summaryrefslogtreecommitdiff
path: root/app/Controller
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/Controller
parentfa5aaa60934223f74c9b9c32e7599f53c72a81fd (diff)
Initial Recurring Tasks Commit
Initial Recurring Tasks Commit No Locales Updated.
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Board.php17
-rw-r--r--app/Controller/Task.php60
2 files changed, 77 insertions, 0 deletions
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index d9243633..94a57e84 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -350,4 +350,21 @@ class Board extends Base
'redirect' => 'board',
)));
}
+
+ /**
+ * Get recurrence information on mouseover
+ *
+ * @access public
+ */
+ public function recurrence()
+ {
+ $task = $this->getTask();
+
+ $this->response->html($this->template->render('board/recurrence', array(
+ 'task' => $task,
+ 'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
+ 'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
+ 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
+ )));
+ }
}
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index 5bca4510..2f590695 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -81,6 +81,9 @@ class Task extends Base
'date_format' => $this->config->get('application_date_format'),
'date_formats' => $this->dateParser->getAvailableFormats(),
'title' => $task['project_name'].' &gt; '.$task['title'],
+ 'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
+ 'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
+ 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
)));
}
@@ -444,6 +447,63 @@ class Task extends Base
}
/**
+ * Edit recurrence form
+ *
+ * @access public
+ */
+ public function recurrence()
+ {
+ $task = $this->getTask();
+ $ajax = $this->request->isAjax() || $this->request->getIntegerParam('ajax');
+
+ if ($this->request->isPost()) {
+
+ $values = $this->request->getValues();
+
+ list($valid, $errors) = $this->taskValidator->validateEditRecurrence($values);
+
+ if ($valid) {
+
+ if ($this->taskModification->update($values)) {
+ $this->session->flash(t('Task updated successfully.'));
+ }
+ else {
+ $this->session->flashError(t('Unable to update your task.'));
+ }
+
+ if ($ajax) {
+ $this->response->redirect('?controller=board&action=show&project_id='.$task['project_id']);
+ }
+ else {
+ $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id']);
+ }
+ }
+ }
+ else {
+ $values = $task;
+ $errors = array();
+ }
+
+ $params = array(
+ 'values' => $values,
+ 'errors' => $errors,
+ 'task' => $task,
+ 'ajax' => $ajax,
+ 'recurrence_status_list' => $this->task->getRecurrenceStatusList(),
+ 'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
+ 'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
+ 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
+ );
+
+ if ($ajax) {
+ $this->response->html($this->template->render('task/edit_recurrence', $params));
+ }
+ else {
+ $this->response->html($this->taskLayout('task/edit_recurrence', $params));
+ }
+ }
+
+ /**
* Move a task to another project
*
* @access public