From bc6b443c3db4f260bdc1460009c8110b54b3c257 Mon Sep 17 00:00:00 2001 From: Ash Bike Date: Sun, 5 Jul 2015 02:16:18 +0530 Subject: Slack channel can be overridden to post to another channel/private group or send direct messages. Need to make these database changes: INSERT INTO settings VALUES ('integration_slack_webhook_channel', ''); ALTER TABLE project_integrations ADD COLUMN slack_webhook_channel text; --- app/Template/project/integrations.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/Template/project') diff --git a/app/Template/project/integrations.php b/app/Template/project/integrations.php index 698e438c..445e7bfb 100644 --- a/app/Template/project/integrations.php +++ b/app/Template/project/integrations.php @@ -85,6 +85,8 @@ form->label(t('Webhook URL'), 'slack_webhook_url') ?> form->text('slack_webhook_url', $values, $errors) ?> + form->label(t('Channel/Group/User (Optional)'), 'slack_webhook_channel') ?> + form->text('slack_webhook_channel', $values, $errors) ?>

-- cgit v1.2.3 From 2f8beda6af9a3f360379ed689c2eb81833e23039 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 7 Jul 2015 20:19:57 -0400 Subject: Move board collapse/expand mode to server side to avoid board flickering --- app/Controller/Board.php | 24 ++++++++++ app/Helper/Board.php | 24 ++++++++++ app/Model/UserSession.php | 24 ++++++++++ app/Template/board/task_private.php | 88 +++++++++++++++++++------------------ app/Template/layout.php | 2 +- app/Template/project/filters.php | 13 +++--- assets/js/app.js | 15 +++---- assets/js/src/board.js | 73 +----------------------------- 8 files changed, 133 insertions(+), 130 deletions(-) create mode 100644 app/Helper/Board.php (limited to 'app/Template/project') diff --git a/app/Controller/Board.php b/app/Controller/Board.php index caaa38ef..ac80a192 100644 --- a/app/Controller/Board.php +++ b/app/Controller/Board.php @@ -310,4 +310,28 @@ class Board extends Base 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(), ))); } + + /** + * Enable collapsed mode + * + * @access public + */ + public function collapse() + { + $project_id = $this->request->getIntegerParam('project_id'); + $this->userSession->setBoardDisplayMode($project_id, true); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project_id))); + } + + /** + * Enable expanded mode + * + * @access public + */ + public function expand() + { + $project_id = $this->request->getIntegerParam('project_id'); + $this->userSession->setBoardDisplayMode($project_id, false); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project_id))); + } } diff --git a/app/Helper/Board.php b/app/Helper/Board.php new file mode 100644 index 00000000..452a3b70 --- /dev/null +++ b/app/Helper/Board.php @@ -0,0 +1,24 @@ +userSession->isBoardCollapsed($project_id); + } +} diff --git a/app/Model/UserSession.php b/app/Model/UserSession.php index 6de4a182..44a9c2a2 100644 --- a/app/Model/UserSession.php +++ b/app/Model/UserSession.php @@ -118,4 +118,28 @@ class UserSession extends Base { $_SESSION['filters'][$project_id] = $filters; } + + /** + * Is board collapsed or expanded + * + * @access public + * @param integer $project_id + * @return boolean + */ + public function isBoardCollapsed($project_id) + { + return ! empty($_SESSION['board_collapsed'][$project_id]) ? $_SESSION['board_collapsed'][$project_id] : false; + } + + /** + * Set board display mode + * + * @access public + * @param integer $project_id + * @param boolean $collapsed + */ + public function setBoardDisplayMode($project_id, $collapsed) + { + $_SESSION['board_collapsed'][$project_id] = $collapsed; + } } diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 3f4010ea..7eaff580 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -10,53 +10,55 @@ render('board/task_menu', array('task' => $task)) ?> - + board->isCollapsed($project['id'])): ?> +
+ + + e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> + - + + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title') ?> + +
+ +
-
+ + + () + + - - - () - - + + url->link( + (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), + 'board', + 'changeAssignee', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + false, + 'task-board-popover', + t('Change assignee') + ) ?> + - - url->link( - (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), - 'board', - 'changeAssignee', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), - false, - 'task-board-popover', - t('Change assignee') - ) ?> - + +
+ dt->age($task['date_creation']) ?> + dt->age($task['date_moved']) ?> +
+ +
+ - -
- dt->age($task['date_creation']) ?> - dt->age($task['date_moved']) ?> -
- -
- +
+ url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> +
-
- url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + render('board/task_footer', array( + 'task' => $task, + 'not_editable' => $not_editable, + )) ?>
- - render('board/task_footer', array( - 'task' => $task, - 'not_editable' => $not_editable, - )) ?> -
+
diff --git a/app/Template/layout.php b/app/Template/layout.php index d804d3d5..a9f1cbc3 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -48,7 +48,7 @@