summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-13 12:39:49 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-13 12:39:49 -0500
commit567d623446d7e98393fb542c88d6d3b18b05cf6f (patch)
tree5371d19e82be3f11bc5cd8bf931d3425ef90a435 /app
parent5d20b93b3a4a9321c7f1126e005b1dd8cfae7324 (diff)
Add setting option to disable private projects
Diffstat (limited to 'app')
-rw-r--r--app/Api/Me.php4
-rw-r--r--app/Controller/Config.php7
-rw-r--r--app/Helper/App.php5
-rw-r--r--app/Locale/bs_BA/translations.php3
-rw-r--r--app/Locale/cs_CZ/translations.php3
-rw-r--r--app/Locale/da_DK/translations.php3
-rw-r--r--app/Locale/de_DE/translations.php3
-rw-r--r--app/Locale/el_GR/translations.php3
-rw-r--r--app/Locale/es_ES/translations.php3
-rw-r--r--app/Locale/fi_FI/translations.php3
-rw-r--r--app/Locale/fr_FR/translations.php3
-rw-r--r--app/Locale/hu_HU/translations.php3
-rw-r--r--app/Locale/id_ID/translations.php3
-rw-r--r--app/Locale/it_IT/translations.php3
-rw-r--r--app/Locale/ja_JP/translations.php3
-rw-r--r--app/Locale/my_MY/translations.php3
-rw-r--r--app/Locale/nb_NO/translations.php3
-rw-r--r--app/Locale/nl_NL/translations.php3
-rw-r--r--app/Locale/pl_PL/translations.php3
-rw-r--r--app/Locale/pt_BR/translations.php3
-rw-r--r--app/Locale/pt_PT/translations.php3
-rw-r--r--app/Locale/ru_RU/translations.php3
-rw-r--r--app/Locale/sr_Latn_RS/translations.php3
-rw-r--r--app/Locale/sv_SE/translations.php3
-rw-r--r--app/Locale/th_TH/translations.php3
-rw-r--r--app/Locale/tr_TR/translations.php3
-rw-r--r--app/Locale/zh_CN/translations.php3
-rw-r--r--app/Template/app/layout.php2
-rw-r--r--app/Template/config/project.php1
-rw-r--r--app/Template/header.php2
30 files changed, 90 insertions, 3 deletions
diff --git a/app/Api/Me.php b/app/Api/Me.php
index df8ec070..ccc809ed 100644
--- a/app/Api/Me.php
+++ b/app/Api/Me.php
@@ -38,6 +38,10 @@ class Me extends Base
public function createMyPrivateProject($name, $description = null)
{
+ if ($this->config->get('disable_private_project', 0) == 1) {
+ return false;
+ }
+
$values = array(
'name' => $name,
'description' => $description,
diff --git a/app/Controller/Config.php b/app/Controller/Config.php
index 80522bbe..e811f870 100644
--- a/app/Controller/Config.php
+++ b/app/Controller/Config.php
@@ -26,7 +26,12 @@ class Config extends Base
$values += array('password_reset' => 0);
break;
case 'project':
- $values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'cfd_include_closed_tasks' => 0);
+ $values += array(
+ 'subtask_restriction' => 0,
+ 'subtask_time_tracking' => 0,
+ 'cfd_include_closed_tasks' => 0,
+ 'disable_private_project' => 0,
+ );
break;
case 'integrations':
$values += array('integration_gravatar' => 0);
diff --git a/app/Helper/App.php b/app/Helper/App.php
index 0593795f..79afa5b9 100644
--- a/app/Helper/App.php
+++ b/app/Helper/App.php
@@ -17,11 +17,12 @@ class App extends Base
*
* @access public
* @param string $param
+ * @param mixed $default_value
* @return mixed
*/
- public function config($param)
+ public function config($param, $default_value = '')
{
- return $this->config->get($param);
+ return $this->config->get($param, $default_value);
}
/**
diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php
index e331d4a1..20a6272a 100644
--- a/app/Locale/bs_BA/translations.php
+++ b/app/Locale/bs_BA/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php
index a495f01e..86222680 100644
--- a/app/Locale/cs_CZ/translations.php
+++ b/app/Locale/cs_CZ/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index 537b6349..3b1bc972 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index ba6a1fd4..5d9582d4 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php
index 01b31819..f51a71db 100644
--- a/app/Locale/el_GR/translations.php
+++ b/app/Locale/el_GR/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 9c7c6e41..f3e16784 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index d50765b6..613f04e2 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index 90d6dc3d..a36a5e6c 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -1121,4 +1121,7 @@ return array(
'End date: ' => 'Date de fin : ',
'New due date: ' => 'Nouvelle date d\'échéance : ',
'Start date changed: ' => 'Date de début modifiée : ',
+ 'Disable private projects' => 'Désactiver les projets privés',
+ 'Do you really want to remove this custom filter: "%s"?' => 'Voulez-vous vraiment supprimer ce filtre personalisé : « %s » ?',
+ 'Remove a custom filter' => 'Supprimer un filtre personalisé',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index 447dafc9..89a47d3e 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php
index 8c6db849..e58ff9a8 100644
--- a/app/Locale/id_ID/translations.php
+++ b/app/Locale/id_ID/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 661e6c86..914a12d2 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 3609836b..ed52d68f 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php
index 5b1da7cd..98c8d3b0 100644
--- a/app/Locale/my_MY/translations.php
+++ b/app/Locale/my_MY/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php
index 335c699b..d361e23f 100644
--- a/app/Locale/nb_NO/translations.php
+++ b/app/Locale/nb_NO/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php
index 0d9d9608..ba4307be 100644
--- a/app/Locale/nl_NL/translations.php
+++ b/app/Locale/nl_NL/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 28ed2b3a..6e9be6a3 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index d29f9f88..81eb789e 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php
index b197a1dc..bbd28fa3 100644
--- a/app/Locale/pt_PT/translations.php
+++ b/app/Locale/pt_PT/translations.php
@@ -1118,4 +1118,7 @@ return array(
'End date: ' => 'Data final: ',
'New due date: ' => 'Nova data estimada: ',
'Start date changed: ' => 'Data inicio alterada: ',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index f971acc1..48ad334d 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php
index 3551c281..f218fb07 100644
--- a/app/Locale/sr_Latn_RS/translations.php
+++ b/app/Locale/sr_Latn_RS/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index c0aa883c..4d1ca6d2 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index 1ccc2d90..dde1e56a 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php
index 10153331..747db7c3 100644
--- a/app/Locale/tr_TR/translations.php
+++ b/app/Locale/tr_TR/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index acdcdf30..8b6d051c 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -1118,4 +1118,7 @@ return array(
// 'End date: ' => '',
// 'New due date: ' => '',
// 'Start date changed: ' => '',
+ // 'Disable private projects' => '',
+ // 'Do you really want to remove this custom filter: "%s"?' => '',
+ // 'Remove a custom filter' => '',
);
diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php
index 0550cef4..200cb0d7 100644
--- a/app/Template/app/layout.php
+++ b/app/Template/app/layout.php
@@ -7,10 +7,12 @@
<?= $this->url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?>
</li>
<?php endif ?>
+ <?php if ($this->app->config('disable_private_project', 0) == 0): ?>
<li>
<i class="fa fa-lock fa-fw"></i>
<?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?>
</li>
+ <?php endif ?>
<li>
<i class="fa fa-search fa-fw"></i>
<?= $this->url->link(t('Search'), 'search', 'index') ?>
diff --git a/app/Template/config/project.php b/app/Template/config/project.php
index a212f65f..1d32a14f 100644
--- a/app/Template/config/project.php
+++ b/app/Template/config/project.php
@@ -16,6 +16,7 @@
<?= $this->form->text('project_categories', $values, $errors) ?>
<p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p>
+ <?= $this->form->checkbox('disable_private_project', t('Disable private projects'), 1, isset($values['disable_private_project']) && $values['disable_private_project'] == 1) ?>
<?= $this->form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?>
<?= $this->form->checkbox('subtask_time_tracking', t('Trigger automatically subtask time tracking'), 1, $values['subtask_time_tracking'] == 1) ?>
<?= $this->form->checkbox('cfd_include_closed_tasks', t('Include closed tasks in the cumulative flow diagram'), 1, $values['cfd_include_closed_tasks'] == 1) ?>
diff --git a/app/Template/header.php b/app/Template/header.php
index 72d89b80..a945411e 100644
--- a/app/Template/header.php
+++ b/app/Template/header.php
@@ -44,9 +44,11 @@
<?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?>
<li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?></li>
<?php endif ?>
+ <?php if ($this->app->config('disable_private_project', 0) == 0): ?>
<li>
<i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?>
</li>
+ <?php endif ?>
</ul>
</div>