Dotclear


Ignore:
Timestamp:
09/18/13 10:51:42 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Message:

Revamp plugin maintenance, step 2, add task reminder, addresses #999

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/maintenance/index.php

    r1925 r1940  
    2323$p_url = 'plugin.php?p=maintenance'; 
    2424$task = null; 
     25$expired = array(); 
    2526 
    2627$code = empty($_POST['code']) ? null : (integer) $_POST['code']; 
     
    4849          } 
    4950          if (true === $code) { 
     51               $maintenance->setLog($task->id()); 
    5052               http::redirect($p_url.'&task='.$task->id().'&done=1&tab='.$tab); 
    5153          } 
     
    5456          $core->error->add($e->getMessage()); 
    5557     } 
     58} 
     59 
     60// Get expired tasks 
     61$user_options = $core->auth->getOptions(); 
     62if (!empty($user_options['user_maintenance_expired'])) { 
     63     $expired = $maintenance->getExpired(); 
    5664} 
    5765 
     
    144152 
    145153               $res .=   
    146                '<p>'.form::radio(array('task', $t->id()),$t->id()).' '. 
     154               '<p>'.form::radio(array('task', $t->id()), $t->id()).' '. 
    147155               '<label class="classic" for="'.$t->id().'">'. 
    148                html::escapeHTML($t->task()).'</label></p>'; 
     156               html::escapeHTML($t->task()).'</label>'; 
     157 
     158               if (array_key_exists($t->id(), $expired)) { 
     159                    $res .=  
     160                    ' <span class="clear form-note warn">'.sprintf( 
     161                         __('Last execution of this task was on %s. You should execute it again.'), 
     162                         dt::dt2str(__('%Y-%m-%d %H:%M'), $expired[$t->id()]) 
     163                    ).'</span>'; 
     164               } 
     165 
     166               $res .= '</p>'; 
    149167          } 
    150168 
Note: See TracChangeset for help on using the changeset viewer.

Sites map