'Seznam úloh',
'Table' => 'Task',
'DefaultOrderColumn' => 'TimeCreate',
'DefaultOrderDirection' => 1,
'Items' => array(
'TimeCreate' => array('Type' => 'DateTime', 'Caption' => 'Čas vytvoření', 'Default' => ''),
'Title' => array('Type' => 'String', 'Caption' => 'Operace', 'Default' => ''),
'State' => array('Type' => 'TaskState', 'Caption' => 'Stav', 'Default' => ''),
'Duration' => array('Type' => 'String', 'Caption' => 'Trvání', 'Default' => ''),
),
);
function ShowListOnRow($Row)
{
$Row['Duration'] = $this->System->AddPrefixMultipliers($Row['Duration'], '', 4, 'Time');
return($Row);
}
function ItemList()
{
$Output = '
Fronta úloh
';
$Table = new Table($this->ItemListFormClass, $this->System);
$Table->OnRow = array($this, 'ShowListOnRow');
$Table->Definition['Table'] = '(SELECT Id, (COALESCE(UNIX_TIMESTAMP(TimeEnd), UNIX_TIMESTAMP(NOW())) - UNIX_TIMESTAMP(TimeStart)) AS Duration, TimeCreate, Title, State FROM Task WHERE User='.
$this->System->Modules['User']->Data['Id'].' ORDER BY Id DESC)';
$Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => '');
$Table->LoadValuesFromDatabase($this->Database);
$Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
foreach($Table->Values as $Index => $Item)
{
$Table->Values[$Index]['Actions'] = 'Výpis chyb Výpis výstupu ';
unset($Table->Values[$Index]['Id']);
}
$Output .= $Table->Show();
$Output .= '
Obnovit pohled';
return($Output);
}
function ErrorLog()
{
$DbResult = $this->Database->select('Task', 'Title, Error, State', 'Id='.$_GET['Id']);
$DbRow = $DbResult->fetch_assoc();
$Output = '
Chybový výpis úlohy: '.$DbRow['Title'].'
';
if($DbRow['State'] == 1) $Output .= '
'.file_get_contents('../temp/wowhosting_script.sh.err').'
';
else $Output .= '
'.$DbRow['Error'].'
';
return($Output);
}
function StandardLog()
{
$DbResult = $this->Database->select('Task', 'Title, Output, State', 'Id='.$_GET['Id']);
$DbRow = $DbResult->fetch_assoc();
$Output = '
Výpis výstupu úlohy: '.$DbRow['Title'].'
';
if($DbRow['State'] == 1) $Output .= '
'.file_get_contents('../temp/wowhosting_script.sh.log').'
';
$Output .= '
'.$DbRow['Output'].'
';
return($Output);
}
}