Merge pull request #843 from Jennydmz/master

CODE STYLE changes...
This commit is contained in:
julceslauhub
2012-10-19 14:12:39 -07:00
11 changed files with 2458 additions and 2430 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -66,7 +66,7 @@ class pmGauge
$center_x = intval( $width / 2 );
$center_y = intval( $height / 2 );
//gauge color
//gauge color
$bgcolor = ImageColorAllocate( $im, 247, 247, 247 );
$extRing = ImageColorAllocate( $im, 214, 214, 214 );
$blueRing = ImageColorAllocate( $im, 70, 132, 238 );
@@ -85,26 +85,26 @@ class pmGauge
ImageFilledRectangle( $im, 0, 0, $width - 1, $height - 1, $white );
ImageRectangle( $im, 0, 0, $width - 1, $height - 1, $gray );
//center coords
//center coords
$cX = intval( $this->w / 2 );
//$cX = intval($this->w /4);
//$cX = intval($this->w /4);
$cY = intval( $this->h / 2 );
//diameter for gauge
//diameter for gauge
$diameter = intval( $this->h * 4 / 5 );
$this->renderGauge( $im, $cX, $cY, $diameter );
/*
//center coords
$cX = intval($this->w * 3/4);
$cY = intval($this->h /2);
//diameter for gauge
$diameter = intval( $this->h * 4/5 );
$this->renderGauge($im, $cX, $cY, $diameter);
*/
/*
//center coords
$cX = intval($this->w * 3/4);
$cY = intval($this->h /2);
//diameter for gauge
$diameter = intval( $this->h * 4/5 );
$this->renderGauge($im, $cX, $cY, $diameter);
*/
Header( "Content-type: image/png" );
ImagePng( $im );
@@ -112,7 +112,7 @@ class pmGauge
function renderGauge ($im, $cX, $cY, $diameter)
{
//gauge color
//gauge color
$bgcolor = ImageColorAllocate( $im, 247, 247, 247 );
$extRing = ImageColorAllocate( $im, 214, 214, 214 );
$blueRing = ImageColorAllocate( $im, 70, 132, 238 );
@@ -129,7 +129,7 @@ class pmGauge
$fontArial = PATH_THIRDPARTY . 'html2ps_pdf/fonts/arial.ttf';
$dX = intval( $diameter * 8 / 7 ); //for now ratio aspect is 8:7
$dX = intval( $diameter * 8 / 7 ); //for now ratio aspect is 8:7
$dY = intval( $diameter );
$dXRing = intval( $dX * 0.90 );
$dYRing = intval( $dY * 0.90 );
@@ -144,19 +144,25 @@ class pmGauge
imagefilledellipse( $im, $cX, $cY, $dXRing, $dYRing, $bgcolor );
//drawing the red arc
if ($this->redFrom > $this->maxValue)
//drawing the red arc
if ($this->redFrom > $this->maxValue) {
$this->redFrom = $this->maxValue;
if ($this->redTo > $this->maxValue)
}
if ($this->redTo > $this->maxValue) {
$this->redTo = $this->maxValue;
if ($this->yellowFrom > $this->maxValue)
}
if ($this->yellowFrom > $this->maxValue) {
$this->yellowFrom = $this->maxValue;
if ($this->yellowTo > $this->maxValue)
}
if ($this->yellowTo > $this->maxValue) {
$this->yellowTo = $this->maxValue;
if ($this->greenFrom > $this->maxValue)
}
if ($this->greenFrom > $this->maxValue) {
$this->greenFrom = $this->maxValue;
if ($this->greenTo > $this->maxValue)
}
if ($this->greenTo > $this->maxValue) {
$this->greenTo = $this->maxValue;
}
$redFrom = $this->redFrom / $this->maxValue * 300 - 240;
$redTo = $this->redTo / $this->maxValue * 300 - 240;
@@ -176,15 +182,16 @@ class pmGauge
}
imagefilledellipse( $im, $cX, $cY, $dXRingCenter, $dYRingCenter, $bgcolor );
//ticks
//ticks
$radiusX = intval( $dX * 0.42 );
$radiusY = intval( $dY * 0.42 );
$min = 5;
while ($min <= 55) {
if ($min % 5 == 0)
if ($min % 5 == 0) {
$len = $radiusX / 8;
else
} else {
$len = $radiusX / 25;
}
$ang = (2 * M_PI * $min) / 60;
$x1 = sin( $ang ) * ($radiusX - $len) + $cX;
@@ -198,7 +205,7 @@ class pmGauge
$textToDisplay = sprintf( "%d", (55 - $min) * $this->maxValue / 50 );
$bbox = imagettfbbox( 8, 0, $fontArial, $textToDisplay );
$x1 = sin( $ang ) * ($radiusX - 2.5 * $len) + $cX - $bbox[4] / 2;
$y1 = cos( $ang ) * ($radiusY - 2.5 * $len) + $cY + 2; // - abs($bbox[5]);
$y1 = cos( $ang ) * ($radiusY - 2.5 * $len) + $cY + 2; // - abs($bbox[5]);
imagettftext( $im, 8, 0, $x1, $y1, $gray, $fontArial, $textToDisplay );
}
$min ++;
@@ -215,7 +222,7 @@ class pmGauge
imagettftext( $im, 9, 0, $cX * 0.60, $cY * 1.8, $gray, $fontArial, $this->open );
imagettftext( $im, 9, 0, $cX * 1.40, $cY * 1.8, $gray, $fontArial, $this->completed );
//drawing the arrow, simple way
//drawing the arrow, simple way
$radiusX = intval( $dX * 0.35 );
$radiusY = intval( $dY * 0.35 );
@@ -224,41 +231,41 @@ class pmGauge
$y1 = cos( $ang ) * ($radiusY) + $cY;
ImageLine( $im, $cX, $cY, $x1, $y1, $arrowLine );
/*
//arrowLine
$arrowHeight = intval($dY * 0.02);
$arrowWidth = intval($dX * 0.35);
$arrowTail = intval($dX * 0.15);
$values = array(
0, -$arrowHeight,
-$arrowTail, 0,
0, $arrowHeight,
$arrowWidth, 0,
0, -$arrowHeight
);
//rotate n degrees
$n = 20;
$ang = (2 * M_PI * $n) / 60;
foreach ( $values as $k => $val ) {
if ( $k % 2 == 0 ) {
//$values[$k] = sin($ang)*$val + 20;
$values[$k] = sin($ang)*($val/$cX)*$;
$values[$k] += $cX;
}
else {
//$ys = intval(sin($sec * M_PI/30 - M_PI/2) * R);
//$values[$k] = intval(sin($n * M_PI/30 - M_PI/2) *$val);
$values[$k] = (cos($ang))*($val/$cY)*$cY;
$values[$k] += $cY;
}
}
imagefilledpolygon ($im, $values, 5, $arrowBody);
imagepolygon ($im, $values, 5, $arrowLine);
*/
//blue ring
/*
//arrowLine
$arrowHeight = intval($dY * 0.02);
$arrowWidth = intval($dX * 0.35);
$arrowTail = intval($dX * 0.15);
$values = array(
0, -$arrowHeight,
-$arrowTail, 0,
0, $arrowHeight,
$arrowWidth, 0,
0, -$arrowHeight
);
//rotate n degrees
$n = 20;
$ang = (2 * M_PI * $n) / 60;
foreach ( $values as $k => $val ) {
if ( $k % 2 == 0 ) {
//$values[$k] = sin($ang)*$val + 20;
$values[$k] = sin($ang)*($val/$cX)*$;
$values[$k] += $cX;
}
else {
//$ys = intval(sin($sec * M_PI/30 - M_PI/2) * R);
//$values[$k] = intval(sin($n * M_PI/30 - M_PI/2) *$val);
$values[$k] = (cos($ang))*($val/$cY)*$cY;
$values[$k] += $cY;
}
}
imagefilledpolygon ($im, $values, 5, $arrowBody);
imagepolygon ($im, $values, 5, $arrowLine);
*/
//blue ring
$dXBlueRing = $dX * 0.07;
$dYBlueRing = $dY * 0.07;
imagefilledellipse( $im, $cX, $cY, $dXBlueRing, $dXBlueRing, $blueRing );
@@ -273,5 +280,5 @@ class pmGauge
imagettftext( $im, 9, 0, $centerX, $centerY, $black, $fontArial, $textToDisplay );
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,11 @@
<?php
/**
* AppMessage.php
** @package workflow.engine.classes.model
*
* * @package workflow.engine.classes.model
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -13,15 +13,14 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/om/BaseAppMessage.php';
@@ -29,93 +28,98 @@ require_once 'classes/model/om/BaseAppMessage.php';
/**
* Skeleton subclass for representing a row from the 'APP_MESSAGE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package workflow.engine.classes.model
* @package workflow.engine.classes.model
*/
class AppMessage extends BaseAppMessage {
private $data_spool;
private $status_spool;
private $error_spool;
public function getSpoolStatus() {
return $this->status_spool;
}
public function getSpoolError() {
return $this->error_spool;
}
/**
* AppMessgae quick Save method
* @param Array(msg_uid, app_uid, del_index, app_msg_type, app_msg_subject, app_msg_from, app_msg_to,
* app_msg_body, app_msg_cc, app_msg_bcc, app_msg_attach, app_msg_template, app_msg_status )
*
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmai.com>
* Date Aug 31th, 2009
*/
public function quickSave2($data_spool) {
$this->data_spool = $data_spool;
$sUID = G::generateUniqueID();
$spool = new AppMessage();
$spool->setAppMsgUid($sUID);
$spool->setMsgUid($data_spool['msg_uid']);
$spool->setAppUid($data_spool['app_uid']);
$spool->setDelIndex($data_spool['del_index']);
$spool->setAppMsgType($data_spool['app_msg_type']);
$spool->setAppMsgSubject($data_spool['app_msg_subject']);
$spool->setAppMsgFrom($data_spool['app_msg_from']);
$spool->setAppMsgTo($data_spool['app_msg_to']);
$spool->setAppMsgBody($data_spool['app_msg_body']);
$spool->setAppMsgDate(date('Y-m-d H:i:s'));
$spool->setAppMsgCc($data_spool['app_msg_cc']);
$spool->setAppMsgBcc($data_spool['app_msg_bcc']);
$spool->setappMsgAttach($data_spool['app_msg_attach']);
$spool->setAppMsgTemplate($data_spool['app_msg_template']);
$spool->setAppMsgStatus($data_spool['app_msg_status']);
if( !$spool->validate() ) {
$this->error_spool = $spool->getValidationFailures();
$this->status_spool = 'error';
$error_msg = "AppMessage::quickSave(): Validation error: \n";
foreach($errors as $key=>$value) {
$error_msg .= $value->getMessage($key) . "\n";
}
throw new Exception($error_msg);
} else {
//echo "Saving - validation ok\n";
$this->error_spool = '';
$this->status = 'success';
$spool->save();
class AppMessage extends BaseAppMessage
{
private $data_spool;
private $status_spool;
private $error_spool;
public function getSpoolStatus ()
{
return $this->status_spool;
}
return $sUID;
}
public function quickSave($aData){
if(isset($aData['app_msg_uid'])) {
$o = EmployeePeer::retrieveByPk($aData['app_msg_uid']);
public function getSpoolError ()
{
return $this->error_spool;
}
if (isset($o) && is_object($o)&& get_class($o) == 'AppMessage') {
$o->fromArray($aData, BasePeer::TYPE_FIELDNAME);
$o->setAppMsgDate(date('Y-m-d H:i:s'));
$o->save();
return $o->getAppMsgUid();
} else {
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
$this->setAppMsgDate(date('Y-m-d H:i:s'));
$this->save();
return $this->getAppMsgUid();
/**
* AppMessgae quick Save method
*
* @param Array(msg_uid, app_uid, del_index, app_msg_type, app_msg_subject, app_msg_from, app_msg_to,
* app_msg_body, app_msg_cc, app_msg_bcc, app_msg_attach, app_msg_template, app_msg_status )
*
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmai.com>
* Date Aug 31th, 2009
*/
public function quickSave2 ($data_spool)
{
$this->data_spool = $data_spool;
$sUID = G::generateUniqueID();
$spool = new AppMessage();
$spool->setAppMsgUid( $sUID );
$spool->setMsgUid( $data_spool['msg_uid'] );
$spool->setAppUid( $data_spool['app_uid'] );
$spool->setDelIndex( $data_spool['del_index'] );
$spool->setAppMsgType( $data_spool['app_msg_type'] );
$spool->setAppMsgSubject( $data_spool['app_msg_subject'] );
$spool->setAppMsgFrom( $data_spool['app_msg_from'] );
$spool->setAppMsgTo( $data_spool['app_msg_to'] );
$spool->setAppMsgBody( $data_spool['app_msg_body'] );
$spool->setAppMsgDate( date( 'Y-m-d H:i:s' ) );
$spool->setAppMsgCc( $data_spool['app_msg_cc'] );
$spool->setAppMsgBcc( $data_spool['app_msg_bcc'] );
$spool->setappMsgAttach( $data_spool['app_msg_attach'] );
$spool->setAppMsgTemplate( $data_spool['app_msg_template'] );
$spool->setAppMsgStatus( $data_spool['app_msg_status'] );
if (! $spool->validate()) {
$this->error_spool = $spool->getValidationFailures();
$this->status_spool = 'error';
$error_msg = "AppMessage::quickSave(): Validation error: \n";
foreach ($errors as $key => $value) {
$error_msg .= $value->getMessage( $key ) . "\n";
}
throw new Exception( $error_msg );
} else {
//echo "Saving - validation ok\n";
$this->error_spool = '';
$this->status = 'success';
$spool->save();
}
return $sUID;
}
}
} // AppMessage
public function quickSave ($aData)
{
if (isset( $aData['app_msg_uid'] )) {
$o = EmployeePeer::retrieveByPk( $aData['app_msg_uid'] );
}
if (isset( $o ) && is_object( $o ) && get_class( $o ) == 'AppMessage') {
$o->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$o->setAppMsgDate( date( 'Y-m-d H:i:s' ) );
$o->save();
return $o->getAppMsgUid();
} else {
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$this->setAppMsgDate( date( 'Y-m-d H:i:s' ) );
$this->save();
return $this->getAppMsgUid();
}
}
}
// AppMessage

View File

@@ -1,125 +1,124 @@
<?php
/**
* CaseTracker.php
* @package workflow.engine.classes.model
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseCaseTracker.php';
/**
* Skeleton subclass for representing a row from the 'CASE_TRACKER' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package workflow.engine.classes.model
* @package workflow.engine.classes.model
*/
class CaseTracker extends BaseCaseTracker {
public function load($sProcessUID) {
try {
$oRow = CaseTrackerPeer::retrieveByPK($sProcessUID);
if (!is_null($oRow)) {
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
$this->setNew(false);
return $aFields;
}
else {
throw(new Exception("The row '$sProcessUID' in table CASE_TRACKER doesn't exist!"));
}
}
catch (Exception $oError) {
throw($oError);
}
}
class CaseTracker extends BaseCaseTracker
{
public function create($aData) {
$oConnection = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
try {
if (!isset($aData['CT_MAP_TYPE'])) {
$aData['CT_MAP_TYPE'] = 'PROCESSMAP';
}
$oCaseTracker = new CaseTracker();
$oCaseTracker->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oCaseTracker->validate()) {
$oConnection->begin();
$iResult = $oCaseTracker->save();
$oConnection->commit();
return true;
}
else {
$sMessage = '';
$aValidationFailures = $oCaseTracker->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
public function load ($sProcessUID)
{
try {
$oRow = CaseTrackerPeer::retrieveByPK( $sProcessUID );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
return $aFields;
} else {
throw (new Exception( "The row '$sProcessUID' in table CASE_TRACKER 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);
}
}
public function update($aData) {
$oConnection = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
try {
$oCaseTracker = CaseTrackerPeer::retrieveByPK($aData['PRO_UID']);
if (!is_null($oCaseTracker))
{
$oCaseTracker->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oCaseTracker->validate()) {
$oConnection->begin();
$iResult = $oCaseTracker->save();
$oConnection->commit();
return $iResult;
public function create ($aData)
{
$oConnection = Propel::getConnection( CaseTrackerPeer::DATABASE_NAME );
try {
if (! isset( $aData['CT_MAP_TYPE'] )) {
$aData['CT_MAP_TYPE'] = 'PROCESSMAP';
}
$oCaseTracker = new CaseTracker();
$oCaseTracker->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oCaseTracker->validate()) {
$oConnection->begin();
$iResult = $oCaseTracker->save();
$oConnection->commit();
return true;
} else {
$sMessage = '';
$aValidationFailures = $oCaseTracker->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 {
$sMessage = '';
$aValidationFailures = $oCaseTracker->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
}
public function update ($aData)
{
$oConnection = Propel::getConnection( CaseTrackerPeer::DATABASE_NAME );
try {
$oCaseTracker = CaseTrackerPeer::retrieveByPK( $aData['PRO_UID'] );
if (! is_null( $oCaseTracker )) {
$oCaseTracker->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oCaseTracker->validate()) {
$oConnection->begin();
$iResult = $oCaseTracker->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oCaseTracker->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);
}
}
else {
throw(new Exception('This row doesn\'t exist!'));
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
public function remove ($sProcessUID)
{
$oConnection = Propel::getConnection( CaseTrackerPeer::DATABASE_NAME );
try {
$oConnection->begin();
$this->setProUid( $sProcessUID );
$iResult = $this->delete();
$oConnection->commit();
return $iResult;
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
}
public function remove($sProcessUID) {
$oConnection = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
try {
$oConnection->begin();
$this->setProUid($sProcessUID);
$iResult = $this->delete();
$oConnection->commit();
return $iResult;
function caseTrackerExists ($sUid)
{
try {
$oObj = CaseTrackerPeer::retrieveByPk( $sUid );
return (is_object( $oObj ) && get_class( $oObj ) == 'CaseTracker');
} catch (Exception $oError) {
throw ($oError);
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
function caseTrackerExists ( $sUid ) {
try {
$oObj = CaseTrackerPeer::retrieveByPk($sUid);
return (is_object($oObj) && get_class($oObj) == 'CaseTracker');
}
catch (Exception $oError) {
throw($oError);
}
}
} // CaseTracker
}
// CaseTracker

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,12 @@
<?php
/**
* GroupUser.php
* @package workflow.engine.classes.model
*
* @package workflow.engine.classes.model
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
@@ -13,15 +14,15 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
require_once 'classes/model/om/BaseGroupUser.php';
@@ -35,114 +36,112 @@ require_once 'classes/model/Groupwf.php';
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* application requirements. This class will only be generated as
* long as it does not already exist in the input directory.
*
* @package workflow.engine.classes.model
* @package workflow.engine.classes.model
*/
class GroupUser extends BaseGroupUser {
class GroupUser extends BaseGroupUser
{
/**
* Create the application document registry
* @param array $aData
* @return string
*/
public function create($aData)
{
$oConnection = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
try {
$oGroupUser = new GroupUser();
$oGroupUser->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oGroupUser->validate()) {
$oConnection->begin();
$iResult = $oGroupUser->save();
$oConnection->commit();
return $iResult;
}
else {
$sMessage = '';
$aValidationFailures = $oGroupUser->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
/**
* Create the application document registry
*
* @param array $aData
* @return string
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( GroupUserPeer::DATABASE_NAME );
try {
$oGroupUser = new GroupUser();
$oGroupUser->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oGroupUser->validate()) {
$oConnection->begin();
$iResult = $oGroupUser->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oGroupUser->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);
}
throw(new Exception('The registry cannot be created!<br />'.$sMessage));
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
/**
* Remove the application document registry
* @param string $sGrpUid
* @param string $sUserUid
* @return string
*/
public function remove($sGrpUid, $sUserUid)
{
$oConnection = Propel::getConnection(GroupUserPeer::DATABASE_NAME);
try {
$oGroupUser = GroupUserPeer::retrieveByPK($sGrpUid, $sUserUid);
if (!is_null($oGroupUser))
{
$oConnection->begin();
$iResult = $oGroupUser->delete();
$oConnection->commit();
return $iResult;
}
else {
throw(new Exception('This row doesn\'t exist!'));
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
function getCountAllUsersByGroup()
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(GroupUserPeer::GRP_UID);
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
$oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::INNER_JOIN);
$oCriteria->add(UsersPeer::USR_STATUS,'CLOSED', Criteria::NOT_EQUAL);
$oCriteria->addGroupByColumn(GroupUserPeer::GRP_UID);
$oDataset = GroupUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$aRows = Array();
while ($oDataset->next()){
$row = $oDataset->getRow();
$aRows[$row['GRP_UID']] = $row['CNT'];
}
return $aRows;
}
function getAllUserGroups($usrUid)
{
$oCriteria = new Criteria('workflow');
$oCriteria->add(GroupUserPeer::USR_UID, $usrUid);
//$oCriteria->addGroupByColumn(GroupUserPeer::GRP_UID);
$oDataset = GroupUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$rows = Array();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$g = new Groupwf();
try {
$grpRow = $g->load($row['GRP_UID']);
$row = array_merge($row, $grpRow);
$rows[] = $row;
}
catch (Exception $e){
continue;
}
}
return $rows;
}
/**
* Remove the application document registry
*
* @param string $sGrpUid
* @param string $sUserUid
* @return string
*/
public function remove ($sGrpUid, $sUserUid)
{
$oConnection = Propel::getConnection( GroupUserPeer::DATABASE_NAME );
try {
$oGroupUser = GroupUserPeer::retrieveByPK( $sGrpUid, $sUserUid );
if (! is_null( $oGroupUser )) {
$oConnection->begin();
$iResult = $oGroupUser->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
function getCountAllUsersByGroup ()
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( GroupUserPeer::GRP_UID );
$oCriteria->addSelectColumn( 'COUNT(*) AS CNT' );
$oCriteria->addJoin( GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::INNER_JOIN );
$oCriteria->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
$oCriteria->addGroupByColumn( GroupUserPeer::GRP_UID );
$oDataset = GroupUserPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$aRows = Array ();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$aRows[$row['GRP_UID']] = $row['CNT'];
}
return $aRows;
}
function getAllUserGroups ($usrUid)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( GroupUserPeer::USR_UID, $usrUid );
//$oCriteria->addGroupByColumn(GroupUserPeer::GRP_UID);
$oDataset = GroupUserPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rows = Array ();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$g = new Groupwf();
try {
$grpRow = $g->load( $row['GRP_UID'] );
$row = array_merge( $row, $grpRow );
$rows[] = $row;
} catch (Exception $e) {
continue;
}
}
return $rows;
}
}
// GroupUser
} // GroupUser

View File

@@ -1,143 +1,130 @@
<?php
/**
* LoginLog.php
* @package workflow.engine.classes.model
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseLoginLog.php';
/**
* Skeleton subclass for representing a row from the 'LOGIN_LOG' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package workflow.engine.classes.model
* @package workflow.engine.classes.model
*/
class LoginLog extends BaseLoginLog {
function create ($aData)
{
$con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
try
{
$this->fromArray($aData, 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);
}
}
public function load($LogUid)
{
try {
$oRow = LoginLogPeer::retrieveByPK( $LogUid );
if (!is_null($oRow))
{
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
$this->setNew(false);
return $aFields;
}
else {
throw(new Exception( "The row '" . $LogUid . "' in table LOGIN_LOG doesn't exist!" ));
}
}
catch (Exception $oError) {
throw($oError);
}
}
public function update($fields)
{
$con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
try
{
$con->begin();
$this->load($fields['LOG_UID']);
$this->fromArray($fields,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);
}
}
class LoginLog extends BaseLoginLog
{
function remove($LogUid)
{
$con = Propel::getConnection(LoginLogPeer::DATABASE_NAME);
try
function create ($aData)
{
$con->begin();
$this->setWlUid($LogUid);
$result=$this->delete();
$con->commit();
return $result;
$con = Propel::getConnection( LoginLogPeer::DATABASE_NAME );
try {
$this->fromArray( $aData, 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);
}
}
catch(Exception $e)
public function load ($LogUid)
{
$con->rollback();
throw($e);
try {
$oRow = LoginLogPeer::retrieveByPK( $LogUid );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
return $aFields;
} else {
throw (new Exception( "The row '" . $LogUid . "' in table LOGIN_LOG doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
}
//Added by Qennix
function getLastLoginByUser($sUID){
$c = new Criteria();
$c->addSelectColumn(LoginLogPeer::LOG_INIT_DATE);
$c->add(LoginLogPeer::USR_UID,$sUID);
$c->setLimit(1);
$c->addDescendingOrderByColumn(LoginLogPeer::LOG_INIT_DATE);
$Dat = LoginLogPeer::doSelectRS ($c);
$Dat->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$Dat->next();
$aRow = $Dat->getRow();
return isset($aRow['LOG_INIT_DATE']) ? $aRow['LOG_INIT_DATE'] : '';
}
//Added by Qennix
function getLastLoginAllUsers(){
$c = new Criteria();
$c->addSelectColumn(LoginLogPeer::USR_UID);
$c->addAsColumn('LAST_LOGIN', 'MAX(LOG_INIT_DATE)');
$c->addGroupByColumn(LoginLogPeer::USR_UID);
$Dat = LoginLogPeer::doSelectRS ($c);
$Dat->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$aRows = Array();
while ($Dat->next()){
$row = $Dat->getRow();
$aRows[$row['USR_UID']] = $row['LAST_LOGIN'];
}
return $aRows;
}
} // LoginLog
public function update ($fields)
{
$con = Propel::getConnection( LoginLogPeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['LOG_UID'] );
$this->fromArray( $fields, 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);
}
}
function remove ($LogUid)
{
$con = Propel::getConnection( LoginLogPeer::DATABASE_NAME );
try {
$con->begin();
$this->setWlUid( $LogUid );
$result = $this->delete();
$con->commit();
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
//Added by Qennix
function getLastLoginByUser ($sUID)
{
$c = new Criteria();
$c->addSelectColumn( LoginLogPeer::LOG_INIT_DATE );
$c->add( LoginLogPeer::USR_UID, $sUID );
$c->setLimit( 1 );
$c->addDescendingOrderByColumn( LoginLogPeer::LOG_INIT_DATE );
$Dat = LoginLogPeer::doSelectRS( $c );
$Dat->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$Dat->next();
$aRow = $Dat->getRow();
return isset( $aRow['LOG_INIT_DATE'] ) ? $aRow['LOG_INIT_DATE'] : '';
}
//Added by Qennix
function getLastLoginAllUsers ()
{
$c = new Criteria();
$c->addSelectColumn( LoginLogPeer::USR_UID );
$c->addAsColumn( 'LAST_LOGIN', 'MAX(LOG_INIT_DATE)' );
$c->addGroupByColumn( LoginLogPeer::USR_UID );
$Dat = LoginLogPeer::doSelectRS( $c );
$Dat->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$aRows = Array ();
while ($Dat->next()) {
$row = $Dat->getRow();
$aRows[$row['USR_UID']] = $row['LAST_LOGIN'];
}
return $aRows;
}
}
// LoginLog

View File

@@ -1,139 +1,131 @@
<?php
/**
* ObjectPermission.php
* @package workflow.engine.classes.model
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseObjectPermission.php';
/**
* Skeleton subclass for representing a row from the 'OBJECT_PERMISSION' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package workflow.engine.classes.model
* @package workflow.engine.classes.model
*/
class ObjectPermission extends BaseObjectPermission {
class ObjectPermission extends BaseObjectPermission
{
public function load($UID)
{
try {
$oRow = ObjectPermissionPeer::retrieveByPK( $UID );
if (!is_null($oRow))
{
$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME);
$this->setNew(false);
return $aFields;
}
else {
throw(new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
}
}
catch (Exception $oError) {
throw($oError);
}
}
function create ($aData)
{
try
public function load ($UID)
{
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
$result=$this->save();
return $result;
try {
$oRow = ObjectPermissionPeer::retrieveByPK( $UID );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
return $aFields;
} else {
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
catch(Exception $e)
function create ($aData)
{
throw($e);
try {
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$result = $this->save();
return $result;
} catch (Exception $e) {
throw ($e);
}
}
}
function Exists ( $Uid ) {
try {
$oPro = ObjectPermissionPeer::retrieveByPk( $Uid );
if (is_object($oPro) && get_class ($oPro) == 'ObjectPermission' ) {
return true;
}
else {
return false;
}
function Exists ($Uid)
{
try {
$oPro = ObjectPermissionPeer::retrieveByPk( $Uid );
if (is_object( $oPro ) && get_class( $oPro ) == 'ObjectPermission') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
catch (Exception $oError) {
throw($oError);
}
}
function remove($Uid)
{
$con = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
try {
$oObjPer = ObjectPermissionPeer::retrieveByPK($Uid);
if (is_object($oObjPer) && get_class($oObjPer) == 'ObjectPermission')
{
$con->begin();
$iResult = $oObjPer->delete();
$con->commit();
return $iResult;
}
else {
throw( new Exception( "The row '" . $Uid . "' in table CaseTrackerObject doesn't exist!" ));
}
function remove ($Uid)
{
$con = Propel::getConnection( ObjectPermissionPeer::DATABASE_NAME );
try {
$oObjPer = ObjectPermissionPeer::retrieveByPK( $Uid );
if (is_object( $oObjPer ) && get_class( $oObjPer ) == 'ObjectPermission') {
$con->begin();
$iResult = $oObjPer->delete();
$con->commit();
return $iResult;
} else {
throw (new Exception( "The row '" . $Uid . "' in table CaseTrackerObject doesn't exist!" ));
}
} catch (exception $e) {
$con->rollback();
throw ($e);
}
}
catch (exception $e) {
$con->rollback();
throw ($e);
}
}
function update($aFields) {
$oConnection = Propel::getConnection(ObjectPermissionPeer::DATABASE_NAME);
try {
$oConnection->begin();
$this->load($aFields['OP_UID']);
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
if ($this->validate()) {
$iResult = $this->save();
$oConnection->commit();
return $iResult;
}
else {
$oConnection->rollback();
throw(new Exception('Failed Validation in class ' . get_class($this) . '.'));
}
function update ($aFields)
{
$oConnection = Propel::getConnection( ObjectPermissionPeer::DATABASE_NAME );
try {
$oConnection->begin();
$this->load( $aFields['OP_UID'] );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$iResult = $this->save();
$oConnection->commit();
return $iResult;
} else {
$oConnection->rollback();
throw (new Exception( 'Failed Validation in class ' . get_class( $this ) . '.' ));
}
} catch (Exception $e) {
$oConnection->rollback();
throw ($e);
}
}
catch(Exception $e) {
$oConnection->rollback();
throw($e);
}
}
function removeByObject($sType, $sObjUid) {
try {
$oCriteria = new Criteria('workflow');
$oCriteria->add(ObjectPermissionPeer::OP_OBJ_TYPE, $sType);
$oCriteria->add(ObjectPermissionPeer::OP_OBJ_UID, $sObjUid);
ObjectPermissionPeer::doDelete($oCriteria);
function removeByObject ($sType, $sObjUid)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( ObjectPermissionPeer::OP_OBJ_TYPE, $sType );
$oCriteria->add( ObjectPermissionPeer::OP_OBJ_UID, $sObjUid );
ObjectPermissionPeer::doDelete( $oCriteria );
} catch (Exception $e) {
throw ($e);
}
}
catch(Exception $e) {
throw($e);
function loadInfo ($sObjUID)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( ObjectPermissionPeer::OP_OBJ_UID, $sObjUID );
$oDataset = ObjectPermissionPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
return ($aRow);
}
}
function loadInfo($sObjUID){
$oCriteria = new Criteria('workflow');
$oCriteria->add(ObjectPermissionPeer::OP_OBJ_UID, $sObjUID);
$oDataset = ObjectPermissionPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
return($aRow);
}
} // ObjectPermission
}
// ObjectPermission