summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controller/ProjectPredefinedContentController.php61
-rw-r--r--app/Locale/bs_BA/translations.php2
-rw-r--r--app/Locale/ca_ES/translations.php2
-rw-r--r--app/Locale/cs_CZ/translations.php2
-rw-r--r--app/Locale/da_DK/translations.php2
-rw-r--r--app/Locale/de_DE/translations.php2
-rw-r--r--app/Locale/el_GR/translations.php2
-rw-r--r--app/Locale/es_ES/translations.php2
-rw-r--r--app/Locale/fi_FI/translations.php2
-rw-r--r--app/Locale/fr_FR/translations.php2
-rw-r--r--app/Locale/hr_HR/translations.php2
-rw-r--r--app/Locale/hu_HU/translations.php2
-rw-r--r--app/Locale/id_ID/translations.php2
-rw-r--r--app/Locale/it_IT/translations.php2
-rw-r--r--app/Locale/ja_JP/translations.php2
-rw-r--r--app/Locale/ko_KR/translations.php2
-rw-r--r--app/Locale/my_MY/translations.php2
-rw-r--r--app/Locale/nb_NO/translations.php2
-rw-r--r--app/Locale/nl_NL/translations.php2
-rw-r--r--app/Locale/pl_PL/translations.php2
-rw-r--r--app/Locale/pt_BR/translations.php2
-rw-r--r--app/Locale/pt_PT/translations.php2
-rw-r--r--app/Locale/ru_RU/translations.php2
-rw-r--r--app/Locale/sr_Latn_RS/translations.php2
-rw-r--r--app/Locale/sv_SE/translations.php2
-rw-r--r--app/Locale/th_TH/translations.php2
-rw-r--r--app/Locale/tr_TR/translations.php2
-rw-r--r--app/Locale/vi_VN/translations.php2
-rw-r--r--app/Locale/zh_CN/translations.php2
-rw-r--r--app/ServiceProvider/AuthenticationProvider.php1
-rw-r--r--app/Template/project/sidebar.php3
-rw-r--r--app/Template/project_edit/show.php6
-rw-r--r--app/Template/project_predefined_content/show.php14
33 files changed, 135 insertions, 6 deletions
diff --git a/app/Controller/ProjectPredefinedContentController.php b/app/Controller/ProjectPredefinedContentController.php
new file mode 100644
index 00000000..1195dfa3
--- /dev/null
+++ b/app/Controller/ProjectPredefinedContentController.php
@@ -0,0 +1,61 @@
+<?php
+
+namespace Kanboard\Controller;
+
+/**
+ * Project Predefined Content Controller
+ *
+ * @package Kanboard\Controller
+ * @author Frederic Guillot
+ */
+class ProjectPredefinedContentController extends BaseController
+{
+ /**
+ * Edit project
+ *
+ * @access public
+ * @param array $values
+ * @param array $errors
+ */
+ public function show(array $values = array(), array $errors = array())
+ {
+ $project = $this->getProject();
+
+ $this->response->html($this->helper->layout->project('project_predefined_content/show', array(
+ 'values' => empty($values) ? $project : $values,
+ 'errors' => $errors,
+ 'project' => $project,
+ 'title' => t('Predefined Contents')
+ )));
+ }
+
+ /**
+ * Validate and update a project
+ *
+ * @access public
+ */
+ public function update()
+ {
+ $project = $this->getProject();
+ $values = $this->request->getValues();
+
+ $values = array(
+ 'id' => $project['id'],
+ 'name' => $project['name'],
+ 'predefined_email_subjects' => isset($values['predefined_email_subjects']) ? $values['predefined_email_subjects'] : '',
+ );
+
+ list($valid, $errors) = $this->projectValidator->validateModification($values);
+
+ if ($valid) {
+ if ($this->projectModel->update($values)) {
+ $this->flash->success(t('Project updated successfully.'));
+ return $this->response->redirect($this->helper->url->to('ProjectPredefinedContentController', 'show', array('project_id' => $project['id'])), true);
+ } else {
+ $this->flash->failure(t('Unable to update this project.'));
+ }
+ }
+
+ return $this->show($values, $errors);
+ }
+}
diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php
index b576af09..ce0374f2 100644
--- a/app/Locale/bs_BA/translations.php
+++ b/app/Locale/bs_BA/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/ca_ES/translations.php b/app/Locale/ca_ES/translations.php
index bb8dc50b..8e14e2fb 100644
--- a/app/Locale/ca_ES/translations.php
+++ b/app/Locale/ca_ES/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php
index 2e729175..92645582 100644
--- a/app/Locale/cs_CZ/translations.php
+++ b/app/Locale/cs_CZ/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index 112be172..cfd27c2c 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index b06b3721..81139377 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php
index 9fb2a41e..9bd08132 100644
--- a/app/Locale/el_GR/translations.php
+++ b/app/Locale/el_GR/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 0490e466..d0777c00 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index 27ff0eed..ad2fa6b1 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index 830cb5c3..24367389 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -1343,4 +1343,6 @@ return array(
'Subtask added successfully.' => 'Sous-tâche ajoutée avec succès.',
'%d subtasks added successfully.' => '%d sous-tâches ajoutées avec succès.',
'Enter one subtask by line.' => 'Entrez une sous-tâche par ligne.',
+ 'Predefined Contents' => 'Contenus prédéfini',
+ 'Predefined contents' => 'Contenus prédéfini',
);
diff --git a/app/Locale/hr_HR/translations.php b/app/Locale/hr_HR/translations.php
index 2eeb5bb0..fa4c87d7 100644
--- a/app/Locale/hr_HR/translations.php
+++ b/app/Locale/hr_HR/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index c19a9b5a..c8f9d8ea 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php
index 4f922752..aad497ad 100644
--- a/app/Locale/id_ID/translations.php
+++ b/app/Locale/id_ID/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 1c2b7144..98647574 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 5eac5986..86c4800b 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -1343,4 +1343,6 @@ return array(
'Subtask added successfully.' => 'サブタスクを追加しました',
'%d subtasks added successfully.' => '%d 件のサブタスクを追加しました',
'Enter one subtask by line.' => '1行に1件のサブタスクを入力',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php
index fa75667e..083ddc67 100644
--- a/app/Locale/ko_KR/translations.php
+++ b/app/Locale/ko_KR/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php
index 62aeecad..50544f2e 100644
--- a/app/Locale/my_MY/translations.php
+++ b/app/Locale/my_MY/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php
index 3445cb5f..3fe60424 100644
--- a/app/Locale/nb_NO/translations.php
+++ b/app/Locale/nb_NO/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php
index 0a3706c8..169654c4 100644
--- a/app/Locale/nl_NL/translations.php
+++ b/app/Locale/nl_NL/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 58bcbb46..d0858db9 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index 20a2f983..079271d1 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php
index 9d5d5efe..6fddbfb2 100644
--- a/app/Locale/pt_PT/translations.php
+++ b/app/Locale/pt_PT/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index 3e7d8a02..6223f94c 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -1343,4 +1343,6 @@ return array(
'Subtask added successfully.' => 'Подзадача успешно добавлена.',
'%d subtasks added successfully.' => '%d подзадач(а) успешно добавлено.',
'Enter one subtask by line.' => 'Записывайте по одной подзадаче на строку.',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php
index 0173b8fd..7d88e0af 100644
--- a/app/Locale/sr_Latn_RS/translations.php
+++ b/app/Locale/sr_Latn_RS/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index 8522072f..427f00a1 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index 1cf74352..ba4a587e 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php
index e049d286..e420eff4 100644
--- a/app/Locale/tr_TR/translations.php
+++ b/app/Locale/tr_TR/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/vi_VN/translations.php b/app/Locale/vi_VN/translations.php
index 35984b9b..dde397bb 100644
--- a/app/Locale/vi_VN/translations.php
+++ b/app/Locale/vi_VN/translations.php
@@ -1349,4 +1349,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 8d51fa9f..9094a7b4 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -1343,4 +1343,6 @@ return array(
// 'Subtask added successfully.' => '',
// '%d subtasks added successfully.' => '',
// 'Enter one subtask by line.' => '',
+ // 'Predefined Contents' => '',
+ // 'Predefined contents' => '',
);
diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php
index fe07fc0c..98212d45 100644
--- a/app/ServiceProvider/AuthenticationProvider.php
+++ b/app/ServiceProvider/AuthenticationProvider.php
@@ -92,6 +92,7 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->add('ProjectViewController', array('share', 'updateSharing', 'integrations', 'updateIntegrations', 'notifications', 'updateNotifications', 'duplicate', 'doDuplication'), Role::PROJECT_MANAGER);
$acl->add('ProjectPermissionController', '*', Role::PROJECT_MANAGER);
$acl->add('ProjectEditController', '*', Role::PROJECT_MANAGER);
+ $acl->add('ProjectPredefinedContentController', '*', Role::PROJECT_MANAGER);
$acl->add('ProjectFileController', '*', Role::PROJECT_MEMBER);
$acl->add('ProjectUserOverviewController', '*', Role::PROJECT_MANAGER);
$acl->add('ProjectStatusController', '*', Role::PROJECT_MANAGER);
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php
index 9775c7a1..4b39172c 100644
--- a/app/Template/project/sidebar.php
+++ b/app/Template/project/sidebar.php
@@ -13,6 +13,9 @@
<li <?= $this->app->checkMenuSelection('ProjectEditController') ?>>
<?= $this->url->link(t('Edit project'), 'ProjectEditController', 'show', array('project_id' => $project['id'])) ?>
</li>
+ <li <?= $this->app->checkMenuSelection('ProjectPredefinedContentController') ?>>
+ <?= $this->url->link(t('Predefined contents'), 'ProjectPredefinedContentController', 'show', array('project_id' => $project['id'])) ?>
+ </li>
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'share') ?>>
<?= $this->url->link(t('Public access'), 'ProjectViewController', 'share', array('project_id' => $project['id'])) ?>
</li>
diff --git a/app/Template/project_edit/show.php b/app/Template/project_edit/show.php
index 8b85f010..96531007 100644
--- a/app/Template/project_edit/show.php
+++ b/app/Template/project_edit/show.php
@@ -62,11 +62,5 @@
<?= $this->form->number('priority_end', $values, $errors, array('tabindex="10"')) ?>
</fieldset>
- <fieldset>
- <legend><?= t('Predefined Email Subjects') ?></legend>
- <?= $this->form->textarea('predefined_email_subjects', $values, $errors, array('tabindex="11"')) ?>
- <p class="form-help"><?= t('Write one subject by line.') ?></p>
- </fieldset>
-
<?= $this->modal->submitButtons(array('tabindex' => 11)) ?>
</form>
diff --git a/app/Template/project_predefined_content/show.php b/app/Template/project_predefined_content/show.php
new file mode 100644
index 00000000..8e5ca3dc
--- /dev/null
+++ b/app/Template/project_predefined_content/show.php
@@ -0,0 +1,14 @@
+<div class="page-header">
+ <h2><?= t('Predefined Contents') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('ProjectPredefinedContentController', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+
+ <fieldset>
+ <legend><?= t('Predefined Email Subjects') ?></legend>
+ <?= $this->form->textarea('predefined_email_subjects', $values, $errors, array('tabindex="1"')) ?>
+ <p class="form-help"><?= t('Write one subject by line.') ?></p>
+ </fieldset>
+
+ <?= $this->modal->submitButtons(array('tabindex' => 2)) ?>
+</form>