From e377f450ad9a97ae9031d852e9195b9092d3e9db Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 8 Jan 2017 12:16:05 -0500 Subject: Open form to create customer filters in modal box --- app/Template/custom_filter/add.php | 24 --------- app/Template/custom_filter/create.php | 21 ++++++++ app/Template/custom_filter/index.php | 90 ++++++++++++++++---------------- app/Template/project_header/dropdown.php | 2 +- 4 files changed, 68 insertions(+), 69 deletions(-) delete mode 100644 app/Template/custom_filter/add.php create mode 100644 app/Template/custom_filter/create.php (limited to 'app/Template') diff --git a/app/Template/custom_filter/add.php b/app/Template/custom_filter/add.php deleted file mode 100644 index 0b91226a..00000000 --- a/app/Template/custom_filter/add.php +++ /dev/null @@ -1,24 +0,0 @@ - -
- - form->csrf() ?> - form->hidden('project_id', $values) ?> - - form->label(t('Name'), 'name') ?> - form->text('name', $values, $errors, array('required', 'maxlength="100"')) ?> - - form->label(t('Filter'), 'filter') ?> - form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?> - - user->hasProjectAccess('ProjectEditController', 'show', $project['id'])): ?> - form->checkbox('is_shared', t('Share with all project members'), 1) ?> - - - form->checkbox('append', t('Append filter (instead of replacement)'), 1) ?> - -
- -
-
diff --git a/app/Template/custom_filter/create.php b/app/Template/custom_filter/create.php new file mode 100644 index 00000000..24e896ee --- /dev/null +++ b/app/Template/custom_filter/create.php @@ -0,0 +1,21 @@ + +
+ form->csrf() ?> + form->hidden('project_id', $values) ?> + + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> + + form->label(t('Filter'), 'filter') ?> + form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?> + + user->hasProjectAccess('ProjectEditController', 'show', $project['id'])): ?> + form->checkbox('is_shared', t('Share with all project members'), 1) ?> + + + form->checkbox('append', t('Append filter (instead of replacement)'), 1) ?> + + modal->submitButtons() ?> +
diff --git a/app/Template/custom_filter/index.php b/app/Template/custom_filter/index.php index 95356e64..d8d1c8e0 100644 --- a/app/Template/custom_filter/index.php +++ b/app/Template/custom_filter/index.php @@ -1,51 +1,53 @@ -
- - - - - - - - - - - - - - + + +
text->e($filter['name']) ?>text->e($filter['filter']) ?> - - - - + + + + + + + + + + + + + + + + + - - - - - -
text->e($filter['name']) ?>text->e($filter['filter']) ?> + + + + + + + + + + + + text->e($filter['owner_name'] ?: $filter['owner_username']) ?> + user->getId() || $this->user->hasProjectAccess('CustomFilterController', 'edit', $project['id'])): ?> + - - - - - - - text->e($filter['owner_name'] ?: $filter['owner_username']) ?> - user->getId() || $this->user->hasProjectAccess('CustomFilterController', 'edit', $project['id'])): ?> - - -
- +
-render('custom_filter/add', array('project' => $project, 'values' => $values, 'errors' => $errors)) ?> diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php index 7fcdfb55..3f11838d 100644 --- a/app/Template/project_header/dropdown.php +++ b/app/Template/project_header/dropdown.php @@ -32,7 +32,7 @@ user->hasProjectAccess('CustomFilterController', 'index', $project['id'])): ?>
  • - url->icon('filter', t('Custom filters'), 'CustomFilterController', 'index', array('project_id' => $project['id'])) ?> + modal->medium('filter', t('Add custom filters'), 'CustomFilterController', 'create', array('project_id' => $project['id'])) ?>
  • -- cgit v1.2.3