<!--#set global $pane="Scheduling"#-->
<!--#set global $help_uri="Configure+Scheduling-0-7"#-->
<!--#include $webdir + "/_inc_header.tmpl"#-->

<%
import time
t = time.localtime()
hour = t[3]
if hour != 23:
  hour += 1
else:
  hour = 0
%>

<div id="config-components">

  <div id="core-component-group1" class="component-group clearfix">
    <div class="component-group-desc">
      <h3>$T('addSchedule')</h3>
    </div>
    <fieldset class="component-group-list">
    <form action="addSchedule" method="post">
    <input type="hidden" name="session" id="session" value="$session">
      <div class="field-pair">
        <label class="nocheck clearfix" for="hour">
          <span class="component-title">$T('hour').capitalize()/$T('minute').capitalize()</span>
          <select name="hour" id="hour">
          <!--#for $i in range(24)#-->
            <option value="$i" <!--#if hour == i then "selected=1" else ""#-->> $i</option>
          <!--#end for#-->
          </select>&nbsp;:&nbsp;<select name="minute" id="minute">
          <!--#for $i in range(60)#-->
            <option value="$i">$i</option>
          <!--#end for#-->
          </select>
        </label>
      </div>
      <div class="field-pair alt">
        <label class="nocheck clearfix" for="dayofweek">
          <span class="component-title">$T('sch-frequency')</span>
          <select name="dayofweek" id="dayofweek">
            <option value="*" selected>$T('daily')</option>
            <option value="1">$T('monday')</option>
            <option value="2">$T('tuesday')</option>
            <option value="3">$T('wednesday')</option>
            <option value="4">$T('thursday')</option>
            <option value="5">$T('friday')</option>
            <option value="6">$T('saturday')</option>
            <option value="7">$T('sunday')</option>
          </select>
        </label>
      </div>
      <div class="field-pair">
        <label class="nocheck clearfix" for="action">
          <span class="component-title">$T('sch-action')</span>
          <select name="action" id="action">
            <!--#for $action in $actions#-->
              <option value="$action">$actions_lng[$action]
            <!--#end for#-->
          </select>
        </label>
      </div>
      <div class="field-pair alt">
        <label class="nocheck clearfix" for="arguments">
          <span class="component-title">$T('sch-arguments')</span>
          <input type="text" size="20" name="arguments" id="arguments" value=""/>
        </label>
      </div>
      <div class="field-pair">
        <label class="nocheck clearfix" for="matrix_username">
          <span class="component-title">&nbsp;</span>
          <input type="submit" class="juiButton" value="$T('button-addSchedule')"/>
        </label>
      </div>
    </form>
    </fieldset>
  </div><!-- /component-group1 -->

  <div id="core-component-group2" class="component-group clearfix">
    <div class="component-group-desc">
      <h3>$T('currentSchedules')</h3>
    </div>
    <fieldset class="component-group-list">
    <!--#if $schedlines#-->
      <table id="schedulingTable">
      <!--#set $schednum = 0#-->
      <!--#set $odd = False#-->
      <!--#for $line in $schedlines#-->
        <!--#set $odd = not $odd#-->
        <form action="delSchedule" method="post">
          <input type="hidden" name="session" id="session" value="$session">
          <input type="hidden" name="line" id="line" value="$line"/>
          <div class="field-pair<!--#if $odd then "" else " alt"#-->">
            <label class="nocheck clearfix" for="email_dir">
              <span class="component-title"><strong>$taskinfo[$schednum][1]:$taskinfo[$schednum][2]</strong> $taskinfo[$schednum][3] $taskinfo[$schednum][4]</span>
              <input type="submit" class="juiButton" value="$T('button-delSchedule')"/>
            </label>
          </div>
        </form>
        <!--#set $schednum = $schednum+1#-->
      <!--#end for#-->
      </table>
    <!--#else#-->
      <p>$T('none')</p>
    <!--#end if#-->
    </fieldset>
  </div><!-- /component-group2 -->

</div>

<!--#include $webdir + "/_inc_footer.tmpl"#-->
