summaryrefslogtreecommitdiff
path: root/app/Templates/project_users.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-10-21 18:51:59 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-10-21 18:51:59 -0400
commit2c056bb9bbfd22c7c2225964d994c79a60b7f64d (patch)
treef68c0f3f503ba4fd199eed2aee2cb201a1cc3a62 /app/Templates/project_users.php
parent88a1120d9b4fde8b3e8cddad6d2be3cdd9fbf806 (diff)
Add option to allow everybody on a project
Diffstat (limited to 'app/Templates/project_users.php')
-rw-r--r--app/Templates/project_users.php75
1 files changed, 47 insertions, 28 deletions
diff --git a/app/Templates/project_users.php b/app/Templates/project_users.php
index 3b0de7f0..35079df6 100644
--- a/app/Templates/project_users.php
+++ b/app/Templates/project_users.php
@@ -2,37 +2,56 @@
<h2><?= t('List of authorized users') ?></h2>
</div>
-<?php if (empty($users['allowed'])): ?>
- <div class="alert alert-info"><?= t('Nobody have access to this project.') ?></div>
+<?php if ($project['is_everybody_allowed']): ?>
+ <div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
<?php else: ?>
-<div class="listing">
- <p><?= t('Only those users have access to this project:') ?></p>
- <ul>
- <?php foreach ($users['allowed'] as $user_id => $username): ?>
- <li>
- <strong><?= Helper\escape($username) ?></strong>
- <?php if ($project['is_private'] == 0): ?>
- (<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
- <?php endif ?>
- </li>
- <?php endforeach ?>
- </ul>
- <p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
-</div>
-<?php endif ?>
-<?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?>
- <form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+ <?php if (empty($users['allowed'])): ?>
+ <div class="alert alert-error"><?= t('Nobody have access to this project.') ?></div>
+ <?php else: ?>
+ <div class="listing">
+ <p><?= t('Only those users have access to this project:') ?></p>
+ <ul>
+ <?php foreach ($users['allowed'] as $user_id => $username): ?>
+ <li>
+ <strong><?= Helper\escape($username) ?></strong>
+ <?php if ($project['is_private'] == 0): ?>
+ (<?= Helper\a(t('revoke'), 'project', 'revoke', array('project_id' => $project['id'], 'user_id' => $user_id), true) ?>)
+ <?php endif ?>
+ </li>
+ <?php endforeach ?>
+ </ul>
+ <p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
+ </div>
+ <?php endif ?>
+
+ <?php if ($project['is_private'] == 0 && ! empty($users['not_allowed'])): ?>
+ <form method="post" action="<?= Helper\u('project', 'allow', array('project_id' => $project['id'])) ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
+ <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
+ <?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
- <?= Helper\form_label(t('User'), 'user_id') ?>
- <?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
+ <?= Helper\form_label(t('User'), 'user_id') ?>
+ <?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
- <div class="form-actions">
- <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
- </div>
- </form>
-<?php endif ?> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
+ </div>
+ </form>
+ <?php endif ?>
+
+<?php endif ?>
+
+<?php if ($project['is_private'] == 0): ?>
+<form method="post" action="<?= Helper\u('project', 'allowEverybody', array('project_id' => $project['id'])) ?>">
+ <?= Helper\form_csrf() ?>
+
+ <?= Helper\form_hidden('id', array('id' => $project['id'])) ?>
+ <?= Helper\form_checkbox('is_everybody_allowed', t('Allow everybody to access to this project'), 1, $project['is_everybody_allowed']) ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form>
+<?php endif ?>