HOR-2814
This commit is contained in:
@@ -54,6 +54,7 @@ class PmTable
|
|||||||
private $db;
|
private $db;
|
||||||
private $alterTable = true;
|
private $alterTable = true;
|
||||||
private $keepData = false;
|
private $keepData = false;
|
||||||
|
public $tableClassName = '';
|
||||||
|
|
||||||
public function __construct ($tableName = null)
|
public function __construct ($tableName = null)
|
||||||
{
|
{
|
||||||
@@ -67,7 +68,7 @@ class PmTable
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set oldTableName to pmTable
|
* Set oldTableName to pmTable
|
||||||
*
|
*
|
||||||
* @param string $oldTableName
|
* @param string $oldTableName
|
||||||
*/
|
*/
|
||||||
public function setOldTableName($oldTableName)
|
public function setOldTableName($oldTableName)
|
||||||
@@ -672,7 +673,7 @@ class PmTable
|
|||||||
$table = $this->oldTableName;
|
$table = $this->oldTableName;
|
||||||
$tableBackup = str_replace($this->tableName, $this->oldTableName, $tableBackup);
|
$tableBackup = str_replace($this->tableName, $this->oldTableName, $tableBackup);
|
||||||
$sqlTableBackup = str_replace($this->tableName, $this->oldTableName, $sqlTableBackup);
|
$sqlTableBackup = str_replace($this->tableName, $this->oldTableName, $sqlTableBackup);
|
||||||
|
|
||||||
//Delete backup if exists
|
//Delete backup if exists
|
||||||
$rs = $stmt->executeQuery(str_replace($table, $tableBackup, $queryStack["drop"]));
|
$rs = $stmt->executeQuery(str_replace($table, $tableBackup, $queryStack["drop"]));
|
||||||
|
|
||||||
@@ -955,6 +956,7 @@ class PmTable
|
|||||||
|
|
||||||
$additionalTable = AdditionalTablesPeer::retrieveByPK($additionalTableUid);
|
$additionalTable = AdditionalTablesPeer::retrieveByPK($additionalTableUid);
|
||||||
$tableName = $additionalTable->getAddTabName();
|
$tableName = $additionalTable->getAddTabName();
|
||||||
|
$this->tableClassName = $additionalTable->getAddTabClassName();
|
||||||
|
|
||||||
$additionalTable = new AdditionalTables();
|
$additionalTable = new AdditionalTables();
|
||||||
$tableData = $additionalTable->load($additionalTableUid, true);
|
$tableData = $additionalTable->load($additionalTableUid, true);
|
||||||
@@ -990,8 +992,12 @@ class PmTable
|
|||||||
$listTablePeer = 'ListInboxPeer';
|
$listTablePeer = 'ListInboxPeer';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//Some PMtables does not have the APP NUMBER columns, but if exist we must be use
|
||||||
$oCriteria->addJoin($listTablePeer::APP_UID, $tableName.'.APP_UID', Criteria::LEFT_JOIN);
|
if (in_array($tableName.'.APP_NUMBER', $oCriteria->getSelectColumns())) {
|
||||||
|
$oCriteria->addJoin($listTablePeer::APP_NUMBER, $tableName.'.APP_NUMBER', Criteria::LEFT_JOIN);
|
||||||
|
} else {
|
||||||
|
$oCriteria->addJoin($listTablePeer::APP_UID, $tableName.'.APP_UID', Criteria::LEFT_JOIN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $oCriteria;
|
return $oCriteria;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ require_once 'classes/model/om/BaseListInbox.php';
|
|||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListInbox extends BaseListInbox
|
class ListInbox extends BaseListInbox
|
||||||
{
|
{
|
||||||
// @codingStandardsIgnoreEnd
|
private $additionalClassName = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Inbox Table
|
* Create List Inbox Table
|
||||||
*
|
*
|
||||||
@@ -384,7 +385,14 @@ class ListInbox extends BaseListInbox
|
|||||||
self::create($data, $isSelfService);
|
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'] : "";
|
$action = isset($filters['action']) ? $filters['action'] : "";
|
||||||
$usrUid = isset($filters['usr_uid']) ? $filters['usr_uid'] : "";
|
$usrUid = isset($filters['usr_uid']) ? $filters['usr_uid'] : "";
|
||||||
@@ -463,21 +471,60 @@ class ListInbox extends BaseListInbox
|
|||||||
|
|
||||||
//Filter Search
|
//Filter Search
|
||||||
if ($search != '') {
|
if ($search != '') {
|
||||||
$criteria->add(
|
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||||
$criteria->getNewCriterion(ListInboxPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
if (count($additionalColumns) > 0) {
|
||||||
->addOr(
|
require_once(PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP . $this->additionalClassName . '.php');
|
||||||
$criteria->getNewCriterion(ListInboxPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
$oNewCriteria = new Criteria("workflow");
|
||||||
->addOr(
|
$oTmpCriteria = '';
|
||||||
$criteria->getNewCriterion(ListInboxPeer::APP_PRO_TITLE, '%' . $search . '%', Criteria::LIKE)
|
$sw = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//We prepare the query related to the custom cases list
|
||||||
|
foreach ($additionalColumns as $key => $value) {
|
||||||
|
if ($sw === 0) {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE);
|
||||||
|
} else {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE)->addOr($oTmpCriteria);
|
||||||
|
}
|
||||||
|
$sw = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($oTmpCriteria)) {
|
||||||
|
$criteria->add(
|
||||||
|
$criteria->getNewCriterion(ListInboxPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||||
->addOr(
|
->addOr(
|
||||||
$criteria->getNewCriterion(ListInboxPeer::APP_UID, $search, Criteria::EQUAL)
|
$criteria->getNewCriterion(ListInboxPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||||
->addOr(
|
->addOr(
|
||||||
$criteria->getNewCriterion(ListInboxPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
$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)
|
||||||
|
->addOr(
|
||||||
|
$oTmpCriteria
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
)
|
} else {
|
||||||
);
|
$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)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Filter Process Id
|
//Filter Process Id
|
||||||
@@ -504,16 +551,20 @@ class ListInbox extends BaseListInbox
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $usr_uid
|
* This function get the information in the corresponding cases list
|
||||||
* @param array $filters
|
* @param string $usr_uid, must be show cases related to this user
|
||||||
|
* @param array $filters for apply in the result
|
||||||
* @param null $callbackRecord
|
* @param null $callbackRecord
|
||||||
* @return array
|
* @return array $data
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
*/
|
*/
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$pmTable = new PmTable();
|
$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;
|
$filters['usr_uid'] = $usr_uid;
|
||||||
|
|
||||||
@@ -542,7 +593,7 @@ class ListInbox extends BaseListInbox
|
|||||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||||
$criteria->addJoin(ListInboxPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
$criteria->addJoin(ListInboxPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||||
self::loadFilters($criteria, $filters);
|
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||||
|
|
||||||
$sort = (!empty($filters['sort'])) ?
|
$sort = (!empty($filters['sort'])) ?
|
||||||
ListInboxPeer::TABLE_NAME.'.'.$filters['sort'] :
|
ListInboxPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||||
@@ -615,7 +666,7 @@ class ListInbox extends BaseListInbox
|
|||||||
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : null;
|
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of cases of a user
|
* Returns the number of cases of a user
|
||||||
* @param string $usrUid
|
* @param string $usrUid
|
||||||
* @param array $filters
|
* @param array $filters
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ require_once 'classes/model/om/BaseListParticipatedLast.php';
|
|||||||
*/
|
*/
|
||||||
class ListParticipatedLast extends BaseListParticipatedLast
|
class ListParticipatedLast extends BaseListParticipatedLast
|
||||||
{
|
{
|
||||||
// @codingStandardsIgnoreEnd
|
private $additionalClassName = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Participated History Table.
|
* Create List Participated History Table.
|
||||||
*
|
*
|
||||||
@@ -234,7 +235,14 @@ 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'] : '';
|
$filter = isset($filters['filter']) ? $filters['filter'] : '';
|
||||||
$search = isset($filters['search']) ? $filters['search'] : '';
|
$search = isset($filters['search']) ? $filters['search'] : '';
|
||||||
@@ -271,25 +279,64 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Search
|
||||||
if ($search != '') {
|
if ($search != '') {
|
||||||
$criteria->add(
|
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TITLE, '%'.$search.'%', Criteria::LIKE)
|
if (count($additionalColumns) > 0) {
|
||||||
->addOr(
|
require_once(PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP . $this->additionalClassName . '.php');
|
||||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TAS_TITLE, '%'.$search.'%', Criteria::LIKE)
|
$oNewCriteria = new Criteria("workflow");
|
||||||
->addOr(
|
$oTmpCriteria = '';
|
||||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_UID, $search, Criteria::EQUAL)
|
$sw = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//We prepare the query related to the custom cases list
|
||||||
|
foreach ($additionalColumns as $key => $value) {
|
||||||
|
if ($sw === 0) {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE);
|
||||||
|
} else {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE)->addOr($oTmpCriteria);
|
||||||
|
}
|
||||||
|
$sw = 1;
|
||||||
|
}
|
||||||
|
if (!empty($oTmpCriteria)) {
|
||||||
|
$criteria->add(
|
||||||
|
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||||
->addOr(
|
->addOr(
|
||||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
$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)
|
||||||
|
->addOr(
|
||||||
|
$oTmpCriteria
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
)
|
} else {
|
||||||
);
|
$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)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Process Id
|
||||||
if ($process != '') {
|
if ($process != '') {
|
||||||
$criteria->add(ListParticipatedLastPeer::PRO_UID, $process, Criteria::EQUAL);
|
$criteria->add(ListParticipatedLastPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Category
|
||||||
if ($category != '') {
|
if ($category != '') {
|
||||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||||
$aConditions = array();
|
$aConditions = array();
|
||||||
@@ -308,10 +355,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 = '')
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null, $appUid = '')
|
||||||
{
|
{
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$criteria = $pmTable->addPMFieldsToList('sent');
|
$criteria = $pmTable->addPMFieldsToList('sent');
|
||||||
|
$this->additionalClassName = $pmTable->tableClassName;
|
||||||
|
$additionalColumns = $criteria->getSelectColumns();
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::APP_UID);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX);
|
||||||
@@ -343,7 +401,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $appUid, Criteria::EQUAL);
|
$criteria->add(ListParticipatedLastPeer::APP_UID, $appUid, Criteria::EQUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
self::loadFilters($criteria, $filters);
|
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||||
|
|
||||||
$sort = (!empty($filters['sort'])) ?
|
$sort = (!empty($filters['sort'])) ?
|
||||||
ListParticipatedLastPeer::TABLE_NAME.'.'.$filters['sort'] :
|
ListParticipatedLastPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ require_once 'classes/model/om/BaseListPaused.php';
|
|||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListPaused extends BaseListPaused
|
class ListPaused extends BaseListPaused
|
||||||
{
|
{
|
||||||
// @codingStandardsIgnoreEnd
|
private $additionalClassName = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Paused Table
|
* Create List Paused Table
|
||||||
*
|
*
|
||||||
@@ -212,7 +213,14 @@ 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'] : "";
|
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||||
@@ -230,25 +238,64 @@ class ListPaused extends BaseListPaused
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Search
|
||||||
if ($search != '') {
|
if ($search != '') {
|
||||||
$criteria->add(
|
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||||
$criteria->getNewCriterion(ListPausedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
if (count($additionalColumns) > 0) {
|
||||||
->addOr(
|
require_once(PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP . $this->additionalClassName . '.php');
|
||||||
$criteria->getNewCriterion(ListPausedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
$oNewCriteria = new Criteria("workflow");
|
||||||
->addOr(
|
$oTmpCriteria = '';
|
||||||
$criteria->getNewCriterion(ListPausedPeer::APP_UID, $search, Criteria::EQUAL)
|
$sw = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//We prepare the query related to the custom cases list
|
||||||
|
foreach ($additionalColumns as $key => $value) {
|
||||||
|
if ($sw === 0) {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE);
|
||||||
|
} else {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE)->addOr($oTmpCriteria);
|
||||||
|
}
|
||||||
|
$sw = 1;
|
||||||
|
}
|
||||||
|
if (!empty($oTmpCriteria)) {
|
||||||
|
$criteria->add(
|
||||||
|
$criteria->getNewCriterion(ListPausedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||||
->addOr(
|
->addOr(
|
||||||
$criteria->getNewCriterion(ListPausedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
$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)
|
||||||
|
->addOr(
|
||||||
|
$oTmpCriteria
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
)
|
} else {
|
||||||
);
|
$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)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Process Id
|
||||||
if ($process != '') {
|
if ($process != '') {
|
||||||
$criteria->add(ListPausedPeer::PRO_UID, $process, Criteria::EQUAL);
|
$criteria->add(ListPausedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Category
|
||||||
if ($category != '') {
|
if ($category != '') {
|
||||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||||
$aConditions = array();
|
$aConditions = array();
|
||||||
@@ -258,11 +305,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)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$criteria = $pmTable->addPMFieldsToList('paused');
|
$criteria = $pmTable->addPMFieldsToList('paused');
|
||||||
|
$this->additionalClassName = $pmTable->tableClassName;
|
||||||
|
$additionalColumns = $criteria->getSelectColumns();
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
|
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListPausedPeer::USR_UID);
|
$criteria->addSelectColumn(ListPausedPeer::USR_UID);
|
||||||
@@ -287,7 +344,7 @@ class ListPaused extends BaseListPaused
|
|||||||
$criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE);
|
$criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE);
|
||||||
$criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY);
|
$criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY);
|
||||||
$criteria->add(ListPausedPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
$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";
|
$sort = (!empty($filters['sort'])) ? ListPausedPeer::TABLE_NAME.'.'.$filters['sort'] : "APP_PAUSED_DATE";
|
||||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ require_once 'classes/model/om/BaseListUnassigned.php';
|
|||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
class ListUnassigned extends BaseListUnassigned
|
class ListUnassigned extends BaseListUnassigned
|
||||||
{
|
{
|
||||||
// @codingStandardsIgnoreEnd
|
private $additionalClassName = '';
|
||||||
private $total = 0;
|
private $total = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create List Unassigned Table
|
* Create List Unassigned Table
|
||||||
*
|
*
|
||||||
@@ -165,7 +166,14 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
return true;
|
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'] : "";
|
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||||
@@ -174,25 +182,64 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : "";
|
$dateFrom = isset($filters['dateFrom']) ? $filters['dateFrom'] : "";
|
||||||
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : "";
|
$dateTo = isset($filters['dateTo']) ? $filters['dateTo'] : "";
|
||||||
|
|
||||||
|
//Filter Search
|
||||||
if ($search != '') {
|
if ($search != '') {
|
||||||
$criteria->add(
|
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
if (count($additionalColumns) > 0) {
|
||||||
->addOr(
|
require_once(PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP . $this->additionalClassName . '.php');
|
||||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)
|
$oNewCriteria = new Criteria("workflow");
|
||||||
->addOr(
|
$oTmpCriteria = '';
|
||||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_UID, $search, Criteria::EQUAL)
|
$sw = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//We prepare the query related to the custom cases list
|
||||||
|
foreach ($additionalColumns as $key => $value) {
|
||||||
|
if ($sw === 0) {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE);
|
||||||
|
} else {
|
||||||
|
$oTmpCriteria = $oNewCriteria->getNewCriterion($value, "%" . $search . "%", Criteria::LIKE)->addOr($oTmpCriteria);
|
||||||
|
}
|
||||||
|
$sw = 1;
|
||||||
|
}
|
||||||
|
if (!empty($oTmpCriteria)) {
|
||||||
|
$criteria->add(
|
||||||
|
$criteria->getNewCriterion(ListUnassignedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)
|
||||||
->addOr(
|
->addOr(
|
||||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
$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)
|
||||||
|
->addOr(
|
||||||
|
$oTmpCriteria
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
)
|
} else {
|
||||||
);
|
$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)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Process Id
|
||||||
if ($process != '') {
|
if ($process != '') {
|
||||||
$criteria->add(ListUnassignedPeer::PRO_UID, $process, Criteria::EQUAL);
|
$criteria->add(ListUnassignedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Filter Category
|
||||||
if ($category != '') {
|
if ($category != '') {
|
||||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||||
$aConditions = array();
|
$aConditions = array();
|
||||||
@@ -202,12 +249,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)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$pmTable = new PmTable();
|
$pmTable = new PmTable();
|
||||||
$tasks = $this->getSelfServiceTasks($usr_uid);
|
$tasks = $this->getSelfServiceTasks($usr_uid);
|
||||||
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
||||||
|
$this->additionalClassName = $pmTable->tableClassName;
|
||||||
|
$additionalColumns = $criteria->getSelectColumns();
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
|
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
|
||||||
@@ -282,7 +339,7 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Apply some filters
|
//Apply some filters
|
||||||
self::loadFilters($criteria, $filters);
|
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||||
$sort = (!empty($filters['sort'])) ?
|
$sort = (!empty($filters['sort'])) ?
|
||||||
ListUnassignedPeer::TABLE_NAME.'.'.$filters['sort'] :
|
ListUnassignedPeer::TABLE_NAME.'.'.$filters['sort'] :
|
||||||
"LIST_UNASSIGNED.DEL_DELEGATE_DATE";
|
"LIST_UNASSIGNED.DEL_DELEGATE_DATE";
|
||||||
|
|||||||
Reference in New Issue
Block a user