Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -88,7 +88,7 @@ class Configurations // extends Configuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function exists($cfgID)
|
||||
{
|
||||
return $this->Configuration->exists($cfgID,"",'','','');
|
||||
@@ -314,11 +314,11 @@ class Configurations // extends Configuration
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function userNameFormat($username, $fullname)
|
||||
{
|
||||
|
||||
|
||||
try {
|
||||
if (!isset($this->UserConfig)) {
|
||||
$this->UserConfig = $this->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
@@ -486,6 +486,7 @@ class Configurations // extends Configuration
|
||||
$arrayFormat[] = array("id" => "d M, Y", "name" => G::LoadTranslation("ID_DATE_FORMAT_12")); //"d M, Y" i.e: "17 Nov, 2010"
|
||||
$arrayFormat[] = array("id" => "d m, Y", "name" => G::LoadTranslation("ID_DATE_FORMAT_13")); //"d m, Y" i.e: "17 11, 2010"
|
||||
$arrayFormat[] = array("id" => "d.m.Y", "name" => G::LoadTranslation("ID_DATE_FORMAT_14")); //"d.m.Y" i.e: "17.11.2010"
|
||||
$arrayFormat[] = array("id" => "d \d\e F \d\e Y", "name" => G::LoadTranslation("ID_DATE_FORMAT_17")); //"d \d\e F \d\e Y" i.e: "2 de Febrero de 2013" (Spanish format)
|
||||
|
||||
return $arrayFormat;
|
||||
}
|
||||
@@ -523,6 +524,12 @@ class Configurations // extends Configuration
|
||||
$newCreation = '';
|
||||
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%e', 'l' => '%A', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%P', 'A' => '%p', 'g' => '%l', 'G' => '%k', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
|
||||
$creationDateMask = trim($creationDateMask);
|
||||
|
||||
if (strpos($creationDateMask, ' \\d\\e ') !== false) {
|
||||
$creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
|
||||
}
|
||||
|
||||
|
||||
for ($i = 0; $i < strlen($creationDateMask); $i++) {
|
||||
if ($creationDateMask[$i] != ' ' && isset($maskTime[$creationDateMask[$i]])) {
|
||||
$newCreation .= $maskTime[$creationDateMask[$i]];
|
||||
@@ -560,8 +567,19 @@ class Configurations // extends Configuration
|
||||
|
||||
setlocale(LC_TIME, $langLocate);
|
||||
$dateTime = utf8_encode(strftime($newCreation, mktime(0, 0, 0, $m, $d, $y)));
|
||||
|
||||
if (strpos($dateTime, ' ') !== false) {
|
||||
$dateTime = ucwords($dateTime);
|
||||
}
|
||||
|
||||
if (strpos($dateTime, ' [xx] ') !== false) {
|
||||
$dateTime = str_replace('[xx]', ' de ', $dateTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $dateTime;
|
||||
}
|
||||
|
||||
@@ -940,4 +958,4 @@ class Configurations // extends Configuration
|
||||
return $ver;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ class dynaformEditor extends WebResource
|
||||
var DYNAFORM_URL="' . $Parameters['URL'] . '";
|
||||
leimnud.event.add(window,"load",function(){ loadEditor(); });
|
||||
');
|
||||
$oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLogged__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";');
|
||||
$oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLogged__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";var __DYN_UID__ = "' . $this->dyn_uid . '";');
|
||||
$oHeadPublisher->addScriptCode('var dynaformEditorParams = \'' . serialize($Parameters) . '\';');
|
||||
G::RenderPage("publish", 'blank');
|
||||
}
|
||||
|
||||
@@ -347,6 +347,7 @@ class Application extends BaseApplication
|
||||
*/
|
||||
public function create($sProUid, $sUsrUid)
|
||||
{
|
||||
require_once ("classes/model/Sequences.php");
|
||||
$con = Propel::getConnection('workflow');
|
||||
|
||||
try {
|
||||
@@ -371,16 +372,14 @@ class Application extends BaseApplication
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
|
||||
$c->addSelectColumn('MAX(' . ApplicationPeer::APP_NUMBER . ')'); //the appnumber is based in all processes
|
||||
//active, not only in the specified
|
||||
//process guid
|
||||
$oSequences = new Sequences();
|
||||
$oSequences->lockSequenceTable();
|
||||
|
||||
$result = ApplicationPeer::doSelectRS($c);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
$maxNumber = $oSequences->getSequeceNumber("APP_NUMBER");
|
||||
|
||||
$maxNumber = $row[0] + 1;
|
||||
$this->setAppNumber($maxNumber);
|
||||
$oSequences->changeSequence('APP_NUMBER', $maxNumber);
|
||||
$oSequences->unlockSequenceTable();
|
||||
|
||||
if ($this->validate()) {
|
||||
$con->begin();
|
||||
|
||||
241
workflow/engine/classes/model/Sequences.php
Normal file
241
workflow/engine/classes/model/Sequences.php
Normal file
@@ -0,0 +1,241 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseSequences.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'SEQUENCES' 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 classes.model
|
||||
*/
|
||||
class Sequences extends BaseSequences {
|
||||
|
||||
/**
|
||||
* Create Sequences Table
|
||||
*
|
||||
* @param type $aData
|
||||
* @return type
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function create($aData)
|
||||
{
|
||||
$con = Propel::getConnection( SequencesPeer::DATABASE_NAME );
|
||||
try {
|
||||
$this->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
$e->aValidationFailures = $this->getValidationFailures();
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch(Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Sequence with native query
|
||||
*
|
||||
* @param type $seqName
|
||||
* @param type $seqValue
|
||||
* @return type
|
||||
*
|
||||
*/
|
||||
public function changeSequence($seqName, $seqValue)
|
||||
{
|
||||
try {
|
||||
$con = Propel::getConnection('workflow');
|
||||
if ($this->nameExists($seqName)) {
|
||||
$sql = "UPDATE SEQUENCES SET SEQ_VALUE = $seqValue WHERE SEQ_NAME = '$seqName' ";
|
||||
} else {
|
||||
$sql = "INSERT INTO SEQUENCES (`SEQ_NAME`,`SEQ_VALUE`) VALUES ('$seqName', $seqValue) ";
|
||||
}
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
return $rs;
|
||||
} catch(Exception $e) {
|
||||
// throw ($e);
|
||||
throw new Exception( G::LoadTranslation('ID_ERROR_CHANGE_SEQUENCE_NUMBER'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock Sequence Table
|
||||
*
|
||||
* @return type
|
||||
*
|
||||
*/
|
||||
public function lockSequenceTable()
|
||||
{
|
||||
try {
|
||||
$con = Propel::getConnection('workflow');
|
||||
$sql = "LOCK TABLES SEQUENCES WRITE, APPLICATION READ ";
|
||||
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
return $rs;
|
||||
} catch(Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlock Sequence Table
|
||||
*
|
||||
* @return type
|
||||
*
|
||||
*/
|
||||
public function unlockSequenceTable()
|
||||
{
|
||||
try {
|
||||
$con = Propel::getConnection('workflow');
|
||||
$sql = "UNLOCK TABLES ";
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
return $rs;
|
||||
} catch(Exeption $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Name Exists
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return boolean
|
||||
*
|
||||
*/
|
||||
public function nameExists($seqName)
|
||||
{
|
||||
try {
|
||||
$oRow = SequencesPeer::retrieveByPK( $seqName );
|
||||
if (! is_null( $oRow )) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Sequences
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return type
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function load($seqName)
|
||||
{
|
||||
try {
|
||||
$oRow = SequencesPeer::retrieveByPK( $seqName );
|
||||
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 '" . $seqName . "' in table SEQUENCES doesn't exist!" ));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Sequences
|
||||
*
|
||||
* @param type $fields
|
||||
* @return type
|
||||
* @throws type
|
||||
*/
|
||||
public function update($fields)
|
||||
{
|
||||
$con = Propel::getConnection( SequencesPeer::DATABASE_NAME );
|
||||
try {
|
||||
$con->begin();
|
||||
$this->load( $fields['SEC_NAME'] );
|
||||
$this->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Sequences
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return type
|
||||
* @throws type
|
||||
*
|
||||
*/
|
||||
public function remove($seqName)
|
||||
{
|
||||
$con = Propel::getConnection( SequencesPeer::DATABASE_NAME );
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setSecName( $seqName );
|
||||
$result = $this->delete();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get new sequece number
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return type
|
||||
* @throws type
|
||||
*/
|
||||
public function getSequeceNumber($seqName)
|
||||
{
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
try {
|
||||
|
||||
if ($this->nameExists("APP_NUMBER") ) {
|
||||
$aSequence = $this->load($seqName);
|
||||
$nSeqValue = ($aSequence['SEQ_VALUE'] + 1);
|
||||
} else {
|
||||
$c->addSelectColumn('MAX(' . ApplicationPeer::APP_NUMBER . ')'); //the appnumber is based in all processes
|
||||
//active, not only in the specified
|
||||
//process guid
|
||||
$result = ApplicationPeer::doSelectRS($c);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
$nSeqValue = $row[0] + 1;
|
||||
}
|
||||
|
||||
return $nSeqValue;
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
|
||||
}
|
||||
} // Sequences
|
||||
23
workflow/engine/classes/model/SequencesPeer.php
Normal file
23
workflow/engine/classes/model/SequencesPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseSequencesPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/Sequences.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'SEQUENCES' 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 classes.model
|
||||
*/
|
||||
class SequencesPeer extends BaseSequencesPeer {
|
||||
|
||||
} // SequencesPeer
|
||||
74
workflow/engine/classes/model/map/SequencesMapBuilder.php
Normal file
74
workflow/engine/classes/model/map/SequencesMapBuilder.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'SEQUENCES' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class SequencesMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.SequencesMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('SEQUENCES');
|
||||
$tMap->setPhpName('Sequences');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('SEQ_NAME', 'SeqName', 'string', CreoleTypes::VARCHAR, true, 50);
|
||||
|
||||
$tMap->addColumn('SEQ_VALUE', 'SeqValue', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // SequencesMapBuilder
|
||||
568
workflow/engine/classes/model/om/BaseSequences.php
Normal file
568
workflow/engine/classes/model/om/BaseSequences.php
Normal file
@@ -0,0 +1,568 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/om/BaseObject.php';
|
||||
|
||||
require_once 'propel/om/Persistent.php';
|
||||
|
||||
|
||||
include_once 'propel/util/Criteria.php';
|
||||
|
||||
include_once 'classes/model/SequencesPeer.php';
|
||||
|
||||
/**
|
||||
* Base class that represents a row from the 'SEQUENCES' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseSequences extends BaseObject implements Persistent
|
||||
{
|
||||
|
||||
/**
|
||||
* The Peer class.
|
||||
* Instance provides a convenient way of calling static methods on a class
|
||||
* that calling code may not be able to identify.
|
||||
* @var SequencesPeer
|
||||
*/
|
||||
protected static $peer;
|
||||
|
||||
/**
|
||||
* The value for the seq_name field.
|
||||
* @var string
|
||||
*/
|
||||
protected $seq_name = '';
|
||||
|
||||
/**
|
||||
* The value for the seq_value field.
|
||||
* @var int
|
||||
*/
|
||||
protected $seq_value = 0;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
* @var boolean
|
||||
*/
|
||||
protected $alreadyInSave = false;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless validation loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
* @var boolean
|
||||
*/
|
||||
protected $alreadyInValidation = false;
|
||||
|
||||
/**
|
||||
* Get the [seq_name] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSeqName()
|
||||
{
|
||||
|
||||
return $this->seq_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [seq_value] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSeqValue()
|
||||
{
|
||||
|
||||
return $this->seq_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [seq_name] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setSeqName($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->seq_name !== $v || $v === '') {
|
||||
$this->seq_name = $v;
|
||||
$this->modifiedColumns[] = SequencesPeer::SEQ_NAME;
|
||||
}
|
||||
|
||||
} // setSeqName()
|
||||
|
||||
/**
|
||||
* Set the value of [seq_value] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setSeqValue($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->seq_value !== $v || $v === 0) {
|
||||
$this->seq_value = $v;
|
||||
$this->modifiedColumns[] = SequencesPeer::SEQ_VALUE;
|
||||
}
|
||||
|
||||
} // setSeqValue()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
* An offset (1-based "start column") is specified so that objects can be hydrated
|
||||
* with a subset of the columns in the resultset rows. This is needed, for example,
|
||||
* for results of JOIN queries where the resultset row includes columns from two or
|
||||
* more tables.
|
||||
*
|
||||
* @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
|
||||
* @param int $startcol 1-based offset column which indicates which restultset column to start with.
|
||||
* @return int next starting column
|
||||
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
|
||||
*/
|
||||
public function hydrate(ResultSet $rs, $startcol = 1)
|
||||
{
|
||||
try {
|
||||
|
||||
$this->seq_name = $rs->getString($startcol + 0);
|
||||
|
||||
$this->seq_value = $rs->getInt($startcol + 1);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 2; // 2 = SequencesPeer::NUM_COLUMNS - SequencesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Sequences object", $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes this object from datastore and sets delete attribute.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see BaseObject::setDeleted()
|
||||
* @see BaseObject::isDeleted()
|
||||
*/
|
||||
public function delete($con = null)
|
||||
{
|
||||
if ($this->isDeleted()) {
|
||||
throw new PropelException("This object has already been deleted.");
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(SequencesPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
SequencesPeer::doDelete($this, $con);
|
||||
$this->setDeleted(true);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the object in the database. If the object is new,
|
||||
* it inserts it; otherwise an update is performed. This method
|
||||
* wraps the doSave() worker method in a transaction.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return int The number of rows affected by this insert/update
|
||||
* @throws PropelException
|
||||
* @see doSave()
|
||||
*/
|
||||
public function save($con = null)
|
||||
{
|
||||
if ($this->isDeleted()) {
|
||||
throw new PropelException("You cannot save an object that has been deleted.");
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(SequencesPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
$affectedRows = $this->doSave($con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the object in the database.
|
||||
*
|
||||
* If the object is new, it inserts it; otherwise an update is performed.
|
||||
* All related objects are also updated in this method.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return int The number of rows affected by this insert/update and any referring
|
||||
* @throws PropelException
|
||||
* @see save()
|
||||
*/
|
||||
protected function doSave($con)
|
||||
{
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
if (!$this->alreadyInSave) {
|
||||
$this->alreadyInSave = true;
|
||||
|
||||
|
||||
// If this object has been modified, then save it to the database.
|
||||
if ($this->isModified()) {
|
||||
if ($this->isNew()) {
|
||||
$pk = SequencesPeer::doInsert($this, $con);
|
||||
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
|
||||
// should always be true here (even though technically
|
||||
// BasePeer::doInsert() can insert multiple rows).
|
||||
|
||||
$this->setNew(false);
|
||||
} else {
|
||||
$affectedRows += SequencesPeer::doUpdate($this, $con);
|
||||
}
|
||||
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
||||
}
|
||||
|
||||
$this->alreadyInSave = false;
|
||||
}
|
||||
return $affectedRows;
|
||||
} // doSave()
|
||||
|
||||
/**
|
||||
* Array of ValidationFailed objects.
|
||||
* @var array ValidationFailed[]
|
||||
*/
|
||||
protected $validationFailures = array();
|
||||
|
||||
/**
|
||||
* Gets any ValidationFailed objects that resulted from last call to validate().
|
||||
*
|
||||
*
|
||||
* @return array ValidationFailed[]
|
||||
* @see validate()
|
||||
*/
|
||||
public function getValidationFailures()
|
||||
{
|
||||
return $this->validationFailures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the objects modified field values and all objects related to this table.
|
||||
*
|
||||
* If $columns is either a column name or an array of column names
|
||||
* only those columns are validated.
|
||||
*
|
||||
* @param mixed $columns Column name or an array of column names.
|
||||
* @return boolean Whether all columns pass validation.
|
||||
* @see doValidate()
|
||||
* @see getValidationFailures()
|
||||
*/
|
||||
public function validate($columns = null)
|
||||
{
|
||||
$res = $this->doValidate($columns);
|
||||
if ($res === true) {
|
||||
$this->validationFailures = array();
|
||||
return true;
|
||||
} else {
|
||||
$this->validationFailures = $res;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function performs the validation work for complex object models.
|
||||
*
|
||||
* In addition to checking the current object, all related objects will
|
||||
* also be validated. If all pass then <code>true</code> is returned; otherwise
|
||||
* an aggreagated array of ValidationFailed objects will be returned.
|
||||
*
|
||||
* @param array $columns Array of column names to validate.
|
||||
* @return mixed <code>true</code> if all validations pass;
|
||||
array of <code>ValidationFailed</code> objects otherwise.
|
||||
*/
|
||||
protected function doValidate($columns = null)
|
||||
{
|
||||
if (!$this->alreadyInValidation) {
|
||||
$this->alreadyInValidation = true;
|
||||
$retval = null;
|
||||
|
||||
$failureMap = array();
|
||||
|
||||
|
||||
if (($retval = SequencesPeer::doValidate($this, $columns)) !== true) {
|
||||
$failureMap = array_merge($failureMap, $retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->alreadyInValidation = false;
|
||||
}
|
||||
|
||||
return (!empty($failureMap) ? $failureMap : true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a field from the object by name passed in as a string.
|
||||
*
|
||||
* @param string $name name
|
||||
* @param string $type The type of fieldname the $name is of:
|
||||
* one of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return mixed Value of field.
|
||||
*/
|
||||
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = SequencesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||
return $this->getByPosition($pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a field from the object by Position as specified in the xml schema.
|
||||
* Zero-based.
|
||||
*
|
||||
* @param int $pos position in xml schema
|
||||
* @return mixed Value of field at $pos
|
||||
*/
|
||||
public function getByPosition($pos)
|
||||
{
|
||||
switch($pos) {
|
||||
case 0:
|
||||
return $this->getSeqName();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getSeqValue();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the object as an array.
|
||||
*
|
||||
* You can specify the key type of the array by passing one of the class
|
||||
* type constants.
|
||||
*
|
||||
* @param string $keyType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return an associative array containing the field names (as keys) and field values
|
||||
*/
|
||||
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = SequencesPeer::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getSeqName(),
|
||||
$keys[1] => $this->getSeqValue(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a field from the object by name passed in as a string.
|
||||
*
|
||||
* @param string $name peer name
|
||||
* @param mixed $value field value
|
||||
* @param string $type The type of fieldname the $name is of:
|
||||
* one of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return void
|
||||
*/
|
||||
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = SequencesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a field from the object by Position as specified in the xml schema.
|
||||
* Zero-based.
|
||||
*
|
||||
* @param int $pos position in xml schema
|
||||
* @param mixed $value field value
|
||||
* @return void
|
||||
*/
|
||||
public function setByPosition($pos, $value)
|
||||
{
|
||||
switch($pos) {
|
||||
case 0:
|
||||
$this->setSeqName($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setSeqValue($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the object using an array.
|
||||
*
|
||||
* This is particularly useful when populating an object from one of the
|
||||
* request arrays (e.g. $_POST). This method goes through the column
|
||||
* names, checking to see whether a matching key exists in populated
|
||||
* array. If so the setByName() method is called for that column.
|
||||
*
|
||||
* You can specify the key type of the array by additionally passing one
|
||||
* of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
|
||||
* TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
|
||||
*
|
||||
* @param array $arr An array to populate the object from.
|
||||
* @param string $keyType The type of keys the array uses.
|
||||
* @return void
|
||||
*/
|
||||
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = SequencesPeer::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) {
|
||||
$this->setSeqName($arr[$keys[0]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[1], $arr)) {
|
||||
$this->setSeqValue($arr[$keys[1]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a Criteria object containing the values of all modified columns in this object.
|
||||
*
|
||||
* @return Criteria The Criteria object containing all modified values.
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(SequencesPeer::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(SequencesPeer::SEQ_NAME)) {
|
||||
$criteria->add(SequencesPeer::SEQ_NAME, $this->seq_name);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(SequencesPeer::SEQ_VALUE)) {
|
||||
$criteria->add(SequencesPeer::SEQ_VALUE, $this->seq_value);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a Criteria object containing the primary key for this object.
|
||||
*
|
||||
* Unlike buildCriteria() this method includes the primary key values regardless
|
||||
* of whether or not they have been modified.
|
||||
*
|
||||
* @return Criteria The Criteria object containing value(s) for primary key(s).
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(SequencesPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(SequencesPeer::SEQ_NAME, $this->seq_name);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary key for this object (row).
|
||||
* @return string
|
||||
*/
|
||||
public function getPrimaryKey()
|
||||
{
|
||||
return $this->getSeqName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to set the primary key (seq_name column).
|
||||
*
|
||||
* @param string $key Primary key.
|
||||
* @return void
|
||||
*/
|
||||
public function setPrimaryKey($key)
|
||||
{
|
||||
$this->setSeqName($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets contents of passed object to values from current object.
|
||||
*
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of Sequences (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copyInto($copyObj, $deepCopy = false)
|
||||
{
|
||||
|
||||
$copyObj->setSeqValue($this->seq_value);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
$copyObj->setSeqName(''); // this is a pkey column, so set to default value
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a copy of this object that will be inserted as a new row in table when saved.
|
||||
* It creates a new object filling in the simple attributes, but skipping any primary
|
||||
* keys that are defined for the table.
|
||||
*
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return Sequences Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
{
|
||||
// we use get_class(), because this might be a subclass
|
||||
$clazz = get_class($this);
|
||||
$copyObj = new $clazz();
|
||||
$this->copyInto($copyObj, $deepCopy);
|
||||
return $copyObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a peer instance associated with this om.
|
||||
*
|
||||
* Since Peer classes are not to have any instance attributes, this method returns the
|
||||
* same instance for all member of this class. The method could therefore
|
||||
* be static, but this would prevent one from overriding the behavior.
|
||||
*
|
||||
* @return SequencesPeer
|
||||
*/
|
||||
public function getPeer()
|
||||
{
|
||||
if (self::$peer === null) {
|
||||
self::$peer = new SequencesPeer();
|
||||
}
|
||||
return self::$peer;
|
||||
}
|
||||
}
|
||||
|
||||
572
workflow/engine/classes/model/om/BaseSequencesPeer.php
Normal file
572
workflow/engine/classes/model/om/BaseSequencesPeer.php
Normal file
@@ -0,0 +1,572 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by SequencesPeer::getOMClass()
|
||||
include_once 'classes/model/Sequences.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'SEQUENCES' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseSequencesPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'SEQUENCES';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.Sequences';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 2;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the SEQ_NAME field */
|
||||
const SEQ_NAME = 'SEQUENCES.SEQ_NAME';
|
||||
|
||||
/** the column name for the SEQ_VALUE field */
|
||||
const SEQ_VALUE = 'SEQUENCES.SEQ_VALUE';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('SeqName', 'SeqValue', ),
|
||||
BasePeer::TYPE_COLNAME => array (SequencesPeer::SEQ_NAME, SequencesPeer::SEQ_VALUE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('SEQ_NAME', 'SEQ_VALUE', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('SeqName' => 0, 'SeqValue' => 1, ),
|
||||
BasePeer::TYPE_COLNAME => array (SequencesPeer::SEQ_NAME => 0, SequencesPeer::SEQ_VALUE => 1, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('SEQ_NAME' => 0, 'SEQ_VALUE' => 1, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/SequencesMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.SequencesMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = SequencesPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. SequencesPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(SequencesPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(SequencesPeer::SEQ_NAME);
|
||||
|
||||
$criteria->addSelectColumn(SequencesPeer::SEQ_VALUE);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(SEQUENCES.SEQ_NAME)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT SEQUENCES.SEQ_NAME)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(SequencesPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(SequencesPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = SequencesPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return Sequences
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = SequencesPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return SequencesPeer::populateObjects(SequencesPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
SequencesPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = SequencesPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return SequencesPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a Sequences or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Sequences object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from Sequences object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a Sequences or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Sequences object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(SequencesPeer::SEQ_NAME);
|
||||
$selectCriteria->add(SequencesPeer::SEQ_NAME, $criteria->remove(SequencesPeer::SEQ_NAME), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the SEQUENCES table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(SequencesPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a Sequences or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Sequences object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(SequencesPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof Sequences) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(SequencesPeer::SEQ_NAME, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given Sequences object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param Sequences $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(Sequences $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(SequencesPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(SequencesPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(SequencesPeer::DATABASE_NAME, SequencesPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param mixed $pk the primary key.
|
||||
* @param Connection $con the connection to use
|
||||
* @return Sequences
|
||||
*/
|
||||
public static function retrieveByPK($pk, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(SequencesPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(SequencesPeer::SEQ_NAME, $pk);
|
||||
|
||||
|
||||
$v = SequencesPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function retrieveByPKs($pks, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(SequencesPeer::SEQ_NAME, $pks, Criteria::IN);
|
||||
$objs = SequencesPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseSequencesPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/SequencesMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.SequencesMapBuilder');
|
||||
}
|
||||
|
||||
@@ -208,9 +208,9 @@ function deleteObject($alfrescoServerUrl, $objetcId, $user, $pwd)
|
||||
function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $mainFolder = 'Sites')
|
||||
{
|
||||
if (!(G::verifyPath($pathFolder))) {
|
||||
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $pathFolder));
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
$result = new stdclass();
|
||||
$result->error = G::Loadtranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array('pluginFile' => $pathFolder));
|
||||
return $result;
|
||||
}
|
||||
|
||||
$dataPathFile = pathinfo($pathFile);
|
||||
@@ -223,9 +223,9 @@ function downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd, $m
|
||||
$xmlObject = simplexml_load_string((string) $sXmlArray);
|
||||
|
||||
if (!isset($xmlObject->content)) {
|
||||
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $nameFile . ' in Alfresco'));
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
$result = new stdclass();
|
||||
$result->error = G::Loadtranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array('pluginFile' => $nameFile));
|
||||
return $result;
|
||||
}
|
||||
|
||||
$linkContent = (string) $xmlObject->content->attributes()->src;
|
||||
@@ -323,9 +323,9 @@ function getFolderChildren($alfrescoServerUrl, $folderId, $user, $pwd)
|
||||
function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docType, $user, $pwd, $path = '', $mainFolder= 'Sites')
|
||||
{
|
||||
if (!(file_exists($fileSource))) {
|
||||
G::SendTemporalMessage('ID_FILE_PLUGIN_NOT_EXISTS', 'error', 'labels', null, null, array('pluginFile' => $fileSource));
|
||||
G::header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
$result = new stdclass();
|
||||
$result->error = G::Loadtranslation('ID_FILE_PLUGIN_NOT_EXISTS', SYS_LANG, array('pluginFile' => $fileSource));
|
||||
return $result;
|
||||
}
|
||||
$filep = fopen($fileSource, "r");
|
||||
$fileLength = filesize($fileSource);
|
||||
|
||||
@@ -2973,4 +2973,28 @@
|
||||
<column name="APP_CHANGE_TRACE" type="VARCHAR" size="500" required="true" />
|
||||
<column name="APP_UPDATED" type="TINYINT" required="true" default="1"/>
|
||||
</table>
|
||||
<table name="SEQUENCES">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="SEQUENCES"/>
|
||||
<parameter name="Engine" value="InnoDB"/>
|
||||
<parameter name="Version" value="10"/>
|
||||
<parameter name="Row_format" value="Dynamic"/>
|
||||
<parameter name="Rows" value="2"/>
|
||||
<parameter name="Avg_row_length" value="128"/>
|
||||
<parameter name="Data_length" value="6768"/>
|
||||
<parameter name="Max_data_length" value="281474976710655"/>
|
||||
<parameter name="Index_length" value="5120"/>
|
||||
<parameter name="Data_free" value="0"/>
|
||||
<parameter name="Auto_increment" value=""/>
|
||||
<parameter name="Create_time" value="2013-05-17 11:21:20"/>
|
||||
<parameter name="Update_time" value="2013-05-17 11:48:16"/>
|
||||
<parameter name="Check_time" value=""/>
|
||||
<parameter name="Collation" value="utf8_general_ci"/>
|
||||
<parameter name="Checksum" value=""/>
|
||||
<parameter name="Create_options" value=""/>
|
||||
<parameter name="Comment" value="Sequences, Controls the numerical sequence of a table"/>
|
||||
</vendor>
|
||||
<column name="SEQ_NAME" type="VARCHAR" size="50" required="true" primaryKey="true" default=""/>
|
||||
<column name="SEQ_VALUE" type="INTEGER" required="true" default="0"/>
|
||||
</table>
|
||||
</database>
|
||||
|
||||
@@ -12505,6 +12505,12 @@ msgstr "M d, Y"
|
||||
msgid "m D, Y"
|
||||
msgstr "m D, Y"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_DATE_FORMAT_17
|
||||
#: LABEL/ID_DATE_FORMAT_17
|
||||
msgid "d de F de Y"
|
||||
msgstr "d de F de Y"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_EXPIRES_IN
|
||||
#: LABEL/ID_EXPIRES_IN
|
||||
|
||||
@@ -1354,10 +1354,15 @@ class Installer extends Controller
|
||||
|
||||
public function setConfiguration()
|
||||
{
|
||||
$query = <<<EOL
|
||||
INSERT INTO CONFIGURATION (CFG_UID, CFG_VALUE) VALUES
|
||||
('ENVIRONMENT_SETTINGS', 'a:3:{s:26:"login_enableForgotPassword";b:0;s:27:"login_enableVirtualKeyboard";b:0;s:21:"login_defaultLanguage";s:5:"pt-BR";}');
|
||||
EOL;
|
||||
//a:4:{s:26:"login_enableForgotPassword";b:0;s:27:"login_enableVirtualKeyboard";b:0;s:21:"login_defaultLanguage";s:5:"pt-BR";s:10:"dateFormat";s:15:"d \\d\\e F \\d\\e Y";}
|
||||
$value = array(
|
||||
'login_defaultLanguage' => "pt-BR",
|
||||
"dateFormat" => 'd \d\e F \d\e Y'
|
||||
);
|
||||
|
||||
$value = serialize($value);
|
||||
$query = "INSERT INTO CONFIGURATION (CFG_UID, CFG_VALUE) VALUES ('ENVIRONMENT_SETTINGS', '".mysql_real_escape_string($value)."')";
|
||||
|
||||
$this->mysqlQuery($query);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ class pmTables extends Controller
|
||||
$tableSize = 30;
|
||||
break;
|
||||
}
|
||||
$tableSize = $tableSize - 4; // Prefix PMT_
|
||||
$tableSize = $tableSize - 8; // Prefix PMT_
|
||||
return $tableSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1442,5 +1442,18 @@ CREATE TABLE `APP_SOLR_QUEUE`
|
||||
`APP_UPDATED` TINYINT default 1 NOT NULL,
|
||||
PRIMARY KEY (`APP_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='APP_SOLR_QUEUE';
|
||||
#-----------------------------------------------------------------------------
|
||||
#-- SEQUENCES
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `SEQUENCES`;
|
||||
|
||||
|
||||
CREATE TABLE `SEQUENCES`
|
||||
(
|
||||
`SEQ_NAME` VARCHAR(50) default '' NOT NULL,
|
||||
`SEQ_VALUE` INTEGER default 0 NOT NULL,
|
||||
PRIMARY KEY (`SEQ_NAME`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Sequences, Controls the numerical sequence of a table';
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
@@ -13,7 +13,7 @@ var lastTypeSelected = '';
|
||||
var sessionPersits = function() {
|
||||
var rpc = new leimnud.module.rpc.xmlhttp({
|
||||
url: '../services/sessionPersists',
|
||||
args: 'dynaformEditorParams=' + dynaformEditorParams,
|
||||
args: 'dynaformEditorParams=' + dynaformEditorParams + (lastActionPerformed != '' ? '&DYN_UID=' + __DYN_UID__ : ''),
|
||||
async: false
|
||||
});
|
||||
rpc.make();
|
||||
|
||||
@@ -125,6 +125,12 @@ try {
|
||||
$aFields['PHP_START_DATE'] = date( 'Y-m-d' );
|
||||
$aFields['PHP_END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
|
||||
|
||||
$aFields['SCH_LIST'] = '';
|
||||
foreach ($_SESSION['_DBArray']['cases_scheduler'] as $key => $item) {
|
||||
$aFields['SCH_LIST'] .= ($item['SCH_UID'] != $_GET['SCH_UID']) ? htmlspecialchars($item['SCH_NAME'], ENT_QUOTES) . '^' : '' ;
|
||||
}
|
||||
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_Edit.xml', '', $aFields, 'cases_Scheduler_Update' );
|
||||
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
@@ -86,6 +86,11 @@ try {
|
||||
|
||||
$aFields['UID_SCHEDULER'] = "scheduler";
|
||||
|
||||
$aFields['SCH_LIST'] = '';
|
||||
foreach ($_SESSION['_DBArray']['cases_scheduler'] as $key => $item) {
|
||||
$aFields['SCH_LIST'] .= htmlspecialchars($item['SCH_NAME'], ENT_QUOTES) . '^';
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_New.xml', '', $aFields, 'cases_Scheduler_Save' );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
|
||||
@@ -178,14 +178,10 @@ try {
|
||||
//Obtain previous and next step - End
|
||||
|
||||
$aRequiredFields = array(
|
||||
'APPLICATION' => $Fields['APP_DATA']['APPLICATION'],
|
||||
'PROCESS' => $Fields['APP_DATA']['PROCESS'],
|
||||
'TASK' => $Fields['APP_DATA']['TASK'],
|
||||
'INDEX' => $Fields['APP_DATA']['INDEX'],
|
||||
'APP_DATA' => $Fields['APP_DATA']
|
||||
'APP_DATA' => $Fields['APP_DATA']
|
||||
);
|
||||
$oHeadPublisher->addScriptCode('var __dynaformSVal__ = \'' . serialize($aRequiredFields) . '\';');
|
||||
|
||||
$oHeadPublisher->addScriptCode('var __dynaformSVal__ = \'' . base64_encode(serialize($aRequiredFields)) . '\'; ');
|
||||
try {
|
||||
//Add content content step - Start
|
||||
$oApp = ApplicationPeer::retrieveByPK( $_SESSION['APPLICATION'] );
|
||||
|
||||
@@ -76,6 +76,8 @@ if (isset( $parameters->TO )) {
|
||||
//echo '<pre>';print_r($parameters->TO);
|
||||
foreach ($parameters->TO as $item) {
|
||||
$row = explode( '|', $item );
|
||||
$row[1] = trim($row[1]);
|
||||
|
||||
switch ($row[0]) {
|
||||
case 'usr':
|
||||
require_once ('classes/model/Users.php');
|
||||
@@ -117,6 +119,8 @@ if (isset( $parameters->CC )) {
|
||||
$paramCC[] = Array ('id' => 'char','name' => 'char' );
|
||||
foreach ($parameters->CC as $item) {
|
||||
$row = explode( '|', $item );
|
||||
$row[1] = trim($row[1]);
|
||||
|
||||
switch ($row[0]) {
|
||||
case 'usr':
|
||||
require_once ('classes/model/Users.php');
|
||||
@@ -156,6 +160,8 @@ if (isset( $parameters->BCC )) {
|
||||
$paramBCC[] = Array ('id' => 'char','name' => 'char' );
|
||||
foreach ($parameters->BCC as $item) {
|
||||
$row = explode( '|', $item );
|
||||
$row[1] = trim($row[1]);
|
||||
|
||||
switch ($row[0]) {
|
||||
case 'usr':
|
||||
require_once ('classes/model/Users.php');
|
||||
|
||||
@@ -3,26 +3,56 @@ $response = new stdclass();
|
||||
$response->status = isset($_SESSION['USER_LOGGED']);
|
||||
if (isset($_REQUEST['dynaformEditorParams'])) {
|
||||
$_SESSION['Current_Dynafom']['Parameters'] = unserialize(stripslashes($_REQUEST['dynaformEditorParams']));
|
||||
if (isset($_REQUEST['DYN_UID'])) {
|
||||
$dynaform = new dynaform();
|
||||
$dynaform->load($_REQUEST['DYN_UID']);
|
||||
|
||||
G::LoadClass('dynaformEditor');
|
||||
$editor = new dynaformEditor(array());
|
||||
$editor->file = $dynaform->getDynFilename();
|
||||
$editor->home = PATH_DYNAFORM;
|
||||
$editor->title = $dynaform->getDynTitle();
|
||||
$editor->dyn_uid = $dynaform->getDynUid();
|
||||
$editor->pro_uid = $dynaform->getProUid();
|
||||
$editor->dyn_type = $dynaform->getDynType();
|
||||
$editor->dyn_title = $dynaform->getDynTitle();
|
||||
$editor->dyn_description = $dynaform->getDynDescription();
|
||||
$editor->dyn_editor = 'processmap';
|
||||
$editor->_setUseTemporalCopy(true);
|
||||
|
||||
$A = isset($_SESSION['Current_Dynafom']['Parameters']['URL']) ? $_SESSION['Current_Dynafom']['Parameters']['URL'] : '';
|
||||
$form = new Form($dynaform->getProUid() . '/' . $dynaform->getDynUid(), PATH_DYNAFORM, SYS_LANG, true);
|
||||
$properties = array('A' => $A, 'DYN_UID' => $dynaform->getDynUid(), 'PRO_UID' => $dynaform->getProUid(), 'DYN_TITLE' => $dynaform->getDynTitle(),
|
||||
'DYN_TYPE' => $dynaform->getDynType(), 'DYN_DESCRIPTION' => $dynaform->getDynDescription(), 'WIDTH' => $form->width,
|
||||
'MODE' => $form->mode, 'PRINTDYNAFORM' => $form->printdynaform, 'ADJUSTGRIDSWIDTH' => $form->adjustgridswidth,
|
||||
'NEXTSTEPSAVE' => $form->nextstepsave);
|
||||
$tmp = $editor->_getTmpData();
|
||||
$tmp['Properties'] = $properties;
|
||||
$editor->_setTmpData($tmp);
|
||||
}
|
||||
}
|
||||
if (isset($_REQUEST['dynaformRestoreValues'])) {
|
||||
$aRetValues = unserialize(stripslashes($_REQUEST['dynaformRestoreValues']));
|
||||
if (isset($aRetValues['APPLICATION'])) {
|
||||
$_SESSION['APPLICATION'] = $aRetValues['APPLICATION'];
|
||||
}
|
||||
if (isset($aRetValues['PROCESS'])) {
|
||||
$_SESSION['PROCESS'] = $aRetValues['PROCESS'];
|
||||
}
|
||||
if (isset($aRetValues['TASK'])) {
|
||||
$_SESSION['TASK'] = $aRetValues['TASK'];
|
||||
}
|
||||
if (isset($aRetValues['INDEX'])) {
|
||||
$_SESSION['INDEX'] = $aRetValues['INDEX'];
|
||||
}
|
||||
if (isset($aRetValues['TRIGGER_DEBUG'])) {
|
||||
$_SESSION['TRIGGER_DEBUG'] = $aRetValues['TRIGGER_DEBUG'];
|
||||
}
|
||||
|
||||
$aRetValues = unserialize(stripslashes(base64_decode($_REQUEST['dynaformRestoreValues'])));
|
||||
|
||||
if (isset($aRetValues['APP_DATA'])) {
|
||||
$_SESSION['APP_DATA'] = $aRetValues['APP_DATA'];
|
||||
|
||||
if (isset($aRetValues['APP_DATA']['APPLICATION'])) {
|
||||
$_SESSION['APPLICATION'] = $aRetValues['APP_DATA']['APPLICATION'];
|
||||
}
|
||||
if (isset($aRetValues['APP_DATA']['PROCESS'])) {
|
||||
$_SESSION['PROCESS'] = $aRetValues['APP_DATA']['PROCESS'];
|
||||
}
|
||||
if (isset($aRetValues['APP_DATA']['TASK'])) {
|
||||
$_SESSION['TASK'] = $aRetValues['APP_DATA']['TASK'];
|
||||
}
|
||||
if (isset($aRetValues['APP_DATA']['INDEX'])) {
|
||||
$_SESSION['INDEX'] = $aRetValues['APP_DATA']['INDEX'];
|
||||
}
|
||||
if (isset($aRetValues['APP_DATA']['TRIGGER_DEBUG'])) {
|
||||
$_SESSION['TRIGGER_DEBUG'] = $aRetValues['APP_DATA']['TRIGGER_DEBUG'];
|
||||
}
|
||||
}
|
||||
}
|
||||
die(G::json_encode($response));
|
||||
@@ -50,13 +50,16 @@ function skinList ()
|
||||
$wildcard = '@';
|
||||
}
|
||||
|
||||
$classicSkin = '';
|
||||
$filterList = array();
|
||||
if (defined('PARTNER_FLAG')) {
|
||||
$classicSkin = '00000000000000000000000000000001';
|
||||
$filterList = array(
|
||||
'00000000000000000000000000000001',
|
||||
'00000000000000000000000000000002'
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($skinList['skins'] as $key => $value) {
|
||||
if (!isset($value['SKIN_ID']) || $value['SKIN_ID'] != $classicSkin) {
|
||||
if (! isset($value['SKIN_ID']) || ! in_array($value['SKIN_ID'], $filterList)) {
|
||||
if ($value['SKIN_FOLDER_ID'] != 'simplified' && $value['SKIN_FOLDER_ID'] != 'uxs' && $value['SKIN_FOLDER_ID'] != 'uxmodern') {
|
||||
if ($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']) {
|
||||
$value['SKIN_STATUS'] = $wildcard . G::LoadTranslation( 'ID_ACTIVE' );
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<td id="pm_header" valign="top">
|
||||
<table width="100%" height="32" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
|
||||
<tr>
|
||||
{if $user_logged neq ''}
|
||||
{if $user_logged neq '' or $tracker neq ''}
|
||||
<td width="50%" rowspan="2" valign="center"><img src="{$logo_company}"/></td>
|
||||
<td width="50%" height="16" align="right" valign="top">
|
||||
<div align="right" class="logout">
|
||||
@@ -44,7 +44,7 @@
|
||||
<td>
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0" >
|
||||
<tr>
|
||||
{if $user_logged neq ''}
|
||||
{if $user_logged neq '' or $tracker neq ''}
|
||||
<td width="100%" class="mainMenuBG" style="height:25px">
|
||||
{include file="$tpl_menu"}
|
||||
</td>
|
||||
|
||||
@@ -713,6 +713,7 @@ class SkinEngine
|
||||
$switch_interface = isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'SWITCHABLE';
|
||||
|
||||
$smarty->assign('user_logged', (isset($_SESSION['USER_LOGGED'])? $_SESSION['USER_LOGGED'] : ''));
|
||||
$smarty->assign('tracker', (SYS_COLLECTION == 'tracker') ? ( ($G_PUBLISH->Parts[0]['File'] != 'tracker/login' ) ? true : '') : '');
|
||||
$smarty->assign('switch_interface', $switch_interface);
|
||||
$smarty->assign('switch_interface_label', G::LoadTranslation('ID_SWITCH_INTERFACE'));
|
||||
$smarty->assign('rolename', isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] . '' : '');
|
||||
@@ -725,7 +726,7 @@ class SkinEngine
|
||||
G::LoadClass( "configuration" );
|
||||
$conf = new Configurations();
|
||||
if ( defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
|
||||
$smarty->assign('udate', $conf->getSystemDate(date('Y-m-d H:i:s')));
|
||||
$smarty->assign('udate', $conf->getSystemDate(date('Y-m-d')));
|
||||
} else {
|
||||
$smarty->assign('udate', G::getformatedDate(date('Y-m-d'), 'M d, yyyy', SYS_LANG));
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ Ext.onReady(function() {
|
||||
}
|
||||
});
|
||||
|
||||
txtCasesRefreshTime = new Ext.form.TextField({
|
||||
txtCasesRefreshTime = new Ext.form.NumberField({
|
||||
id: "txtCasesRefreshTime",
|
||||
name: "txtCasesRefreshTime",
|
||||
|
||||
@@ -215,6 +215,9 @@ Ext.onReady(function() {
|
||||
fieldLabel: _("ID_REFRESH_TIME_SECONDS"),
|
||||
maskRe: /^\d*$/,
|
||||
enableKeyEvents: true,
|
||||
|
||||
minValue: 90,
|
||||
maxValue: 14400,
|
||||
|
||||
listeners: {
|
||||
keyup: function (txt, e)
|
||||
|
||||
@@ -153,7 +153,7 @@ try {
|
||||
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
|
||||
// $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "",
|
||||
// str_replace ( '"', '', $paramDefaultValue ) ) );
|
||||
$paramValue = $_GET[trim( str_replace( "$", "", $paramName ) )];
|
||||
$paramValue = isset($_GET[trim( str_replace( "$", "", $paramName ) )]) ? $_GET[trim( str_replace( "$", "", $paramName ) )] : '';
|
||||
$template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "'", $paramValue) );
|
||||
//turn single quotes to double quotes into an array asignation
|
||||
$template->assign ( 'ADD_TRI_VALUE', str_replace("'", """, $paramValue) );
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.SCH_UID}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.SCH_LIST}</td>
|
||||
</tr>
|
||||
<tr style="display: none">
|
||||
<td colspan="2">{$form.SCH_ADVANCED}</td>
|
||||
</tr>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<SCH_UID type="hidden" >
|
||||
<en></en>
|
||||
</SCH_UID>
|
||||
<SCH_LIST type="hidden" >
|
||||
</SCH_LIST>
|
||||
<PREV_SCH_END_DATE type="hidden" >
|
||||
<en></en>
|
||||
</PREV_SCH_END_DATE>
|
||||
@@ -48,7 +50,7 @@
|
||||
|
||||
|
||||
<SCH_NAME type="text" maxlength="100" validate="Any" required="1" readonly="0" size="40" mode="edit" mask="" strto="" dependentfields="" defaultvalue="" hint="" formula="" function="" sqlconnection="" savelabel="0">
|
||||
<en>Description</en>
|
||||
<en>Name</en>
|
||||
</SCH_NAME>
|
||||
<PRO_UID type="hidden" required="1" style="width:300px" dependentfields="TAS_UID" mode="edit">
|
||||
</PRO_UID>
|
||||
@@ -247,7 +249,7 @@ WHERE A.PRO_UID='@#PRO_UID' AND A.TAS_START = 'TRUE' ]]>
|
||||
|
||||
</CASE_SH_PLUGIN_UID>
|
||||
|
||||
<UPDATE type="submit" onClick="if(validateSchedulerFields()) {return true;} else {return false;}">
|
||||
<UPDATE type="button" onClick="validateSchedulerFields(this.form)">
|
||||
<en>Update</en>
|
||||
</UPDATE>
|
||||
|
||||
@@ -758,18 +760,36 @@ function collapseAdvancedOptions(){
|
||||
* @return true/false boolean
|
||||
*/
|
||||
|
||||
function validateSchedulerFields(){
|
||||
function validateSchedulerFields(oForm) {
|
||||
|
||||
var validFields = true;
|
||||
var requiredFields = '';
|
||||
var badFormatFields = '';
|
||||
var startDate = document.getElementById('form[SCH_START_DATE]').value;
|
||||
var endDate = document.getElementById('form[SCH_END_DATE]').value;
|
||||
var schedulerTitle = document.getElementById('form[SCH_NAME]').value;
|
||||
schedulerTitle = schedulerTitle.replace(/^\s*|\s*$/g,"");
|
||||
if (schedulerTitle == '') {
|
||||
document.getElementById('form[SCH_NAME]').focus();
|
||||
msgBox("@G::LoadTranslation(ID_REQUIRED_NAME_CASE_SCHEDULER)", 'alert');
|
||||
return false;
|
||||
}
|
||||
|
||||
var listNames = document.getElementById('form[SCH_LIST]').value;
|
||||
listNames = listNames.split("^");
|
||||
for (var i= 1; i<listNames.length; i++) {
|
||||
if (schedulerTitle.toLowerCase() == (listNames[i]).toLowerCase()) {
|
||||
document.getElementById('form[SCH_NAME]').focus();
|
||||
msgBox("@G::LoadTranslation(ID_DUPLICATE_CASE_SCHEDULER_NAME)", 'alert');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
getField("SCH_NAME").value = schedulerTitle;
|
||||
var validFields = true;
|
||||
var requiredFields = '';
|
||||
var badFormatFields = '';
|
||||
var startDate = document.getElementById('form[SCH_START_DATE]').value;
|
||||
var endDate = document.getElementById('form[SCH_END_DATE]').value;
|
||||
|
||||
startDate = startDate.split("-");
|
||||
endDate = endDate.split("-");
|
||||
startDate = new Date(startDate[0],startDate[1],startDate[2]);
|
||||
endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
startDate = startDate.split("-");
|
||||
endDate = endDate.split("-");
|
||||
startDate = new Date(startDate[0],startDate[1],startDate[2]);
|
||||
endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
|
||||
if (document.getElementById('form[SCH_START_DATE]').value==''){
|
||||
requiredFields = requiredFields + 'Start Date,';
|
||||
@@ -782,7 +802,7 @@ endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
}
|
||||
}
|
||||
|
||||
if (document.getElementById('form[SCH_START_TIME]').value==''){
|
||||
if (document.getElementById('form[SCH_START_TIME]').value=='') {
|
||||
requiredFields = requiredFields + 'Start Time,';
|
||||
validFields = false;
|
||||
}
|
||||
@@ -790,38 +810,36 @@ endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
// for time format hh:mm
|
||||
var regExpString = "([0-1]\\d|2[0-3]):([0-5]\\d)";
|
||||
var timeRegexp = new RegExp(regExpString);
|
||||
if (!timeRegexp.test(document.getElementById('form[SCH_START_TIME]').value)){
|
||||
if (!timeRegexp.test(document.getElementById('form[SCH_START_TIME]').value)) {
|
||||
msgBox('The time format is invalid','alert');
|
||||
return false;
|
||||
}
|
||||
if (document.getElementById('form[SCH_OPTION]').value == 5) {
|
||||
if (document.getElementById('form[SCH_REPEAT_EVERY]').value==''){
|
||||
requiredFields = requiredFields + 'Every,';
|
||||
validFields = false;
|
||||
}
|
||||
if (document.getElementById('form[SCH_REPEAT_EVERY]').value=='') {
|
||||
requiredFields = requiredFields + 'Every,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
switch(document.getElementById('form[SCH_OPTION]').value){
|
||||
// daily
|
||||
switch(document.getElementById('form[SCH_OPTION]').value) {
|
||||
case '1':
|
||||
|
||||
// if(document.getElementById('form[SCH_DAYS_PERFORM_TASK][1]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][2]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][3]').checked==true){
|
||||
if(document.getElementById('form[SCH_DAYS_PERFORM_TASK]').value!=''){
|
||||
validFields = true;
|
||||
} else {
|
||||
requiredFields = requiredFields + 'Weekdays,';
|
||||
validFields = false;
|
||||
}
|
||||
|
||||
break;
|
||||
// weekly
|
||||
// daily
|
||||
//if(document.getElementById('form[SCH_DAYS_PERFORM_TASK][1]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][2]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][3]').checked==true){
|
||||
if(document.getElementById('form[SCH_DAYS_PERFORM_TASK]').value!=''){
|
||||
validFields = true;
|
||||
} else {
|
||||
requiredFields = requiredFields + 'Weekdays,';
|
||||
validFields = false;
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
if (document.getElementById('form[SCH_EVERY_DAYS]').value==''){
|
||||
// weekly
|
||||
if (document.getElementById('form[SCH_EVERY_DAYS]').value=='') {
|
||||
requiredFields = requiredFields + 'Number of Weeks,';
|
||||
validFields = false;
|
||||
} else {
|
||||
for (week=1;week<=4;week++){
|
||||
for (week=1;week<=4;week++) {
|
||||
weekIdOne = 'form[SCH_WEEK_DAYS]['+week+']';
|
||||
if (document.getElementById(weekIdOne).checked==true){
|
||||
if (document.getElementById(weekIdOne).checked==true) {
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -829,9 +847,9 @@ endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
for (week=1;week<=3;week++){
|
||||
for (week=1;week<=3;week++) {
|
||||
weekIdTwo = 'form[SCH_WEEK_DAYS_2]['+(week+4)+']';
|
||||
if (document.getElementById(weekIdTwo).checked==true){
|
||||
if (document.getElementById(weekIdTwo).checked==true) {
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -839,28 +857,27 @@ endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
if (!validFields) {
|
||||
requiredFields = requiredFields + 'Weeks,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
//monthly
|
||||
break;
|
||||
case '3':
|
||||
if (document.getElementById('form[SCH_START_DAY][1]').checked==true||document.getElementById('form[SCH_START_DAY][2]').checked==true){
|
||||
for (month=1;month<=4;month++){
|
||||
//monthly
|
||||
if (document.getElementById('form[SCH_START_DAY][1]').checked==true||document.getElementById('form[SCH_START_DAY][2]').checked==true) {
|
||||
for (month=1;month<=4;month++) {
|
||||
monthIdOne = 'form[SCH_MONTHS]['+month+']';
|
||||
monthIdTwo = 'form[SCH_MONTHS_2]['+(month+4)+']';
|
||||
monthIdThree = 'form[SCH_MONTHS_3]['+(month+8)+']';
|
||||
|
||||
if (document.getElementById(monthIdOne).checked==true||document.getElementById(monthIdTwo).checked==true||document.getElementById(monthIdThree).checked==true){
|
||||
if (document.getElementById(monthIdOne).checked==true||document.getElementById(monthIdTwo).checked==true||document.getElementById(monthIdThree).checked==true) {
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
if (!validFields) {
|
||||
requiredFields = requiredFields + 'Months,';
|
||||
validFields = false;
|
||||
}
|
||||
@@ -868,22 +885,18 @@ endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
requiredFields = requiredFields + 'Start Day,';
|
||||
validFields = false;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
//run once
|
||||
break;
|
||||
case '4':
|
||||
|
||||
validFields = true;
|
||||
|
||||
break;
|
||||
//run once
|
||||
//run once
|
||||
validFields = true;
|
||||
break;
|
||||
case '5':
|
||||
validFields = true;
|
||||
break;
|
||||
//run once
|
||||
validFields = true;
|
||||
break;
|
||||
default:
|
||||
validFields = false;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
if (requiredFields!='') {
|
||||
var message = "The fields "+requiredFields+" can\'t be empty";
|
||||
@@ -895,7 +908,7 @@ endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
msgBox(message, 'alert');
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
oForm.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.SCH_UID}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.SCH_LIST}</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td colspan="2">{$form.SCH_USER_UID}</td>
|
||||
</tr>
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
<![CDATA[ SELECT count( * )+1 AS UID FROM CASE_SCHEDULER ]]>
|
||||
<en></en>
|
||||
</SCH_UID>
|
||||
|
||||
<SCH_LIST type="hidden" >
|
||||
</SCH_LIST>
|
||||
<PHP_CURRENT_DATE type="hidden" >
|
||||
</PHP_CURRENT_DATE>
|
||||
|
||||
@@ -230,7 +231,7 @@
|
||||
<en>Start a case based on following registered Plugin.</en>
|
||||
</SELECT_PLUGIN>
|
||||
|
||||
<SAVE type="submit" onClick="if(validateSchedulerFields()) {return true;} else {return false;}">
|
||||
<SAVE type="button" onClick="validateSchedulerFields(this.form)">
|
||||
<en>Save</en>
|
||||
</SAVE>
|
||||
|
||||
@@ -243,7 +244,6 @@ hideAll();
|
||||
hideProperties();
|
||||
|
||||
|
||||
|
||||
function $_GET(q,s) {
|
||||
s = (s) ? s : self.location.search;
|
||||
var re = new RegExp('&'+q+'=([^&]*)','i');
|
||||
@@ -622,149 +622,160 @@ function case_userSchedulerValidate(username, password) {
|
||||
* @return true/false boolean
|
||||
*/
|
||||
|
||||
function validateSchedulerFields(){
|
||||
function validateSchedulerFields(oForm) {
|
||||
|
||||
getField("SCH_NAME").value = getField("SCH_NAME").value.trim();
|
||||
var schedulerTitle = document.getElementById('form[SCH_NAME]').value;
|
||||
schedulerTitle = schedulerTitle.replace(/^\s*|\s*$/g,"");
|
||||
if (schedulerTitle == '') {
|
||||
document.getElementById('form[SCH_NAME]').focus();
|
||||
msgBox("@G::LoadTranslation(ID_REQUIRED_NAME_CASE_SCHEDULER)", 'alert');
|
||||
return false;
|
||||
}
|
||||
|
||||
var listNames = document.getElementById('form[SCH_LIST]').value;
|
||||
listNames = listNames.split("^");
|
||||
if (schedulerTitle.toLowerCase() == (listNames[i]).toLowerCase()) {
|
||||
if (schedulerTitle == listNames[i]) {
|
||||
document.getElementById('form[SCH_NAME]').focus();
|
||||
msgBox("@G::LoadTranslation(ID_DUPLICATE_CASE_SCHEDULER_NAME)", 'alert');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
getField("SCH_NAME").value = schedulerTitle;
|
||||
|
||||
var validFields = true;
|
||||
var requiredFields = '';
|
||||
var badFormatFields = '';
|
||||
var startDate = document.getElementById('form[SCH_START_DATE]').value;
|
||||
var endDate = document.getElementById('form[SCH_END_DATE]').value;
|
||||
var validFields = true;
|
||||
var requiredFields = '';
|
||||
var badFormatFields = '';
|
||||
var startDate = document.getElementById('form[SCH_START_DATE]').value;
|
||||
var endDate = document.getElementById('form[SCH_END_DATE]').value;
|
||||
|
||||
startDate = startDate.split("-");
|
||||
endDate = endDate.split("-");
|
||||
startDate = new Date(startDate[0],startDate[1],startDate[2]);
|
||||
endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
startDate = startDate.split("-");
|
||||
endDate = endDate.split("-");
|
||||
startDate = new Date(startDate[0],startDate[1],startDate[2]);
|
||||
endDate = new Date(endDate[0],endDate[1],endDate[2]);
|
||||
|
||||
if (document.getElementById('form[SCH_START_DATE]').value==''){
|
||||
requiredFields = requiredFields + 'Start Date,';
|
||||
validFields = false;
|
||||
} else {
|
||||
if (document.getElementById('form[SCH_END_DATE]').value!='')
|
||||
if (startDate>endDate){
|
||||
badFormatFields = badFormatFields + 'Start Date can\'t be greater than End Date';
|
||||
if (document.getElementById('form[SCH_START_DATE]').value=='') {
|
||||
requiredFields = requiredFields + 'Start Date,';
|
||||
validFields = false;
|
||||
} else {
|
||||
if (document.getElementById('form[SCH_END_DATE]').value!='') {
|
||||
if (startDate>endDate) {
|
||||
badFormatFields = badFormatFields + 'Start Date can\'t be greater than End Date';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if the field time is compliant with the regular expression
|
||||
// for time format hh:mm
|
||||
var regExpString = "([0-1]\\d|2[0-3]):([0-5]\\d)";
|
||||
var timeRegexp = new RegExp(regExpString);
|
||||
if (document.getElementById('form[SCH_OPTION]').value != 5) {
|
||||
if (!timeRegexp.test(document.getElementById('form[SCH_START_TIME]').value)) {
|
||||
msgBox('The time format is invalid','alert');
|
||||
return false;
|
||||
}
|
||||
if (document.getElementById('form[SCH_START_TIME]').value=='') {
|
||||
requiredFields = requiredFields + 'Execution Time,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
// check if the field time is compliant with the regular expression
|
||||
// for time format hh:mm
|
||||
var regExpString = "([0-1]\\d|2[0-3]):([0-5]\\d)";
|
||||
var timeRegexp = new RegExp(regExpString);
|
||||
if (document.getElementById('form[SCH_OPTION]').value != 5) {
|
||||
if (!timeRegexp.test(document.getElementById('form[SCH_START_TIME]').value)){
|
||||
msgBox('The time format is invalid','alert');
|
||||
return false;
|
||||
}
|
||||
if (document.getElementById('form[SCH_START_TIME]').value==''){
|
||||
requiredFields = requiredFields + 'Execution Time,';
|
||||
validFields = false;
|
||||
}
|
||||
} else {
|
||||
if (document.getElementById('form[SCH_REPEAT_EVERY]').value==''){
|
||||
requiredFields = requiredFields + 'Every,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
switch(document.getElementById('form[SCH_OPTION]').value){
|
||||
// daily
|
||||
case '1':
|
||||
//if(document.getElementById('form[SCH_DAYS_PERFORM_TASK][1]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][2]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][3]').checked==true){
|
||||
} else {
|
||||
if (document.getElementById('form[SCH_REPEAT_EVERY]').value=='') {
|
||||
requiredFields = requiredFields + 'Every,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
switch (document.getElementById('form[SCH_OPTION]').value) {
|
||||
// daily
|
||||
case '1':
|
||||
//if(document.getElementById('form[SCH_DAYS_PERFORM_TASK][1]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][2]').checked==true||document.getElementById('form[SCH_DAYS_PERFORM_TASK][3]').checked==true){
|
||||
if(document.getElementById('form[SCH_DAYS_PERFORM_TASK]').value!=''){
|
||||
validFields = true;
|
||||
} else {
|
||||
requiredFields = requiredFields + 'Weekdays,';
|
||||
validFields = false;
|
||||
}
|
||||
|
||||
break;
|
||||
// weekly
|
||||
case '2':
|
||||
if (document.getElementById('form[SCH_EVERY_DAYS]').value==''){
|
||||
requiredFields = requiredFields + 'Number of Weeks,';
|
||||
validFields = false;
|
||||
} else {
|
||||
for (week=1;week<=4;week++){
|
||||
weekIdOne = 'form[SCH_WEEK_DAYS]['+week+']';
|
||||
if (document.getElementById(weekIdOne).checked==true){
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
for (week=1;week<=3;week++){
|
||||
weekIdTwo = 'form[SCH_WEEK_DAYS_2]['+(week+4)+']';
|
||||
if (document.getElementById(weekIdTwo).checked==true){
|
||||
break;
|
||||
// weekly
|
||||
case '2':
|
||||
if (document.getElementById('form[SCH_EVERY_DAYS]').value=='') {
|
||||
requiredFields = requiredFields + 'Number of Weeks,';
|
||||
validFields = false;
|
||||
} else {
|
||||
for (week=1;week<=4;week++) {
|
||||
weekIdOne = 'form[SCH_WEEK_DAYS]['+week+']';
|
||||
if (document.getElementById(weekIdOne).checked==true) {
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
requiredFields = requiredFields + 'Weeks,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
//monthly
|
||||
case '3':
|
||||
if (document.getElementById('form[SCH_START_DAY][1]').checked==true||document.getElementById('form[SCH_START_DAY][2]').checked==true){
|
||||
for (month=1;month<=4;month++){
|
||||
monthIdOne = 'form[SCH_MONTHS]['+month+']';
|
||||
monthIdTwo = 'form[SCH_MONTHS_2]['+(month+4)+']';
|
||||
monthIdThree = 'form[SCH_MONTHS_3]['+(month+8)+']';
|
||||
|
||||
if (document.getElementById(monthIdOne).checked==true||document.getElementById(monthIdTwo).checked==true||document.getElementById(monthIdThree).checked==true){
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
if (!validFields){
|
||||
for (week=1;week<=3;week++){
|
||||
weekIdTwo = 'form[SCH_WEEK_DAYS_2]['+(week+4)+']';
|
||||
if (document.getElementById(weekIdTwo).checked==true) {
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
requiredFields = requiredFields + 'Weeks,';
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
requiredFields = requiredFields + 'Months,';
|
||||
break;
|
||||
//monthly
|
||||
case '3':
|
||||
if (document.getElementById('form[SCH_START_DAY][1]').checked==true||document.getElementById('form[SCH_START_DAY][2]').checked==true){
|
||||
for (month=1;month<=4;month++){
|
||||
monthIdOne = 'form[SCH_MONTHS]['+month+']';
|
||||
monthIdTwo = 'form[SCH_MONTHS_2]['+(month+4)+']';
|
||||
monthIdThree = 'form[SCH_MONTHS_3]['+(month+8)+']';
|
||||
|
||||
if (document.getElementById(monthIdOne).checked==true||document.getElementById(monthIdTwo).checked==true||document.getElementById(monthIdThree).checked==true){
|
||||
validFields = true;
|
||||
break;
|
||||
} else {
|
||||
validFields = false;
|
||||
}
|
||||
}
|
||||
if (!validFields){
|
||||
requiredFields = requiredFields + 'Months,';
|
||||
validFields = false;
|
||||
}
|
||||
} else {
|
||||
requiredFields = requiredFields + 'Start Day,';
|
||||
validFields = false;
|
||||
}
|
||||
} else {
|
||||
requiredFields = requiredFields + 'Start Day,';
|
||||
break;
|
||||
//run once
|
||||
case '4':
|
||||
validFields = true;
|
||||
break;
|
||||
//run every
|
||||
case '5':
|
||||
validFields = true;
|
||||
break;
|
||||
default:
|
||||
validFields = false;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
//run once
|
||||
case '4':
|
||||
|
||||
validFields = true;
|
||||
|
||||
break;
|
||||
//run every
|
||||
case '5':
|
||||
|
||||
validFields = true;
|
||||
|
||||
break;
|
||||
default:
|
||||
validFields = false;
|
||||
break;
|
||||
}
|
||||
if (requiredFields!='') {
|
||||
var message = "The fields "+requiredFields+" can\'t be empty";
|
||||
msgBox(message, 'alert');
|
||||
return false;
|
||||
} else {
|
||||
if (badFormatFields!=''){
|
||||
var message = badFormatFields;
|
||||
break;
|
||||
}
|
||||
if (requiredFields!='') {
|
||||
var message = "The fields "+requiredFields+" can\'t be empty";
|
||||
msgBox(message, 'alert');
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
if (badFormatFields!='') {
|
||||
var message = badFormatFields;
|
||||
msgBox(message, 'alert');
|
||||
return false;
|
||||
} else {
|
||||
oForm.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetForm(){
|
||||
|
||||
BIN
workflow/public_html/images/processmaker.logo2.png
Normal file
BIN
workflow/public_html/images/processmaker.logo2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Reference in New Issue
Block a user