summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/view_private.php1
-rw-r--r--app/Template/custom_filter/add.php22
-rw-r--r--app/Template/custom_filter/edit.php30
-rw-r--r--app/Template/custom_filter/index.php40
-rw-r--r--app/Template/project/dropdown.php4
-rw-r--r--app/Template/project/filters.php11
-rw-r--r--app/Template/project/sidebar.php3
7 files changed, 111 insertions, 0 deletions
diff --git a/app/Template/board/view_private.php b/app/Template/board/view_private.php
index d4c2c651..63d261f6 100644
--- a/app/Template/board/view_private.php
+++ b/app/Template/board/view_private.php
@@ -5,6 +5,7 @@
'filters' => $filters,
'categories_list' => $categories_list,
'users_list' => $users_list,
+ 'custom_filters_list' => $custom_filters_list,
'is_board' => true,
)) ?>
diff --git a/app/Template/custom_filter/add.php b/app/Template/custom_filter/add.php
new file mode 100644
index 00000000..d4e102b3
--- /dev/null
+++ b/app/Template/custom_filter/add.php
@@ -0,0 +1,22 @@
+<div class="page-header">
+ <h2><?= t('Add a new filter') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('customfilter', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
+
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('project_id', $values) ?>
+
+ <?= $this->form->label(t('Name'), 'name') ?>
+ <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="100"')) ?>
+
+ <?= $this->form->label(t('Filter'), 'filter') ?>
+ <?= $this->form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?>
+
+ <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
+ <?= $this->form->checkbox('is_shared', t('Share with all project members'), 1) ?>
+ <?php endif ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue">
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Template/custom_filter/edit.php b/app/Template/custom_filter/edit.php
new file mode 100644
index 00000000..7525574c
--- /dev/null
+++ b/app/Template/custom_filter/edit.php
@@ -0,0 +1,30 @@
+<div class="page-header">
+ <h2><?= t('Edit custom filter') ?></h2>
+</div>
+
+<form method="post" action="<?= $this->url->href('customfilter', 'update', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?>" autocomplete="off">
+
+ <?= $this->form->csrf() ?>
+
+ <?= $this->form->hidden('id', $values) ?>
+ <?= $this->form->hidden('user_id', $values) ?>
+ <?= $this->form->hidden('project_id', $values) ?>
+
+ <?= $this->form->label(t('Name'), 'name') ?>
+ <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?>
+
+ <?= $this->form->label(t('Filter'), 'filter') ?>
+ <?= $this->form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?>
+
+ <?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
+ <?= $this->form->checkbox('is_shared', t('Share with all project members'), 1, $values['is_shared'] == 1) ?>
+ <?php else: ?>
+ <?= $this->form->hidden('is_shared', $values) ?>
+ <?php endif ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue">
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Template/custom_filter/index.php b/app/Template/custom_filter/index.php
new file mode 100644
index 00000000..a53d0d0a
--- /dev/null
+++ b/app/Template/custom_filter/index.php
@@ -0,0 +1,40 @@
+<?php if (! empty($custom_filters)): ?>
+<div class="page-header">
+ <h2><?= t('Custom filters') ?></h2>
+</div>
+<div>
+ <table>
+ <tr>
+ <th><?= t('Name') ?></th>
+ <th><?= t('Filter') ?></th>
+ <th><?= t('Shared') ?></th>
+ <th><?= t('Owner') ?></th>
+ <th><?= t('Actions') ?></th>
+ </tr>
+ <?php foreach ($custom_filters as $filter): ?>
+ <tr>
+ <td><?= $this->e($filter['name']) ?></td>
+ <td><?= $this->e($filter['filter']) ?></td>
+ <td>
+ <?php if ($filter['is_shared'] == 1): ?>
+ <?= t('Yes') ?>
+ <?php else: ?>
+ <?= t('No') ?>
+ <?php endif ?>
+ </td>
+ <td><?= $this->e($filter['owner_name'] ?: $filter['owner_username']) ?></td>
+ <td>
+ <?php if ($filter['user_id'] == $this->user->getId() || $this->user->isProjectManagementAllowed($project['id'])): ?>
+ <ul>
+ <li><?= $this->url->link(t('Remove'), 'customfilter', 'remove', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), true) ?></li>
+ <li><?= $this->url->link(t('Edit'), 'customfilter', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li>
+ </ul>
+ <?php endif ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+</div>
+<?php endif ?>
+
+<?= $this->render('custom_filter/add', array('project' => $project, 'values' => $values, 'errors' => $errors)) ?> \ No newline at end of file
diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php
index 96b6a43a..1eb87b0e 100644
--- a/app/Template/project/dropdown.php
+++ b/app/Template/project/dropdown.php
@@ -2,6 +2,10 @@
<i class="fa fa-dashboard fa-fw"></i>&nbsp;
<?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
</li>
+<li>
+ <i class="fa fa-filter fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
+</li>
<?php if ($project['is_public']): ?>
<li>
diff --git a/app/Template/project/filters.php b/app/Template/project/filters.php
index 5b9ac472..c8f09fee 100644
--- a/app/Template/project/filters.php
+++ b/app/Template/project/filters.php
@@ -86,5 +86,16 @@
</ul>
</div>
<?php endif ?>
+
+ <?php if (isset($custom_filters_list) && ! empty($custom_filters_list)): ?>
+ <div class="dropdown filters">
+ <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('My filters') ?></a>
+ <ul>
+ <?php foreach ($custom_filters_list as $filter): ?>
+ <li><a href="#" class="filter-helper" data-filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li>
+ <?php endforeach ?>
+ </ul>
+ </div>
+ <?php endif ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php
index 482a95d2..d8b35e3b 100644
--- a/app/Template/project/sidebar.php
+++ b/app/Template/project/sidebar.php
@@ -4,6 +4,9 @@
<li <?= $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
+ <li <?= $this->app->getRouterController() === 'customfilter' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
+ <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
+ </li>
<?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>>