BUG 9830 "En Advanced Search no funciona la busqueda por..." SOLVED
- In AdvancedSearch no performs searches for user and category
- Problem solved, have been added to SOLR missing criteria for the search
- Note. - To register/upgrade the new criteria in the SOLR server, run the
following script:
$ php reindex_solr.php workspace_name reindexall
* Available from version 2.0.45
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -170,18 +170,23 @@ class Applications
|
||||
}
|
||||
*/
|
||||
|
||||
// add the process filter
|
||||
if ($process != '') {
|
||||
$Criteria->add( AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL );
|
||||
//Add the process filter
|
||||
if (!empty($process)) {
|
||||
$Criteria->add(AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
// add the category filter
|
||||
if ($category != '') {
|
||||
$Criteria->addAlias( 'CP', 'PROCESS' );
|
||||
$Criteria->add( 'CP.PRO_CATEGORY', $category, Criteria::EQUAL );
|
||||
$Criteria->addJoin( AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN );
|
||||
$Criteria->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' );
|
||||
//Add the category filter
|
||||
if (!empty($category)) {
|
||||
$Criteria->addAlias("CP", "PROCESS");
|
||||
$Criteria->add("CP.PRO_CATEGORY", $category, Criteria::EQUAL);
|
||||
$Criteria->addJoin(AppCacheViewPeer::PRO_UID, "CP.PRO_UID", Criteria::LEFT_JOIN);
|
||||
$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
|
||||
@@ -314,11 +319,13 @@ class Applications
|
||||
if ($doCountAlreadyExecuted == false) {
|
||||
// in the case of reassign the distinct attribute shows a diferent count result comparing to the
|
||||
// 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;
|
||||
} else {
|
||||
$distinct = true;
|
||||
}
|
||||
|
||||
// first check if there is a PMTable defined within the list,
|
||||
// the issue that brokes the normal criteria query seems to be fixed
|
||||
if (isset( $oAppCache->confCasesList['PMTable'] ) && ! empty( $oAppCache->confCasesList['PMTable'] )) {
|
||||
|
||||
@@ -47,16 +47,18 @@ class AppCacheView extends BaseAppCacheView
|
||||
|
||||
public function getListCounters($type, $userUid, $processSummary)
|
||||
{
|
||||
$distinct = true;
|
||||
|
||||
switch ($type) {
|
||||
case 'to_do':
|
||||
$criteria = $this->getToDoCountCriteria($userUid);
|
||||
$distinct = false;
|
||||
break;
|
||||
case 'draft':
|
||||
$criteria = $this->getDraftCountCriteria($userUid);
|
||||
break;
|
||||
case 'sent':
|
||||
$criteria = $this->getSentCountCriteria($userUid);
|
||||
//return AppCacheViewPeer::doCount($criteria, true);
|
||||
break;
|
||||
case 'selfservice':
|
||||
$criteria = $this->getUnassignedCountCriteria($userUid);
|
||||
@@ -77,7 +79,7 @@ class AppCacheView extends BaseAppCacheView
|
||||
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);
|
||||
}
|
||||
|
||||
//paused
|
||||
//Paused
|
||||
$sqlAppDelay = $this->getAppDelaySql(AppCacheViewPeer::APP_UID, AppCacheViewPeer::DEL_INDEX);
|
||||
|
||||
$criteria->add(
|
||||
//todo - getToDo()
|
||||
//ToDo - getToDo()
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL))->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
|
||||
)->addOr(
|
||||
//draft - getDraft()
|
||||
//Draft - getDraft()
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "DRAFT", CRITERIA::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_THREAD_STATUS, "OPEN"))->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
|
||||
)->addOr(
|
||||
//paused
|
||||
//Paused
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "PAUSED")->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_UID, AppCacheViewPeer::APP_UID . " IN ($sqlAppDelay)", Criteria::CUSTOM))
|
||||
)->addOr(
|
||||
//cancelled - getCancelled()
|
||||
//Cancelled - getCancelled()
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "CANCELLED", CRITERIA::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "CLOSED"))
|
||||
)->addOr(
|
||||
//completed - getCompleted()
|
||||
//Completed - getCompleted()
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "COMPLETED", CRITERIA::EQUAL)
|
||||
);
|
||||
|
||||
if (!$doCount) {
|
||||
//completed - getCompleted()
|
||||
//Completed - getCompleted()
|
||||
$criteria->addGroupByColumn(AppCacheViewPeer::APP_UID);
|
||||
|
||||
//$criteria->addGroupByColumn(AppCacheViewPeer::USR_UID);
|
||||
|
||||
Reference in New Issue
Block a user