From 44f680cf2f1463721eb5bdb7eda4d3b339e63ba9 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 10 Sep 2016 22:37:57 -0400 Subject: Add ui to create new custom project roles and column restrictions --- app/Template/column/index.php | 2 + app/Template/column/remove.php | 2 +- app/Template/column_move_restriction/create.php | 24 ++++++++++ app/Template/column_move_restriction/remove.php | 14 ++++++ app/Template/project/sidebar.php | 3 ++ app/Template/project_role/create.php | 18 ++++++++ app/Template/project_role/remove.php | 14 ++++++ app/Template/project_role/show.php | 58 +++++++++++++++++++++++++ 8 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 app/Template/column_move_restriction/create.php create mode 100644 app/Template/column_move_restriction/remove.php create mode 100644 app/Template/project_role/create.php create mode 100644 app/Template/project_role/remove.php create mode 100644 app/Template/project_role/show.php (limited to 'app/Template') diff --git a/app/Template/column/index.php b/app/Template/column/index.php index 66890ba5..8c96a350 100644 --- a/app/Template/column/index.php +++ b/app/Template/column/index.php @@ -41,9 +41,11 @@ diff --git a/app/Template/column/remove.php b/app/Template/column/remove.php index b231a9a7..dc0a4712 100644 --- a/app/Template/column/remove.php +++ b/app/Template/column/remove.php @@ -9,7 +9,7 @@

- url->link(t('Yes'), 'ColumnController', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> + url->link(t('Yes'), 'ColumnController', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id']), true, 'btn btn-red') ?> url->link(t('cancel'), 'ColumnController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
diff --git a/app/Template/column_move_restriction/create.php b/app/Template/column_move_restriction/create.php new file mode 100644 index 00000000..69a75ce0 --- /dev/null +++ b/app/Template/column_move_restriction/create.php @@ -0,0 +1,24 @@ +
+ +
+ form->csrf() ?> + form->hidden('project_id', $values) ?> + form->hidden('role_id', $values) ?> + + form->label(t('Source column'), 'src_column_id') ?> + form->select('src_column_id', $columns, $values, $errors) ?> + + form->label(t('Destination column'), 'dst_column_id') ?> + form->select('dst_column_id', $columns, $values, $errors) ?> + +
+ + + url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?> +
+ +

+
+
diff --git a/app/Template/column_move_restriction/remove.php b/app/Template/column_move_restriction/remove.php new file mode 100644 index 00000000..1985e167 --- /dev/null +++ b/app/Template/column_move_restriction/remove.php @@ -0,0 +1,14 @@ + + +
+

+ +

+ +
+ url->link(t('Yes'), 'ColumnMoveRestrictionController', 'remove', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), true, 'btn btn-red') ?> + url->link(t('cancel'), 'ProjectRoleController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> +
+
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 3be0da48..6e7fff05 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -38,6 +38,9 @@
  • app->checkMenuSelection('ProjectPermissionController') ?>> url->link(t('Permissions'), 'ProjectPermissionController', 'index', array('project_id' => $project['id'])) ?>
  • +
  • app->checkMenuSelection('ProjectRoleController') ?>> + url->link(t('Custom roles'), 'ProjectRoleController', 'show', array('project_id' => $project['id'])) ?> +
  • app->checkMenuSelection('ActionController') ?>> url->link(t('Automatic actions'), 'ActionController', 'index', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project_role/create.php b/app/Template/project_role/create.php new file mode 100644 index 00000000..8eee8f70 --- /dev/null +++ b/app/Template/project_role/create.php @@ -0,0 +1,18 @@ +
    + +
    + form->csrf() ?> + form->hidden('project_id', $values) ?> + + form->label(t('Role'), 'role') ?> + form->text('role', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + +
    + + + url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?> +
    +
    +
    diff --git a/app/Template/project_role/remove.php b/app/Template/project_role/remove.php new file mode 100644 index 00000000..25875e3a --- /dev/null +++ b/app/Template/project_role/remove.php @@ -0,0 +1,14 @@ + + +
    +

    + +

    + +
    + url->link(t('Yes'), 'ProjectRoleController', 'remove', array('project_id' => $project['id'], 'role_id' => $role['role_id']), true, 'btn btn-red') ?> + url->link(t('cancel'), 'ProjectRoleController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> +
    +
    diff --git a/app/Template/project_role/show.php b/app/Template/project_role/show.php new file mode 100644 index 00000000..2114a1c9 --- /dev/null +++ b/app/Template/project_role/show.php @@ -0,0 +1,58 @@ + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + text->e($restriction['src_column_title']) ?> + + text->e($restriction['dst_column_title']) ?> + + + url->link(t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), false, 'popover') ?> +
    + + -- cgit v1.2.3