summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-13 10:57:36 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-13 10:57:36 -0500
commit70557833a7cad62c3e68af3c7df1a4d51e64d20b (patch)
tree2202442ee9fbfa868808ce9745d40061baa159d6 /app
parent047236711e0e92a4d00d3009eb2fccf97b78a538 (diff)
parent71dc812ae679b7940e70aa85990667c217a6a510 (diff)
Merge pull-request #1837
Diffstat (limited to 'app')
-rw-r--r--app/Controller/Customfilter.php17
-rw-r--r--app/Template/custom_filter/index.php2
-rw-r--r--app/Template/custom_filter/remove.php17
3 files changed, 35 insertions, 1 deletions
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
@@ -57,6 +57,23 @@ class Customfilter extends Base
}
/**
+ * 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
*
* @access public
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 @@
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
<ul>
- <li><?= $this->url->link(t('Remove'), 'customfilter', 'remove', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), true, 'popover') ?></li>
+ <li><?= $this->url->link(t('Remove'), 'customfilter', 'confirm', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), false, 'popover') ?></li>
<li><?= $this->url->link(t('Edit'), 'customfilter', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), false, 'popover') ?></li>
</ul>
</div>
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 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Remove a custom filter') ?></h2>
+ </div>
+
+ <div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this custom filter: "%s"?', $filter['name']) ?>
+ </p>
+
+ <div class="form-actions">
+ <?= $this->url->link(t('Yes'), 'customfilter', 'remove', array('project_id' => $project['id'], 'filter_id' => $filter['id']), true, 'btn btn-red') ?>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
+ </div>
+ </div>
+</section>