From ad6f898134a3aadc38571f5c8e11d37f43a953e3 Mon Sep 17 00:00:00 2001 From: Florian Wernert Date: Tue, 11 Jul 2017 10:33:40 +0200 Subject: Feature request #2072 : Quick edit in the list view Added the quick link to the edit modal on the tasks in the board view, both expanded and collapsed --- app/Template/board/task_private.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/Template') diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 28e53473..ccf09932 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -19,6 +19,7 @@ user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> render('task/dropdown', array('task' => $task)) ?> + modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> @@ -36,6 +37,7 @@
user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?> render('task/dropdown', array('task' => $task)) ?> + modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> -- cgit v1.2.3 From 4bb422b41fd995cb67c41ad4b7ba155a84c6f1eb Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 12 Oct 2017 14:01:39 -0700 Subject: Render a dropdown menu for external task providers --- app/Core/ExternalTask/ExternalTaskManager.php | 10 ++++ .../ExternalTask/ExternalTaskProviderInterface.php | 16 +++++++ app/Helper/TaskHelper.php | 54 ++++++++++++++++++++++ app/Locale/bs_BA/translations.php | 1 + app/Locale/ca_ES/translations.php | 1 + app/Locale/cs_CZ/translations.php | 1 + app/Locale/da_DK/translations.php | 1 + app/Locale/de_DE/translations.php | 1 + app/Locale/el_GR/translations.php | 1 + app/Locale/es_ES/translations.php | 1 + app/Locale/fi_FI/translations.php | 1 + app/Locale/fr_FR/translations.php | 1 + app/Locale/hr_HR/translations.php | 1 + app/Locale/hu_HU/translations.php | 1 + app/Locale/id_ID/translations.php | 1 + app/Locale/it_IT/translations.php | 1 + app/Locale/ja_JP/translations.php | 1 + app/Locale/ko_KR/translations.php | 1 + app/Locale/my_MY/translations.php | 1 + app/Locale/nb_NO/translations.php | 1 + app/Locale/nl_NL/translations.php | 1 + app/Locale/pl_PL/translations.php | 1 + app/Locale/pt_BR/translations.php | 1 + app/Locale/pt_PT/translations.php | 1 + app/Locale/ru_RU/translations.php | 1 + app/Locale/sr_Latn_RS/translations.php | 1 + app/Locale/sv_SE/translations.php | 1 + app/Locale/th_TH/translations.php | 1 + app/Locale/tr_TR/translations.php | 1 + app/Locale/vi_VN/translations.php | 1 + app/Locale/zh_CN/translations.php | 1 + app/Template/board/table_column.php | 4 +- 32 files changed, 109 insertions(+), 3 deletions(-) (limited to 'app/Template') diff --git a/app/Core/ExternalTask/ExternalTaskManager.php b/app/Core/ExternalTask/ExternalTaskManager.php index 102ec459..87a46b71 100644 --- a/app/Core/ExternalTask/ExternalTaskManager.php +++ b/app/Core/ExternalTask/ExternalTaskManager.php @@ -55,4 +55,14 @@ class ExternalTaskManager return array(); } + + /** + * Get all providers + * + * @return ExternalTaskProviderInterface[] + */ + public function getProviders() + { + return $this->providers; + } } diff --git a/app/Core/ExternalTask/ExternalTaskProviderInterface.php b/app/Core/ExternalTask/ExternalTaskProviderInterface.php index f67f7552..5678efb8 100644 --- a/app/Core/ExternalTask/ExternalTaskProviderInterface.php +++ b/app/Core/ExternalTask/ExternalTaskProviderInterface.php @@ -18,6 +18,22 @@ interface ExternalTaskProviderInterface */ public function getName(); + /** + * Get provider icon + * + * @access public + * @return string + */ + public function getIcon(); + + /** + * Get label for adding a new task + * + * @access public + * @return string + */ + public function getMenuAddLabel(); + /** * Retrieve task from external system or cache * diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index f3084759..3b9e9745 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -256,4 +256,58 @@ class TaskHelper extends Base $html .= '
'; return $html; } + + public function getNewBoardTaskButton(array $swimlane, array $column) + { + $html = '
'; + $providers = $this->externalTaskManager->getProviders(); + + if (empty($providers)) { + $html .= $this->helper->modal->largeIcon( + 'plus', + t('Add a new task'), + 'TaskCreationController', + 'show', array( + 'project_id' => $column['project_id'], + 'column_id' => $column['id'], + 'swimlane_id' => $swimlane['id'], + ) + ); + } else { + $html .= ''; + } + + $html .= '
'; + + return $html; + } } diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php index bddfafe7..5d9757fb 100644 --- a/app/Locale/bs_BA/translations.php +++ b/app/Locale/bs_BA/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/ca_ES/translations.php b/app/Locale/ca_ES/translations.php index 7e8100dc..5c39c926 100644 --- a/app/Locale/ca_ES/translations.php +++ b/app/Locale/ca_ES/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php index 922cec5e..178ce0e2 100644 --- a/app/Locale/cs_CZ/translations.php +++ b/app/Locale/cs_CZ/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index d5126359..277efcee 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 51f544e8..496a11f2 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Schreibe ein Betreff pro Zeile.', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php index 926cfd28..2ce91756 100644 --- a/app/Locale/el_GR/translations.php +++ b/app/Locale/el_GR/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index b05ad4da..65424fd2 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Escriba un asunto por línea.', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 3c65ab7e..98f5e216 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index b1845377..0fe5f17b 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Écrivez un sujet par ligne.', 'Create another link' => 'Créer un autre lien', 'BRL - Brazilian Real' => 'BRL - Real brésilien', + 'Add a new Kanboard task' => 'Ajouter une nouvelle tâche Kanboard', ); diff --git a/app/Locale/hr_HR/translations.php b/app/Locale/hr_HR/translations.php index 0d690b61..f0cf0ae1 100644 --- a/app/Locale/hr_HR/translations.php +++ b/app/Locale/hr_HR/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 5f17805b..7e4809f5 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php index 653bcf9d..5a3ea6a1 100644 --- a/app/Locale/id_ID/translations.php +++ b/app/Locale/id_ID/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 45a58944..8252c3d0 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 70da2a8d..b7f592c3 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php index 4f164e36..c85e3469 100644 --- a/app/Locale/ko_KR/translations.php +++ b/app/Locale/ko_KR/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php index 95c09334..86e92360 100644 --- a/app/Locale/my_MY/translations.php +++ b/app/Locale/my_MY/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php index 8f5482a3..56b58eec 100644 --- a/app/Locale/nb_NO/translations.php +++ b/app/Locale/nb_NO/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index a8de3aa3..cb588a66 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 58cfb42e..662bcd96 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index cf46cf9a..38e9a072 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Escreva um assunto por linha.', 'Create another link' => 'Criar outro link', 'BRL - Brazilian Real' => 'BRL - Real Brasileiro', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php index 25f8ff4a..d0cf5d70 100644 --- a/app/Locale/pt_PT/translations.php +++ b/app/Locale/pt_PT/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Escreva um assunto por linha.', 'Create another link' => 'Criar outro link', 'BRL - Brazilian Real' => 'BRL - Real Brasileiro', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 11571df7..90bac3f6 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Записываются по одной теме на строку.', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index 97062ec6..aa4d29e7 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 7bc73b44..882ccce5 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 871c21ba..d5f49540 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index 7f55634f..efcbbbd7 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -1340,4 +1340,5 @@ return array( 'Write one subject by line.' => 'Her satıra bir konu yazınız', 'Create another link' => 'Başka bağlantı oluştur', 'BRL - Brazilian Real' => 'BRL - Brezilya Reali', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/vi_VN/translations.php b/app/Locale/vi_VN/translations.php index 387791b5..7fa77c9f 100644 --- a/app/Locale/vi_VN/translations.php +++ b/app/Locale/vi_VN/translations.php @@ -1346,4 +1346,5 @@ return array( 'Write one subject by line.' => 'Viết một chủ đề theo dòng.', 'Create another link' => 'Tạo liên kết khác', 'BRL - Brazilian Real' => 'BRL - Brazilian Real', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 8df657cb..5cea713f 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -1340,4 +1340,5 @@ return array( // 'Write one subject by line.' => '', // 'Create another link' => '', // 'BRL - Brazilian Real' => '', + // 'Add a new Kanboard task' => '', ); diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index 9d2815ff..a9652a2b 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -16,9 +16,7 @@
projectRole->canCreateTaskInColumn($column['project_id'], $column['id'])): ?> -
- modal->largeIcon('plus', t('Add a new task'), 'TaskCreationController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id'])) ?> -
+ task->getNewBoardTaskButton($swimlane, $column) ?> 1 && ! empty($column['column_nb_tasks'])): ?> -- cgit v1.2.3 From 7c52546ed2b5ed724d19af95fe97726ab6156291 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 12 Oct 2017 15:25:13 -0700 Subject: Generate a link if the reference is a URL --- app/Helper/TaskHelper.php | 15 +++++++++++++++ app/Template/board/task_footer.php | 2 +- app/Template/task/details.php | 2 +- app/Template/task_list/task_icons.php | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) (limited to 'app/Template') diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index 3b9e9745..065ece10 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -220,6 +220,21 @@ class TaskHelper extends Base return $html; } + public function renderReference(array $task) + { + if (! empty($task['reference'])) { + $reference = $this->helper->text->e($task['reference']); + + if (filter_var($task['reference'], FILTER_VALIDATE_URL) !== false) { + return sprintf('%s', $reference, $reference); + } + + return $reference; + } + + return ''; + } + public function getProgress($task) { if (! isset($this->columns[$task['project_id']])) { diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index c78616e9..4ea5bb31 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -32,7 +32,7 @@
- text->e($task['reference']) ?> + task->renderReference($task) ?>
diff --git a/app/Template/task/details.php b/app/Template/task/details.php index a42e09d1..3b4d4b38 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -22,7 +22,7 @@
  • - text->e($task['reference']) ?> + task->renderReference($task) ?>
  • diff --git a/app/Template/task_list/task_icons.php b/app/Template/task_list/task_icons.php index 03a891a2..d02c9021 100644 --- a/app/Template/task_list/task_icons.php +++ b/app/Template/task_list/task_icons.php @@ -1,7 +1,7 @@
    - text->e($task['reference']) ?> + task->renderReference($task) ?> -- cgit v1.2.3