Improvement the list Advanced Search
This commit is contained in:
@@ -137,8 +137,9 @@ function getUserArray ($action, $userUid)
|
|||||||
{
|
{
|
||||||
global $oAppCache;
|
global $oAppCache;
|
||||||
$status = array ();
|
$status = array ();
|
||||||
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" ));
|
|
||||||
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" ));
|
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" ));
|
||||||
|
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" ));
|
||||||
|
|
||||||
//now get users, just for the Search action
|
//now get users, just for the Search action
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
|
|||||||
@@ -35,6 +35,40 @@ G::LoadClass( 'case' );
|
|||||||
|
|
||||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||||
|
|
||||||
|
if ($actionAjax == "userValues") {
|
||||||
|
//global $oAppCache;
|
||||||
|
$oAppCache = new AppCacheView();
|
||||||
|
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
|
||||||
|
$users = array();
|
||||||
|
$users[] = array ("USR_UID" => "", "USR_FULLNAME" => G::LoadTranslation( "ID_ALL_USERS" ));
|
||||||
|
$users[] = array ("USR_UID" => "CURRENT_USER", "USR_FULLNAME" => G::LoadTranslation( "ID_CURRENT_USER" ));
|
||||||
|
|
||||||
|
//now get users, just for the Search action
|
||||||
|
switch ($action) {
|
||||||
|
case 'search_simple':
|
||||||
|
case 'search':
|
||||||
|
$cUsers = new Criteria( 'workflow' );
|
||||||
|
$cUsers->clearSelectColumns();
|
||||||
|
$cUsers->addSelectColumn( UsersPeer::USR_UID );
|
||||||
|
$cUsers->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||||
|
$cUsers->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||||
|
$cUsers->addAscendingOrderByColumn( UsersPeer::USR_LASTNAME );
|
||||||
|
$oDataset = UsersPeer::doSelectRS( $cUsers );
|
||||||
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$oDataset->next();
|
||||||
|
while ($aRow = $oDataset->getRow()) {
|
||||||
|
$users[] = array ("USR_UID" => $aRow['USR_UID'],"USR_FULLNAME" => $aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME']);
|
||||||
|
$oDataset->next();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return $users;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//return $users;
|
||||||
|
return print G::json_encode( $users );
|
||||||
|
}
|
||||||
|
|
||||||
if ($actionAjax == "processListExtJs") {
|
if ($actionAjax == "processListExtJs") {
|
||||||
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
|
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
|
||||||
$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
|
$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
|
||||||
|
|||||||
@@ -860,7 +860,8 @@ Ext.onReady ( function() {
|
|||||||
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
||||||
}
|
}
|
||||||
storeCases.setBaseParam('process', filterProcess);
|
storeCases.setBaseParam('process', filterProcess);
|
||||||
storeCases.load({params:{process: filterProcess, start : 0 , limit : pageSize}});
|
//
|
||||||
|
//storeCases.load({params:{process: filterProcess, start : 0 , limit : pageSize}});
|
||||||
}},
|
}},
|
||||||
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
||||||
});
|
});
|
||||||
@@ -901,7 +902,7 @@ Ext.onReady ( function() {
|
|||||||
btnReassign.show();
|
btnReassign.show();
|
||||||
}*/
|
}*/
|
||||||
storeCases.setBaseParam( 'user', filterProcess);
|
storeCases.setBaseParam( 'user', filterProcess);
|
||||||
storeCases.load({params:{user: filterProcess, start : 0 , limit : pageSize}});
|
//storeCases.load({params:{user: filterProcess, start : 0 , limit : pageSize}});
|
||||||
}},
|
}},
|
||||||
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
||||||
});
|
});
|
||||||
@@ -931,7 +932,7 @@ Ext.onReady ( function() {
|
|||||||
filterCategory = comboCategory.value;
|
filterCategory = comboCategory.value;
|
||||||
storeCases.setBaseParam('category', filterCategory);
|
storeCases.setBaseParam('category', filterCategory);
|
||||||
storeCases.setBaseParam('process', '');
|
storeCases.setBaseParam('process', '');
|
||||||
storeCases.load({params:{category: filterCategory, start : 0 , limit : pageSize}});
|
//storeCases.load({params:{category: filterCategory, start : 0 , limit : pageSize}});
|
||||||
|
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url : 'casesList_Ajax' ,
|
url : 'casesList_Ajax' ,
|
||||||
@@ -1051,42 +1052,48 @@ Ext.onReady ( function() {
|
|||||||
storeCases.setBaseParam( 'status', filterStatus);
|
storeCases.setBaseParam( 'status', filterStatus);
|
||||||
storeCases.setBaseParam( 'start', 0);
|
storeCases.setBaseParam( 'start', 0);
|
||||||
storeCases.setBaseParam( 'limit', pageSize);
|
storeCases.setBaseParam( 'limit', pageSize);
|
||||||
storeCases.load();
|
//storeCases.load();
|
||||||
}},
|
}},
|
||||||
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
||||||
});
|
});
|
||||||
|
|
||||||
// ComboBox creation processValues
|
// ComboBox creation processValues
|
||||||
var comboUser = new Ext.form.ComboBox({
|
var comboUser = new Ext.form.ComboBox({
|
||||||
width : 160,
|
store : new Ext.data.Store( {
|
||||||
boxMaxWidth : 180,
|
proxy : new Ext.data.HttpProxy( {
|
||||||
editable : true,
|
url : 'casesList_Ajax?actionAjax=userValues&action='+action,
|
||||||
displayField : 'USR_FULLNAME',
|
method : 'POST'
|
||||||
valueField : 'USR_UID',
|
|
||||||
mode : 'local',
|
|
||||||
forceSelection: false,
|
|
||||||
emptyText: _('ID_SELECT'),
|
|
||||||
selectOnFocus: true,
|
|
||||||
|
|
||||||
typeAhead: true,
|
|
||||||
mode: 'local',
|
|
||||||
autocomplete: true,
|
|
||||||
triggerAction: 'all',
|
|
||||||
|
|
||||||
store : new Ext.data.ArrayStore({
|
|
||||||
fields: ['USR_UID','USR_FULLNAME'],
|
|
||||||
data : userValues
|
|
||||||
}),
|
}),
|
||||||
|
reader : new Ext.data.JsonReader( {
|
||||||
|
fields : [ {
|
||||||
|
name : 'USR_UID'
|
||||||
|
}, {
|
||||||
|
name : 'USR_FULLNAME'
|
||||||
|
} ]
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
valueField : 'USR_UID',
|
||||||
|
displayField : 'USR_FULLNAME',
|
||||||
|
triggerAction : 'all',
|
||||||
|
emptyText : _('ID_SELECT'),
|
||||||
|
selectOnFocus : true,
|
||||||
|
editable : true,
|
||||||
|
width: 180,
|
||||||
|
allowBlank : true,
|
||||||
|
autocomplete: true,
|
||||||
|
typeAhead: true,
|
||||||
|
//allowBlankText : _('ID_SHOULD_SELECT_LANGUAGE_FROM_LIST'),
|
||||||
listeners:{
|
listeners:{
|
||||||
scope: this,
|
scope: this,
|
||||||
'select': function() {
|
'select': function() {
|
||||||
|
storeCases.setBaseParam("user", comboUser.store.getAt(0).get(comboUser.valueField));
|
||||||
filterUser = comboUser.value;
|
filterUser = comboUser.value;
|
||||||
storeCases.setBaseParam( 'user', filterUser);
|
storeCases.setBaseParam( 'user', filterUser);
|
||||||
storeCases.setBaseParam( 'start', 0);
|
storeCases.setBaseParam( 'start', 0);
|
||||||
storeCases.setBaseParam( 'limit', pageSize);
|
storeCases.setBaseParam( 'limit', pageSize);
|
||||||
storeCases.load();
|
//storeCases.load();
|
||||||
}},
|
}
|
||||||
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1106,10 +1113,16 @@ Ext.onReady ( function() {
|
|||||||
|
|
||||||
var btnSearch = new Ext.Button ({
|
var btnSearch = new Ext.Button ({
|
||||||
text: _('ID_SEARCH'),
|
text: _('ID_SEARCH'),
|
||||||
|
iconCls: 'button_menu_ext ss_sprite ss_page_find',
|
||||||
|
//cls: 'x-form-toolbar-standardButton',
|
||||||
handler: doSearch
|
handler: doSearch
|
||||||
});
|
});
|
||||||
|
|
||||||
function doSearch(){
|
function doSearch(){
|
||||||
|
//var viewText = Ext.getCmp('casesGrid').getView();
|
||||||
|
viewText.emptyText = _('ID_NO_RECORDS_FOUND');
|
||||||
|
//Ext.getCmp('casesGrid').getView().refresh();
|
||||||
|
|
||||||
searchText = textSearch.getValue();
|
searchText = textSearch.getValue();
|
||||||
storeCases.setBaseParam( 'search', searchText);
|
storeCases.setBaseParam( 'search', searchText);
|
||||||
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
||||||
@@ -1674,7 +1687,13 @@ Ext.onReady ( function() {
|
|||||||
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
||||||
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
storeCases.load({params:{ start : 0 , limit : pageSize }});
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
|
"->",
|
||||||
|
'-',
|
||||||
|
textSearch,
|
||||||
|
resetSearchButton,
|
||||||
|
btnSearch ,
|
||||||
|
' '
|
||||||
];
|
];
|
||||||
|
|
||||||
var firstToolbarSearch = new Ext.Toolbar({
|
var firstToolbarSearch = new Ext.Toolbar({
|
||||||
@@ -1695,10 +1714,11 @@ Ext.onReady ( function() {
|
|||||||
"-",
|
"-",
|
||||||
_("ID_USER"),
|
_("ID_USER"),
|
||||||
comboUser,
|
comboUser,
|
||||||
'-',
|
' '
|
||||||
textSearch,
|
//'-',
|
||||||
resetSearchButton,
|
//textSearch,
|
||||||
btnSearch
|
//resetSearchButton,
|
||||||
|
//btnSearch
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
//alert(action);
|
//alert(action);
|
||||||
@@ -1942,7 +1962,7 @@ var gridForm = new Ext.FormPanel({
|
|||||||
storeCases.setBaseParam("category", "");
|
storeCases.setBaseParam("category", "");
|
||||||
storeCases.setBaseParam("process", "");
|
storeCases.setBaseParam("process", "");
|
||||||
storeCases.setBaseParam("status", comboStatus.store.getAt(0).get(comboStatus.valueField));
|
storeCases.setBaseParam("status", comboStatus.store.getAt(0).get(comboStatus.valueField));
|
||||||
storeCases.setBaseParam("user", comboUser.store.getAt(0).get(comboUser.valueField));
|
//storeCases.setBaseParam("user", comboUser.store.getAt(0).get(comboUser.valueField));
|
||||||
storeCases.setBaseParam("search", textSearch.getValue());
|
storeCases.setBaseParam("search", textSearch.getValue());
|
||||||
storeCases.setBaseParam("dateFrom", dateFrom.getValue());
|
storeCases.setBaseParam("dateFrom", dateFrom.getValue());
|
||||||
storeCases.setBaseParam("dateTo", dateTo.getValue());
|
storeCases.setBaseParam("dateTo", dateTo.getValue());
|
||||||
@@ -1969,13 +1989,13 @@ var gridForm = new Ext.FormPanel({
|
|||||||
storeCases.setBaseParam("start", 0);
|
storeCases.setBaseParam("start", 0);
|
||||||
storeCases.setBaseParam("limit", pageSize);
|
storeCases.setBaseParam("limit", pageSize);
|
||||||
|
|
||||||
|
var viewText = Ext.getCmp('casesGrid').getView();
|
||||||
storeCases.removeAll();
|
storeCases.removeAll();
|
||||||
if (action != 'search') {
|
if (action != 'search') {
|
||||||
storeCases.load();
|
storeCases.load();
|
||||||
} else {
|
} else {
|
||||||
|
viewText.emptyText = _('ID_ENTER_SEARCH_CRITERIA');
|
||||||
storeCases.load( {params: { first: true}} );
|
storeCases.load( {params: { first: true}} );
|
||||||
PMExt.notify_time_out = 7;
|
|
||||||
PMExt.notify(_('ID_ADVANCEDSEARCH'), _('ID_ENTER_SEARCH_CRITERIA'));
|
|
||||||
}
|
}
|
||||||
//newPopUp.add(reassignGrid);
|
//newPopUp.add(reassignGrid);
|
||||||
newPopUp.add(gridForm);
|
newPopUp.add(gridForm);
|
||||||
|
|||||||
Reference in New Issue
Block a user