{* $Id$ *}
{title help="Scheduler" admpage="general" url="tiki-admin_schedulers.php"}{tr}Scheduler{/tr}{/title}
{if isset($schedulerinfo.id)}
{button href="?add=1" class="btn btn-primary" _text="{tr}Add a new Scheduler{/tr}"}
{/if}
{tabset name='tabs_admin_schedulers'}
{* ---------------------- tab with list -------------------- *}
{if $schedulers|count > 0}
{tab name="{tr}Schedulers{/tr}"}
{* Use css menus as fallback for item dropdown action menu if javascript is not being used *}
{/tab}
{/if}
{* ---------------------- tab with form -------------------- *}
{if isset($schedulerinfo.id) && $schedulerinfo.id}
{$add_edit_scheduler_tablabel = "{tr}Edit scheduler{/tr}"}
{$schedulename = "{$schedulerinfo.name|escape}"}
{else}
{$add_edit_scheduler_tablabel = "{tr}Add a new scheduler{/tr}"}
{$schedulename = ""}
{/if}
{tab name="{$add_edit_scheduler_tablabel} {$schedulename}"}
{remarksbox type="note" title="{tr}Information{/tr}"}
{tr}Use CRON format to enter the values in "Run Time":
Minute, Hour, Day of Month, Month, Day of Week
Eg. every 5 minutes: */5 * * * *{/tr}
{/remarksbox}
{/tab}
{if isset($schedulerinfo.id) && $schedulerinfo.id}
{tab name="{tr}Scheduler logs{/tr}"}
{tr}Scheduler{/tr} {$schedulerinfo.name|escape} Logs
{tr}Last {$numOfLogs} Logs{/tr}
| ID |
Start Time |
End Time |
Status |
Output |
{section name=run loop=$schedulerruns}
| {$schedulerruns[run].id} |
{$schedulerruns[run].start_time|tiki_short_datetime} |
{if $schedulerruns[run].end_time ne null}{$schedulerruns[run].end_time|tiki_short_datetime}{/if} |
{if $schedulerruns[run].status eq 'running'}
{tr}Running{/tr}
{/if}
{if $schedulerruns[run].status eq 'failed'}
{tr}Failed{/tr}
{/if}
{if $schedulerruns[run].status eq 'done'}
{tr}Done{/tr}
{/if}
|
{if $schedulerruns[run].can_stop}
{icon name="undo" _menu_text='y' _menu_icon='y' alt="{tr}Reset{/tr}"}
{else}
{$schedulerruns[run].output|nl2br}
{/if}
|
{/section}
{pagination_links cant=$cant step=$numrows offset=$offset}tiki-admin_schedulers.php?scheduler={$schedulerinfo.id}&cookietab=3{/pagination_links}
{/tab}
{/if}
{if $jobs|count > 0}
{tab name="{tr}Jobs{/tr}"}
{remarksbox type="note" title="{tr}Information{/tr}"}
{tr}This page lists all scheduled background jobs along with their processing status. You can re-run a job or see a log of the job executions. Note that Tiki Scheduler must be executed periodically by a cron job in order to execute the background jobs. If you see a job in Active status below for too long interval, then your cron job is most probably not running. {/tr}
{/remarksbox}
{* Use css menus as fallback for item dropdown action menu if javascript is not being used *}
{/tab}
{/if}
{/tabset}
{jq}
var selectedSchedulerTask = $('select[name="scheduler_task"]').val();
$('div [data-task-name="'+selectedSchedulerTask+'"]').show();
$('#console_doc').hide();
$('select[name="scheduler_task"]').on('change', function() {
var taskName = this.value;
$('div [data-task-name]:not([data-task-name="'+taskName+'"])').hide();
$('div [data-task-name="'+taskName+'"]').show();
if (taskName == "ConsoleCommandTask") {
$('#console_doc').show();
} else {
$('#console_doc').hide();
}
});
$('form[name="RegForm"]').validate({
rules: {
scheduler_time: {
validate_cron_runtime: true
}
}
});
{/jq}