Merged in bugfix/HOR-2814-A (pull request #5629)
HOR-2814 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -16,7 +16,8 @@ require_once 'classes/model/om/BaseListInbox.php';
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListInbox extends BaseListInbox
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
private $additionalClassName = '';
|
||||
|
||||
/**
|
||||
* Create List Inbox Table
|
||||
*
|
||||
@@ -384,19 +385,27 @@ class ListInbox extends BaseListInbox
|
||||
self::create($data, $isSelfService);
|
||||
}
|
||||
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
/**
|
||||
* This function add restriction in the query related to the filters
|
||||
* @param Criteria $criteria, must be contain only select of columns
|
||||
* @param array $filters
|
||||
* @param array $additionalColumns information about the new columns related to custom cases list
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadFilters(&$criteria, $filters, $additionalColumns = array())
|
||||
{
|
||||
$action = isset($filters['action']) ? $filters['action'] : "";
|
||||
$usrUid = isset($filters['usr_uid']) ? $filters['usr_uid'] : "";
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
$process = isset($filters['process']) ? $filters['process'] : "";
|
||||
$category = isset($filters['category']) ? $filters['category'] : "";
|
||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : "";
|
||||
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : "";
|
||||
$filterStatus = isset($filters['filterStatus']) ? $filters['filterStatus'] : "";
|
||||
$newestthan = isset($filters['newestthan']) ? $filters['newestthan'] : '';
|
||||
$oldestthan = isset($filters['oldestthan']) ? $filters['oldestthan'] : '';
|
||||
$action = isset($filters['action']) ? $filters['action'] : '';
|
||||
$usrUid = isset($filters['usr_uid']) ? $filters['usr_uid'] : '';
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : '';
|
||||
$search = isset($filters['search']) ? $filters['search'] : '';
|
||||
$caseLink = isset($filters['caseLink']) ? $filters['caseLink'] : '';
|
||||
$process = isset($filters['process']) ? $filters['process'] : '';
|
||||
$category = isset($filters['category']) ? $filters['category'] : '';
|
||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : '';
|
||||
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : '';
|
||||
$filterStatus = isset($filters['filterStatus']) ? $filters['filterStatus'] : '';
|
||||
$newestthan = isset($filters['newestthan']) ? $filters['newestthan'] : '';
|
||||
$oldestthan = isset($filters['oldestthan']) ? $filters['oldestthan'] : '';
|
||||
|
||||
//Check the inbox to call
|
||||
switch ($action) {
|
||||
@@ -463,21 +472,14 @@ class ListInbox extends BaseListInbox
|
||||
|
||||
//Filter Search
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_PRO_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
//Check if we need to search to the APP_UID
|
||||
if (!empty($caseLink)) {
|
||||
$criteria->add(ListInboxPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
}
|
||||
}
|
||||
|
||||
//Filter Process Id
|
||||
@@ -504,17 +506,20 @@ class ListInbox extends BaseListInbox
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $usr_uid
|
||||
* @param array $filters
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @return array
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$pmTable = new PmTable();
|
||||
$criteria = $pmTable->addPMFieldsToList('todo');
|
||||
|
||||
$list = isset($filters['action']) ? $filters['action'] : "";
|
||||
$criteria = $pmTable->addPMFieldsToList($list);
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
$filters['usr_uid'] = $usr_uid;
|
||||
|
||||
$criteria->addSelectColumn(ListInboxPeer::APP_UID);
|
||||
@@ -542,7 +547,7 @@ class ListInbox extends BaseListInbox
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addJoin(ListInboxPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
self::loadFilters($criteria, $filters);
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ?
|
||||
ListInboxPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||
@@ -615,7 +620,7 @@ class ListInbox extends BaseListInbox
|
||||
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param string $usrUid
|
||||
* @param array $filters
|
||||
|
||||
@@ -14,7 +14,8 @@ require_once 'classes/model/om/BaseListParticipatedLast.php';
|
||||
*/
|
||||
class ListParticipatedLast extends BaseListParticipatedLast
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
private $additionalClassName = '';
|
||||
|
||||
/**
|
||||
* Create List Participated History Table.
|
||||
*
|
||||
@@ -234,10 +235,18 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
/**
|
||||
* This function add restriction in the query related to the filters
|
||||
* @param Criteria $criteria, must be contain only select of columns
|
||||
* @param array $filters
|
||||
* @param array $additionalColumns information about the new columns related to custom cases list
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadFilters(&$criteria, $filters, $additionalColumns = array())
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : '';
|
||||
$search = isset($filters['search']) ? $filters['search'] : '';
|
||||
$caseLink = isset($filters['caseLink']) ? $filters['caseLink'] : '';
|
||||
$process = isset($filters['process']) ? $filters['process'] : '';
|
||||
$category = isset($filters['category']) ? $filters['category'] : '';
|
||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : '';
|
||||
@@ -271,25 +280,24 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
break;
|
||||
}
|
||||
|
||||
//Filter Search
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TITLE, '%'.$search.'%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TAS_TITLE, '%'.$search.'%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
//Check if we need to search to the APP_UID
|
||||
if (!empty($caseLink)) {
|
||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
}
|
||||
}
|
||||
|
||||
//Filter Process Id
|
||||
if ($process != '') {
|
||||
$criteria->add(ListParticipatedLastPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
//Filter Category
|
||||
if ($category != '') {
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||
$aConditions = array();
|
||||
@@ -308,10 +316,21 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @param string $appUid related to the specific case
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null, $appUid = '')
|
||||
{
|
||||
$pmTable = new PmTable();
|
||||
$criteria = $pmTable->addPMFieldsToList('sent');
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
|
||||
$criteria->addSelectColumn(ListParticipatedLastPeer::APP_UID);
|
||||
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX);
|
||||
@@ -343,7 +362,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $appUid, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
self::loadFilters($criteria, $filters);
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ?
|
||||
ListParticipatedLastPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||
|
||||
@@ -17,7 +17,8 @@ require_once 'classes/model/om/BaseListPaused.php';
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListPaused extends BaseListPaused
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
private $additionalClassName = '';
|
||||
|
||||
/**
|
||||
* Create List Paused Table
|
||||
*
|
||||
@@ -212,13 +213,21 @@ class ListPaused extends BaseListPaused
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
/**
|
||||
* This function add restriction in the query related to the filters
|
||||
* @param Criteria $criteria, must be contain only select of columns
|
||||
* @param array $filters
|
||||
* @param array $additionalColumns information about the new columns related to custom cases list
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadFilters(&$criteria, $filters, $additionalColumns = array())
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
$process = isset($filters['process']) ? $filters['process'] : "";
|
||||
$category = isset($filters['category']) ? $filters['category'] : "";
|
||||
$filterStatus = isset($filters['filterStatus']) ? $filters['filterStatus'] : "";
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : '';
|
||||
$search = isset($filters['search']) ? $filters['search'] : '';
|
||||
$caseLink = isset($filters['caseLink']) ? $filters['caseLink'] : '';
|
||||
$process = isset($filters['process']) ? $filters['process'] : '';
|
||||
$category = isset($filters['category']) ? $filters['category'] : '';
|
||||
$filterStatus = isset($filters['filterStatus']) ? $filters['filterStatus'] : '';
|
||||
|
||||
//Filter Read Unread All
|
||||
switch ($filter) {
|
||||
@@ -230,25 +239,24 @@ class ListPaused extends BaseListPaused
|
||||
break;
|
||||
}
|
||||
|
||||
//Filter Search
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
//Check if we need to search to the APP_UID
|
||||
if (!empty($caseLink)) {
|
||||
$criteria->add(ListPausedPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
}
|
||||
}
|
||||
|
||||
//Filter Process Id
|
||||
if ($process != '') {
|
||||
$criteria->add(ListPausedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
//Filter Category
|
||||
if ($category != '') {
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||
$aConditions = array();
|
||||
@@ -258,11 +266,21 @@ class ListPaused extends BaseListPaused
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
$pmTable = new PmTable();
|
||||
$criteria = $pmTable->addPMFieldsToList('paused');
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
|
||||
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
|
||||
$criteria->addSelectColumn(ListPausedPeer::USR_UID);
|
||||
@@ -287,7 +305,7 @@ class ListPaused extends BaseListPaused
|
||||
$criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE);
|
||||
$criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY);
|
||||
$criteria->add(ListPausedPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
||||
self::loadFilters($criteria, $filters);
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? ListPausedPeer::TABLE_NAME.'.'.$filters['sort'] : "APP_PAUSED_DATE";
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
|
||||
@@ -17,8 +17,9 @@ require_once 'classes/model/om/BaseListUnassigned.php';
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListUnassigned extends BaseListUnassigned
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
private $additionalClassName = '';
|
||||
private $total = 0;
|
||||
|
||||
/**
|
||||
* Create List Unassigned Table
|
||||
*
|
||||
@@ -165,34 +166,41 @@ class ListUnassigned extends BaseListUnassigned
|
||||
return true;
|
||||
}
|
||||
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
/**
|
||||
* This function add restriction in the query related to the filters
|
||||
* @param Criteria $criteria, must be contain only select of columns
|
||||
* @param array $filters
|
||||
* @param array $additionalColumns information about the new columns related to custom cases list
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadFilters(&$criteria, $filters, $additionalColumns = array())
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
$process = isset($filters['process']) ? $filters['process'] : "";
|
||||
$category = isset($filters['category']) ? $filters['category'] : "";
|
||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : "";
|
||||
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : "";
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : '';
|
||||
$search = isset($filters['search']) ? $filters['search'] : '';
|
||||
$caseLink = isset($filters['caseLink']) ? $filters['caseLink'] : '';
|
||||
$process = isset($filters['process']) ? $filters['process'] : '';
|
||||
$category = isset($filters['category']) ? $filters['category'] : '';
|
||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : '';
|
||||
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : '';
|
||||
|
||||
//Filter Search
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
//Check if we need to search to the APP_UID
|
||||
if (!empty($caseLink)) {
|
||||
$criteria->add(ListUnassignedPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
}
|
||||
}
|
||||
|
||||
//Filter Process Id
|
||||
if ($process != '') {
|
||||
$criteria->add(ListUnassignedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
//Filter Category
|
||||
if ($category != '') {
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||
$aConditions = array();
|
||||
@@ -202,12 +210,22 @@ class ListUnassigned extends BaseListUnassigned
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
$pmTable = new PmTable();
|
||||
$tasks = $this->getSelfServiceTasks($usr_uid);
|
||||
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
|
||||
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
||||
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
|
||||
@@ -282,7 +300,7 @@ class ListUnassigned extends BaseListUnassigned
|
||||
}
|
||||
|
||||
//Apply some filters
|
||||
self::loadFilters($criteria, $filters);
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
$sort = (!empty($filters['sort'])) ?
|
||||
ListUnassignedPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||
"LIST_UNASSIGNED.DEL_DELEGATE_DATE";
|
||||
|
||||
Reference in New Issue
Block a user