update
This commit is contained in:
@@ -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,15 +371,13 @@ class ListInbox extends BaseListInbox
|
||||
break;
|
||||
}
|
||||
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, NULL, Criteria::ISNOTNULL );
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListInboxPeer::DEL_INIT_DATE, NULL, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
@@ -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
|
||||
@@ -570,24 +558,27 @@ class ListInbox extends BaseListInbox
|
||||
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
$total = ListInboxPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
$dataset = ListInboxPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['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,15 +208,13 @@ 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 );
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
|
||||
if ($search != '' ) {
|
||||
@@ -245,28 +243,12 @@ 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";
|
||||
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
if (!empty($dateFrom)) {
|
||||
$criteria->add(ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
if (!empty($dateTo)) {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add( ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$criteria->add(ListParticipatedLastPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
|
||||
if ($newestthan != '') {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user