Merged in feature/HOR-2440 (pull request #5485)
Feature/HOR-2440 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -104,7 +104,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @param $isSubprocess is a subprocess inside a process?
|
||||
* @return delegation index of the application delegation.
|
||||
*/
|
||||
public function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null, $flagControl = false, $flagControlMulInstance = false, $delPrevious = 0)
|
||||
public function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null, $flagControl = false, $flagControlMulInstance = false, $delPrevious = 0, $appNumber = 0, $taskId = 0, $userId = 0, $proId = 0)
|
||||
{
|
||||
if (! isset( $sProUid ) || strlen( $sProUid ) == 0) {
|
||||
throw (new Exception( 'Column "PRO_UID" cannot be null.' ));
|
||||
@@ -126,6 +126,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
throw (new Exception( 'Column "APP_THREAD" cannot be null.' ));
|
||||
}
|
||||
|
||||
$this->delegation_id = null;
|
||||
//Get max DEL_INDEX
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $sAppUid);
|
||||
@@ -196,6 +197,10 @@ class AppDelegation extends BaseAppDelegation
|
||||
$this->setDelThread( $sAppThread );
|
||||
$this->setDelThreadStatus( 'OPEN' );
|
||||
$this->setDelDelegateDate( 'now' );
|
||||
$this->setAppNumber($appNumber);
|
||||
$this->setTasId($taskId);
|
||||
$this->setUsrId($userId);
|
||||
$this->setProId($proId);
|
||||
|
||||
//The function return an array now. By JHL
|
||||
$delTaskDueDate = $this->calculateDueDate($sNextTasParam);
|
||||
|
||||
@@ -48,7 +48,7 @@ class Application extends BaseApplication
|
||||
*/
|
||||
protected $app_title_content = '';
|
||||
protected $app_description_content = '';
|
||||
//protected $app_proc_code = '';
|
||||
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
|
||||
|
||||
/**
|
||||
* Get the [app_title_content] column value.
|
||||
@@ -225,7 +225,8 @@ class Application extends BaseApplication
|
||||
$this->setAppUid(G::generateUniqueID());
|
||||
$this->setAppParent('');
|
||||
$this->setAppStatus('DRAFT');
|
||||
$this->setProUid( $sProUid);
|
||||
$this->setAppStatusId(1);
|
||||
$this->setProUid($sProUid);
|
||||
$this->setAppProcStatus('');
|
||||
$this->setAppProcCode('');
|
||||
$this->setAppParallel('N');
|
||||
@@ -294,6 +295,9 @@ class Application extends BaseApplication
|
||||
$oApp->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
if ($oApp->validate()) {
|
||||
if (isset($aData['APP_STATUS'])) {
|
||||
$oApp->setAppStatusId(self::$app_status_values[$aData['APP_STATUS']]);
|
||||
}
|
||||
if (isset($aData['APP_TITLE'])) {
|
||||
$oApp->setAppTitleContent($aData['APP_TITLE']);
|
||||
}
|
||||
@@ -301,9 +305,6 @@ class Application extends BaseApplication
|
||||
$oApp->setAppDescriptionContent($aData['APP_DESCRIPTION']);
|
||||
}
|
||||
|
||||
//if ( isset ( $aData['APP_PROC_CODE'] ) )
|
||||
//$oApp->setAppProcCode( $aData['APP_PROC_CODE'] );
|
||||
|
||||
$res = $oApp->save();
|
||||
$con->commit();
|
||||
|
||||
|
||||
@@ -14,7 +14,10 @@ require_once 'classes/model/om/BaseListCanceled.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class ListCanceled extends BaseListCanceled {
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListCanceled extends BaseListCanceled
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Canceled Table
|
||||
*
|
||||
@@ -26,7 +29,7 @@ class ListCanceled extends BaseListCanceled {
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_TITLE);
|
||||
$criteria->add( ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add(ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$dataset = ApplicationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -48,8 +51,8 @@ class ListCanceled extends BaseListCanceled {
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
||||
$criteria->add( AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $data['DEL_INDEX'], Criteria::EQUAL );
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $data['DEL_INDEX'], Criteria::EQUAL);
|
||||
$dataset = AppDelegationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -62,8 +65,8 @@ class ListCanceled extends BaseListCanceled {
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$criteria->add( AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $delPrevious, Criteria::EQUAL );
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $delPrevious, Criteria::EQUAL);
|
||||
$dataset = AppDelegationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -83,7 +86,7 @@ class ListCanceled extends BaseListCanceled {
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
|
||||
$criteria->add(UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -105,19 +108,31 @@ class ListCanceled extends BaseListCanceled {
|
||||
$criteriaSet->add(ListParticipatedLastPeer::APP_STATUS, 'CANCELLED');
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
|
||||
$con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME );
|
||||
if (!empty($data['PRO_UID']) && empty($data['PRO_ID'])) {
|
||||
$p = new Process();
|
||||
$data['PRO_ID'] = $p->load($data['PRO_UID'])['PRO_ID'];
|
||||
}
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -132,18 +147,26 @@ class ListCanceled extends BaseListCanceled {
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME );
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -159,9 +182,9 @@ class ListCanceled extends BaseListCanceled {
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove ($app_uid)
|
||||
public function remove($app_uid)
|
||||
{
|
||||
$con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$con->begin();
|
||||
@@ -173,7 +196,7 @@ class ListCanceled extends BaseListCanceled {
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters (&$criteria, $filters)
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
@@ -185,25 +208,31 @@ class ListCanceled extends BaseListCanceled {
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListCanceledPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$criteria->add(ListCanceledPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListCanceledPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$criteria->add(ListCanceledPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListCanceledPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListCanceledPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListCanceledPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListCanceledPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
$criteria->add( ListCanceledPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
$criteria->add(ListCanceledPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
if ($category != '') {
|
||||
@@ -226,29 +255,31 @@ class ListCanceled extends BaseListCanceled {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add( $criteria->getNewCriterion( ListCanceledPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->
|
||||
addAnd( $criteria->getNewCriterion( ListCanceledPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(
|
||||
ListCanceledPeer::DEL_DELEGATE_DATE,
|
||||
$dateFrom,
|
||||
Criteria::GREATER_EQUAL
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(
|
||||
ListCanceledPeer::DEL_DELEGATE_DATE,
|
||||
$dateTo,
|
||||
Criteria::LESS_EQUAL
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
$criteria->add( ListCanceledPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
$criteria->add(ListCanceledPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add( ListCanceledPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$criteria->add(ListCanceledPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -272,7 +303,7 @@ class ListCanceled extends BaseListCanceled {
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_INIT_DATE);
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_DUE_DATE);
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_PRIORITY);
|
||||
$criteria->add( ListCanceledPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
$criteria->add(ListCanceledPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
||||
self::loadFilters($criteria, $filters);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "APP_FINISH_DATE";
|
||||
@@ -288,11 +319,11 @@ class ListCanceled extends BaseListCanceled {
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
$criteria->setLimit( $limit );
|
||||
$criteria->setOffset( $start );
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
|
||||
$dataset = ListCanceledPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset = ListCanceledPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
while ($dataset->next()) {
|
||||
@@ -307,14 +338,21 @@ 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
|
||||
|
||||
|
||||
@@ -14,8 +14,10 @@ require_once 'classes/model/om/BaseListCompleted.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListCompleted extends BaseListCompleted
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Completed Table
|
||||
*
|
||||
@@ -27,7 +29,7 @@ class ListCompleted extends BaseListCompleted
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(ListCompletedPeer::APP_UID);
|
||||
$criteria->add( ListCompletedPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add(ListCompletedPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($dataset->next()) {
|
||||
@@ -36,7 +38,7 @@ class ListCompleted extends BaseListCompleted
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_TITLE);
|
||||
$criteria->add( ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add(ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$dataset = ApplicationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -68,7 +70,7 @@ class ListCompleted extends BaseListCompleted
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
|
||||
$criteria->add(UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -81,7 +83,7 @@ class ListCompleted extends BaseListCompleted
|
||||
if ($data['DEL_PREVIOUS'] != 0) {
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $data['DEL_PREVIOUS'], Criteria::EQUAL );
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $data['DEL_PREVIOUS'], Criteria::EQUAL);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -97,19 +99,31 @@ class ListCompleted extends BaseListCompleted
|
||||
$criteriaSet->add(ListParticipatedLastPeer::APP_STATUS, 'COMPLETED');
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
|
||||
$con = Propel::getConnection( ListCompletedPeer::DATABASE_NAME );
|
||||
if (!empty($data['PRO_UID']) && empty($data['PRO_ID'])) {
|
||||
$p = new Process();
|
||||
$data['PRO_ID'] = $p->load($data['PRO_UID'])['PRO_ID'];
|
||||
}
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListCompletedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -124,18 +138,26 @@ class ListCompleted extends BaseListCompleted
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListCompletedPeer::DATABASE_NAME );
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListCompletedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -151,9 +173,9 @@ class ListCompleted extends BaseListCompleted
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove ($app_uid)
|
||||
public function remove($app_uid)
|
||||
{
|
||||
$con = Propel::getConnection( ListCompletedPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(ListCompletedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$con->begin();
|
||||
@@ -165,7 +187,7 @@ class ListCompleted extends BaseListCompleted
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters (&$criteria, $filters)
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
@@ -177,25 +199,31 @@ class ListCompleted extends BaseListCompleted
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListCompletedPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$criteria->add(ListCompletedPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListCompletedPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$criteria->add(ListCompletedPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListCompletedPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListCompletedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListCompletedPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListCompletedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
$criteria->add( ListCompletedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
$criteria->add(ListCompletedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
if ($category != '') {
|
||||
@@ -218,29 +246,31 @@ class ListCompleted extends BaseListCompleted
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add( $criteria->getNewCriterion( ListCompletedPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->
|
||||
addAnd( $criteria->getNewCriterion( ListCompletedPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(
|
||||
ListCompletedPeer::DEL_DELEGATE_DATE,
|
||||
$dateFrom,
|
||||
Criteria::GREATER_EQUAL
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(
|
||||
ListCompletedPeer::DEL_DELEGATE_DATE,
|
||||
$dateTo,
|
||||
Criteria::LESS_EQUAL
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
$criteria->add( ListCompletedPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
$criteria->add(ListCompletedPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add( ListCompletedPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$criteria->add(ListCompletedPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -261,7 +291,7 @@ class ListCompleted extends BaseListCompleted
|
||||
$criteria->addSelectColumn(ListCompletedPeer::DEL_CURRENT_USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(ListCompletedPeer::DEL_CURRENT_USR_LASTNAME);
|
||||
$criteria->addSelectColumn(ListCompletedPeer::DEL_CURRENT_USR_USERNAME);
|
||||
$criteria->add( ListCompletedPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
$criteria->add(ListCompletedPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
||||
self::loadFilters($criteria, $filters);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "APP_FINISH_DATE";
|
||||
@@ -277,11 +307,11 @@ class ListCompleted extends BaseListCompleted
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
$criteria->setLimit( $limit );
|
||||
$criteria->setOffset( $start );
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
while ($dataset->next()) {
|
||||
@@ -296,14 +326,21 @@ 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
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,10 @@ require_once 'classes/model/om/BaseListMyInbox.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListMyInbox extends BaseListMyInbox
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List My Inbox Table
|
||||
*
|
||||
@@ -25,19 +27,34 @@ class ListMyInbox extends BaseListMyInbox
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListMyInboxPeer::DATABASE_NAME );
|
||||
if (!empty($data['PRO_UID']) && empty($data['PRO_ID'])) {
|
||||
$p = new Process();
|
||||
$data['PRO_ID'] = $p->load($data['PRO_UID'])['PRO_ID'];
|
||||
}
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
if (!empty($data['APP_STATUS'])) {
|
||||
$data['APP_STATUS_ID'] = Application::$app_status_values[$data['APP_STATUS']];
|
||||
}
|
||||
$con = Propel::getConnection(ListMyInboxPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -52,18 +69,29 @@ class ListMyInbox extends BaseListMyInbox
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListMyInboxPeer::DATABASE_NAME );
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
if (!empty($data['APP_STATUS'])) {
|
||||
$data['APP_STATUS_ID'] = Application::$app_status_values[$data['APP_STATUS']];
|
||||
}
|
||||
$con = Propel::getConnection(ListMyInboxPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -79,9 +107,9 @@ class ListMyInbox extends BaseListMyInbox
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove ($app_uid, $usr_uid)
|
||||
public function remove($app_uid, $usr_uid)
|
||||
{
|
||||
$con = Propel::getConnection( ListMyInboxPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(ListMyInboxPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$this->setUsrUid($usr_uid);
|
||||
@@ -103,7 +131,7 @@ class ListMyInbox extends BaseListMyInbox
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function refresh ($data)
|
||||
public function refresh($data)
|
||||
{
|
||||
$data['APP_STATUS'] = (empty($data['APP_STATUS'])) ? 'TO_DO' : $data['APP_STATUS'];
|
||||
|
||||
@@ -111,7 +139,7 @@ class ListMyInbox extends BaseListMyInbox
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
|
||||
$criteria->add(UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -136,7 +164,7 @@ class ListMyInbox extends BaseListMyInbox
|
||||
|
||||
|
||||
|
||||
public function loadFilters (&$criteria, $filters)
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
@@ -148,25 +176,31 @@ class ListMyInbox extends BaseListMyInbox
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListMyInboxPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$criteria->add(ListMyInboxPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListMyInboxPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$criteria->add(ListMyInboxPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListMyInboxPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListMyInboxPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListMyInboxPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(ListMyInboxPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
$criteria->add( ListMyInboxPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
$criteria->add(ListMyInboxPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
if ($category != '') {
|
||||
@@ -189,29 +223,31 @@ class ListMyInbox extends BaseListMyInbox
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add( $criteria->getNewCriterion( ListMyInboxPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->
|
||||
addAnd( $criteria->getNewCriterion( ListMyInboxPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(
|
||||
ListMyInboxPeer::DEL_DELEGATE_DATE,
|
||||
$dateFrom,
|
||||
Criteria::GREATER_EQUAL
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(
|
||||
ListMyInboxPeer::DEL_DELEGATE_DATE,
|
||||
$dateTo,
|
||||
Criteria::LESS_EQUAL
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
$criteria->add( ListMyInboxPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
$criteria->add(ListMyInboxPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add( ListMyInboxPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$criteria->add(ListMyInboxPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -241,7 +277,7 @@ class ListMyInbox extends BaseListMyInbox
|
||||
$criteria->addSelectColumn(ListMyInboxPeer::DEL_INIT_DATE);
|
||||
$criteria->addSelectColumn(ListMyInboxPeer::DEL_DUE_DATE);
|
||||
$criteria->addSelectColumn(ListMyInboxPeer::DEL_PRIORITY);
|
||||
$criteria->add( ListMyInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
$criteria->add(ListMyInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
||||
self::loadFilters($criteria, $filters);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "APP_UPDATE_DATE";
|
||||
@@ -257,22 +293,42 @@ class ListMyInbox extends BaseListMyInbox
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
$criteria->setLimit( $limit );
|
||||
$criteria->setOffset( $start );
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
|
||||
$dataset = ListMyInboxPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset = ListMyInboxPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
$aPriorities = array('1' => 'VL', '2' => 'L', '3' => 'N', '4' => 'H', '5' => 'VH');
|
||||
while ($dataset->next()) {
|
||||
$aRow = (is_null($callbackRecord))? $dataset->getRow() : $callbackRecord($dataset->getRow());
|
||||
|
||||
$aRow['DEL_PRIORITY'] = G::LoadTranslation( "ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}" );
|
||||
$aRow['DEL_PRIORITY'] = G::LoadTranslation("ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}");
|
||||
$data[] = $aRow;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
} // ListMyInbox
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
@@ -14,8 +14,10 @@ require_once 'classes/model/om/BaseListParticipatedHistory.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Participated History Table
|
||||
*
|
||||
@@ -25,19 +27,31 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListParticipatedHistoryPeer::DATABASE_NAME );
|
||||
if (!empty($data['PRO_UID']) && empty($data['PRO_ID'])) {
|
||||
$p = new Process();
|
||||
$data['PRO_ID'] = $p->load($data['PRO_UID'])['PRO_ID'];
|
||||
}
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListParticipatedHistoryPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -52,18 +66,26 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListParticipatedHistoryPeer::DATABASE_NAME );
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListParticipatedHistoryPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -79,9 +101,9 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove ($app_uid, $del_index)
|
||||
public function remove($app_uid, $del_index)
|
||||
{
|
||||
$con = Propel::getConnection( ListParticipatedHistoryPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(ListParticipatedHistoryPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$this->setDelIndex($del_index);
|
||||
@@ -95,7 +117,7 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters (&$criteria, $filters)
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
$search = isset($filters['search']) ? $filters['search'] : "";
|
||||
@@ -107,10 +129,10 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListParticipatedHistoryPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$criteria->add(ListParticipatedHistoryPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListParticipatedHistoryPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$criteria->add(ListParticipatedHistoryPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -118,14 +140,22 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedHistoryPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedHistoryPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedHistoryPeer::APP_UID, $search, Criteria::EQUAL)
|
||||
->addOr(
|
||||
$criteria->getNewCriterion(
|
||||
ListParticipatedHistoryPeer::APP_NUMBER,
|
||||
$search,
|
||||
Criteria::EQUAL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
$criteria->add( ListParticipatedHistoryPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
$criteria->add(ListParticipatedHistoryPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
if ($category != '') {
|
||||
@@ -148,29 +178,31 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add( $criteria->getNewCriterion( ListParticipatedHistoryPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->
|
||||
addAnd( $criteria->getNewCriterion( ListParticipatedHistoryPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(
|
||||
ListParticipatedHistoryPeer::DEL_DELEGATE_DATE,
|
||||
$dateFrom,
|
||||
Criteria::GREATER_EQUAL
|
||||
)->addAnd(
|
||||
$criteria->getNewCriterion(
|
||||
ListParticipatedHistoryPeer::DEL_DELEGATE_DATE,
|
||||
$dateTo,
|
||||
Criteria::LESS_EQUAL
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
$criteria->add( ListParticipatedHistoryPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
$criteria->add(ListParticipatedHistoryPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add( ListParticipatedHistoryPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$criteria->add(ListParticipatedHistoryPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -196,7 +228,7 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
$criteria->addSelectColumn(ListParticipatedHistoryPeer::DEL_INIT_DATE);
|
||||
$criteria->addSelectColumn(ListParticipatedHistoryPeer::DEL_DUE_DATE);
|
||||
$criteria->addSelectColumn(ListParticipatedHistoryPeer::DEL_PRIORITY);
|
||||
$criteria->add( ListParticipatedHistoryPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
$criteria->add(ListParticipatedHistoryPeer::USR_UID, $usr_uid, Criteria::EQUAL);
|
||||
self::loadFilters($criteria, $filters);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "DEL_DELEGATE_DATE";
|
||||
@@ -212,22 +244,42 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
$criteria->setLimit( $limit );
|
||||
$criteria->setOffset( $start );
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
|
||||
$dataset = ListParticipatedHistoryPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset = ListParticipatedHistoryPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
$aPriorities = array('1' => 'VL', '2' => 'L', '3' => 'N', '4' => 'H', '5' => 'VH');
|
||||
while ($dataset->next()) {
|
||||
$aRow = (is_null($callbackRecord))? $dataset->getRow() : $callbackRecord($dataset->getRow());
|
||||
|
||||
$aRow['DEL_PRIORITY'] = G::LoadTranslation( "ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}" );
|
||||
$aRow['DEL_PRIORITY'] = G::LoadTranslation("ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}");
|
||||
$data[] = $aRow;
|
||||
}
|
||||
|
||||
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'];
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,10 @@ require_once 'classes/model/om/BaseListPaused.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class ListPaused extends BaseListPaused {
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListPaused extends BaseListPaused
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Paused Table
|
||||
*
|
||||
@@ -37,7 +40,7 @@ class ListPaused extends BaseListPaused {
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$criteria->add( ProcessPeer::PRO_UID, $data['PRO_UID'], Criteria::EQUAL );
|
||||
$criteria->add(ProcessPeer::PRO_UID, $data['PRO_UID'], Criteria::EQUAL);
|
||||
$dataset = ProcessPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -51,8 +54,8 @@ class ListPaused extends BaseListPaused {
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
||||
$criteria->add( AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $data['DEL_INDEX'], Criteria::EQUAL );
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $data['DEL_INDEX'], Criteria::EQUAL);
|
||||
$dataset = AppDelegationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -66,8 +69,8 @@ class ListPaused extends BaseListPaused {
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$criteria->add( AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $delPrevious, Criteria::EQUAL );
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $delPrevious, Criteria::EQUAL);
|
||||
$dataset = AppDelegationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -78,7 +81,7 @@ class ListPaused extends BaseListPaused {
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->add( UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL );
|
||||
$criteria->add(UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -89,7 +92,7 @@ class ListPaused extends BaseListPaused {
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
$criteria->add( TaskPeer::TAS_UID, $data['TAS_UID'], Criteria::EQUAL );
|
||||
$criteria->add(TaskPeer::TAS_UID, $data['TAS_UID'], Criteria::EQUAL);
|
||||
$dataset = TaskPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -100,7 +103,7 @@ class ListPaused extends BaseListPaused {
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
|
||||
$criteria->add(UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -114,19 +117,31 @@ class ListPaused extends BaseListPaused {
|
||||
$oListInbox = new ListInbox();
|
||||
$oListInbox->remove($data['APP_UID'], $data['DEL_INDEX']);
|
||||
|
||||
$con = Propel::getConnection( ListPausedPeer::DATABASE_NAME );
|
||||
if (!empty($data['PRO_UID']) && empty($data['PRO_ID'])) {
|
||||
$p = new Process();
|
||||
$data['PRO_ID'] = $p->load($data['PRO_UID'])['PRO_ID'];
|
||||
}
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListPausedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -141,18 +156,26 @@ class ListPaused extends BaseListPaused {
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListPausedPeer::DATABASE_NAME );
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
if (!empty($data['TAS_UID'])) {
|
||||
$t = new Task();
|
||||
$data['TAS_ID'] = $t->load($data['TAS_UID'])['TAS_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListPausedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -168,15 +191,15 @@ class ListPaused extends BaseListPaused {
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove ($app_uid, $del_index, $data_inbox)
|
||||
public function remove($app_uid, $del_index, $data_inbox)
|
||||
{
|
||||
$oRow = ApplicationPeer::retrieveByPK($app_uid);
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$data_inbox['APP_STATUS'] = $aFields['APP_STATUS'];
|
||||
$listInbox = new ListInbox();
|
||||
$listInbox->newRow($data_inbox, $data_inbox['USR_UID']);
|
||||
|
||||
$con = Propel::getConnection( ListPausedPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(ListPausedPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$this->setDelIndex($del_index);
|
||||
@@ -189,80 +212,50 @@ class ListPaused extends BaseListPaused {
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters (&$criteria, $filters)
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
{
|
||||
$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'] : "";
|
||||
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add( ListPausedPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add( ListPausedPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
break;
|
||||
}
|
||||
//Filter Read Unread All
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$criteria->add(ListPausedPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
break;
|
||||
case 'unread':
|
||||
$criteria->add(ListPausedPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
break;
|
||||
}
|
||||
|
||||
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)
|
||||
))));
|
||||
$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)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
$criteria->add( ListPausedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
$criteria->add(ListPausedPeer::PRO_UID, $process, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
if ($category != '') {
|
||||
// INNER JOIN FOR TAS_TITLE
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
|
||||
$aConditions = array();
|
||||
$aConditions[] = array(ListPausedPeer::PRO_UID, ProcessPeer::PRO_UID);
|
||||
$aConditions[] = array(ProcessPeer::PRO_CATEGORY, "'" . $category . "'");
|
||||
$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( ListPausedPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->
|
||||
addAnd( $criteria->getNewCriterion( ListPausedPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
$criteria->add( ListPausedPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$criteria->add( ListPausedPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
}
|
||||
}
|
||||
|
||||
public function countTotal ($usr_uid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add( ListPausedPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||
self::loadFilters($criteria, $filters);
|
||||
$total = ListPausedPeer::doCount( $criteria );
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
@@ -293,7 +286,7 @@ class ListPaused extends BaseListPaused {
|
||||
$criteria->addSelectColumn(ListPausedPeer::DEL_INIT_DATE);
|
||||
$criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE);
|
||||
$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);
|
||||
|
||||
$sort = (!empty($filters['sort'])) ? ListPausedPeer::TABLE_NAME.'.'.$filters['sort'] : "APP_PAUSED_DATE";
|
||||
@@ -309,11 +302,11 @@ class ListPaused extends BaseListPaused {
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
$criteria->setLimit( $limit );
|
||||
$criteria->setOffset( $start );
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
|
||||
$dataset = ListPausedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$dataset = ListPausedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = array();
|
||||
while ($dataset->next()) {
|
||||
@@ -327,15 +320,22 @@ class ListPaused extends BaseListPaused {
|
||||
|
||||
/**
|
||||
* 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(ListPausedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListPausedPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListPausedPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
}
|
||||
} // ListPaused
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseListUnassignedGroup.php';
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'LIST_UNASSIGNED_GROUP' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
@@ -14,7 +14,10 @@ require_once 'classes/model/om/BaseListUnassignedGroup.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class ListUnassignedGroup extends BaseListUnassignedGroup {
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListUnassignedGroup extends BaseListUnassignedGroup
|
||||
{
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Unassigned Group Table
|
||||
*
|
||||
@@ -23,20 +26,24 @@ class ListUnassignedGroup extends BaseListUnassignedGroup {
|
||||
*
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListUnassignedGroupPeer::DATABASE_NAME );
|
||||
{
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListUnassignedGroupPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e = new Exception("Failed Validation in class " . get_class($this) . ".");
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
@@ -50,18 +57,22 @@ class ListUnassignedGroup extends BaseListUnassignedGroup {
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( ListUnassignedGroupPeer::DATABASE_NAME );
|
||||
if (!empty($data['USR_UID'])) {
|
||||
$u = new Users();
|
||||
$data['USR_ID'] = $u->load($data['USR_UID'])['USR_ID'];
|
||||
}
|
||||
$con = Propel::getConnection(ListUnassignedGroupPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
@@ -77,9 +88,9 @@ class ListUnassignedGroup extends BaseListUnassignedGroup {
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove ($app_uid,$una_uid)
|
||||
public function remove($app_uid, $una_uid)
|
||||
{
|
||||
$con = Propel::getConnection( ListUnassignedGroupPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(ListUnassignedGroupPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$this->setUnaUid($una_uid);
|
||||
@@ -99,7 +110,8 @@ class ListUnassignedGroup extends BaseListUnassignedGroup {
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function newRow($unaUid, $usrUid, $type, $typeUid=''){
|
||||
public function newRow($unaUid, $usrUid, $type, $typeUid = '')
|
||||
{
|
||||
$data['UNA_UID'] = $unaUid;
|
||||
$data['USR_UID'] = $usrUid;
|
||||
$data['TYPE'] = $type;
|
||||
|
||||
@@ -165,6 +165,9 @@ class Process extends BaseProcess
|
||||
} while ($this->processExists( $sNewProUid ));
|
||||
} else {
|
||||
$sNewProUid = $aData['PRO_UID'];
|
||||
if (!empty($aData['PRO_ID'])) {
|
||||
$this->setProId($aData['PRO_ID']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setProUid( $sNewProUid );
|
||||
|
||||
@@ -410,6 +410,9 @@ class Task extends BaseTask
|
||||
$this->setTasPosy("");
|
||||
$this->setTasColor("");
|
||||
$this->setTasGroupVariable("");
|
||||
if (!$generateUid && !empty($aData['TAS_ID'])) {
|
||||
$this->setTasId($aData['TAS_ID']);
|
||||
}
|
||||
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
if ($this->validate()) {
|
||||
|
||||
@@ -63,12 +63,16 @@ class AppDelegationMapBuilder
|
||||
$tMap = $this->dbMap->addTable('APP_DELEGATION');
|
||||
$tMap->setPhpName('AppDelegation');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('DELEGATION_ID', 'DelegationId', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('DEL_PREVIOUS', 'DelPrevious', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('DEL_LAST_INDEX', 'DelLastIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||
@@ -113,6 +117,12 @@ class AppDelegationMapBuilder
|
||||
|
||||
$tMap->addColumn('APP_OVERDUE_PERCENTAGE', 'AppOverduePercentage', 'double', CreoleTypes::DOUBLE, true, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addValidator('DEL_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|PARALLEL', 'Please select a valid status.');
|
||||
|
||||
$tMap->addValidator('DEL_PRIORITY', 'validValues', 'propel.validator.ValidValuesValidator', '1|2|3|4|5', 'Please select a valid Priority.');
|
||||
|
||||
@@ -77,6 +77,8 @@ class ApplicationMapBuilder
|
||||
|
||||
$tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('APP_STATUS_ID', 'AppStatusId', 'int', CreoleTypes::TINYINT, true, null);
|
||||
|
||||
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_PROC_STATUS', 'AppProcStatus', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
@@ -101,6 +101,12 @@ class ListCanceledMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListCanceledMapBuilder
|
||||
|
||||
@@ -95,6 +95,12 @@ class ListCompletedMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_CURRENT_USR_LASTNAME', 'DelCurrentUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListCompletedMapBuilder
|
||||
|
||||
@@ -105,6 +105,14 @@ class ListInboxMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('APP_STATUS_ID', 'AppStatusId', 'int', CreoleTypes::TINYINT, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListInboxMapBuilder
|
||||
|
||||
@@ -115,6 +115,14 @@ class ListMyInboxMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('APP_STATUS_ID', 'AppStatusId', 'int', CreoleTypes::TINYINT, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListMyInboxMapBuilder
|
||||
|
||||
@@ -105,6 +105,12 @@ class ListParticipatedHistoryMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListParticipatedHistoryMapBuilder
|
||||
|
||||
@@ -111,6 +111,14 @@ class ListParticipatedLastMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_THREAD_STATUS', 'DelThreadStatus', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('APP_STATUS_ID', 'AppStatusId', 'int', CreoleTypes::TINYINT, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListParticipatedLastMapBuilder
|
||||
|
||||
@@ -109,6 +109,12 @@ class ListPausedMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListPausedMapBuilder
|
||||
|
||||
@@ -73,6 +73,8 @@ class ListUnassignedGroupMapBuilder
|
||||
|
||||
$tMap->addColumn('TYP_UID', 'TypUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListUnassignedGroupMapBuilder
|
||||
|
||||
@@ -97,6 +97,10 @@ class ListUnassignedMapBuilder
|
||||
|
||||
$tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ListUnassignedMapBuilder
|
||||
|
||||
@@ -63,10 +63,12 @@ class ProcessMapBuilder
|
||||
$tMap = $this->dbMap->addTable('PROCESS');
|
||||
$tMap->setPhpName('Process');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('PRO_TITLE', 'ProTitle', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
||||
|
||||
$tMap->addColumn('PRO_DESCRIPTION', 'ProDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
@@ -63,12 +63,14 @@ class TaskMapBuilder
|
||||
$tMap = $this->dbMap->addTable('TASK');
|
||||
$tMap->setPhpName('Task');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('TAS_TITLE', 'TasTitle', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
||||
|
||||
$tMap->addColumn('TAS_DESCRIPTION', 'TasDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
@@ -63,10 +63,12 @@ class UsersMapBuilder
|
||||
$tMap = $this->dbMap->addTable('USERS');
|
||||
$tMap->setPhpName('Users');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
$tMap->setUseIdGenerator(true);
|
||||
|
||||
$tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('USR_ID', 'UsrId', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('USR_USERNAME', 'UsrUsername', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('USR_PASSWORD', 'UsrPassword', 'string', CreoleTypes::VARCHAR, true, 128);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ abstract class BaseAppDelegationPeer
|
||||
const CLASS_DEFAULT = 'classes.model.AppDelegation';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 24;
|
||||
const NUM_COLUMNS = 29;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -37,6 +37,12 @@ abstract class BaseAppDelegationPeer
|
||||
/** the column name for the DEL_INDEX field */
|
||||
const DEL_INDEX = 'APP_DELEGATION.DEL_INDEX';
|
||||
|
||||
/** the column name for the DELEGATION_ID field */
|
||||
const DELEGATION_ID = 'APP_DELEGATION.DELEGATION_ID';
|
||||
|
||||
/** the column name for the APP_NUMBER field */
|
||||
const APP_NUMBER = 'APP_DELEGATION.APP_NUMBER';
|
||||
|
||||
/** the column name for the DEL_PREVIOUS field */
|
||||
const DEL_PREVIOUS = 'APP_DELEGATION.DEL_PREVIOUS';
|
||||
|
||||
@@ -103,6 +109,15 @@ abstract class BaseAppDelegationPeer
|
||||
/** the column name for the APP_OVERDUE_PERCENTAGE field */
|
||||
const APP_OVERDUE_PERCENTAGE = 'APP_DELEGATION.APP_OVERDUE_PERCENTAGE';
|
||||
|
||||
/** the column name for the USR_ID field */
|
||||
const USR_ID = 'APP_DELEGATION.USR_ID';
|
||||
|
||||
/** the column name for the PRO_ID field */
|
||||
const PRO_ID = 'APP_DELEGATION.PRO_ID';
|
||||
|
||||
/** the column name for the TAS_ID field */
|
||||
const TAS_ID = 'APP_DELEGATION.TAS_ID';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -114,10 +129,10 @@ abstract class BaseAppDelegationPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'DelPrevious', 'DelLastIndex', 'ProUid', 'TasUid', 'UsrUid', 'DelType', 'DelThread', 'DelThreadStatus', 'DelPriority', 'DelDelegateDate', 'DelInitDate', 'DelFinishDate', 'DelTaskDueDate', 'DelRiskDate', 'DelDuration', 'DelQueueDuration', 'DelDelayDuration', 'DelStarted', 'DelFinished', 'DelDelayed', 'DelData', 'AppOverduePercentage', ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID, AppDelegationPeer::DEL_INDEX, AppDelegationPeer::DEL_PREVIOUS, AppDelegationPeer::DEL_LAST_INDEX, AppDelegationPeer::PRO_UID, AppDelegationPeer::TAS_UID, AppDelegationPeer::USR_UID, AppDelegationPeer::DEL_TYPE, AppDelegationPeer::DEL_THREAD, AppDelegationPeer::DEL_THREAD_STATUS, AppDelegationPeer::DEL_PRIORITY, AppDelegationPeer::DEL_DELEGATE_DATE, AppDelegationPeer::DEL_INIT_DATE, AppDelegationPeer::DEL_FINISH_DATE, AppDelegationPeer::DEL_TASK_DUE_DATE, AppDelegationPeer::DEL_RISK_DATE, AppDelegationPeer::DEL_DURATION, AppDelegationPeer::DEL_QUEUE_DURATION, AppDelegationPeer::DEL_DELAY_DURATION, AppDelegationPeer::DEL_STARTED, AppDelegationPeer::DEL_FINISHED, AppDelegationPeer::DEL_DELAYED, AppDelegationPeer::DEL_DATA, AppDelegationPeer::APP_OVERDUE_PERCENTAGE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'DEL_PREVIOUS', 'DEL_LAST_INDEX', 'PRO_UID', 'TAS_UID', 'USR_UID', 'DEL_TYPE', 'DEL_THREAD', 'DEL_THREAD_STATUS', 'DEL_PRIORITY', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_FINISH_DATE', 'DEL_TASK_DUE_DATE', 'DEL_RISK_DATE', 'DEL_DURATION', 'DEL_QUEUE_DURATION', 'DEL_DELAY_DURATION', 'DEL_STARTED', 'DEL_FINISHED', 'DEL_DELAYED', 'DEL_DATA', 'APP_OVERDUE_PERCENTAGE', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'DelegationId', 'AppNumber', 'DelPrevious', 'DelLastIndex', 'ProUid', 'TasUid', 'UsrUid', 'DelType', 'DelThread', 'DelThreadStatus', 'DelPriority', 'DelDelegateDate', 'DelInitDate', 'DelFinishDate', 'DelTaskDueDate', 'DelRiskDate', 'DelDuration', 'DelQueueDuration', 'DelDelayDuration', 'DelStarted', 'DelFinished', 'DelDelayed', 'DelData', 'AppOverduePercentage', 'UsrId', 'ProId', 'TasId', ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID, AppDelegationPeer::DEL_INDEX, AppDelegationPeer::DELEGATION_ID, AppDelegationPeer::APP_NUMBER, AppDelegationPeer::DEL_PREVIOUS, AppDelegationPeer::DEL_LAST_INDEX, AppDelegationPeer::PRO_UID, AppDelegationPeer::TAS_UID, AppDelegationPeer::USR_UID, AppDelegationPeer::DEL_TYPE, AppDelegationPeer::DEL_THREAD, AppDelegationPeer::DEL_THREAD_STATUS, AppDelegationPeer::DEL_PRIORITY, AppDelegationPeer::DEL_DELEGATE_DATE, AppDelegationPeer::DEL_INIT_DATE, AppDelegationPeer::DEL_FINISH_DATE, AppDelegationPeer::DEL_TASK_DUE_DATE, AppDelegationPeer::DEL_RISK_DATE, AppDelegationPeer::DEL_DURATION, AppDelegationPeer::DEL_QUEUE_DURATION, AppDelegationPeer::DEL_DELAY_DURATION, AppDelegationPeer::DEL_STARTED, AppDelegationPeer::DEL_FINISHED, AppDelegationPeer::DEL_DELAYED, AppDelegationPeer::DEL_DATA, AppDelegationPeer::APP_OVERDUE_PERCENTAGE, AppDelegationPeer::USR_ID, AppDelegationPeer::PRO_ID, AppDelegationPeer::TAS_ID, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'DELEGATION_ID', 'APP_NUMBER', 'DEL_PREVIOUS', 'DEL_LAST_INDEX', 'PRO_UID', 'TAS_UID', 'USR_UID', 'DEL_TYPE', 'DEL_THREAD', 'DEL_THREAD_STATUS', 'DEL_PRIORITY', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_FINISH_DATE', 'DEL_TASK_DUE_DATE', 'DEL_RISK_DATE', 'DEL_DURATION', 'DEL_QUEUE_DURATION', 'DEL_DELAY_DURATION', 'DEL_STARTED', 'DEL_FINISHED', 'DEL_DELAYED', 'DEL_DATA', 'APP_OVERDUE_PERCENTAGE', 'USR_ID', 'PRO_ID', 'TAS_ID', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -127,10 +142,10 @@ abstract class BaseAppDelegationPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'DelPrevious' => 2, 'DelLastIndex' => 3, 'ProUid' => 4, 'TasUid' => 5, 'UsrUid' => 6, 'DelType' => 7, 'DelThread' => 8, 'DelThreadStatus' => 9, 'DelPriority' => 10, 'DelDelegateDate' => 11, 'DelInitDate' => 12, 'DelFinishDate' => 13, 'DelTaskDueDate' => 14, 'DelRiskDate' => 15, 'DelDuration' => 16, 'DelQueueDuration' => 17, 'DelDelayDuration' => 18, 'DelStarted' => 19, 'DelFinished' => 20, 'DelDelayed' => 21, 'DelData' => 22, 'AppOverduePercentage' => 23, ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID => 0, AppDelegationPeer::DEL_INDEX => 1, AppDelegationPeer::DEL_PREVIOUS => 2, AppDelegationPeer::DEL_LAST_INDEX => 3, AppDelegationPeer::PRO_UID => 4, AppDelegationPeer::TAS_UID => 5, AppDelegationPeer::USR_UID => 6, AppDelegationPeer::DEL_TYPE => 7, AppDelegationPeer::DEL_THREAD => 8, AppDelegationPeer::DEL_THREAD_STATUS => 9, AppDelegationPeer::DEL_PRIORITY => 10, AppDelegationPeer::DEL_DELEGATE_DATE => 11, AppDelegationPeer::DEL_INIT_DATE => 12, AppDelegationPeer::DEL_FINISH_DATE => 13, AppDelegationPeer::DEL_TASK_DUE_DATE => 14, AppDelegationPeer::DEL_RISK_DATE => 15, AppDelegationPeer::DEL_DURATION => 16, AppDelegationPeer::DEL_QUEUE_DURATION => 17, AppDelegationPeer::DEL_DELAY_DURATION => 18, AppDelegationPeer::DEL_STARTED => 19, AppDelegationPeer::DEL_FINISHED => 20, AppDelegationPeer::DEL_DELAYED => 21, AppDelegationPeer::DEL_DATA => 22, AppDelegationPeer::APP_OVERDUE_PERCENTAGE => 23, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'DEL_PREVIOUS' => 2, 'DEL_LAST_INDEX' => 3, 'PRO_UID' => 4, 'TAS_UID' => 5, 'USR_UID' => 6, 'DEL_TYPE' => 7, 'DEL_THREAD' => 8, 'DEL_THREAD_STATUS' => 9, 'DEL_PRIORITY' => 10, 'DEL_DELEGATE_DATE' => 11, 'DEL_INIT_DATE' => 12, 'DEL_FINISH_DATE' => 13, 'DEL_TASK_DUE_DATE' => 14, 'DEL_RISK_DATE' => 15, 'DEL_DURATION' => 16, 'DEL_QUEUE_DURATION' => 17, 'DEL_DELAY_DURATION' => 18, 'DEL_STARTED' => 19, 'DEL_FINISHED' => 20, 'DEL_DELAYED' => 21, 'DEL_DATA' => 22, 'APP_OVERDUE_PERCENTAGE' => 23, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'DelegationId' => 2, 'AppNumber' => 3, 'DelPrevious' => 4, 'DelLastIndex' => 5, 'ProUid' => 6, 'TasUid' => 7, 'UsrUid' => 8, 'DelType' => 9, 'DelThread' => 10, 'DelThreadStatus' => 11, 'DelPriority' => 12, 'DelDelegateDate' => 13, 'DelInitDate' => 14, 'DelFinishDate' => 15, 'DelTaskDueDate' => 16, 'DelRiskDate' => 17, 'DelDuration' => 18, 'DelQueueDuration' => 19, 'DelDelayDuration' => 20, 'DelStarted' => 21, 'DelFinished' => 22, 'DelDelayed' => 23, 'DelData' => 24, 'AppOverduePercentage' => 25, 'UsrId' => 26, 'ProId' => 27, 'TasId' => 28, ),
|
||||
BasePeer::TYPE_COLNAME => array (AppDelegationPeer::APP_UID => 0, AppDelegationPeer::DEL_INDEX => 1, AppDelegationPeer::DELEGATION_ID => 2, AppDelegationPeer::APP_NUMBER => 3, AppDelegationPeer::DEL_PREVIOUS => 4, AppDelegationPeer::DEL_LAST_INDEX => 5, AppDelegationPeer::PRO_UID => 6, AppDelegationPeer::TAS_UID => 7, AppDelegationPeer::USR_UID => 8, AppDelegationPeer::DEL_TYPE => 9, AppDelegationPeer::DEL_THREAD => 10, AppDelegationPeer::DEL_THREAD_STATUS => 11, AppDelegationPeer::DEL_PRIORITY => 12, AppDelegationPeer::DEL_DELEGATE_DATE => 13, AppDelegationPeer::DEL_INIT_DATE => 14, AppDelegationPeer::DEL_FINISH_DATE => 15, AppDelegationPeer::DEL_TASK_DUE_DATE => 16, AppDelegationPeer::DEL_RISK_DATE => 17, AppDelegationPeer::DEL_DURATION => 18, AppDelegationPeer::DEL_QUEUE_DURATION => 19, AppDelegationPeer::DEL_DELAY_DURATION => 20, AppDelegationPeer::DEL_STARTED => 21, AppDelegationPeer::DEL_FINISHED => 22, AppDelegationPeer::DEL_DELAYED => 23, AppDelegationPeer::DEL_DATA => 24, AppDelegationPeer::APP_OVERDUE_PERCENTAGE => 25, AppDelegationPeer::USR_ID => 26, AppDelegationPeer::PRO_ID => 27, AppDelegationPeer::TAS_ID => 28, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'DELEGATION_ID' => 2, 'APP_NUMBER' => 3, 'DEL_PREVIOUS' => 4, 'DEL_LAST_INDEX' => 5, 'PRO_UID' => 6, 'TAS_UID' => 7, 'USR_UID' => 8, 'DEL_TYPE' => 9, 'DEL_THREAD' => 10, 'DEL_THREAD_STATUS' => 11, 'DEL_PRIORITY' => 12, 'DEL_DELEGATE_DATE' => 13, 'DEL_INIT_DATE' => 14, 'DEL_FINISH_DATE' => 15, 'DEL_TASK_DUE_DATE' => 16, 'DEL_RISK_DATE' => 17, 'DEL_DURATION' => 18, 'DEL_QUEUE_DURATION' => 19, 'DEL_DELAY_DURATION' => 20, 'DEL_STARTED' => 21, 'DEL_FINISHED' => 22, 'DEL_DELAYED' => 23, 'DEL_DATA' => 24, 'APP_OVERDUE_PERCENTAGE' => 25, 'USR_ID' => 26, 'PRO_ID' => 27, 'TAS_ID' => 28, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -235,6 +250,10 @@ abstract class BaseAppDelegationPeer
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DELEGATION_ID);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::APP_NUMBER);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_LAST_INDEX);
|
||||
@@ -279,6 +298,12 @@ abstract class BaseAppDelegationPeer
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::APP_OVERDUE_PERCENTAGE);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::USR_ID);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::PRO_ID);
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::TAS_ID);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(APP_DELEGATION.APP_UID)';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user