BUG 7197 New feature request: "Categories" column/filter... SOLVED
- According to the specifications. - Was added the filter "Categories" only when Solar is disabled.
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
$oAppCache->confCasesList = $confCasesList;
|
||||
|
||||
//get values for the comboBoxes
|
||||
$processes = getProcessArray($action, $userUid );
|
||||
$processes[] = array ( '', G::LoadTranslation('ID_ALL_PROCESS'));
|
||||
$status = getStatusArray($action, $userUid );
|
||||
$category = getCategoryArray();
|
||||
$users = getUserArray($action, $userUid );
|
||||
@@ -125,95 +125,6 @@
|
||||
$oHeadPublisher->assign('FORMATS',$c->getFormats());
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
//functions to fill the comboboxes in the case list page
|
||||
function getProcessArray ( $action, $userUid ) {
|
||||
global $oAppCache;
|
||||
$processes = Array();
|
||||
$processes[] = array ( '', G::LoadTranslation('ID_ALL_PROCESS') );
|
||||
|
||||
//get the list based in the action provided
|
||||
|
||||
// G::pr($action);die;
|
||||
switch ( $action ) {
|
||||
case 'draft' :
|
||||
$cProcess = $oAppCache->getDraftListCriteria($userUid); //fast enough
|
||||
break;
|
||||
case 'sent' :
|
||||
$cProcess = $oAppCache->getSentListProcessCriteria ($userUid); // fast enough
|
||||
break;
|
||||
case 'simple_search':
|
||||
case 'search' :
|
||||
//in search action, the query to obtain all process is too slow, so we need to query directly to
|
||||
//process and content tables, and for that reason we need the current language in AppCacheView.
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE','','','','');
|
||||
$appCacheViewEngine = $oConf->aConfig;
|
||||
$lang = isset($appCacheViewEngine['LANG']) ? $appCacheViewEngine['LANG'] : 'en';
|
||||
|
||||
$cProcess = new Criteria('workflow');
|
||||
$cProcess->clearSelectColumns ( );
|
||||
$cProcess->addSelectColumn ( ProcessPeer::PRO_UID );
|
||||
$cProcess->addSelectColumn ( ContentPeer::CON_VALUE );
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$conds = array();
|
||||
$conds[] = array(ProcessPeer::PRO_UID, ContentPeer::CON_ID );
|
||||
$conds[] = array(ContentPeer::CON_CATEGORY, $del . 'PRO_TITLE' . $del);
|
||||
$conds[] = array(ContentPeer::CON_LANG, $del . $lang . $del);
|
||||
$cProcess->addJoinMC($conds, Criteria::LEFT_JOIN);
|
||||
$cProcess->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
||||
$oDataset = ProcessPeer::doSelectRS($cProcess);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while($aRow = $oDataset->getRow()){
|
||||
$processes[] = array ( $aRow['PRO_UID'], $aRow['CON_VALUE'] );
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $processes;
|
||||
break;
|
||||
case 'unassigned' :
|
||||
$cProcess = $oAppCache->getUnassignedListCriteria($userUid);
|
||||
break;
|
||||
case 'paused' :
|
||||
$cProcess = $oAppCache->getPausedListCriteria($userUid);
|
||||
break;
|
||||
case 'to_revise' :
|
||||
$cProcess = $oAppCache->getToReviseListCriteria($userUid);
|
||||
break;
|
||||
case 'to_reassign' :
|
||||
$cProcess = $oAppCache->getToReassignListCriteria();
|
||||
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
|
||||
break;
|
||||
case 'gral' :
|
||||
$cProcess = $oAppCache->getGeneralListCriteria();
|
||||
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
|
||||
break;
|
||||
case 'todo' :
|
||||
default:
|
||||
$cProcess = $oAppCache->getToDoListCriteria($userUid); //fast enough
|
||||
break;
|
||||
}
|
||||
|
||||
//get the processes for this user in this action
|
||||
$cProcess->clearSelectColumns();
|
||||
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
|
||||
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
|
||||
$cProcess->setDistinct(AppCacheViewPeer::PRO_UID);
|
||||
|
||||
$oDataset = AppCacheViewPeer::doSelectRS($cProcess);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while($aRow = $oDataset->getRow()){
|
||||
$processes[] = array ( $aRow['PRO_UID'], $aRow['APP_PRO_TITLE'] );
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $processes;
|
||||
}
|
||||
|
||||
function getUserArray ( $action, $userUid ) {
|
||||
global $oAppCache;
|
||||
$status = array();
|
||||
|
||||
@@ -794,6 +794,21 @@ Ext.onReady ( function() {
|
||||
'</div></tpl>'
|
||||
);
|
||||
|
||||
Ext.Ajax.request({
|
||||
url : 'casesList_Ajax' ,
|
||||
params : {actionAjax : 'processListExtJs',
|
||||
action: action,
|
||||
CATEGORY_UID: filterCategory},
|
||||
success: function ( result, request ) {
|
||||
processValues = Ext.util.JSON.decode(result.responseText);
|
||||
comboProcess.getStore().removeAll();
|
||||
comboProcess.getStore().loadData(processValues);
|
||||
},
|
||||
failure: function ( result, request) {
|
||||
Ext.MessageBox.alert('Failed', result.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
var comboProcess = new Ext.form.ComboBox({
|
||||
width : 200,
|
||||
boxMaxWidth : 200,
|
||||
@@ -893,6 +908,7 @@ Ext.onReady ( function() {
|
||||
|
||||
filterCategory = comboCategory.value;
|
||||
storeCases.setBaseParam('category', filterCategory);
|
||||
storeCases.setBaseParam('process', '');
|
||||
storeCases.load({params:{category: filterCategory, start : 0 , limit : pageSize}});
|
||||
|
||||
Ext.Ajax.request({
|
||||
@@ -905,6 +921,7 @@ Ext.onReady ( function() {
|
||||
comboProcess.getStore().removeAll();
|
||||
comboProcess.getStore().loadData( data );
|
||||
comboProcess.setValue('');
|
||||
|
||||
},
|
||||
failure: function ( result, request) {
|
||||
Ext.MessageBox.alert('Failed', result.responseText);
|
||||
@@ -1858,25 +1875,25 @@ var gridForm = new Ext.FormPanel({
|
||||
//Manually trigger the data store load
|
||||
switch (action) {
|
||||
case "draft":
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
case "sent":
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("status", comboStatus.store.getAt(0).get(comboStatus.valueField));
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
case "to_revise":
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
case "to_reassign":
|
||||
storeCases.setBaseParam("user", comboAllUsers.store.getAt(0).get(comboAllUsers.valueField));
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
case "search":
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("status", comboStatus.store.getAt(0).get(comboStatus.valueField));
|
||||
storeCases.setBaseParam("user", comboUser.store.getAt(0).get(comboUser.valueField));
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
@@ -1884,16 +1901,16 @@ var gridForm = new Ext.FormPanel({
|
||||
storeCases.setBaseParam("dateTo", dateTo.getValue());
|
||||
break;
|
||||
case "unassigned":
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
case "gral":
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
default:
|
||||
//todo
|
||||
storeCases.setBaseParam("process", comboProcess.store.getAt(0).get(comboProcess.valueField));
|
||||
storeCases.setBaseParam("process", '');
|
||||
storeCases.setBaseParam("search", textSearch.getValue());
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user