diff options
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Authentication.php | 5 | ||||
-rw-r--r-- | app/Model/TaskFilter.php | 38 |
2 files changed, 33 insertions, 10 deletions
diff --git a/app/Model/Authentication.php b/app/Model/Authentication.php index 86c1c43f..31969b57 100644 --- a/app/Model/Authentication.php +++ b/app/Model/Authentication.php @@ -49,11 +49,6 @@ class Authentication extends Base return false; } - // We update each time the RememberMe cookie tokens - if ($this->backend('rememberMe')->hasCookie()) { - $this->backend('rememberMe')->refresh(); - } - return true; } diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index e9d9ccbd..082318f1 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -68,6 +68,9 @@ class TaskFilter extends Base case 'T_COLUMN': $this->filterByColumnName($value); break; + case 'T_REFERENCE': + $this->filterByReference($value); + break; } } @@ -141,6 +144,22 @@ class TaskFilter extends Base } /** + * Filter by reference + * + * @access public + * @param string $reference + * @return TaskFilter + */ + public function filterByReference($reference) + { + if (! empty($reference)) { + $this->query->eq(Task::TABLE.'.reference', $reference); + } + + return $this; + } + + /** * Filter by title * * @access public @@ -154,7 +173,7 @@ class TaskFilter extends Base } /** - * Filter by title + * Filter by title or id if the string is like #123 or an integer * * @access public * @param string $title @@ -162,7 +181,16 @@ class TaskFilter extends Base */ public function filterByTitle($title) { - $this->query->ilike(Task::TABLE.'.title', '%'.$title.'%'); + if (strlen($title) > 1 && $title{0} === '#' && ctype_digit(substr($title, 1))) { + $this->query->eq(Task::TABLE.'.id', substr($title, 1)); + } + else if (ctype_digit($title)) { + $this->query->eq(Task::TABLE.'.id', $title); + } + else { + $this->query->ilike(Task::TABLE.'.title', '%'.$title.'%'); + } + return $this; } @@ -688,11 +716,11 @@ class TaskFilter extends Base $vEvent->setSummary(t('#%d', $task['id']).' '.$task['title']); $vEvent->setUrl($this->helper->url->base().$this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))); - if (! empty($task['creator_id'])) { - $vEvent->setOrganizer('MAILTO:'.($task['creator_email'] ?: $task['creator_username'].'@kanboard.local')); + if (! empty($task['owner_id'])) { + $vEvent->setOrganizer('MAILTO:'.($task['assignee_email'] ?: $task['assignee_username'].'@kanboard.local')); } - if (! empty($task['owner_id'])) { + if (! empty($task['creator_id'])) { $attendees = new Attendees; $attendees->add('MAILTO:'.($task['creator_email'] ?: $task['creator_username'].'@kanboard.local')); $vEvent->setAttendees($attendees); |