Source for file _cronjob_list.view.php
Documentation is available at _cronjob_list.view.php
* This file implements the UI view for the general settings.
* This file is part of Quam Plures - {@link http://quamplures.net/}
* See also {@link https://launchpad.net/quam-plures}.
* @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
* {@internal License choice
* - If you have received this file as part of a package, please find the license.txt file in
* the same folder or the closest folder above for complete license terms.
* - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
* then you must choose one of the following licenses before using the file:
* - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
* - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
* {@internal Open Source relicensing agreement:
if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $ctst_pending, $ctst_started, $ctst_timeout, $ctst_error, $ctst_finished;
if( !$ctst_pending && !$ctst_started && !$ctst_timeout && !$ctst_error && !$ctst_finished )
{ // Set default status filters:
$SQL->SELECT( 'ctsk_ID, ctsk_start_datetime, ctsk_name, ctsk_repeat_after, IFNULL( clog_status, "pending" ) as status' );
$SQL->FROM( 'T_cron__task LEFT JOIN T_cron__log ON ctsk_ID = clog_ctsk_ID' );
$SQL->WHERE_or( 'clog_status IS NULL' );
$SQL->WHERE_or( 'clog_status = "started"' );
$SQL->WHERE_or( 'clog_status = "timeout"' );
$SQL->WHERE_or( 'clog_status = "error"' );
$SQL->WHERE_or( 'clog_status = "finished"' );
$SQL->ORDER_BY( '*, ctsk_ID' );
$Results = new Results( $SQL->get(), 'crontab_', '-A' );
if( $current_User->check_perm( 'options', 'edit', false, NULL ) )
{ // Permission to edit settings:
$Results->global_icon( T_('Create a new scheduled job...'), 'new', regenerate_url( 'action,cjob_ID', 'action=new' ), T_('New job'). ' »', 3, 4 );
* Callback to add filters on top of the result set
global $ctst_pending, $ctst_started, $ctst_timeout, $ctst_error, $ctst_finished;
$Form->checkbox( 'ctst_pending', $ctst_pending, T_('Pending') );
$Form->checkbox( 'ctst_started', $ctst_started, T_('Started') );
$Form->checkbox( 'ctst_timeout', $ctst_timeout, T_('Timed out') );
$Form->checkbox( 'ctst_error', $ctst_error, T_('Error') );
$Form->checkbox( 'ctst_finished', $ctst_finished, T_('Finished') );
$Results->filter_area = array(
'callback' => 'filter_crontab',
'url_ignore' => 'results_crontab_page,ctst_pending,ctst_started,ctst_timeout,ctst_error,ctst_finished', // ignor epage param and checkboxes
'schedule' => array( T_('Schedule'), '?ctrl=crontab&ctst_pending=1&ctst_started=1&ctst_timeout=1&ctst_error=1' ),
'attention' => array( T_('Attention'), '?ctrl=crontab&ctst_timeout=1&ctst_error=1' ),
'all' => array( T_('All'), '?ctrl=crontab&ctst_pending=1&ctst_started=1&ctst_timeout=1&ctst_error=1&ctst_finished=1' ),
$Results->cols[] = array(
'th_class' => 'shrinkwrap',
'td_class' => 'shrinkwrap',
$Results->cols[] = array(
'th' => T_('Planned at'),
'order' => 'ctsk_start_datetime',
'td_class' => 'shrinkwrap',
'td' => '$ctsk_start_datetime$',
$Results->cols[] = array(
'td' => '<a href="%regenerate_url(\'action,cjob_ID\',\'action=view&cjob_ID=$ctsk_ID$\')%">$ctsk_name$</a>',
$Results->cols[] = array(
'td_class' => 'shrinkwrap cron_$status$',
$Results->cols[] = array(
'order' => 'ctsk_repeat_after',
'td_class' => 'shrinkwrap',
'td' => '$ctsk_repeat_after$',
if( $status != 'started' && $current_User->check_perm( 'options', 'edit', false, NULL ) )
{ // User can edit options:
$Results->cols[] = array(
'td_class' => 'shrinkwrap',
'td' => '%crontab_actions( #ctsk_ID#, #status# )%',
echo '<p>[<a href="'. $srvc_url. 'cron_exec.php" onclick="return pop_up_window( \''. $srvc_url. 'cron_exec.php\', \'evo_cron\' )" target="evo_cron">'. T_('Execute pending jobs in a popup window now!'). '</a>]</p>';
|