summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorDavid-Norris <Dave@Rachels-MacBook-Pro.local>2015-05-03 00:12:28 -0400
committerDavid-Norris <Dave@Rachels-MacBook-Pro.local>2015-05-03 00:12:28 -0400
commita314bbb489eff2d419481ad001805ce13edb5352 (patch)
tree43961ee5b42857f905eb8042af5090d0a4413221 /app/Template
parentfa5aaa60934223f74c9b9c32e7599f53c72a81fd (diff)
Initial Recurring Tasks Commit
Initial Recurring Tasks Commit No Locales Updated.
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/recurrence.php18
-rw-r--r--app/Template/board/task_footer.php8
-rw-r--r--app/Template/board/task_menu.php3
-rw-r--r--app/Template/task/details.php39
-rw-r--r--app/Template/task/edit_recurrence.php85
-rw-r--r--app/Template/task/show.php2
-rw-r--r--app/Template/task/sidebar.php5
7 files changed, 157 insertions, 3 deletions
diff --git a/app/Template/board/recurrence.php b/app/Template/board/recurrence.php
new file mode 100644
index 00000000..1b71bc34
--- /dev/null
+++ b/app/Template/board/recurrence.php
@@ -0,0 +1,18 @@
+<section class="tooltip-large">
+<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PENDING): ?>
+ <?= t('Recurrent task is scheduled to generate') ?><br/>
+<?php endif ?>
+<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
+ <?= t('Recurrent task has been generated') ?><br/>
+<?php endif ?>
+ <?= t('Trigger to generate recurrent task: %s', $recurrence_trigger_list[$task['recurrence_trigger']]) ?><br/>
+ <?= t('Factor to calculate new due date: %s', $task['recurrence_factor']) ?><br/>
+ <?= t('Timeframe to calculate new due date: %s', $recurrence_timeframe_list[$task['recurrence_timeframe']]) ?><br/>
+ <?= t('Base date to calculate new due date: %s', $recurrence_basedate_list[$task['recurrence_basedate']]) ?><br/>
+<?php if ($task['recurrence_parent']): ?>
+ <?= t('Recurrent task created by: %s', $task['recurrence_parent']) ?><br/>
+<?php endif ?>
+<?php if ($task['recurrence_child']): ?>
+ <?= t('Created recurrent task: %s', $task['recurrence_child']) ?><br/>
+<?php endif ?>
+</section>
diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php
index 36ed2684..b8868f52 100644
--- a/app/Template/board/task_footer.php
+++ b/app/Template/board/task_footer.php
@@ -25,6 +25,14 @@
</span>
<?php endif ?>
+ <?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PENDING): ?>
+ <span title="<?= t('Recurrence') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-refresh fa-rotate-90"></i></span>
+ <?php endif ?>
+
+ <?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
+ <span title="<?= t('Recurrence') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-refresh fa-rotate-90 fa-inverse"></i></span>
+ <?php endif ?>
+
<?php if (! empty($task['nb_links'])): ?>
<span title="<?= t('Links') ?>" class="task-board-tooltip" data-href="<?= $this->u('board', 'tasklinks', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"><i class="fa fa-code-fork"></i>&nbsp;<?= $task['nb_links'] ?></span>
<?php endif ?>
diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php
index f3ec3019..fba2d71d 100644
--- a/app/Template/board/task_menu.php
+++ b/app/Template/board/task_menu.php
@@ -5,6 +5,7 @@
<li><i class="fa fa-user"></i> <?= $this->a(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-tag"></i> <?= $this->a(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-align-left"></i> <?= $this->a(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
+ <li><i class="fa fa-refresh fa-rotate-90"></i> <?= $this->a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-comment-o"></i> <?= $this->a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-code-fork"></i> <?= $this->a(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-pencil-square-o"></i> <?= $this->a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
@@ -12,4 +13,4 @@
<li><i class="fa fa-close"></i> <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?></li>
</ul>
</span>
-</span> \ No newline at end of file
+</span>
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index 76241acf..331862b9 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -80,5 +80,44 @@
<?= $this->a(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
</li>
<?php endif ?>
+ <?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_NONE): ?>
+ <li>
+ <?= t('No recurrent task is scheduled to generate') ?>
+ </li>
+ <?php endif ?>
+ <?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_NONE): ?>
+ <li>
+ <?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PENDING): ?>
+ <?= t('Recurrent task is scheduled to generate') ?>
+ <?php endif ?>
+ <?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
+ <?= t('Recurrent task has been generated') ?>
+ <?php endif ?>
+ <ul>
+ <li>
+ <?= t('Trigger to generate recurrent task: %s', $recurrence_trigger_list[$task['recurrence_trigger']]) ?></stong>
+ </li>
+ <li>
+ <?= t('Factor to calculate new due date: %s', $task['recurrence_factor']) ?></stong>
+ </li>
+ <li>
+ <?= t('Timeframe to calculate new due date: %s', $recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></stong>
+ </li>
+ <li>
+ <?= t('Base date to calculate new due date: %s', $recurrence_basedate_list[$task['recurrence_basedate']]) ?></stong>
+ </li>
+ </ul>
+ </li>
+ <?php endif ?>
+ <?php if ($task['recurrence_parent']): ?>
+ <li>
+ <?= t('Recurrent task created by: %s', $task['recurrence_parent']) ?>
+ </li>
+ <?php endif ?>
+ <?php if ($task['recurrence_child']): ?>
+ <li>
+ <?= t('Created recurrent task: %s', $task['recurrence_child']) ?>
+ </li>
+ <?php endif ?>
</ul>
</div>
diff --git a/app/Template/task/edit_recurrence.php b/app/Template/task/edit_recurrence.php
new file mode 100644
index 00000000..bb86e429
--- /dev/null
+++ b/app/Template/task/edit_recurrence.php
@@ -0,0 +1,85 @@
+<div class="page-header">
+ <h2><?= t('Edit recurrence') ?></h2>
+</div>
+<section id="task-section">
+
+
+
+<form method="post" action="<?= $this->u('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
+
+ <?= $this->formCsrf() ?>
+
+
+ <div class="form-column">
+ <?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
+ <ul>
+ <li><?= t('Recurrent task has been generated') ?>
+ <ul>
+ <li>
+ <?= t('Trigger to generate recurrent task: %s', $recurrence_trigger_list[$task['recurrence_trigger']]) ?></stong>
+ </li>
+ <li>
+ <?= t('Factor to calculate new due date: %s', $task['recurrence_factor']) ?></stong>
+ </li>
+ <li>
+ <?= t('Timeframe to calculate new due date: %s', $recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></stong>
+ </li>
+ <li>
+ <?= t('Base date to calculate new due date: %s', $recurrence_basedate_list[$task['recurrence_basedate']]) ?></stong>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <?php endif ?>
+ <?php if ($task['recurrence_parent'] || $task['recurrence_child']): ?>
+ <ul>
+ <?php if ($task['recurrence_parent']): ?>
+ <li>
+ <?= t('Recurrent task created by: %s', $task['recurrence_parent']) ?>
+ </li>
+ <?php endif ?>
+ <?php if ($task['recurrence_child']): ?>
+ <li>
+ <?= t('Created recurrent task: %s', $task['recurrence_child']) ?>
+ </li>
+ <?php endif ?>
+ </ul>
+ <?php endif ?>
+
+ <?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_PROCESSED): ?>
+
+ <?= $this->formHidden('id', $values) ?>
+ <?= $this->formHidden('project_id', $values) ?>
+
+ <?= $this->formLabel(t('Generate recurrent task'), 'recurrence_status') ?>
+ <?= $this->formSelect('recurrence_status', $recurrence_status_list, $values, $errors) ?> </br>
+
+ <?= $this->formLabel(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?>
+ <?= $this->formSelect('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> </br>
+
+ <?= $this->formLabel(t('Factor to calculate new due date'), 'recurrence_factor') ?>
+ <?= $this->formNumber('recurrence_factor', $values, $errors) ?> </br>
+
+ <?= $this->formLabel(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?>
+ <?= $this->formSelect('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> </br>
+
+ <?= $this->formLabel(t('Base date to calculate new due date'), 'recurrence_basedate') ?>
+ <?= $this->formSelect('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> </br>
+
+ <?php endif ?>
+
+ </div>
+
+ <div class="form-actions">
+ <?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_PROCESSED): ?>
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?php endif ?>
+ <?php if ($ajax): ?>
+ <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
+ <?php else: ?>
+ <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?php endif ?>
+ </div>
+</form>
+</section>
diff --git a/app/Template/task/show.php b/app/Template/task/show.php
index 50316c9f..9d16ab74 100644
--- a/app/Template/task/show.php
+++ b/app/Template/task/show.php
@@ -1,4 +1,4 @@
-<?= $this->render('task/details', array('task' => $task, 'project' => $project)) ?>
+<?= $this->render('task/details', array('task' => $task, 'project' => $project, 'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(), 'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(), 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList())) ?>
<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?>
<?= $this->render('task/show_description', array('task' => $task)) ?>
<?= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?>
diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php
index a740e939..7c82700a 100644
--- a/app/Template/task/sidebar.php
+++ b/app/Template/task/sidebar.php
@@ -25,6 +25,9 @@
<?= $this->a(t('Edit the description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
+ <?= $this->a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ </li>
+ <li>
<?= $this->a(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
@@ -61,4 +64,4 @@
</li>
<?php endif ?>
</ul>
-</div> \ No newline at end of file
+</div>