update
This commit is contained in:
@@ -17,107 +17,128 @@ class Applications
|
||||
//Task Dummies
|
||||
$arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT");
|
||||
|
||||
$newCriteria = new Criteria("workflow");
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_UID);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_STATUS);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_CREATE_DATE);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_FINISH_DATE);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_UPDATE_DATE);
|
||||
$newCriteria->addSelectColumn(ApplicationPeer::APP_TITLE);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_LAST_INDEX);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_RISK_DATE);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_THREAD_STATUS);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_PRIORITY);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_STARTED);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
|
||||
$newCriteria->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
|
||||
$newCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$newCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$newCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$newCriteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
$newCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$newCriteria->addJoin(AppDelegationPeer::APP_NUMBER , ApplicationPeer::APP_NUMBER, Criteria::LEFT_JOIN);
|
||||
$newCriteria->addJoin(AppDelegationPeer::DELEGATION_ID , AppThreadPeer::DELEGATION_ID, Criteria::LEFT_JOIN);
|
||||
$newCriteria->addJoin(AppDelegationPeer::USR_ID , UsersPeer::USR_ID, Criteria::LEFT_JOIN);
|
||||
$newCriteria->addJoin(AppDelegationPeer::PRO_ID , ProcessPeer::PRO_ID, Criteria::LEFT_JOIN);
|
||||
$newCriteria->addJoin(AppDelegationPeer::TAS_ID , TaskPeer::TAS_ID, Criteria::LEFT_JOIN);
|
||||
$newCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
|
||||
$con->begin();
|
||||
$sqlCount = "SELECT STRAIGHT_JOIN COUNT(*) AS TOTAL FROM APP_DELEGATION";
|
||||
$sql = "SELECT
|
||||
STRAIGHT_JOIN APPLICATION.APP_NUMBER,
|
||||
APPLICATION.APP_UID,
|
||||
APPLICATION.APP_STATUS,
|
||||
APPLICATION.APP_STATUS AS APP_STATUS_LABEL,
|
||||
APPLICATION.PRO_UID,
|
||||
APPLICATION.APP_CREATE_DATE,
|
||||
APPLICATION.APP_FINISH_DATE,
|
||||
APPLICATION.APP_UPDATE_DATE,
|
||||
APPLICATION.APP_TITLE,
|
||||
APP_DELEGATION.USR_UID,
|
||||
APP_DELEGATION.TAS_UID,
|
||||
APP_DELEGATION.DEL_INDEX,
|
||||
APP_DELEGATION.DEL_LAST_INDEX,
|
||||
APP_DELEGATION.DEL_DELEGATE_DATE,
|
||||
APP_DELEGATION.DEL_INIT_DATE,
|
||||
APP_DELEGATION.DEL_FINISH_DATE,
|
||||
APP_DELEGATION.DEL_TASK_DUE_DATE,
|
||||
APP_DELEGATION.DEL_RISK_DATE,
|
||||
APP_DELEGATION.DEL_THREAD_STATUS,
|
||||
APP_DELEGATION.DEL_PRIORITY,
|
||||
APP_DELEGATION.DEL_DURATION,
|
||||
APP_DELEGATION.DEL_QUEUE_DURATION,
|
||||
APP_DELEGATION.DEL_STARTED,
|
||||
APP_DELEGATION.DEL_DELAY_DURATION,
|
||||
APP_DELEGATION.DEL_FINISHED,
|
||||
APP_DELEGATION.DEL_DELAYED,
|
||||
APP_DELEGATION.DEL_DELAY_DURATION,
|
||||
TASK.TAS_TITLE AS APP_TAS_TITLE,
|
||||
USERS.USR_LASTNAME,
|
||||
USERS.USR_FIRSTNAME,
|
||||
USERS.USR_USERNAME,
|
||||
PROCESS.PRO_TITLE AS APP_PRO_TITLE
|
||||
FROM APP_DELEGATION
|
||||
";
|
||||
|
||||
$sqlJoin = " LEFT JOIN APPLICATION ON (APP_DELEGATION.APP_NUMBER=APPLICATION.APP_NUMBER)";
|
||||
$sqlCount.= " LEFT JOIN TASK ON (APP_DELEGATION.TAS_ID=TASK.TAS_ID)";
|
||||
|
||||
if (in_array($status, array(1, 2, 3, 4)) || !empty($search)) {
|
||||
$sqlCount .= $sqlJoin;
|
||||
}
|
||||
|
||||
$sqlJoin .= " LEFT JOIN TASK ON (APP_DELEGATION.TAS_ID=TASK.TAS_ID)";
|
||||
$sqlWhere = " WHERE TASK.TAS_TYPE NOT IN ('" . implode("','",$arrayTaskTypeToExclude) . "')";
|
||||
switch ($status) {
|
||||
case 1: //DRAFT
|
||||
$newCriteria->add(ApplicationPeer::APP_STATUS_ID, 1);
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_THREAD_STATUS='OPEN'";
|
||||
$sqlWhere .= " AND APPLICATION.APP_STATUS_ID = 1";
|
||||
break;
|
||||
case 2: //TO_DO
|
||||
$newCriteria->add(ApplicationPeer::APP_STATUS_ID, 2);
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_THREAD_STATUS='OPEN'";
|
||||
$sqlWhere .= " AND APPLICATION.APP_STATUS_ID = 2";
|
||||
break;
|
||||
case 3: //COMPLETED
|
||||
$newCriteria->addOr(AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED');
|
||||
$newCriteria->add(ApplicationPeer::APP_STATUS_ID, 3);
|
||||
$newCriteria->add(AppDelegationPeer::DEL_LAST_INDEX, '1');
|
||||
$sqlWhere .= " AND APPLICATION.APP_STATUS_ID = 3";
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_LAST_INDEX = 1";
|
||||
break;
|
||||
case 4: //CANCELLED
|
||||
$newCriteria->addOr(AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED');
|
||||
$newCriteria->add(ApplicationPeer::APP_STATUS_ID, 4);
|
||||
$newCriteria->add(AppDelegationPeer::DEL_LAST_INDEX, '1');
|
||||
$sqlWhere .= " AND APPLICATION.APP_STATUS_ID = 4";
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_LAST_INDEX = 1";
|
||||
break;
|
||||
case "PAUSED": //This status is not considered in the search, maybe we can add in the new versions
|
||||
$newCriteria->add(ApplicationPeer::APP_STATUS, 'TO_DO');
|
||||
$sqlWhere .= " AND APPLICATION.APP_STATUS = 'TO_DO'";
|
||||
break;
|
||||
default: //All status
|
||||
$newCriteria->addOr(AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED');
|
||||
$newCriteria->add(AppDelegationPeer::DEL_LAST_INDEX, '1');
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_LAST_INDEX = 1";
|
||||
break;
|
||||
}
|
||||
$sqlJoin .= $sqlJoinUser = " LEFT JOIN USERS ON (APP_DELEGATION.USR_ID=USERS.USR_ID)";
|
||||
if (!empty($userUid)) {
|
||||
$newCriteria->add(AppDelegationPeer::USR_ID, $userUid);
|
||||
$sqlWhere .= " AND APP_DELEGATION.USR_ID = " . $userUid;
|
||||
$sqlCount = $sqlCount . $sqlJoinUser;
|
||||
}
|
||||
$sqlJoin .= $sqlJoinPro = " LEFT JOIN PROCESS ON (APP_DELEGATION.PRO_ID=PROCESS.PRO_ID)";
|
||||
if (!empty($process)) {
|
||||
$newCriteria->add(ProcessPeer::PRO_ID, $process);
|
||||
$sqlWhere .= " AND APP_DELEGATION.PRO_ID = " . $process;
|
||||
}
|
||||
if (!empty($category)) {
|
||||
$newCriteria->add(ProcessPeer::PRO_CATEGORY, $category);
|
||||
$category = mysql_real_escape_string($category);
|
||||
$sqlWhere .= " AND PROCESS.PRO_CATEGORY = '{$category}'";
|
||||
}
|
||||
if (!empty($process) || !empty($category)) {
|
||||
$sqlCount = $sqlCount . $sqlJoinPro;
|
||||
}
|
||||
if (!empty($search)) {
|
||||
//APP_NUMBER APP_TAS_TITLE APP_TITLE
|
||||
$newCriteria->add( $newCriteria->getNewCriterion( ApplicationPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )
|
||||
->addOr( $newCriteria->getNewCriterion( TaskPeer::TAS_TITLE, '%' . $search . '%', Criteria::LIKE )
|
||||
->addOr( $newCriteria->getNewCriterion( ApplicationPeer::APP_NUMBER, '%' . $search . '%', Criteria::LIKE ) ) ) );
|
||||
$sqlWhere .= " AND (APPLICATION.APP_TITLE LIKE '%{$search}%' OR APPLICATION.APP_NUMBER LIKE '%{$search}%' OR TASK.TAS_TITLE LIKE '%{$search}%')";
|
||||
}
|
||||
if (!empty($dateFrom)) {
|
||||
$newCriteria->add(AppDelegationPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL) ;
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_DELEGATE_DATE >= '{$dateFrom}'";
|
||||
}
|
||||
if (!empty($dateTo)) {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
$newCriteria->addAnd(AppDelegationPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL) ;
|
||||
$sqlWhere .= " AND APP_DELEGATION.DEL_DELEGATE_DATE <= '{$dateTo}'";
|
||||
}
|
||||
|
||||
$newCriteria->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN);
|
||||
$totalCount = ApplicationPeer::doCount($newCriteria, false);
|
||||
$stmt = $con->createStatement();
|
||||
//Get total count
|
||||
$iCount = $stmt->executeQuery($sqlCount . $sqlWhere);
|
||||
$iCount->next();
|
||||
$aRow = $iCount->getRow();
|
||||
$totalCount = $aRow['TOTAL'];
|
||||
|
||||
//Filters
|
||||
if ($dir == "DESC") {
|
||||
$newCriteria->addDescendingOrderByColumn($sort);
|
||||
} else {
|
||||
$newCriteria->addAscendingOrderByColumn($sort);
|
||||
if (!empty($sort)) {
|
||||
if ($sort === 'APP_NUMBER') {
|
||||
$sort = 'APP_DELEGATION.APP_NUMBER';
|
||||
}
|
||||
$newCriteria->setLimit( $limit );
|
||||
$newCriteria->setOffset( $start );
|
||||
|
||||
$oDataset = ApplicationPeer::doSelectRS( $newCriteria, Propel::getDbConnection('workflow') );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$sqlWhere .= " ORDER BY " . $sort;
|
||||
}
|
||||
if (!empty($dir)) {
|
||||
$sqlWhere .= " " . $dir;
|
||||
}
|
||||
if (!empty($start)) {
|
||||
$sqlWhere .= " LIMIT $start, " . $limit;
|
||||
} else {
|
||||
$sqlWhere .= " LIMIT " . $limit;
|
||||
}
|
||||
$oDataset = $stmt->executeQuery($sql . $sqlJoin . $sqlWhere);
|
||||
$result = array ();
|
||||
$result['totalCount'] = $totalCount;
|
||||
$rows = array();
|
||||
@@ -137,9 +158,6 @@ class Applications
|
||||
$aRow["USRCR_USR_LASTNAME"] = $aRow["USR_LASTNAME"];
|
||||
$aRow["USRCR_USR_USERNAME"] = $aRow["USR_USERNAME"];
|
||||
$aRow["APP_OVERDUE_PERCENTAGE"] = '';
|
||||
$aRow["APP_TAS_TITLE"] = $aRow["TAS_TITLE"];
|
||||
$aRow["APP_TITLE"] = $aRow["APP_TITLE"];
|
||||
$aRow["APP_PRO_TITLE"] = $aRow["PRO_TITLE"];
|
||||
$rows[] = $aRow;
|
||||
}
|
||||
$result['data'] = $rows;
|
||||
|
||||
@@ -240,15 +240,6 @@ class ListCanceled extends BaseListCanceled {
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( ListCanceledPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListCanceledPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
@@ -307,14 +298,22 @@ class ListCanceled extends BaseListCanceled {
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param array $filters
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListCanceledPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListCanceledPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListCanceledPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
} // ListCanceled
|
||||
|
||||
|
||||
@@ -232,15 +232,6 @@ class ListCompleted extends BaseListCompleted
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( ListCompletedPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListCompletedPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
@@ -296,14 +287,22 @@ class ListCompleted extends BaseListCompleted
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param array $filters
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListCompletedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListCompletedPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
} // ListCompleted
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ class ListInbox extends BaseListInbox
|
||||
self::create($data, $isSelfService);
|
||||
}
|
||||
|
||||
public function loadFilters (&$criteria, $filters)
|
||||
public static function loadFilters (&$criteria, $filters)
|
||||
{
|
||||
$action = isset($filters['action']) ? $filters['action'] : "";
|
||||
$usrUid = isset($filters['usr_uid']) ? $filters['usr_uid'] : "";
|
||||
@@ -371,16 +371,14 @@ class ListInbox extends BaseListInbox
|
||||
break;
|
||||
}
|
||||
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, NULL, Criteria::ISNOTNULL );
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, NULL, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
@@ -453,16 +451,6 @@ class ListInbox extends BaseListInbox
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$filters['usr_uid'] = $usr_uid;
|
||||
|
||||
$criteria = new Criteria();
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListInboxPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $usr_uid
|
||||
* @param array $filters
|
||||
@@ -572,22 +560,25 @@ class ListInbox extends BaseListInbox
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param string $appStatus
|
||||
* @param string $usrUid
|
||||
* @param array $filters
|
||||
* @param string $status
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $appStatus = 'DRAFT')
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$filters['usr_uid'] = $usrUid;
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListInboxPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if ($appStatus == 'TO_DO') {
|
||||
$criteria->add(ListInboxPeer::APP_STATUS, 'TO_DO', Criteria::EQUAL);
|
||||
} else {
|
||||
$criteria->add(ListInboxPeer::APP_STATUS, 'DRAFT', Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListInboxPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
$total = ListInboxPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -203,15 +203,6 @@ class ListMyInbox extends BaseListMyInbox
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( ListMyInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListMyInboxPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
@@ -274,5 +265,26 @@ class ListMyInbox extends BaseListMyInbox
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param array $filters
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListMyInboxPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListMyInboxPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
} // ListMyInbox
|
||||
|
||||
|
||||
@@ -162,15 +162,6 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( ListParticipatedHistoryPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListParticipatedHistoryPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
@@ -229,5 +220,26 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param array $filters
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListParticipatedHistoryPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListParticipatedHistoryPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,6 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$newestthan = isset($filters['newestthan'] ) ? $filters['newestthan'] : '';
|
||||
$oldestthan = isset($filters['oldestthan'] ) ? $filters['oldestthan'] : '';
|
||||
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
@@ -217,7 +216,6 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($search != '' ) {
|
||||
$criteria->add(
|
||||
@@ -245,27 +243,11 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$criteria->addJoinMC($aConditions, Criteria::INNER_JOIN);
|
||||
}
|
||||
|
||||
if ($dateFrom != "") {
|
||||
if ($dateTo != "") {
|
||||
if ($dateFrom == $dateTo) {
|
||||
$dateSame = $dateFrom;
|
||||
$dateFrom = $dateSame . " 00:00:00";
|
||||
$dateTo = $dateSame . " 23:59:59";
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add( $criteria->getNewCriterion( ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->
|
||||
addAnd( $criteria->getNewCriterion( ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
if (!empty($dateFrom)) {
|
||||
$criteria->add(ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
if (!empty($dateTo)) {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add(ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
|
||||
@@ -278,15 +260,6 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( ListParticipatedLastPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListParticipatedLastPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null, $appUid = '')
|
||||
{
|
||||
$pmTable = new PmTable();
|
||||
@@ -408,15 +381,23 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param string $usrUid
|
||||
* @param array $filters
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListParticipatedLastPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListParticipatedLastPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,12 +218,6 @@ class ListUnassigned extends BaseListUnassigned
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$total = $this->total;
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
@@ -446,9 +440,10 @@ class ListUnassigned extends BaseListUnassigned
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $userUid
|
||||
* @param array $filters
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($userUid)
|
||||
public function getCountList($userUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria('workflow');
|
||||
$tasks = $this->getSelfServiceTasks($userUid);
|
||||
|
||||
@@ -67,7 +67,7 @@ abstract class BaseApplication extends BaseObject implements Persistent
|
||||
* The value for the app_status_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $app_status_id = 1;
|
||||
protected $app_status_id = 0;
|
||||
|
||||
/**
|
||||
* The value for the pro_uid field.
|
||||
@@ -663,7 +663,7 @@ abstract class BaseApplication extends BaseObject implements Persistent
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->app_status_id !== $v || $v === 1) {
|
||||
if ($this->app_status_id !== $v || $v === 0) {
|
||||
$this->app_status_id = $v;
|
||||
$this->modifiedColumns[] = ApplicationPeer::APP_STATUS_ID;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<column name="APP_NUMBER" type="INTEGER" required="true" default="0"/>
|
||||
<column name="APP_PARENT" type="VARCHAR" size="32" required="true" default="0"/>
|
||||
<column name="APP_STATUS" type="VARCHAR" size="100" required="true" default=""/>
|
||||
<column name="APP_STATUS_ID" type="TINYINT" required="true" default="1"/>
|
||||
<column name="APP_STATUS_ID" type="TINYINT" required="true" default="0"/>
|
||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||
<column name="APP_PROC_STATUS" type="VARCHAR" size="100" required="true" default=""/>
|
||||
<column name="APP_PROC_CODE" type="VARCHAR" size="100" required="true" default=""/>
|
||||
@@ -4332,6 +4332,15 @@
|
||||
<parameter name="Seq_in_index" value="1"/>
|
||||
</vendor>
|
||||
</index>
|
||||
<index name="delDelegateDate">
|
||||
<index-column name="DEL_DELEGATE_DATE"/>
|
||||
<vendor type="mysql">
|
||||
<parameter name="Table" value="LIST_PARTICIPATED_LAST"/>
|
||||
<parameter name="Non_unique" value="1"/>
|
||||
<parameter name="Key_name" value="delDelegateDate"/>
|
||||
<parameter name="Seq_in_index" value="1"/>
|
||||
</vendor>
|
||||
</index>
|
||||
</table>
|
||||
<table name="LIST_COMPLETED">
|
||||
<vendor type="mysql">
|
||||
|
||||
@@ -18,7 +18,7 @@ CREATE TABLE `APPLICATION`
|
||||
`APP_NUMBER` INTEGER default 0 NOT NULL,
|
||||
`APP_PARENT` VARCHAR(32) default '0' NOT NULL,
|
||||
`APP_STATUS` VARCHAR(100) default '' NOT NULL,
|
||||
`APP_STATUS_ID` TINYINT default 1 NOT NULL,
|
||||
`APP_STATUS_ID` TINYINT default 0 NOT NULL,
|
||||
`PRO_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`APP_PROC_STATUS` VARCHAR(100) default '' NOT NULL,
|
||||
`APP_PROC_CODE` VARCHAR(100) default '' NOT NULL,
|
||||
@@ -2436,7 +2436,8 @@ CREATE TABLE `LIST_PARTICIPATED_LAST`
|
||||
`DEL_PRIORITY` VARCHAR(32) default '3' NOT NULL,
|
||||
`DEL_THREAD_STATUS` VARCHAR(32) default 'OPEN' NOT NULL,
|
||||
PRIMARY KEY (`APP_UID`,`USR_UID`,`DEL_INDEX`),
|
||||
KEY `usrIndex`(`USR_UID`)
|
||||
KEY `usrIndex`(`USR_UID`),
|
||||
KEY `delDelegateDate`(`DEL_DELEGATE_DATE`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Participated last list';
|
||||
#-----------------------------------------------------------------------------
|
||||
#-- LIST_COMPLETED
|
||||
|
||||
@@ -312,7 +312,11 @@ function getStatusArray($action, $userUid)
|
||||
$aStatus = Application::$app_status_values;
|
||||
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||
foreach ($aStatus as $key => $value) {
|
||||
if ($action == 'search') {
|
||||
$status[] = array ($value, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
|
||||
} else {
|
||||
$status[] = array ($key, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user