Skip to content

Commit

Permalink
[jan] Add saved queries to sidebar menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Sep 30, 2016
1 parent ed51e04 commit 324ba5f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions whups/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v3.1.0-git
----------

[jan] Add saved queries to sidebar menu.
[jan] Store incoming email messages separately from attachments.
[jan] Return due dates in API methods.
[jan] Add batch-deletion of tickets from result lists.
Expand Down
20 changes: 20 additions & 0 deletions whups/lib/Application.php
Expand Up @@ -107,9 +107,29 @@ public function perms()

public function sidebar($sidebar)
{
global $registry, $session;

$sidebar->addNewButton(
_("_New Ticket"),
Horde::url('ticket/create.php'));
$sidebar->containers['queries'] = array(
'header' => array(
'id' => 'whups-toggle-queries',
'label' => _("Saved Queries"),
),
);
$manager = new Whups_Query_Manager();
$queries = $manager->listQueries($registry->getAuth(), true);
foreach ($queries as $id => $query) {
$row = array(
'selected' => strpos(strval(Horde::selfUrl()), $registry->get('webroot') . '/query') === 0 &&
$id == $session->get('whups', 'query'),
'cssClass' => 'whups-sidebar-query',
'url' => Whups::urlFor('query', empty($query['slug']) ? array('id' => $id) : array('slug' => $query['slug'])),
'label' => $query['name'],
);
$sidebar->addRow($row, 'queries');
}
}

/**
Expand Down
8 changes: 6 additions & 2 deletions whups/package.xml
Expand Up @@ -16,7 +16,7 @@
<email>jan@horde.org</email>
<active>yes</active>
</lead>
<date>2016-06-23</date>
<date>2016-09-30</date>
<version>
<release>3.1.0</release>
<api>3.0.0</api>
Expand All @@ -27,6 +27,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsdl.php">BSD-2-Clause</license>
<notes>
* [jan] Add saved queries to sidebar menu.
* [jan] Store incoming email messages separately from attachments.
* [jan] Return due dates in API methods.
* [jan] Add batch-deletion of tickets from result lists.
Expand Down Expand Up @@ -455,6 +456,7 @@
<file name="favicon.ico" role="horde" />
<file name="query.png" role="horde" />
<file name="reports.png" role="horde" />
<file name="save.png" role="horde" />
<file name="whups.png" role="horde" />
<file name="za.png" role="horde" />
</dir> <!-- /themes/default/graphics -->
Expand Down Expand Up @@ -902,6 +904,7 @@
<install as="whups/themes/default/graphics/favicon.ico" name="themes/default/graphics/favicon.ico" />
<install as="whups/themes/default/graphics/query.png" name="themes/default/graphics/query.png" />
<install as="whups/themes/default/graphics/reports.png" name="themes/default/graphics/reports.png" />
<install as="whups/themes/default/graphics/save.png" name="themes/default/graphics/save.png" />
<install as="whups/themes/default/graphics/whups.png" name="themes/default/graphics/whups.png" />
<install as="whups/themes/default/graphics/za.png" name="themes/default/graphics/za.png" />
<install as="whups/ticket/.htaccess" name="ticket/.htaccess" />
Expand Down Expand Up @@ -1235,9 +1238,10 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2016-06-23</date>
<date>2016-09-30</date>
<license uri="http://www.horde.org/licenses/bsdl.php">BSD-2-Clause</license>
<notes>
* [jan] Add saved queries to sidebar menu.
* [jan] Store incoming email messages separately from attachments.
* [jan] Return due dates in API methods.
* [jan] Add batch-deletion of tickets from result lists.
Expand Down
3 changes: 1 addition & 2 deletions whups/query/run.php
Expand Up @@ -27,6 +27,7 @@
} else {
$whups_query = $session->get('whups', 'query');
}
$session->set('whups', 'query', $whups_query);
} catch (Whups_Exception $e) {
$notification->push($e->getMessage());
}
Expand Down Expand Up @@ -107,5 +108,3 @@
}

$page_output->footer();

$session->set('whups', 'query', $whups_query);
Binary file added whups/themes/default/graphics/save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions whups/themes/default/screen.css
Expand Up @@ -105,3 +105,6 @@ div#comments div {
.whups-admin {
background-image: url('graphics/admin.png');
}
.whups-sidebar-query {
background-image: url('graphics/save.png');
}

0 comments on commit 324ba5f

Please sign in to comment.