summaryrefslogtreecommitdiff
path: root/app/Template/project_role
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/project_role')
-rw-r--r--app/Template/project_role/create.php12
-rw-r--r--app/Template/project_role/edit.php13
-rw-r--r--app/Template/project_role/remove.php15
-rw-r--r--app/Template/project_role/show.php93
4 files changed, 133 insertions, 0 deletions
diff --git a/app/Template/project_role/create.php b/app/Template/project_role/create.php
new file mode 100644
index 00000000..f554eb17
--- /dev/null
+++ b/app/Template/project_role/create.php
@@ -0,0 +1,12 @@
+<div class="page-header">
+ <h2><?= t('New custom project role') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('ProjectRoleController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('project_id', $values) ?>
+
+ <?= $this->form->label(t('Role'), 'role') ?>
+ <?= $this->form->text('role', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
+
+ <?= $this->modal->submitButtons() ?>
+</form>
diff --git a/app/Template/project_role/edit.php b/app/Template/project_role/edit.php
new file mode 100644
index 00000000..740ac0fe
--- /dev/null
+++ b/app/Template/project_role/edit.php
@@ -0,0 +1,13 @@
+<div class="page-header">
+ <h2><?= t('Edit custom project role') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('ProjectRoleController', 'update', array('project_id' => $project['id'], 'role_id' => $role['role_id'])) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('project_id', $values) ?>
+ <?= $this->form->hidden('role_id', $values) ?>
+
+ <?= $this->form->label(t('Role'), 'role') ?>
+ <?= $this->form->text('role', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
+
+ <?= $this->modal->submitButtons() ?>
+</form>
diff --git a/app/Template/project_role/remove.php b/app/Template/project_role/remove.php
new file mode 100644
index 00000000..44d24eda
--- /dev/null
+++ b/app/Template/project_role/remove.php
@@ -0,0 +1,15 @@
+<div class="page-header">
+ <h2><?= t('Remove a custom role') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this custom role: "%s"? All people assigned to this role will become project member.', $role['role']) ?>
+ </p>
+
+ <?= $this->modal->confirmButtons(
+ 'ProjectRoleController',
+ 'remove',
+ array('project_id' => $project['id'], 'role_id' => $role['role_id'])
+ ) ?>
+</div>
diff --git a/app/Template/project_role/show.php b/app/Template/project_role/show.php
new file mode 100644
index 00000000..5377f7bb
--- /dev/null
+++ b/app/Template/project_role/show.php
@@ -0,0 +1,93 @@
+<div class="page-header">
+ <h2><?= t('Custom Project Roles') ?></h2>
+ <ul>
+ <li>
+ <?= $this->modal->medium('plus', t('Add a new custom role'), 'ProjectRoleController', 'create', array('project_id' => $project['id'])) ?>
+ </li>
+ </ul>
+</div>
+
+<?php if (empty($roles)): ?>
+ <div class="alert"><?= t('There is no custom role for this project.') ?></div>
+<?php else: ?>
+ <?php foreach ($roles as $role): ?>
+ <table class="table-striped">
+ <tr>
+ <th>
+ <div class="dropdown">
+ <a href="#" class="dropdown-menu"><?= t('Restrictions for the role "%s"', $role['role']) ?> <i class="fa fa-caret-down"></i></a>
+ <ul>
+ <li>
+ <?= $this->modal->medium('plus', t('Add a new project restriction'), 'ProjectRoleRestrictionController', 'create', array('project_id' => $project['id'], 'role_id' => $role['role_id'])) ?>
+ </li>
+ <li>
+ <?= $this->modal->medium('plus', t('Add a new drag and drop restriction'), 'ColumnMoveRestrictionController', 'create', array('project_id' => $project['id'], 'role_id' => $role['role_id'])) ?>
+ </li>
+ <li>
+ <?= $this->modal->medium('plus', t('Add a new column restriction'), 'ColumnRestrictionController', 'create', array('project_id' => $project['id'], 'role_id' => $role['role_id'])) ?>
+ </li>
+ <li>
+ <?= $this->modal->medium('edit', t('Edit this role'), 'ProjectRoleController', 'edit', array('project_id' => $project['id'], 'role_id' => $role['role_id'])) ?>
+ </li>
+ <li>
+ <?= $this->modal->confirm('trash-o', t('Remove this role'), 'ProjectRoleController', 'confirm', array('project_id' => $project['id'], 'role_id' => $role['role_id'])) ?>
+ </li>
+ </ul>
+ </div>
+ </th>
+ <th class="column-15">
+ <?= t('Actions') ?>
+ </th>
+ </tr>
+ <?php if (empty($role['project_restrictions']) && empty($role['column_restrictions']) && empty($role['column_move_restrictions'])): ?>
+ <tr>
+ <td colspan="2"><?= t('There is no restriction for this role.') ?></td>
+ </tr>
+ <?php else: ?>
+ <?php foreach ($role['project_restrictions'] as $restriction): ?>
+ <tr>
+ <td>
+ <i class="fa fa-ban fa-fw" aria-hidden="true"></i>
+ <strong><?= t('Project') ?></strong>
+ <i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i>
+ <?= $this->text->e($restriction['title']) ?>
+ </td>
+ <td>
+ <?= $this->modal->confirm('trash-o', t('Remove'), 'ProjectRoleRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ <?php foreach ($role['column_restrictions'] as $restriction): ?>
+ <tr>
+ <td>
+ <?php if (strpos($restriction['rule'], 'block') === 0): ?>
+ <i class="fa fa-ban fa-fw" aria-hidden="true"></i>
+ <?php else: ?>
+ <i class="fa fa-check-circle-o fa-fw" aria-hidden="true"></i>
+ <?php endif ?>
+ <strong><?= $this->text->e($restriction['column_title']) ?></strong>
+ <i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i>
+ <?= $this->text->e($restriction['title']) ?>
+ </td>
+ <td>
+ <?= $this->modal->confirm('trash-o', t('Remove'), 'ColumnRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ <?php foreach ($role['column_move_restrictions'] as $restriction): ?>
+ <tr>
+ <td>
+ <i class="fa fa-check-circle-o fa-fw" aria-hidden="true"></i>
+ <strong><?= $this->text->e($restriction['src_column_title']) ?> / <?= $this->text->e($restriction['dst_column_title']) ?></strong>
+ <i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i>
+ <?= t('Only moving task between those columns is permitted') ?>
+ </td>
+ <td>
+ <?= $this->modal->confirm('trash-o', t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ <?php endif ?>
+ </table>
+ <?php endforeach ?>
+<?php endif ?>