Changeset 59 for trunk/www/view/task.php
- Timestamp:
- Aug 4, 2009, 7:47:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/view/task.php
r56 r59 10 10 'Items' => array( 11 11 'TimeCreate' => array('Type' => 'DateTime', 'Caption' => 'Čas vytvoření', 'Default' => ''), 12 'Title' => array('Type' => 'String', 'Caption' => ' Akce', 'Default' => ''),12 'Title' => array('Type' => 'String', 'Caption' => 'Operace', 'Default' => ''), 13 13 'State' => array('Type' => 'TaskState', 'Caption' => 'Stav', 'Default' => ''), 14 14 'Duration' => array('Type' => 'String', 'Caption' => 'Trvání', 'Default' => ''), … … 31 31 $Table = new Table($this->ItemListFormClass); 32 32 $Table->OnRow = array($this, 'ShowListOnRow'); 33 $Table->Definition['Table'] = '(SELECT (COALESCE(UNIX_TIMESTAMP(TimeEnd), UNIX_TIMESTAMP(NOW())) - UNIX_TIMESTAMP(TimeStart)) AS Duration, TimeCreate, Title, State FROM Task WHERE User='.$this->System->Modules['User']->User['Id'].' ORDER BY Id DESC)'; 33 $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']->User['Id'].' ORDER BY Id DESC)'; 34 $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => ''); 34 35 $Table->LoadValuesFromDatabase($this->Database); 36 $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => ''); 37 foreach($Table->Values as $Index => $Item) 38 { 39 $Table->Values[$Index]['Actions'] = '<a href="?Action=TaskShowErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Action=TaskShowStandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> '; 40 unset($Table->Values[$Index]['Id']); 41 } 35 42 $Output .= $Table->Show(); 36 43 $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>'; … … 38 45 return($Output); 39 46 } 47 48 function ErrorLog() 49 { 50 $DbResult = $this->Database->select('Task', 'Title, Error', 'Id='.$_GET['Id']); 51 $DbRow = $DbResult->fetch_assoc(); 52 $Output = '<h4>Chybový výpis úlohy: '.$DbRow['Title'].'</h4>'; 53 $Output .= '<pre>'.$DbRow['Error'].'</pre>'; 54 return($Output); 55 } 56 57 function StandardLog() 58 { 59 $DbResult = $this->Database->select('Task', 'Title, Output', 'Id='.$_GET['Id']); 60 $DbRow = $DbResult->fetch_assoc(); 61 $Output = '<h4>Výpis výstupu úlohy: '.$DbRow['Title'].'</h4>'; 62 $Output .= '<pre>'.$DbRow['Output'].'</pre>'; 63 return($Output); 64 } 40 65 } 41 66
Note:
See TracChangeset
for help on using the changeset viewer.