2012-05-15 17:41:12 -04:00
|
|
|
<?php
|
2011-02-17 15:40:35 +00:00
|
|
|
|
2012-05-15 17:41:12 -04:00
|
|
|
// 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 ) : '';
|
2011-02-17 15:40:35 +00:00
|
|
|
|
2012-05-15 17:41:12 -04:00
|
|
|
try {
|
|
|
|
|
$result = "";
|
|
|
|
|
|
|
|
|
|
$userUid = (isset ( $_SESSION ['USER_LOGGED'] ) && $_SESSION ['USER_LOGGED'] != '') ? $_SESSION ['USER_LOGGED'] : null;
|
|
|
|
|
|
2012-07-13 11:56:46 -04:00
|
|
|
if (($action == 'todo' || $action == 'draft' || $action == 'sent' || $action == 'selfservice' || $action == 'unassigned' || $action == 'search') && (($solrConf = System::solrEnv()) !== false)) {
|
2012-05-15 17:41:12 -04:00
|
|
|
G::LoadClass ( 'AppSolr' );
|
|
|
|
|
$ApplicationSolrIndex = new AppSolr ($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
|
BUG 0000 herbert> SOLR implementation in PMOS2
Solr support in PMOS2 includes:
Functionality:
- Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results.
- Include read, unread, all, and process filter in inbox View.
- Include process filter in draft view.
- Include started by me, completed by me, all, process, and status filter in participated view.
- Include process filter in unassigned view.
- Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user.
+ Use of wildcards in search: Use * as wildcard at the begin or end of word
+ Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20.
+ Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd]
Local date not UTC date required
ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30.
+ we can use the wildcard *:
ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30.
FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15.
+ Search of exact phrases. format: {variable}:"frase a buscar"
ex: Cliente:"Jesus Marin"
- Application update function.
+ The function is called every time a change is detected in the application's data including the related delegations.
- Use of cache to improve performance
Not included:
- Order of task, sent by, and due date columns.
Pending:
- Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
|
|
|
|
2012-05-15 17:41:12 -04:00
|
|
|
$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 );
|
BUG 0000 herbert> SOLR implementation in PMOS2
Solr support in PMOS2 includes:
Functionality:
- Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results.
- Include read, unread, all, and process filter in inbox View.
- Include process filter in draft view.
- Include started by me, completed by me, all, process, and status filter in participated view.
- Include process filter in unassigned view.
- Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user.
+ Use of wildcards in search: Use * as wildcard at the begin or end of word
+ Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20.
+ Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd]
Local date not UTC date required
ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30.
+ we can use the wildcard *:
ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30.
FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15.
+ Search of exact phrases. format: {variable}:"frase a buscar"
ex: Cliente:"Jesus Marin"
- Application update function.
+ The function is called every time a change is detected in the application's data including the related delegations.
- Use of cache to improve performance
Not included:
- Order of task, sent by, and due date columns.
Pending:
- Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
|
|
|
|
2012-05-15 17:41:12 -04:00
|
|
|
$result = G::json_encode ( $data );
|
2011-02-17 15:40:35 +00:00
|
|
|
}
|
2012-05-15 17:41:12 -04:00
|
|
|
echo $result;
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception $e ) {
|
|
|
|
|
$msg = array (
|
|
|
|
|
'error' => $e->getMessage ()
|
|
|
|
|
);
|
|
|
|
|
print G::json_encode ( $msg );
|
|
|
|
|
}
|