CODE STYLE class/model/ files

This commit is contained in:
Fernando Ontiveros
2012-10-20 16:52:15 -04:00
parent ad53bd8a50
commit 319f755d18
52 changed files with 2559 additions and 2617 deletions

View File

@@ -297,7 +297,7 @@ class InputDocument extends BaseInputDocument
* @param string $sUid the uid of the Prolication
*/
function InputExists ($sUid)
public function InputExists ($sUid)
{
$con = Propel::getConnection( InputDocumentPeer::DATABASE_NAME );
try {

View File

@@ -2,10 +2,10 @@
/**
* InputDocumentPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'INPUT_DOCUMENT' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class InputDocumentPeer extends BaseInputDocumentPeer {
class InputDocumentPeer extends BaseInputDocumentPeer
{
}
} // InputDocumentPeer

View File

@@ -2,10 +2,10 @@
/**
* IsoCountry.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* 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/BaseIsoCountry.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseIsoCountry.php';
/**
* Skeleton subclass for representing a row from the 'ISO_COUNTRY' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,26 +38,30 @@ require_once 'classes/model/om/BaseIsoCountry.php';
*
* @package workflow.engine.classes.model
*/
class IsoCountry extends BaseIsoCountry {
function findById($UID){
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoCountryPeer::IC_UID);
$oCriteria->addSelectColumn(IsoCountryPeer::IC_NAME);
$oCriteria->add(IsoCountryPeer::IC_UID, $UID);
$oDataset = IsoCountryPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
class IsoCountry extends BaseIsoCountry
{
public function findById($UID)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoCountryPeer::IC_UID);
$oCriteria->addSelectColumn(IsoCountryPeer::IC_NAME);
$oCriteria->add(IsoCountryPeer::IC_UID, $UID);
$oDataset = IsoCountryPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
public function findByIcName($IC_NAME)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoCountryPeer::IC_UID);
$oCriteria->addSelectColumn(IsoCountryPeer::IC_NAME);
$oCriteria->add(IsoCountryPeer::IC_NAME, $IC_NAME);
$oDataset = IsoCountryPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
}
function findByIcName($IC_NAME){
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoCountryPeer::IC_UID);
$oCriteria->addSelectColumn(IsoCountryPeer::IC_NAME);
$oCriteria->add(IsoCountryPeer::IC_NAME, $IC_NAME);
$oDataset = IsoCountryPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
} // IsoCountry

View File

@@ -2,10 +2,10 @@
/**
* IsoCountryPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'ISO_COUNTRY' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class IsoCountryPeer extends BaseIsoCountryPeer {
class IsoCountryPeer extends BaseIsoCountryPeer
{
}
} // IsoCountryPeer

View File

@@ -2,10 +2,10 @@
/**
* IsoLocation.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* 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/BaseIsoLocation.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseIsoLocation.php';
/**
* Skeleton subclass for representing a row from the 'ISO_LOCATION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,59 +38,58 @@ require_once 'classes/model/om/BaseIsoLocation.php';
*
* @package workflow.engine.classes.model
*/
class IsoLocation extends BaseIsoLocation {
function findById($IC_UID, $IS_UID, $IL_UID){
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoLocationPeer::IC_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IS_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_NAME);
$oCriteria->add(IsoLocationPeer::IC_UID, $IC_UID);
$oCriteria->add(IsoLocationPeer::IS_UID, $IS_UID);
$oCriteria->add(IsoLocationPeer::IL_UID, $IL_UID);
$oDataset = IsoLocationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
function findByIcName($IL_NAME){
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoLocationPeer::IC_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IS_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_NAME);
$oCriteria->add(IsoLocationPeer::IL_NAME, $IL_NAME);
$oDataset = IsoLocationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
function getAllRowsLike($word)
class IsoLocation extends BaseIsoLocation
{
public function findById($IC_UID, $IS_UID, $IL_UID)
{
try {
//require_once 'classes/model/IsoLocation.php';
$c = new Criteria('workflow');
$c->addSelectColumn(IsoLocationPeer::IC_UID);
$c->addSelectColumn(IsoLocationPeer::IL_NORMAL_NAME);
$c->add(IsoLocationPeer::IL_NORMAL_NAME, $word."%", Criteria::LIKE);
$rs = IsoLocationPeer::doSelectRS($c);
//$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rows = Array();
while($rs->next()){
array_push($rows, $rs->getRow());
}
return $rows;
}
catch (Exception $oException) {
throw $oException;
}
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoLocationPeer::IC_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IS_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_NAME);
$oCriteria->add(IsoLocationPeer::IC_UID, $IC_UID);
$oCriteria->add(IsoLocationPeer::IS_UID, $IS_UID);
$oCriteria->add(IsoLocationPeer::IL_UID, $IL_UID);
$oDataset = IsoLocationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
} // IsoLocation
public function findByIcName($IL_NAME)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoLocationPeer::IC_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IS_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_UID);
$oCriteria->addSelectColumn(IsoLocationPeer::IL_NAME);
$oCriteria->add(IsoLocationPeer::IL_NAME, $IL_NAME);
$oDataset = IsoLocationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
public function getAllRowsLike($word)
{
try {
$c = new Criteria('workflow');
$c->addSelectColumn(IsoLocationPeer::IC_UID);
$c->addSelectColumn(IsoLocationPeer::IL_NORMAL_NAME);
$c->add(IsoLocationPeer::IL_NORMAL_NAME, $word."%", Criteria::LIKE);
$rs = IsoLocationPeer::doSelectRS($c);
//$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rows = Array();
while ($rs->next()) {
array_push($rows, $rs->getRow());
}
return $rows;
} catch (Exception $oException) {
throw $oException;
}
}
}

View File

@@ -2,10 +2,10 @@
/**
* IsoLocationPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'ISO_LOCATION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class IsoLocationPeer extends BaseIsoLocationPeer {
class IsoLocationPeer extends BaseIsoLocationPeer
{
}
} // IsoLocationPeer

View File

@@ -2,10 +2,10 @@
/**
* IsoSubdivision.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* 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/BaseIsoSubdivision.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseIsoSubdivision.php';
/**
* Skeleton subclass for representing a row from the 'ISO_SUBDIVISION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,29 +38,33 @@ require_once 'classes/model/om/BaseIsoSubdivision.php';
*
* @package workflow.engine.classes.model
*/
class IsoSubdivision extends BaseIsoSubdivision {
function findById($IC_UID, $IS_UID){
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IC_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_NAME);
$oCriteria->add(IsoSubdivisionPeer::IC_UID, $IC_UID);
$oCriteria->add(IsoSubdivisionPeer::IS_UID, $IS_UID);
$oDataset = IsoSubdivisionPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
class IsoSubdivision extends BaseIsoSubdivision
{
public function findById($IC_UID, $IS_UID)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IC_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_NAME);
$oCriteria->add(IsoSubdivisionPeer::IC_UID, $IC_UID);
$oCriteria->add(IsoSubdivisionPeer::IS_UID, $IS_UID);
$oDataset = IsoSubdivisionPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
public function findByIcName($IS_NAME)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IC_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_NAME);
$oCriteria->add(IsoSubdivisionPeer::IS_NAME, $IS_UID);
$oDataset = IsoSubdivisionPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
}
function findByIcName($IS_NAME){
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IC_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_UID);
$oCriteria->addSelectColumn(IsoSubdivisionPeer::IS_NAME);
$oCriteria->add(IsoSubdivisionPeer::IS_NAME, $IS_UID);
$oDataset = IsoSubdivisionPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
return $oDataset->getRow();
}
} // IsoSubdivision

View File

@@ -2,10 +2,10 @@
/**
* IsoSubdivisionPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'ISO_SUBDIVISION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class IsoSubdivisionPeer extends BaseIsoSubdivisionPeer {
class IsoSubdivisionPeer extends BaseIsoSubdivisionPeer
{
}
} // IsoSubdivisionPeer

View File

@@ -45,7 +45,7 @@ require_once 'classes/model/Translation.php';
class Language extends BaseLanguage
{
function load ($sLanUid)
public function load ($sLanUid)
{
try {
$oRow = LanguagePeer::retrieveByPK( $sLanUid );
@@ -62,7 +62,7 @@ class Language extends BaseLanguage
}
}
function update ($aFields)
public function update ($aFields)
{
$oConnection = Propel::getConnection( LanguagePeer::DATABASE_NAME );
try {
@@ -82,8 +82,9 @@ class Language extends BaseLanguage
throw ($e);
}
}
//SELECT LAN_ID, LAN_NAME FROM LANGUAGE WHERE LAN_ENABLED = '1' ORDER BY LAN_WEIGHT DESC
function getActiveLanguages ()
public function getActiveLanguages ()
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( LanguagePeer::LAN_ID );
@@ -103,7 +104,7 @@ class Language extends BaseLanguage
return $rows;
}
function findById ($LAN_ID)
public function findById ($LAN_ID)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( LanguagePeer::LAN_NAME );
@@ -114,7 +115,7 @@ class Language extends BaseLanguage
return $oDataset->getRow();
}
function findByLanName ($LAN_NAME)
public function findByLanName ($LAN_NAME)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( LanguagePeer::LAN_ID );
@@ -179,9 +180,7 @@ class Language extends BaseLanguage
$errorMsg = '';
while ($rowTranslation = $POFile->getTranslation()) {
$countItems ++;
if (! isset( $POFile->translatorComments[0] ) || ! isset( $POFile->translatorComments[1] ) || ! isset( $POFile->references[0] )) {
throw new Exception( 'The .po file doesn\'t have valid directives for Processmaker!' );
}
@@ -223,7 +222,6 @@ class Language extends BaseLanguage
}
} // is a Xml update
elseif ($updateXml) {
$xmlForm = $context;
//erik: expresion to prevent and hable correctly dropdown values like -1, -2 etc.
preg_match( '/^([\w_]+)\s-\s([\w_]+)\s*-*\s*([\w\W]*)$/', $reference, $match );
@@ -287,17 +285,11 @@ class Language extends BaseLanguage
}
//export
function export ()
public function export ()
{
//G::LoadThirdParty('pear', 'Benchmark/Timer');
G::LoadSystem( 'i18n_po' );
G::LoadClass( "system" );
//echo G::getMemoryUsage();
//$timer = new Benchmark_Timer();
//$timer->start();
//creating the .po file
$sPOFile = PATH_CORE . 'content' . PATH_SEP . 'translations' . PATH_SEP . MAIN_POFILE . '.' . $_GET['LOCALE'] . '.po';
@@ -347,10 +339,6 @@ class Language extends BaseLanguage
$poFile->addHeader( 'X-Poedit-SourceCharset', 'utf-8' );
$poFile->addHeader( 'Content-Transfer-Encoding', '8bit' );
//$timer->setMarker('end making po headers');
//export translation
$aLabels = array ();
$aMsgids = array ('' => true
);
@@ -429,9 +417,6 @@ class Language extends BaseLanguage
//now find labels in xmlforms
/**
* *********
*/
$aExceptionFields = array ('','javascript','hidden','phpvariable','private','toolbar','xmlmenu','toolbutton','cellmark','grid','CheckboxTable'
);
@@ -545,26 +530,12 @@ class Language extends BaseLanguage
}
}
} //end foreach
}
//
//$timer->setMarker('end xml files processed');
//$profiling = $timer->getProfiling();
//$timer->stop(); $timer->display();
//echo G::getMemoryUsage();
//die;
//g::pr($profiling);
G::streamFile( $sPOFile, true );
}
}
// Language
function getMatchDropdownOptionValue ($name, $options)
{
foreach ($options as $option) {

View File

@@ -2,10 +2,10 @@
/**
* LanguagePeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'LANGUAGE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class LanguagePeer extends BaseLanguagePeer {
class LanguagePeer extends BaseLanguagePeer
{
}
} // LanguagePeer

View File

@@ -2,10 +2,10 @@
/**
* Lexico.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* 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/BaseLexico.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseLexico.php';
/**
* Skeleton subclass for representing a row from the 'LEXICO' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,6 +38,7 @@ require_once 'classes/model/om/BaseLexico.php';
*
* @package workflow.engine.classes.model
*/
class Lexico extends BaseLexico {
class Lexico extends BaseLexico
{
}
} // Lexico

View File

@@ -2,10 +2,10 @@
/**
* LexicoPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'LEXICO' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class LexicoPeer extends BaseLexicoPeer {
class LexicoPeer extends BaseLexicoPeer
{
}
} // LexicoPeer

View File

@@ -10,7 +10,7 @@ require_once 'classes/model/om/BaseLogCasesScheduler.php';
/**
* Skeleton subclass for representing a row from the 'LOG_CASES_SCHEDULER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,8 +18,10 @@ require_once 'classes/model/om/BaseLogCasesScheduler.php';
*
* @package workflow.engine.classes.model
*/
class LogCasesScheduler extends BaseLogCasesScheduler {
function getAllCriteria() {
class LogCasesScheduler extends BaseLogCasesScheduler
{
public function getAllCriteria()
{
$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn(LogCasesSchedulerPeer::LOG_CASE_UID);
@@ -34,14 +36,15 @@ class LogCasesScheduler extends BaseLogCasesScheduler {
$c->addSelectColumn(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS);
return $c;
}
function getAll(){
public function getAll()
{
$oCriteria = $this->getAllCriteria();
$oDataset = LogCasesSchedulerPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRows = Array();
while( $aRow = $oDataset->getRow() ) {
while ($aRow = $oDataset->getRow() ) {
$aRows[] = $aRow;
$oDataset->next();
}
@@ -53,16 +56,19 @@ class LogCasesScheduler extends BaseLogCasesScheduler {
$aRows[$k] = array_merge($aRow, $aProcessRow, $aTaskRow);
}*/
return $aRows;
return $aRows;
}
function saveLogParameters($params){
if ( isset ( $params['LOG_CASE_UID'] ) && $params['LOG_CASE_UID']== '' )
public function saveLogParameters($params)
{
if ( isset ( $params['LOG_CASE_UID'] ) && $params['LOG_CASE_UID']== '' ) {
unset ( $params['LOG_CASE_UID'] );
if ( !isset ( $params['LOG_CASE_UID'] ) )
$params['LOG_CASE_UID'] = G::generateUniqueID();
$this->setLogCaseUid($params['LOG_CASE_UID']);
}
if ( !isset ( $params['LOG_CASE_UID'] ) ) {
$params['LOG_CASE_UID'] = G::generateUniqueID();
}
$this->setLogCaseUid($params['LOG_CASE_UID']);
$this->setProUid($params['PRO_UID']);
$this->setTasUid($params['TAS_UID']);
$this->setSchUid($params['SCH_UID']);
@@ -72,8 +78,6 @@ class LogCasesScheduler extends BaseLogCasesScheduler {
$this->setResult($params['RESULT']);
$this->setWsCreateCaseStatus($params['WS_CREATE_CASE_STATUS']);
$this->setWsRouteCaseStatus($params['WS_ROUTE_CASE_STATUS']);
}
}
} // LogCasesScheduler

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'LOG_CASES_SCHEDULER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class LogCasesSchedulerPeer extends BaseLogCasesSchedulerPeer {
class LogCasesSchedulerPeer extends BaseLogCasesSchedulerPeer
{
}
} // LogCasesSchedulerPeer

View File

@@ -20,8 +20,7 @@ require_once 'classes/model/om/BaseLoginLog.php';
*/
class LoginLog extends BaseLoginLog
{
function create ($aData)
public function create ($aData)
{
$con = Propel::getConnection( LoginLogPeer::DATABASE_NAME );
try {
@@ -79,7 +78,7 @@ class LoginLog extends BaseLoginLog
}
}
function remove ($LogUid)
public function remove ($LogUid)
{
$con = Propel::getConnection( LoginLogPeer::DATABASE_NAME );
try {
@@ -95,7 +94,7 @@ class LoginLog extends BaseLoginLog
}
//Added by Qennix
function getLastLoginByUser ($sUID)
public function getLastLoginByUser ($sUID)
{
$c = new Criteria();
$c->addSelectColumn( LoginLogPeer::LOG_INIT_DATE );
@@ -110,7 +109,7 @@ class LoginLog extends BaseLoginLog
}
//Added by Qennix
function getLastLoginAllUsers ()
public function getLastLoginAllUsers ()
{
$c = new Criteria();
$c->addSelectColumn( LoginLogPeer::USR_UID );
@@ -126,5 +125,4 @@ class LoginLog extends BaseLoginLog
return $aRows;
}
}
// LoginLog

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'LOGIN_LOG' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class LoginLogPeer extends BaseLoginLogPeer {
class LoginLogPeer extends BaseLoginLogPeer
{
}
} // LoginLogPeer

View File

@@ -20,7 +20,6 @@ require_once 'classes/model/om/BaseObjectPermission.php';
*/
class ObjectPermission extends BaseObjectPermission
{
public function load ($UID)
{
try {
@@ -38,7 +37,7 @@ class ObjectPermission extends BaseObjectPermission
}
}
function create ($aData)
public function create ($aData)
{
try {
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
@@ -49,7 +48,7 @@ class ObjectPermission extends BaseObjectPermission
}
}
function Exists ($Uid)
public function Exists ($Uid)
{
try {
$oPro = ObjectPermissionPeer::retrieveByPk( $Uid );
@@ -63,7 +62,7 @@ class ObjectPermission extends BaseObjectPermission
}
}
function remove ($Uid)
public function remove ($Uid)
{
$con = Propel::getConnection( ObjectPermissionPeer::DATABASE_NAME );
try {
@@ -82,7 +81,7 @@ class ObjectPermission extends BaseObjectPermission
}
}
function update ($aFields)
public function update ($aFields)
{
$oConnection = Propel::getConnection( ObjectPermissionPeer::DATABASE_NAME );
try {
@@ -103,7 +102,7 @@ class ObjectPermission extends BaseObjectPermission
}
}
function removeByObject ($sType, $sObjUid)
public function removeByObject ($sType, $sObjUid)
{
try {
$oCriteria = new Criteria( 'workflow' );
@@ -115,7 +114,7 @@ class ObjectPermission extends BaseObjectPermission
}
}
function loadInfo ($sObjUID)
public function loadInfo ($sObjUID)
{
$oCriteria = new Criteria( 'workflow' );
@@ -127,5 +126,4 @@ class ObjectPermission extends BaseObjectPermission
return ($aRow);
}
}
// ObjectPermission

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'OBJECT_PERMISSION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class ObjectPermissionPeer extends BaseObjectPermissionPeer {
class ObjectPermissionPeer extends BaseObjectPermissionPeer
{
}
} // ObjectPermissionPeer

View File

@@ -504,9 +504,9 @@ class OutputDocument extends BaseOutputDocument
$sPath,
$sFilename,
$sContent,
$sLandscape=false,
$sTypeDocToGener='BOTH',
$aProperties=array()
$sLandscape = false,
$sTypeDocToGener = 'BOTH',
$aProperties = array()
) {
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
$nrt = array("\n", "\r", "\t");
@@ -945,5 +945,4 @@ class OutputDocument extends BaseOutputDocument
}
}
}
// OutputDocument

View File

@@ -2,10 +2,10 @@
/**
* OutputDocumentPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'OUTPUT_DOCUMENT' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class OutputDocumentPeer extends BaseOutputDocumentPeer {
class OutputDocumentPeer extends BaseOutputDocumentPeer
{
}
} // OutputDocumentPeer

View File

@@ -150,7 +150,7 @@ class Process extends BaseProcess
* @return void
*/
function create ($aData)
public function create ($aData)
{
if (! isset( $aData['USR_UID'] )) {
throw (new PropelException( 'The process cannot be created. The USR_UID is empty.' ));
@@ -212,7 +212,6 @@ class Process extends BaseProcess
}
throw (new PropelException( 'The row cannot be created!', new PropelException( $msg ) ));
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
@@ -224,8 +223,7 @@ class Process extends BaseProcess
*
* @param string $sProUid the uid of the Prolication
*/
function processExists ($ProUid)
public function processExists ($ProUid)
{
$con = Propel::getConnection( ProcessPeer::DATABASE_NAME );
try {
@@ -246,10 +244,8 @@ class Process extends BaseProcess
* @param string $ProUid the uid of the Prolication
* @return array $Fields the fields
*/
function load ($ProUid, $getAllLang = false)
public function load ($ProUid, $getAllLang = false)
{
$con = Propel::getConnection( ProcessPeer::DATABASE_NAME );
try {
$oPro = ProcessPeer::retrieveByPk( $ProUid );
@@ -262,7 +258,6 @@ class Process extends BaseProcess
// $this->pro_title = $aFields['PRO_TITLE'];
// $this->pro_description = $aFields['PRO_DESCRIPTION'];
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$c = new Criteria();
@@ -335,9 +330,8 @@ class Process extends BaseProcess
}
}
function getAll ()
public function getAll ()
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
@@ -403,7 +397,6 @@ class Process extends BaseProcess
* @return variant
*
*/
public function update ($aData)
{
if (isset( $aData['PRO_DYNAFORMS'] ) && is_array( $aData['PRO_DYNAFORMS'] )) {
@@ -453,7 +446,6 @@ class Process extends BaseProcess
* @return variant
*
*/
public function createRow ($aData)
{
$con = Propel::getConnection( ProcessPeer::DATABASE_NAME );
@@ -577,8 +569,7 @@ class Process extends BaseProcess
return $aRow['PROCESS'] ? true : false;
}
//new functions
function getAllProcessesCount ()
public function getAllProcessesCount ()
{
$c = $this->tmpCriteria;
$c->clearSelectColumns();
@@ -594,7 +585,7 @@ class Process extends BaseProcess
}
}
function getAllProcesses ($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false)
public function getAllProcesses ($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false)
{
require_once PATH_RBAC . "model/RbacUsers.php";
require_once "classes/model/ProcessCategory.php";
@@ -753,7 +744,7 @@ class Process extends BaseProcess
return $aProcesses;
}
function getCasesCountInAllProcesses ()
public function getCasesCountInAllProcesses ()
{
/*SELECT PRO_UID, APP_STATUS, COUNT( * )
FROM APPLICATION
@@ -783,7 +774,7 @@ class Process extends BaseProcess
return $aProcesses;
}
function getAllProcessesByCategory ()
public function getAllProcessesByCategory ()
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ProcessPeer::PRO_CATEGORY );
@@ -799,7 +790,7 @@ class Process extends BaseProcess
return $aProc;
}
function getTriggerWebBotProcess ($proUid, $action)
public function getTriggerWebBotProcess ($proUid, $action)
{
require_once ("classes/model/Triggers.php");
@@ -856,12 +847,9 @@ class Process extends BaseProcess
}
}
}
//Process
function ordProcessByProTitle ($a, $b)
{
if ($a['PRO_TITLE'] > $b['PRO_TITLE']) {
return 1;
} elseif ($a['PRO_TITLE'] < $b['PRO_TITLE']) {

View File

@@ -6,11 +6,10 @@
require_once 'classes/model/om/BaseProcessCategory.php';
/**
* Skeleton subclass for representing a row from the 'PROCESS_CATEGORY' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,48 +17,42 @@ require_once 'classes/model/om/BaseProcessCategory.php';
*
* @package workflow.engine.classes.model
*/
class ProcessCategory extends BaseProcessCategory {
function getAll($type='criteria')
{
$c = new Criteria('workflow');
$c->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$c->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
if( $type == 'array' ){
$result = Array();
while ( $dataset->next() ) {
$result[] = $dataset->getRow();
}
return $result;
}
else {
return $c;
class ProcessCategory extends BaseProcessCategory
{
public function getAll ($type = 'criteria')
{
$c = new Criteria('workflow');
$c->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$c->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
if ($type == 'array') {
$result = Array();
while ( $dataset->next() ) {
$result[] = $dataset->getRow();
}
return $result;
} else {
return $c;
}
}
}
function loadByCategoryName($sCategoryName)
{
$c = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$c->clearSelectColumns();
$c->addSelectColumn( ProcessCategoryPeer::CATEGORY_UID );
$c->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME);
$c->add(ProcessCategoryPeer::CATEGORY_NAME, $sCategoryName);
$dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$dataset->next();
$aRow = $dataset->getRow();
return $aRow;
}
} // ProcessCategory
public function loadByCategoryName($sCategoryName)
{
$c = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$c->clearSelectColumns();
$c->addSelectColumn( ProcessCategoryPeer::CATEGORY_UID );
$c->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME);
$c->add(ProcessCategoryPeer::CATEGORY_NAME, $sCategoryName);
$dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$dataset->next();
$aRow = $dataset->getRow();
return $aRow;
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'PROCESS_CATEGORY' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class ProcessCategoryPeer extends BaseProcessCategoryPeer {
class ProcessCategoryPeer extends BaseProcessCategoryPeer
{
}
} // ProcessCategoryPeer

View File

@@ -2,10 +2,10 @@
/**
* ProcessOwner.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* 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/BaseProcessOwner.php';
@@ -30,7 +30,7 @@ require_once 'classes/model/om/BaseProcessOwner.php';
/**
* Skeleton subclass for representing a row from the 'PROCESS_OWNER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -38,6 +38,7 @@ require_once 'classes/model/om/BaseProcessOwner.php';
*
* @package workflow.engine.classes.model
*/
class ProcessOwner extends BaseProcessOwner {
class ProcessOwner extends BaseProcessOwner
{
}
} // ProcessOwner

View File

@@ -2,10 +2,10 @@
/**
* ProcessOwnerPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'PROCESS_OWNER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class ProcessOwnerPeer extends BaseProcessOwnerPeer {
class ProcessOwnerPeer extends BaseProcessOwnerPeer
{
}
} // ProcessOwnerPeer

View File

@@ -2,10 +2,10 @@
/**
* ProcessPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'PROCESS' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class ProcessPeer extends BaseProcessPeer {
class ProcessPeer extends BaseProcessPeer
{
}
} // ProcessPeer

View File

@@ -18,83 +18,79 @@ require_once 'classes/model/om/BaseProcessUser.php';
*
* @package workflow.engine.classes.model
*/
class ProcessUser extends BaseProcessUser {
public function create($aData)
{
$oConnection = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
try {
$criteria = new Criteria('workflow');
$criteria->add(ProcessUserPeer::PU_UID, $aData['PU_UID'] );
$criteria->add(ProcessUserPeer::PRO_UID, $aData['PRO_UID'] );
$criteria->add(ProcessUserPeer::USR_UID, $aData['USR_UID'] );
$criteria->add(ProcessUserPeer::PU_TYPE, $aData['PU_TYPE'] );
$objects = ProcessUserPeer::doSelect($criteria, $oConnection);
$oConnection->begin();
foreach($objects as $row) {
$this->remove($row->getTasUid(), $row->getUsrUid(), $row->getTuType(), $row->getTuRelation() );
}
$oConnection->commit();
class ProcessUser extends BaseProcessUser
{
public function create($aData)
{
$oConnection = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
try {
$criteria = new Criteria('workflow');
$criteria->add(ProcessUserPeer::PU_UID, $aData['PU_UID'] );
$criteria->add(ProcessUserPeer::PRO_UID, $aData['PRO_UID'] );
$criteria->add(ProcessUserPeer::USR_UID, $aData['USR_UID'] );
$criteria->add(ProcessUserPeer::PU_TYPE, $aData['PU_TYPE'] );
$objects = ProcessUserPeer::doSelect($criteria, $oConnection);
$oConnection->begin();
foreach ($objects as $row) {
$this->remove($row->getTasUid(), $row->getUsrUid(), $row->getTuType(), $row->getTuRelation() );
}
$oConnection->commit();
$oProcessUser = new ProcessUser();
$oProcessUser->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oProcessUser->validate()) {
$oConnection->begin();
$iResult = $oProcessUser->save();
$oConnection->commit();
return $iResult;
}
else {
$sMessage = '';
$aValidationFailures = $oProcessUser->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
$oProcessUser = new ProcessUser();
$oProcessUser->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oProcessUser->validate()) {
$oConnection->begin();
$iResult = $oProcessUser->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oProcessUser->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 $sPuUid
* @param string $sProUid
* @param string $sUserUid
* @return string
**/
public function remove($sPuUid)
{
$oConnection = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
try {
$oProcessUser = ProcessUserPeer::retrieveByPK($sPuUid);
if (!is_null($oProcessUser))
{
$oConnection->begin();
$iResult = $oProcessUser->delete();
$oConnection->commit();
return $iResult;
}
else {
throw(new Exception('This row doesn\'t exist!'));
}
/**
* Remove the application document registry
* @param string $sPuUid
* @param string $sProUid
* @param string $sUserUid
* @return string
**/
public function remove($sPuUid)
{
$oConnection = Propel::getConnection(ProcessUserPeer::DATABASE_NAME);
try {
$oProcessUser = ProcessUserPeer::retrieveByPK($sPuUid);
if (!is_null($oProcessUser)) {
$oConnection->begin();
$iResult = $oProcessUser->delete();
$oConnection->commit();
return $iResult;
} else {
throw(new Exception('This row doesn\'t exist!'));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
function Exists ( $sUid ) {
try {
$oObj = ProcessUserPeer::retrieveByPk($sUid);
return (is_object($oObj) && get_class($oObj) == 'ProcessUser');
public function Exists ($sUid)
{
try {
$oObj = ProcessUserPeer::retrieveByPk($sUid);
return (is_object($oObj) && get_class($oObj) == 'ProcessUser');
} catch (Exception $oError) {
throw($oError);
}
}
catch (Exception $oError) {
throw($oError);
}
}
} // ProcessUser
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'PROCESS_USER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class ProcessUserPeer extends BaseProcessUserPeer {
class ProcessUserPeer extends BaseProcessUserPeer
{
}
} // ProcessUserPeer

View File

@@ -1,227 +1,226 @@
<?php
/**
* ReportTable.php
*
* @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
* License, or (at your option) any later version.
*
* 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
* 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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/Content.php';
require_once 'classes/model/om/BaseReportTable.php';
/**
* Skeleton subclass for representing a row from the 'REPORT_TABLE' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class ReportTable extends BaseReportTable
{
/**
* This value goes in the content table
*
* @var string
*/
protected $rep_tab_title = '';
/**
* Get the rep_tab_title column value.
*
* @return string
*/
public function getRepTabTitle ()
{
if ($this->getRepTabUid() == "") {
throw (new Exception( "Error in getRepTabTitle, the getRepTabUid() can't be blank" ));
}
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$this->rep_tab_title = Content::load( 'REP_TAB_TITLE', '', $this->getRepTabUid(), $lang );
return $this->rep_tab_title;
}
/**
* Set the rep_tab_title column value.
*
* @param string $v new value
* @return void
*/
public function setRepTabTitle ($v)
{
if ($this->getRepTabUid() == "") {
throw (new Exception( "Error in setRepTabTitle, the setRepTabUid() can't be blank" ));
}
$v = isset( $v ) ? ((string) $v) : '';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
if ($this->rep_tab_title !== $v || $v === "") {
$this->rep_tab_title = $v;
$res = Content::addContent( 'REP_TAB_TITLE', '', $this->getRepTabUid(), $lang, $this->rep_tab_title );
return $res;
}
return 0;
}
public function load ($RepTabUid)
{
try {
$oRow = ReportTablePeer::retrieveByPK( $RepTabUid );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
$this->setRepTabTitle( $aFields['REP_TAB_TITLE'] = $this->getRepTabTitle() );
return $aFields;
} else {
<?php
/**
* ReportTable.php
*
* @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
* License, or (at your option) any later version.
*
* 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
* 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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/Content.php';
require_once 'classes/model/om/BaseReportTable.php';
/**
* Skeleton subclass for representing a row from the 'REPORT_TABLE' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class ReportTable extends BaseReportTable
{
/**
* This value goes in the content table
*
* @var string
*/
protected $rep_tab_title = '';
/**
* Get the rep_tab_title column value.
*
* @return string
*/
public function getRepTabTitle ()
{
if ($this->getRepTabUid() == "") {
throw (new Exception( "Error in getRepTabTitle, the getRepTabUid() can't be blank" ));
}
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$this->rep_tab_title = Content::load( 'REP_TAB_TITLE', '', $this->getRepTabUid(), $lang );
return $this->rep_tab_title;
}
/**
* Set the rep_tab_title column value.
*
* @param string $v new value
* @return void
*/
public function setRepTabTitle ($v)
{
if ($this->getRepTabUid() == "") {
throw (new Exception( "Error in setRepTabTitle, the setRepTabUid() can't be blank" ));
}
$v = isset( $v ) ? ((string) $v) : '';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
if ($this->rep_tab_title !== $v || $v === "") {
$this->rep_tab_title = $v;
$res = Content::addContent( 'REP_TAB_TITLE', '', $this->getRepTabUid(), $lang, $this->rep_tab_title );
return $res;
}
return 0;
}
public function load ($RepTabUid)
{
try {
$oRow = ReportTablePeer::retrieveByPK( $RepTabUid );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
$this->setRepTabTitle( $aFields['REP_TAB_TITLE'] = $this->getRepTabTitle() );
return $aFields;
} else {
//throw( new Exception( "The row '$RepTabUid' in table ReportTable doesn't exist!" ));
return array ();
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function create ($aData)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$con->begin();
if (isset( $aData['REP_TAB_UID'] ) && $aData['REP_TAB_UID'] == '') {
unset( $aData['REP_TAB_UID'] );
}
if (! isset( $aData['REP_TAB_UID'] )) {
$this->setRepTabUid( G::generateUniqueID() );
} else {
$this->setRepTabUid( $aData['REP_TAB_UID'] );
}
$this->setProUid( $aData['PRO_UID'] );
$this->setRepTabName( $aData['REP_TAB_NAME'] );
$this->setRepTabType( $aData['REP_TAB_TYPE'] );
if (! isset( $aData['REP_TAB_GRID'] )) {
$this->setRepTabGrid( "" );
} else {
$this->setRepTabGrid( $aData['REP_TAB_GRID'] );
}
if (! isset( $aData['REP_TAB_CONNECTION'] )) {
$this->setRepTabConnection( "report" );
} else {
$this->setRepTabConnection( $aData['REP_TAB_CONNECTION'] );
}
$this->setRepTabCreateDate( date( 'Y-m-d H:i:s' ) );
$this->setRepTabStatus( 'ACTIVE' );
if ($this->validate()) {
if (! isset( $aData['REP_TAB_TITLE'] )) {
$this->setRepTabTitle( "" );
} else {
$this->setRepTabTitle( $aData['REP_TAB_TITLE'] );
}
$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);
}
}
public function update ($fields)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['REP_TAB_UID'] );
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
if (G::LoadSystemExist( $sDataBase )) {
G::LoadSystem( $sDataBase );
$oDataBase = new database();
$oValidate = $oDataBase->getValidate( $this->validate() );
} else {
$oValidate = $this->validate();
}
return array ();
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function create ($aData)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$con->begin();
if (isset( $aData['REP_TAB_UID'] ) && $aData['REP_TAB_UID'] == '') {
unset( $aData['REP_TAB_UID'] );
}
if (! isset( $aData['REP_TAB_UID'] )) {
$this->setRepTabUid( G::generateUniqueID() );
} else {
$this->setRepTabUid( $aData['REP_TAB_UID'] );
}
$this->setProUid( $aData['PRO_UID'] );
$this->setRepTabName( $aData['REP_TAB_NAME'] );
$this->setRepTabType( $aData['REP_TAB_TYPE'] );
if (! isset( $aData['REP_TAB_GRID'] )) {
$this->setRepTabGrid( "" );
} else {
$this->setRepTabGrid( $aData['REP_TAB_GRID'] );
}
if (! isset( $aData['REP_TAB_CONNECTION'] )) {
$this->setRepTabConnection( "report" );
} else {
$this->setRepTabConnection( $aData['REP_TAB_CONNECTION'] );
}
$this->setRepTabCreateDate( date( 'Y-m-d H:i:s' ) );
$this->setRepTabStatus( 'ACTIVE' );
if ($this->validate()) {
if (! isset( $aData['REP_TAB_TITLE'] )) {
$this->setRepTabTitle( "" );
} else {
$this->setRepTabTitle( $aData['REP_TAB_TITLE'] );
}
$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);
}
}
public function update ($fields)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['REP_TAB_UID'] );
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
$sDataBase = 'database_' . strtolower( DB_ADAPTER );
if (G::LoadSystemExist( $sDataBase )) {
G::LoadSystem( $sDataBase );
$oDataBase = new database();
$oValidate = $oDataBase->getValidate( $this->validate() );
} else {
$oValidate = $this->validate();
}
// if($this->validate())
if ($oValidate) {
$contentResult = 0;
if (array_key_exists( "REP_TAB_TITLE", $fields )) {
$contentResult += $this->setRepTabTitle( $fields["REP_TAB_TITLE"] );
}
$result = $this->save();
$result = ($result == 0) ? ($contentResult > 0 ? 1 : 0) : $result;
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$validationE->aValidationFailures = $this->getValidationFailures();
throw ($validationE);
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function remove ($RepTabUid)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$con->begin();
$oRepTab = ReportTablePeer::retrieveByPK( $RepTabUid );
if (! is_null( $oRepTab )) {
Content::removeContent( 'REP_TAB_TITLE', '', $this->getRepTabUid() );
$result = $oRepTab->delete();
$con->commit();
}
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function reportTableExists ($RepTabUid)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$oRepTabUid = ReportTablePeer::retrieveByPk( $RepTabUid );
if (is_object( $oRepTabUid ) && get_class( $oRepTabUid ) == 'ReportTable') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
}
// ReportTable
if ($oValidate) {
$contentResult = 0;
if (array_key_exists( "REP_TAB_TITLE", $fields )) {
$contentResult += $this->setRepTabTitle( $fields["REP_TAB_TITLE"] );
}
$result = $this->save();
$result = ($result == 0) ? ($contentResult > 0 ? 1 : 0) : $result;
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$validationE->aValidationFailures = $this->getValidationFailures();
throw ($validationE);
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function remove ($RepTabUid)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$con->begin();
$oRepTab = ReportTablePeer::retrieveByPK( $RepTabUid );
if (! is_null( $oRepTab )) {
Content::removeContent( 'REP_TAB_TITLE', '', $this->getRepTabUid() );
$result = $oRepTab->delete();
$con->commit();
}
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function reportTableExists ($RepTabUid)
{
$con = Propel::getConnection( ReportTablePeer::DATABASE_NAME );
try {
$oRepTabUid = ReportTablePeer::retrieveByPk( $RepTabUid );
if (is_object( $oRepTabUid ) && get_class( $oRepTabUid ) == 'ReportTable') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'REPORT_TABLE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class ReportTablePeer extends BaseReportTablePeer {
class ReportTablePeer extends BaseReportTablePeer
{
}
} // ReportTablePeer

View File

@@ -1,160 +1,159 @@
<?php
/**
* ReportVar.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseReportVar.php';
/**
* Skeleton subclass for representing a row from the 'REPORT_VAR' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class ReportVar extends BaseReportVar
{
<?php
/**
* ReportVar.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseReportVar.php';
/**
* Skeleton subclass for representing a row from the 'REPORT_VAR' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class ReportVar extends BaseReportVar
{
/*
* Load the report var registry
* @param string $sRepVarUid
* @return variant
*/
public function load ($sRepVarUid)
{
try {
$oReportVar = ReportVarPeer::retrieveByPK( $sRepVarUid );
if (! is_null( $oReportVar )) {
$aFields = $oReportVar->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);
}
}
/**
* Create the report var registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
if (isset( $aData['REP_VAR_UID'] ) && $aData['REP_VAR_UID'] == '') {
unset( $aData['REP_VAR_UID'] );
}
if (! isset( $aData['REP_VAR_UID'] )) {
$aData['REP_VAR_UID'] = G::generateUniqueID();
}
$oReportVar = new ReportVar();
$oReportVar->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oReportVar->validate()) {
$oConnection->begin();
$iResult = $oReportVar->save();
$oConnection->commit();
return $aData['REP_VAR_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oReportVar->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);
}
}
/**
* Update the report var registry
*
* @param array $aData
* @return string
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
$oReportVar = ReportVarPeer::retrieveByPK( $aData['REP_VAR_UID'] );
if (! is_null( $oReportVar )) {
$oReportVar->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oReportVar->validate()) {
$oConnection->begin();
$iResult = $oReportVar->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oReportVar->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);
}
}
/**
* Remove the report var registry
*
* @param array $aData
* @return string
*
*/
public function remove ($sRepVarUid)
{
$oConnection = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
$oReportVar = ReportVarPeer::retrieveByPK( $sRepVarUid );
if (! is_null( $oReportVar )) {
$oConnection->begin();
$iResult = $oReportVar->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public function reportVarExists ($sRepVarUid)
{
$con = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
$oRepVarUid = ReportVarPeer::retrieveByPk( $sRepVarUid );
if (is_object( $oRepVarUid ) && get_class( $oRepVarUid ) == 'ReportVar') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
}
// ReportVar
* Load the report var registry
* @param string $sRepVarUid
* @return variant
*/
public function load ($sRepVarUid)
{
try {
$oReportVar = ReportVarPeer::retrieveByPK( $sRepVarUid );
if (! is_null( $oReportVar )) {
$aFields = $oReportVar->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);
}
}
/**
* Create the report var registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
if (isset( $aData['REP_VAR_UID'] ) && $aData['REP_VAR_UID'] == '') {
unset( $aData['REP_VAR_UID'] );
}
if (! isset( $aData['REP_VAR_UID'] )) {
$aData['REP_VAR_UID'] = G::generateUniqueID();
}
$oReportVar = new ReportVar();
$oReportVar->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oReportVar->validate()) {
$oConnection->begin();
$iResult = $oReportVar->save();
$oConnection->commit();
return $aData['REP_VAR_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oReportVar->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);
}
}
/**
* Update the report var registry
*
* @param array $aData
* @return string
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
$oReportVar = ReportVarPeer::retrieveByPK( $aData['REP_VAR_UID'] );
if (! is_null( $oReportVar )) {
$oReportVar->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oReportVar->validate()) {
$oConnection->begin();
$iResult = $oReportVar->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oReportVar->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);
}
}
/**
* Remove the report var registry
*
* @param array $aData
* @return string
*
*/
public function remove ($sRepVarUid)
{
$oConnection = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
$oReportVar = ReportVarPeer::retrieveByPK( $sRepVarUid );
if (! is_null( $oReportVar )) {
$oConnection->begin();
$iResult = $oReportVar->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public function reportVarExists ($sRepVarUid)
{
$con = Propel::getConnection( ReportVarPeer::DATABASE_NAME );
try {
$oRepVarUid = ReportVarPeer::retrieveByPk( $sRepVarUid );
if (is_object( $oRepVarUid ) && get_class( $oRepVarUid ) == 'ReportVar') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'REPORT_VAR' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class ReportVarPeer extends BaseReportVarPeer {
class ReportVarPeer extends BaseReportVarPeer
{
}
} // ReportVarPeer

View File

@@ -1,217 +1,217 @@
<?php
/**
* Route.php
*
* @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
* License, or (at your option) any later version.
*
* 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
* 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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/om/BaseRoute.php';
require_once 'classes/model/Content.php';
/**
* Skeleton subclass for representing a row from the 'ROUTE' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class Route extends BaseRoute
{
<?php
/**
* Route.php
*
* @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
* License, or (at your option) any later version.
*
* 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
* 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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/om/BaseRoute.php';
require_once 'classes/model/Content.php';
/**
* Skeleton subclass for representing a row from the 'ROUTE' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class Route extends BaseRoute
{
/*
* Load the application document registry
* @param string $sRouUid
* @return variant
*/
public function load ($sRouUid)
{
try {
$oRoute = RoutePeer::retrieveByPK( $sRouUid );
if (! is_null( $oRoute )) {
$aFields = $oRoute->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);
}
}
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$sRouteUID = G::generateUniqueID();
$aData['ROU_UID'] = $sRouteUID;
$oRoute = new Route();
* Load the application document registry
* @param string $sRouUid
* @return variant
*/
public function load ($sRouUid)
{
try {
$oRoute = RoutePeer::retrieveByPK( $sRouUid );
if (! is_null( $oRoute )) {
$aFields = $oRoute->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);
}
}
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$sRouteUID = G::generateUniqueID();
$aData['ROU_UID'] = $sRouteUID;
$oRoute = new Route();
// validating default values
$aData['ROU_TO_LAST_USER'] = $this->validateValue( isset( $aData['ROU_TO_LAST_USER'] ) ? $aData['ROU_TO_LAST_USER'] : '', array ('TRUE','FALSE'
), 'FALSE' );
$aData['ROU_OPTIONAL'] = $this->validateValue( isset( $aData['ROU_OPTIONAL'] ) ? $aData['ROU_OPTIONAL'] : '', array ('TRUE','FALSE'
), 'FALSE' );
$aData['ROU_SEND_EMAIL'] = $this->validateValue( isset( $aData['ROU_SEND_EMAIL'] ) ? $aData['ROU_SEND_EMAIL'] : '', array ('TRUE','FALSE'
), 'TRUE' );
$oRoute->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oRoute->validate()) {
$oConnection->begin();
$iResult = $oRoute->save();
$oConnection->commit();
return $sRouteUID;
} else {
$sMessage = '';
$aValidationFailures = $oRoute->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);
}
}
/**
* Update the application document registry
*
* @param array $aData
* @return string
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$oRoute = RoutePeer::retrieveByPK( $aData['ROU_UID'] );
if (! is_null( $oRoute )) {
$aData['ROU_TO_LAST_USER'] = $this->validateValue( isset( $aData['ROU_TO_LAST_USER'] ) ? $aData['ROU_TO_LAST_USER'] : '', array ('TRUE','FALSE'
), 'FALSE' );
$aData['ROU_OPTIONAL'] = $this->validateValue( isset( $aData['ROU_OPTIONAL'] ) ? $aData['ROU_OPTIONAL'] : '', array ('TRUE','FALSE'
), 'FALSE' );
$aData['ROU_SEND_EMAIL'] = $this->validateValue( isset( $aData['ROU_SEND_EMAIL'] ) ? $aData['ROU_SEND_EMAIL'] : '', array ('TRUE','FALSE'
), 'TRUE' );
$oRoute->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oRoute->validate()) {
$oConnection->begin();
$iResult = $oRoute->save();
$oConnection->commit();
return $sRouteUID;
} else {
$sMessage = '';
$aValidationFailures = $oRoute->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);
}
}
/**
* Update the application document registry
*
* @param array $aData
* @return string
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$oRoute = RoutePeer::retrieveByPK( $aData['ROU_UID'] );
if (! is_null( $oRoute )) {
// validating default values
if (isset( $aData['ROU_TO_LAST_USER'] )) {
$aData['ROU_TO_LAST_USER'] = $this->validateValue( $aData['ROU_TO_LAST_USER'], array ('TRUE','FALSE'
), 'FALSE' );
}
if (isset( $aData['ROU_OPTIONAL'] )) {
$aData['ROU_OPTIONAL'] = $this->validateValue( $aData['ROU_OPTIONAL'], array ('TRUE','FALSE'
), 'FALSE' );
}
if (isset( $aData['ROU_SEND_EMAIL'] )) {
$aData['ROU_SEND_EMAIL'] = $this->validateValue( $aData['ROU_SEND_EMAIL'], array ('TRUE','FALSE'
), 'TRUE' );
}
$oRoute->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oRoute->validate()) {
$oConnection->begin();
$iResult = $oRoute->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oRoute->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw (new Exception( 'The ROUTE tables cannot be updated!<br />' . $sMessage ));
}
} else {
throw (new Exception( "The row " . $aData['ROU_UID'] . " doesn't exist!" ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
/**
* Remove the application document registry
*
* @param array $aData
* @return string
*
*/
public function remove ($sRouUid)
{
$oConnection = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$oRoute = RoutePeer::retrieveByPK( $sRouUid );
if (! is_null( $oRoute )) {
$oConnection->begin();
$iResult = $oRoute->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public function routeExists ($sRouUid)
{
$con = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$oRouUid = RoutePeer::retrieveByPk( $sRouUid );
if (is_object( $oRouUid ) && get_class( $oRouUid ) == 'Route') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Validate value for a variable that only accepts some determinated values
*
* @param $value string - value to test
* @param $validValues array - list of valid values
* @param $default string default value, if the tested value is not valid the default value is returned
* @return the tested and accepted value
*/
public function validateValue ($value, $validValues, $default)
{
if (! in_array( $value, $validValues )) {
$value = $default;
}
return $value;
}
}
// Route
if (isset( $aData['ROU_TO_LAST_USER'] )) {
$aData['ROU_TO_LAST_USER'] = $this->validateValue( $aData['ROU_TO_LAST_USER'], array ('TRUE','FALSE'
), 'FALSE' );
}
if (isset( $aData['ROU_OPTIONAL'] )) {
$aData['ROU_OPTIONAL'] = $this->validateValue( $aData['ROU_OPTIONAL'], array ('TRUE','FALSE'
), 'FALSE' );
}
if (isset( $aData['ROU_SEND_EMAIL'] )) {
$aData['ROU_SEND_EMAIL'] = $this->validateValue( $aData['ROU_SEND_EMAIL'], array ('TRUE','FALSE'
), 'TRUE' );
}
$oRoute->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oRoute->validate()) {
$oConnection->begin();
$iResult = $oRoute->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oRoute->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw (new Exception( 'The ROUTE tables cannot be updated!<br />' . $sMessage ));
}
} else {
throw (new Exception( "The row " . $aData['ROU_UID'] . " doesn't exist!" ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
/**
* Remove the application document registry
*
* @param array $aData
* @return string
*
*/
public function remove ($sRouUid)
{
$oConnection = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$oRoute = RoutePeer::retrieveByPK( $sRouUid );
if (! is_null( $oRoute )) {
$oConnection->begin();
$iResult = $oRoute->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public function routeExists ($sRouUid)
{
$con = Propel::getConnection( RoutePeer::DATABASE_NAME );
try {
$oRouUid = RoutePeer::retrieveByPk( $sRouUid );
if (is_object( $oRouUid ) && get_class( $oRouUid ) == 'Route') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Validate value for a variable that only accepts some determinated values
*
* @param $value string - value to test
* @param $validValues array - list of valid values
* @param $default string default value, if the tested value is not valid the default value is returned
* @return the tested and accepted value
*/
public function validateValue ($value, $validValues, $default)
{
if (! in_array( $value, $validValues )) {
$value = $default;
}
return $value;
}
}

View File

@@ -2,10 +2,10 @@
/**
* RoutePeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'ROUTE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class RoutePeer extends BaseRoutePeer {
class RoutePeer extends BaseRoutePeer
{
}
} // RoutePeer

View File

@@ -10,7 +10,7 @@ require_once 'classes/model/om/BaseSession.php';
/**
* Skeleton subclass for representing a row from the 'SESSION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -18,6 +18,7 @@ require_once 'classes/model/om/BaseSession.php';
*
* @package workflow.engine.classes.model
*/
class Session extends BaseSession {
class Session extends BaseSession
{
}
} // Session

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'SESSION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class SessionPeer extends BaseSessionPeer {
class SessionPeer extends BaseSessionPeer
{
}
} // SessionPeer

View File

@@ -18,74 +18,72 @@ require_once 'classes/model/om/BaseShadowTable.php';
*
* @package workflow.engine.classes.model
*/
class ShadowTable extends BaseShadowTable {
function load($sUID) {
try {
$oShadowTable = ShadowTablePeer::retrieveByPK($sUID);
if (!is_null($oShadowTable)) {
$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['SHD_UID'])) {
$aData['SHD_UID'] = G::generateUniqueID();
}
else {
if ($aData['SHD_UID'] == '') {
$aData['SHD_UID'] = G::generateUniqueID();
}
}
$oConnection = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
try {
$oShadowTable = new ShadowTable();
$oShadowTable->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oShadowTable->validate()) {
$oConnection->begin();
$iResult = $oShadowTable->save();
$oConnection->commit();
return $aData['SHD_UID'];
}
else {
$sMessage = '';
$aValidationFailures = $oShadowTable->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
class ShadowTable extends BaseShadowTable
{
public function load($sUID)
{
try {
$oShadowTable = ShadowTablePeer::retrieveByPK($sUID);
if (!is_null($oShadowTable)) {
$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 remove($sUID) {
$oConnection = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
try {
$oShadowTable = ShadowTablePeer::retrieveByPK($sUID);
if (!is_null($oShadowTable)) {
$oConnection->begin();
$iResult = $oShadowTable->delete();
$oConnection->commit();
return $iResult;
}
else {
throw(new Exception('This row doesn\'t exist!'));
}
public function create($aData)
{
if (!isset($aData['SHD_UID'])) {
$aData['SHD_UID'] = G::generateUniqueID();
} else {
if ($aData['SHD_UID'] == '') {
$aData['SHD_UID'] = G::generateUniqueID();
}
}
$oConnection = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
try {
$oShadowTable = new ShadowTable();
$oShadowTable->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oShadowTable->validate()) {
$oConnection->begin();
$iResult = $oShadowTable->save();
$oConnection->commit();
return $aData['SHD_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oShadowTable->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);
}
}
catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
public function remove($sUID)
{
$oConnection = Propel::getConnection(ShadowTablePeer::DATABASE_NAME);
try {
$oShadowTable = ShadowTablePeer::retrieveByPK($sUID);
if (!is_null($oShadowTable)) {
$oConnection->begin();
$iResult = $oShadowTable->delete();
$oConnection->commit();
return $iResult;
} else {
throw(new Exception('This row doesn\'t exist!'));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
}
}
}
} // ShadowTable
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'SHADOW_TABLE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class ShadowTablePeer extends BaseShadowTablePeer {
class ShadowTablePeer extends BaseShadowTablePeer
{
}
} // ShadowTablePeer

View File

@@ -1,193 +1,192 @@
<?php
/**
* Stage.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/Content.php';
require_once 'classes/model/om/BaseStage.php';
/**
* Skeleton subclass for representing a row from the 'STAGE' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class Stage extends BaseStage
{
/**
* This value goes in the content table
*
* @var string
*/
protected $stg_title = '';
/**
* Get the stg_title column value.
*
* @return string
*/
public function getStgTitle ()
{
if ($this->getStgUid() == "") {
throw (new Exception( "Error in getStgTitle, the getStgUid() can't be blank" ));
}
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$this->stg_title = Content::load( 'STG_TITLE', '', $this->getStgUid(), $lang );
return $this->stg_title;
}
/**
* Set the stg_title column value.
*
* @param string $v new value
* @return void
*/
public function setStgTitle ($v)
{
if ($this->getStgUid() == "") {
throw (new Exception( "Error in setStgTitle, the setStgUid() can't be blank" ));
}
$v = isset( $v ) ? ((string) $v) : '';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
if ($this->stg_title !== $v || $v === "") {
$this->stg_title = $v;
$res = Content::addContent( 'STG_TITLE', '', $this->getStgUid(), $lang, $this->stg_title );
return $res;
}
return 0;
}
public function load ($StgUid)
{
try {
$oRow = StagePeer::retrieveByPK( $StgUid );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
$this->setStgTitle( $aFields['STG_TITLE'] = $this->getStgTitle() );
return $aFields;
} else {
throw (new Exception( "The row '$StgUid' in table Stage doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function create ($aData)
{
$oConnection = Propel::getConnection( StagePeer::DATABASE_NAME );
try {
if (isset( $aData['STG_UID'] ) && $aData['STG_UID'] == '') {
unset( $aData['STG_UID'] );
}
if (! isset( $aData['STG_UID'] )) {
$aData['STG_UID'] = G::generateUniqueID();
}
$oStage = new Stage();
$oStage->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$oStage->setStgTitle( $aData['STG_TITLE'] );
if ($oStage->validate()) {
$oConnection->begin();
$iResult = $oStage->save();
$oConnection->commit();
return $aData['STG_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oStage->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);
}
}
public function update ($fields)
{
$con = Propel::getConnection( StagePeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['STG_UID'] );
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$contentResult = 0;
if (array_key_exists( "STG_TITLE", $fields )) {
$contentResult += $this->setStgTitle( $fields["STG_TITLE"] );
}
$result = $this->save();
$result = ($result == 0) ? ($contentResult > 0 ? 1 : 0) : $result;
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$validationE->aValidationFailures = $this->getValidationFailures();
throw ($validationE);
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function remove ($StgUid)
{
$con = Propel::getConnection( StagePeer::DATABASE_NAME );
try {
$con->begin();
$oStage = StagePeer::retrieveByPK( $StgUid );
if (! is_null( $oStage )) {
Content::removeContent( 'STG_TITLE', '', $this->getStgUid() );
$result = $oStage->delete();
$con->commit();
}
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function reorderPositions ($sProcessUID, $iIndex)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StagePeer::PRO_UID, $sProcessUID );
$oCriteria->add( StagePeer::STG_INDEX, $iIndex, '>' );
$oDataset = StagePeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$this->update( array ('STG_UID' => $aRow['STG_UID'],'PRO_UID' => $aRow['PRO_UID'],'STG_POSX' => $aRow['STG_POSX'],'STG_POSY' => $aRow['STG_POSY'],'STG_INDEX' => $aRow['STG_INDEX'] - 1
) );
$oDataset->next();
}
} catch (Exception $oException) {
throw $Exception;
}
}
public function Exists ($sUid)
{
try {
$oObj = StagePeer::retrieveByPk( $sUid );
return (is_object( $oObj ) && get_class( $oObj ) == 'Stage');
} catch (Exception $oError) {
throw ($oError);
}
}
}
// Stage
<?php
/**
* Stage.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/Content.php';
require_once 'classes/model/om/BaseStage.php';
/**
* Skeleton subclass for representing a row from the 'STAGE' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class Stage extends BaseStage
{
/**
* This value goes in the content table
*
* @var string
*/
protected $stg_title = '';
/**
* Get the stg_title column value.
*
* @return string
*/
public function getStgTitle ()
{
if ($this->getStgUid() == "") {
throw (new Exception( "Error in getStgTitle, the getStgUid() can't be blank" ));
}
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$this->stg_title = Content::load( 'STG_TITLE', '', $this->getStgUid(), $lang );
return $this->stg_title;
}
/**
* Set the stg_title column value.
*
* @param string $v new value
* @return void
*/
public function setStgTitle ($v)
{
if ($this->getStgUid() == "") {
throw (new Exception( "Error in setStgTitle, the setStgUid() can't be blank" ));
}
$v = isset( $v ) ? ((string) $v) : '';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
if ($this->stg_title !== $v || $v === "") {
$this->stg_title = $v;
$res = Content::addContent( 'STG_TITLE', '', $this->getStgUid(), $lang, $this->stg_title );
return $res;
}
return 0;
}
public function load ($StgUid)
{
try {
$oRow = StagePeer::retrieveByPK( $StgUid );
if (! is_null( $oRow )) {
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
$this->setNew( false );
$this->setStgTitle( $aFields['STG_TITLE'] = $this->getStgTitle() );
return $aFields;
} else {
throw (new Exception( "The row '$StgUid' in table Stage doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function create ($aData)
{
$oConnection = Propel::getConnection( StagePeer::DATABASE_NAME );
try {
if (isset( $aData['STG_UID'] ) && $aData['STG_UID'] == '') {
unset( $aData['STG_UID'] );
}
if (! isset( $aData['STG_UID'] )) {
$aData['STG_UID'] = G::generateUniqueID();
}
$oStage = new Stage();
$oStage->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$oStage->setStgTitle( $aData['STG_TITLE'] );
if ($oStage->validate()) {
$oConnection->begin();
$iResult = $oStage->save();
$oConnection->commit();
return $aData['STG_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oStage->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);
}
}
public function update ($fields)
{
$con = Propel::getConnection( StagePeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['STG_UID'] );
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$contentResult = 0;
if (array_key_exists( "STG_TITLE", $fields )) {
$contentResult += $this->setStgTitle( $fields["STG_TITLE"] );
}
$result = $this->save();
$result = ($result == 0) ? ($contentResult > 0 ? 1 : 0) : $result;
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$validationE->aValidationFailures = $this->getValidationFailures();
throw ($validationE);
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function remove ($StgUid)
{
$con = Propel::getConnection( StagePeer::DATABASE_NAME );
try {
$con->begin();
$oStage = StagePeer::retrieveByPK( $StgUid );
if (! is_null( $oStage )) {
Content::removeContent( 'STG_TITLE', '', $this->getStgUid() );
$result = $oStage->delete();
$con->commit();
}
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function reorderPositions ($sProcessUID, $iIndex)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StagePeer::PRO_UID, $sProcessUID );
$oCriteria->add( StagePeer::STG_INDEX, $iIndex, '>' );
$oDataset = StagePeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$this->update( array ('STG_UID' => $aRow['STG_UID'],'PRO_UID' => $aRow['PRO_UID'],'STG_POSX' => $aRow['STG_POSX'],'STG_POSY' => $aRow['STG_POSY'],'STG_INDEX' => $aRow['STG_INDEX'] - 1
) );
$oDataset->next();
}
} catch (Exception $oException) {
throw $Exception;
}
}
public function Exists ($sUid)
{
try {
$oObj = StagePeer::retrieveByPk( $sUid );
return (is_object( $oObj ) && get_class( $oObj ) == 'Stage');
} catch (Exception $oError) {
throw ($oError);
}
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'STAGE' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class StagePeer extends BaseStagePeer {
class StagePeer extends BaseStagePeer
{
}
} // StagePeer

File diff suppressed because it is too large Load Diff

View File

@@ -2,10 +2,10 @@
/**
* StepPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'STEP' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class StepPeer extends BaseStepPeer {
class StepPeer extends BaseStepPeer
{
}
} // StepPeer

View File

@@ -1,229 +1,228 @@
<?php
/**
* StepSupervisor.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseStepSupervisor.php';
/**
* Skeleton subclass for representing a row from the 'STEP_SUPERVISOR' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class StepSupervisor extends BaseStepSupervisor
{
public function load ($Uid)
{
try {
$oRow = StepSupervisorPeer::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 '$Uid' in table StepSupervisor doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function Exists ($Uid)
{
try {
$oPro = StepSupervisorPeer::retrieveByPk( $Uid );
if (is_object( $oPro ) && get_class( $oPro ) == 'StepSupervisor') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Create the step supervisor registry
*
* @param array $aData
* @return boolean
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( StepSupervisorPeer::DATABASE_NAME );
try {
if (isset( $aData['STEP_UID'] ) && $aData['STEP_UID'] == '') {
unset( $aData['STEP_UID'] );
}
if (! isset( $aData['STEP_UID'] )) {
$aData['STEP_UID'] = G::generateUniqueID();
}
$oStepSupervisor = new StepSupervisor();
$oStepSupervisor->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oStepSupervisor->validate()) {
$oConnection->begin();
$iResult = $oStepSupervisor->save();
$oConnection->commit();
return true;
} else {
$sMessage = '';
$aValidationFailures = $oStepSupervisor->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);
}
}
/**
* Update the step supervisor registry
*
* @param array $aData
* @return integer
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( StepSupervisorPeer::DATABASE_NAME );
try {
$oStepSupervisor = StepSupervisorPeer::retrieveByPK( $aData['STEP_UID'] );
if (! is_null( $oStepSupervisor )) {
$oStepSupervisor->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oStepSupervisor->validate()) {
$oConnection->begin();
$iResult = $oStepSupervisor->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oStepSupervisor->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);
}
}
/**
* Remove the step supervisor registry
*
* @param string $sStepUID
* @return integer
*
*/
public function remove ($sStepUID)
{
$oConnection = Propel::getConnection( StepSupervisorPeer::DATABASE_NAME );
try {
$oConnection->begin();
$this->setStepUid( $sStepUID );
$iResult = $this->delete();
$oConnection->commit();
return $iResult;
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
/**
* Get the next position for a atep
*
* @param string $sProcessUID
* @return integer
*
*/
public function getNextPosition ($sProcessUID, $sType)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS POSITION' );
$oCriteria->add( StepSupervisorPeer::PRO_UID, $sProcessUID );
$oCriteria->add( StepSupervisorPeer::STEP_TYPE_OBJ, $sType );
$oDataset = StepSupervisorPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
return (int) $aRow['POSITION'];
} catch (Exception $oException) {
throw $Exception;
}
}
/**
* Reorder the steps positions
*
* @param string $sProcessUID
* @param string $iPosition
*
*/
public function reorderPositions ($sProcessUID, $iPosition, $sType)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepSupervisorPeer::PRO_UID, $sProcessUID );
$oCriteria->add( StepSupervisorPeer::STEP_TYPE_OBJ, $sType );
$oCriteria->add( StepSupervisorPeer::STEP_POSITION, $iPosition, '>' );
$oDataset = StepSupervisorPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
var_dump( StepSupervisorPeer::doCount( $oCriteria ) );
while ($aRow = $oDataset->getRow()) {
var_dump( $aRow );
echo "\n";
$this->update( array ('STEP_UID' => $aRow['STEP_UID'],'PRO_UID' => $aRow['PRO_UID'],'STEP_TYPE_OBJ' => $aRow['STEP_TYPE_OBJ'],'STEP_UID_OBJ' => $aRow['STEP_UID_OBJ'],'STEP_POSITION' => $aRow['STEP_POSITION'] - 1
) );
$oDataset->next();
}
} catch (Exception $oException) {
throw $Exception;
}
}
public function removeByObject ($sType, $sObjUid)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepSupervisorPeer::STEP_TYPE_OBJ, $sType );
$oCriteria->add( StepSupervisorPeer::STEP_UID_OBJ, $sObjUid );
StepSupervisorPeer::doDelete( $oCriteria );
} catch (Exception $e) {
throw ($e);
}
}
public function loadInfo ($sObjUID)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepSupervisorPeer::STEP_UID_OBJ, $sObjUID );
$oDataset = StepSupervisorPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
return ($aRow);
}
}
// StepSupervisor
<?php
/**
* StepSupervisor.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseStepSupervisor.php';
/**
* Skeleton subclass for representing a row from the 'STEP_SUPERVISOR' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class StepSupervisor extends BaseStepSupervisor
{
public function load ($Uid)
{
try {
$oRow = StepSupervisorPeer::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 '$Uid' in table StepSupervisor doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function Exists ($Uid)
{
try {
$oPro = StepSupervisorPeer::retrieveByPk( $Uid );
if (is_object( $oPro ) && get_class( $oPro ) == 'StepSupervisor') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Create the step supervisor registry
*
* @param array $aData
* @return boolean
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( StepSupervisorPeer::DATABASE_NAME );
try {
if (isset( $aData['STEP_UID'] ) && $aData['STEP_UID'] == '') {
unset( $aData['STEP_UID'] );
}
if (! isset( $aData['STEP_UID'] )) {
$aData['STEP_UID'] = G::generateUniqueID();
}
$oStepSupervisor = new StepSupervisor();
$oStepSupervisor->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oStepSupervisor->validate()) {
$oConnection->begin();
$iResult = $oStepSupervisor->save();
$oConnection->commit();
return true;
} else {
$sMessage = '';
$aValidationFailures = $oStepSupervisor->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);
}
}
/**
* Update the step supervisor registry
*
* @param array $aData
* @return integer
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( StepSupervisorPeer::DATABASE_NAME );
try {
$oStepSupervisor = StepSupervisorPeer::retrieveByPK( $aData['STEP_UID'] );
if (! is_null( $oStepSupervisor )) {
$oStepSupervisor->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oStepSupervisor->validate()) {
$oConnection->begin();
$iResult = $oStepSupervisor->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oStepSupervisor->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);
}
}
/**
* Remove the step supervisor registry
*
* @param string $sStepUID
* @return integer
*
*/
public function remove ($sStepUID)
{
$oConnection = Propel::getConnection( StepSupervisorPeer::DATABASE_NAME );
try {
$oConnection->begin();
$this->setStepUid( $sStepUID );
$iResult = $this->delete();
$oConnection->commit();
return $iResult;
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
/**
* Get the next position for a atep
*
* @param string $sProcessUID
* @return integer
*
*/
public function getNextPosition ($sProcessUID, $sType)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS POSITION' );
$oCriteria->add( StepSupervisorPeer::PRO_UID, $sProcessUID );
$oCriteria->add( StepSupervisorPeer::STEP_TYPE_OBJ, $sType );
$oDataset = StepSupervisorPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
return (int) $aRow['POSITION'];
} catch (Exception $oException) {
throw $Exception;
}
}
/**
* Reorder the steps positions
*
* @param string $sProcessUID
* @param string $iPosition
*
*/
public function reorderPositions ($sProcessUID, $iPosition, $sType)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepSupervisorPeer::PRO_UID, $sProcessUID );
$oCriteria->add( StepSupervisorPeer::STEP_TYPE_OBJ, $sType );
$oCriteria->add( StepSupervisorPeer::STEP_POSITION, $iPosition, '>' );
$oDataset = StepSupervisorPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
var_dump( StepSupervisorPeer::doCount( $oCriteria ) );
while ($aRow = $oDataset->getRow()) {
var_dump( $aRow );
echo "\n";
$this->update( array ('STEP_UID' => $aRow['STEP_UID'],'PRO_UID' => $aRow['PRO_UID'],'STEP_TYPE_OBJ' => $aRow['STEP_TYPE_OBJ'],'STEP_UID_OBJ' => $aRow['STEP_UID_OBJ'],'STEP_POSITION' => $aRow['STEP_POSITION'] - 1
) );
$oDataset->next();
}
} catch (Exception $oException) {
throw $Exception;
}
}
public function removeByObject ($sType, $sObjUid)
{
try {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepSupervisorPeer::STEP_TYPE_OBJ, $sType );
$oCriteria->add( StepSupervisorPeer::STEP_UID_OBJ, $sObjUid );
StepSupervisorPeer::doDelete( $oCriteria );
} catch (Exception $e) {
throw ($e);
}
}
public function loadInfo ($sObjUID)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( StepSupervisorPeer::STEP_UID_OBJ, $sObjUID );
$oDataset = StepSupervisorPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
return ($aRow);
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'STEP_SUPERVISOR' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class StepSupervisorPeer extends BaseStepSupervisorPeer {
class StepSupervisorPeer extends BaseStepSupervisorPeer
{
}
} // StepSupervisorPeer

View File

@@ -41,7 +41,7 @@ require_once 'classes/model/om/BaseStepTrigger.php';
class StepTrigger extends BaseStepTrigger
{
function create ($aData)
public function create ($aData)
{
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -96,7 +96,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function update ($fields)
public function update ($fields)
{
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -117,7 +117,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function remove ($StepUid, $TasUid, $TriUid, $StType)
public function remove ($StepUid, $TasUid, $TriUid, $StType)
{
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -136,7 +136,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function stepTriggerExists ($StepUid, $TasUid, $TriUid, $StType)
public function stepTriggerExists ($StepUid, $TasUid, $TriUid, $StType)
{
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -151,7 +151,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function removeTrigger ($TriUid)
public function removeTrigger ($TriUid)
{
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -173,7 +173,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function getNextPosition ($sStepUID, $sType)
public function getNextPosition ($sStepUID, $sType)
{
try {
$oCriteria = new Criteria( 'workflow' );
@@ -190,7 +190,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function reOrder ($sStepUID, $sTaskUID, $sType, $iPosition)
public function reOrder ($sStepUID, $sTaskUID, $sType, $iPosition)
{
try {
$oCriteria = new Criteria( 'workflow' );
@@ -212,7 +212,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function up ($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0)
public function up ($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0)
{
try {
if ($iPosition > 1) {
@@ -238,7 +238,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function down ($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0)
public function down ($sStepUID = '', $sTaskUID = '', $sTriggerUID = '', $sType = '', $iPosition = 0)
{
try {
$oCriteria = new Criteria( 'workflow' );
@@ -273,7 +273,7 @@ class StepTrigger extends BaseStepTrigger
}
}
function createRow ($aData)
public function createRow ($aData)
{
$con = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
try {
@@ -302,5 +302,4 @@ class StepTrigger extends BaseStepTrigger
}
}
}
// StepTrigger

View File

@@ -2,10 +2,10 @@
/**
* StepTriggerPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'STEP_TRIGGER' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class StepTriggerPeer extends BaseStepTriggerPeer {
class StepTriggerPeer extends BaseStepTriggerPeer
{
}
} // StepTriggerPeer

View File

@@ -18,81 +18,77 @@ require_once 'classes/model/om/BaseSubApplication.php';
*
* @package workflow.engine.classes.model
*/
class SubApplication extends BaseSubApplication {
public function load($sAppUID, $sAppParent, $iIndexParent, $iThreadParent) {
try {
$oRow = SubApplicationPeer::retrieveByPK($sAppUID, $sAppParent, $iIndexParent, $iThreadParent);
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 '$sAppUID, $sAppParent, $iIndexParent, $iThreadParent' in table SubApplication doesn't exist!");
}
}
catch (Exception $oError) {
throw($oError);
}
}
public function create($aData) {
$oConnection = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
try {
$oSubApplication = new SubApplication();
$oSubApplication->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oSubApplication->validate()) {
$oConnection->begin();
$iResult = $oSubApplication->save();
$oConnection->commit();
return $iResult;
}
else {
$sMessage = '';
$aValidationFailures = $oSubApplication->getValidationFailures();
foreach($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
class SubApplication extends BaseSubApplication
{
public function load($sAppUID, $sAppParent, $iIndexParent, $iThreadParent)
{
try {
$oRow = SubApplicationPeer::retrieveByPK($sAppUID, $sAppParent, $iIndexParent, $iThreadParent);
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 '$sAppUID, $sAppParent, $iIndexParent, $iThreadParent' in table SubApplication 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(SubApplicationPeer::DATABASE_NAME);
try {
$oSubApplication = SubApplicationPeer::retrieveByPK($aData['APP_UID'], $aData['APP_PARENT'], $aData['DEL_INDEX_PARENT'], $aData['DEL_THREAD_PARENT']);
if (!is_null($oSubApplication)) {
$oSubApplication->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oSubApplication->validate()) {
$oConnection->begin();
$iResult = $oSubApplication->save();
$oConnection->commit();
return $iResult;
public function create($aData)
{
$oConnection = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
try {
$oSubApplication = new SubApplication();
$oSubApplication->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oSubApplication->validate()) {
$oConnection->begin();
$iResult = $oSubApplication->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oSubApplication->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 = $oSubApplication->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);
}
}
} // SubApplication
public function update($aData)
{
$oConnection = Propel::getConnection(SubApplicationPeer::DATABASE_NAME);
try {
$oSubApplication = SubApplicationPeer::retrieveByPK($aData['APP_UID'], $aData['APP_PARENT'], $aData['DEL_INDEX_PARENT'], $aData['DEL_THREAD_PARENT']);
if (!is_null($oSubApplication)) {
$oSubApplication->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oSubApplication->validate()) {
$oConnection->begin();
$iResult = $oSubApplication->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oSubApplication->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);
}
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'SUB_APPLICATION' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class SubApplicationPeer extends BaseSubApplicationPeer {
class SubApplicationPeer extends BaseSubApplicationPeer
{
}
} // SubApplicationPeer

View File

@@ -1,153 +1,152 @@
<?php
/**
* SubProcess.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseSubProcess.php';
/**
* Skeleton subclass for representing a row from the 'SUB_PROCESS' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class SubProcess extends BaseSubProcess
{
public function load ($SP_UID)
{
try {
$oRow = SubProcessPeer::retrieveByPK( $SP_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 '$SP_UID' in table SubProcess doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function create ($aData)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$con->begin();
if (isset( $aData['SP_UID'] ) && $aData['SP_UID'] == '') {
unset( $aData['SP_UID'] );
}
if (! isset( $aData['SP_UID'] )) {
$this->setSpUid( G::generateUniqueID() );
} else {
$this->setSpUid( $aData['SP_UID'] );
}
$this->setProUid( $aData['PRO_UID'] );
$this->setTasUid( $aData['TAS_UID'] );
$this->setProParent( $aData['PRO_PARENT'] );
$this->setTasParent( $aData['TAS_PARENT'] );
$this->setSpType( $aData['SP_TYPE'] );
$this->setSpSynchronous( $aData['SP_SYNCHRONOUS'] );
$this->setSpSynchronousType( $aData['SP_SYNCHRONOUS_TYPE'] );
$this->setSpSynchronousWait( $aData['SP_SYNCHRONOUS_WAIT'] );
$this->setSpVariablesOut( $aData['SP_VARIABLES_OUT'] );
$this->setSpVariablesIn( $aData['SP_VARIABLES_IN'] );
$this->setSpGridIn( $aData['SP_GRID_IN'] );
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);
}
}
public function update ($fields)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['SP_UID'] );
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$result = $this->save();
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$validationE->aValidationFailures = $this->getValidationFailures();
throw ($validationE);
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function remove ($SP_UID)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$con->begin();
$oRepTab = SubProcessPeer::retrieveByPK( $SP_UID );
if (! is_null( $oRepTab )) {
$result = $oRepTab->delete();
$con->commit();
}
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
/**
* verify if Trigger row specified in [sUid] exists.
*
* @param string $sUid the uid of the Prolication
*/
public function subProcessExists ($sUid)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$oObj = SubProcessPeer::retrieveByPk( $sUid );
if (is_object( $oObj ) && get_class( $oObj ) == 'SubProcess') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
}
// SubProcess
<?php
/**
* SubProcess.php
*
* @package workflow.engine.classes.model
*/
require_once 'classes/model/om/BaseSubProcess.php';
/**
* Skeleton subclass for representing a row from the 'SUB_PROCESS' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class SubProcess extends BaseSubProcess
{
public function load ($SP_UID)
{
try {
$oRow = SubProcessPeer::retrieveByPK( $SP_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 '$SP_UID' in table SubProcess doesn't exist!" ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
public function create ($aData)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$con->begin();
if (isset( $aData['SP_UID'] ) && $aData['SP_UID'] == '') {
unset( $aData['SP_UID'] );
}
if (! isset( $aData['SP_UID'] )) {
$this->setSpUid( G::generateUniqueID() );
} else {
$this->setSpUid( $aData['SP_UID'] );
}
$this->setProUid( $aData['PRO_UID'] );
$this->setTasUid( $aData['TAS_UID'] );
$this->setProParent( $aData['PRO_PARENT'] );
$this->setTasParent( $aData['TAS_PARENT'] );
$this->setSpType( $aData['SP_TYPE'] );
$this->setSpSynchronous( $aData['SP_SYNCHRONOUS'] );
$this->setSpSynchronousType( $aData['SP_SYNCHRONOUS_TYPE'] );
$this->setSpSynchronousWait( $aData['SP_SYNCHRONOUS_WAIT'] );
$this->setSpVariablesOut( $aData['SP_VARIABLES_OUT'] );
$this->setSpVariablesIn( $aData['SP_VARIABLES_IN'] );
$this->setSpGridIn( $aData['SP_GRID_IN'] );
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);
}
}
public function update ($fields)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$con->begin();
$this->load( $fields['SP_UID'] );
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$result = $this->save();
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$validationE->aValidationFailures = $this->getValidationFailures();
throw ($validationE);
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
public function remove ($SP_UID)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$con->begin();
$oRepTab = SubProcessPeer::retrieveByPK( $SP_UID );
if (! is_null( $oRepTab )) {
$result = $oRepTab->delete();
$con->commit();
}
return $result;
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
/**
* verify if Trigger row specified in [sUid] exists.
*
* @param string $sUid the uid of the Prolication
*/
public function subProcessExists ($sUid)
{
$con = Propel::getConnection( SubProcessPeer::DATABASE_NAME );
try {
$oObj = SubProcessPeer::retrieveByPk( $sUid );
if (is_object( $oObj ) && get_class( $oObj ) == 'SubProcess') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
}

View File

@@ -14,7 +14,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'SUB_PROCESS' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -22,6 +22,7 @@
*
* @package workflow.engine.classes.model
*/
class SubProcessPeer extends BaseSubProcessPeer {
class SubProcessPeer extends BaseSubProcessPeer
{
}
} // SubProcessPeer

View File

@@ -1,232 +1,232 @@
<?php
/**
* SwimlanesElements.php
*
* @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
* License, or (at your option) any later version.
*
* 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
* 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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/om/BaseSwimlanesElements.php';
require_once 'classes/model/Content.php';
/**
* Skeleton subclass for representing a row from the 'SWIMLANES_ELEMENTS' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class SwimlanesElements extends BaseSwimlanesElements
{
/**
* This value goes in the content table
*
* @var string
*/
protected $swi_text = '';
<?php
/**
* SwimlanesElements.php
*
* @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
* License, or (at your option) any later version.
*
* 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
* 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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/om/BaseSwimlanesElements.php';
require_once 'classes/model/Content.php';
/**
* Skeleton subclass for representing a row from the 'SWIMLANES_ELEMENTS' table.
*
*
*
* You should add additional methods to this class to meet the
* 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
*/
class SwimlanesElements extends BaseSwimlanesElements
{
/**
* This value goes in the content table
*
* @var string
*/
protected $swi_text = '';
/*
* Load the application document registry
* @param string $sAppDocUid
* @return variant
*/
public function load ($sSwiEleUid)
{
try {
$oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK( $sSwiEleUid );
if (! is_null( $oSwimlanesElements )) {
$aFields = $oSwimlanesElements->toArray( BasePeer::TYPE_FIELDNAME );
$aFields['SWI_TEXT'] = $oSwimlanesElements->getSwiEleText();
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
return $aFields;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$aData['SWI_UID'] = G::generateUniqueID();
$oSwimlanesElements = new SwimlanesElements();
$oSwimlanesElements->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oSwimlanesElements->validate()) {
$oConnection->begin();
if (isset( $aData['SWI_TEXT'] )) {
$oSwimlanesElements->setSwiEleText( $aData['SWI_TEXT'] );
}
$iResult = $oSwimlanesElements->save();
$oConnection->commit();
return $aData['SWI_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oSwimlanesElements->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);
}
}
/**
* Update the application document registry
*
* @param array $aData
* @return string
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK( $aData['SWI_UID'] );
if (! is_null( $oSwimlanesElements )) {
$oSwimlanesElements->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oSwimlanesElements->validate()) {
$oConnection->begin();
if (isset( $aData['SWI_TEXT'] )) {
$oSwimlanesElements->setSwiEleText( $aData['SWI_TEXT'] );
}
$iResult = $oSwimlanesElements->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oSwimlanesElements->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);
}
}
/**
* Remove the application document registry
*
* @param array $aData
* @return string
*
*/
public function remove ($sSwiEleUid)
{
$oConnection = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK( $sSwiEleUid );
if (! is_null( $oSwimlanesElements )) {
$oConnection->begin();
Content::removeContent( 'SWI_TEXT', '', $oSwimlanesElements->getSwiUid() );
$iResult = $oSwimlanesElements->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public function swimlanesElementsExists ($sSwiEleUid)
{
$con = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$oSwiEleUid = SwimlanesElementsPeer::retrieveByPk( $sSwiEleUid );
if (is_object( $oSwiEleUid ) && get_class( $oSwiEleUid ) == 'SwimlanesElements') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Get the [swi_text] column value.
*
* @return string
*/
public function getSwiEleText ()
{
if ($this->swi_text == '') {
try {
$this->swi_text = Content::load( 'SWI_TEXT', '', $this->getSwiUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en') );
} catch (Exception $oError) {
throw ($oError);
}
}
return $this->swi_text;
}
/**
* Set the [swi_text] column value.
*
* @param string $sValue new value
* @return void
*/
public function setSwiEleText ($sValue)
{
if ($sValue !== null && ! is_string( $sValue )) {
$sValue = (string) $sValue;
}
if ($this->swi_text !== $sValue || $sValue === '') {
try {
$this->swi_text = $sValue;
$iResult = Content::addContent( 'SWI_TEXT', '', $this->getSwiUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->swi_text );
} catch (Exception $oError) {
$this->swi_text = '';
throw ($oError);
}
}
}
}
// SwimlanesElements
* Load the application document registry
* @param string $sAppDocUid
* @return variant
*/
public function load ($sSwiEleUid)
{
try {
$oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK( $sSwiEleUid );
if (! is_null( $oSwimlanesElements )) {
$aFields = $oSwimlanesElements->toArray( BasePeer::TYPE_FIELDNAME );
$aFields['SWI_TEXT'] = $oSwimlanesElements->getSwiEleText();
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
return $aFields;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$aData['SWI_UID'] = G::generateUniqueID();
$oSwimlanesElements = new SwimlanesElements();
$oSwimlanesElements->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oSwimlanesElements->validate()) {
$oConnection->begin();
if (isset( $aData['SWI_TEXT'] )) {
$oSwimlanesElements->setSwiEleText( $aData['SWI_TEXT'] );
}
$iResult = $oSwimlanesElements->save();
$oConnection->commit();
return $aData['SWI_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oSwimlanesElements->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);
}
}
/**
* Update the application document registry
*
* @param array $aData
* @return string
*
*/
public function update ($aData)
{
$oConnection = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK( $aData['SWI_UID'] );
if (! is_null( $oSwimlanesElements )) {
$oSwimlanesElements->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oSwimlanesElements->validate()) {
$oConnection->begin();
if (isset( $aData['SWI_TEXT'] )) {
$oSwimlanesElements->setSwiEleText( $aData['SWI_TEXT'] );
}
$iResult = $oSwimlanesElements->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oSwimlanesElements->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);
}
}
/**
* Remove the application document registry
*
* @param array $aData
* @return string
*
*/
public function remove ($sSwiEleUid)
{
$oConnection = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK( $sSwiEleUid );
if (! is_null( $oSwimlanesElements )) {
$oConnection->begin();
Content::removeContent( 'SWI_TEXT', '', $oSwimlanesElements->getSwiUid() );
$iResult = $oSwimlanesElements->delete();
$oConnection->commit();
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public function swimlanesElementsExists ($sSwiEleUid)
{
$con = Propel::getConnection( SwimlanesElementsPeer::DATABASE_NAME );
try {
$oSwiEleUid = SwimlanesElementsPeer::retrieveByPk( $sSwiEleUid );
if (is_object( $oSwiEleUid ) && get_class( $oSwiEleUid ) == 'SwimlanesElements') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* Get the [swi_text] column value.
*
* @return string
*/
public function getSwiEleText ()
{
if ($this->swi_text == '') {
try {
$this->swi_text = Content::load( 'SWI_TEXT', '', $this->getSwiUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en') );
} catch (Exception $oError) {
throw ($oError);
}
}
return $this->swi_text;
}
/**
* Set the [swi_text] column value.
*
* @param string $sValue new value
* @return void
*/
public function setSwiEleText ($sValue)
{
if ($sValue !== null && ! is_string( $sValue )) {
$sValue = (string) $sValue;
}
if ($this->swi_text !== $sValue || $sValue === '') {
try {
$this->swi_text = $sValue;
$iResult = Content::addContent( 'SWI_TEXT', '', $this->getSwiUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->swi_text );
} catch (Exception $oError) {
$this->swi_text = '';
throw ($oError);
}
}
}
}
// SwimlanesElements

View File

@@ -2,10 +2,10 @@
/**
* SwimlanesElementsPeer.php
* @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
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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.,
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*
*/
// include base peer class
@@ -34,7 +34,7 @@
/**
* Skeleton subclass for performing query and update operations on the 'SWIMLANES_ELEMENTS' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@@ -42,6 +42,7 @@
*
* @package workflow.engine.classes.model
*/
class SwimlanesElementsPeer extends BaseSwimlanesElementsPeer {
class SwimlanesElementsPeer extends BaseSwimlanesElementsPeer
{
}
} // SwimlanesElementsPeer