summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-08-14 15:43:08 -0400
committerFrederic Guillot <fred@kanboard.net>2015-08-14 15:43:08 -0400
commitb2cce5a3a1a0be68102e614b42d2ee6a030bd523 (patch)
tree0014f4362cee39f98727276bc79aa96adc213fee /app/Template
parent80fb3bc9aa842ef75f1f8282db63ca43282aacd7 (diff)
Add new role Project Administrator
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/activity/project.php2
-rw-r--r--app/Template/analytic/layout.php2
-rw-r--r--app/Template/app/layout.php2
-rw-r--r--app/Template/app/projects.php2
-rw-r--r--app/Template/project/dropdown.php2
-rw-r--r--app/Template/project/edit.php2
-rw-r--r--app/Template/project/index.php2
-rw-r--r--app/Template/project/sidebar.php4
-rw-r--r--app/Template/task/layout.php2
-rw-r--r--app/Template/user/create_local.php1
-rw-r--r--app/Template/user/create_remote.php1
-rw-r--r--app/Template/user/edit.php1
-rw-r--r--app/Template/user/index.php15
-rw-r--r--app/Template/user/show.php2
14 files changed, 18 insertions, 22 deletions
diff --git a/app/Template/activity/project.php b/app/Template/activity/project.php
index 480bbadd..bc585212 100644
--- a/app/Template/activity/project.php
+++ b/app/Template/activity/project.php
@@ -19,7 +19,7 @@
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
</li>
- <?php if ($this->user->isManager($project['id'])): ?>
+ <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php
index 9d6bf77c..fd2090ae 100644
--- a/app/Template/analytic/layout.php
+++ b/app/Template/analytic/layout.php
@@ -19,7 +19,7 @@
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
</li>
- <?php if ($this->user->isManager($project['id'])): ?>
+ <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php
index 4a307a19..de561ded 100644
--- a/app/Template/app/layout.php
+++ b/app/Template/app/layout.php
@@ -1,7 +1,7 @@
<section id="main">
<div class="page-header page-header-mobile">
<ul>
- <?php if ($this->user->isAdmin()): ?>
+ <?php if ($this->user->isProjectAdmin()): ?>
<li>
<i class="fa fa-plus fa-fw"></i>
<?= $this->url->link(t('New project'), 'project', 'create') ?>
diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php
index 627ad21b..43db85bd 100644
--- a/app/Template/app/projects.php
+++ b/app/Template/app/projects.php
@@ -16,7 +16,7 @@
<?= $this->url->link('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?>
</td>
<td>
- <?php if ($this->user->isManager($project['id'])): ?>
+ <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<?= $this->url->link('<i class="fa fa-cog"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>&nbsp;
<?php endif ?>
diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php
index aa4322e6..0a53cc05 100644
--- a/app/Template/project/dropdown.php
+++ b/app/Template/project/dropdown.php
@@ -9,7 +9,7 @@
</li>
<?php endif ?>
-<?php if ($this->user->isManager($project['id'])): ?>
+<?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<li>
<i class="fa fa-line-chart fa-fw"></i>
<?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php
index 794267f4..c8f235c7 100644
--- a/app/Template/project/edit.php
+++ b/app/Template/project/edit.php
@@ -13,7 +13,7 @@
<?= $this->form->text('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->user->isAdmin()): ?>
+ <?php if ($this->user->isAdmin() || $this->user->isProjectAdministrationAllowed($project['id'])): ?>
<?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?>
<?php endif ?>
diff --git a/app/Template/project/index.php b/app/Template/project/index.php
index 971ba2ae..679bdd00 100644
--- a/app/Template/project/index.php
+++ b/app/Template/project/index.php
@@ -1,7 +1,7 @@
<section id="main">
<div class="page-header">
<ul>
- <?php if ($this->user->isAdmin()): ?>
+ <?php if ($this->user->isProjectAdmin()): ?>
<li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li>
<?php endif ?>
<li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?></li>
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php
index 7ee39f53..d6f7db97 100644
--- a/app/Template/project/sidebar.php
+++ b/app/Template/project/sidebar.php
@@ -5,7 +5,7 @@
<?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
- <?php if ($this->user->isManager($project['id'])): ?>
+ <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<li>
<?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?>
</li>
@@ -42,7 +42,7 @@
<?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?>
<?php endif ?>
</li>
- <?php if ($this->user->isAdmin()): ?>
+ <?php if ($this->user->isProjectAdministrationAllowed($project['id'])): ?>
<li>
<?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?>
</li>
diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php
index bbccf177..6b6e827a 100644
--- a/app/Template/task/layout.php
+++ b/app/Template/task/layout.php
@@ -9,7 +9,7 @@
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
</li>
- <?php if ($this->user->isManager($task['project_id'])): ?>
+ <?php if ($this->user->isProjectManagementAllowed($task['project_id'])): ?>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $task['project_id'])) ?>
diff --git a/app/Template/user/create_local.php b/app/Template/user/create_local.php
index aeec300f..3c8b43b0 100644
--- a/app/Template/user/create_local.php
+++ b/app/Template/user/create_local.php
@@ -39,6 +39,7 @@
<?= $this->form->checkbox('notifications_enabled', t('Enable notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?>
<?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
+ <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1 ? true : false) ?>
</div>
<div class="form-actions">
diff --git a/app/Template/user/create_remote.php b/app/Template/user/create_remote.php
index 52661585..6b3678d3 100644
--- a/app/Template/user/create_remote.php
+++ b/app/Template/user/create_remote.php
@@ -39,6 +39,7 @@
<?= $this->form->checkbox('notifications_enabled', t('Enable notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?>
<?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
+ <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1 ? true : false) ?>
<?= $this->form->checkbox('disable_login_form', t('Disallow login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?>
</div>
diff --git a/app/Template/user/edit.php b/app/Template/user/edit.php
index ea7e3875..a60ee681 100644
--- a/app/Template/user/edit.php
+++ b/app/Template/user/edit.php
@@ -24,6 +24,7 @@
<?php if ($this->user->isAdmin()): ?>
<?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1) ?><br/>
+ <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1) ?><br/>
<?php endif ?>
<div class="form-actions">
diff --git a/app/Template/user/index.php b/app/Template/user/index.php
index edf043a6..d74aa748 100644
--- a/app/Template/user/index.php
+++ b/app/Template/user/index.php
@@ -18,9 +18,9 @@
<th><?= $paginator->order(t('Name'), 'name') ?></th>
<th><?= $paginator->order(t('Email'), 'email') ?></th>
<th><?= $paginator->order(t('Administrator'), 'is_admin') ?></th>
+ <th><?= $paginator->order(t('Project Administrator'), 'is_project_admin') ?></th>
<th><?= $paginator->order(t('Two factor authentication'), 'twofactor_activated') ?></th>
<th><?= $paginator->order(t('Notifications'), 'notifications_enabled') ?></th>
- <th><?= t('External accounts') ?></th>
<th><?= $paginator->order(t('Account type'), 'is_ldap_user') ?></th>
</tr>
<?php foreach ($paginator->getCollection() as $user): ?>
@@ -41,6 +41,9 @@
<?= $user['is_admin'] ? t('Yes') : t('No') ?>
</td>
<td>
+ <?= $user['is_project_admin'] ? t('Yes') : t('No') ?>
+ </td>
+ <td>
<?= $user['twofactor_activated'] ? t('Yes') : t('No') ?>
</td>
<td>
@@ -51,16 +54,6 @@
<?php endif ?>
</td>
<td>
- <ul class="no-bullet">
- <?php if ($user['google_id']): ?>
- <li><i class="fa fa-google fa-fw"></i><?= t('Google account linked') ?></li>
- <?php endif ?>
- <?php if ($user['github_id']): ?>
- <li><i class="fa fa-github fa-fw"></i><?= t('Github account linked') ?></li>
- <?php endif ?>
- </ul>
- </td>
- <td>
<?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?>
</td>
</tr>
diff --git a/app/Template/user/show.php b/app/Template/user/show.php
index acb02f71..220ad87e 100644
--- a/app/Template/user/show.php
+++ b/app/Template/user/show.php
@@ -11,7 +11,7 @@
<h2><?= t('Security') ?></h2>
</div>
<ul class="listing">
- <li><?= t('Group:') ?> <strong><?= $user['is_admin'] ? t('Administrator') : t('Regular user') ?></strong></li>
+ <li><?= t('Group:') ?> <strong><?= $user['is_admin'] ? t('Administrator') : ($user['is_project_admin'] ? t('Project Administrator') : t('Regular user')) ?></strong></li>
<li><?= t('Account type:') ?> <strong><?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?></strong></li>
<li><?= $user['twofactor_activated'] == 1 ? t('Two factor authentication enabled') : t('Two factor authentication disabled') ?></li>
</ul>