Allow admins to transform a private project to a team project

This commit is contained in:
Frederic Guillot
2015-03-21 19:10:24 -04:00
parent bcb39ad4db
commit 373537efe2
3 changed files with 12 additions and 2 deletions

View File

@@ -128,6 +128,11 @@ class Project extends Base
{ {
$project = $this->getProject(); $project = $this->getProject();
$values = $this->request->getValues(); $values = $this->request->getValues();
if ($project['is_private'] == 1) {
$values += array('is_private' => 0);
}
list($valid, $errors) = $this->project->validateModification($values); list($valid, $errors) = $this->project->validateModification($values);
if ($valid) { if ($valid) {

View File

@@ -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.', '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', 'Files' => 'Fichiers',
'Images' => 'Images', 'Images' => 'Images',
'Private project' => 'Projet privé',
); );

View File

@@ -1,7 +1,7 @@
<div class="page-header"> <div class="page-header">
<h2><?= t('Edit project') ?></h2> <h2><?= t('Edit project') ?></h2>
</div> </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->formCsrf() ?>
<?= $this->formHidden('id', $values) ?> <?= $this->formHidden('id', $values) ?>
@@ -30,6 +30,10 @@
</div> </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> <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"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div> </div>