BUG 9605 "Change default advanced search options" SOLVED
- Change default advanced search options, for get cases information of the current user - Solved, added new option "Current user" in DropDown Users set to default in Advanced Search
This commit is contained in:
@@ -214,7 +214,9 @@
|
||||
function getUserArray ( $action, $userUid ) {
|
||||
global $oAppCache;
|
||||
$status = array();
|
||||
$users[] = array( '', G::LoadTranslation('ID_ALL_USERS') );
|
||||
$users[] = array("CURRENT_USER", G::LoadTranslation("ID_CURRENT_USER"));
|
||||
$users[] = array("", G::LoadTranslation("ID_ALL_USERS"));
|
||||
|
||||
//now get users, just for the Search action
|
||||
switch ( $action ) {
|
||||
case 'search_simple':
|
||||
@@ -242,7 +244,9 @@
|
||||
function getAllUsersArray ( $action ) {
|
||||
global $oAppCache;
|
||||
$status = array();
|
||||
$users[] = array( '', G::LoadTranslation('ID_ALL_USERS') );
|
||||
$users[] = array("CURRENT_USER", G::LoadTranslation("ID_CURRENT_USER"));
|
||||
$users[] = array("", G::LoadTranslation("ID_ALL_USERS"));
|
||||
|
||||
if ($action=='to_reassign') {
|
||||
//now get users, just for the Search action
|
||||
$cUsers = $oAppCache->getToReassignListCriteria();
|
||||
|
||||
@@ -1,46 +1,89 @@
|
||||
<?php
|
||||
|
||||
// getting the extJs parameters
|
||||
$callback = isset ( $_POST ['callback'] ) ? $_POST ['callback'] : 'stcCallback1001';
|
||||
$dir = isset ( $_POST ['dir'] ) ? $_POST ['dir'] : 'DESC';
|
||||
$sort = isset ( $_POST ['sort'] ) ? $_POST ['sort'] : '';
|
||||
$start = isset ( $_POST ['start'] ) ? $_POST ['start'] : '0';
|
||||
$limit = isset ( $_POST ['limit'] ) ? $_POST ['limit'] : '25';
|
||||
$filter = isset ( $_POST ['filter'] ) ? $_POST ['filter'] : '';
|
||||
$search = isset ( $_POST ['search'] ) ? $_POST ['search'] : '';
|
||||
$process = isset ( $_POST ['process'] ) ? $_POST ['process'] : '';
|
||||
$user = isset ( $_POST ['user'] ) ? $_POST ['user'] : '';
|
||||
$status = isset ( $_POST ['status'] ) ? strtoupper ( $_POST ['status'] ) : '';
|
||||
$action = isset ( $_GET ['action'] ) ? $_GET ['action'] : (isset ( $_POST ['action'] ) ? $_POST ['action'] : 'todo');
|
||||
$type = isset ( $_GET ['type'] ) ? $_GET ['type'] : (isset ( $_POST ['type'] ) ? $_POST ['type'] : 'extjs');
|
||||
$user = isset ( $_POST ['user'] ) ? $_POST ['user'] : '';
|
||||
$dateFrom = isset ( $_POST ['dateFrom'] ) ? substr ( $_POST ['dateFrom'], 0, 10 ) : '';
|
||||
$dateTo = isset ( $_POST ['dateTo'] ) ? substr ( $_POST ['dateTo'], 0, 10 ) : '';
|
||||
//Getting the extJs parameters
|
||||
$callback = isset($_POST["callback"])? $_POST["callback"] : "stcCallback1001";
|
||||
$dir = isset($_POST["dir"])? $_POST["dir"] : "DESC";
|
||||
$sort = isset($_POST["sort"])? $_POST["sort"] : "";
|
||||
$start = isset($_POST["start"])? $_POST["start"] : "0";
|
||||
$limit = isset($_POST["limit"])? $_POST["limit"] : "25";
|
||||
$filter = isset($_POST ["filter"])? $_POST["filter"] : "";
|
||||
$process = isset($_POST["process"])? $_POST["process"] : "";
|
||||
$status = isset($_POST["status"])? strtoupper($_POST["status"]) : "";
|
||||
$user = isset($_POST["user"])? $_POST["user"] : "";
|
||||
$search = isset($_POST["search"])? $_POST["search"] : "";
|
||||
$action = isset($_GET["action"])? $_GET["action"] : (isset($_POST["action"])? $_POST["action"] : "todo");
|
||||
$type = isset($_GET["type"])? $_GET["type"] : (isset($_POST["type"])? $_POST["type"] : "extjs");
|
||||
$dateFrom = isset($_POST["dateFrom"])? substr($_POST["dateFrom"], 0, 10) : "";
|
||||
$dateTo = isset($_POST["dateTo"])? substr($_POST["dateTo"], 0, 10) : "";
|
||||
|
||||
try {
|
||||
$result = "";
|
||||
$result = "";
|
||||
|
||||
$userUid = (isset ( $_SESSION ['USER_LOGGED'] ) && $_SESSION ['USER_LOGGED'] != '') ? $_SESSION ['USER_LOGGED'] : null;
|
||||
|
||||
if (($action == 'todo' || $action == 'draft' || $action == 'sent' || $action == 'selfservice' || $action == 'unassigned' || $action == 'search') && (($solrConf = System::solrEnv()) !== false)) {
|
||||
G::LoadClass ( 'AppSolr' );
|
||||
$ApplicationSolrIndex = new AppSolr ($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
|
||||
|
||||
$data = $ApplicationSolrIndex->getAppGridData ( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort );
|
||||
$result = G::json_encode ( $data );
|
||||
}
|
||||
else {
|
||||
G::LoadClass ( 'applications' );
|
||||
$apps = new Applications ();
|
||||
$data = $apps->getAll ( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort );
|
||||
|
||||
$result = G::json_encode ( $data );
|
||||
}
|
||||
echo $result;
|
||||
$userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "")? $_SESSION["USER_LOGGED"] : null;
|
||||
$user = ($user == "CURRENT_USER")? $userUid : $user;
|
||||
|
||||
if ((
|
||||
$action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" ||
|
||||
$action == "unassigned" || $action == "search"
|
||||
)
|
||||
&&
|
||||
(($solrConf = System::solrEnv()) !== false)
|
||||
) {
|
||||
G::LoadClass("AppSolr");
|
||||
|
||||
$ApplicationSolrIndex = new AppSolr(
|
||||
$solrConf["solr_enabled"],
|
||||
$solrConf["solr_host"],
|
||||
$solrConf["solr_instance"]
|
||||
);
|
||||
|
||||
$data = $ApplicationSolrIndex->getAppGridData(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
$action,
|
||||
$filter,
|
||||
$search,
|
||||
$process,
|
||||
$user,
|
||||
$status,
|
||||
$type,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$callback,
|
||||
$dir,
|
||||
$sort
|
||||
);
|
||||
|
||||
$result = G::json_encode($data);
|
||||
} else {
|
||||
G::LoadClass("applications");
|
||||
|
||||
$apps = new Applications();
|
||||
$data = $apps->getAll(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
$action,
|
||||
$filter,
|
||||
$search,
|
||||
$process,
|
||||
$user,
|
||||
$status,
|
||||
$type,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$callback,
|
||||
$dir,
|
||||
$sort
|
||||
);
|
||||
|
||||
$result = G::json_encode($data);
|
||||
}
|
||||
|
||||
echo $result;
|
||||
} catch (Exception $e) {
|
||||
$msg = array("error" => $e->getMessage());
|
||||
|
||||
echo G::json_encode($msg);
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
$msg = array (
|
||||
'error' => $e->getMessage ()
|
||||
);
|
||||
print G::json_encode ( $msg );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user