Merge remote branch 'upstream/master' into BUG-9717

This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-11-06 09:37:28 -04:00
6 changed files with 763 additions and 263 deletions

View File

@@ -14,6 +14,9 @@ if( isset($request) ){
} }
if (is_array($_SESSION[$_POST["formID"]][$_POST["gridname"]])) { if (is_array($_SESSION[$_POST["formID"]][$_POST["gridname"]])) {
if (!is_array($_SESSION[$_POST["formID"]][$_POST["gridname"]])) {
$_SESSION[$_POST["formID"]][$_POST["gridname"]] = (array)$_SESSION[$_POST["formID"]][$_POST["gridname"]];
}
ksort($_SESSION[$_POST["formID"]][$_POST["gridname"]]); ksort($_SESSION[$_POST["formID"]][$_POST["gridname"]]);
$oFields = array(); $oFields = array();
$initialKey = 1; $initialKey = 1;

File diff suppressed because it is too large Load Diff

View File

@@ -170,18 +170,23 @@ class Applications
} }
*/ */
// add the process filter //Add the process filter
if ($process != '') { if (!empty($process)) {
$Criteria->add( AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL ); $Criteria->add(AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL);
$CriteriaCount->add( AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL ); $CriteriaCount->add(AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL);
} }
// add the category filter //Add the category filter
if ($category != '') { if (!empty($category)) {
$Criteria->addAlias( 'CP', 'PROCESS' ); $Criteria->addAlias("CP", "PROCESS");
$Criteria->add( 'CP.PRO_CATEGORY', $category, Criteria::EQUAL ); $Criteria->add("CP.PRO_CATEGORY", $category, Criteria::EQUAL);
$Criteria->addJoin( AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN ); $Criteria->addJoin(AppCacheViewPeer::PRO_UID, "CP.PRO_UID", Criteria::LEFT_JOIN);
$Criteria->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' ); $Criteria->addAsColumn("CATEGORY_UID", "CP.PRO_CATEGORY");
$CriteriaCount->addAlias("CP", "PROCESS");
$CriteriaCount->add("CP.PRO_CATEGORY", $category, Criteria::EQUAL);
$CriteriaCount->addJoin(AppCacheViewPeer::PRO_UID, "CP.PRO_UID", Criteria::LEFT_JOIN);
$CriteriaCount->addAsColumn("CATEGORY_UID", "CP.PRO_CATEGORY");
} }
// add the user filter // add the user filter
@@ -314,11 +319,13 @@ class Applications
if ($doCountAlreadyExecuted == false) { if ($doCountAlreadyExecuted == false) {
// in the case of reassign the distinct attribute shows a diferent count result comparing to the // in the case of reassign the distinct attribute shows a diferent count result comparing to the
// original list // original list
if (($action == "to_reassign" || $action == "todo") || ($status == "TO_DO")) { //Check also $distinct in the method getListCounters(), this in AppCacheView.php
$distinct = true;
if (($action == "todo" || $action == "to_reassign") || ($status == "TO_DO")) {
$distinct = false; $distinct = false;
} else {
$distinct = true;
} }
// first check if there is a PMTable defined within the list, // first check if there is a PMTable defined within the list,
// the issue that brokes the normal criteria query seems to be fixed // the issue that brokes the normal criteria query seems to be fixed
if (isset( $oAppCache->confCasesList['PMTable'] ) && ! empty( $oAppCache->confCasesList['PMTable'] )) { if (isset( $oAppCache->confCasesList['PMTable'] ) && ! empty( $oAppCache->confCasesList['PMTable'] )) {

View File

@@ -47,16 +47,18 @@ class AppCacheView extends BaseAppCacheView
public function getListCounters($type, $userUid, $processSummary) public function getListCounters($type, $userUid, $processSummary)
{ {
$distinct = true;
switch ($type) { switch ($type) {
case 'to_do': case 'to_do':
$criteria = $this->getToDoCountCriteria($userUid); $criteria = $this->getToDoCountCriteria($userUid);
$distinct = false;
break; break;
case 'draft': case 'draft':
$criteria = $this->getDraftCountCriteria($userUid); $criteria = $this->getDraftCountCriteria($userUid);
break; break;
case 'sent': case 'sent':
$criteria = $this->getSentCountCriteria($userUid); $criteria = $this->getSentCountCriteria($userUid);
//return AppCacheViewPeer::doCount($criteria, true);
break; break;
case 'selfservice': case 'selfservice':
$criteria = $this->getUnassignedCountCriteria($userUid); $criteria = $this->getUnassignedCountCriteria($userUid);
@@ -77,7 +79,7 @@ class AppCacheView extends BaseAppCacheView
return $type; return $type;
} }
return AppCacheViewPeer::doCount($criteria); return AppCacheViewPeer::doCount($criteria, $distinct);
} }
/** /**
@@ -1004,35 +1006,35 @@ class AppCacheView extends BaseAppCacheView
$criteria->add(AppCacheViewPeer::USR_UID, $userUid); $criteria->add(AppCacheViewPeer::USR_UID, $userUid);
} }
//paused //Paused
$sqlAppDelay = $this->getAppDelaySql(AppCacheViewPeer::APP_UID, AppCacheViewPeer::DEL_INDEX); $sqlAppDelay = $this->getAppDelaySql(AppCacheViewPeer::APP_UID, AppCacheViewPeer::DEL_INDEX);
$criteria->add( $criteria->add(
//todo - getToDo() //ToDo - getToDo()
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL)->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL))->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL))->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")) $criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
)->addOr( )->addOr(
//draft - getDraft() //Draft - getDraft()
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "DRAFT", CRITERIA::EQUAL)->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "DRAFT", CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN")) $criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
)->addOr( )->addOr(
//paused //Paused
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "PAUSED")->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "PAUSED")->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_UID, AppCacheViewPeer::APP_UID . " IN ($sqlAppDelay)", Criteria::CUSTOM)) $criteria->getNewCriterion(AppCacheViewPeer::APP_UID, AppCacheViewPeer::APP_UID . " IN ($sqlAppDelay)", Criteria::CUSTOM))
)->addOr( )->addOr(
//cancelled - getCancelled() //Cancelled - getCancelled()
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "CANCELLED", CRITERIA::EQUAL)->addAnd( $criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "CANCELLED", CRITERIA::EQUAL)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "CLOSED")) $criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "CLOSED"))
)->addOr( )->addOr(
//completed - getCompleted() //Completed - getCompleted()
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "COMPLETED", CRITERIA::EQUAL) $criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "COMPLETED", CRITERIA::EQUAL)
); );
if (!$doCount) { if (!$doCount) {
//completed - getCompleted() //Completed - getCompleted()
$criteria->addGroupByColumn(AppCacheViewPeer::APP_UID); $criteria->addGroupByColumn(AppCacheViewPeer::APP_UID);
//$criteria->addGroupByColumn(AppCacheViewPeer::USR_UID); //$criteria->addGroupByColumn(AppCacheViewPeer::USR_UID);

View File

@@ -20,16 +20,24 @@ try {
$userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "")? $_SESSION["USER_LOGGED"] : null; $userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "")? $_SESSION["USER_LOGGED"] : null;
$result = ""; $result = "";
switch ($action) {
case "search":
case "to_reassign":
$user = ($user == "CURRENT_USER")? $userUid : $user;
$userUid = $user;
break;
default:
break;
}
if (( if ((
$action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" || $action == "todo" || $action == "draft" || $action == "paused" || $action == "sent" ||
$action == "unassigned" || $action == "search" $action == "selfservice" || $action == "unassigned" || $action == "search"
) && ) &&
(($solrConf = System::solrEnv()) !== false) (($solrConf = System::solrEnv()) !== false)
) { ) {
G::LoadClass("AppSolr"); G::LoadClass("AppSolr");
$user = ($user == "CURRENT_USER")? $userUid : $user;
$ApplicationSolrIndex = new AppSolr( $ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"], $solrConf["solr_enabled"],
$solrConf["solr_host"], $solrConf["solr_host"],
@@ -44,30 +52,20 @@ try {
$filter, $filter,
$search, $search,
$process, $process,
$user, //delete
$status, $status,
$type, $type,
$dateFrom, $dateFrom,
$dateTo, $dateTo,
$callback, $callback,
$dir, $dir,
$sort $sort,
$category
); );
$result = G::json_encode($data); $result = G::json_encode($data);
} else { } else {
G::LoadClass("applications"); G::LoadClass("applications");
switch ($action) {
case "search":
case "to_reassign":
$user = ($user == "CURRENT_USER")? $userUid : $user;
$userUid = $user;
break;
default:
break;
}
$apps = new Applications(); $apps = new Applications();
$data = $apps->getAll( $data = $apps->getAll(
$userUid, $userUid,

View File

@@ -479,7 +479,7 @@ Ext.onReady ( function() {
function renderNote(val,p,r) { function renderNote(val,p,r) {
pro = r.json.PRO_UID; pro = r.json.PRO_UID;
tas = r.json.TAS_UID; tas = r.json.TAS_UID;
appUid = r.data['APP_UID']; appUid = r.data['APP_UID'];
title = r.data['APP_TITLE']; title = r.data['APP_TITLE'];
return '<img src="/images/ext/default/s.gif" class="x-tree-node-icon ICON_CASES_NOTES" unselectable="off" id="extdd-17" onClick="openCaseNotesWindow(\''+appUid+'\', true, \''+title+'\', \''+pro+'\', \''+tas+'\')">'; return '<img src="/images/ext/default/s.gif" class="x-tree-node-icon ICON_CASES_NOTES" unselectable="off" id="extdd-17" onClick="openCaseNotesWindow(\''+appUid+'\', true, \''+title+'\', \''+pro+'\', \''+tas+'\')">';
@@ -514,7 +514,7 @@ Ext.onReady ( function() {
if( c.id == 'unpauseLink') c.renderer = unpauseLink; if( c.id == 'unpauseLink') c.renderer = unpauseLink;
if( c.dataIndex == 'CASE_SUMMARY') c.renderer = renderSummary; if( c.dataIndex == 'CASE_SUMMARY') c.renderer = renderSummary;
if( c.dataIndex == 'CASE_NOTES_COUNT') c.renderer = renderNote; if( c.dataIndex == 'CASE_NOTES_COUNT') c.renderer = renderNote;
if (solrEnabled != 1) { if (solrEnabled == 0) {
if( c.dataIndex == 'APP_DEL_PREVIOUS_USER') c.renderer = previous_full_name; if( c.dataIndex == 'APP_DEL_PREVIOUS_USER') c.renderer = previous_full_name;
if( c.dataIndex == 'APP_CURRENT_USER') c.renderer = full_name; if( c.dataIndex == 'APP_CURRENT_USER') c.renderer = full_name;
} }
@@ -1459,8 +1459,6 @@ Ext.onReady ( function() {
value: '' value: ''
}); });
var optionCategory = (solrEnabled == 1)? [""] : [_("ID_CATEGORY"), comboCategory, "-"];
var toolbarTodo = [ var toolbarTodo = [
optionMenuOpen, optionMenuOpen,
{ {
@@ -1476,7 +1474,9 @@ Ext.onReady ( function() {
'-', '-',
btnAll, btnAll,
'->', // begin using the right-justified button container '->', // begin using the right-justified button container
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
@@ -1498,7 +1498,9 @@ Ext.onReady ( function() {
'-', '-',
btnAll, btnAll,
'->', // begin using the right-justified button container '->', // begin using the right-justified button container
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
@@ -1520,7 +1522,9 @@ Ext.onReady ( function() {
'-', '-',
btnAll, btnAll,
'->', // begin using the right-justified button container '->', // begin using the right-justified button container
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
@@ -1544,7 +1548,9 @@ Ext.onReady ( function() {
menu: menuItems menu: menuItems
}, },
'->', '->',
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
@@ -1561,7 +1567,9 @@ Ext.onReady ( function() {
var toolbarToRevise = [ var toolbarToRevise = [
optionMenuOpen, optionMenuOpen,
'->', // begin using the right-justified button container '->', // begin using the right-justified button container
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
@@ -1586,7 +1594,9 @@ Ext.onReady ( function() {
_("ID_USER"), _("ID_USER"),
comboAllUsers, comboAllUsers,
"-", "-",
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_("ID_PROCESS"), _("ID_PROCESS"),
comboProcess, comboProcess,
textSearch, textSearch,
@@ -1604,7 +1614,9 @@ Ext.onReady ( function() {
'-', '-',
btnAll, btnAll,
'->', // begin using the right-justified button container '->', // begin using the right-justified button container
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
@@ -1640,8 +1652,6 @@ Ext.onReady ( function() {
}) })
]; ];
var arrayAux = (solrEnabled == 1)? [""] : ["-", _("ID_USER"), comboUser];
var firstToolbarSearch = new Ext.Toolbar({ var firstToolbarSearch = new Ext.Toolbar({
region: 'north', region: 'north',
width: '100%', width: '100%',
@@ -1649,13 +1659,17 @@ Ext.onReady ( function() {
items: [ items: [
optionMenuOpen, optionMenuOpen,
'->', '->',
optionCategory, _("ID_CATEGORY"),
comboCategory,
"-",
_('ID_PROCESS'), _('ID_PROCESS'),
comboProcess, comboProcess,
'-', '-',
_('ID_STATUS'), _('ID_STATUS'),
comboStatus, comboStatus,
arrayAux, "-",
_("ID_USER"),
comboUser,
'-', '-',
textSearch, textSearch,
resetSearchButton, resetSearchButton,
@@ -1878,46 +1892,50 @@ var gridForm = new Ext.FormPanel({
//Manually trigger the data store load //Manually trigger the data store load
switch (action) { switch (action) {
case "draft": case "draft":
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("category", "");
storeCases.setBaseParam("process", "");
storeCases.setBaseParam("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
case "sent": case "sent":
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("category", "");
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("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
case "to_revise": case "to_revise":
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("category", "");
storeCases.setBaseParam("process", "");
storeCases.setBaseParam("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
case "to_reassign": case "to_reassign":
storeCases.setBaseParam("user", comboAllUsers.store.getAt(0).get(comboAllUsers.valueField)); storeCases.setBaseParam("user", comboAllUsers.store.getAt(0).get(comboAllUsers.valueField));
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("category", "");
storeCases.setBaseParam("process", "");
storeCases.setBaseParam("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
case "search": case "search":
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("category", "");
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));
if (!(solrEnabled == 1)) {
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());
break; break;
case "unassigned": case "unassigned":
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("category", "");
storeCases.setBaseParam("process", "");
storeCases.setBaseParam("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
case "gral": case "gral":
storeCases.setBaseParam("process", ''); storeCases.setBaseParam("process", "");
storeCases.setBaseParam("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
default: default:
//todo //todo
storeCases.setBaseParam("process", ''); //paused
storeCases.setBaseParam("category", "");
storeCases.setBaseParam("process", "");
storeCases.setBaseParam("search", textSearch.getValue()); storeCases.setBaseParam("search", textSearch.getValue());
break; break;
} }
@@ -2031,6 +2049,7 @@ var gridForm = new Ext.FormPanel({
// Nothing to do // Nothing to do
} }
comboCategory.setValue("");
comboProcess.setValue(""); comboProcess.setValue("");
comboStatus.setValue(""); comboStatus.setValue("");
comboUser.setValue("CURRENT_USER"); comboUser.setValue("CURRENT_USER");