CODE STYLE class/model/ files
This commit is contained in:
@@ -14,21 +14,20 @@ require_once 'classes/model/om/BaseDashlet.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class Dashlet extends BaseDashlet {
|
||||
|
||||
public function load($dasUid) {
|
||||
try {
|
||||
$dashlet = DashletPeer::retrieveByPK($dasUid);
|
||||
if (!is_null($dashlet)) {
|
||||
return $dashlet->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
class Dashlet extends BaseDashlet
|
||||
{
|
||||
public function load($dasUid)
|
||||
{
|
||||
try {
|
||||
$dashlet = DashletPeer::retrieveByPK($dasUid);
|
||||
if (!is_null($dashlet)) {
|
||||
return $dashlet->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // Dashlet
|
||||
|
||||
@@ -14,94 +14,90 @@ require_once 'classes/model/om/BaseDashletInstance.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashletInstance extends BaseDashletInstance {
|
||||
|
||||
private $filterThisFields = array('DAS_INS_UID', 'DAS_UID', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID',
|
||||
class DashletInstance extends BaseDashletInstance
|
||||
{
|
||||
private $filterThisFields = array('DAS_INS_UID', 'DAS_UID', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID',
|
||||
'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_STATUS',
|
||||
'pmos_generik', 'ys-admin-tabpanel', 'PHPSESSID');
|
||||
|
||||
public function load($dasInsUid) {
|
||||
try {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid);
|
||||
$fields = $dashletInstance->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
if ($fields['DAS_INS_ADDITIONAL_PROPERTIES'] != '') {
|
||||
$fields = array_merge($fields, unserialize($fields['DAS_INS_ADDITIONAL_PROPERTIES']));
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function createOrUpdate($data) {
|
||||
$additionalFields = array();
|
||||
foreach ($data as $field => $value) {
|
||||
if (!in_array($field, $this->filterThisFields)) {
|
||||
$additionalFields[$field] = $value;
|
||||
unset($data[$field]);
|
||||
}
|
||||
}
|
||||
if (!empty($additionalFields)) {
|
||||
$data['DAS_INS_ADDITIONAL_PROPERTIES'] = serialize($additionalFields);
|
||||
}
|
||||
else {
|
||||
$data['DAS_INS_ADDITIONAL_PROPERTIES'] = '';
|
||||
}
|
||||
$connection = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
|
||||
try {
|
||||
if (!isset($data['DAS_INS_UID'])) {
|
||||
$data['DAS_INS_UID'] = '';
|
||||
}
|
||||
if ($data['DAS_INS_UID'] == '') {
|
||||
$data['DAS_INS_UID'] = G::generateUniqueID();
|
||||
$data['DAS_INS_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashletInstance = new DashletInstance();
|
||||
}
|
||||
else {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($data['DAS_INS_UID']);
|
||||
}
|
||||
$data['DAS_INS_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashletInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($dashletInstance->validate()) {
|
||||
$connection->begin();
|
||||
$result = $dashletInstance->save();
|
||||
$connection->commit();
|
||||
return $data['DAS_INS_UID'];
|
||||
}
|
||||
else {
|
||||
$message = '';
|
||||
$validationFailures = $dashletInstance->getValidationFailures();
|
||||
foreach($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '. ';
|
||||
public function load($dasInsUid)
|
||||
{
|
||||
try {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid);
|
||||
$fields = $dashletInstance->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
if ($fields['DAS_INS_ADDITIONAL_PROPERTIES'] != '') {
|
||||
$fields = array_merge($fields, unserialize($fields['DAS_INS_ADDITIONAL_PROPERTIES']));
|
||||
}
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
throw(new Exception('Error trying to update: ' . $message));
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($dasInsUid) {
|
||||
$connection = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
|
||||
try {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid);
|
||||
if (!is_null($dashletInstance)) {
|
||||
$connection->begin();
|
||||
$result = $dashletInstance->delete();
|
||||
$connection->commit();
|
||||
return $result;
|
||||
}
|
||||
else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.');
|
||||
}
|
||||
public function createOrUpdate($data)
|
||||
{
|
||||
$additionalFields = array();
|
||||
foreach ($data as $field => $value) {
|
||||
if (!in_array($field, $this->filterThisFields)) {
|
||||
$additionalFields[$field] = $value;
|
||||
unset($data[$field]);
|
||||
}
|
||||
}
|
||||
if (!empty($additionalFields)) {
|
||||
$data['DAS_INS_ADDITIONAL_PROPERTIES'] = serialize($additionalFields);
|
||||
} else {
|
||||
$data['DAS_INS_ADDITIONAL_PROPERTIES'] = '';
|
||||
}
|
||||
$connection = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
|
||||
try {
|
||||
if (!isset($data['DAS_INS_UID'])) {
|
||||
$data['DAS_INS_UID'] = '';
|
||||
}
|
||||
if ($data['DAS_INS_UID'] == '') {
|
||||
$data['DAS_INS_UID'] = G::generateUniqueID();
|
||||
$data['DAS_INS_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashletInstance = new DashletInstance();
|
||||
} else {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($data['DAS_INS_UID']);
|
||||
}
|
||||
$data['DAS_INS_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashletInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($dashletInstance->validate()) {
|
||||
$connection->begin();
|
||||
$result = $dashletInstance->save();
|
||||
$connection->commit();
|
||||
return $data['DAS_INS_UID'];
|
||||
} else {
|
||||
$message = '';
|
||||
$validationFailures = $dashletInstance->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '. ';
|
||||
}
|
||||
throw(new Exception('Error trying to update: ' . $message));
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
} // DashletInstance
|
||||
public function remove($dasInsUid)
|
||||
{
|
||||
$connection = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
|
||||
try {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid);
|
||||
if (!is_null($dashletInstance)) {
|
||||
$connection->begin();
|
||||
$result = $dashletInstance->delete();
|
||||
$connection->commit();
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.');
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashletInstancePeer extends BaseDashletInstancePeer {
|
||||
class DashletInstancePeer extends BaseDashletInstancePeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DashletInstancePeer
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashletPeer extends BaseDashletPeer {
|
||||
class DashletPeer extends BaseDashletPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DashletPeer
|
||||
|
||||
@@ -84,7 +84,7 @@ class DbSource extends BaseDbSource
|
||||
return $oCriteria;
|
||||
}
|
||||
|
||||
public function load($Uid, $ProUID='')
|
||||
public function load($Uid, $ProUID = '')
|
||||
{
|
||||
try {
|
||||
$oRow = DbSourcePeer::retrieveByPK($Uid, $ProUID);
|
||||
@@ -203,5 +203,4 @@ class DbSource extends BaseDbSource
|
||||
}
|
||||
}
|
||||
}
|
||||
// DbSource
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DbSourcePeer extends BaseDbSourcePeer {
|
||||
class DbSourcePeer extends BaseDbSourcePeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DbSourcePeer
|
||||
|
||||
@@ -51,7 +51,7 @@ class Department extends BaseDepartment
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function create ($aData)
|
||||
public function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -171,8 +171,7 @@ class Department extends BaseDepartment
|
||||
* @param string $ProUid the uid of the Prolication
|
||||
* @return array $Fields the fields
|
||||
*/
|
||||
|
||||
function Load ($DepUid)
|
||||
public function Load ($DepUid)
|
||||
{
|
||||
$con = Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -296,7 +295,7 @@ class Department extends BaseDepartment
|
||||
* @return array $Fields the fields
|
||||
*/
|
||||
|
||||
function existsDepartment ($DepUid)
|
||||
public function existsDepartment ($DepUid)
|
||||
{
|
||||
$con = Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$oPro = DepartmentPeer::retrieveByPk( $DepUid );
|
||||
@@ -307,7 +306,7 @@ class Department extends BaseDepartment
|
||||
}
|
||||
}
|
||||
|
||||
function existsUserInDepartment ($depId, $userId)
|
||||
public function existsUserInDepartment ($depId, $userId)
|
||||
{
|
||||
$con = Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$oUser = UsersPeer::retrieveByPk( $userId );
|
||||
@@ -320,7 +319,7 @@ class Department extends BaseDepartment
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateDepartmentManager ($depId)
|
||||
public function updateDepartmentManager ($depId)
|
||||
{
|
||||
$managerId = '';
|
||||
$depParent = '';
|
||||
@@ -374,7 +373,7 @@ class Department extends BaseDepartment
|
||||
}
|
||||
|
||||
//add an user to a department and sync all about manager info
|
||||
function addUserToDepartment ($depId, $userId, $manager, $updateManager = false)
|
||||
public function addUserToDepartment ($depId, $userId, $manager, $updateManager = false)
|
||||
{
|
||||
try {
|
||||
//update the field in user table
|
||||
@@ -405,7 +404,7 @@ class Department extends BaseDepartment
|
||||
|
||||
// select departments
|
||||
// this function is used to draw the hierachy tree view
|
||||
function getDepartments ($DepParent)
|
||||
public function getDepartments ($DepParent)
|
||||
{
|
||||
try {
|
||||
$result = array ();
|
||||
@@ -465,7 +464,7 @@ class Department extends BaseDepartment
|
||||
* @return boolean $Fields true or false
|
||||
*
|
||||
*/
|
||||
function checkDepartmentName ($departmentName, $parentUID, $departmentUID = '')
|
||||
public function checkDepartmentName ($departmentName, $parentUID, $departmentUID = '')
|
||||
{
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
|
||||
@@ -488,7 +487,7 @@ class Department extends BaseDepartment
|
||||
return ($aRow) ? true : false;
|
||||
}
|
||||
|
||||
function getUsersFromDepartment ($sDepUid, $sManagerUid)
|
||||
public function getUsersFromDepartment ($sDepUid, $sManagerUid)
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -544,7 +543,7 @@ class Department extends BaseDepartment
|
||||
* @param string $DepUid, $UsrUid
|
||||
* @return array
|
||||
*/
|
||||
function removeUserFromDepartment ($DepUid, $UsrUid)
|
||||
public function removeUserFromDepartment ($DepUid, $UsrUid)
|
||||
{
|
||||
$aFields = array ('USR_UID' => $UsrUid,'DEP_UID' => '','USR_REPORTS_TO' => ''
|
||||
);
|
||||
@@ -566,7 +565,7 @@ class Department extends BaseDepartment
|
||||
* @param string $sGroupUID
|
||||
* @return object
|
||||
*/
|
||||
function getAvailableUsersCriteria ($sGroupUID = '')
|
||||
public function getAvailableUsersCriteria ($sGroupUID = '')
|
||||
{
|
||||
try {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -586,7 +585,7 @@ class Department extends BaseDepartment
|
||||
* @param string $sDepUID
|
||||
* @return object
|
||||
*/
|
||||
function cantUsersInDepartment ($sDepUID)
|
||||
public function cantUsersInDepartment ($sDepUID)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria( 'workflow' );
|
||||
@@ -604,7 +603,7 @@ class Department extends BaseDepartment
|
||||
}
|
||||
}
|
||||
|
||||
function loadByGroupname ($Groupname)
|
||||
public function loadByGroupname ($Groupname)
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
@@ -620,7 +619,7 @@ class Department extends BaseDepartment
|
||||
}
|
||||
|
||||
//Added by Qennix
|
||||
function getAllDepartmentsByUser ()
|
||||
public function getAllDepartmentsByUser ()
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->addSelectColumn( UsersPeer::USR_UID );
|
||||
@@ -638,7 +637,7 @@ class Department extends BaseDepartment
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
function getDepartmentsForUser ($userUid)
|
||||
public function getDepartmentsForUser ($userUid)
|
||||
{
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( UsersPeer::DEP_UID );
|
||||
@@ -669,5 +668,4 @@ class Department extends BaseDepartment
|
||||
return $departments;
|
||||
}
|
||||
}
|
||||
// Department
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DepartmentPeer extends BaseDepartmentPeer {
|
||||
class DepartmentPeer extends BaseDepartmentPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DepartmentPeer
|
||||
|
||||
@@ -18,6 +18,7 @@ require_once 'classes/model/om/BaseDimTimeComplete.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DimTimeComplete extends BaseDimTimeComplete {
|
||||
class DimTimeComplete extends BaseDimTimeComplete
|
||||
{
|
||||
}
|
||||
|
||||
} // DimTimeComplete
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DimTimeCompletePeer extends BaseDimTimeCompletePeer {
|
||||
class DimTimeCompletePeer extends BaseDimTimeCompletePeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DimTimeCompletePeer
|
||||
|
||||
@@ -18,6 +18,7 @@ require_once 'classes/model/om/BaseDimTimeDelegate.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DimTimeDelegate extends BaseDimTimeDelegate {
|
||||
class DimTimeDelegate extends BaseDimTimeDelegate
|
||||
{
|
||||
}
|
||||
|
||||
} // DimTimeDelegate
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DimTimeDelegatePeer extends BaseDimTimeDelegatePeer {
|
||||
class DimTimeDelegatePeer extends BaseDimTimeDelegatePeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DimTimeDelegatePeer
|
||||
|
||||
@@ -150,7 +150,7 @@ class Dynaform extends BaseDynaform
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function create ($aData)
|
||||
public function create ($aData)
|
||||
{
|
||||
if (! isset( $aData['PRO_UID'] )) {
|
||||
throw (new PropelException( 'The dynaform cannot be created. The PRO_UID is empty.' ));
|
||||
@@ -223,7 +223,7 @@ class Dynaform extends BaseDynaform
|
||||
*
|
||||
*/
|
||||
|
||||
function createFromPMTable ($aData, $pmTableUid)
|
||||
public function createFromPMTable ($aData, $pmTableUid)
|
||||
{
|
||||
$this->create( $aData );
|
||||
$aData['DYN_UID'] = $this->getDynUid();
|
||||
@@ -355,7 +355,7 @@ class Dynaform extends BaseDynaform
|
||||
* @return array $Fields the fields
|
||||
*/
|
||||
|
||||
function Load ($ProUid)
|
||||
public function Load ($ProUid)
|
||||
{
|
||||
$con = Propel::getConnection( DynaformPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -468,7 +468,7 @@ class Dynaform extends BaseDynaform
|
||||
* @param string $sProUid the uid of the Prolication
|
||||
*/
|
||||
|
||||
function dynaformExists ($DynUid)
|
||||
public function dynaformExists ($DynUid)
|
||||
{
|
||||
$con = Propel::getConnection( TaskPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -483,7 +483,7 @@ class Dynaform extends BaseDynaform
|
||||
}
|
||||
}
|
||||
|
||||
function getDynaformContent ($dynaformUid)
|
||||
public function getDynaformContent ($dynaformUid)
|
||||
{
|
||||
$content = '';
|
||||
$fields = $this->Load( $dynaformUid );
|
||||
@@ -495,7 +495,7 @@ class Dynaform extends BaseDynaform
|
||||
return $content;
|
||||
}
|
||||
|
||||
function getDynaformFields ($dynaformUid)
|
||||
public function getDynaformFields ($dynaformUid)
|
||||
{
|
||||
$content = '';
|
||||
$fields = $this->Load( $dynaformUid );
|
||||
@@ -510,7 +510,7 @@ class Dynaform extends BaseDynaform
|
||||
return $G_FORM->fields;
|
||||
}
|
||||
|
||||
function verifyExistingName ($sName, $sProUid)
|
||||
public function verifyExistingName ($sName, $sProUid)
|
||||
{
|
||||
$sNameDyanform = urldecode( $sName );
|
||||
$sProUid = urldecode( $sProUid );
|
||||
@@ -540,5 +540,4 @@ class Dynaform extends BaseDynaform
|
||||
return $flag;
|
||||
}
|
||||
}
|
||||
// Dynaform
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class DynaformPeer extends BaseDynaformPeer {
|
||||
class DynaformPeer extends BaseDynaformPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // DynaformPeer
|
||||
|
||||
@@ -98,7 +98,7 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function create ($aData)
|
||||
public function create ($aData)
|
||||
{
|
||||
if (! isset( $aData['EVN_UID'] ) || $aData['EVN_UID'] == '') {
|
||||
$aData['EVN_UID'] = G::generateUniqueID();
|
||||
@@ -226,7 +226,7 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function update ($aData)
|
||||
public function update ($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( EventPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -362,7 +362,7 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function remove ($sUID)
|
||||
public function remove ($sUID)
|
||||
{
|
||||
$oConnection = Propel::getConnection( EventPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -407,7 +407,7 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function calculateEventsExecutionDate ()
|
||||
public function calculateEventsExecutionDate ()
|
||||
{
|
||||
$line1 = '';
|
||||
$line2 = '';
|
||||
@@ -416,7 +416,7 @@ class Event extends BaseEvent
|
||||
return $line1 . "<br>\n" . $line2;
|
||||
}
|
||||
|
||||
function calculateExecutionDateSingle ()
|
||||
public function calculateExecutionDateSingle ()
|
||||
{
|
||||
try {
|
||||
$rowsCreated = 0;
|
||||
@@ -537,7 +537,7 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function calculateExecutionDateMultiple ()
|
||||
public function calculateExecutionDateMultiple ()
|
||||
{
|
||||
try {
|
||||
$rowsCreated = 0;
|
||||
@@ -647,9 +647,8 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function closeAppEvents ($PRO_UID, $APP_UID, $DEL_INDEX, $TAS_UID)
|
||||
public function closeAppEvents ($PRO_UID, $APP_UID, $DEL_INDEX, $TAS_UID)
|
||||
{
|
||||
|
||||
$aAppEvents = $this->getAppEvents( $APP_UID, $DEL_INDEX );
|
||||
if ($aAppEvents) {
|
||||
foreach ($aAppEvents as $aRow) {
|
||||
@@ -661,10 +660,9 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function createAppEvents ($PRO_UID, $APP_UID, $DEL_INDEX, $TAS_UID)
|
||||
public function createAppEvents ($PRO_UID, $APP_UID, $DEL_INDEX, $TAS_UID)
|
||||
{
|
||||
$aRows = Array ();
|
||||
$aEventsRows = $this->getBy( $PRO_UID, $TAS_UID );
|
||||
@@ -728,7 +726,7 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function verifyTaskbetween ($PRO_UID, $taskFrom, $taskTo, $taskVerify)
|
||||
public function verifyTaskbetween ($PRO_UID, $taskFrom, $taskTo, $taskVerify)
|
||||
{
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( RoutePeer::ROU_NEXT_TASK );
|
||||
@@ -756,9 +754,8 @@ class Event extends BaseEvent
|
||||
}
|
||||
}
|
||||
|
||||
function getBy ($PRO_UID, $taskUid)
|
||||
public function getBy ($PRO_UID, $taskUid)
|
||||
{
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( EventPeer::EVN_UID );
|
||||
$oCriteria->addSelectColumn( EventPeer::TAS_UID );
|
||||
@@ -818,7 +815,7 @@ class Event extends BaseEvent
|
||||
return (count( $aRows ) > 0) ? $aRows : false;
|
||||
}
|
||||
|
||||
function getAppEvents ($APP_UID, $DEL_INDEX)
|
||||
public function getAppEvents ($APP_UID, $DEL_INDEX)
|
||||
{
|
||||
//for single task event
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -862,7 +859,7 @@ class Event extends BaseEvent
|
||||
return (count( $aRows ) > 0) ? $aRows : false;
|
||||
}
|
||||
|
||||
function toCalculateTime ($aData, $iDate = null)
|
||||
public function toCalculateTime ($aData, $iDate = null)
|
||||
{
|
||||
G::LoadClass( 'dates' );
|
||||
$oDates = new dates();
|
||||
@@ -887,7 +884,7 @@ class Event extends BaseEvent
|
||||
return $sActionDate;
|
||||
}
|
||||
|
||||
function Exists ($sUid)
|
||||
public function Exists ($sUid)
|
||||
{
|
||||
try {
|
||||
$oObj = EventPeer::retrieveByPk( $sUid );
|
||||
@@ -923,5 +920,4 @@ class Event extends BaseEvent
|
||||
return $aRow;
|
||||
}
|
||||
}
|
||||
// Event
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class EventPeer extends BaseEventPeer {
|
||||
class EventPeer extends BaseEventPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // EventPeer
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class FieldConditionPeer extends BaseFieldConditionPeer {
|
||||
class FieldConditionPeer extends BaseFieldConditionPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // FieldConditionPeer
|
||||
|
||||
@@ -18,106 +18,102 @@ require_once 'classes/model/om/BaseFields.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class Fields extends BaseFields {
|
||||
public function load($sUID) {
|
||||
try {
|
||||
$oFields = FieldsPeer::retrieveByPK($sUID);
|
||||
if (!is_null($oFields)) {
|
||||
$aFields = $oFields->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||
return $aFields;
|
||||
}
|
||||
else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function create($aData) {
|
||||
if (!isset($aData['FLD_UID'])) {
|
||||
$aData['FLD_UID'] = G::generateUniqueID();
|
||||
}
|
||||
else {
|
||||
if ($aData['FLD_UID'] == '') {
|
||||
$aData['FLD_UID'] = G::generateUniqueID();
|
||||
}
|
||||
}
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oFields = new Fields();
|
||||
$oFields->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oFields->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oFields->save();
|
||||
$oConnection->commit();
|
||||
return $aData['FLD_UID'];
|
||||
}
|
||||
else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oFields->getValidationFailures();
|
||||
foreach($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
class Fields extends BaseFields
|
||||
{
|
||||
public function load($sUID)
|
||||
{
|
||||
try {
|
||||
$oFields = FieldsPeer::retrieveByPK($sUID);
|
||||
if (!is_null($oFields)) {
|
||||
$aFields = $oFields->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||
return $aFields;
|
||||
} else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
throw(new Exception('The registry cannot be created!<br />' . $sMessage));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function update($aData) {
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oFields = FieldsPeer::retrieveByPK($aData['FLD_UID']);
|
||||
if (!is_null($oFields)) {
|
||||
$oFields->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oFields->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oFields->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
public function create($aData)
|
||||
{
|
||||
if (!isset($aData['FLD_UID'])) {
|
||||
$aData['FLD_UID'] = G::generateUniqueID();
|
||||
} else {
|
||||
if ($aData['FLD_UID'] == '') {
|
||||
$aData['FLD_UID'] = G::generateUniqueID();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oFields->getValidationFailures();
|
||||
foreach($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oFields = new Fields();
|
||||
$oFields->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oFields->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oFields->save();
|
||||
$oConnection->commit();
|
||||
return $aData['FLD_UID'];
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oFields->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be created!<br />' . $sMessage));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
function remove($sUID) {
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oFields = FieldsPeer::retrieveByPK($sUID);
|
||||
if (!is_null($oFields)) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oFields->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
}
|
||||
else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
public function update($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oFields = FieldsPeer::retrieveByPK($aData['FLD_UID']);
|
||||
if (!is_null($oFields)) {
|
||||
$oFields->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oFields->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oFields->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oFields->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
|
||||
}
|
||||
} else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
|
||||
public function remove($sUID)
|
||||
{
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oFields = FieldsPeer::retrieveByPK($sUID);
|
||||
if (!is_null($oFields)) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oFields->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
} else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Fields
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class FieldsPeer extends BaseFieldsPeer {
|
||||
class FieldsPeer extends BaseFieldsPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // FieldsPeer
|
||||
|
||||
@@ -162,5 +162,4 @@ class Gateway extends BaseGateway
|
||||
}
|
||||
}
|
||||
}
|
||||
// Gateway
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class GatewayPeer extends BaseGatewayPeer {
|
||||
class GatewayPeer extends BaseGatewayPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // GatewayPeer
|
||||
|
||||
@@ -101,7 +101,7 @@ class GroupUser extends BaseGroupUser
|
||||
}
|
||||
}
|
||||
|
||||
function getCountAllUsersByGroup ()
|
||||
public function getCountAllUsersByGroup ()
|
||||
{
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( GroupUserPeer::GRP_UID );
|
||||
@@ -119,7 +119,7 @@ class GroupUser extends BaseGroupUser
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
function getAllUserGroups ($usrUid)
|
||||
public function getAllUserGroups ($usrUid)
|
||||
{
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( GroupUserPeer::USR_UID, $usrUid );
|
||||
@@ -143,5 +143,4 @@ class GroupUser extends BaseGroupUser
|
||||
return $rows;
|
||||
}
|
||||
}
|
||||
// GroupUser
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class GroupUserPeer extends BaseGroupUserPeer {
|
||||
class GroupUserPeer extends BaseGroupUserPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // GroupUserPeer
|
||||
|
||||
@@ -96,8 +96,7 @@ class Groupwf extends BaseGroupwf
|
||||
* @param array $aData $oData is not necessary
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function create ($aData)
|
||||
public function create ($aData)
|
||||
{
|
||||
//$oData is not necessary
|
||||
$con = Propel::getConnection( GroupwfPeer::DATABASE_NAME );
|
||||
@@ -153,8 +152,7 @@ class Groupwf extends BaseGroupwf
|
||||
* @param string $ProUid the uid of the Prolication
|
||||
* @return array $Fields the fields
|
||||
*/
|
||||
|
||||
function Load ($ProUid)
|
||||
public function Load ($ProUid)
|
||||
{
|
||||
$con = Propel::getConnection( GroupwfPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -180,7 +178,6 @@ class Groupwf extends BaseGroupwf
|
||||
* @return variant
|
||||
*
|
||||
*/
|
||||
|
||||
public function update ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( GroupwfPeer::DATABASE_NAME );
|
||||
@@ -245,7 +242,7 @@ class Groupwf extends BaseGroupwf
|
||||
* @param string $sProUid the uid of the Prolication
|
||||
*/
|
||||
|
||||
function GroupwfExists ($GrpUid)
|
||||
public function GroupwfExists ($GrpUid)
|
||||
{
|
||||
$con = Propel::getConnection( GroupwfPeer::DATABASE_NAME );
|
||||
try {
|
||||
@@ -260,7 +257,7 @@ class Groupwf extends BaseGroupwf
|
||||
}
|
||||
}
|
||||
|
||||
function loadByGroupname ($Groupname)
|
||||
public function loadByGroupname ($Groupname)
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
@@ -275,7 +272,7 @@ class Groupwf extends BaseGroupwf
|
||||
return $c;
|
||||
}
|
||||
|
||||
function getAll ($start = null, $limit = null, $search = null)
|
||||
public function getAll ($start = null, $limit = null, $search = null)
|
||||
{
|
||||
$totalCount = 0;
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
@@ -325,7 +322,7 @@ class Groupwf extends BaseGroupwf
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getAllGroup ($start = null, $limit = null, $search = null)
|
||||
public function getAllGroup ($start = null, $limit = null, $search = null)
|
||||
{
|
||||
require_once PATH_RBAC . "model/RbacUsers.php";
|
||||
require_once 'classes/model/TaskUser.php';
|
||||
@@ -382,7 +379,7 @@ class Groupwf extends BaseGroupwf
|
||||
);
|
||||
}
|
||||
|
||||
function filterGroup ($filter, $start, $limit)
|
||||
public function filterGroup ($filter, $start, $limit)
|
||||
{
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
require_once 'classes/model/TaskUser.php';
|
||||
@@ -428,5 +425,4 @@ class Groupwf extends BaseGroupwf
|
||||
|
||||
}
|
||||
}
|
||||
// Groupwf
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class GroupwfPeer extends BaseGroupwfPeer {
|
||||
class GroupwfPeer extends BaseGroupwfPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // GroupwfPeer
|
||||
|
||||
@@ -38,6 +38,7 @@ require_once 'classes/model/om/BaseHoliday.php';
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class Holiday extends BaseHoliday {
|
||||
class Holiday extends BaseHoliday
|
||||
{
|
||||
}
|
||||
|
||||
} // Holiday
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class HolidayPeer extends BaseHolidayPeer {
|
||||
class HolidayPeer extends BaseHolidayPeer
|
||||
{
|
||||
}
|
||||
|
||||
} // HolidayPeer
|
||||
|
||||
Reference in New Issue
Block a user