From 373537efe2f893f91f11c04436073bbb2c2732dd Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 21 Mar 2015 19:10:24 -0400 Subject: Allow admins to transform a private project to a team project --- app/Controller/Project.php | 7 ++++++- app/Locale/fr_FR/translations.php | 1 + app/Template/project/edit.php | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'app') 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 @@ -
+ formCsrf() ?> formHidden('id', $values) ?> @@ -30,6 +30,10 @@
+ userSession->isAdmin()): ?> + formCheckbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> + +
-- cgit v1.2.3