diff --git a/gulliver/js/codemirror/addon/hint/php-hint.js b/gulliver/js/codemirror/addon/hint/php-hint.js index 9723cb250..2b2f7338f 100644 --- a/gulliver/js/codemirror/addon/hint/php-hint.js +++ b/gulliver/js/codemirror/addon/hint/php-hint.js @@ -24,7 +24,7 @@ var sToken = token.string.trim(); if ( sToken == "(") { - token = tprop = getToken(editor, Pos(cur.line, tprop.start)); + token = tprop = getToken(editor, Pos(cur.line, tprop.start)); return {list: getCompletions(token.string, keywords, options), from: Pos(cur.line, token.start), to: Pos(cur.line, token.end + 1)}; @@ -244,24 +244,24 @@ } arrayFunction = arrayFunctions[functionName]; - + if (arrayFunction != undefined) { forEach( arrayFunction, yesAdd); } else { if (functionName.trim() == "") { - forEach (phpKeywords, yesAdd); - forEach (keywords, yesAdd); + forEach (phpKeywords, yesAdd); + forEach (keywords, yesAdd); } else if (functionName == "=") { - forEach (phpPMFunctions, yesAdd); + forEach (phpPMFunctions, yesAdd); } else { - for (index = 0; index < phpKeywords.length; index++) { - if ( phpKeywords[index].indexOf(functionName) == 0 ) { - found.push(phpKeywords[index]); - } - } - forEach(keywords, maybeAdd); + for (index = 0; index < phpKeywords.length; index++) { + if ( phpKeywords[index].indexOf(functionName) == 0 ) { + found.push(phpKeywords[index]); + } + } + forEach(keywords, maybeAdd); } } return found; } -})(); +})(); \ No newline at end of file diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index e9e76ec53..78f021b69 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -3906,6 +3906,18 @@ class Cases } $this->getExecuteTriggerProcess($sApplicationUID, 'PAUSED'); + + /*----------------------------------********---------------------------------*/ + $data = array ( + 'APP_UID' => $sApplicationUID, + 'DEL_INDEX' => $iDelegation, + 'USR_UID' => $sUserUID, + 'APP_RESTART_DATE' => $sUnpauseDate + ); + $data = array_merge($aFields, $data); + $oListPaused = new ListPaused(); + $oListPaused->create($data); + /*----------------------------------********---------------------------------*/ } /* @@ -3996,6 +4008,11 @@ class Cases } $this->getExecuteTriggerProcess($sApplicationUID, "UNPAUSE"); + + /*----------------------------------********---------------------------------*/ + $oListPaused = new ListPaused(); + $oListPaused->remove($sApplicationUID, $iDelegation, true); + /*----------------------------------********---------------------------------*/ } /* @@ -4080,6 +4097,15 @@ class Cases if ($this->appSolr != null) { $this->appSolr->updateApplicationSearchIndex($sApplicationUID); } + + $data = array ( + 'APP_UID' => $sApplicationUID, + 'DEL_INDEX' => $iIndex, + 'USR_UID' => $user_logged + ); + $data = array_merge($aFields, $data); + $oListCanceled = new ListCanceled(); + $oListCanceled->create($data); } /* diff --git a/workflow/engine/classes/class.configuration.php b/workflow/engine/classes/class.configuration.php index 16c44cf0e..d26da6083 100755 --- a/workflow/engine/classes/class.configuration.php +++ b/workflow/engine/classes/class.configuration.php @@ -373,12 +373,15 @@ class Configurations // extends Configuration */ public function getFormats() { - if (!isset($this->UserConfig)) { + if (!isset($this->UserConfig)) { $this->UserConfig = array(); } if (empty($this->UserConfig)) { $this->UserConfig = $this->getConfiguration("ENVIRONMENT_SETTINGS", ""); } + if (is_numeric($this->UserConfig)) { + $this->UserConfig = array(); + } //Setting defaults if (!isset($this->UserConfig["format"])) { diff --git a/workflow/engine/classes/model/ListCanceled.php b/workflow/engine/classes/model/ListCanceled.php new file mode 100644 index 000000000..a0974f76d --- /dev/null +++ b/workflow/engine/classes/model/ListCanceled.php @@ -0,0 +1,302 @@ +addSelectColumn(ContentPeer::CON_VALUE); + $criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_TITLE'] = $aRow['CON_VALUE']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(ContentPeer::CON_VALUE); + $criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_PRO_TITLE'] = $aRow['CON_VALUE']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(AppDelegationPeer::TAS_UID); + $criteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE); + $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 ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['TAS_UID'] = $aRow['TAS_UID']; + $data['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE']; + $data['DEL_DUE_DATE'] = $aRow['DEL_TASK_DUE_DATE']; + $data['DEL_DELEGATE_DATE'] = $aRow['DEL_DELEGATE_DATE']; + $delPrevious = $aRow['DEL_PREVIOUS']; + + $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 ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['DEL_PREVIOUS_USR_UID'] = $aRow['USR_UID']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(ContentPeer::CON_VALUE); + $criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_TAS_TITLE'] = $aRow['CON_VALUE']; + + $criteria = new Criteria(); + $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 ); + $dataset = UsersPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['DEL_CURRENT_USR_USERNAME'] = $aRow['USR_USERNAME']; + $data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME']; + $data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME']; + + $data['APP_CANCELED_DATE'] = Date("Y-m-d H:i:s"); + + $oListInbox = new ListInbox(); + $oListInbox->removeAll($data['APP_UID']); + + $con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME ); + try { + $this->fromArray( $data, BasePeer::TYPE_FIELDNAME ); + if ($this->validate()) { + $result = $this->save(); + } else { + $e = new Exception( "Failed Validation in class " . get_class( $this ) . "." ); + $e->aValidationFailures = $this->getValidationFailures(); + throw ($e); + } + $con->commit(); + return $result; + } catch(Exception $e) { + $con->rollback(); + throw ($e); + } + } + + /** + * Update List Canceled Table + * + * @param type $data + * @return type + * @throws type + */ + public function update($data) + { + $con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME ); + try { + $con->begin(); + $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 ) . "." )); + } + } catch (Exception $e) { + $con->rollback(); + throw ($e); + } + } + + /** + * Remove List Canceled + * + * @param type $seqName + * @return type + * @throws type + * + */ + public function remove ($app_uid) + { + $con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME ); + try { + $this->setAppUid($app_uid); + $con->begin(); + $this->delete(); + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + throw ($e); + } + } + + 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'] : ""; + + if ($filter != '') { + switch ($filter) { + case 'read': + $criteria->add( ListCanceledPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL ); + break; + case 'unread': + $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_NUMBER, $search, Criteria::LIKE ) ) ) ); + } + + if ($process != '') { + $criteria->add( ListCanceledPeer::PRO_UID, $process, Criteria::EQUAL); + } + + if ($category != '') { + // INNER JOIN FOR TAS_TITLE + $criteria->addSelectColumn(ProcessPeer::PRO_CATEGORY); + $aConditions = array(); + $aConditions[] = array(ListCanceledPeer::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( 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 ); + } + } elseif ($dateTo != "") { + $dateTo = $dateTo . " 23:59:59"; + + $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()) + { + $resp = array(); + $criteria = new Criteria(); + + $criteria->addSelectColumn(ListCanceledPeer::APP_UID); + $criteria->addSelectColumn(ListCanceledPeer::USR_UID); + $criteria->addSelectColumn(ListCanceledPeer::TAS_UID); + $criteria->addSelectColumn(ListCanceledPeer::PRO_UID); + $criteria->addSelectColumn(ListCanceledPeer::APP_NUMBER); + $criteria->addSelectColumn(ListCanceledPeer::APP_TITLE); + $criteria->addSelectColumn(ListCanceledPeer::APP_PRO_TITLE); + $criteria->addSelectColumn(ListCanceledPeer::APP_TAS_TITLE); + $criteria->addSelectColumn(ListCanceledPeer::APP_CANCELED_DATE); + $criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX); + $criteria->addSelectColumn(ListCanceledPeer::DEL_PREVIOUS_USR_UID); + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME); + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME); + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_USERNAME); + $criteria->addSelectColumn(ListCanceledPeer::DEL_DELEGATE_DATE); + $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 ); + self::loadFilters($criteria, $filters); + + $sort = (!empty($filters['sort'])) ? $filters['sort'] : "APP_FINISH_DATE"; + $dir = isset($filters['dir']) ? $filters['dir'] : "ASC"; + $start = isset($filters['start']) ? $filters['start'] : "0"; + $limit = isset($filters['limit']) ? $filters['limit'] : "25"; + $paged = isset($filters['paged']) ? $filters['paged'] : 1; + + if ($dir == "DESC") { + $criteria->addDescendingOrderByColumn($sort); + } else { + $criteria->addAscendingOrderByColumn($sort); + } + + if ($paged == 1) { + $criteria->setLimit( $limit ); + $criteria->setOffset( $start ); + } + + $dataset = ListCanceledPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $data = array(); + while ($dataset->next()) { + $aRow = $dataset->getRow(); + $data[] = $aRow; + } + + return $data; + } +} // ListCanceled diff --git a/workflow/engine/classes/model/ListCanceledPeer.php b/workflow/engine/classes/model/ListCanceledPeer.php new file mode 100644 index 000000000..d0e5969a1 --- /dev/null +++ b/workflow/engine/classes/model/ListCanceledPeer.php @@ -0,0 +1,23 @@ +setAppUid($app_uid); + + $con->begin(); + $this->delete(); + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + throw ($e); + } + } + public function newRow ($data, $delPreviusUsrUid) { $data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid; - $data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE']; + if (isset($data['DEL_TASK_DUE_DATE'])) { + $data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE']; + } $criteria = new Criteria(); $criteria->addSelectColumn( ApplicationPeer::APP_NUMBER ); @@ -297,6 +322,9 @@ class ListInbox extends BaseListInbox $limit = isset($filters['limit']) ? $filters['limit'] : "25"; $paged = isset($filters['paged']) ? $filters['paged'] : 1; + if ($filters['action'] == 'draft') { + $criteria->add( ListInboxPeer::DEL_INDEX, 1, Criteria::EQUAL ); + } if ($dir == "DESC") { $criteria->addDescendingOrderByColumn($sort); } else { diff --git a/workflow/engine/classes/model/ListParticipatedLast.php b/workflow/engine/classes/model/ListParticipatedLast.php index ac48121f9..b1ccb12eb 100644 --- a/workflow/engine/classes/model/ListParticipatedLast.php +++ b/workflow/engine/classes/model/ListParticipatedLast.php @@ -25,6 +25,28 @@ class ListParticipatedLast extends BaseListParticipatedLast */ public function create($data) { + $criteria = new Criteria(); + $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 ); + $dataset = UsersPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['DEL_CURRENT_USR_USERNAME'] = $aRow['USR_USERNAME']; + $data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME']; + $data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(ApplicationPeer::APP_STATUS); + $criteria->add( ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL ); + $dataset = UsersPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_STATUS'] = $aRow['APP_STATUS']; + $con = Propel::getConnection( ListParticipatedLastPeer::DATABASE_NAME ); try { $this->fromArray( $data, BasePeer::TYPE_FIELDNAME ); @@ -182,11 +204,15 @@ class ListParticipatedLast extends BaseListParticipatedLast $criteria->addSelectColumn(ListParticipatedLastPeer::APP_TITLE); $criteria->addSelectColumn(ListParticipatedLastPeer::APP_PRO_TITLE); $criteria->addSelectColumn(ListParticipatedLastPeer::APP_TAS_TITLE); + $criteria->addSelectColumn(ListParticipatedLastPeer::APP_STATUS); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PREVIOUS_USR_UID); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PREVIOUS_USR_USERNAME); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PREVIOUS_USR_FIRSTNAME); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME); + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME); + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME); + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_DELEGATE_DATE); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INIT_DATE); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_DUE_DATE); diff --git a/workflow/engine/classes/model/ListPaused.php b/workflow/engine/classes/model/ListPaused.php new file mode 100644 index 000000000..c211efd76 --- /dev/null +++ b/workflow/engine/classes/model/ListPaused.php @@ -0,0 +1,320 @@ +addSelectColumn(ContentPeer::CON_VALUE); + $criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_TITLE'] = $aRow['CON_VALUE']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(ContentPeer::CON_VALUE); + $criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_PRO_TITLE'] = $aRow['CON_VALUE']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(AppDelegationPeer::TAS_UID); + $criteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE); + $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 ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['TAS_UID'] = $aRow['TAS_UID']; + $data['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE']; + $data['DEL_DUE_DATE'] = $aRow['DEL_TASK_DUE_DATE']; + $data['DEL_DELEGATE_DATE'] = $aRow['DEL_DELEGATE_DATE']; + $delPrevious = $aRow['DEL_PREVIOUS']; + + $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 ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['DEL_PREVIOUS_USR_UID'] = $aRow['USR_UID']; + + $criteria = new Criteria(); + $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 ); + $dataset = UsersPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['DEL_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME']; + $data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME']; + $data['DEL_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME']; + + $criteria = new Criteria(); + $criteria->addSelectColumn(ContentPeer::CON_VALUE); + $criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL ); + $criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL ); + $dataset = ContentPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['APP_TAS_TITLE'] = $aRow['CON_VALUE']; + + $criteria = new Criteria(); + $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 ); + $dataset = UsersPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $dataset->next(); + $aRow = $dataset->getRow(); + $data['DEL_CURRENT_USR_USERNAME'] = $aRow['USR_USERNAME']; + $data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME']; + $data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME']; + + $data['APP_PAUSED_DATE'] = Date("Y-m-d H:i:s"); + + $oListInbox = new ListInbox(); + $oListInbox->remove($data['APP_UID'], $data['DEL_INDEX']); + + $con = Propel::getConnection( ListPausedPeer::DATABASE_NAME ); + try { + $this->fromArray( $data, BasePeer::TYPE_FIELDNAME ); + if ($this->validate()) { + $result = $this->save(); + } else { + $e = new Exception( "Failed Validation in class " . get_class( $this ) . "." ); + $e->aValidationFailures = $this->getValidationFailures(); + throw ($e); + } + $con->commit(); + return $result; + } catch(Exception $e) { + $con->rollback(); + throw ($e); + } + } + + /** + * Update List Paused Table + * + * @param type $data + * @return type + * @throws type + */ + public function update($data) + { + $con = Propel::getConnection( ListPausedPeer::DATABASE_NAME ); + try { + $con->begin(); + $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 ) . "." )); + } + } catch (Exception $e) { + $con->rollback(); + throw ($e); + } + } + + /** + * Remove List Paused + * + * @param type $seqName + * @return type + * @throws type + * + */ + public function remove ($app_uid, $del_index) + { + $con = Propel::getConnection( ListPausedPeer::DATABASE_NAME ); + try { + $this->setAppUid($app_uid); + $this->setDelIndex($del_index); + $con->begin(); + $this->delete(); + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + throw ($e); + } + } + + 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'] : ""; + + 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; + } + } + + 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( ListPausedPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) ); + } + + if ($process != '') { + $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()) + { + $resp = array(); + $criteria = new Criteria(); + + $criteria->addSelectColumn(ListPausedPeer::APP_UID); + $criteria->addSelectColumn(ListPausedPeer::USR_UID); + $criteria->addSelectColumn(ListPausedPeer::TAS_UID); + $criteria->addSelectColumn(ListPausedPeer::PRO_UID); + $criteria->addSelectColumn(ListPausedPeer::APP_NUMBER); + $criteria->addSelectColumn(ListPausedPeer::APP_TITLE); + $criteria->addSelectColumn(ListPausedPeer::APP_PRO_TITLE); + $criteria->addSelectColumn(ListPausedPeer::APP_TAS_TITLE); + $criteria->addSelectColumn(ListPausedPeer::APP_PAUSED_DATE); + $criteria->addSelectColumn(ListPausedPeer::APP_RESTART_DATE); + $criteria->addSelectColumn(ListPausedPeer::DEL_INDEX); + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_UID); + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_USERNAME); + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME); + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME); + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME); + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_LASTNAME); + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_USERNAME); + $criteria->addSelectColumn(ListPausedPeer::DEL_DELEGATE_DATE); + $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 ); + self::loadFilters($criteria, $filters); + + $sort = (!empty($filters['sort'])) ? $filters['sort'] : "APP_PAUSED_DATE"; + $dir = isset($filters['dir']) ? $filters['dir'] : "ASC"; + $start = isset($filters['start']) ? $filters['start'] : "0"; + $limit = isset($filters['limit']) ? $filters['limit'] : "25"; + $paged = isset($filters['paged']) ? $filters['paged'] : 1; + + if ($dir == "DESC") { + $criteria->addDescendingOrderByColumn($sort); + } else { + $criteria->addAscendingOrderByColumn($sort); + } + + if ($paged == 1) { + $criteria->setLimit( $limit ); + $criteria->setOffset( $start ); + } + + $dataset = ListPausedPeer::doSelectRS($criteria); + $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); + $data = array(); + while ($dataset->next()) { + $aRow = $dataset->getRow(); + $data[] = $aRow; + } + + return $data; + } +} // ListPaused diff --git a/workflow/engine/classes/model/ListPausedPeer.php b/workflow/engine/classes/model/ListPausedPeer.php new file mode 100644 index 000000000..224744dd1 --- /dev/null +++ b/workflow/engine/classes/model/ListPausedPeer.php @@ -0,0 +1,23 @@ +dbMap; @@ -55,13 +56,11 @@ class AddonsStoreMapBuilder * @return void * @throws PropelException */ - public function doBuild() { $this->dbMap = Propel::getDatabaseMap('workflow'); $tMap = $this->dbMap->addTable('ADDONS_STORE'); - $tMap->setPhpName('AddonsStore'); $tMap->setUseIdGenerator(false); @@ -75,6 +74,7 @@ class AddonsStoreMapBuilder $tMap->addColumn('STORE_TYPE', 'StoreType', 'string', CreoleTypes::VARCHAR, true, 255); $tMap->addColumn('STORE_LAST_UPDATED', 'StoreLastUpdated', 'int', CreoleTypes::TIMESTAMP, false, null); - } -} + } // doBuild() + +} // AddonsStoreMapBuilder diff --git a/workflow/engine/classes/model/map/ListCanceledMapBuilder.php b/workflow/engine/classes/model/map/ListCanceledMapBuilder.php new file mode 100644 index 000000000..9214cd3a0 --- /dev/null +++ b/workflow/engine/classes/model/map/ListCanceledMapBuilder.php @@ -0,0 +1,106 @@ +dbMap !== null); + } + + /** + * Gets the databasemap this map builder built. + * + * @return the databasemap + */ + public function getDatabaseMap() + { + return $this->dbMap; + } + + /** + * The doBuild() method builds the DatabaseMap + * + * @return void + * @throws PropelException + */ + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('workflow'); + + $tMap = $this->dbMap->addTable('LIST_CANCELED'); + $tMap->setPhpName('ListCanceled'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('APP_TITLE', 'AppTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_PRO_TITLE', 'AppProTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_CANCELED_DATE', 'AppCanceledDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32); + + $tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addColumn('DEL_CURRENT_USR_FIRSTNAME', 'DelCurrentUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_CURRENT_USR_LASTNAME', 'DelCurrentUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_DUE_DATE', 'DelDueDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32); + + } // doBuild() + +} // ListCanceledMapBuilder diff --git a/workflow/engine/classes/model/map/ListMyInboxMapBuilder.php b/workflow/engine/classes/model/map/ListMyInboxMapBuilder.php index 2aec4e7b9..42c8fbc11 100644 --- a/workflow/engine/classes/model/map/ListMyInboxMapBuilder.php +++ b/workflow/engine/classes/model/map/ListMyInboxMapBuilder.php @@ -81,11 +81,11 @@ class ListMyInboxMapBuilder $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255); - $tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null); + $tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, false, null); - $tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null); + $tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null); - $tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, true, null); + $tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null); $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100); diff --git a/workflow/engine/classes/model/map/ListParticipatedLastMapBuilder.php b/workflow/engine/classes/model/map/ListParticipatedLastMapBuilder.php index e9ee783d9..10a3e1bf3 100644 --- a/workflow/engine/classes/model/map/ListParticipatedLastMapBuilder.php +++ b/workflow/engine/classes/model/map/ListParticipatedLastMapBuilder.php @@ -81,6 +81,8 @@ class ListParticipatedLastMapBuilder $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255); + $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 20); + $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null); $tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32); @@ -91,6 +93,12 @@ class ListParticipatedLastMapBuilder $tMap->addColumn('DEL_PREVIOUS_USR_LASTNAME', 'DelPreviousUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + $tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addColumn('DEL_CURRENT_USR_FIRSTNAME', 'DelCurrentUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_CURRENT_USR_LASTNAME', 'DelCurrentUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null); $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null); diff --git a/workflow/engine/classes/model/map/ListPausedMapBuilder.php b/workflow/engine/classes/model/map/ListPausedMapBuilder.php new file mode 100644 index 000000000..a535e261d --- /dev/null +++ b/workflow/engine/classes/model/map/ListPausedMapBuilder.php @@ -0,0 +1,114 @@ +dbMap !== null); + } + + /** + * Gets the databasemap this map builder built. + * + * @return the databasemap + */ + public function getDatabaseMap() + { + return $this->dbMap; + } + + /** + * The doBuild() method builds the DatabaseMap + * + * @return void + * @throws PropelException + */ + public function doBuild() + { + $this->dbMap = Propel::getDatabaseMap('workflow'); + + $tMap = $this->dbMap->addTable('LIST_PAUSED'); + $tMap->setPhpName('ListPaused'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('APP_TITLE', 'AppTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_PRO_TITLE', 'AppProTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_PAUSED_DATE', 'AppPausedDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('APP_RESTART_DATE', 'AppRestartDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32); + + $tMap->addColumn('DEL_PREVIOUS_USR_USERNAME', 'DelPreviousUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addColumn('DEL_PREVIOUS_USR_FIRSTNAME', 'DelPreviousUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_PREVIOUS_USR_LASTNAME', 'DelPreviousUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addColumn('DEL_CURRENT_USR_FIRSTNAME', 'DelCurrentUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_CURRENT_USR_LASTNAME', 'DelCurrentUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_DUE_DATE', 'DelDueDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32); + + } // doBuild() + +} // ListPausedMapBuilder diff --git a/workflow/engine/classes/model/om/BaseListCanceled.php b/workflow/engine/classes/model/om/BaseListCanceled.php new file mode 100644 index 000000000..14bdcb1d6 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListCanceled.php @@ -0,0 +1,1608 @@ +app_uid; + } + + /** + * Get the [usr_uid] column value. + * + * @return string + */ + public function getUsrUid() + { + + return $this->usr_uid; + } + + /** + * Get the [tas_uid] column value. + * + * @return string + */ + public function getTasUid() + { + + return $this->tas_uid; + } + + /** + * Get the [pro_uid] column value. + * + * @return string + */ + public function getProUid() + { + + return $this->pro_uid; + } + + /** + * Get the [app_number] column value. + * + * @return int + */ + public function getAppNumber() + { + + return $this->app_number; + } + + /** + * Get the [app_title] column value. + * + * @return string + */ + public function getAppTitle() + { + + return $this->app_title; + } + + /** + * Get the [app_pro_title] column value. + * + * @return string + */ + public function getAppProTitle() + { + + return $this->app_pro_title; + } + + /** + * Get the [app_tas_title] column value. + * + * @return string + */ + public function getAppTasTitle() + { + + return $this->app_tas_title; + } + + /** + * Get the [optionally formatted] [app_canceled_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getAppCanceledDate($format = 'Y-m-d H:i:s') + { + + if ($this->app_canceled_date === null || $this->app_canceled_date === '') { + return null; + } elseif (!is_int($this->app_canceled_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->app_canceled_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [app_canceled_date] as date/time value: " . + var_export($this->app_canceled_date, true)); + } + } else { + $ts = $this->app_canceled_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_index] column value. + * + * @return int + */ + public function getDelIndex() + { + + return $this->del_index; + } + + /** + * Get the [del_previous_usr_uid] column value. + * + * @return string + */ + public function getDelPreviousUsrUid() + { + + return $this->del_previous_usr_uid; + } + + /** + * Get the [del_current_usr_username] column value. + * + * @return string + */ + public function getDelCurrentUsrUsername() + { + + return $this->del_current_usr_username; + } + + /** + * Get the [del_current_usr_firstname] column value. + * + * @return string + */ + public function getDelCurrentUsrFirstname() + { + + return $this->del_current_usr_firstname; + } + + /** + * Get the [del_current_usr_lastname] column value. + * + * @return string + */ + public function getDelCurrentUsrLastname() + { + + return $this->del_current_usr_lastname; + } + + /** + * Get the [optionally formatted] [del_delegate_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDelegateDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_delegate_date === null || $this->del_delegate_date === '') { + return null; + } elseif (!is_int($this->del_delegate_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_delegate_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " . + var_export($this->del_delegate_date, true)); + } + } else { + $ts = $this->del_delegate_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_init_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelInitDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_init_date === null || $this->del_init_date === '') { + return null; + } elseif (!is_int($this->del_init_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_init_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " . + var_export($this->del_init_date, true)); + } + } else { + $ts = $this->del_init_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_due_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDueDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_due_date === null || $this->del_due_date === '') { + return null; + } elseif (!is_int($this->del_due_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_due_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_due_date] as date/time value: " . + var_export($this->del_due_date, true)); + } + } else { + $ts = $this->del_due_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_priority] column value. + * + * @return string + */ + public function getDelPriority() + { + + return $this->del_priority; + } + + /** + * Set the value of [app_uid] column. + * + * @param string $v new value + * @return void + */ + public function setAppUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_uid !== $v || $v === '') { + $this->app_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_UID; + } + + } // setAppUid() + + /** + * Set the value of [usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->usr_uid !== $v || $v === '') { + $this->usr_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::USR_UID; + } + + } // setUsrUid() + + /** + * Set the value of [tas_uid] column. + * + * @param string $v new value + * @return void + */ + public function setTasUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->tas_uid !== $v || $v === '') { + $this->tas_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::TAS_UID; + } + + } // setTasUid() + + /** + * Set the value of [pro_uid] column. + * + * @param string $v new value + * @return void + */ + public function setProUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->pro_uid !== $v || $v === '') { + $this->pro_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::PRO_UID; + } + + } // setProUid() + + /** + * Set the value of [app_number] column. + * + * @param int $v new value + * @return void + */ + public function setAppNumber($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->app_number !== $v || $v === 0) { + $this->app_number = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_NUMBER; + } + + } // setAppNumber() + + /** + * Set the value of [app_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_title !== $v || $v === '') { + $this->app_title = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_TITLE; + } + + } // setAppTitle() + + /** + * Set the value of [app_pro_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppProTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_pro_title !== $v || $v === '') { + $this->app_pro_title = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_PRO_TITLE; + } + + } // setAppProTitle() + + /** + * Set the value of [app_tas_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTasTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_tas_title !== $v || $v === '') { + $this->app_tas_title = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_TAS_TITLE; + } + + } // setAppTasTitle() + + /** + * Set the value of [app_canceled_date] column. + * + * @param int $v new value + * @return void + */ + public function setAppCanceledDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [app_canceled_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->app_canceled_date !== $ts) { + $this->app_canceled_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::APP_CANCELED_DATE; + } + + } // setAppCanceledDate() + + /** + * Set the value of [del_index] column. + * + * @param int $v new value + * @return void + */ + public function setDelIndex($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->del_index !== $v || $v === 0) { + $this->del_index = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_INDEX; + } + + } // setDelIndex() + + /** + * Set the value of [del_previous_usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setDelPreviousUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_previous_usr_uid !== $v || $v === '') { + $this->del_previous_usr_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_PREVIOUS_USR_UID; + } + + } // setDelPreviousUsrUid() + + /** + * Set the value of [del_current_usr_username] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrUsername($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_username !== $v || $v === '') { + $this->del_current_usr_username = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_CURRENT_USR_USERNAME; + } + + } // setDelCurrentUsrUsername() + + /** + * Set the value of [del_current_usr_firstname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrFirstname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_firstname !== $v || $v === '') { + $this->del_current_usr_firstname = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME; + } + + } // setDelCurrentUsrFirstname() + + /** + * Set the value of [del_current_usr_lastname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrLastname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_lastname !== $v || $v === '') { + $this->del_current_usr_lastname = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_CURRENT_USR_LASTNAME; + } + + } // setDelCurrentUsrLastname() + + /** + * Set the value of [del_delegate_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDelegateDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_delegate_date !== $ts) { + $this->del_delegate_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::DEL_DELEGATE_DATE; + } + + } // setDelDelegateDate() + + /** + * Set the value of [del_init_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelInitDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_init_date !== $ts) { + $this->del_init_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::DEL_INIT_DATE; + } + + } // setDelInitDate() + + /** + * Set the value of [del_due_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDueDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_due_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_due_date !== $ts) { + $this->del_due_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::DEL_DUE_DATE; + } + + } // setDelDueDate() + + /** + * Set the value of [del_priority] column. + * + * @param string $v new value + * @return void + */ + public function setDelPriority($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_priority !== $v || $v === '3') { + $this->del_priority = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_PRIORITY; + } + + } // setDelPriority() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (1-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos. + * @param int $startcol 1-based offset column which indicates which restultset column to start with. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->app_uid = $rs->getString($startcol + 0); + + $this->usr_uid = $rs->getString($startcol + 1); + + $this->tas_uid = $rs->getString($startcol + 2); + + $this->pro_uid = $rs->getString($startcol + 3); + + $this->app_number = $rs->getInt($startcol + 4); + + $this->app_title = $rs->getString($startcol + 5); + + $this->app_pro_title = $rs->getString($startcol + 6); + + $this->app_tas_title = $rs->getString($startcol + 7); + + $this->app_canceled_date = $rs->getTimestamp($startcol + 8, null); + + $this->del_index = $rs->getInt($startcol + 9); + + $this->del_previous_usr_uid = $rs->getString($startcol + 10); + + $this->del_current_usr_username = $rs->getString($startcol + 11); + + $this->del_current_usr_firstname = $rs->getString($startcol + 12); + + $this->del_current_usr_lastname = $rs->getString($startcol + 13); + + $this->del_delegate_date = $rs->getTimestamp($startcol + 14, null); + + $this->del_init_date = $rs->getTimestamp($startcol + 15, null); + + $this->del_due_date = $rs->getTimestamp($startcol + 16, null); + + $this->del_priority = $rs->getString($startcol + 17); + + $this->resetModified(); + + $this->setNew(false); + + // FIXME - using NUM_COLUMNS may be clearer. + return $startcol + 18; // 18 = ListCanceledPeer::NUM_COLUMNS - ListCanceledPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating ListCanceled object", $e); + } + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param Connection $con + * @return void + * @throws PropelException + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME); + } + + try { + $con->begin(); + ListCanceledPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Stores the object in the database. If the object is new, + * it inserts it; otherwise an update is performed. This method + * wraps the doSave() worker method in a transaction. + * + * @param Connection $con + * @return int The number of rows affected by this insert/update + * @throws PropelException + * @see doSave() + */ + public function save($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Stores the object in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param Connection $con + * @return int The number of rows affected by this insert/update and any referring + * @throws PropelException + * @see save() + */ + protected function doSave($con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + // If this object has been modified, then save it to the database. + if ($this->isModified()) { + if ($this->isNew()) { + $pk = ListCanceledPeer::doInsert($this, $con); + $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which + // should always be true here (even though technically + // BasePeer::doInsert() can insert multiple rows). + + $this->setNew(false); + } else { + $affectedRows += ListCanceledPeer::doUpdate($this, $con); + } + $this->resetModified(); // [HL] After being saved an object is no longer 'modified' + } + + $this->alreadyInSave = false; + } + return $affectedRows; + } // doSave() + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggreagated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; + array of ValidationFailed objects otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + if (($retval = ListCanceledPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * one of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = ListCanceledPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getAppUid(); + break; + case 1: + return $this->getUsrUid(); + break; + case 2: + return $this->getTasUid(); + break; + case 3: + return $this->getProUid(); + break; + case 4: + return $this->getAppNumber(); + break; + case 5: + return $this->getAppTitle(); + break; + case 6: + return $this->getAppProTitle(); + break; + case 7: + return $this->getAppTasTitle(); + break; + case 8: + return $this->getAppCanceledDate(); + break; + case 9: + return $this->getDelIndex(); + break; + case 10: + return $this->getDelPreviousUsrUid(); + break; + case 11: + return $this->getDelCurrentUsrUsername(); + break; + case 12: + return $this->getDelCurrentUsrFirstname(); + break; + case 13: + return $this->getDelCurrentUsrLastname(); + break; + case 14: + return $this->getDelDelegateDate(); + break; + case 15: + return $this->getDelInitDate(); + break; + case 16: + return $this->getDelDueDate(); + break; + case 17: + return $this->getDelPriority(); + break; + default: + return null; + break; + } // switch() + } + + /** + * Exports the object as an array. + * + * You can specify the key type of the array by passing one of the class + * type constants. + * + * @param string $keyType One of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return an associative array containing the field names (as keys) and field values + */ + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = ListCanceledPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getAppUid(), + $keys[1] => $this->getUsrUid(), + $keys[2] => $this->getTasUid(), + $keys[3] => $this->getProUid(), + $keys[4] => $this->getAppNumber(), + $keys[5] => $this->getAppTitle(), + $keys[6] => $this->getAppProTitle(), + $keys[7] => $this->getAppTasTitle(), + $keys[8] => $this->getAppCanceledDate(), + $keys[9] => $this->getDelIndex(), + $keys[10] => $this->getDelPreviousUsrUid(), + $keys[11] => $this->getDelCurrentUsrUsername(), + $keys[12] => $this->getDelCurrentUsrFirstname(), + $keys[13] => $this->getDelCurrentUsrLastname(), + $keys[14] => $this->getDelDelegateDate(), + $keys[15] => $this->getDelInitDate(), + $keys[16] => $this->getDelDueDate(), + $keys[17] => $this->getDelPriority(), + ); + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * one of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = ListCanceledPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setAppUid($value); + break; + case 1: + $this->setUsrUid($value); + break; + case 2: + $this->setTasUid($value); + break; + case 3: + $this->setProUid($value); + break; + case 4: + $this->setAppNumber($value); + break; + case 5: + $this->setAppTitle($value); + break; + case 6: + $this->setAppProTitle($value); + break; + case 7: + $this->setAppTasTitle($value); + break; + case 8: + $this->setAppCanceledDate($value); + break; + case 9: + $this->setDelIndex($value); + break; + case 10: + $this->setDelPreviousUsrUid($value); + break; + case 11: + $this->setDelCurrentUsrUsername($value); + break; + case 12: + $this->setDelCurrentUsrFirstname($value); + break; + case 13: + $this->setDelCurrentUsrLastname($value); + break; + case 14: + $this->setDelDelegateDate($value); + break; + case 15: + $this->setDelInitDate($value); + break; + case 16: + $this->setDelDueDate($value); + break; + case 17: + $this->setDelPriority($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, + * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId') + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = ListCanceledPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) { + $this->setAppUid($arr[$keys[0]]); + } + + if (array_key_exists($keys[1], $arr)) { + $this->setUsrUid($arr[$keys[1]]); + } + + if (array_key_exists($keys[2], $arr)) { + $this->setTasUid($arr[$keys[2]]); + } + + if (array_key_exists($keys[3], $arr)) { + $this->setProUid($arr[$keys[3]]); + } + + if (array_key_exists($keys[4], $arr)) { + $this->setAppNumber($arr[$keys[4]]); + } + + if (array_key_exists($keys[5], $arr)) { + $this->setAppTitle($arr[$keys[5]]); + } + + if (array_key_exists($keys[6], $arr)) { + $this->setAppProTitle($arr[$keys[6]]); + } + + if (array_key_exists($keys[7], $arr)) { + $this->setAppTasTitle($arr[$keys[7]]); + } + + if (array_key_exists($keys[8], $arr)) { + $this->setAppCanceledDate($arr[$keys[8]]); + } + + if (array_key_exists($keys[9], $arr)) { + $this->setDelIndex($arr[$keys[9]]); + } + + if (array_key_exists($keys[10], $arr)) { + $this->setDelPreviousUsrUid($arr[$keys[10]]); + } + + if (array_key_exists($keys[11], $arr)) { + $this->setDelCurrentUsrUsername($arr[$keys[11]]); + } + + if (array_key_exists($keys[12], $arr)) { + $this->setDelCurrentUsrFirstname($arr[$keys[12]]); + } + + if (array_key_exists($keys[13], $arr)) { + $this->setDelCurrentUsrLastname($arr[$keys[13]]); + } + + if (array_key_exists($keys[14], $arr)) { + $this->setDelDelegateDate($arr[$keys[14]]); + } + + if (array_key_exists($keys[15], $arr)) { + $this->setDelInitDate($arr[$keys[15]]); + } + + if (array_key_exists($keys[16], $arr)) { + $this->setDelDueDate($arr[$keys[16]]); + } + + if (array_key_exists($keys[17], $arr)) { + $this->setDelPriority($arr[$keys[17]]); + } + + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(ListCanceledPeer::DATABASE_NAME); + + if ($this->isColumnModified(ListCanceledPeer::APP_UID)) { + $criteria->add(ListCanceledPeer::APP_UID, $this->app_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::USR_UID)) { + $criteria->add(ListCanceledPeer::USR_UID, $this->usr_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::TAS_UID)) { + $criteria->add(ListCanceledPeer::TAS_UID, $this->tas_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::PRO_UID)) { + $criteria->add(ListCanceledPeer::PRO_UID, $this->pro_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_NUMBER)) { + $criteria->add(ListCanceledPeer::APP_NUMBER, $this->app_number); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_TITLE)) { + $criteria->add(ListCanceledPeer::APP_TITLE, $this->app_title); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_PRO_TITLE)) { + $criteria->add(ListCanceledPeer::APP_PRO_TITLE, $this->app_pro_title); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_TAS_TITLE)) { + $criteria->add(ListCanceledPeer::APP_TAS_TITLE, $this->app_tas_title); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_CANCELED_DATE)) { + $criteria->add(ListCanceledPeer::APP_CANCELED_DATE, $this->app_canceled_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) { + $criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_PREVIOUS_USR_UID)) { + $criteria->add(ListCanceledPeer::DEL_PREVIOUS_USR_UID, $this->del_previous_usr_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_CURRENT_USR_USERNAME)) { + $criteria->add(ListCanceledPeer::DEL_CURRENT_USR_USERNAME, $this->del_current_usr_username); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME)) { + $criteria->add(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, $this->del_current_usr_firstname); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME)) { + $criteria->add(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, $this->del_current_usr_lastname); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_DELEGATE_DATE)) { + $criteria->add(ListCanceledPeer::DEL_DELEGATE_DATE, $this->del_delegate_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_INIT_DATE)) { + $criteria->add(ListCanceledPeer::DEL_INIT_DATE, $this->del_init_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_DUE_DATE)) { + $criteria->add(ListCanceledPeer::DEL_DUE_DATE, $this->del_due_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_PRIORITY)) { + $criteria->add(ListCanceledPeer::DEL_PRIORITY, $this->del_priority); + } + + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(ListCanceledPeer::DATABASE_NAME); + + $criteria->add(ListCanceledPeer::APP_UID, $this->app_uid); + + return $criteria; + } + + /** + * Returns the primary key for this object (row). + * @return string + */ + public function getPrimaryKey() + { + return $this->getAppUid(); + } + + /** + * Generic method to set the primary key (app_uid column). + * + * @param string $key Primary key. + * @return void + */ + public function setPrimaryKey($key) + { + $this->setAppUid($key); + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of ListCanceled (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setUsrUid($this->usr_uid); + + $copyObj->setTasUid($this->tas_uid); + + $copyObj->setProUid($this->pro_uid); + + $copyObj->setAppNumber($this->app_number); + + $copyObj->setAppTitle($this->app_title); + + $copyObj->setAppProTitle($this->app_pro_title); + + $copyObj->setAppTasTitle($this->app_tas_title); + + $copyObj->setAppCanceledDate($this->app_canceled_date); + + $copyObj->setDelIndex($this->del_index); + + $copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid); + + $copyObj->setDelCurrentUsrUsername($this->del_current_usr_username); + + $copyObj->setDelCurrentUsrFirstname($this->del_current_usr_firstname); + + $copyObj->setDelCurrentUsrLastname($this->del_current_usr_lastname); + + $copyObj->setDelDelegateDate($this->del_delegate_date); + + $copyObj->setDelInitDate($this->del_init_date); + + $copyObj->setDelDueDate($this->del_due_date); + + $copyObj->setDelPriority($this->del_priority); + + + $copyObj->setNew(true); + + $copyObj->setAppUid(''); // this is a pkey column, so set to default value + + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return ListCanceled Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return ListCanceledPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new ListCanceledPeer(); + } + return self::$peer; + } +} + diff --git a/workflow/engine/classes/model/om/BaseListCanceledPeer.php b/workflow/engine/classes/model/om/BaseListCanceledPeer.php new file mode 100644 index 000000000..0ab6942a9 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListCanceledPeer.php @@ -0,0 +1,652 @@ + array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelIndex', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', ), + BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::USR_UID, ListCanceledPeer::TAS_UID, ListCanceledPeer::PRO_UID, ListCanceledPeer::APP_NUMBER, ListCanceledPeer::APP_TITLE, ListCanceledPeer::APP_PRO_TITLE, ListCanceledPeer::APP_TAS_TITLE, ListCanceledPeer::APP_CANCELED_DATE, ListCanceledPeer::DEL_INDEX, ListCanceledPeer::DEL_PREVIOUS_USR_UID, ListCanceledPeer::DEL_CURRENT_USR_USERNAME, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, ListCanceledPeer::DEL_DELEGATE_DATE, ListCanceledPeer::DEL_INIT_DATE, ListCanceledPeer::DEL_DUE_DATE, ListCanceledPeer::DEL_PRIORITY, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CANCELED_DATE', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) + ); + + /** + * holds an array of keys for quick access to the fieldnames array + * + * first dimension keys are the type constants + * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 + */ + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppCanceledDate' => 8, 'DelIndex' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, ), + BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::USR_UID => 1, ListCanceledPeer::TAS_UID => 2, ListCanceledPeer::PRO_UID => 3, ListCanceledPeer::APP_NUMBER => 4, ListCanceledPeer::APP_TITLE => 5, ListCanceledPeer::APP_PRO_TITLE => 6, ListCanceledPeer::APP_TAS_TITLE => 7, ListCanceledPeer::APP_CANCELED_DATE => 8, ListCanceledPeer::DEL_INDEX => 9, ListCanceledPeer::DEL_PREVIOUS_USR_UID => 10, ListCanceledPeer::DEL_CURRENT_USR_USERNAME => 11, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME => 13, ListCanceledPeer::DEL_DELEGATE_DATE => 14, ListCanceledPeer::DEL_INIT_DATE => 15, ListCanceledPeer::DEL_DUE_DATE => 16, ListCanceledPeer::DEL_PRIORITY => 17, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'APP_CANCELED_DATE' => 8, 'DEL_INDEX' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 17, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) + ); + + /** + * @return MapBuilder the map builder for this peer + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getMapBuilder() + { + include_once 'classes/model/map/ListCanceledMapBuilder.php'; + return BasePeer::getMapBuilder('classes.model.map.ListCanceledMapBuilder'); + } + /** + * Gets a map (hash) of PHP names to DB column names. + * + * @return array The PHP to DB name map for this peer + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this. + */ + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = ListCanceledPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + /** + * Translates a fieldname to another type + * + * @param string $name field name + * @param string $fromType One of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @param string $toType One of the class type constants + * @return string translated name of the field. + */ + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null; + if ($key === null) { + throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + /** + * Returns an array of of field names. + * + * @param string $type The type of fieldnames to return: + * One of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return array A list of field names + */ + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + /** + * Convenience method which changes table.column to alias.column. + * + * Using this method you can maintain SQL abstraction while using column aliases. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. ListCanceledPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(ListCanceledPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + /** + * Add all the columns needed to create a new object. + * + * Note: any columns that were marked with lazyLoad="true" in the + * XML schema will not be added to the select list and only loaded + * on demand. + * + * @param criteria object containing the columns to add. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(ListCanceledPeer::APP_UID); + + $criteria->addSelectColumn(ListCanceledPeer::USR_UID); + + $criteria->addSelectColumn(ListCanceledPeer::TAS_UID); + + $criteria->addSelectColumn(ListCanceledPeer::PRO_UID); + + $criteria->addSelectColumn(ListCanceledPeer::APP_NUMBER); + + $criteria->addSelectColumn(ListCanceledPeer::APP_TITLE); + + $criteria->addSelectColumn(ListCanceledPeer::APP_PRO_TITLE); + + $criteria->addSelectColumn(ListCanceledPeer::APP_TAS_TITLE); + + $criteria->addSelectColumn(ListCanceledPeer::APP_CANCELED_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_PREVIOUS_USR_UID); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_USERNAME); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_DELEGATE_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_INIT_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_DUE_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_PRIORITY); + + } + + const COUNT = 'COUNT(LIST_CANCELED.APP_UID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT LIST_CANCELED.APP_UID)'; + + /** + * Returns the number of rows matching criteria. + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria). + * @param Connection $con + * @return int Number of matching rows. + */ + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // clear out anything that might confuse the ORDER BY clause + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(ListCanceledPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(ListCanceledPeer::COUNT); + } + + // just in case we're grouping: add those columns to the select statement + foreach ($criteria->getGroupByColumns() as $column) { + $criteria->addSelectColumn($column); + } + + $rs = ListCanceledPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + // no rows returned; we infer that means 0 matches. + return 0; + } + } + /** + * Method to select one object from the DB. + * + * @param Criteria $criteria object used to create the SELECT statement. + * @param Connection $con + * @return ListCanceled + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = ListCanceledPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + /** + * Method to do selects. + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param Connection $con + * @return array Array of selected Objects + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelect(Criteria $criteria, $con = null) + { + return ListCanceledPeer::populateObjects(ListCanceledPeer::doSelectRS($criteria, $con)); + } + /** + * Prepares the Criteria object and uses the parent doSelect() + * method to get a ResultSet. + * + * Use this method directly if you want to just get the resultset + * (instead of an array of objects). + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param Connection $con the connection to use + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @return ResultSet The resultset object with numerically-indexed fields. + * @see BasePeer::doSelect() + */ + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + ListCanceledPeer::addSelectColumns($criteria); + } + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + // BasePeer returns a Creole ResultSet, set to return + // rows indexed numerically. + return BasePeer::doSelect($criteria, $con); + } + /** + * The returned array will contain objects of the default type or + * objects that inherit from the default. + * + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + // set the class once to avoid overhead in the loop + $cls = ListCanceledPeer::getOMClass(); + $cls = Propel::import($cls); + // populate the object(s) + while ($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + /** + * Returns the TableMap related to this peer. + * This method is not needed for general use but a specific application could have a need. + * @return TableMap + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + /** + * The class that the Peer will make instances of. + * + * This uses a dot-path notation which is tranalted into a path + * relative to a location on the PHP include_path. + * (e.g. path.to.MyClass -> 'path/to/MyClass.php') + * + * @return string path.to.ClassName + */ + public static function getOMClass() + { + return ListCanceledPeer::CLASS_DEFAULT; + } + + /** + * Method perform an INSERT on the database, given a ListCanceled or Criteria object. + * + * @param mixed $values Criteria or ListCanceled object containing data that is used to create the INSERT statement. + * @param Connection $con the connection to use + * @return mixed The new primary key. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from ListCanceled object + } + + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + try { + // use transaction because $criteria could contain info + // for more than one table (I guess, conceivably) + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + /** + * Method perform an UPDATE on the database, given a ListCanceled or Criteria object. + * + * @param mixed $values Criteria or ListCanceled object containing data create the UPDATE statement. + * @param Connection $con The connection to use (specify Connection exert more control over transactions). + * @return int The number of affected rows (if supported by underlying database driver). + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(ListCanceledPeer::APP_UID); + $selectCriteria->add(ListCanceledPeer::APP_UID, $criteria->remove(ListCanceledPeer::APP_UID), $comparison); + + } else { + $criteria = $values->buildCriteria(); // gets full criteria + $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) + } + + // set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + /** + * Method to DELETE all rows from the LIST_CANCELED table. + * + * @return int The number of affected rows (if supported by underlying database driver). + */ + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; // initialize var to track total num of affected rows + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(ListCanceledPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a ListCanceled or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or ListCanceled object or primary key or array of primary keys + * which is used to create the DELETE statement + * @param Connection $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). + * This includes CASCADE-related rows + * if supported by native driver or if emulated using Propel. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } elseif ($values instanceof ListCanceled) { + + $criteria = $values->buildPkeyCriteria(); + } else { + // it must be the primary key + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(ListCanceledPeer::APP_UID, (array) $values, Criteria::IN); + } + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; // initialize var to track total num of affected rows + + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Validates all modified columns of given ListCanceled object. + * If parameter $columns is either a single column name or an array of column names + * than only those columns are validated. + * + * NOTICE: This does not apply to primary or foreign keys for now. + * + * @param ListCanceled $obj The object to validate. + * @param mixed $cols Column name or array of column names. + * + * @return mixed TRUE if all columns are valid or the error message of the first invalid column. + */ + public static function doValidate(ListCanceled $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(ListCanceledPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(ListCanceledPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach ($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + return BasePeer::doValidate(ListCanceledPeer::DATABASE_NAME, ListCanceledPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param mixed $pk the primary key. + * @param Connection $con the connection to use + * @return ListCanceled + */ + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(ListCanceledPeer::DATABASE_NAME); + + $criteria->add(ListCanceledPeer::APP_UID, $pk); + + + $v = ListCanceledPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + /** + * Retrieve multiple objects by pkey. + * + * @param array $pks List of primary keys + * @param Connection $con the connection to use + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function retrieveByPKs($pks, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(); + $criteria->add(ListCanceledPeer::APP_UID, $pks, Criteria::IN); + $objs = ListCanceledPeer::doSelect($criteria, $con); + } + return $objs; + } +} + + +// static code to register the map builder for this Peer with the main Propel class +if (Propel::isInit()) { + // the MapBuilder classes register themselves with Propel during initialization + // so we need to load them here. + try { + BaseListCanceledPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + // even if Propel is not yet initialized, the map builder class can be registered + // now and then it will be loaded when Propel initializes. + require_once 'classes/model/map/ListCanceledMapBuilder.php'; + Propel::registerMapBuilder('classes.model.map.ListCanceledMapBuilder'); +} + diff --git a/workflow/engine/classes/model/om/BaseListParticipatedLast.php b/workflow/engine/classes/model/om/BaseListParticipatedLast.php index 6b6288169..8ee9a0191 100644 --- a/workflow/engine/classes/model/om/BaseListParticipatedLast.php +++ b/workflow/engine/classes/model/om/BaseListParticipatedLast.php @@ -75,6 +75,12 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent */ protected $app_tas_title = ''; + /** + * The value for the app_status field. + * @var string + */ + protected $app_status = '0'; + /** * The value for the del_index field. * @var int @@ -105,6 +111,24 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent */ protected $del_previous_usr_lastname = ''; + /** + * The value for the del_current_usr_username field. + * @var string + */ + protected $del_current_usr_username = ''; + + /** + * The value for the del_current_usr_firstname field. + * @var string + */ + protected $del_current_usr_firstname = ''; + + /** + * The value for the del_current_usr_lastname field. + * @var string + */ + protected $del_current_usr_lastname = ''; + /** * The value for the del_delegate_date field. * @var int @@ -231,6 +255,17 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent return $this->app_tas_title; } + /** + * Get the [app_status] column value. + * + * @return string + */ + public function getAppStatus() + { + + return $this->app_status; + } + /** * Get the [del_index] column value. * @@ -286,6 +321,39 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent return $this->del_previous_usr_lastname; } + /** + * Get the [del_current_usr_username] column value. + * + * @return string + */ + public function getDelCurrentUsrUsername() + { + + return $this->del_current_usr_username; + } + + /** + * Get the [del_current_usr_firstname] column value. + * + * @return string + */ + public function getDelCurrentUsrFirstname() + { + + return $this->del_current_usr_firstname; + } + + /** + * Get the [del_current_usr_lastname] column value. + * + * @return string + */ + public function getDelCurrentUsrLastname() + { + + return $this->del_current_usr_lastname; + } + /** * Get the [optionally formatted] [del_delegate_date] column value. * @@ -569,6 +637,28 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent } // setAppTasTitle() + /** + * Set the value of [app_status] column. + * + * @param string $v new value + * @return void + */ + public function setAppStatus($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_status !== $v || $v === '0') { + $this->app_status = $v; + $this->modifiedColumns[] = ListParticipatedLastPeer::APP_STATUS; + } + + } // setAppStatus() + /** * Set the value of [del_index] column. * @@ -679,6 +769,72 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent } // setDelPreviousUsrLastname() + /** + * Set the value of [del_current_usr_username] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrUsername($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_username !== $v || $v === '') { + $this->del_current_usr_username = $v; + $this->modifiedColumns[] = ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME; + } + + } // setDelCurrentUsrUsername() + + /** + * Set the value of [del_current_usr_firstname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrFirstname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_firstname !== $v || $v === '') { + $this->del_current_usr_firstname = $v; + $this->modifiedColumns[] = ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME; + } + + } // setDelCurrentUsrFirstname() + + /** + * Set the value of [del_current_usr_lastname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrLastname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_lastname !== $v || $v === '') { + $this->del_current_usr_lastname = $v; + $this->modifiedColumns[] = ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME; + } + + } // setDelCurrentUsrLastname() + /** * Set the value of [del_delegate_date] column. * @@ -821,30 +977,38 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $this->app_tas_title = $rs->getString($startcol + 7); - $this->del_index = $rs->getInt($startcol + 8); + $this->app_status = $rs->getString($startcol + 8); - $this->del_previous_usr_uid = $rs->getString($startcol + 9); + $this->del_index = $rs->getInt($startcol + 9); - $this->del_previous_usr_username = $rs->getString($startcol + 10); + $this->del_previous_usr_uid = $rs->getString($startcol + 10); - $this->del_previous_usr_firstname = $rs->getString($startcol + 11); + $this->del_previous_usr_username = $rs->getString($startcol + 11); - $this->del_previous_usr_lastname = $rs->getString($startcol + 12); + $this->del_previous_usr_firstname = $rs->getString($startcol + 12); - $this->del_delegate_date = $rs->getTimestamp($startcol + 13, null); + $this->del_previous_usr_lastname = $rs->getString($startcol + 13); - $this->del_init_date = $rs->getTimestamp($startcol + 14, null); + $this->del_current_usr_username = $rs->getString($startcol + 14); - $this->del_due_date = $rs->getTimestamp($startcol + 15, null); + $this->del_current_usr_firstname = $rs->getString($startcol + 15); - $this->del_priority = $rs->getString($startcol + 16); + $this->del_current_usr_lastname = $rs->getString($startcol + 16); + + $this->del_delegate_date = $rs->getTimestamp($startcol + 17, null); + + $this->del_init_date = $rs->getTimestamp($startcol + 18, null); + + $this->del_due_date = $rs->getTimestamp($startcol + 19, null); + + $this->del_priority = $rs->getString($startcol + 20); $this->resetModified(); $this->setNew(false); // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 17; // 17 = ListParticipatedLastPeer::NUM_COLUMNS - ListParticipatedLastPeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 21; // 21 = ListParticipatedLastPeer::NUM_COLUMNS - ListParticipatedLastPeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating ListParticipatedLast object", $e); @@ -1073,30 +1237,42 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent return $this->getAppTasTitle(); break; case 8: - return $this->getDelIndex(); + return $this->getAppStatus(); break; case 9: - return $this->getDelPreviousUsrUid(); + return $this->getDelIndex(); break; case 10: - return $this->getDelPreviousUsrUsername(); + return $this->getDelPreviousUsrUid(); break; case 11: - return $this->getDelPreviousUsrFirstname(); + return $this->getDelPreviousUsrUsername(); break; case 12: - return $this->getDelPreviousUsrLastname(); + return $this->getDelPreviousUsrFirstname(); break; case 13: - return $this->getDelDelegateDate(); + return $this->getDelPreviousUsrLastname(); break; case 14: - return $this->getDelInitDate(); + return $this->getDelCurrentUsrUsername(); break; case 15: - return $this->getDelDueDate(); + return $this->getDelCurrentUsrFirstname(); break; case 16: + return $this->getDelCurrentUsrLastname(); + break; + case 17: + return $this->getDelDelegateDate(); + break; + case 18: + return $this->getDelInitDate(); + break; + case 19: + return $this->getDelDueDate(); + break; + case 20: return $this->getDelPriority(); break; default: @@ -1127,15 +1303,19 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $keys[5] => $this->getAppTitle(), $keys[6] => $this->getAppProTitle(), $keys[7] => $this->getAppTasTitle(), - $keys[8] => $this->getDelIndex(), - $keys[9] => $this->getDelPreviousUsrUid(), - $keys[10] => $this->getDelPreviousUsrUsername(), - $keys[11] => $this->getDelPreviousUsrFirstname(), - $keys[12] => $this->getDelPreviousUsrLastname(), - $keys[13] => $this->getDelDelegateDate(), - $keys[14] => $this->getDelInitDate(), - $keys[15] => $this->getDelDueDate(), - $keys[16] => $this->getDelPriority(), + $keys[8] => $this->getAppStatus(), + $keys[9] => $this->getDelIndex(), + $keys[10] => $this->getDelPreviousUsrUid(), + $keys[11] => $this->getDelPreviousUsrUsername(), + $keys[12] => $this->getDelPreviousUsrFirstname(), + $keys[13] => $this->getDelPreviousUsrLastname(), + $keys[14] => $this->getDelCurrentUsrUsername(), + $keys[15] => $this->getDelCurrentUsrFirstname(), + $keys[16] => $this->getDelCurrentUsrLastname(), + $keys[17] => $this->getDelDelegateDate(), + $keys[18] => $this->getDelInitDate(), + $keys[19] => $this->getDelDueDate(), + $keys[20] => $this->getDelPriority(), ); return $result; } @@ -1192,30 +1372,42 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $this->setAppTasTitle($value); break; case 8: - $this->setDelIndex($value); + $this->setAppStatus($value); break; case 9: - $this->setDelPreviousUsrUid($value); + $this->setDelIndex($value); break; case 10: - $this->setDelPreviousUsrUsername($value); + $this->setDelPreviousUsrUid($value); break; case 11: - $this->setDelPreviousUsrFirstname($value); + $this->setDelPreviousUsrUsername($value); break; case 12: - $this->setDelPreviousUsrLastname($value); + $this->setDelPreviousUsrFirstname($value); break; case 13: - $this->setDelDelegateDate($value); + $this->setDelPreviousUsrLastname($value); break; case 14: - $this->setDelInitDate($value); + $this->setDelCurrentUsrUsername($value); break; case 15: - $this->setDelDueDate($value); + $this->setDelCurrentUsrFirstname($value); break; case 16: + $this->setDelCurrentUsrLastname($value); + break; + case 17: + $this->setDelDelegateDate($value); + break; + case 18: + $this->setDelInitDate($value); + break; + case 19: + $this->setDelDueDate($value); + break; + case 20: $this->setDelPriority($value); break; } // switch() @@ -1274,39 +1466,55 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent } if (array_key_exists($keys[8], $arr)) { - $this->setDelIndex($arr[$keys[8]]); + $this->setAppStatus($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { - $this->setDelPreviousUsrUid($arr[$keys[9]]); + $this->setDelIndex($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { - $this->setDelPreviousUsrUsername($arr[$keys[10]]); + $this->setDelPreviousUsrUid($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { - $this->setDelPreviousUsrFirstname($arr[$keys[11]]); + $this->setDelPreviousUsrUsername($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { - $this->setDelPreviousUsrLastname($arr[$keys[12]]); + $this->setDelPreviousUsrFirstname($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { - $this->setDelDelegateDate($arr[$keys[13]]); + $this->setDelPreviousUsrLastname($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { - $this->setDelInitDate($arr[$keys[14]]); + $this->setDelCurrentUsrUsername($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { - $this->setDelDueDate($arr[$keys[15]]); + $this->setDelCurrentUsrFirstname($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { - $this->setDelPriority($arr[$keys[16]]); + $this->setDelCurrentUsrLastname($arr[$keys[16]]); + } + + if (array_key_exists($keys[17], $arr)) { + $this->setDelDelegateDate($arr[$keys[17]]); + } + + if (array_key_exists($keys[18], $arr)) { + $this->setDelInitDate($arr[$keys[18]]); + } + + if (array_key_exists($keys[19], $arr)) { + $this->setDelDueDate($arr[$keys[19]]); + } + + if (array_key_exists($keys[20], $arr)) { + $this->setDelPriority($arr[$keys[20]]); } } @@ -1352,6 +1560,10 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $criteria->add(ListParticipatedLastPeer::APP_TAS_TITLE, $this->app_tas_title); } + if ($this->isColumnModified(ListParticipatedLastPeer::APP_STATUS)) { + $criteria->add(ListParticipatedLastPeer::APP_STATUS, $this->app_status); + } + if ($this->isColumnModified(ListParticipatedLastPeer::DEL_INDEX)) { $criteria->add(ListParticipatedLastPeer::DEL_INDEX, $this->del_index); } @@ -1372,6 +1584,18 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $criteria->add(ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME, $this->del_previous_usr_lastname); } + if ($this->isColumnModified(ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME)) { + $criteria->add(ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME, $this->del_current_usr_username); + } + + if ($this->isColumnModified(ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME)) { + $criteria->add(ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME, $this->del_current_usr_firstname); + } + + if ($this->isColumnModified(ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME)) { + $criteria->add(ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME, $this->del_current_usr_lastname); + } + if ($this->isColumnModified(ListParticipatedLastPeer::DEL_DELEGATE_DATE)) { $criteria->add(ListParticipatedLastPeer::DEL_DELEGATE_DATE, $this->del_delegate_date); } @@ -1466,6 +1690,8 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $copyObj->setAppTasTitle($this->app_tas_title); + $copyObj->setAppStatus($this->app_status); + $copyObj->setDelIndex($this->del_index); $copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid); @@ -1476,6 +1702,12 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent $copyObj->setDelPreviousUsrLastname($this->del_previous_usr_lastname); + $copyObj->setDelCurrentUsrUsername($this->del_current_usr_username); + + $copyObj->setDelCurrentUsrFirstname($this->del_current_usr_firstname); + + $copyObj->setDelCurrentUsrLastname($this->del_current_usr_lastname); + $copyObj->setDelDelegateDate($this->del_delegate_date); $copyObj->setDelInitDate($this->del_init_date); diff --git a/workflow/engine/classes/model/om/BaseListParticipatedLastPeer.php b/workflow/engine/classes/model/om/BaseListParticipatedLastPeer.php index cd9362886..b79a16061 100644 --- a/workflow/engine/classes/model/om/BaseListParticipatedLastPeer.php +++ b/workflow/engine/classes/model/om/BaseListParticipatedLastPeer.php @@ -25,7 +25,7 @@ abstract class BaseListParticipatedLastPeer const CLASS_DEFAULT = 'classes.model.ListParticipatedLast'; /** The total number of columns. */ - const NUM_COLUMNS = 17; + const NUM_COLUMNS = 21; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -55,6 +55,9 @@ abstract class BaseListParticipatedLastPeer /** the column name for the APP_TAS_TITLE field */ const APP_TAS_TITLE = 'LIST_PARTICIPATED_LAST.APP_TAS_TITLE'; + /** the column name for the APP_STATUS field */ + const APP_STATUS = 'LIST_PARTICIPATED_LAST.APP_STATUS'; + /** the column name for the DEL_INDEX field */ const DEL_INDEX = 'LIST_PARTICIPATED_LAST.DEL_INDEX'; @@ -70,6 +73,15 @@ abstract class BaseListParticipatedLastPeer /** the column name for the DEL_PREVIOUS_USR_LASTNAME field */ const DEL_PREVIOUS_USR_LASTNAME = 'LIST_PARTICIPATED_LAST.DEL_PREVIOUS_USR_LASTNAME'; + /** the column name for the DEL_CURRENT_USR_USERNAME field */ + const DEL_CURRENT_USR_USERNAME = 'LIST_PARTICIPATED_LAST.DEL_CURRENT_USR_USERNAME'; + + /** the column name for the DEL_CURRENT_USR_FIRSTNAME field */ + const DEL_CURRENT_USR_FIRSTNAME = 'LIST_PARTICIPATED_LAST.DEL_CURRENT_USR_FIRSTNAME'; + + /** the column name for the DEL_CURRENT_USR_LASTNAME field */ + const DEL_CURRENT_USR_LASTNAME = 'LIST_PARTICIPATED_LAST.DEL_CURRENT_USR_LASTNAME'; + /** the column name for the DEL_DELEGATE_DATE field */ const DEL_DELEGATE_DATE = 'LIST_PARTICIPATED_LAST.DEL_DELEGATE_DATE'; @@ -93,10 +105,10 @@ abstract class BaseListParticipatedLastPeer * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'DelIndex', 'DelPreviousUsrUid', 'DelPreviousUsrUsername', 'DelPreviousUsrFirstname', 'DelPreviousUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', ), - BasePeer::TYPE_COLNAME => array (ListParticipatedLastPeer::APP_UID, ListParticipatedLastPeer::USR_UID, ListParticipatedLastPeer::TAS_UID, ListParticipatedLastPeer::PRO_UID, ListParticipatedLastPeer::APP_NUMBER, ListParticipatedLastPeer::APP_TITLE, ListParticipatedLastPeer::APP_PRO_TITLE, ListParticipatedLastPeer::APP_TAS_TITLE, ListParticipatedLastPeer::DEL_INDEX, ListParticipatedLastPeer::DEL_PREVIOUS_USR_UID, ListParticipatedLastPeer::DEL_PREVIOUS_USR_USERNAME, ListParticipatedLastPeer::DEL_PREVIOUS_USR_FIRSTNAME, ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME, ListParticipatedLastPeer::DEL_DELEGATE_DATE, ListParticipatedLastPeer::DEL_INIT_DATE, ListParticipatedLastPeer::DEL_DUE_DATE, ListParticipatedLastPeer::DEL_PRIORITY, ), - BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_PREVIOUS_USR_USERNAME', 'DEL_PREVIOUS_USR_FIRSTNAME', 'DEL_PREVIOUS_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ) + BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppStatus', 'DelIndex', 'DelPreviousUsrUid', 'DelPreviousUsrUsername', 'DelPreviousUsrFirstname', 'DelPreviousUsrLastname', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', ), + BasePeer::TYPE_COLNAME => array (ListParticipatedLastPeer::APP_UID, ListParticipatedLastPeer::USR_UID, ListParticipatedLastPeer::TAS_UID, ListParticipatedLastPeer::PRO_UID, ListParticipatedLastPeer::APP_NUMBER, ListParticipatedLastPeer::APP_TITLE, ListParticipatedLastPeer::APP_PRO_TITLE, ListParticipatedLastPeer::APP_TAS_TITLE, ListParticipatedLastPeer::APP_STATUS, ListParticipatedLastPeer::DEL_INDEX, ListParticipatedLastPeer::DEL_PREVIOUS_USR_UID, ListParticipatedLastPeer::DEL_PREVIOUS_USR_USERNAME, ListParticipatedLastPeer::DEL_PREVIOUS_USR_FIRSTNAME, ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME, ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME, ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME, ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME, ListParticipatedLastPeer::DEL_DELEGATE_DATE, ListParticipatedLastPeer::DEL_INIT_DATE, ListParticipatedLastPeer::DEL_DUE_DATE, ListParticipatedLastPeer::DEL_PRIORITY, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_STATUS', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_PREVIOUS_USR_USERNAME', 'DEL_PREVIOUS_USR_FIRSTNAME', 'DEL_PREVIOUS_USR_LASTNAME', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ), + 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, ) ); /** @@ -106,10 +118,10 @@ abstract class BaseListParticipatedLastPeer * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'DelIndex' => 8, 'DelPreviousUsrUid' => 9, 'DelPreviousUsrUsername' => 10, 'DelPreviousUsrFirstname' => 11, 'DelPreviousUsrLastname' => 12, 'DelDelegateDate' => 13, 'DelInitDate' => 14, 'DelDueDate' => 15, 'DelPriority' => 16, ), - BasePeer::TYPE_COLNAME => array (ListParticipatedLastPeer::APP_UID => 0, ListParticipatedLastPeer::USR_UID => 1, ListParticipatedLastPeer::TAS_UID => 2, ListParticipatedLastPeer::PRO_UID => 3, ListParticipatedLastPeer::APP_NUMBER => 4, ListParticipatedLastPeer::APP_TITLE => 5, ListParticipatedLastPeer::APP_PRO_TITLE => 6, ListParticipatedLastPeer::APP_TAS_TITLE => 7, ListParticipatedLastPeer::DEL_INDEX => 8, ListParticipatedLastPeer::DEL_PREVIOUS_USR_UID => 9, ListParticipatedLastPeer::DEL_PREVIOUS_USR_USERNAME => 10, ListParticipatedLastPeer::DEL_PREVIOUS_USR_FIRSTNAME => 11, ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME => 12, ListParticipatedLastPeer::DEL_DELEGATE_DATE => 13, ListParticipatedLastPeer::DEL_INIT_DATE => 14, ListParticipatedLastPeer::DEL_DUE_DATE => 15, ListParticipatedLastPeer::DEL_PRIORITY => 16, ), - BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'DEL_INDEX' => 8, 'DEL_PREVIOUS_USR_UID' => 9, 'DEL_PREVIOUS_USR_USERNAME' => 10, 'DEL_PREVIOUS_USR_FIRSTNAME' => 11, 'DEL_PREVIOUS_USR_LASTNAME' => 12, 'DEL_DELEGATE_DATE' => 13, 'DEL_INIT_DATE' => 14, 'DEL_DUE_DATE' => 15, 'DEL_PRIORITY' => 16, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ) + BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppStatus' => 8, 'DelIndex' => 9, 'DelPreviousUsrUid' => 10, 'DelPreviousUsrUsername' => 11, 'DelPreviousUsrFirstname' => 12, 'DelPreviousUsrLastname' => 13, 'DelCurrentUsrUsername' => 14, 'DelCurrentUsrFirstname' => 15, 'DelCurrentUsrLastname' => 16, 'DelDelegateDate' => 17, 'DelInitDate' => 18, 'DelDueDate' => 19, 'DelPriority' => 20, ), + BasePeer::TYPE_COLNAME => array (ListParticipatedLastPeer::APP_UID => 0, ListParticipatedLastPeer::USR_UID => 1, ListParticipatedLastPeer::TAS_UID => 2, ListParticipatedLastPeer::PRO_UID => 3, ListParticipatedLastPeer::APP_NUMBER => 4, ListParticipatedLastPeer::APP_TITLE => 5, ListParticipatedLastPeer::APP_PRO_TITLE => 6, ListParticipatedLastPeer::APP_TAS_TITLE => 7, ListParticipatedLastPeer::APP_STATUS => 8, ListParticipatedLastPeer::DEL_INDEX => 9, ListParticipatedLastPeer::DEL_PREVIOUS_USR_UID => 10, ListParticipatedLastPeer::DEL_PREVIOUS_USR_USERNAME => 11, ListParticipatedLastPeer::DEL_PREVIOUS_USR_FIRSTNAME => 12, ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME => 13, ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME => 14, ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME => 15, ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME => 16, ListParticipatedLastPeer::DEL_DELEGATE_DATE => 17, ListParticipatedLastPeer::DEL_INIT_DATE => 18, ListParticipatedLastPeer::DEL_DUE_DATE => 19, ListParticipatedLastPeer::DEL_PRIORITY => 20, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'APP_STATUS' => 8, 'DEL_INDEX' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_PREVIOUS_USR_USERNAME' => 11, 'DEL_PREVIOUS_USR_FIRSTNAME' => 12, 'DEL_PREVIOUS_USR_LASTNAME' => 13, 'DEL_CURRENT_USR_USERNAME' => 14, 'DEL_CURRENT_USR_FIRSTNAME' => 15, 'DEL_CURRENT_USR_LASTNAME' => 16, 'DEL_DELEGATE_DATE' => 17, 'DEL_INIT_DATE' => 18, 'DEL_DUE_DATE' => 19, 'DEL_PRIORITY' => 20, ), + 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, ) ); /** @@ -226,6 +238,8 @@ abstract class BaseListParticipatedLastPeer $criteria->addSelectColumn(ListParticipatedLastPeer::APP_TAS_TITLE); + $criteria->addSelectColumn(ListParticipatedLastPeer::APP_STATUS); + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PREVIOUS_USR_UID); @@ -236,6 +250,12 @@ abstract class BaseListParticipatedLastPeer $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_PREVIOUS_USR_LASTNAME); + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_CURRENT_USR_USERNAME); + + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME); + + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME); + $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_DELEGATE_DATE); $criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INIT_DATE); diff --git a/workflow/engine/classes/model/om/BaseListPaused.php b/workflow/engine/classes/model/om/BaseListPaused.php new file mode 100644 index 000000000..9233bc9f9 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListPaused.php @@ -0,0 +1,1880 @@ +app_uid; + } + + /** + * Get the [del_index] column value. + * + * @return int + */ + public function getDelIndex() + { + + return $this->del_index; + } + + /** + * Get the [usr_uid] column value. + * + * @return string + */ + public function getUsrUid() + { + + return $this->usr_uid; + } + + /** + * Get the [tas_uid] column value. + * + * @return string + */ + public function getTasUid() + { + + return $this->tas_uid; + } + + /** + * Get the [pro_uid] column value. + * + * @return string + */ + public function getProUid() + { + + return $this->pro_uid; + } + + /** + * Get the [app_number] column value. + * + * @return int + */ + public function getAppNumber() + { + + return $this->app_number; + } + + /** + * Get the [app_title] column value. + * + * @return string + */ + public function getAppTitle() + { + + return $this->app_title; + } + + /** + * Get the [app_pro_title] column value. + * + * @return string + */ + public function getAppProTitle() + { + + return $this->app_pro_title; + } + + /** + * Get the [app_tas_title] column value. + * + * @return string + */ + public function getAppTasTitle() + { + + return $this->app_tas_title; + } + + /** + * Get the [optionally formatted] [app_paused_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getAppPausedDate($format = 'Y-m-d H:i:s') + { + + if ($this->app_paused_date === null || $this->app_paused_date === '') { + return null; + } elseif (!is_int($this->app_paused_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->app_paused_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [app_paused_date] as date/time value: " . + var_export($this->app_paused_date, true)); + } + } else { + $ts = $this->app_paused_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [app_restart_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getAppRestartDate($format = 'Y-m-d H:i:s') + { + + if ($this->app_restart_date === null || $this->app_restart_date === '') { + return null; + } elseif (!is_int($this->app_restart_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->app_restart_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [app_restart_date] as date/time value: " . + var_export($this->app_restart_date, true)); + } + } else { + $ts = $this->app_restart_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_previous_usr_uid] column value. + * + * @return string + */ + public function getDelPreviousUsrUid() + { + + return $this->del_previous_usr_uid; + } + + /** + * Get the [del_previous_usr_username] column value. + * + * @return string + */ + public function getDelPreviousUsrUsername() + { + + return $this->del_previous_usr_username; + } + + /** + * Get the [del_previous_usr_firstname] column value. + * + * @return string + */ + public function getDelPreviousUsrFirstname() + { + + return $this->del_previous_usr_firstname; + } + + /** + * Get the [del_previous_usr_lastname] column value. + * + * @return string + */ + public function getDelPreviousUsrLastname() + { + + return $this->del_previous_usr_lastname; + } + + /** + * Get the [del_current_usr_username] column value. + * + * @return string + */ + public function getDelCurrentUsrUsername() + { + + return $this->del_current_usr_username; + } + + /** + * Get the [del_current_usr_firstname] column value. + * + * @return string + */ + public function getDelCurrentUsrFirstname() + { + + return $this->del_current_usr_firstname; + } + + /** + * Get the [del_current_usr_lastname] column value. + * + * @return string + */ + public function getDelCurrentUsrLastname() + { + + return $this->del_current_usr_lastname; + } + + /** + * Get the [optionally formatted] [del_delegate_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDelegateDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_delegate_date === null || $this->del_delegate_date === '') { + return null; + } elseif (!is_int($this->del_delegate_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_delegate_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " . + var_export($this->del_delegate_date, true)); + } + } else { + $ts = $this->del_delegate_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_init_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelInitDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_init_date === null || $this->del_init_date === '') { + return null; + } elseif (!is_int($this->del_init_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_init_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " . + var_export($this->del_init_date, true)); + } + } else { + $ts = $this->del_init_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_due_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDueDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_due_date === null || $this->del_due_date === '') { + return null; + } elseif (!is_int($this->del_due_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_due_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_due_date] as date/time value: " . + var_export($this->del_due_date, true)); + } + } else { + $ts = $this->del_due_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_priority] column value. + * + * @return string + */ + public function getDelPriority() + { + + return $this->del_priority; + } + + /** + * Set the value of [app_uid] column. + * + * @param string $v new value + * @return void + */ + public function setAppUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_uid !== $v || $v === '') { + $this->app_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_UID; + } + + } // setAppUid() + + /** + * Set the value of [del_index] column. + * + * @param int $v new value + * @return void + */ + public function setDelIndex($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->del_index !== $v || $v === 0) { + $this->del_index = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_INDEX; + } + + } // setDelIndex() + + /** + * Set the value of [usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->usr_uid !== $v || $v === '') { + $this->usr_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::USR_UID; + } + + } // setUsrUid() + + /** + * Set the value of [tas_uid] column. + * + * @param string $v new value + * @return void + */ + public function setTasUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->tas_uid !== $v || $v === '') { + $this->tas_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::TAS_UID; + } + + } // setTasUid() + + /** + * Set the value of [pro_uid] column. + * + * @param string $v new value + * @return void + */ + public function setProUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->pro_uid !== $v || $v === '') { + $this->pro_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::PRO_UID; + } + + } // setProUid() + + /** + * Set the value of [app_number] column. + * + * @param int $v new value + * @return void + */ + public function setAppNumber($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->app_number !== $v || $v === 0) { + $this->app_number = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_NUMBER; + } + + } // setAppNumber() + + /** + * Set the value of [app_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_title !== $v || $v === '') { + $this->app_title = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_TITLE; + } + + } // setAppTitle() + + /** + * Set the value of [app_pro_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppProTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_pro_title !== $v || $v === '') { + $this->app_pro_title = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_PRO_TITLE; + } + + } // setAppProTitle() + + /** + * Set the value of [app_tas_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTasTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_tas_title !== $v || $v === '') { + $this->app_tas_title = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_TAS_TITLE; + } + + } // setAppTasTitle() + + /** + * Set the value of [app_paused_date] column. + * + * @param int $v new value + * @return void + */ + public function setAppPausedDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [app_paused_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->app_paused_date !== $ts) { + $this->app_paused_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::APP_PAUSED_DATE; + } + + } // setAppPausedDate() + + /** + * Set the value of [app_restart_date] column. + * + * @param int $v new value + * @return void + */ + public function setAppRestartDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [app_restart_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->app_restart_date !== $ts) { + $this->app_restart_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::APP_RESTART_DATE; + } + + } // setAppRestartDate() + + /** + * Set the value of [del_previous_usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setDelPreviousUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_previous_usr_uid !== $v || $v === '') { + $this->del_previous_usr_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_PREVIOUS_USR_UID; + } + + } // setDelPreviousUsrUid() + + /** + * Set the value of [del_previous_usr_username] column. + * + * @param string $v new value + * @return void + */ + public function setDelPreviousUsrUsername($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_previous_usr_username !== $v || $v === '') { + $this->del_previous_usr_username = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_PREVIOUS_USR_USERNAME; + } + + } // setDelPreviousUsrUsername() + + /** + * Set the value of [del_previous_usr_firstname] column. + * + * @param string $v new value + * @return void + */ + public function setDelPreviousUsrFirstname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_previous_usr_firstname !== $v || $v === '') { + $this->del_previous_usr_firstname = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME; + } + + } // setDelPreviousUsrFirstname() + + /** + * Set the value of [del_previous_usr_lastname] column. + * + * @param string $v new value + * @return void + */ + public function setDelPreviousUsrLastname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_previous_usr_lastname !== $v || $v === '') { + $this->del_previous_usr_lastname = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME; + } + + } // setDelPreviousUsrLastname() + + /** + * Set the value of [del_current_usr_username] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrUsername($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_username !== $v || $v === '') { + $this->del_current_usr_username = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_CURRENT_USR_USERNAME; + } + + } // setDelCurrentUsrUsername() + + /** + * Set the value of [del_current_usr_firstname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrFirstname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_firstname !== $v || $v === '') { + $this->del_current_usr_firstname = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME; + } + + } // setDelCurrentUsrFirstname() + + /** + * Set the value of [del_current_usr_lastname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrLastname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_lastname !== $v || $v === '') { + $this->del_current_usr_lastname = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_CURRENT_USR_LASTNAME; + } + + } // setDelCurrentUsrLastname() + + /** + * Set the value of [del_delegate_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDelegateDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_delegate_date !== $ts) { + $this->del_delegate_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::DEL_DELEGATE_DATE; + } + + } // setDelDelegateDate() + + /** + * Set the value of [del_init_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelInitDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_init_date !== $ts) { + $this->del_init_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::DEL_INIT_DATE; + } + + } // setDelInitDate() + + /** + * Set the value of [del_due_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDueDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_due_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_due_date !== $ts) { + $this->del_due_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::DEL_DUE_DATE; + } + + } // setDelDueDate() + + /** + * Set the value of [del_priority] column. + * + * @param string $v new value + * @return void + */ + public function setDelPriority($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_priority !== $v || $v === '3') { + $this->del_priority = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_PRIORITY; + } + + } // setDelPriority() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (1-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos. + * @param int $startcol 1-based offset column which indicates which restultset column to start with. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->app_uid = $rs->getString($startcol + 0); + + $this->del_index = $rs->getInt($startcol + 1); + + $this->usr_uid = $rs->getString($startcol + 2); + + $this->tas_uid = $rs->getString($startcol + 3); + + $this->pro_uid = $rs->getString($startcol + 4); + + $this->app_number = $rs->getInt($startcol + 5); + + $this->app_title = $rs->getString($startcol + 6); + + $this->app_pro_title = $rs->getString($startcol + 7); + + $this->app_tas_title = $rs->getString($startcol + 8); + + $this->app_paused_date = $rs->getTimestamp($startcol + 9, null); + + $this->app_restart_date = $rs->getTimestamp($startcol + 10, null); + + $this->del_previous_usr_uid = $rs->getString($startcol + 11); + + $this->del_previous_usr_username = $rs->getString($startcol + 12); + + $this->del_previous_usr_firstname = $rs->getString($startcol + 13); + + $this->del_previous_usr_lastname = $rs->getString($startcol + 14); + + $this->del_current_usr_username = $rs->getString($startcol + 15); + + $this->del_current_usr_firstname = $rs->getString($startcol + 16); + + $this->del_current_usr_lastname = $rs->getString($startcol + 17); + + $this->del_delegate_date = $rs->getTimestamp($startcol + 18, null); + + $this->del_init_date = $rs->getTimestamp($startcol + 19, null); + + $this->del_due_date = $rs->getTimestamp($startcol + 20, null); + + $this->del_priority = $rs->getString($startcol + 21); + + $this->resetModified(); + + $this->setNew(false); + + // FIXME - using NUM_COLUMNS may be clearer. + return $startcol + 22; // 22 = ListPausedPeer::NUM_COLUMNS - ListPausedPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating ListPaused object", $e); + } + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param Connection $con + * @return void + * @throws PropelException + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(ListPausedPeer::DATABASE_NAME); + } + + try { + $con->begin(); + ListPausedPeer::doDelete($this, $con); + $this->setDeleted(true); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Stores the object in the database. If the object is new, + * it inserts it; otherwise an update is performed. This method + * wraps the doSave() worker method in a transaction. + * + * @param Connection $con + * @return int The number of rows affected by this insert/update + * @throws PropelException + * @see doSave() + */ + public function save($con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(ListPausedPeer::DATABASE_NAME); + } + + try { + $con->begin(); + $affectedRows = $this->doSave($con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Stores the object in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param Connection $con + * @return int The number of rows affected by this insert/update and any referring + * @throws PropelException + * @see save() + */ + protected function doSave($con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + + // If this object has been modified, then save it to the database. + if ($this->isModified()) { + if ($this->isNew()) { + $pk = ListPausedPeer::doInsert($this, $con); + $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which + // should always be true here (even though technically + // BasePeer::doInsert() can insert multiple rows). + + $this->setNew(false); + } else { + $affectedRows += ListPausedPeer::doUpdate($this, $con); + } + $this->resetModified(); // [HL] After being saved an object is no longer 'modified' + } + + $this->alreadyInSave = false; + } + return $affectedRows; + } // doSave() + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggreagated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; + array of ValidationFailed objects otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + if (($retval = ListPausedPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * one of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = ListPausedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getAppUid(); + break; + case 1: + return $this->getDelIndex(); + break; + case 2: + return $this->getUsrUid(); + break; + case 3: + return $this->getTasUid(); + break; + case 4: + return $this->getProUid(); + break; + case 5: + return $this->getAppNumber(); + break; + case 6: + return $this->getAppTitle(); + break; + case 7: + return $this->getAppProTitle(); + break; + case 8: + return $this->getAppTasTitle(); + break; + case 9: + return $this->getAppPausedDate(); + break; + case 10: + return $this->getAppRestartDate(); + break; + case 11: + return $this->getDelPreviousUsrUid(); + break; + case 12: + return $this->getDelPreviousUsrUsername(); + break; + case 13: + return $this->getDelPreviousUsrFirstname(); + break; + case 14: + return $this->getDelPreviousUsrLastname(); + break; + case 15: + return $this->getDelCurrentUsrUsername(); + break; + case 16: + return $this->getDelCurrentUsrFirstname(); + break; + case 17: + return $this->getDelCurrentUsrLastname(); + break; + case 18: + return $this->getDelDelegateDate(); + break; + case 19: + return $this->getDelInitDate(); + break; + case 20: + return $this->getDelDueDate(); + break; + case 21: + return $this->getDelPriority(); + break; + default: + return null; + break; + } // switch() + } + + /** + * Exports the object as an array. + * + * You can specify the key type of the array by passing one of the class + * type constants. + * + * @param string $keyType One of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return an associative array containing the field names (as keys) and field values + */ + public function toArray($keyType = BasePeer::TYPE_PHPNAME) + { + $keys = ListPausedPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getAppUid(), + $keys[1] => $this->getDelIndex(), + $keys[2] => $this->getUsrUid(), + $keys[3] => $this->getTasUid(), + $keys[4] => $this->getProUid(), + $keys[5] => $this->getAppNumber(), + $keys[6] => $this->getAppTitle(), + $keys[7] => $this->getAppProTitle(), + $keys[8] => $this->getAppTasTitle(), + $keys[9] => $this->getAppPausedDate(), + $keys[10] => $this->getAppRestartDate(), + $keys[11] => $this->getDelPreviousUsrUid(), + $keys[12] => $this->getDelPreviousUsrUsername(), + $keys[13] => $this->getDelPreviousUsrFirstname(), + $keys[14] => $this->getDelPreviousUsrLastname(), + $keys[15] => $this->getDelCurrentUsrUsername(), + $keys[16] => $this->getDelCurrentUsrFirstname(), + $keys[17] => $this->getDelCurrentUsrLastname(), + $keys[18] => $this->getDelDelegateDate(), + $keys[19] => $this->getDelInitDate(), + $keys[20] => $this->getDelDueDate(), + $keys[21] => $this->getDelPriority(), + ); + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * one of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = ListPausedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setAppUid($value); + break; + case 1: + $this->setDelIndex($value); + break; + case 2: + $this->setUsrUid($value); + break; + case 3: + $this->setTasUid($value); + break; + case 4: + $this->setProUid($value); + break; + case 5: + $this->setAppNumber($value); + break; + case 6: + $this->setAppTitle($value); + break; + case 7: + $this->setAppProTitle($value); + break; + case 8: + $this->setAppTasTitle($value); + break; + case 9: + $this->setAppPausedDate($value); + break; + case 10: + $this->setAppRestartDate($value); + break; + case 11: + $this->setDelPreviousUsrUid($value); + break; + case 12: + $this->setDelPreviousUsrUsername($value); + break; + case 13: + $this->setDelPreviousUsrFirstname($value); + break; + case 14: + $this->setDelPreviousUsrLastname($value); + break; + case 15: + $this->setDelCurrentUsrUsername($value); + break; + case 16: + $this->setDelCurrentUsrFirstname($value); + break; + case 17: + $this->setDelCurrentUsrLastname($value); + break; + case 18: + $this->setDelDelegateDate($value); + break; + case 19: + $this->setDelInitDate($value); + break; + case 20: + $this->setDelDueDate($value); + break; + case 21: + $this->setDelPriority($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, + * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId') + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = ListPausedPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) { + $this->setAppUid($arr[$keys[0]]); + } + + if (array_key_exists($keys[1], $arr)) { + $this->setDelIndex($arr[$keys[1]]); + } + + if (array_key_exists($keys[2], $arr)) { + $this->setUsrUid($arr[$keys[2]]); + } + + if (array_key_exists($keys[3], $arr)) { + $this->setTasUid($arr[$keys[3]]); + } + + if (array_key_exists($keys[4], $arr)) { + $this->setProUid($arr[$keys[4]]); + } + + if (array_key_exists($keys[5], $arr)) { + $this->setAppNumber($arr[$keys[5]]); + } + + if (array_key_exists($keys[6], $arr)) { + $this->setAppTitle($arr[$keys[6]]); + } + + if (array_key_exists($keys[7], $arr)) { + $this->setAppProTitle($arr[$keys[7]]); + } + + if (array_key_exists($keys[8], $arr)) { + $this->setAppTasTitle($arr[$keys[8]]); + } + + if (array_key_exists($keys[9], $arr)) { + $this->setAppPausedDate($arr[$keys[9]]); + } + + if (array_key_exists($keys[10], $arr)) { + $this->setAppRestartDate($arr[$keys[10]]); + } + + if (array_key_exists($keys[11], $arr)) { + $this->setDelPreviousUsrUid($arr[$keys[11]]); + } + + if (array_key_exists($keys[12], $arr)) { + $this->setDelPreviousUsrUsername($arr[$keys[12]]); + } + + if (array_key_exists($keys[13], $arr)) { + $this->setDelPreviousUsrFirstname($arr[$keys[13]]); + } + + if (array_key_exists($keys[14], $arr)) { + $this->setDelPreviousUsrLastname($arr[$keys[14]]); + } + + if (array_key_exists($keys[15], $arr)) { + $this->setDelCurrentUsrUsername($arr[$keys[15]]); + } + + if (array_key_exists($keys[16], $arr)) { + $this->setDelCurrentUsrFirstname($arr[$keys[16]]); + } + + if (array_key_exists($keys[17], $arr)) { + $this->setDelCurrentUsrLastname($arr[$keys[17]]); + } + + if (array_key_exists($keys[18], $arr)) { + $this->setDelDelegateDate($arr[$keys[18]]); + } + + if (array_key_exists($keys[19], $arr)) { + $this->setDelInitDate($arr[$keys[19]]); + } + + if (array_key_exists($keys[20], $arr)) { + $this->setDelDueDate($arr[$keys[20]]); + } + + if (array_key_exists($keys[21], $arr)) { + $this->setDelPriority($arr[$keys[21]]); + } + + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(ListPausedPeer::DATABASE_NAME); + + if ($this->isColumnModified(ListPausedPeer::APP_UID)) { + $criteria->add(ListPausedPeer::APP_UID, $this->app_uid); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_INDEX)) { + $criteria->add(ListPausedPeer::DEL_INDEX, $this->del_index); + } + + if ($this->isColumnModified(ListPausedPeer::USR_UID)) { + $criteria->add(ListPausedPeer::USR_UID, $this->usr_uid); + } + + if ($this->isColumnModified(ListPausedPeer::TAS_UID)) { + $criteria->add(ListPausedPeer::TAS_UID, $this->tas_uid); + } + + if ($this->isColumnModified(ListPausedPeer::PRO_UID)) { + $criteria->add(ListPausedPeer::PRO_UID, $this->pro_uid); + } + + if ($this->isColumnModified(ListPausedPeer::APP_NUMBER)) { + $criteria->add(ListPausedPeer::APP_NUMBER, $this->app_number); + } + + if ($this->isColumnModified(ListPausedPeer::APP_TITLE)) { + $criteria->add(ListPausedPeer::APP_TITLE, $this->app_title); + } + + if ($this->isColumnModified(ListPausedPeer::APP_PRO_TITLE)) { + $criteria->add(ListPausedPeer::APP_PRO_TITLE, $this->app_pro_title); + } + + if ($this->isColumnModified(ListPausedPeer::APP_TAS_TITLE)) { + $criteria->add(ListPausedPeer::APP_TAS_TITLE, $this->app_tas_title); + } + + if ($this->isColumnModified(ListPausedPeer::APP_PAUSED_DATE)) { + $criteria->add(ListPausedPeer::APP_PAUSED_DATE, $this->app_paused_date); + } + + if ($this->isColumnModified(ListPausedPeer::APP_RESTART_DATE)) { + $criteria->add(ListPausedPeer::APP_RESTART_DATE, $this->app_restart_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_PREVIOUS_USR_UID)) { + $criteria->add(ListPausedPeer::DEL_PREVIOUS_USR_UID, $this->del_previous_usr_uid); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_PREVIOUS_USR_USERNAME)) { + $criteria->add(ListPausedPeer::DEL_PREVIOUS_USR_USERNAME, $this->del_previous_usr_username); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME)) { + $criteria->add(ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME, $this->del_previous_usr_firstname); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME)) { + $criteria->add(ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME, $this->del_previous_usr_lastname); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_CURRENT_USR_USERNAME)) { + $criteria->add(ListPausedPeer::DEL_CURRENT_USR_USERNAME, $this->del_current_usr_username); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME)) { + $criteria->add(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME, $this->del_current_usr_firstname); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_CURRENT_USR_LASTNAME)) { + $criteria->add(ListPausedPeer::DEL_CURRENT_USR_LASTNAME, $this->del_current_usr_lastname); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_DELEGATE_DATE)) { + $criteria->add(ListPausedPeer::DEL_DELEGATE_DATE, $this->del_delegate_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_INIT_DATE)) { + $criteria->add(ListPausedPeer::DEL_INIT_DATE, $this->del_init_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_DUE_DATE)) { + $criteria->add(ListPausedPeer::DEL_DUE_DATE, $this->del_due_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_PRIORITY)) { + $criteria->add(ListPausedPeer::DEL_PRIORITY, $this->del_priority); + } + + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(ListPausedPeer::DATABASE_NAME); + + $criteria->add(ListPausedPeer::APP_UID, $this->app_uid); + $criteria->add(ListPausedPeer::DEL_INDEX, $this->del_index); + + return $criteria; + } + + /** + * Returns the composite primary key for this object. + * The array elements will be in same order as specified in XML. + * @return array + */ + public function getPrimaryKey() + { + $pks = array(); + + $pks[0] = $this->getAppUid(); + + $pks[1] = $this->getDelIndex(); + + return $pks; + } + + /** + * Set the [composite] primary key. + * + * @param array $keys The elements of the composite key (order must match the order in XML file). + * @return void + */ + public function setPrimaryKey($keys) + { + + $this->setAppUid($keys[0]); + + $this->setDelIndex($keys[1]); + + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of ListPaused (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false) + { + + $copyObj->setUsrUid($this->usr_uid); + + $copyObj->setTasUid($this->tas_uid); + + $copyObj->setProUid($this->pro_uid); + + $copyObj->setAppNumber($this->app_number); + + $copyObj->setAppTitle($this->app_title); + + $copyObj->setAppProTitle($this->app_pro_title); + + $copyObj->setAppTasTitle($this->app_tas_title); + + $copyObj->setAppPausedDate($this->app_paused_date); + + $copyObj->setAppRestartDate($this->app_restart_date); + + $copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid); + + $copyObj->setDelPreviousUsrUsername($this->del_previous_usr_username); + + $copyObj->setDelPreviousUsrFirstname($this->del_previous_usr_firstname); + + $copyObj->setDelPreviousUsrLastname($this->del_previous_usr_lastname); + + $copyObj->setDelCurrentUsrUsername($this->del_current_usr_username); + + $copyObj->setDelCurrentUsrFirstname($this->del_current_usr_firstname); + + $copyObj->setDelCurrentUsrLastname($this->del_current_usr_lastname); + + $copyObj->setDelDelegateDate($this->del_delegate_date); + + $copyObj->setDelInitDate($this->del_init_date); + + $copyObj->setDelDueDate($this->del_due_date); + + $copyObj->setDelPriority($this->del_priority); + + + $copyObj->setNew(true); + + $copyObj->setAppUid(''); // this is a pkey column, so set to default value + + $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value + + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return ListPaused Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return ListPausedPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new ListPausedPeer(); + } + return self::$peer; + } +} + diff --git a/workflow/engine/classes/model/om/BaseListPausedPeer.php b/workflow/engine/classes/model/om/BaseListPausedPeer.php new file mode 100644 index 000000000..16d0ec452 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListPausedPeer.php @@ -0,0 +1,662 @@ + array ('AppUid', 'DelIndex', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppPausedDate', 'AppRestartDate', 'DelPreviousUsrUid', 'DelPreviousUsrUsername', 'DelPreviousUsrFirstname', 'DelPreviousUsrLastname', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', ), + BasePeer::TYPE_COLNAME => array (ListPausedPeer::APP_UID, ListPausedPeer::DEL_INDEX, ListPausedPeer::USR_UID, ListPausedPeer::TAS_UID, ListPausedPeer::PRO_UID, ListPausedPeer::APP_NUMBER, ListPausedPeer::APP_TITLE, ListPausedPeer::APP_PRO_TITLE, ListPausedPeer::APP_TAS_TITLE, ListPausedPeer::APP_PAUSED_DATE, ListPausedPeer::APP_RESTART_DATE, ListPausedPeer::DEL_PREVIOUS_USR_UID, ListPausedPeer::DEL_PREVIOUS_USR_USERNAME, ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME, ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME, ListPausedPeer::DEL_CURRENT_USR_USERNAME, ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME, ListPausedPeer::DEL_CURRENT_USR_LASTNAME, ListPausedPeer::DEL_DELEGATE_DATE, ListPausedPeer::DEL_INIT_DATE, ListPausedPeer::DEL_DUE_DATE, ListPausedPeer::DEL_PRIORITY, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_PAUSED_DATE', 'APP_RESTART_DATE', 'DEL_PREVIOUS_USR_UID', 'DEL_PREVIOUS_USR_USERNAME', 'DEL_PREVIOUS_USR_FIRSTNAME', 'DEL_PREVIOUS_USR_LASTNAME', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ), + 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, ) + ); + + /** + * holds an array of keys for quick access to the fieldnames array + * + * first dimension keys are the type constants + * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 + */ + private static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'UsrUid' => 2, 'TasUid' => 3, 'ProUid' => 4, 'AppNumber' => 5, 'AppTitle' => 6, 'AppProTitle' => 7, 'AppTasTitle' => 8, 'AppPausedDate' => 9, 'AppRestartDate' => 10, 'DelPreviousUsrUid' => 11, 'DelPreviousUsrUsername' => 12, 'DelPreviousUsrFirstname' => 13, 'DelPreviousUsrLastname' => 14, 'DelCurrentUsrUsername' => 15, 'DelCurrentUsrFirstname' => 16, 'DelCurrentUsrLastname' => 17, 'DelDelegateDate' => 18, 'DelInitDate' => 19, 'DelDueDate' => 20, 'DelPriority' => 21, ), + BasePeer::TYPE_COLNAME => array (ListPausedPeer::APP_UID => 0, ListPausedPeer::DEL_INDEX => 1, ListPausedPeer::USR_UID => 2, ListPausedPeer::TAS_UID => 3, ListPausedPeer::PRO_UID => 4, ListPausedPeer::APP_NUMBER => 5, ListPausedPeer::APP_TITLE => 6, ListPausedPeer::APP_PRO_TITLE => 7, ListPausedPeer::APP_TAS_TITLE => 8, ListPausedPeer::APP_PAUSED_DATE => 9, ListPausedPeer::APP_RESTART_DATE => 10, ListPausedPeer::DEL_PREVIOUS_USR_UID => 11, ListPausedPeer::DEL_PREVIOUS_USR_USERNAME => 12, ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME => 13, ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME => 14, ListPausedPeer::DEL_CURRENT_USR_USERNAME => 15, ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME => 16, ListPausedPeer::DEL_CURRENT_USR_LASTNAME => 17, ListPausedPeer::DEL_DELEGATE_DATE => 18, ListPausedPeer::DEL_INIT_DATE => 19, ListPausedPeer::DEL_DUE_DATE => 20, ListPausedPeer::DEL_PRIORITY => 21, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'USR_UID' => 2, 'TAS_UID' => 3, 'PRO_UID' => 4, 'APP_NUMBER' => 5, 'APP_TITLE' => 6, 'APP_PRO_TITLE' => 7, 'APP_TAS_TITLE' => 8, 'APP_PAUSED_DATE' => 9, 'APP_RESTART_DATE' => 10, 'DEL_PREVIOUS_USR_UID' => 11, 'DEL_PREVIOUS_USR_USERNAME' => 12, 'DEL_PREVIOUS_USR_FIRSTNAME' => 13, 'DEL_PREVIOUS_USR_LASTNAME' => 14, 'DEL_CURRENT_USR_USERNAME' => 15, 'DEL_CURRENT_USR_FIRSTNAME' => 16, 'DEL_CURRENT_USR_LASTNAME' => 17, 'DEL_DELEGATE_DATE' => 18, 'DEL_INIT_DATE' => 19, 'DEL_DUE_DATE' => 20, 'DEL_PRIORITY' => 21, ), + 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, ) + ); + + /** + * @return MapBuilder the map builder for this peer + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getMapBuilder() + { + include_once 'classes/model/map/ListPausedMapBuilder.php'; + return BasePeer::getMapBuilder('classes.model.map.ListPausedMapBuilder'); + } + /** + * Gets a map (hash) of PHP names to DB column names. + * + * @return array The PHP to DB name map for this peer + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this. + */ + public static function getPhpNameMap() + { + if (self::$phpNameMap === null) { + $map = ListPausedPeer::getTableMap(); + $columns = $map->getColumns(); + $nameMap = array(); + foreach ($columns as $column) { + $nameMap[$column->getPhpName()] = $column->getColumnName(); + } + self::$phpNameMap = $nameMap; + } + return self::$phpNameMap; + } + /** + * Translates a fieldname to another type + * + * @param string $name field name + * @param string $fromType One of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @param string $toType One of the class type constants + * @return string translated name of the field. + */ + static public function translateFieldName($name, $fromType, $toType) + { + $toNames = self::getFieldNames($toType); + $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null; + if ($key === null) { + throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true)); + } + return $toNames[$key]; + } + + /** + * Returns an array of of field names. + * + * @param string $type The type of fieldnames to return: + * One of the class type constants TYPE_PHPNAME, + * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM + * @return array A list of field names + */ + + static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, self::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.'); + } + return self::$fieldNames[$type]; + } + + /** + * Convenience method which changes table.column to alias.column. + * + * Using this method you can maintain SQL abstraction while using column aliases. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. ListPausedPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(ListPausedPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + /** + * Add all the columns needed to create a new object. + * + * Note: any columns that were marked with lazyLoad="true" in the + * XML schema will not be added to the select list and only loaded + * on demand. + * + * @param criteria object containing the columns to add. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function addSelectColumns(Criteria $criteria) + { + + $criteria->addSelectColumn(ListPausedPeer::APP_UID); + + $criteria->addSelectColumn(ListPausedPeer::DEL_INDEX); + + $criteria->addSelectColumn(ListPausedPeer::USR_UID); + + $criteria->addSelectColumn(ListPausedPeer::TAS_UID); + + $criteria->addSelectColumn(ListPausedPeer::PRO_UID); + + $criteria->addSelectColumn(ListPausedPeer::APP_NUMBER); + + $criteria->addSelectColumn(ListPausedPeer::APP_TITLE); + + $criteria->addSelectColumn(ListPausedPeer::APP_PRO_TITLE); + + $criteria->addSelectColumn(ListPausedPeer::APP_TAS_TITLE); + + $criteria->addSelectColumn(ListPausedPeer::APP_PAUSED_DATE); + + $criteria->addSelectColumn(ListPausedPeer::APP_RESTART_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_UID); + + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_USERNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_USERNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_LASTNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_DELEGATE_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_INIT_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY); + + } + + const COUNT = 'COUNT(LIST_PAUSED.APP_UID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT LIST_PAUSED.APP_UID)'; + + /** + * Returns the number of rows matching criteria. + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria). + * @param Connection $con + * @return int Number of matching rows. + */ + public static function doCount(Criteria $criteria, $distinct = false, $con = null) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // clear out anything that might confuse the ORDER BY clause + $criteria->clearSelectColumns()->clearOrderByColumns(); + if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->addSelectColumn(ListPausedPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(ListPausedPeer::COUNT); + } + + // just in case we're grouping: add those columns to the select statement + foreach ($criteria->getGroupByColumns() as $column) { + $criteria->addSelectColumn($column); + } + + $rs = ListPausedPeer::doSelectRS($criteria, $con); + if ($rs->next()) { + return $rs->getInt(1); + } else { + // no rows returned; we infer that means 0 matches. + return 0; + } + } + /** + * Method to select one object from the DB. + * + * @param Criteria $criteria object used to create the SELECT statement. + * @param Connection $con + * @return ListPaused + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectOne(Criteria $criteria, $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = ListPausedPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + return null; + } + /** + * Method to do selects. + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param Connection $con + * @return array Array of selected Objects + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelect(Criteria $criteria, $con = null) + { + return ListPausedPeer::populateObjects(ListPausedPeer::doSelectRS($criteria, $con)); + } + /** + * Prepares the Criteria object and uses the parent doSelect() + * method to get a ResultSet. + * + * Use this method directly if you want to just get the resultset + * (instead of an array of objects). + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param Connection $con the connection to use + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @return ResultSet The resultset object with numerically-indexed fields. + * @see BasePeer::doSelect() + */ + public static function doSelectRS(Criteria $criteria, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if (!$criteria->getSelectColumns()) { + $criteria = clone $criteria; + ListPausedPeer::addSelectColumns($criteria); + } + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + // BasePeer returns a Creole ResultSet, set to return + // rows indexed numerically. + return BasePeer::doSelect($criteria, $con); + } + /** + * The returned array will contain objects of the default type or + * objects that inherit from the default. + * + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function populateObjects(ResultSet $rs) + { + $results = array(); + + // set the class once to avoid overhead in the loop + $cls = ListPausedPeer::getOMClass(); + $cls = Propel::import($cls); + // populate the object(s) + while ($rs->next()) { + + $obj = new $cls(); + $obj->hydrate($rs); + $results[] = $obj; + + } + return $results; + } + /** + * Returns the TableMap related to this peer. + * This method is not needed for general use but a specific application could have a need. + * @return TableMap + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getTableMap() + { + return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); + } + + /** + * The class that the Peer will make instances of. + * + * This uses a dot-path notation which is tranalted into a path + * relative to a location on the PHP include_path. + * (e.g. path.to.MyClass -> 'path/to/MyClass.php') + * + * @return string path.to.ClassName + */ + public static function getOMClass() + { + return ListPausedPeer::CLASS_DEFAULT; + } + + /** + * Method perform an INSERT on the database, given a ListPaused or Criteria object. + * + * @param mixed $values Criteria or ListPaused object containing data that is used to create the INSERT statement. + * @param Connection $con the connection to use + * @return mixed The new primary key. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doInsert($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from ListPaused object + } + + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + try { + // use transaction because $criteria could contain info + // for more than one table (I guess, conceivably) + $con->begin(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + + return $pk; + } + + /** + * Method perform an UPDATE on the database, given a ListPaused or Criteria object. + * + * @param mixed $values Criteria or ListPaused object containing data create the UPDATE statement. + * @param Connection $con The connection to use (specify Connection exert more control over transactions). + * @return int The number of affected rows (if supported by underlying database driver). + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doUpdate($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(ListPausedPeer::APP_UID); + $selectCriteria->add(ListPausedPeer::APP_UID, $criteria->remove(ListPausedPeer::APP_UID), $comparison); + + $comparison = $criteria->getComparison(ListPausedPeer::DEL_INDEX); + $selectCriteria->add(ListPausedPeer::DEL_INDEX, $criteria->remove(ListPausedPeer::DEL_INDEX), $comparison); + + } else { + $criteria = $values->buildCriteria(); // gets full criteria + $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) + } + + // set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + /** + * Method to DELETE all rows from the LIST_PAUSED table. + * + * @return int The number of affected rows (if supported by underlying database driver). + */ + public static function doDeleteAll($con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $affectedRows = 0; // initialize var to track total num of affected rows + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->begin(); + $affectedRows += BasePeer::doDeleteAll(ListPausedPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a ListPaused or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or ListPaused object or primary key or array of primary keys + * which is used to create the DELETE statement + * @param Connection $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). + * This includes CASCADE-related rows + * if supported by native driver or if emulated using Propel. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doDelete($values, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(ListPausedPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } elseif ($values instanceof ListPaused) { + + $criteria = $values->buildPkeyCriteria(); + } else { + // it must be the primary key + $criteria = new Criteria(self::DATABASE_NAME); + // primary key is composite; we therefore, expect + // the primary key passed to be an array of pkey + // values + if (count($values) == count($values, COUNT_RECURSIVE)) { + // array is not multi-dimensional + $values = array($values); + } + $vals = array(); + foreach ($values as $value) { + + $vals[0][] = $value[0]; + $vals[1][] = $value[1]; + } + + $criteria->add(ListPausedPeer::APP_UID, $vals[0], Criteria::IN); + $criteria->add(ListPausedPeer::DEL_INDEX, $vals[1], Criteria::IN); + } + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; // initialize var to track total num of affected rows + + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Validates all modified columns of given ListPaused object. + * If parameter $columns is either a single column name or an array of column names + * than only those columns are validated. + * + * NOTICE: This does not apply to primary or foreign keys for now. + * + * @param ListPaused $obj The object to validate. + * @param mixed $cols Column name or array of column names. + * + * @return mixed TRUE if all columns are valid or the error message of the first invalid column. + */ + public static function doValidate(ListPaused $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(ListPausedPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(ListPausedPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach ($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + return BasePeer::doValidate(ListPausedPeer::DATABASE_NAME, ListPausedPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve object using using composite pkey values. + * @param string $app_uid + * @param int $del_index + * @param Connection $con + * @return ListPaused + */ + public static function retrieveByPK($app_uid, $del_index, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $criteria = new Criteria(); + $criteria->add(ListPausedPeer::APP_UID, $app_uid); + $criteria->add(ListPausedPeer::DEL_INDEX, $del_index); + $v = ListPausedPeer::doSelect($criteria, $con); + + return !empty($v) ? $v[0] : null; + } +} + + +// static code to register the map builder for this Peer with the main Propel class +if (Propel::isInit()) { + // the MapBuilder classes register themselves with Propel during initialization + // so we need to load them here. + try { + BaseListPausedPeer::getMapBuilder(); + } catch (Exception $e) { + Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR); + } +} else { + // even if Propel is not yet initialized, the map builder class can be registered + // now and then it will be loaded when Propel initializes. + require_once 'classes/model/map/ListPausedMapBuilder.php'; + Propel::registerMapBuilder('classes.model.map.ListPausedMapBuilder'); +} + diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index ce5e8bd11..411c38c86 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -2651,7 +2651,7 @@ - + @@ -3707,6 +3707,9 @@ + + + @@ -4012,11 +4015,15 @@ + + + + @@ -4059,7 +4066,108 @@
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index 33ebc1edf..e034b44a1 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -486,7 +486,7 @@ CREATE TABLE `ROUTE` `ROU_PARENT` VARCHAR(32) default '0' NOT NULL, `PRO_UID` VARCHAR(32) default '' NOT NULL, `TAS_UID` VARCHAR(32) default '' NOT NULL, -`ROU_NEXT_TASK` VARCHAR(32) default '0' NOT NULL, + `ROU_NEXT_TASK` VARCHAR(32) default '0' NOT NULL, `ROU_CASE` INTEGER default 0 NOT NULL, `ROU_TYPE` VARCHAR(25) default 'SEQUENTIAL' NOT NULL, `ROU_DEFAULT` INTEGER default 0 NOT NULL, @@ -1207,7 +1207,7 @@ CREATE TABLE `APP_HISTORY` `PRO_UID` VARCHAR(32) default '' NOT NULL, `TAS_UID` VARCHAR(32) default '' NOT NULL, `DYN_UID` VARCHAR(32) default '' NOT NULL, - `OBJ_TYPE` VARCHAR(20) default 'DYNAFORM' NOT NULL, + `OBJ_TYPE` VARCHAR(20) default 'DYNAFORM' NOT NULL, `USR_UID` VARCHAR(32) default '' NOT NULL, `APP_STATUS` VARCHAR(100) default '' NOT NULL, `HISTORY_DATE` DATETIME, @@ -1907,7 +1907,7 @@ CREATE TABLE `BPMN_FLOW` `FLO_X2` INTEGER default 0 NOT NULL, `FLO_Y2` INTEGER default 0 NOT NULL, `FLO_STATE` MEDIUMTEXT, - `FLO_POSITION` INTEGER default 0 NOT NULL, + `FLO_POSITION` INTEGER default 0 NOT NULL, PRIMARY KEY (`FLO_UID`), KEY `BPMN_FLOW_I_1`(`FLO_UID`), KEY `BPMN_FLOW_I_2`(`PRJ_UID`), @@ -2263,11 +2263,15 @@ CREATE TABLE `LIST_PARTICIPATED_LAST` `APP_TITLE` VARCHAR(255) default '' NOT NULL, `APP_PRO_TITLE` VARCHAR(255) default '' NOT NULL, `APP_TAS_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_STATUS` VARCHAR(20) default '0' NOT NULL, `DEL_INDEX` INTEGER default 0 NOT NULL, `DEL_PREVIOUS_USR_UID` VARCHAR(32) default '', `DEL_PREVIOUS_USR_USERNAME` VARCHAR(100) default '', `DEL_PREVIOUS_USR_FIRSTNAME` VARCHAR(50) default '', `DEL_PREVIOUS_USR_LASTNAME` VARCHAR(50) default '', + `DEL_CURRENT_USR_USERNAME` VARCHAR(100) default '', + `DEL_CURRENT_USR_FIRSTNAME` VARCHAR(50) default '', + `DEL_CURRENT_USR_LASTNAME` VARCHAR(50) default '', `DEL_DELEGATE_DATE` DATETIME NOT NULL, `DEL_INIT_DATE` DATETIME, `DEL_DUE_DATE` DATETIME, @@ -2301,6 +2305,70 @@ CREATE TABLE `LIST_COMPLETED` PRIMARY KEY (`APP_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Completed list'; #----------------------------------------------------------------------------- +#-- LIST_PAUSED +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `LIST_PAUSED`; + + +CREATE TABLE `LIST_PAUSED` +( + `APP_UID` VARCHAR(32) default '' NOT NULL, + `DEL_INDEX` INTEGER default 0 NOT NULL, + `USR_UID` VARCHAR(32) default '' NOT NULL, + `TAS_UID` VARCHAR(32) default '' NOT NULL, + `PRO_UID` VARCHAR(32) default '' NOT NULL, + `APP_NUMBER` INTEGER default 0 NOT NULL, + `APP_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_PRO_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_TAS_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_PAUSED_DATE` DATETIME NOT NULL, + `APP_RESTART_DATE` DATETIME NOT NULL, + `DEL_PREVIOUS_USR_UID` VARCHAR(32) default '', + `DEL_PREVIOUS_USR_USERNAME` VARCHAR(100) default '', + `DEL_PREVIOUS_USR_FIRSTNAME` VARCHAR(50) default '', + `DEL_PREVIOUS_USR_LASTNAME` VARCHAR(50) default '', + `DEL_CURRENT_USR_USERNAME` VARCHAR(100) default '', + `DEL_CURRENT_USR_FIRSTNAME` VARCHAR(50) default '', + `DEL_CURRENT_USR_LASTNAME` VARCHAR(50) default '', + `DEL_DELEGATE_DATE` DATETIME NOT NULL, + `DEL_INIT_DATE` DATETIME, + `DEL_DUE_DATE` DATETIME, + `DEL_PRIORITY` VARCHAR(32) default '3' NOT NULL, + PRIMARY KEY (`APP_UID`,`DEL_INDEX`), + KEY `indexPausedUser`(`USR_UID`) +)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Paused list'; +#----------------------------------------------------------------------------- +#-- LIST_CANCELED +#----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS `LIST_CANCELED`; + + +CREATE TABLE `LIST_CANCELED` +( + `APP_UID` VARCHAR(32) default '' NOT NULL, + `USR_UID` VARCHAR(32) default '' NOT NULL, + `TAS_UID` VARCHAR(32) default '' NOT NULL, + `PRO_UID` VARCHAR(32) default '' NOT NULL, + `APP_NUMBER` INTEGER default 0 NOT NULL, + `APP_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_PRO_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_TAS_TITLE` VARCHAR(255) default '' NOT NULL, + `APP_CANCELED_DATE` DATETIME NOT NULL, + `DEL_INDEX` INTEGER default 0 NOT NULL, + `DEL_PREVIOUS_USR_UID` VARCHAR(32) default '', + `DEL_CURRENT_USR_USERNAME` VARCHAR(100) default '', + `DEL_CURRENT_USR_FIRSTNAME` VARCHAR(50) default '', + `DEL_CURRENT_USR_LASTNAME` VARCHAR(50) default '', + `DEL_DELEGATE_DATE` DATETIME NOT NULL, + `DEL_INIT_DATE` DATETIME, + `DEL_DUE_DATE` DATETIME, + `DEL_PRIORITY` VARCHAR(32) default '3' NOT NULL, + PRIMARY KEY (`APP_UID`), + KEY `indexCanceledUser`(`USR_UID`) +)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Canceled list'; +#----------------------------------------------------------------------------- #-- LIST_MY_INBOX #----------------------------------------------------------------------------- @@ -2382,73 +2450,74 @@ CREATE TABLE `LIST_UNASSIGNED_GROUP` #-- MESSAGE_TYPE #----------------------------------------------------------------------------- -DROP TABLE IF EXISTS MESSAGE_TYPE; +DROP TABLE IF EXISTS `MESSAGE_TYPE`; -CREATE TABLE MESSAGE_TYPE + +CREATE TABLE `MESSAGE_TYPE` ( - MSGT_UID VARCHAR(32) default '' NOT NULL, - PRJ_UID VARCHAR(32) default '' NOT NULL, - MSGT_NAME VARCHAR(256) default '' NOT NULL, - PRIMARY KEY (MSGT_UID) -)ENGINE=InnoDB DEFAULT CHARSET='utf8'; - + `MSGT_UID` VARCHAR(32) NOT NULL, + `PRJ_UID` VARCHAR(32) NOT NULL, + `MSGT_NAME` VARCHAR(512) default '', + PRIMARY KEY (`MSGT_UID`) +)ENGINE=InnoDB DEFAULT CHARSET='utf8'; #----------------------------------------------------------------------------- #-- MESSAGE_TYPE_VARIABLE #----------------------------------------------------------------------------- -DROP TABLE IF EXISTS MESSAGE_TYPE_VARIABLE; +DROP TABLE IF EXISTS `MESSAGE_TYPE_VARIABLE`; -CREATE TABLE MESSAGE_TYPE_VARIABLE + +CREATE TABLE `MESSAGE_TYPE_VARIABLE` ( - MSGTV_UID VARCHAR(32) default '' NOT NULL, - MSGT_UID VARCHAR(32) default '' NOT NULL, - MSGTV_NAME VARCHAR(256) default '' NOT NULL, - MSGTV_DEFAULT_VALUE VARCHAR(256) default '' NOT NULL, - PRIMARY KEY (MSGTV_UID) -)ENGINE=InnoDB DEFAULT CHARSET='utf8'; - + `MSGTV_UID` VARCHAR(32) NOT NULL, + `MSGT_UID` VARCHAR(32) NOT NULL, + `MSGTV_NAME` VARCHAR(512) default '', + `MSGTV_DEFAULT_VALUE` VARCHAR(512) default '', + PRIMARY KEY (`MSGTV_UID`) +)ENGINE=InnoDB DEFAULT CHARSET='utf8'; #----------------------------------------------------------------------------- -#-- TABLE: EMAIL_SERVER +#-- EMAIL_SERVER #----------------------------------------------------------------------------- DROP TABLE IF EXISTS `EMAIL_SERVER`; + CREATE TABLE `EMAIL_SERVER` ( - `MESS_UID` VARCHAR(32) default '' NOT NULL, - `MESS_ENGINE` VARCHAR(256) default '' NOT NULL, - `MESS_SERVER` VARCHAR(256) default '' NOT NULL, - `MESS_PORT` INTEGER default 0 NOT NULL, - `MESS_RAUTH` INTEGER default 0 NOT NULL, - `MESS_ACCOUNT` VARCHAR(256) default '' NOT NULL, - `MESS_PASSWORD` VARCHAR(256) default '' NOT NULL, - `MESS_FROM_MAIL` VARCHAR(256) default '' NOT NULL, - `MESS_FROM_NAME` VARCHAR(256) default '' NOT NULL, - `SMTPSECURE` VARCHAR(3) default 'No' NOT NULL, - `MESS_TRY_SEND_INMEDIATLY` INTEGER default 0 NOT NULL, - `MAIL_TO` VARCHAR(256) default '' NOT NULL, - `MESS_DEFAULT` INTEGER default 0 NOT NULL, - PRIMARY KEY (`MESS_UID`) -)ENGINE=InnoDB DEFAULT CHARSET='utf8'; - + `MESS_UID` VARCHAR(32) default '' NOT NULL, + `MESS_ENGINE` VARCHAR(256) default '' NOT NULL, + `MESS_SERVER` VARCHAR(256) default '' NOT NULL, + `MESS_PORT` INTEGER default 0 NOT NULL, + `MESS_RAUTH` INTEGER default 0 NOT NULL, + `MESS_ACCOUNT` VARCHAR(256) default '' NOT NULL, + `MESS_PASSWORD` VARCHAR(256) default '' NOT NULL, + `MESS_FROM_MAIL` VARCHAR(256) default '' NOT NULL, + `MESS_FROM_NAME` VARCHAR(256) default '' NOT NULL, + `SMTPSECURE` VARCHAR(3) default 'No' NOT NULL, + `MESS_TRY_SEND_INMEDIATLY` INTEGER default 0 NOT NULL, + `MAIL_TO` VARCHAR(256) default '' NOT NULL, + `MESS_DEFAULT` INTEGER default 0 NOT NULL, + PRIMARY KEY (`MESS_UID`) +)ENGINE=InnoDB DEFAULT CHARSET='utf8'; #----------------------------------------------------------------------------- #-- WEB_ENTRY_EVENT #----------------------------------------------------------------------------- -DROP TABLE IF EXISTS WEB_ENTRY_EVENT; +DROP TABLE IF EXISTS `WEB_ENTRY_EVENT`; -CREATE TABLE WEB_ENTRY_EVENT + +CREATE TABLE `WEB_ENTRY_EVENT` ( - WEE_UID VARCHAR(32) NOT NULL, - PRJ_UID VARCHAR(32) NOT NULL, - EVN_UID VARCHAR(32) NOT NULL, - ACT_UID VARCHAR(32) NOT NULL, - DYN_UID VARCHAR(32) NOT NULL, - USR_UID VARCHAR(32) NOT NULL, - WEE_STATUS VARCHAR(10) NOT NULL DEFAULT 'ENABLED', - WEE_WE_UID VARCHAR(32) NOT NULL DEFAULT '', - WEE_WE_TAS_UID VARCHAR(32) NOT NULL DEFAULT '', - - PRIMARY KEY (WEE_UID) -) ENGINE=InnoDB DEFAULT CHARSET='utf8'; - + `WEE_UID` VARCHAR(32) NOT NULL, + `PRJ_UID` VARCHAR(32) NOT NULL, + `EVN_UID` VARCHAR(32) NOT NULL, + `ACT_UID` VARCHAR(32) NOT NULL, + `DYN_UID` VARCHAR(32) NOT NULL, + `USR_UID` VARCHAR(32) NOT NULL, + `WEE_STATUS` VARCHAR(10) default 'ENABLED' NOT NULL, + `WEE_WE_UID` VARCHAR(32) default '' NOT NULL, + `WEE_WE_TAS_UID` VARCHAR(32) default '' NOT NULL, + PRIMARY KEY (`WEE_UID`) +)ENGINE=InnoDB DEFAULT CHARSET='utf8'; +# This restores the fkey checks, after having unset them earlier +SET FOREIGN_KEY_CHECKS = 1; diff --git a/workflow/engine/methods/cases/casesListExtJs.php b/workflow/engine/methods/cases/casesListExtJs.php index 12de433a2..0882bdac8 100755 --- a/workflow/engine/methods/cases/casesListExtJs.php +++ b/workflow/engine/methods/cases/casesListExtJs.php @@ -4,10 +4,76 @@ unset($_SESSION['APPLICATION']); //get the action from GET or POST, default is todo $action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo'); //fix a previous inconsistency + +$urlProxy = 'proxyCasesList'; if ($action == 'selfservice') { $action = 'unassigned'; - //if ( $action == 'sent' ) $action = 'participated'; } +/*----------------------------------********---------------------------------*/ +$urlProxy = '/api/1.0/' . SYS_SYS . '/lists/'; +switch ($action) { + case 'todo': + case 'draft': + $urlProxy .= 'inbox'; + break; + case 'sent': + $urlProxy .= 'participated'; + break; + case 'search': + case 'participated-history': + $urlProxy = 'proxyCasesList'; + break; + case 'paused': + $urlProxy .= 'paused'; + break; + case 'cancel': + case 'canceled': + $urlProxy .= 'canceled'; + break; + case 'completed': + $urlProxy .= 'completed'; + break; + case 'myinbox': + case 'my-inbox': + $urlProxy .= 'my-inbox'; + break; + case 'selfservice': + $urlProxy = 'proxyCasesList'; + $action = 'unassigned'; + break; +} + +$clientId = 'x-pm-local-client'; +$client = getClientCredentials($clientId); +$authCode = getAuthorizationCode($client); +$debug = false; //System::isDebugMode(); + +$loader = Maveriks\Util\ClassLoader::getInstance(); +$loader->add(PATH_TRUNK . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2"); + +$request = array( + 'grant_type' => 'authorization_code', + 'code' => $authCode +); +$server = array( + 'REQUEST_METHOD' => 'POST' +); +$headers = array( + "PHP_AUTH_USER" => $client['CLIENT_ID'], + "PHP_AUTH_PW" => $client['CLIENT_SECRET'], + "Content-Type" => "multipart/form-data;", + "Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET']) +); + +$request = new \OAuth2\Request(array(), $request, array(), array(), array(), $server, null, $headers); +$oauthServer = new \ProcessMaker\Services\OAuth2\Server(); +$response = $oauthServer->postToken($request, true); +$clientToken = $response->getParameters(); +$clientToken["client_id"] = $client['CLIENT_ID']; +$clientToken["client_secret"] = $client['CLIENT_SECRET']; +/*----------------------------------********---------------------------------*/ + + G::LoadClass("BasePeer"); G::LoadClass("configuration"); @@ -120,6 +186,10 @@ $oHeadPublisher->assign( 'columns', $columns ); //sending the columns to display $oHeadPublisher->assign( 'readerFields', $readerFields ); //sending the fields to get from proxy $oHeadPublisher->assign( 'reassignColumns', $reassignColumns ); //sending the columns to display in grid $oHeadPublisher->assign( 'action', $action ); //sending the action to make +$oHeadPublisher->assign( 'urlProxy', $urlProxy ); //sending the urlProxy to make +/*----------------------------------********---------------------------------*/ +$oHeadPublisher->assign( 'credentials', $clientToken ); //sending the SYS_SYS to make +/*----------------------------------********---------------------------------*/ $oHeadPublisher->assign( 'PMDateFormat', $dateFormat ); //sending the fields to get from proxy $oHeadPublisher->assign( 'statusValues', $status ); //Sending the listing of status $oHeadPublisher->assign( 'processValues', $processes ); //Sending the listing of processes @@ -429,3 +499,41 @@ function getAdditionalFields($action, $confCasesList = array()) return $arrayConfig; } + +/*----------------------------------********---------------------------------*/ +function getClientCredentials($clientId) +{ + $oauthQuery = new ProcessMaker\Services\OAuth2\PmPdo(getDsn()); + return $oauthQuery->getClientDetails($clientId); +} + +function getDsn() +{ + list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, ''); + $port = empty($port) ? '' : ";port=$port"; + $dsn = DB_ADAPTER.':host='.$host.';dbname='.DB_NAME.$port; + + return array('dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS); +} + + +function getAuthorizationCode($client) +{ + \ProcessMaker\Services\OAuth2\Server::setDatabaseSource(getDsn()); + \ProcessMaker\Services\OAuth2\Server::setPmClientId($client['CLIENT_ID']); + + $oauthServer = new \ProcessMaker\Services\OAuth2\Server(); + $userId = $_SESSION['USER_LOGGED']; + $authorize = true; + $_GET = array_merge($_GET, array( + 'response_type' => 'code', + 'client_id' => $client['CLIENT_ID'], + 'scope' => implode(' ', $oauthServer->getScope()) + )); + + $response = $oauthServer->postAuthorize($authorize, $userId, true); + $code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40); + + return $code; +} +/*----------------------------------********---------------------------------*/ \ No newline at end of file diff --git a/workflow/engine/methods/setup/environmentSettingsAjax.php b/workflow/engine/methods/setup/environmentSettingsAjax.php index 553e09a43..72714f9f0 100755 --- a/workflow/engine/methods/setup/environmentSettingsAjax.php +++ b/workflow/engine/methods/setup/environmentSettingsAjax.php @@ -35,6 +35,9 @@ switch ($request) { case "save": $conf = new Configurations(); $config = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "" ); + if (is_numeric($config)) { + $config = array(); + } if (isset($_POST["userFormat"])) { $config['format'] = $_POST["userFormat"]; } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Lists.php b/workflow/engine/src/ProcessMaker/BusinessModel/Lists.php index 5c91a4038..007e09970 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Lists.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Lists.php @@ -44,6 +44,8 @@ class Lists { $filters["sort"] = isset( $dataList["sort"] ) ? $dataList["sort"] : ""; $filters["dir"] = isset( $dataList["dir"] ) ? $dataList["dir"] : "DESC"; + $filters["action"] = isset( $dataList["action"] ) ? $dataList["action"] : ""; + // Select list switch ($listName) { case 'inbox': @@ -62,6 +64,14 @@ class Lists { $list = new \ListCompleted(); $listpeer = 'ListCompletedPeer'; break; + case 'paused': + $list = new \ListPaused(); + $listpeer = 'ListPausedPeer'; + break; + case 'canceled': + $list = new \ListCanceled(); + $listpeer = 'ListCanceledPeer'; + break; case 'my_inbox': $list = new \ListMyInbox(); $listpeer = 'ListMyInboxPeer'; @@ -126,7 +136,30 @@ class Lists { $result = $list->loadList($userUid, $filters); if (!empty($result)) { foreach ($result as &$value) { - $value = array_change_key_case($value, CASE_LOWER); + if (isset($value['DEL_PREVIOUS_USR_UID'])) { + $value['PREVIOUS_USR_UID'] = $value['DEL_PREVIOUS_USR_UID']; + $value['PREVIOUS_USR_USERNAME'] = $value['DEL_PREVIOUS_USR_USERNAME']; + $value['PREVIOUS_USR_FIRSTNAME'] = $value['DEL_PREVIOUS_USR_FIRSTNAME']; + $value['PREVIOUS_USR_LASTNAME'] = $value['DEL_PREVIOUS_USR_LASTNAME']; + } + if (isset($value['DEL_DUE_DATE'])) { + $value['DEL_TASK_DUE_DATE'] = $value['DEL_DUE_DATE']; + } + if (isset($value['APP_PAUSED_DATE'])) { + $value['APP_UPDATE_DATE'] = $value['APP_PAUSED_DATE']; + } + if (isset($value['DEL_CURRENT_USR_USERNAME'])) { + $value['USR_USERNAME'] = $value['DEL_CURRENT_USR_USERNAME']; + $value['USR_FIRSTNAME'] = $value['DEL_CURRENT_USR_FIRSTNAME']; + $value['USR_LASTNAME'] = $value['DEL_CURRENT_USR_LASTNAME']; + $value['APP_UPDATE_DATE'] = $value['DEL_DELEGATE_DATE']; + } + if (isset($value['APP_STATUS'])) { + $value['APP_STATUS_LABEL'] = G::LoadTranslation( "ID_{$value['APP_STATUS']}" ); + } + + + //$value = array_change_key_case($value, CASE_LOWER); } } @@ -144,6 +177,7 @@ class Lists { $filtersData['date_to'] = $filters["dateTo"]; $response['filters'] = $filtersData; $response['data'] = $result; + $response['totalCount'] = $list->countTotal($userUid, $filters); } else { $response = $result; } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Lists.php b/workflow/engine/src/ProcessMaker/Services/Api/Lists.php index 5e95ade99..3e32cb60c 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Lists.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Lists.php @@ -50,7 +50,8 @@ class Lists extends Api $search = '', $filter = '', $date_from = '', - $date_to = '' + $date_to = '', + $action = '' ) { try { $dataList['userId'] = $this->getUserId(); @@ -69,6 +70,8 @@ class Lists extends Api $dataList['dateFrom'] = $date_from; $dataList['dateTo'] = $date_to; + $dataList['action'] = $action; + $lists = new \ProcessMaker\BusinessModel\Lists(); $response = $lists->getList('inbox', $dataList); return $response; @@ -329,6 +332,217 @@ class Lists extends Api } + + + /** + * Get list Paused + * + * @param string $count {@from path} + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $sort {@from path} + * @param string $dir {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} + * @param string $search {@from path} + * @param string $filter {@from path} + * @param string $date_from {@from path} + * @param string $date_to {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /paused + */ + public function doGetListPaused( + $count = true, + $paged = true, + $start = 0, + $limit = 0, + $sort = 'APP_PAUSED_DATE', + $dir = 'DESC', + $cat_uid = '', + $pro_uid = '', + $search = '', + $filter = '', + $date_from = '', + $date_to = '' + ) { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['paged'] = $paged; + $dataList['count'] = $count; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; + $dataList['search'] = $search; + $dataList['filter'] = $filter; + $dataList['dateFrom'] = $date_from; + $dataList['dateTo'] = $date_to; + + $lists = new \ProcessMaker\BusinessModel\Lists(); + $response = $lists->getList('paused', $dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get count list Paused + * + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} + * @param string $search {@from path} + * @param string $filter {@from path} + * @param string $date_from {@from path} + * @param string $date_to {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /paused/total + */ + public function doGetCountPaused( + $cat_uid = '', + $pro_uid = '', + $search = '', + $filter = '', + $date_from = '', + $date_to = '' + ) { + try { + $dataList['userId'] = $this->getUserId(); + + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; + $dataList['search'] = $search; + $dataList['filter'] = $filter; + $dataList['dateFrom'] = $date_from; + $dataList['dateTo'] = $date_to; + + $lists = new \ProcessMaker\BusinessModel\Lists(); + $response = $lists->getList('paused', $dataList, true); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + + + /** + * Get list Canceled + * + * @param string $count {@from path} + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $sort {@from path} + * @param string $dir {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} + * @param string $search {@from path} + * @param string $filter {@from path} + * @param string $date_from {@from path} + * @param string $date_to {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /canceled + */ + public function doGetListCanceled( + $count = true, + $paged = true, + $start = 0, + $limit = 0, + $sort = 'APP_CANCELED_DATE', + $dir = 'DESC', + $cat_uid = '', + $pro_uid = '', + $search = '', + $filter = '', + $date_from = '', + $date_to = '' + ) { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['paged'] = $paged; + $dataList['count'] = $count; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; + $dataList['search'] = $search; + $dataList['filter'] = $filter; + $dataList['dateFrom'] = $date_from; + $dataList['dateTo'] = $date_to; + + $lists = new \ProcessMaker\BusinessModel\Lists(); + $response = $lists->getList('canceled', $dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get count list Canceled + * + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} + * @param string $search {@from path} + * @param string $filter {@from path} + * @param string $date_from {@from path} + * @param string $date_to {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /canceled/total + */ + public function doGetCountCanceled( + $cat_uid = '', + $pro_uid = '', + $search = '', + $filter = '', + $date_from = '', + $date_to = '' + ) { + try { + $dataList['userId'] = $this->getUserId(); + + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; + $dataList['search'] = $search; + $dataList['filter'] = $filter; + $dataList['dateFrom'] = $date_from; + $dataList['dateTo'] = $date_to; + + $lists = new \ProcessMaker\BusinessModel\Lists(); + $response = $lists->getList('canceled', $dataList, true); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** * Get List Completed * diff --git a/workflow/engine/templates/cases/casesList.js b/workflow/engine/templates/cases/casesList.js index 96d92e904..3a0922027 100755 --- a/workflow/engine/templates/cases/casesList.js +++ b/workflow/engine/templates/cases/casesList.js @@ -738,8 +738,14 @@ Ext.onReady ( function() { // Create HttpProxy instance, all CRUD requests will be directed to single proxy url. var proxyCasesList = new Ext.data.HttpProxy({ api: { - read : 'proxyCasesList' + read : urlProxy } + /*----------------------------------********---------------------------------*/ + ,headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer ' + credentials.access_token + } + /*----------------------------------********---------------------------------*/ }); // Typical JsonReader with additional meta-data params for defining the core attributes of your json-response @@ -797,9 +803,9 @@ Ext.onReady ( function() { autoSave: true, // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton. sortInfo:{field: 'APP_CACHE_VIEW.APP_NUMBER', direction: "DESC"}, listeners: { - load: function(response){ - //console.log(response.reader.jsonData); - if (response.reader.jsonData.result === false) { + load: function(response){ + //console.log(response.reader.jsonData); + if (response.reader.jsonData.result === false) { PMExt.notify('ERROR', response.reader.jsonData.message); //PMExt.error }