Skip to content
Snippets Groups Projects
Commit 6513f58f authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

queue: Fix crash if no advanced search in session

parent 67bd50b9
Branches
Tags
No related merge requests found
...@@ -6,7 +6,12 @@ ...@@ -6,7 +6,12 @@
// $adhoc - not FALSE if an adhoc advanced search exists // $adhoc - not FALSE if an adhoc advanced search exists
?> ?>
<li class="item <?php if ($child_selected) echo 'child active'; ?>"> <li class="item <?php if ($child_selected) echo 'child active'; ?>">
<a href="tickets.php?queue=adhoc"><i class="icon-sort-down pull-right"></i><?php echo __('Search'); <?php
$href = 'href="tickets.php?queue=adhoc"';
if (!isset($_SESSION['advsearch']))
$href = 'href="#" data-dialog="ajax.php/tickets/search"';
?>
<a <?php echo $href; ?>><i class="icon-sort-down pull-right"></i><?php echo __('Search');
?></a> ?></a>
<div class="customQ-dropdown"> <div class="customQ-dropdown">
<ul class="scroll-height"> <ul class="scroll-height">
...@@ -22,12 +27,14 @@ ...@@ -22,12 +27,14 @@
} ?> } ?>
<li> <li>
<h4><?php echo __('Recent Searches'); ?></h4> <h4><?php echo __('Recent Searches'); ?></h4>
<?php foreach ($_SESSION['advsearch'] as $token=>$criteria) { <?php if (isset($_SESSION['advsearch'])) {
$q = new SavedSearch(array('root' => 'T')); foreach ($_SESSION['advsearch'] as $token=>$criteria) {
$q->id = 'adhoc,'.$token; $q = new SavedSearch(array('root' => 'T'));
$q->title = $q->describeCriteria($criteria); $q->id = 'adhoc,'.$token;
$q->title = $q->describeCriteria($criteria);
include 'queue-subnavigation.tmpl.php'; include 'queue-subnavigation.tmpl.php';
}
} ?> } ?>
<!-- Dropdown Titles --> <!-- Dropdown Titles -->
</li> </li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment