diff --git a/app/Core/ExternalTask/ExternalTaskManager.php b/app/Core/ExternalTask/ExternalTaskManager.php index 102ec459c..87a46b71b 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 f67f7552c..5678efb8a 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 f3084759a..3b9e97457 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 bddfafe7b..5d9757fb0 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 7e8100dc4..5c39c9262 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 922cec5e7..178ce0e23 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 d51263598..277efcee4 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 51f544e8e..496a11f2a 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 926cfd28d..2ce917561 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 b05ad4da5..65424fd25 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 3c65ab7e8..98f5e216d 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 b1845377a..0fe5f17b9 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 0d690b616..f0cf0ae12 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 5f17805b3..7e4809f51 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 653bcf9d0..5a3ea6a1f 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 45a58944b..8252c3d0c 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 70da2a8de..b7f592c3c 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 4f164e362..c85e34691 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 95c093340..86e923604 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 8f5482a38..56b58eec6 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 a8de3aa3e..cb588a661 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 58cfb42e2..662bcd969 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 cf46cf9ab..38e9a0728 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 25f8ff4ab..d0cf5d702 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 11571df7c..90bac3f6d 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 97062ec68..aa4d29e7d 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 7bc73b44b..882ccce5e 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 871c21baf..d5f495400 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 7f55634f9..efcbbbd73 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 387791b5b..7fa77c9f6 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 8df657cb6..5cea713fe 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 9d2815ffc..a9652a2b9 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'])): ?>