Fixed issue with customer filter popover and added confirmation for removal

This commit is contained in:
Nick Blackledge 2016-02-13 22:06:23 +11:00
parent 77ae92b09b
commit 71dc812ae6
3 changed files with 35 additions and 1 deletions

View File

@ -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
*

View File

@ -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>

View File

@ -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>