Skip to content
Permalink
Browse files

Revert commit cedd612

This commit reverts commit cedd612 because it broke adhoc search queue name
(describe).

The spirit of the initial change was correct but support of complex criteria
wasn't needed after all due to difficulty supporting multiple organizations
- something we will revisit in the future.
  • Loading branch information...
protich committed Nov 21, 2019
1 parent 9ea8e77 commit 7dd7bfa078a05f87c489cdfaaab02fb910f37362
Showing with 7 additions and 26 deletions.
  1. +0 −13 include/class.queue.php
  2. +1 −6 include/class.search.php
  3. +6 −7 scp/tickets.php
@@ -68,7 +68,6 @@ class CustomQueue extends VerySimpleModel {
const FLAG_INHERIT_EVERYTHING = 0x158; // Maskf or all INHERIT flags
var $filters;
var $criteria;
var $_conditions;
@@ -113,14 +112,6 @@ function getPath() {
return $this->path ?: $this->buildPath();
}
function filter($filter) {
$this->filters[] = $filter;
}
function getFilters() {
return $this->filters ?: array();
}
function criteriaRequired() {
return true;
}
@@ -910,10 +901,6 @@ function getQuery($form=false, $quick_filter=null) {
// Start with basic criteria
$query = $this->getBasicQuery($form);
// Apply filers if any.
foreach ($this->getFilters() as $filter)
$query->filter($filter);
// Apply quick filter
if (isset($quick_filter)
&& ($qf = $this->getQuickFilterField($quick_filter))
@@ -1091,12 +1091,7 @@ function load($key) {
'staff_id' => $thisstaff->getId(),
'title' => __('Advanced Search'),
));
// if instance of Q then assume filters otherwise it's criteria.
if ($config instanceof Q)
$queue->filter($config);
else
$queue->config = $config;
$queue->config = $config;
return $queue;
}
@@ -57,15 +57,14 @@
if ($user
&& $_GET['a'] !== 'open'
) {
$Q = Q::any([
'user__emails__address' => $user->getDefaultEmailAddress(),
'user_id' => $user->id,
]);
$criteria = [
['user__emails__address', 'equal', $user->getDefaultEmailAddress()],
['user_id', 'equal', $user->id],
];
if ($S = $_GET['status'])
// The actual state is tracked by the key
$Q = Q::all(array('status__state' => $S, $Q));
$_SESSION['advsearch']['uid'] = $Q;
$criteria[] = ['status__state', 'includes', [$S => $S]];
$_SESSION['advsearch']['uid'] = $criteria;
$queue_id = "adhoc,uid";
}
// Search for organization tickets

0 comments on commit 7dd7bfa

Please sign in to comment.
You can’t perform that action at this time.