Added Load,update function and Gateway position in UI

This commit is contained in:
girish
2010-12-13 12:37:36 +00:00
parent 2c90bb75b7
commit 1a53972092
2 changed files with 97 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ G::LoadClass('tasks');
G::LoadClass('derivation');
require_once 'classes/model/Users.php';
require_once 'classes/model/Configuration.php';
require_once 'classes/model/Gateway.php';
require_once 'classes/model/Event.php';
class Xpdl extends processes
{
@@ -3456,8 +3457,8 @@ class Xpdl extends processes
$coordinateY=$idVal['TAS_POSY'];
}
}
$positionX=$coordinateX+35;
$positionY=$coordinateY+85;
$positionX=$coordinateX+62;
$positionY=$coordinateY+55;
if($idTask != $taskParallel){
$taskParallel = $idTask;
$routeParallel = $idRoute;
@@ -3538,8 +3539,8 @@ class Xpdl extends processes
$coordinateY=$idVal['TAS_POSY'];
}
}
$positionX=$coordinateX+35;
$positionY=$coordinateY+85;
$positionX=$coordinateX+62;
$positionY=$coordinateY+55;
if($idTask != $taskEvaluate){
$taskEvaluate = $idTask;
$routeEvaluate = $idRoute;
@@ -3586,8 +3587,8 @@ class Xpdl extends processes
$coordinateY = $idVal['TAS_POSY'];
}
}
$positionX=$coordinateX+60;
$positionY=$coordinateY+40;
$positionX=$coordinateX+62;
$positionY=$coordinateY+55;
if($idTask != $taskParallelEv){
$taskParallelEv = $idTask;
$routeParallelEv = $idRoute;

View File

@@ -16,4 +16,94 @@ require_once 'classes/model/om/BaseGateway.php';
*/
class Gateway extends BaseGateway {
function create ($aData)
{
$con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
try
{
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if($this->validate())
{
$result=$this->save();
}
else
{
$e=new Exception("Failed Validation in class ".get_class($this).".");
$e->aValidationFailures=$this->getValidationFailures();
throw($e);
}
$con->commit();
return $result;
}
catch(Exception $e)
{
$con->rollback();
throw($e);
}
}
public function load($GatewayUid)
{
try {
$oRow = GatewayPeer::retrieveByPK( $GatewayUid );
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 '" . $GatewayUid . "' in table Gateway doesn't exist!" ));
}
}
catch (Exception $oError) {
throw($oError);
}
}
public function update($fields)
{
$con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
try
{
$con->begin();
$this->load($fields['GAT_UID']);
$this->fromArray($fields,BasePeer::TYPE_FIELDNAME);
if($this->validate())
{
$result=$this->save();
$con->commit();
return $result;
}
else
{
$con->rollback();
throw(new Exception("Failed Validation in class ".get_class($this)."."));
}
}
catch(Exception $e)
{
$con->rollback();
throw($e);
}
}
function remove($GatewayUid)
{
$con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
try
{
$con->begin();
$this->setGatUid($GatewayUid);
$result=$this->delete();
$con->commit();
return $result;
}
catch(Exception $e)
{
$con->rollback();
throw($e);
}
}
} // Gateway