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() {
|
Ext.onReady ( function() {
|
||||||
setExtStateManagerSetProvider('casesGrid', action);
|
setExtStateManagerSetProvider('casesGrid', action);
|
||||||
|
|
||||||
var ids = '';
|
var ids = '',
|
||||||
var filterProcess = '';
|
filterProcess = '',
|
||||||
var filterCategory = '';
|
filterCategory = '',
|
||||||
var filterUser = '';
|
filterUser = '',
|
||||||
var caseIdToDelete = '';
|
caseIdToDelete = '',
|
||||||
var caseIdToUnpause = '';
|
caseIdToUnpause = '',
|
||||||
var caseIndexToUnpause = '';
|
caseIndexToUnpause = '',
|
||||||
|
searchProcessId = '';
|
||||||
try {
|
try {
|
||||||
parent._action = action;
|
parent._action = action;
|
||||||
}
|
}
|
||||||
@@ -1016,15 +1017,46 @@ Ext.onReady ( function() {
|
|||||||
scope: this,
|
scope: this,
|
||||||
'select': function() {
|
'select': function() {
|
||||||
filterProcess = suggestProcess.value;
|
filterProcess = suggestProcess.value;
|
||||||
if ( action == 'search' ){
|
if (action === 'search') {
|
||||||
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
||||||
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
||||||
}
|
}
|
||||||
storeCases.setBaseParam('process', filterProcess);
|
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 = {
|
var resetProcessButton = {
|
||||||
text:'X',
|
text:'X',
|
||||||
ctCls:"pm_search_x_button_des",
|
ctCls:"pm_search_x_button_des",
|
||||||
|
|||||||
Reference in New Issue
Block a user