
<span class="descriptiveText">{i18n}The scheduler runs background tasks.{/i18n}</span>
{if $lasttime}
    <span class="descriptiveText">{i18n  arg_time=$lasttime}The last time these tasks were performed was on #time#.{/i18n}</span>
{else}
    <span class="descriptiveText">{i18n}No tasks have been run yet.{/i18n}</span>
{/if}
&nbsp;<span><a href="{$sAdmin}">Administration page</a></span>

<p>
{if !$lasttime}
{if $isDue}
    <span class="">{i18n  arg_time=$timedif}The tasks were scheduled to be run #time# ago.{/i18n}</span>
{else}
    <span class="">{i18n  arg_time=$timedif}The tasks are scheduled to be run in #time#.{/i18n}</span>
{/if}
{/if}
</p>


{if $bWin}
    <p>
    {i18n}Note: The stack install uses its own service for task scheduling and the following is only for source installs.<br>{/i18n}
    {i18n}To view the list of scheduled tasks, open the Control Panel and go to Scheduled Tasks. For further information on how to add or update a task, please refer to the documentation.{/i18n}
    </p>
    <p>
    <strong><span onclick="{$onClick}">
        <img id="scheduler_icon" src="{$sImg}"/>
        {i18n}Brief Guide to Scheduled Tasks:{/i18n}</span></strong>
    <div id="cronguide" style="display: none; visibility: hidden;">
    {i18n}If the scheduler is not in the list of jobs then add it by clicking on "Add Scheduled Task" or by right-clicking and selecting New->Scheduled Task. If the scheduler exists then right-click on it and select Properties.{/i18n}
    <br /><br />Set the following:
        <ul>
        <li>{i18n}Task to run = path/to/knowledgetree/bin/scheduler.php{/i18n}</li>
        <li>{i18n}Frequency = Daily at midnight{/i18n}</li>
        <li>{i18n}Under advanced, set it to repeat every 5 minutes{/i18n}</li>
        </ul>
    </div>
    </p>

{else}
    <p>
    {i18n}Note: The stack install uses its own service for task scheduling and the following is only for source installs.{/i18n}<br>
    {i18n}Please ensure that the scheduler is listed in your cron jobs. The line to be added to the crontab to implement the cron job is: {/i18n}
    <ul><li>*/5 * * * * {$sPath} > /dev/null</li></ul>
    </p>

    <p>
    <strong><span onclick="{$onClick}">
        <img id="scheduler_icon" src="{$sImg}"/>
        {i18n}Guide to using cron:{/i18n}</span></strong>
    <div id="cronguide" style="display: none; visibility: hidden;">
    <ul>
        <li>{i18n}View jobs in the crontab:{/i18n} crontab -l</li>
        <li>{i18n}Edit the crontab:{/i18n} crontab -e
        <ol><li>{i18n}Press 'o' to start a new line.{/i18n}</li>
            <li>{i18n}Press 'i' to edit a line.{/i18n}</li>
            <li>{i18n}Press the 'esc' key to exit the edit mode.{/i18n}</li>
            <li>{i18n}Type ZZ to save changes and exit.{/i18n}</li>
            <li>{i18n}Type :q! to exit without saving.{/i18n}</li>
        </ol>
    </ul>
    </div>
    </p>

{/if}
