diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-03-21 19:10:24 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-03-21 19:10:24 -0400 |
commit | 373537efe2f893f91f11c04436073bbb2c2732dd (patch) | |
tree | e744f1260c36e3b1a5c5e92c998ae5ebed76df19 | |
parent | bcb39ad4db0f4c1d9bf35437852ee0b74e1680ce (diff) |
Allow admins to transform a private project to a team project
-rw-r--r-- | app/Controller/Project.php | 7 | ||||
-rw-r--r-- | app/Locale/fr_FR/translations.php | 1 | ||||
-rw-r--r-- | app/Template/project/edit.php | 6 |
3 files changed, 12 insertions, 2 deletions
diff --git a/app/Controller/Project.php b/app/Controller/Project.php index fb0a8d05..4e01271a 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -23,7 +23,7 @@ class Project extends Base else { $project_ids = $this->projectPermission->getMemberProjectIds($this->userSession->getId()); } - + $nb_projects = count($project_ids); $paginator = $this->paginator @@ -128,6 +128,11 @@ class Project extends Base { $project = $this->getProject(); $values = $this->request->getValues(); + + if ($project['is_private'] == 1) { + $values += array('is_private' => 0); + } + list($valid, $errors) = $this->project->validateModification($values); if ($valid) { diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 5354970a..7c405a08 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -777,4 +777,5 @@ return array( 'This timetable is used when the checkbox "all day" is checked for scheduled time off and overtime.' => 'Ces horaires sont utilisés lorsque la case « Toute la journée » est cochée pour les heures d\'absences ou supplémentaires programmées.', 'Files' => 'Fichiers', 'Images' => 'Images', + 'Private project' => 'Projet privé', ); diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php index 37b03fe1..c1f98315 100644 --- a/app/Template/project/edit.php +++ b/app/Template/project/edit.php @@ -1,7 +1,7 @@ <div class="page-header"> <h2><?= t('Edit project') ?></h2> </div> -<form method="post" action="<?= $this->u('project', 'update', array('project_id' => $values['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('project', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('id', $values) ?> @@ -30,6 +30,10 @@ </div> <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div> + <?php if ($project['is_private'] == 1 && $this->userSession->isAdmin()): ?> + <?= $this->formCheckbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> + <?php endif ?> + <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> </div> |