Changeset 78 for trunk/www/Application/View/Task.php
- Timestamp:
- Sep 11, 2009, 8:18:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/View/Task.php
r72 r78 1 1 <?php 2 2 3 class TaskView extends Module 3 include_once(dirname(__FILE__).'/../../Base/View.php'); 4 5 class TaskView extends View 4 6 { 5 7 var $ItemListFormClass = array( … … 26 28 global $Config; 27 29 28 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 30 $Output = '<h4>Fronta úloh</h4>'; 31 $Table = new Table($this->ItemListFormClass); 32 $Table->OnRow = array($this, 'ShowListOnRow'); 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' => ''); 35 $Table->LoadValuesFromDatabase($this->Database); 36 $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => ''); 37 foreach($Table->Values as $Index => $Item) 29 38 { 30 $Output = '<h4>Fronta úloh</h4>'; 31 $Table = new Table($this->ItemListFormClass); 32 $Table->OnRow = array($this, 'ShowListOnRow'); 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' => ''); 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="?Module=Task&Action=ErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&Action=StandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> '; 40 unset($Table->Values[$Index]['Id']); 41 } 42 $Output .= $Table->Show(); 43 $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>'; 44 } else $Output = USER_BAD_ROLE; 39 $Table->Values[$Index]['Actions'] = '<a href="?Module=Task&Action=ErrorLog&Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&Action=StandardLog&Id='.$Item['Id'].'">Výpis výstupu</a> '; 40 unset($Table->Values[$Index]['Id']); 41 } 42 $Output .= $Table->Show(); 43 $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>'; 45 44 return($Output); 46 45 }
Note:
See TracChangeset
for help on using the changeset viewer.