Add ui to create new custom project roles and column restrictions
This commit is contained in:
18
app/Template/project_role/create.php
Normal file
18
app/Template/project_role/create.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<section id="main">
|
||||
<div class="page-header">
|
||||
<h2><?= t('New custom project role') ?></h2>
|
||||
</div>
|
||||
<form class="popover-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"')) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
14
app/Template/project_role/remove.php
Normal file
14
app/Template/project_role/remove.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<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>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'ProjectRoleController', 'remove', array('project_id' => $project['id'], 'role_id' => $role['role_id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectRoleController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
</div>
|
||||
58
app/Template/project_role/show.php
Normal file
58
app/Template/project_role/show.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Custom Project Roles') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Add a new custom role'), 'ProjectRoleController', 'create', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
</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('Column restrictions for the role "%s"', $role['role']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Add a new column restriction'), 'ColumnMoveRestrictionController', 'create', array('project_id' => $project['id'], 'role_id' => $role['role_id']), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Remove this role'), 'ProjectRoleController', 'confirm', array('project_id' => $project['id'], 'role_id' => $role['role_id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</th>
|
||||
<th class="column-15">
|
||||
<?= t('Actions') ?>
|
||||
</th>
|
||||
</tr>
|
||||
<?php if (empty($role['restrictions'])): ?>
|
||||
<tr>
|
||||
<td colspan="2"><?= t('There is no restriction for this role.') ?></td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($role['restrictions'] as $restriction): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-ban fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->text->e($restriction['src_column_title']) ?>
|
||||
<i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->text->e($restriction['dst_column_title']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), false, 'popover') ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</table>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
Reference in New Issue
Block a user