Merge remote branch 'upstream/master'
This commit is contained in:
@@ -2094,3 +2094,4 @@ function PMFGetCaseNotes ($applicationID, $type='array', $userUid='')
|
|||||||
$response = Cases::getCaseNotes($applicationID, $type, $userUid);
|
$response = Cases::getCaseNotes($applicationID, $type, $userUid);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class.case.php
|
* class.case.php
|
||||||
* @package workflow.engine.classes
|
* @package workflow.engine.classes
|
||||||
@@ -23,7 +24,6 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'classes/model/AdditionalTables.php';
|
require_once 'classes/model/AdditionalTables.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,28 +33,24 @@ require_once 'classes/model/AdditionalTables.php';
|
|||||||
*/
|
*/
|
||||||
class PmTable
|
class PmTable
|
||||||
{
|
{
|
||||||
|
|
||||||
private $dom = null;
|
private $dom = null;
|
||||||
private $schemaFile = '';
|
private $schemaFile = '';
|
||||||
|
|
||||||
private $tableName;
|
private $tableName;
|
||||||
private $columns;
|
private $columns;
|
||||||
|
|
||||||
private $baseDir = '';
|
private $baseDir = '';
|
||||||
private $targetDir = '';
|
private $targetDir = '';
|
||||||
private $configDir = '';
|
private $configDir = '';
|
||||||
private $dataDir = '';
|
private $dataDir = '';
|
||||||
private $classesDir = '';
|
private $classesDir = '';
|
||||||
private $className = '';
|
private $className = '';
|
||||||
|
|
||||||
private $dataSource = '';
|
private $dataSource = '';
|
||||||
private $rootNode;
|
private $rootNode;
|
||||||
|
|
||||||
private $dbConfig;
|
private $dbConfig;
|
||||||
private $db;
|
private $db;
|
||||||
|
|
||||||
private $alterTable = true;
|
private $alterTable = true;
|
||||||
|
|
||||||
function __construct($tableName = null)
|
public function __construct($tableName=null)
|
||||||
{
|
{
|
||||||
if (isset($tableName)) {
|
if (isset($tableName)) {
|
||||||
$this->tableName = $tableName;
|
$this->tableName = $tableName;
|
||||||
@@ -64,13 +60,12 @@ class PmTable
|
|||||||
$this->dbConfig = new StdClass();
|
$this->dbConfig = new StdClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set columns to pmTable
|
* Set columns to pmTable
|
||||||
* @param array $columns contains a array of abjects
|
* @param array $columns contains a array of abjects
|
||||||
* array(StdClass->field_name, field_type, field_size, field_null, field_key, field_autoincrement,...)
|
* array(StdClass->field_name, field_type, field_size, field_null, field_key, field_autoincrement,...)
|
||||||
*/
|
*/
|
||||||
function setColumns($columns)
|
public function setColumns($columns)
|
||||||
{
|
{
|
||||||
$this->columns = $columns;
|
$this->columns = $columns;
|
||||||
}
|
}
|
||||||
@@ -79,7 +74,7 @@ class PmTable
|
|||||||
* Set a data source
|
* Set a data source
|
||||||
* @param string $dbsUid DBS_UID to relate the pmTable to phisical table
|
* @param string $dbsUid DBS_UID to relate the pmTable to phisical table
|
||||||
*/
|
*/
|
||||||
function setDataSource($dbsUid)
|
public function setDataSource($dbsUid)
|
||||||
{
|
{
|
||||||
$this->dataSource = self::resolveDbSource($dbsUid);
|
$this->dataSource = self::resolveDbSource($dbsUid);
|
||||||
|
|
||||||
@@ -92,7 +87,6 @@ class PmTable
|
|||||||
$this->dbConfig->passwd = DB_PASS;
|
$this->dbConfig->passwd = DB_PASS;
|
||||||
$this->dbConfig->port = 3306; //FIXME update this when port for workflow dsn will be available
|
$this->dbConfig->port = 3306; //FIXME update this when port for workflow dsn will be available
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'rp':
|
case 'rp':
|
||||||
$this->dbConfig->adapter = DB_ADAPTER;
|
$this->dbConfig->adapter = DB_ADAPTER;
|
||||||
$this->dbConfig->host = DB_REPORT_HOST;
|
$this->dbConfig->host = DB_REPORT_HOST;
|
||||||
@@ -101,7 +95,6 @@ class PmTable
|
|||||||
$this->dbConfig->passwd = DB_REPORT_PASS;
|
$this->dbConfig->passwd = DB_REPORT_PASS;
|
||||||
$this->dbConfig->port = 3306; //FIXME update this when port for rp dsn will be available
|
$this->dbConfig->port = 3306; //FIXME update this when port for rp dsn will be available
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
require_once 'classes/model/DbSource.php';
|
require_once 'classes/model/DbSource.php';
|
||||||
$oDBSource = new DbSource();
|
$oDBSource = new DbSource();
|
||||||
@@ -123,8 +116,7 @@ class PmTable
|
|||||||
$this->dbConfig->user = $dbSource['DBS_USERNAME'];
|
$this->dbConfig->user = $dbSource['DBS_USERNAME'];
|
||||||
$this->dbConfig->passwd = $dbSource['DBS_PASSWORD'];
|
$this->dbConfig->passwd = $dbSource['DBS_PASSWORD'];
|
||||||
$this->dbConfig->port = $dbSource['DBS_PORT'];
|
$this->dbConfig->port = $dbSource['DBS_PORT'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new Exception("Db source with id $dbsUid does not exist!");
|
throw new Exception("Db source with id $dbsUid does not exist!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,10 +131,15 @@ class PmTable
|
|||||||
public function resolveDbSource($dbsUid)
|
public function resolveDbSource($dbsUid)
|
||||||
{
|
{
|
||||||
switch ($dbsUid) {
|
switch ($dbsUid) {
|
||||||
case 'workflow': case 'wf': case '0': case '': case null:
|
case 'workflow':
|
||||||
|
case 'wf':
|
||||||
|
case '0':
|
||||||
|
case '':
|
||||||
|
case null:
|
||||||
$dbsUid = 'workflow';
|
$dbsUid = 'workflow';
|
||||||
break;
|
break;
|
||||||
case 'rp': case 'report':
|
case 'rp':
|
||||||
|
case 'report':
|
||||||
$dbsUid = 'rp';
|
$dbsUid = 'rp';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -172,7 +169,7 @@ class PmTable
|
|||||||
/**
|
/**
|
||||||
* Build the pmTable with all dependencies
|
* Build the pmTable with all dependencies
|
||||||
*/
|
*/
|
||||||
function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$this->prepare();
|
$this->prepare();
|
||||||
$this->preparePropelIniFile();
|
$this->preparePropelIniFile();
|
||||||
@@ -185,7 +182,7 @@ class PmTable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildModelFor($dbsUid, $tablesList)
|
public function buildModelFor($dbsUid, $tablesList)
|
||||||
{
|
{
|
||||||
$this->setDataSource($dbsUid);
|
$this->setDataSource($dbsUid);
|
||||||
$loadSchema = false;
|
$loadSchema = false;
|
||||||
@@ -198,7 +195,7 @@ class PmTable
|
|||||||
/**
|
/**
|
||||||
* Prepare the pmTable env
|
* Prepare the pmTable env
|
||||||
*/
|
*/
|
||||||
function prepare($loadSchema = true)
|
public function prepare($loadSchema=true)
|
||||||
{
|
{
|
||||||
//prevent execute prepare() twice or more
|
//prevent execute prepare() twice or more
|
||||||
if (is_object($this->dom)) {
|
if (is_object($this->dom)) {
|
||||||
@@ -221,7 +218,7 @@ class PmTable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadSchema()
|
public function loadSchema()
|
||||||
{
|
{
|
||||||
$this->dom = new DOMDocument('1.0', 'utf-8');
|
$this->dom = new DOMDocument('1.0', 'utf-8');
|
||||||
$this->dom->preserveWhiteSpace = false;
|
$this->dom->preserveWhiteSpace = false;
|
||||||
@@ -232,8 +229,7 @@ class PmTable
|
|||||||
throw new Exception('Error: ' . $this->schemaFilename . ' is a invalid xml file!');
|
throw new Exception('Error: ' . $this->schemaFilename . ' is a invalid xml file!');
|
||||||
}
|
}
|
||||||
$this->rootNode = $this->dom->firstChild;
|
$this->rootNode = $this->dom->firstChild;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->rootNode = $this->dom->createElement('database');
|
$this->rootNode = $this->dom->createElement('database');
|
||||||
$this->rootNode->setAttribute('name', $this->dataSource);
|
$this->rootNode->setAttribute('name', $this->dataSource);
|
||||||
$this->dom->appendChild($this->rootNode);
|
$this->dom->appendChild($this->rootNode);
|
||||||
@@ -243,7 +239,7 @@ class PmTable
|
|||||||
/**
|
/**
|
||||||
* Build the xml schema for propel
|
* Build the xml schema for propel
|
||||||
*/
|
*/
|
||||||
function buildSchema()
|
public function buildSchema()
|
||||||
{
|
{
|
||||||
$tableNode = $this->dom->createElement('table');
|
$tableNode = $this->dom->createElement('table');
|
||||||
$tableNode->setAttribute('name', $this->tableName);
|
$tableNode->setAttribute('name', $this->tableName);
|
||||||
@@ -295,10 +291,11 @@ class PmTable
|
|||||||
$xpath = new DOMXPath($this->dom);
|
$xpath = new DOMXPath($this->dom);
|
||||||
$xtable = $xpath->query('/database/table[@name="' . $this->tableName . '"]');
|
$xtable = $xpath->query('/database/table[@name="' . $this->tableName . '"]');
|
||||||
|
|
||||||
if ($xtable->length == 0) { //the table definition does not exist, then just append the new node
|
if ($xtable->length == 0) {
|
||||||
|
//the table definition does not exist, then just append the new node
|
||||||
$this->rootNode->appendChild($tableNode);
|
$this->rootNode->appendChild($tableNode);
|
||||||
}
|
} else {
|
||||||
else { // the table definition already exist, then replace the node
|
// the table definition already exist, then replace the node
|
||||||
$replacedNode = $xtable->item(0);
|
$replacedNode = $xtable->item(0);
|
||||||
$this->rootNode->replaceChild($tableNode, $replacedNode);
|
$this->rootNode->replaceChild($tableNode, $replacedNode);
|
||||||
}
|
}
|
||||||
@@ -359,8 +356,7 @@ class PmTable
|
|||||||
if (is_object($con)) {
|
if (is_object($con)) {
|
||||||
try {
|
try {
|
||||||
$stmt->executeQuery("DROP TABLE {$tableName}");
|
$stmt->executeQuery("DROP TABLE {$tableName}");
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
throw new Exception("Physical table '$tableName' does not exist!");
|
throw new Exception("Physical table '$tableName' does not exist!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -374,7 +370,6 @@ class PmTable
|
|||||||
$this->dom->save($this->configDir . $this->schemaFilename);
|
$this->dom->save($this->configDir . $this->schemaFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare and create if not exists the propel ini file
|
* Prepare and create if not exists the propel ini file
|
||||||
*/
|
*/
|
||||||
@@ -390,7 +385,8 @@ class PmTable
|
|||||||
throw new Exception("Invalid or not supported engine '$adapter'!");
|
throw new Exception("Invalid or not supported engine '$adapter'!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@copy(PATH_CORE. PATH_SEP . 'config' . PATH_SEP . "propel.$adapter.ini", $this->configDir . "propel.$adapter.ini");
|
@copy(PATH_CORE . PATH_SEP . 'config' . PATH_SEP . "propel.$adapter.ini",
|
||||||
|
$this->configDir . "propel.$adapter.ini");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -404,7 +400,7 @@ class PmTable
|
|||||||
$con = Propel::getConnection($this->dataSource);
|
$con = Propel::getConnection($this->dataSource);
|
||||||
$stmt = $con->createStatement();
|
$stmt = $con->createStatement();
|
||||||
$lines = file($this->dataDir . $this->dbConfig->adapter . PATH_SEP . 'schema.sql');
|
$lines = file($this->dataDir . $this->dbConfig->adapter . PATH_SEP . 'schema.sql');
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
$queryStack = array();
|
$queryStack = array();
|
||||||
$aDNS = $con->getDSN();
|
$aDNS = $con->getDSN();
|
||||||
$dbEngine = $aDNS["phptype"];
|
$dbEngine = $aDNS["phptype"];
|
||||||
@@ -434,7 +430,7 @@ class PmTable
|
|||||||
if ($previous) {
|
if ($previous) {
|
||||||
$line = $previous . " " . $line;
|
$line = $previous . " " . $line;
|
||||||
}
|
}
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
|
|
||||||
// If the current line doesnt end with ; then put this line together
|
// If the current line doesnt end with ; then put this line together
|
||||||
// with the next one, thus supporting multi-line statements.
|
// with the next one, thus supporting multi-line statements.
|
||||||
@@ -446,12 +442,13 @@ class PmTable
|
|||||||
$line = substr($line, 0, strrpos($line, ";"));
|
$line = substr($line, 0, strrpos($line, ";"));
|
||||||
// just execute the drop and create table for target table nad not for others
|
// just execute the drop and create table for target table nad not for others
|
||||||
if (stripos($line, 'CREATE TABLE') !== false || stripos($line, 'DROP TABLE') !== false) {
|
if (stripos($line, 'CREATE TABLE') !== false || stripos($line, 'DROP TABLE') !== false) {
|
||||||
$isCreateForCurrentTable = preg_match('/CREATE\sTABLE\s[\[\'\"\`]{1}' . $this->tableName . '[\]\'\"\`]{1}/i', $line, $match);
|
$isCreateForCurrentTable = preg_match('/CREATE\sTABLE\s[\[\'\"\`]{1}' . $this->tableName
|
||||||
|
. '[\]\'\"\`]{1}/i', $line, $match);
|
||||||
if ($isCreateForCurrentTable) {
|
if ($isCreateForCurrentTable) {
|
||||||
$queryStack['create'] = $line;
|
$queryStack['create'] = $line;
|
||||||
}
|
} else {
|
||||||
else {
|
$isDropForCurrentTable = preg_match('/DROP TABLE.*[\[\'\"\`]{1}' . $this->tableName
|
||||||
$isDropForCurrentTable = preg_match('/DROP TABLE.*[\[\'\"\`]{1}' . $this->tableName . '[\]\'\"\`]{1}/i', $line, $match);
|
. '[\]\'\"\`]{1}/i', $line, $match);
|
||||||
if ($isDropForCurrentTable) {
|
if ($isDropForCurrentTable) {
|
||||||
$queryStack['drop'] = $line;
|
$queryStack['drop'] = $line;
|
||||||
}
|
}
|
||||||
@@ -481,7 +478,7 @@ class PmTable
|
|||||||
if ($previous) {
|
if ($previous) {
|
||||||
$line = $previous . " " . $line;
|
$line = $previous . " " . $line;
|
||||||
}
|
}
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
|
|
||||||
// If the current line doesnt end with ; then put this line together
|
// If the current line doesnt end with ; then put this line together
|
||||||
// with the next one, thus supporting multi-line statements.
|
// with the next one, thus supporting multi-line statements.
|
||||||
@@ -504,7 +501,7 @@ class PmTable
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
$line = trim($line);
|
$line = trim($line); // Remove comments from the script
|
||||||
if (empty($line)) {
|
if (empty($line)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -556,7 +553,6 @@ class PmTable
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($dbEngine == 'oracle') {
|
if ($dbEngine == 'oracle') {
|
||||||
@@ -571,8 +567,7 @@ class PmTable
|
|||||||
}
|
}
|
||||||
$stmt->executeQuery($queryStack['create']);
|
$stmt->executeQuery($queryStack['create']);
|
||||||
$stmt->executeQuery($queryStack['alter']);
|
$stmt->executeQuery($queryStack['alter']);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (isset($queryStack['create'])) {
|
if (isset($queryStack['create'])) {
|
||||||
// first at all we need to verify if we have a valid schema defined,
|
// first at all we need to verify if we have a valid schema defined,
|
||||||
// so we verify that creating a dummy table
|
// so we verify that creating a dummy table
|
||||||
@@ -600,7 +595,7 @@ class PmTable
|
|||||||
$con = Propel::getConnection($dataSource);
|
$con = Propel::getConnection($dataSource);
|
||||||
$stmt = $con->createStatement();
|
$stmt = $con->createStatement();
|
||||||
$lines = file($this->dataDir . $this->dbConfig->adapter . PATH_SEP . 'schema.sql');
|
$lines = file($this->dataDir . $this->dbConfig->adapter . PATH_SEP . 'schema.sql');
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
$errors = '';
|
$errors = '';
|
||||||
|
|
||||||
foreach ($lines as $j => $line) {
|
foreach ($lines as $j => $line) {
|
||||||
@@ -626,7 +621,7 @@ class PmTable
|
|||||||
if ($previous) {
|
if ($previous) {
|
||||||
$line = $previous . " " . $line;
|
$line = $previous . " " . $line;
|
||||||
}
|
}
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
|
|
||||||
// If the current line doesnt end with ; then put this line together
|
// If the current line doesnt end with ; then put this line together
|
||||||
// with the next one, thus supporting multi-line statements.
|
// with the next one, thus supporting multi-line statements.
|
||||||
@@ -647,12 +642,10 @@ class PmTable
|
|||||||
//error_log($line);
|
//error_log($line);
|
||||||
try {
|
try {
|
||||||
$stmt->executeQuery($line);
|
$stmt->executeQuery($line);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e) {
|
|
||||||
$errors .= $e->getMessage() . "\n";
|
$errors .= $e->getMessage() . "\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -665,7 +658,7 @@ class PmTable
|
|||||||
* verify if on the columns list was set a column as primary key
|
* verify if on the columns list was set a column as primary key
|
||||||
* @return boolean to affirm if was defined a column as pk.
|
* @return boolean to affirm if was defined a column as pk.
|
||||||
*/
|
*/
|
||||||
function hasAutoIncrementPKey()
|
public function hasAutoIncrementPKey()
|
||||||
{
|
{
|
||||||
foreach ($this->columns as $column) {
|
foreach ($this->columns as $column) {
|
||||||
if ($column->field_autoincrement) {
|
if ($column->field_autoincrement) {
|
||||||
@@ -680,11 +673,12 @@ class PmTable
|
|||||||
*
|
*
|
||||||
* @return array contains all supported columns types provided by propel
|
* @return array contains all supported columns types provided by propel
|
||||||
*/
|
*/
|
||||||
function getPropelSupportedColumnTypes()
|
public function getPropelSupportedColumnTypes()
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* http://www.propelorm.org/wiki/Documentation/1.2/Schema
|
* http://www.propelorm.org/wiki/Documentation/1.2/Schema
|
||||||
* [type = "BOOLEAN|TINYINT|SMALLINT|INTEGER|BIGINT|DOUBLE|FLOAT|REAL|DECIMAL|CHAR|{VARCHAR}|LONGVARCHAR|DATE|TIME|TIMESTAMP|BLOB|CLOB"]
|
* [type = "BOOLEAN|TINYINT|SMALLINT|INTEGER|BIGINT|DOUBLE|FLOAT|REAL|DECIMAL|CHAR|{VARCHAR}
|
||||||
|
* |LONGVARCHAR|DATE|TIME|TIMESTAMP|BLOB|CLOB"]
|
||||||
*/
|
*/
|
||||||
$types = array();
|
$types = array();
|
||||||
|
|
||||||
@@ -781,8 +775,7 @@ class PmTable
|
|||||||
|
|
||||||
if (is_array($target)) {
|
if (is_array($target)) {
|
||||||
$args = array_merge($args, $target);
|
$args = array_merge($args, $target);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$args[] = $target;
|
$args[] = $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,5 +791,5 @@ class PmTable
|
|||||||
$m->execute($args);
|
$m->execute($args);
|
||||||
$m->runBuild();
|
$m->runBuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DbSource.php
|
* DbSource.php
|
||||||
* @package workflow.engine.classes.model
|
* @package workflow.engine.classes.model
|
||||||
@@ -23,11 +24,9 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'classes/model/Content.php';
|
require_once 'classes/model/Content.php';
|
||||||
require_once 'classes/model/om/BaseDbSource.php';
|
require_once 'classes/model/om/BaseDbSource.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skeleton subclass for representing a row from the 'DB_SOURCE' table.
|
* Skeleton subclass for representing a row from the 'DB_SOURCE' table.
|
||||||
*
|
*
|
||||||
@@ -52,7 +51,8 @@ class DbSource extends BaseDbSource
|
|||||||
* Get the rep_tab_title column value.
|
* Get the rep_tab_title column value.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getDBSourceDescription() {
|
public function getDBSourceDescription()
|
||||||
|
{
|
||||||
if ($this->getDbsUid() == "") {
|
if ($this->getDbsUid() == "") {
|
||||||
throw ( new Exception("Error in getDBSourceDescription, the getDbsUid() can't be blank") );
|
throw ( new Exception("Error in getDBSourceDescription, the getDbsUid() can't be blank") );
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ class DbSource extends BaseDbSource
|
|||||||
return $this->db_source_description;
|
return $this->db_source_description;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCriteriaDBSList($sProcessUID)
|
public function getCriteriaDBSList($sProcessUID)
|
||||||
{
|
{
|
||||||
$sDelimiter = DBAdapter::getStringDelimiter();
|
$sDelimiter = DBAdapter::getStringDelimiter();
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
@@ -97,8 +97,7 @@ class DbSource extends BaseDbSource
|
|||||||
} else {
|
} else {
|
||||||
throw(new Exception("The row '$Uid'/'$ProUID' in table DbSource doesn't exist!"));
|
throw(new Exception("The row '$Uid'/'$ProUID' in table DbSource doesn't exist!"));
|
||||||
}
|
}
|
||||||
}
|
} catch (exception $oError) {
|
||||||
catch (exception $oError) {
|
|
||||||
throw ($oError);
|
throw ($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,17 +114,16 @@ class DbSource extends BaseDbSource
|
|||||||
return $aRow[0];
|
return $aRow[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function Exists ( $Uid, $ProUID ) {
|
public function Exists($Uid, $ProUID)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$oPro = DbSourcePeer::retrieveByPk($Uid, $ProUID);
|
$oPro = DbSourcePeer::retrieveByPk($Uid, $ProUID);
|
||||||
if (is_object($oPro) && get_class($oPro) == 'DbSource') {
|
if (is_object($oPro) && get_class($oPro) == 'DbSource') {
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $oError) {
|
||||||
catch (Exception $oError) {
|
|
||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,14 +146,13 @@ class DbSource extends BaseDbSource
|
|||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||||
}
|
}
|
||||||
}
|
} catch (exception $e) {
|
||||||
catch (exception $e) {
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw ($e);
|
throw ($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove($DbsUid, $ProUID )
|
public function remove($DbsUid, $ProUID)
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
|
$con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
@@ -171,24 +168,25 @@ class DbSource extends BaseDbSource
|
|||||||
$result = $this->delete();
|
$result = $this->delete();
|
||||||
$con->commit();
|
$con->commit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
} catch (exception $e) {
|
||||||
catch (exception $e) {
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw ($e);
|
throw ($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function create($aData)
|
public function create($aData)
|
||||||
{
|
{
|
||||||
if ($aData['DBS_ENCODE'] == '0') {
|
if ($aData['DBS_ENCODE'] == '0') {
|
||||||
unset($aData['DBS_ENCODE']);
|
unset($aData['DBS_ENCODE']);
|
||||||
}
|
}
|
||||||
$con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
|
$con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
|
||||||
try {
|
try {
|
||||||
if ( isset ( $aData['DBS_UID'] ) && $aData['DBS_UID']== '' )
|
if (isset($aData['DBS_UID']) && $aData['DBS_UID'] == '') {
|
||||||
unset($aData['DBS_UID']);
|
unset($aData['DBS_UID']);
|
||||||
if ( !isset ( $aData['DBS_UID'] ) )
|
}
|
||||||
|
if (!isset($aData['DBS_UID'])) {
|
||||||
$aData['DBS_UID'] = G::generateUniqueID();
|
$aData['DBS_UID'] = G::generateUniqueID();
|
||||||
|
}
|
||||||
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
$this->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||||
if ($this->validate()) {
|
if ($this->validate()) {
|
||||||
$result = $this->save();
|
$result = $this->save();
|
||||||
@@ -199,11 +197,11 @@ class DbSource extends BaseDbSource
|
|||||||
}
|
}
|
||||||
$con->commit();
|
$con->commit();
|
||||||
return $this->getDbsUid();
|
return $this->getDbsUid();
|
||||||
}
|
} catch (exception $e) {
|
||||||
catch (exception $e) {
|
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw ($e);
|
throw ($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// DbSource
|
||||||
|
|
||||||
} // DbSource
|
|
||||||
|
|||||||
@@ -53,8 +53,12 @@ try {
|
|||||||
|
|
||||||
$bReturnValue = true;
|
$bReturnValue = true;
|
||||||
$displayMode = 'display:block';
|
$displayMode = 'display:block';
|
||||||
|
$methodreturnDescription = "";
|
||||||
|
if (isset($methodreturnA[3])) {
|
||||||
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ('ID_NONE')))
|
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ('ID_NONE')))
|
||||||
? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
|
? G::LoadTranslation ( 'ID_NOT_REQUIRED')
|
||||||
|
: $methodreturnA [3];
|
||||||
|
}
|
||||||
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
|
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
|
||||||
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1]))
|
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1]))
|
||||||
&& (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
|
&& (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user