diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-21 12:10:01 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-21 12:10:01 -0400 |
commit | fb68231f2bb4fcbf0063ecc1e37279b5e125076b (patch) | |
tree | f181ff8c578551774a88ec62a0bd3ef015d3a9cb | |
parent | 8ebeac656b548b9f5dcaa404b1b9efadcbcc8907 (diff) |
Fix bug: editing private project enable user management
-rw-r--r-- | app/Controller/Project.php | 2 | ||||
-rw-r--r-- | app/Template/project/edit.php | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/Controller/Project.php b/app/Controller/Project.php index 3015ecc0..f0847ef2 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -140,7 +140,7 @@ class Project extends Base $project = $this->getProject(); $values = $this->request->getValues(); - if ($project['is_private'] == 1) { + if ($project['is_private'] == 1 && $this->userSession->isAdmin() && ! isset($values['is_private'])) { $values += array('is_private' => 0); } diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php index ffd9be00..8b94e378 100644 --- a/app/Template/project/edit.php +++ b/app/Template/project/edit.php @@ -13,6 +13,10 @@ <?= $this->formText('identifier', $values, $errors, array('maxlength="50"')) ?> <p class="form-help"><?= t('The project identifier is an optional alphanumeric code used to identify your project.') ?></p> + <?php if ($this->userSession->isAdmin()): ?> + <?= $this->formCheckbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?> + <?php endif ?> + <?= $this->formLabel(t('Description'), 'description') ?> <div class="form-tabs"> @@ -34,10 +38,6 @@ </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> |