1<?php if (!$task_details['is_closed']): ?>
2  <div id="remind" class="tab">
3
4  <form method="post" action="{CreateUrl('details', $task_details['task_id'])}#remind" >
5    <?php if (count($reminders)): ?>
6    <table id="reminders" class="userlist">
7    <tr>
8      <th>
9        <a class="toggle_selected" href="javascript:ToggleSelected('reminders')">
10          <!--<img title="{L('toggleselected')}" alt="{L('toggleselected')}" src="{$this->get_image('kaboodleloop')}" width="16" height="16" />-->
11        </a>
12      </th>
13      <th>{L('user')}</th>
14      <th>{L('startat')}</th>
15      <th>{L('frequency')}</th>
16      <th>{L('message')}</th>
17    </tr>
18
19    <?php foreach ($reminders as $row): ?>
20    <tr>
21      <td class="ttcolumn">
22        <input type="checkbox" name="reminder_id[]" {!tpl_disableif(!$user->can_edit_task($task_details))} value="{$row['reminder_id']}" />
23      </td>
24     <td>{!tpl_userlink($row['user_id'])}</td>
25     <td>{formatDate($row['start_time'])}</td>
26     <?php
27      // Work out the unit of time to display
28      if ($row['how_often'] < 86400) {
29          $how_often = $row['how_often'] / 3600 . ' ' . L('hours');
30      } elseif ($row['how_often'] < 604800) {
31          $how_often = $row['how_often'] / 86400 . ' ' . L('days');
32      } else {
33          $how_often = $row['how_often'] / 604800 . ' ' . L('weeks');
34      }
35     ?>
36     <td>{$how_often}</td>
37     <td>{!TextFormatter::render($row['reminder_message'], true)}</td>
38  </tr>
39    <?php endforeach; ?>
40    <tr><td colspan="4">
41      <input type="hidden" name="action" value="deletereminder" />
42      <input type="hidden" name="task_id" value="{$task_details['task_id']}" />
43      <button type="submit">{L('remove')}</button></td></tr>
44  </table>
45  <?php endif; ?>
46  </form>
47
48  <fieldset><legend>{L('addreminder')}</legend>
49  <form action="{CreateUrl('details', $task_details['task_id'])}#remind" method="post" id="formaddreminder">
50    <div>
51      <input type="hidden" name="action" value="details.addreminder" />
52      <input type="hidden" name="task_id" value="{$task_details['task_id']}" />
53
54        <label class="default multisel" for="to_user_id">{L('remindthisuser')}</label>
55        {!tpl_userselect('to_user_id', Req::val('to_user_id'), 'to_user_id')}
56      <br />
57
58      <label for="timeamount1">{L('thisoften')}</label>
59      <input class="text" type="text" value="{Req::val('timeamount1')}" id="timeamount1" name="timeamount1" size="3" maxlength="3" />
60      <select class="adminlist" name="timetype1">
61        {!tpl_options(array(3600 => L('hours'), 86400 => L('days'), 604800 => L('weeks')), Req::val('timetype1'))}
62      </select>
63
64      <br />
65
66      {!tpl_datepicker('timeamount2', L('startat'), Req::val('timeamount2', formatDate(time())))}
67
68      <br />
69      <textarea class="text" name="reminder_message"
70        rows="10" cols="72">{Req::val('reminder_message', L('defaultreminder') . "\n\n" . CreateURL('details', $task_details['task_id']))}</textarea>
71      <br />
72      <button type="submit">{L('addreminder')}</button>
73    </div>
74  </form>
75  </fieldset>
76</div>
77<?php endif; ?>
78