From 71dc812ae679b7940e70aa85990667c217a6a510 Mon Sep 17 00:00:00 2001 From: Nick Blackledge Date: Sat, 13 Feb 2016 22:06:23 +1100 Subject: Fixed issue with customer filter popover and added confirmation for removal --- app/Controller/Customfilter.php | 17 +++++++++++++++++ app/Template/custom_filter/index.php | 2 +- app/Template/custom_filter/remove.php | 17 +++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 app/Template/custom_filter/remove.php (limited to 'app') diff --git a/app/Controller/Customfilter.php b/app/Controller/Customfilter.php index da7eb77b..41da0b11 100644 --- a/app/Controller/Customfilter.php +++ b/app/Controller/Customfilter.php @@ -56,6 +56,23 @@ class Customfilter extends Base $this->index($values, $errors); } + /** + * Confirmation dialog before removing a custom filter + * + * @access public + */ + public function confirm() + { + $project = $this->getProject(); + $filter = $this->customFilter->getById($this->request->getIntegerParam('filter_id')); + + $this->response->html($this->helper->layout->project('custom_filter/remove', array( + 'project' => $project, + 'filter' => $filter, + 'title' => t('Remove a custom filter') + ))); + } + /** * Remove a custom filter * diff --git a/app/Template/custom_filter/index.php b/app/Template/custom_filter/index.php index 2994ae25..28b6a878 100644 --- a/app/Template/custom_filter/index.php +++ b/app/Template/custom_filter/index.php @@ -36,7 +36,7 @@ diff --git a/app/Template/custom_filter/remove.php b/app/Template/custom_filter/remove.php new file mode 100644 index 00000000..d4c67a2b --- /dev/null +++ b/app/Template/custom_filter/remove.php @@ -0,0 +1,17 @@ +
+ + +
+

+ +

+ +
+ url->link(t('Yes'), 'customfilter', 'remove', array('project_id' => $project['id'], 'filter_id' => $filter['id']), true, 'btn btn-red') ?> + + url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> +
+
+
-- cgit v1.2.3