Changeset 59


Ignore:
Timestamp:
Aug 4, 2009, 7:47:36 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Zobrazení standarního a chybového výstupu úloh.
Location:
trunk/www
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/index.php

    r57 r59  
    201201        $TaskView = new TaskView($this->Database, $this->System);
    202202        $Output .= $TaskView->ItemList();
     203      } else     
     204      if($_GET['Action'] == 'TaskShowErrorLog')
     205      {
     206        $TaskView = new TaskView($this->Database, $this->System);
     207        $Output .= $TaskView->ErrorLog();
     208      } else     
     209      if($_GET['Action'] == 'TaskShowStandardLog')
     210      {
     211        $TaskView = new TaskView($this->Database, $this->System);
     212        $Output .= $TaskView->StandardLog();
    203213      } else     
    204214      if($_GET['Action'] == 'Update')
  • trunk/www/model/realm.php

    r58 r59  
    8585    }
    8686    // Lookup nearest database with full import
    87     $DbResult = $this->Database->query('SELECT * FROM `Database` WHERE (`Emulator` <> 0) AND (`Revision` <= '.$this->Realm['Database']['Revision'].') AND (`SourceFileName` <> "") ORDER BY `Revision` DESC');
     87    $DbResult = $this->Database->query('SELECT * FROM `Database` WHERE (`Emulator` <> 0) AND (`Revision` <= '.$this->Data['Database']['Revision'].') AND (`SourceFileName` <> "") ORDER BY `Revision` DESC');
    8888    $Database = $DbResult->fetch_assoc();
    8989   
  • trunk/www/view/task.php

    r56 r59  
    1010    'Items' => array(
    1111      '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' => ''),
    1313      'State' => array('Type' => 'TaskState', 'Caption' => 'Stav', 'Default' => ''),
    1414      'Duration' => array('Type' => 'String', 'Caption' => 'Trvání', 'Default' => ''),
     
    3131      $Table = new Table($this->ItemListFormClass);
    3232      $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' => '');
    3435      $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&amp;Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Action=TaskShowStandardLog&amp;Id='.$Item['Id'].'">Výpis výstupu</a> ';
     40        unset($Table->Values[$Index]['Id']);
     41      }
    3542      $Output .= $Table->Show();
    3643      $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>';     
     
    3845    return($Output);
    3946  }
     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  }
    4065}
    4166
Note: See TracChangeset for help on using the changeset viewer.