Merge remote branch 'upstream/master'

This commit is contained in:
marcelo.cuiza
2015-02-03 16:41:02 -04:00
9 changed files with 187 additions and 43 deletions

2
workflow/engine/classes/model/BpmnFlow.php Normal file → Executable file
View File

@@ -72,7 +72,7 @@ class BpmnFlow extends BaseBpmnFlow
if (! is_null($prjUid)) { if (! is_null($prjUid)) {
$c->add(BpmnFlowPeer::PRJ_UID, $prjUid, Criteria::EQUAL); $c->add(BpmnFlowPeer::PRJ_UID, $prjUid, Criteria::EQUAL);
} }
$c->addAscendingOrderByColumn(BpmnFlowPeer::FLO_POSITION);
$rs = BpmnFlowPeer::doSelectRS($c); $rs = BpmnFlowPeer::doSelectRS($c);
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);

View File

@@ -101,6 +101,8 @@ class BpmnFlowMapBuilder
$tMap->addColumn('FLO_STATE', 'FloState', 'string', CreoleTypes::LONGVARCHAR, false, null); $tMap->addColumn('FLO_STATE', 'FloState', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('FLO_POSITION', 'FloPosition', 'int', CreoleTypes::INTEGER, true, null);
} // doBuild() } // doBuild()
} // BpmnFlowMapBuilder } // BpmnFlowMapBuilder

60
workflow/engine/classes/model/om/BaseBpmnFlow.php Normal file → Executable file
View File

@@ -136,6 +136,12 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
protected $flo_state; protected $flo_state;
/** /**
* The value for the flo_position field.
* @var int
*/
protected $flo_position = 0;
/**
* @var BpmnProject * @var BpmnProject
*/ */
protected $aBpmnProject; protected $aBpmnProject;
@@ -358,6 +364,17 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
} }
/** /**
* Get the [flo_position] column value.
*
* @return int
*/
public function getFloPosition()
{
return $this->flo_position;
}
/*
* Set the value of [flo_uid] column. * Set the value of [flo_uid] column.
* *
* @param string $v new value * @param string $v new value
@@ -761,6 +778,28 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
} // setFloState() } // setFloState()
/**
* Set the value of [flo_position] column.
*
* @param int $v new value
* @return void
*/
public function setFloPosition($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->flo_position !== $v || $v === 0) {
$this->flo_position = $v;
$this->modifiedColumns[] = BpmnFlowPeer::FLO_POSITION;
}
} // setFloPosition()
/** /**
* Hydrates (populates) the object variables with values from the database resultset. * Hydrates (populates) the object variables with values from the database resultset.
* *
@@ -814,12 +853,14 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
$this->flo_state = $rs->getString($startcol + 17); $this->flo_state = $rs->getString($startcol + 17);
$this->flo_position = $rs->getInt($startcol + 18);
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer. // FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 18; // 18 = BpmnFlowPeer::NUM_COLUMNS - BpmnFlowPeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 19; // 19 = BpmnFlowPeer::NUM_COLUMNS - BpmnFlowPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating BpmnFlow object", $e); throw new PropelException("Error populating BpmnFlow object", $e);
@@ -1115,6 +1156,9 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
case 17: case 17:
return $this->getFloState(); return $this->getFloState();
break; break;
case 18:
return $this->getFloPosition();
break;
default: default:
return null; return null;
break; break;
@@ -1153,6 +1197,7 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
$keys[15] => $this->getFloX2(), $keys[15] => $this->getFloX2(),
$keys[16] => $this->getFloY2(), $keys[16] => $this->getFloY2(),
$keys[17] => $this->getFloState(), $keys[17] => $this->getFloState(),
$keys[18] => $this->getFloPosition(),
); );
return $result; return $result;
} }
@@ -1238,6 +1283,9 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
case 17: case 17:
$this->setFloState($value); $this->setFloState($value);
break; break;
case 18:
$this->setFloPosition($value);
break;
} // switch() } // switch()
} }
@@ -1333,6 +1381,10 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
$this->setFloState($arr[$keys[17]]); $this->setFloState($arr[$keys[17]]);
} }
if (array_key_exists($keys[18], $arr)) {
$this->setFloPosition($arr[$keys[18]]);
}
} }
/** /**
@@ -1416,6 +1468,10 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
$criteria->add(BpmnFlowPeer::FLO_STATE, $this->flo_state); $criteria->add(BpmnFlowPeer::FLO_STATE, $this->flo_state);
} }
if ($this->isColumnModified(BpmnFlowPeer::FLO_POSITION)) {
$criteria->add(BpmnFlowPeer::FLO_POSITION, $this->flo_position);
}
return $criteria; return $criteria;
} }
@@ -1504,6 +1560,8 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
$copyObj->setFloState($this->flo_state); $copyObj->setFloState($this->flo_state);
$copyObj->setFloPosition($this->flo_position);
$copyObj->setNew(true); $copyObj->setNew(true);

23
workflow/engine/classes/model/om/BaseBpmnFlowPeer.php Normal file → Executable file
View File

@@ -25,7 +25,7 @@ abstract class BaseBpmnFlowPeer
const CLASS_DEFAULT = 'classes.model.BpmnFlow'; const CLASS_DEFAULT = 'classes.model.BpmnFlow';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 18; const NUM_COLUMNS = 19;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -85,6 +85,9 @@ abstract class BaseBpmnFlowPeer
/** the column name for the FLO_STATE field */ /** the column name for the FLO_STATE field */
const FLO_STATE = 'BPMN_FLOW.FLO_STATE'; const FLO_STATE = 'BPMN_FLOW.FLO_STATE';
/** the column name for the FLO_POSITION field */
const FLO_POSITION = 'BPMN_FLOW.FLO_POSITION';
/** The PHP to DB Name Mapping */ /** The PHP to DB Name Mapping */
private static $phpNameMap = null; private static $phpNameMap = null;
@@ -96,10 +99,10 @@ abstract class BaseBpmnFlowPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('FloUid', 'PrjUid', 'DiaUid', 'FloType', 'FloName', 'FloElementOrigin', 'FloElementOriginType', 'FloElementOriginPort', 'FloElementDest', 'FloElementDestType', 'FloElementDestPort', 'FloIsInmediate', 'FloCondition', 'FloX1', 'FloY1', 'FloX2', 'FloY2', 'FloState', ), BasePeer::TYPE_PHPNAME => array ('FloUid', 'PrjUid', 'DiaUid', 'FloType', 'FloName', 'FloElementOrigin', 'FloElementOriginType', 'FloElementOriginPort', 'FloElementDest', 'FloElementDestType', 'FloElementDestPort', 'FloIsInmediate', 'FloCondition', 'FloX1', 'FloY1', 'FloX2', 'FloY2', 'FloState', 'FloPosition', ),
BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID, BpmnFlowPeer::PRJ_UID, BpmnFlowPeer::DIA_UID, BpmnFlowPeer::FLO_TYPE, BpmnFlowPeer::FLO_NAME, BpmnFlowPeer::FLO_ELEMENT_ORIGIN, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT, BpmnFlowPeer::FLO_ELEMENT_DEST, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT, BpmnFlowPeer::FLO_IS_INMEDIATE, BpmnFlowPeer::FLO_CONDITION, BpmnFlowPeer::FLO_X1, BpmnFlowPeer::FLO_Y1, BpmnFlowPeer::FLO_X2, BpmnFlowPeer::FLO_Y2, BpmnFlowPeer::FLO_STATE, ), BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID, BpmnFlowPeer::PRJ_UID, BpmnFlowPeer::DIA_UID, BpmnFlowPeer::FLO_TYPE, BpmnFlowPeer::FLO_NAME, BpmnFlowPeer::FLO_ELEMENT_ORIGIN, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT, BpmnFlowPeer::FLO_ELEMENT_DEST, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT, BpmnFlowPeer::FLO_IS_INMEDIATE, BpmnFlowPeer::FLO_CONDITION, BpmnFlowPeer::FLO_X1, BpmnFlowPeer::FLO_Y1, BpmnFlowPeer::FLO_X2, BpmnFlowPeer::FLO_Y2, BpmnFlowPeer::FLO_STATE, BpmnFlowPeer::FLO_POSITION, ),
BasePeer::TYPE_FIELDNAME => array ('FLO_UID', 'PRJ_UID', 'DIA_UID', 'FLO_TYPE', 'FLO_NAME', 'FLO_ELEMENT_ORIGIN', 'FLO_ELEMENT_ORIGIN_TYPE', 'FLO_ELEMENT_ORIGIN_PORT', 'FLO_ELEMENT_DEST', 'FLO_ELEMENT_DEST_TYPE', 'FLO_ELEMENT_DEST_PORT', 'FLO_IS_INMEDIATE', 'FLO_CONDITION', 'FLO_X1', 'FLO_Y1', 'FLO_X2', 'FLO_Y2', 'FLO_STATE', ), BasePeer::TYPE_FIELDNAME => array ('FLO_UID', 'PRJ_UID', 'DIA_UID', 'FLO_TYPE', 'FLO_NAME', 'FLO_ELEMENT_ORIGIN', 'FLO_ELEMENT_ORIGIN_TYPE', 'FLO_ELEMENT_ORIGIN_PORT', 'FLO_ELEMENT_DEST', 'FLO_ELEMENT_DEST_TYPE', 'FLO_ELEMENT_DEST_PORT', 'FLO_IS_INMEDIATE', 'FLO_CONDITION', 'FLO_X1', 'FLO_Y1', 'FLO_X2', 'FLO_Y2', 'FLO_STATE', 'FLO_POSITION', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
); );
/** /**
@@ -109,10 +112,10 @@ abstract class BaseBpmnFlowPeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('FloUid' => 0, 'PrjUid' => 1, 'DiaUid' => 2, 'FloType' => 3, 'FloName' => 4, 'FloElementOrigin' => 5, 'FloElementOriginType' => 6, 'FloElementOriginPort' => 7, 'FloElementDest' => 8, 'FloElementDestType' => 9, 'FloElementDestPort' => 10, 'FloIsInmediate' => 11, 'FloCondition' => 12, 'FloX1' => 13, 'FloY1' => 14, 'FloX2' => 15, 'FloY2' => 16, 'FloState' => 17, ), BasePeer::TYPE_PHPNAME => array ('FloUid' => 0, 'PrjUid' => 1, 'DiaUid' => 2, 'FloType' => 3, 'FloName' => 4, 'FloElementOrigin' => 5, 'FloElementOriginType' => 6, 'FloElementOriginPort' => 7, 'FloElementDest' => 8, 'FloElementDestType' => 9, 'FloElementDestPort' => 10, 'FloIsInmediate' => 11, 'FloCondition' => 12, 'FloX1' => 13, 'FloY1' => 14, 'FloX2' => 15, 'FloY2' => 16, 'FloState' => 17, 'FloPosition' => 18, ),
BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID => 0, BpmnFlowPeer::PRJ_UID => 1, BpmnFlowPeer::DIA_UID => 2, BpmnFlowPeer::FLO_TYPE => 3, BpmnFlowPeer::FLO_NAME => 4, BpmnFlowPeer::FLO_ELEMENT_ORIGIN => 5, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => 6, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT => 7, BpmnFlowPeer::FLO_ELEMENT_DEST => 8, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE => 9, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT => 10, BpmnFlowPeer::FLO_IS_INMEDIATE => 11, BpmnFlowPeer::FLO_CONDITION => 12, BpmnFlowPeer::FLO_X1 => 13, BpmnFlowPeer::FLO_Y1 => 14, BpmnFlowPeer::FLO_X2 => 15, BpmnFlowPeer::FLO_Y2 => 16, BpmnFlowPeer::FLO_STATE => 17, ), BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID => 0, BpmnFlowPeer::PRJ_UID => 1, BpmnFlowPeer::DIA_UID => 2, BpmnFlowPeer::FLO_TYPE => 3, BpmnFlowPeer::FLO_NAME => 4, BpmnFlowPeer::FLO_ELEMENT_ORIGIN => 5, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => 6, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT => 7, BpmnFlowPeer::FLO_ELEMENT_DEST => 8, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE => 9, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT => 10, BpmnFlowPeer::FLO_IS_INMEDIATE => 11, BpmnFlowPeer::FLO_CONDITION => 12, BpmnFlowPeer::FLO_X1 => 13, BpmnFlowPeer::FLO_Y1 => 14, BpmnFlowPeer::FLO_X2 => 15, BpmnFlowPeer::FLO_Y2 => 16, BpmnFlowPeer::FLO_STATE => 17, BpmnFlowPeer::FLO_POSITION => 18, ),
BasePeer::TYPE_FIELDNAME => array ('FLO_UID' => 0, 'PRJ_UID' => 1, 'DIA_UID' => 2, 'FLO_TYPE' => 3, 'FLO_NAME' => 4, 'FLO_ELEMENT_ORIGIN' => 5, 'FLO_ELEMENT_ORIGIN_TYPE' => 6, 'FLO_ELEMENT_ORIGIN_PORT' => 7, 'FLO_ELEMENT_DEST' => 8, 'FLO_ELEMENT_DEST_TYPE' => 9, 'FLO_ELEMENT_DEST_PORT' => 10, 'FLO_IS_INMEDIATE' => 11, 'FLO_CONDITION' => 12, 'FLO_X1' => 13, 'FLO_Y1' => 14, 'FLO_X2' => 15, 'FLO_Y2' => 16, 'FLO_STATE' => 17, ), BasePeer::TYPE_FIELDNAME => array ('FLO_UID' => 0, 'PRJ_UID' => 1, 'DIA_UID' => 2, 'FLO_TYPE' => 3, 'FLO_NAME' => 4, 'FLO_ELEMENT_ORIGIN' => 5, 'FLO_ELEMENT_ORIGIN_TYPE' => 6, 'FLO_ELEMENT_ORIGIN_PORT' => 7, 'FLO_ELEMENT_DEST' => 8, 'FLO_ELEMENT_DEST_TYPE' => 9, 'FLO_ELEMENT_DEST_PORT' => 10, 'FLO_IS_INMEDIATE' => 11, 'FLO_CONDITION' => 12, 'FLO_X1' => 13, 'FLO_Y1' => 14, 'FLO_X2' => 15, 'FLO_Y2' => 16, 'FLO_STATE' => 17, 'FLO_POSITION' => 18, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
); );
/** /**
@@ -249,6 +252,8 @@ abstract class BaseBpmnFlowPeer
$criteria->addSelectColumn(BpmnFlowPeer::FLO_STATE); $criteria->addSelectColumn(BpmnFlowPeer::FLO_STATE);
$criteria->addSelectColumn(BpmnFlowPeer::FLO_POSITION);
} }
const COUNT = 'COUNT(BPMN_FLOW.FLO_UID)'; const COUNT = 'COUNT(BPMN_FLOW.FLO_UID)';

View File

@@ -3583,6 +3583,7 @@
<column name="FLO_X2" type="INTEGER" required="true" default="0"/> <column name="FLO_X2" type="INTEGER" required="true" default="0"/>
<column name="FLO_Y2" type="INTEGER" required="true" default="0"/> <column name="FLO_Y2" type="INTEGER" required="true" default="0"/>
<column name="FLO_STATE" type="LONGVARCHAR" required="false"/> <column name="FLO_STATE" type="LONGVARCHAR" required="false"/>
<column name="FLO_POSITION" type="INTEGER" required="true" default="0"/>
<foreign-key name="fk_bpmn_flow_project" foreignTable="BPMN_PROJECT"> <foreign-key name="fk_bpmn_flow_project" foreignTable="BPMN_PROJECT">
<reference local="PRJ_UID" foreign="PRJ_UID"/> <reference local="PRJ_UID" foreign="PRJ_UID"/>
</foreign-key> </foreign-key>

View File

@@ -1907,6 +1907,7 @@ CREATE TABLE `BPMN_FLOW`
`FLO_X2` INTEGER default 0 NOT NULL, `FLO_X2` INTEGER default 0 NOT NULL,
`FLO_Y2` INTEGER default 0 NOT NULL, `FLO_Y2` INTEGER default 0 NOT NULL,
`FLO_STATE` MEDIUMTEXT, `FLO_STATE` MEDIUMTEXT,
`FLO_POSITION` INTEGER default 0 NOT NULL,
PRIMARY KEY (`FLO_UID`), PRIMARY KEY (`FLO_UID`),
KEY `BPMN_FLOW_I_1`(`FLO_UID`), KEY `BPMN_FLOW_I_1`(`FLO_UID`),
KEY `BPMN_FLOW_I_2`(`PRJ_UID`), KEY `BPMN_FLOW_I_2`(`PRJ_UID`),

44
workflow/engine/methods/cases/cases_SaveData.php Normal file → Executable file
View File

@@ -69,6 +69,10 @@ try {
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs" ); $oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs" );
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] ); $Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
if ($swpmdynaform) {
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $pmdynaform );
}
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() ); $Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] ); $Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] );
@@ -123,27 +127,27 @@ try {
$aAux = explode( '|', $oForm->fields[$oForm->fields[$sField]->pmconnection]->keys ); $aAux = explode( '|', $oForm->fields[$oForm->fields[$sField]->pmconnection]->keys );
$i = 0; $i = 0;
$aValues = array (); $aValues = array ();
if($aData == "" || count($aData['FIELDS']) < 1){ if ($aData == "" || count($aData['FIELDS']) < 1) {
$message = G::LoadTranslation( 'ID_PMTABLE_NOT_FOUNDED_SAVED_DATA' ); $message = G::LoadTranslation( 'ID_PMTABLE_NOT_FOUNDED_SAVED_DATA' );
G::SendMessageText( $message, "WARNING" ); G::SendMessageText( $message, "WARNING" );
$aRow = false; $aRow = false;
} else { } else {
foreach ($aData['FIELDS'] as $aField) { foreach ($aData['FIELDS'] as $aField) {
if ($aField['FLD_KEY'] == '1') { if ($aField['FLD_KEY'] == '1') {
$aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : ''); $aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : '');
$i ++; $i ++;
} }
if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) { if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) {
$aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField]; $aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField];
} else { } else {
$aValues[$aField['FLD_NAME']] = ''; $aValues[$aField['FLD_NAME']] = '';
} }
} }
try { try {
$aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys ); $aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys );
} catch (Exception $oError) { } catch (Exception $oError) {
$aRow = false; $aRow = false;
} }
} }
if ($aRow) { if ($aRow) {

46
workflow/engine/src/ProcessMaker/Project/Bpmn.php Normal file → Executable file
View File

@@ -684,6 +684,7 @@ class Bpmn extends Handler
$flow->fromArray($data, BasePeer::TYPE_FIELDNAME); $flow->fromArray($data, BasePeer::TYPE_FIELDNAME);
$flow->setPrjUid($this->getUid()); $flow->setPrjUid($this->getUid());
$flow->setDiaUid($this->getDiagram("object")->getDiaUid()); $flow->setDiaUid($this->getDiagram("object")->getDiaUid());
$flow->setFloPosition($this->getFlowNextPosition($data["FLO_UID"], $data["FLO_TYPE"], $data["FLO_ELEMENT_ORIGIN"]));
$flow->save(); $flow->save();
self::log("Add Flow Success!"); self::log("Add Flow Success!");
@@ -746,6 +747,8 @@ class Bpmn extends Handler
self::log("Remove Flow: $floUid"); self::log("Remove Flow: $floUid");
$flow = FlowPeer::retrieveByPK($floUid); $flow = FlowPeer::retrieveByPK($floUid);
$this->reOrderFlowPosition($flow->getFloElementOrigin(), $flow->getFloPosition());
$flow->delete(); $flow->delete();
self::log("Remove Flow Success!"); self::log("Remove Flow Success!");
@@ -1242,5 +1245,48 @@ class Bpmn extends Handler
throw $e; throw $e;
} }
} }
public function getFlowNextPosition ($sFloUid, $sFloType, $sFloElementOrigin)
{
try {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS FLOW_POS' );
$oCriteria->add(\BpmnFlowPeer::PRJ_UID, $this->getUid());
$oCriteria->add(\BpmnFlowPeer::DIA_UID, $this->getDiagram("object")->getDiaUid());
$oCriteria->add(\BpmnFlowPeer::FLO_UID, $sFloUid, \Criteria::NOT_EQUAL);
$oCriteria->add(\BpmnFlowPeer::FLO_TYPE, $sFloType);
$oCriteria->add(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $sFloElementOrigin);
$oDataset = \BpmnFlowPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
return (int)($aRow["FLOW_POS"]);
} catch (Exception $oException) {
throw $oException;
}
}
public function reOrderFlowPosition ($sFloOrigin, $iPosition)
{
try {
$con = \Propel::getConnection('workflow');
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( \BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $sFloOrigin );
$oCriteria->add( \BpmnFlowPeer::FLO_POSITION, $iPosition, '>' );
$oDataset = \BpmnFlowPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
$oCriteria2 = new Criteria('workflow');
$oCriteria2->add( \BpmnFlowPeer::FLO_POSITION, $aRow['FLO_POSITION'] - 1);
BasePeer::doUpdate($oCriteria, $oCriteria2, $con);
$oDataset->next();
} catch (Exception $oException) {
throw $oException;
}
}
} }

View File

@@ -38,9 +38,21 @@ emailServer.application = {
//Data //Data
var p; var p;
/*----------------------------------********---------------------------------*/
if (Ext.getCmp("chkEmailServerDefault").checked) {
/*----------------------------------********---------------------------------*/
var emailDefault = 1;
/*----------------------------------********---------------------------------*/
} else {
var emailDefault = 0;
}
/*----------------------------------********---------------------------------*/
switch (option) { switch (option) {
case "INS": case "INS":
var typeEmailEngine = Ext.getCmp("cboEmailEngine").getValue(); var typeEmailEngine = Ext.getCmp("cboEmailEngine").getValue();
if (typeEmailEngine == "PHPMAILER") { if (typeEmailEngine == "PHPMAILER") {
var rdoGrpOption = Ext.getCmp("rdoGrpSmtpSecure").getValue(); var rdoGrpOption = Ext.getCmp("rdoGrpSmtpSecure").getValue();
@@ -60,7 +72,7 @@ emailServer.application = {
smtpSecure: smtpSecure, smtpSecure: smtpSecure,
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0, sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
mailTo: Ext.getCmp("txtMailTo").getValue(), mailTo: Ext.getCmp("txtMailTo").getValue(),
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0 emailServerDefault: emailDefault
}; };
} else { } else {
//MAIL //MAIL
@@ -72,7 +84,7 @@ emailServer.application = {
fromName: Ext.getCmp("txtFromName").getValue(), fromName: Ext.getCmp("txtFromName").getValue(),
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0, sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
mailTo: Ext.getCmp("txtMailTo").getValue(), mailTo: Ext.getCmp("txtMailTo").getValue(),
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0 emailServerDefault: emailDefault
}; };
} }
break; break;
@@ -98,7 +110,7 @@ emailServer.application = {
smtpSecure: smtpSecure, smtpSecure: smtpSecure,
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0, sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
mailTo: Ext.getCmp("txtMailTo").getValue(), mailTo: Ext.getCmp("txtMailTo").getValue(),
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0 emailServerDefault: emailDefault
}; };
} else { } else {
//MAIL //MAIL
@@ -111,7 +123,7 @@ emailServer.application = {
fromName: Ext.getCmp("txtFromName").getValue(), fromName: Ext.getCmp("txtFromName").getValue(),
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0, sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
mailTo: Ext.getCmp("txtMailTo").getValue(), mailTo: Ext.getCmp("txtMailTo").getValue(),
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0 emailServerDefault: emailDefault
}; };
} }
break; break;
@@ -144,7 +156,7 @@ emailServer.application = {
smtpSecure: smtpSecure, smtpSecure: smtpSecure,
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0, sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
mailTo: Ext.getCmp("txtMailTo").getValue(), mailTo: Ext.getCmp("txtMailTo").getValue(),
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0 emailServerDefault: emailDefault
}; };
} else { } else {
//MAIL //MAIL
@@ -156,7 +168,7 @@ emailServer.application = {
fromName: Ext.getCmp("txtFromName").getValue(), fromName: Ext.getCmp("txtFromName").getValue(),
sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0, sendTestMail: (Ext.getCmp("chkSendTestMail").checked)? 1 : 0,
mailTo: Ext.getCmp("txtMailTo").getValue(), mailTo: Ext.getCmp("txtMailTo").getValue(),
emailServerDefault: (Ext.getCmp("chkEmailServerDefault").checked)? 1 : 0 emailServerDefault: emailDefault
}; };
} }
break; break;
@@ -251,7 +263,9 @@ emailServer.application = {
Ext.getCmp("txtMailTo").setValue(""); Ext.getCmp("txtMailTo").setValue("");
/*----------------------------------********---------------------------------*/
Ext.getCmp("chkEmailServerDefault").setValue(false); Ext.getCmp("chkEmailServerDefault").setValue(false);
/*----------------------------------********---------------------------------*/
winData.setTitle(_("ID_EMAIL_SERVER_NEW")); winData.setTitle(_("ID_EMAIL_SERVER_NEW"));
winData.setDisabled(false); winData.setDisabled(false);
@@ -287,8 +301,17 @@ emailServer.application = {
emailServerSetMailTo(Ext.getCmp("chkSendTestMail").checked); emailServerSetMailTo(Ext.getCmp("chkSendTestMail").checked);
Ext.getCmp("txtMailTo").setValue(record.get("MAIL_TO")); Ext.getCmp("txtMailTo").setValue(record.get("MAIL_TO"));
Ext.getCmp("chkEmailServerDefault").setValue((parseInt(record.get("MESS_DEFAULT")) == 1)? true : false);
/*----------------------------------********---------------------------------*/
if (parseInt(record.get("MESS_DEFAULT")) == 1) {
/*----------------------------------********---------------------------------*/
Ext.getCmp("chkEmailServerDefault").setValue(true);
/*----------------------------------********---------------------------------*/
} else {
Ext.getCmp("chkEmailServerDefault").setValue(false);
}
/*----------------------------------********---------------------------------*/
winData.setTitle(_("ID_EMAIL_SERVER_EDIT")); winData.setTitle(_("ID_EMAIL_SERVER_EDIT"));
winData.setDisabled(false); winData.setDisabled(false);
winData.show(); winData.show();
@@ -591,6 +614,7 @@ emailServer.application = {
} }
}); });
var txtAccountFrom = new Ext.form.TextField({ var txtAccountFrom = new Ext.form.TextField({
id: "txtAccountFrom", id: "txtAccountFrom",
name: "txtAccountFrom", name: "txtAccountFrom",
@@ -599,7 +623,7 @@ emailServer.application = {
vtype: "emailUrlValidation" vtype: "emailUrlValidation"
}); });
var txtPassword = new Ext.form.TextField({ var txtPassword = new Ext.form.TextField({
id: "txtPassword", id: "txtPassword",
name: "txtPassword", name: "txtPassword",
@@ -662,14 +686,14 @@ emailServer.application = {
hidden: true hidden: true
}); });
/*----------------------------------********---------------------------------*/
var chkEmailServerDefault = new Ext.form.Checkbox({ var chkEmailServerDefault = new Ext.form.Checkbox({
id: "chkEmailServerDefault", id: "chkEmailServerDefault",
name: "chkEmailServerDefault", name: "chkEmailServerDefault",
boxLabel: _("ID_EMAIL_SERVER_THIS_CONFIGURATION_IS_DEFAULT") boxLabel: _("ID_EMAIL_SERVER_THIS_CONFIGURATION_IS_DEFAULT")
}); });
/*----------------------------------********---------------------------------*/
var btnTest = new Ext.Action({ var btnTest = new Ext.Action({
id: "btnTest", id: "btnTest",
text: _("ID_TEST"), text: _("ID_TEST"),
@@ -760,8 +784,11 @@ emailServer.application = {
txtFromName, txtFromName,
rdoGrpSmtpSecure, rdoGrpSmtpSecure,
chkSendTestMail, chkSendTestMail,
txtMailTo, txtMailTo
/*----------------------------------********---------------------------------*/
,
chkEmailServerDefault chkEmailServerDefault
/*----------------------------------********---------------------------------*/
] ]
}) })
], ],