FBI-1964:(Cases List) Search criteria doesn't validate if the process exist or not
Code Style Corrections Corrections 2 Documentation Simplify Code Code Style
This commit is contained in:
@@ -490,13 +490,14 @@ function redirect(href){
|
||||
Ext.onReady ( function() {
|
||||
setExtStateManagerSetProvider('casesGrid', action);
|
||||
|
||||
var ids = '';
|
||||
var filterProcess = '';
|
||||
var filterCategory = '';
|
||||
var filterUser = '';
|
||||
var caseIdToDelete = '';
|
||||
var caseIdToUnpause = '';
|
||||
var caseIndexToUnpause = '';
|
||||
var ids = '',
|
||||
filterProcess = '',
|
||||
filterCategory = '',
|
||||
filterUser = '',
|
||||
caseIdToDelete = '',
|
||||
caseIdToUnpause = '',
|
||||
caseIndexToUnpause = '',
|
||||
searchProcessId = '';
|
||||
try {
|
||||
parent._action = action;
|
||||
}
|
||||
@@ -1016,15 +1017,46 @@ Ext.onReady ( function() {
|
||||
scope: this,
|
||||
'select': function() {
|
||||
filterProcess = suggestProcess.value;
|
||||
if ( action == 'search' ){
|
||||
if (action === 'search') {
|
||||
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
||||
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
||||
}
|
||||
storeCases.setBaseParam('process', filterProcess);
|
||||
},
|
||||
'blur': function () {
|
||||
var param = suggestProcess.getValue() !== '' ?
|
||||
processStore.getTotalCount() === 0 ?
|
||||
"null" :
|
||||
searchProcessId(suggestProcess.getValue(), processStore):
|
||||
suggestProcess.getValue() ;
|
||||
|
||||
storeCases.setBaseParam('process', param);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Search the PRO_UID in processStore with the value.
|
||||
* @param value
|
||||
* @param processStore
|
||||
* @returns {string}
|
||||
*/
|
||||
searchProcessId = function (value, processStore) {
|
||||
var i,
|
||||
totalProcessStore = processStore.getTotalCount();
|
||||
try {
|
||||
for (i = 0; i < totalProcessStore; i += 1) {
|
||||
if (processStore.data.items[i].data.PRO_TITLE === value ||
|
||||
processStore.data.items[i].data.PRO_UID === value) {
|
||||
return processStore.data.items[i].data.PRO_UID;
|
||||
}
|
||||
}
|
||||
return "null";
|
||||
} catch (e) {
|
||||
// Nothing to do
|
||||
}
|
||||
};
|
||||
|
||||
var resetProcessButton = {
|
||||
text:'X',
|
||||
ctCls:"pm_search_x_button_des",
|
||||
|
||||
Reference in New Issue
Block a user