diff --git a/workflow/engine/classes/class.dbConnections.php b/workflow/engine/classes/class.dbConnections.php index 2f3e35ecc..10706b115 100755 --- a/workflow/engine/classes/class.dbConnections.php +++ b/workflow/engine/classes/class.dbConnections.php @@ -424,8 +424,14 @@ class dbConnections if ($aInfoCon['DBS_PASSWORD'] != '') { $aPassw = explode( '_', $aInfoCon['DBS_PASSWORD'] ); $passw = $aPassw[0]; - if (sizeof( $aPassw ) > 1) - $passw = ($passw == 'none') ? "" : G::decrypt( $passw, $aInfoCon['DBS_DATABASE_NAME'] ); + + $flagTns = ($aInfoCon["DBS_TYPE"] == "oracle" && $aInfoCon["DBS_CONNECTION_TYPE"] == "TNS")? 1 : 0; + + if (sizeof($aPassw) > 1 && $flagTns == 0) { + $passw = ($passw == "none")? "" : G::decrypt($passw, $aInfoCon["DBS_DATABASE_NAME"]); + } else { + $passw = ($passw == "none")? "" : G::decrypt($passw, $aInfoCon["DBS_TNS"]); + } } return $passw; } diff --git a/workflow/engine/classes/class.net.php b/workflow/engine/classes/class.net.php index 35baaadd3..10dd46d50 100755 --- a/workflow/engine/classes/class.net.php +++ b/workflow/engine/classes/class.net.php @@ -25,13 +25,34 @@ class NET public $errno; public $errstr; + public function __construct() + { + $a = func_get_args(); + $f = "__construct" . func_num_args(); + + if (method_exists($this, $f)) { + call_user_func_array(array($this, $f), $a); + } + } + + /** + * This function is the constructor of the class net + * + * return void + */ + public function __construct0() + { + $this->errno = 0; + $this->error = ""; + } + /** * This function is the constructor of the class net * * @param string $pHost * @return void */ - public function __construct ($pHost) + public function __construct1($pHost) { $this->errno = 0; $this->errstr = ""; @@ -181,16 +202,20 @@ class NET * This function tries to connect to server * * @param string $pDbDriver + * @param array $arrayServerData + * * @return void */ - public function tryConnectServer ($pDbDriver) + public function tryConnectServer($pDbDriver, array $arrayServerData = array()) { if ($this->errno != 0) { return 0; } $stat = new Stat(); - if (isset( $this->db_user ) && (isset( $this->db_passwd ) || ('' == $this->db_passwd)) && isset( $this->db_sourcename )) { + $flagTns = (isset($arrayServerData["connectionType"]) && $arrayServerData["connectionType"] == "TNS")? 1 : 0; + + if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) { switch ($pDbDriver) { case 'mysql': if ($this->db_passwd == '') { @@ -247,11 +272,17 @@ class NET } break; case 'oracle': - $this->db_port = (($this->db_port == "") || ($this->db_port == 0)) ? "1521" : $this->db_port; try { - $link = $conn = @oci_connect( $this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))" ); - if ($link) { - $stat->status = 'SUCCESS'; + if ($flagTns == 0) { + $this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port; + + $cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))"); + } else { + $cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"]); + } + + if ($cnn) { + $stat->status = "SUCCESS"; $this->errstr = ""; $this->errno = 0; } else { @@ -279,9 +310,11 @@ class NET * This function tries to open to the DB * * @param string $pDbDriver + * @param array $arrayServerData + * * @return void */ - public function tryOpenDataBase ($pDbDriver) + public function tryOpenDataBase($pDbDriver, array $arrayServerData = array()) { if ($this->errno != 0) { return 0; @@ -290,7 +323,9 @@ class NET set_time_limit( 0 ); $stat = new Stat(); - if (isset( $this->db_user ) && (isset( $this->db_passwd ) || ('' == $this->db_passwd)) && isset( $this->db_sourcename )) { + $flagTns = (isset($arrayServerData["connectionType"]) && $arrayServerData["connectionType"] == "TNS")? 1 : 0; + + if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) { switch ($pDbDriver) { case 'mysql': $link = @mysql_connect( $this->ip . (($this->db_port != '') && ($this->db_port != 0) ? ':' . $this->db_port : ''), $this->db_user, $this->db_passwd ); @@ -366,16 +401,22 @@ class NET } break; case 'oracle': - $this->db_port = (($this->db_port == "") || ($this->db_port == 0)) ? "1521" : $this->db_port; - $link = @oci_connect( $this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))" ); - if ($link) { - $stid = @oci_parse( $link, 'select AUTHENTICATION_TYPE from v$session_connect_info' ); + if ($flagTns == 0) { + $this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port; + + $cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))"); + } else { + $cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"]); + } + + if ($cnn) { + $stid = @oci_parse($cnn, 'select AUTHENTICATION_TYPE from v$session_connect_info'); $result = @oci_execute( $stid, OCI_DEFAULT ); if ($result) { $stat->status = 'SUCCESS'; $this->errstr = ""; $this->errno = 0; - @oci_close( $link ); + @oci_close($cnn); } else { $this->error = "the user $this->db_user doesn't have privileges to run queries!"; $this->errstr = "NET::ORACLE->Couldn't execute any query on this server!"; diff --git a/workflow/engine/classes/model/map/DbSourceMapBuilder.php b/workflow/engine/classes/model/map/DbSourceMapBuilder.php index 3924eb3f4..d4bed130e 100755 --- a/workflow/engine/classes/model/map/DbSourceMapBuilder.php +++ b/workflow/engine/classes/model/map/DbSourceMapBuilder.php @@ -83,6 +83,10 @@ class DbSourceMapBuilder $tMap->addColumn('DBS_ENCODE', 'DbsEncode', 'string', CreoleTypes::VARCHAR, false, 32); + $tMap->addColumn('DBS_CONNECTION_TYPE', 'DbsConnectionType', 'string', CreoleTypes::VARCHAR, false, 32); + + $tMap->addColumn('DBS_TNS', 'DbsTns', 'string', CreoleTypes::VARCHAR, false, 256); + } // doBuild() } // DbSourceMapBuilder diff --git a/workflow/engine/classes/model/om/BaseDbSource.php b/workflow/engine/classes/model/om/BaseDbSource.php index cefc79492..b21a8a1f6 100755 --- a/workflow/engine/classes/model/om/BaseDbSource.php +++ b/workflow/engine/classes/model/om/BaseDbSource.php @@ -81,6 +81,18 @@ abstract class BaseDbSource extends BaseObject implements Persistent */ protected $dbs_encode = ''; + /** + * The value for the dbs_connection_type field. + * @var string + */ + protected $dbs_connection_type = 'NORMAL'; + + /** + * The value for the dbs_tns field. + * @var string + */ + protected $dbs_tns = ''; + /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -194,6 +206,28 @@ abstract class BaseDbSource extends BaseObject implements Persistent return $this->dbs_encode; } + /** + * Get the [dbs_connection_type] column value. + * + * @return string + */ + public function getDbsConnectionType() + { + + return $this->dbs_connection_type; + } + + /** + * Get the [dbs_tns] column value. + * + * @return string + */ + public function getDbsTns() + { + + return $this->dbs_tns; + } + /** * Set the value of [dbs_uid] column. * @@ -392,6 +426,50 @@ abstract class BaseDbSource extends BaseObject implements Persistent } // setDbsEncode() + /** + * Set the value of [dbs_connection_type] column. + * + * @param string $v new value + * @return void + */ + public function setDbsConnectionType($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->dbs_connection_type !== $v || $v === 'NORMAL') { + $this->dbs_connection_type = $v; + $this->modifiedColumns[] = DbSourcePeer::DBS_CONNECTION_TYPE; + } + + } // setDbsConnectionType() + + /** + * Set the value of [dbs_tns] column. + * + * @param string $v new value + * @return void + */ + public function setDbsTns($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->dbs_tns !== $v || $v === '') { + $this->dbs_tns = $v; + $this->modifiedColumns[] = DbSourcePeer::DBS_TNS; + } + + } // setDbsTns() + /** * Hydrates (populates) the object variables with values from the database resultset. * @@ -427,12 +505,16 @@ abstract class BaseDbSource extends BaseObject implements Persistent $this->dbs_encode = $rs->getString($startcol + 8); + $this->dbs_connection_type = $rs->getString($startcol + 9); + + $this->dbs_tns = $rs->getString($startcol + 10); + $this->resetModified(); $this->setNew(false); // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 9; // 9 = DbSourcePeer::NUM_COLUMNS - DbSourcePeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 11; // 11 = DbSourcePeer::NUM_COLUMNS - DbSourcePeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating DbSource object", $e); @@ -663,6 +745,12 @@ abstract class BaseDbSource extends BaseObject implements Persistent case 8: return $this->getDbsEncode(); break; + case 9: + return $this->getDbsConnectionType(); + break; + case 10: + return $this->getDbsTns(); + break; default: return null; break; @@ -692,6 +780,8 @@ abstract class BaseDbSource extends BaseObject implements Persistent $keys[6] => $this->getDbsPassword(), $keys[7] => $this->getDbsPort(), $keys[8] => $this->getDbsEncode(), + $keys[9] => $this->getDbsConnectionType(), + $keys[10] => $this->getDbsTns(), ); return $result; } @@ -750,6 +840,12 @@ abstract class BaseDbSource extends BaseObject implements Persistent case 8: $this->setDbsEncode($value); break; + case 9: + $this->setDbsConnectionType($value); + break; + case 10: + $this->setDbsTns($value); + break; } // switch() } @@ -809,6 +905,14 @@ abstract class BaseDbSource extends BaseObject implements Persistent $this->setDbsEncode($arr[$keys[8]]); } + if (array_key_exists($keys[9], $arr)) { + $this->setDbsConnectionType($arr[$keys[9]]); + } + + if (array_key_exists($keys[10], $arr)) { + $this->setDbsTns($arr[$keys[10]]); + } + } /** @@ -856,6 +960,14 @@ abstract class BaseDbSource extends BaseObject implements Persistent $criteria->add(DbSourcePeer::DBS_ENCODE, $this->dbs_encode); } + if ($this->isColumnModified(DbSourcePeer::DBS_CONNECTION_TYPE)) { + $criteria->add(DbSourcePeer::DBS_CONNECTION_TYPE, $this->dbs_connection_type); + } + + if ($this->isColumnModified(DbSourcePeer::DBS_TNS)) { + $criteria->add(DbSourcePeer::DBS_TNS, $this->dbs_tns); + } + return $criteria; } @@ -936,6 +1048,10 @@ abstract class BaseDbSource extends BaseObject implements Persistent $copyObj->setDbsEncode($this->dbs_encode); + $copyObj->setDbsConnectionType($this->dbs_connection_type); + + $copyObj->setDbsTns($this->dbs_tns); + $copyObj->setNew(true); diff --git a/workflow/engine/classes/model/om/BaseDbSourcePeer.php b/workflow/engine/classes/model/om/BaseDbSourcePeer.php index ff2eaf6a0..fd02370c9 100755 --- a/workflow/engine/classes/model/om/BaseDbSourcePeer.php +++ b/workflow/engine/classes/model/om/BaseDbSourcePeer.php @@ -25,7 +25,7 @@ abstract class BaseDbSourcePeer const CLASS_DEFAULT = 'classes.model.DbSource'; /** The total number of columns. */ - const NUM_COLUMNS = 9; + const NUM_COLUMNS = 11; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -58,6 +58,12 @@ abstract class BaseDbSourcePeer /** the column name for the DBS_ENCODE field */ const DBS_ENCODE = 'DB_SOURCE.DBS_ENCODE'; + /** the column name for the DBS_CONNECTION_TYPE field */ + const DBS_CONNECTION_TYPE = 'DB_SOURCE.DBS_CONNECTION_TYPE'; + + /** the column name for the DBS_TNS field */ + const DBS_TNS = 'DB_SOURCE.DBS_TNS'; + /** The PHP to DB Name Mapping */ private static $phpNameMap = null; @@ -69,10 +75,10 @@ abstract class BaseDbSourcePeer * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbsUid', 'ProUid', 'DbsType', 'DbsServer', 'DbsDatabaseName', 'DbsUsername', 'DbsPassword', 'DbsPort', 'DbsEncode', ), - BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID, DbSourcePeer::PRO_UID, DbSourcePeer::DBS_TYPE, DbSourcePeer::DBS_SERVER, DbSourcePeer::DBS_DATABASE_NAME, DbSourcePeer::DBS_USERNAME, DbSourcePeer::DBS_PASSWORD, DbSourcePeer::DBS_PORT, DbSourcePeer::DBS_ENCODE, ), - BasePeer::TYPE_FIELDNAME => array ('DBS_UID', 'PRO_UID', 'DBS_TYPE', 'DBS_SERVER', 'DBS_DATABASE_NAME', 'DBS_USERNAME', 'DBS_PASSWORD', 'DBS_PORT', 'DBS_ENCODE', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) + BasePeer::TYPE_PHPNAME => array ('DbsUid', 'ProUid', 'DbsType', 'DbsServer', 'DbsDatabaseName', 'DbsUsername', 'DbsPassword', 'DbsPort', 'DbsEncode', 'DbsConnectionType', 'DbsTns', ), + BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID, DbSourcePeer::PRO_UID, DbSourcePeer::DBS_TYPE, DbSourcePeer::DBS_SERVER, DbSourcePeer::DBS_DATABASE_NAME, DbSourcePeer::DBS_USERNAME, DbSourcePeer::DBS_PASSWORD, DbSourcePeer::DBS_PORT, DbSourcePeer::DBS_ENCODE, DbSourcePeer::DBS_CONNECTION_TYPE, DbSourcePeer::DBS_TNS, ), + BasePeer::TYPE_FIELDNAME => array ('DBS_UID', 'PRO_UID', 'DBS_TYPE', 'DBS_SERVER', 'DBS_DATABASE_NAME', 'DBS_USERNAME', 'DBS_PASSWORD', 'DBS_PORT', 'DBS_ENCODE', 'DBS_CONNECTION_TYPE', 'DBS_TNS', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) ); /** @@ -82,10 +88,10 @@ abstract class BaseDbSourcePeer * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbsUid' => 0, 'ProUid' => 1, 'DbsType' => 2, 'DbsServer' => 3, 'DbsDatabaseName' => 4, 'DbsUsername' => 5, 'DbsPassword' => 6, 'DbsPort' => 7, 'DbsEncode' => 8, ), - BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID => 0, DbSourcePeer::PRO_UID => 1, DbSourcePeer::DBS_TYPE => 2, DbSourcePeer::DBS_SERVER => 3, DbSourcePeer::DBS_DATABASE_NAME => 4, DbSourcePeer::DBS_USERNAME => 5, DbSourcePeer::DBS_PASSWORD => 6, DbSourcePeer::DBS_PORT => 7, DbSourcePeer::DBS_ENCODE => 8, ), - BasePeer::TYPE_FIELDNAME => array ('DBS_UID' => 0, 'PRO_UID' => 1, 'DBS_TYPE' => 2, 'DBS_SERVER' => 3, 'DBS_DATABASE_NAME' => 4, 'DBS_USERNAME' => 5, 'DBS_PASSWORD' => 6, 'DBS_PORT' => 7, 'DBS_ENCODE' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) + BasePeer::TYPE_PHPNAME => array ('DbsUid' => 0, 'ProUid' => 1, 'DbsType' => 2, 'DbsServer' => 3, 'DbsDatabaseName' => 4, 'DbsUsername' => 5, 'DbsPassword' => 6, 'DbsPort' => 7, 'DbsEncode' => 8, 'DbsConnectionType' => 9, 'DbsTns' => 10, ), + BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID => 0, DbSourcePeer::PRO_UID => 1, DbSourcePeer::DBS_TYPE => 2, DbSourcePeer::DBS_SERVER => 3, DbSourcePeer::DBS_DATABASE_NAME => 4, DbSourcePeer::DBS_USERNAME => 5, DbSourcePeer::DBS_PASSWORD => 6, DbSourcePeer::DBS_PORT => 7, DbSourcePeer::DBS_ENCODE => 8, DbSourcePeer::DBS_CONNECTION_TYPE => 9, DbSourcePeer::DBS_TNS => 10, ), + BasePeer::TYPE_FIELDNAME => array ('DBS_UID' => 0, 'PRO_UID' => 1, 'DBS_TYPE' => 2, 'DBS_SERVER' => 3, 'DBS_DATABASE_NAME' => 4, 'DBS_USERNAME' => 5, 'DBS_PASSWORD' => 6, 'DBS_PORT' => 7, 'DBS_ENCODE' => 8, 'DBS_CONNECTION_TYPE' => 9, 'DBS_TNS' => 10, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) ); /** @@ -204,6 +210,10 @@ abstract class BaseDbSourcePeer $criteria->addSelectColumn(DbSourcePeer::DBS_ENCODE); + $criteria->addSelectColumn(DbSourcePeer::DBS_CONNECTION_TYPE); + + $criteria->addSelectColumn(DbSourcePeer::DBS_TNS); + } const COUNT = 'COUNT(DB_SOURCE.DBS_UID)'; diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index d768368e3..afa88abb2 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -1657,6 +1657,8 @@ + + diff --git a/workflow/engine/data/mssql/schema.sql b/workflow/engine/data/mssql/schema.sql index 04264711d..536111446 100755 --- a/workflow/engine/data/mssql/schema.sql +++ b/workflow/engine/data/mssql/schema.sql @@ -1714,6 +1714,8 @@ CREATE TABLE [DB_SOURCE] [DBS_PASSWORD] VARCHAR(32) default '' NULL, [DBS_PORT] INT default 0 NULL, [DBS_ENCODE] VARCHAR(32) default '' NULL, + [DBS_CONNECTION_TYPE] VARCHAR(32) default 'NORMAL' NULL, + [DBS_TNS] VARCHAR(256) default '' NULL, CONSTRAINT DB_SOURCE_PK PRIMARY KEY ([DBS_UID],[PRO_UID]) ); diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index b51457a24..eab6cb46c 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -785,6 +785,8 @@ CREATE TABLE `DB_SOURCE` `DBS_PASSWORD` VARCHAR(32) default '', `DBS_PORT` INTEGER default 0, `DBS_ENCODE` VARCHAR(32) default '', + `DBS_CONNECTION_TYPE` VARCHAR(32) default 'NORMAL', + `DBS_TNS` VARCHAR(256) default '', PRIMARY KEY (`DBS_UID`,`PRO_UID`), KEY `indexDBSource`(`PRO_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='DB_SOURCE'; diff --git a/workflow/engine/data/oracle/schema.sql b/workflow/engine/data/oracle/schema.sql index 6a5cba79e..6c297a3ef 100755 --- a/workflow/engine/data/oracle/schema.sql +++ b/workflow/engine/data/oracle/schema.sql @@ -972,7 +972,9 @@ CREATE TABLE "DB_SOURCE" "DBS_USERNAME" VARCHAR2(32) default '0' NOT NULL, "DBS_PASSWORD" VARCHAR2(32) default '', "DBS_PORT" NUMBER default 0, - "DBS_ENCODE" VARCHAR2(32) default '' + "DBS_ENCODE" VARCHAR2(32) default '', + "DBS_CONNECTION_TYPE" VARCHAR2(32) default 'NORMAL', + "DBS_TNS" VARCHAR2(256) default '' ); ALTER TABLE "DB_SOURCE" diff --git a/workflow/engine/js/dbConnections/main.js b/workflow/engine/js/dbConnections/main.js index 1cdf99c21..f27d87559 100755 --- a/workflow/engine/js/dbConnections/main.js +++ b/workflow/engine/js/dbConnections/main.js @@ -56,7 +56,10 @@ var saveDBConnection = function() { var desc = $('form[DBS_DESCRIPTION]').value; var enc = $('form[DBS_ENCODE]').value; - var uri = 'action=saveConnection&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&passwd='+passwd+'&port='+port+'&desc='+desc+'&enc='+enc; + var connectionType = getField("DBS_CONNECTION_TYPE").value; + var tns = getField("DBS_TNS").value; + + var uri = 'action=saveConnection&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&passwd='+passwd+'&port='+port+'&desc='+desc+'&enc='+enc + "&connectionType=" + connectionType + "&tns=" + tns; var oRPC = new leimnud.module.rpc.xmlhttp({ url : PROCESS_REQUEST_FILE, @@ -97,7 +100,10 @@ function saveEditDBConnection() var desc = $('form[DBS_DESCRIPTION]').value; var enc = $('form[DBS_ENCODE]').value; - var uri = 'action=saveEditConnection&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&passwd='+passwd+'&port='+port+'&dbs_uid='+dbs_uid+'&desc='+desc+'&enc='+enc; + var connectionType = getField("DBS_CONNECTION_TYPE").value; + var tns = getField("DBS_TNS").value; + + var uri = 'action=saveEditConnection&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&passwd='+passwd+'&port='+port+'&dbs_uid='+dbs_uid+'&desc='+desc+'&enc='+enc + "&connectionType=" + connectionType + "&tns=" + tns; var oRPC = new leimnud.module.rpc.xmlhttp({ url : PROCESS_REQUEST_FILE, @@ -231,6 +237,10 @@ function testDBConnection() var user = $('form[DBS_USERNAME]').value; var passwd = $('form[DBS_PASSWORD]').value; var port = $('form[DBS_PORT]').value; + + var connectionType = getField("DBS_CONNECTION_TYPE").value; + var tns = getField("DBS_TNS").value; + if(port.trim() == ''){ port = 'default'; } @@ -256,7 +266,7 @@ function testDBConnection() myPanel.loader.show(); var requestfile = PROCESS_REQUEST_FILE; - var uri = 'action=showTestConnection&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&passwd='+passwd+'&port='+port; + var uri = 'action=showTestConnection&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&passwd='+passwd+'&port='+port + "&connectionType=" + connectionType + "&tns=" + tns; var ajax = AJAX(); ajax.open("POST", requestfile, true); @@ -298,8 +308,11 @@ function testHost(step) var port = 'none'; } + var connectionType = getField("DBS_CONNECTION_TYPE").value; + var tns = getField("DBS_TNS").value; + var requestfile = PROCESS_REQUEST_FILE; - var uri = 'action=testConnection&step='+step+'&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&port='+port+'&passwd='+passwd; + var uri = 'action=testConnection&step='+step+'&type='+type+'&server='+server+'&db_name='+db_name+'&user='+user+'&port='+port+'&passwd='+passwd + "&connectionType=" + connectionType + "&tns=" + tns; var ajax = AJAX(); mainRequest = ajax; @@ -370,68 +383,78 @@ function cancelTestConnection() currentPopupWindow.remove(); } - - function validateFields() { - if( getField('DBS_PORT').value.trim() == '' || getField('DBS_PORT').value.trim() == '0' ) { - onChangeType(); - } + if (FLAG_DBS_TNS == 1) { + var res = true; + var tns = new input(getField("DBS_TNS")); - var res = true; - var o = new input(getField('DBS_SERVER')); - if($('form[DBS_SERVER]').value == '') { - //new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_MSG4}); - o.failed(); - res = false; - } else - o.passed(); + if($("form[DBS_TNS]").value == "") { + tns.failed(); + res = false; + } else { + tns.passed(); + } + } else { + if( getField('DBS_PORT').value.trim() == '' || getField('DBS_PORT').value.trim() == '0' ) { + onChangeType(); + } - var o = new input(getField('DBS_DATABASE_NAME')); - if($('form[DBS_DATABASE_NAME]').value == '') { - //new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_MSG5}); - o.failed(); - res = false; - } else - o.passed(); + var res = true; + var o = new input(getField('DBS_SERVER')); + if($('form[DBS_SERVER]').value == '') { + //new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_MSG4}); + o.failed(); + res = false; + } else + o.passed(); - var o = new input(getField('DBS_USERNAME')); - if($('form[DBS_USERNAME]').value == '') { - //new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_MSG6}); - o.failed(); - res = false; - } else - o.passed(); + var o = new input(getField('DBS_DATABASE_NAME')); + if($('form[DBS_DATABASE_NAME]').value == '') { + //new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_MSG5}); + o.failed(); + res = false; + } else + o.passed(); - /*var o = new input(getField('DBS_PORT')); - if($('form[DBS_PORT]').value == '') { - o.failed(); - res = false; - } else - o.passed();*/ + var o = new input(getField('DBS_USERNAME')); + if($('form[DBS_USERNAME]').value == '') { + //new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_MSG6}); + o.failed(); + res = false; + } else + o.passed(); - var o = new input(getField('DBS_TYPE')); - if($('form[DBS_TYPE]').value == '0') { - o.failed(); - res = false; - } else - o.passed(); + /*var o = new input(getField('DBS_PORT')); + if($('form[DBS_PORT]').value == '') { + o.failed(); + res = false; + } else + o.passed();*/ - oType = getField('DBS_TYPE'); - if( oType.value != 'mssql' && oType.value != 'oracle' ){ - var o = new input(getField('DBS_ENCODE')); - if($('form[DBS_ENCODE]').value == '0') { - o.failed(); - res = false; - } else - o.passed(); - } + var o = new input(getField('DBS_TYPE')); + if($('form[DBS_TYPE]').value == '0') { + o.failed(); + res = false; + } else + o.passed(); + oType = getField('DBS_TYPE'); + if( oType.value != 'mssql' && oType.value != 'oracle' ){ + var o = new input(getField('DBS_ENCODE')); + if($('form[DBS_ENCODE]').value == '0') { + o.failed(); + res = false; + } else + o.passed(); + } + } - if(!res){ - new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_ALERT}); - } - return res; + if(!res){ + new leimnud.module.app.alert().make({label: G_STRINGS.DBCONNECTIONS_ALERT}); + } + + return res; } var onChangeType = function() { @@ -456,10 +479,25 @@ var onChangeType = function() { }; +var FLAG_DBS_TNS = 0; + function showEncodes(pre){ oType = getField('DBS_TYPE'); //if( oType.value != 'mssql' && oType.value != 'oracle' ){ if( oType.value != 'oracle' ){ + FLAG_DBS_TNS = 0; + + hideRowById("DBS_CONNECTION_TYPE"); + + getField("DBS_TNS").value = ""; + hideRowById("DBS_TNS"); + + showRowById("DBS_SERVER"); + showRowById("DBS_DATABASE_NAME"); + showRowById("DBS_USERNAME"); + showRowById("DBS_PASSWORD"); + showRowById("DBS_PORT"); + showRowById('DBS_ENCODE'); var o = new input(getField('DBS_TYPE')); if($('form[DBS_TYPE]').value == '0') { @@ -499,6 +537,40 @@ function showEncodes(pre){ }.extend(this); oRPC.make(); } else { - hideRowById('DBS_ENCODE'); + hideRowById('DBS_ENCODE'); + + showRowById("DBS_CONNECTION_TYPE"); + showRowById("DBS_SERVER"); + showRowById("DBS_DATABASE_NAME"); + showRowById("DBS_USERNAME"); + showRowById("DBS_PASSWORD"); + showRowById("DBS_PORT"); + + var connectionType = getField("DBS_CONNECTION_TYPE").value; + + if (connectionType == "TNS") { + FLAG_DBS_TNS = 1; + + document.getElementById("userName").style.display = "none"; + removeRequiredById("DBS_USERNAME"); + + showRowById("DBS_TNS"); + + hideRowById("DBS_SERVER"); + hideRowById("DBS_DATABASE_NAME"); + hideRowById("DBS_PORT"); + + getField("DBS_USERNAME").required = false; + getField("DBS_PASSWORD").required = false; + } else { + FLAG_DBS_TNS = 0; + + getField("DBS_TNS").value = ""; + + hideRowById("DBS_TNS"); + + document.getElementById("userName").style.display = "inline"; + enableRequiredById("DBS_USERNAME"); + } } } diff --git a/workflow/engine/methods/dbConnections/dbConnectionsAjax.php b/workflow/engine/methods/dbConnections/dbConnectionsAjax.php index 707baa6fb..b30792b4a 100755 --- a/workflow/engine/methods/dbConnections/dbConnectionsAjax.php +++ b/workflow/engine/methods/dbConnections/dbConnectionsAjax.php @@ -144,8 +144,16 @@ switch ($action) { if (strpos( $_POST['server'], "\\" )) { $_POST['port'] = 'none'; } - $aData = Array ('DBS_UID' => $_POST['dbs_uid'],'PRO_UID' => $_SESSION['PROCESS'],'DBS_TYPE' => $_POST['type'],'DBS_SERVER' => $_POST['server'],'DBS_DATABASE_NAME' => $_POST['db_name'],'DBS_USERNAME' => $_POST['user'],'DBS_PASSWORD' => (($_POST['passwd'] == 'none') ? "" : G::encrypt( $_POST['passwd'], $_POST['db_name'] )) . "_2NnV3ujj3w",'DBS_PORT' => (($_POST['port'] == 'none') ? "" : $_POST['port']),'DBS_ENCODE' => $_POST['enc'] - ); + + $flagTns = ($_POST["type"] == "oracle" && $_POST["connectionType"] == "TNS")? 1 : 0; + + if ($flagTns == 0) { + $_POST["connectionType"] = "NORMAL"; + + $aData = array("DBS_UID" => $_POST["dbs_uid"], "PRO_UID" => $_SESSION["PROCESS"], "DBS_TYPE" => $_POST["type"], "DBS_SERVER" => $_POST["server"], "DBS_DATABASE_NAME" => $_POST["db_name"], "DBS_USERNAME" => $_POST["user"], "DBS_PASSWORD" => (($_POST["passwd"] == "none")? "" : G::encrypt($_POST["passwd"], $_POST["db_name"])) . "_2NnV3ujj3w", "DBS_PORT" => (($_POST["port"] == "none")? "" : $_POST["port"]), "DBS_ENCODE" => $_POST["enc"], "DBS_CONNECTION_TYPE" => $_POST["connectionType"], "DBS_TNS" => ""); + } else { + $aData = array("DBS_UID" => $_POST["dbs_uid"], "PRO_UID" => $_SESSION["PROCESS"], "DBS_TYPE" => $_POST["type"], "DBS_SERVER" => "", "DBS_DATABASE_NAME" => "", "DBS_USERNAME" => $_POST["user"], "DBS_PASSWORD" => (($_POST["passwd"] == "none")? "" : G::encrypt($_POST["passwd"], $_POST["tns"])) . "_2NnV3ujj3w", "DBS_PORT" => "", "DBS_ENCODE" => "", "DBS_CONNECTION_TYPE" => $_POST["connectionType"], "DBS_TNS" => $_POST["tns"]); + } $oDBSource->update( $aData ); $oContent->addContent( 'DBS_DESCRIPTION', '', $_POST['dbs_uid'], SYS_LANG, $_POST['desc'] ); @@ -156,8 +164,17 @@ switch ($action) { if (strpos( $_POST['server'], "\\" )) { $_POST['port'] = 'none'; } - $aData = Array ('PRO_UID' => $_SESSION['PROCESS'],'DBS_TYPE' => $_POST['type'],'DBS_SERVER' => $_POST['server'],'DBS_DATABASE_NAME' => $_POST['db_name'],'DBS_USERNAME' => $_POST['user'],'DBS_PASSWORD' => (($_POST['passwd'] == 'none') ? "" : G::encrypt( $_POST['passwd'], $_POST['db_name'] )) . "_2NnV3ujj3w",'DBS_PORT' => (($_POST['port'] == 'none') ? "" : $_POST['port']),'DBS_ENCODE' => $_POST['enc'] - ); + + $flagTns = ($_POST["type"] == "oracle" && $_POST["connectionType"] == "TNS")? 1 : 0; + + if ($flagTns == 0) { + $_POST["connectionType"] = "NORMAL"; + + $aData = array("PRO_UID" => $_SESSION["PROCESS"], "DBS_TYPE" => $_POST["type"], "DBS_SERVER" => $_POST["server"], "DBS_DATABASE_NAME" => $_POST["db_name"], "DBS_USERNAME" => $_POST["user"], "DBS_PASSWORD" => (($_POST["passwd"] == "none")? "" : G::encrypt($_POST["passwd"], $_POST["db_name"])) . "_2NnV3ujj3w", "DBS_PORT" => (($_POST["port"] == "none") ? "" : $_POST["port"]), "DBS_ENCODE" => $_POST["enc"], "DBS_CONNECTION_TYPE" => $_POST["connectionType"], "DBS_TNS" => ""); + } else { + $aData = array("PRO_UID" => $_SESSION["PROCESS"], "DBS_TYPE" => $_POST["type"], "DBS_SERVER" => "", "DBS_DATABASE_NAME" => "", "DBS_USERNAME" => $_POST["user"], "DBS_PASSWORD" => (($_POST["passwd"] == "none")? "" : G::encrypt($_POST["passwd"], $_POST["tns"])) . "_2NnV3ujj3w", "DBS_PORT" => "", "DBS_ENCODE" => "", "DBS_CONNECTION_TYPE" => $_POST["connectionType"], "DBS_TNS" => $_POST["tns"]); + } + $newid = $oDBSource->create( $aData ); $sDelimiter = DBAdapter::getStringDelimiter(); $oContent->addContent( 'DBS_DESCRIPTION', '', $newid, SYS_LANG, $_POST['desc'] ); @@ -186,90 +203,138 @@ switch ($action) { break; case 'testConnection': sleep( 0 ); - $step = $_POST['step']; - $type = $_POST['type']; - $server = $_POST['server']; - $db_name = $_POST['db_name']; - $user = $_POST['user']; - $passwd = ($_POST['passwd'] == 'none') ? "" : $_POST['passwd']; - $port = $_POST['port']; - if (($port == 'none') || ($port == 0)) { - //setting defaults ports - switch ($type) { - case 'mysql': - $port = 3306; - break; - case 'pgsql': - $port = 5432; - break; - case 'mssql': - $port = 1433; - break; - case 'oracle': - $port = 1521; - break; + G::LoadClass("net"); + + define("SUCCESSFULL", "SUCCESSFULL"); + define("FAILED", "FAILED"); + + $step = $_POST["step"]; + $type = $_POST["type"]; + + $user = $_POST["user"]; + $passwd = ($_POST["passwd"] == "none")? "" : $_POST["passwd"]; + + $flagTns = ($_POST["type"] == "oracle" && $_POST["connectionType"] == "TNS")? 1 : 0; + + if ($flagTns == 0) { + $server = $_POST["server"]; + $db_name = $_POST["db_name"]; + $port = $_POST["port"]; + + if ($port == "none" || $port == 0) { + //setting defaults ports + switch ($type) { + case "mysql": + $port = 3306; + break; + case "pgsql": + $port = 5432; + break; + case "mssql": + $port = 1433; + break; + case "oracle": + $port = 1521; + break; + } } - } - G::LoadClass( 'net' ); - $Server = new NET( $server ); + $Server = new NET($server); - define( "SUCCESSFULL", 'SUCCESSFULL' ); - define( "FAILED", 'FAILED' ); - - switch ($step) { - case 1: - if ($Server->getErrno() == 0) { - print (SUCCESSFULL . ',') ; - } else { - print (FAILED . ',' . $Server->error) ; - } - break; - case 2: - $Server->scannPort( $port ); - if ($Server->getErrno() == 0) { - print (SUCCESSFULL . ',') ; - } else { - print (FAILED . ',' . $Server->error) ; - } - break; - case 3: - $Server->loginDbServer( $user, $passwd ); - $Server->setDataBase( $db_name, $port ); - - if ($Server->errno == 0) { - $response = $Server->tryConnectServer( $type ); - if ($response->status == 'SUCCESS') { - print (SUCCESSFULL . ',') ; + switch ($step) { + case 1: + if ($Server->getErrno() == 0) { + echo SUCCESSFULL . ","; } else { - print (FAILED . ',' . $Server->error) ; + echo FAILED . "," . $Server->error; } - } else { - print (FAILED . ',' . $Server->error) ; - } - break; - case 4: - $Server->loginDbServer( $user, $passwd ); - $Server->setDataBase( $db_name, $port ); - if ($Server->errno == 0) { - $response = $Server->tryConnectServer( $type ); - if ($response->status == 'SUCCESS') { - $response = $Server->tryOpenDataBase( $type ); - if ($response->status == 'SUCCESS') { - print (SUCCESSFULL . ',' . $Server->error) ; + break; + case 2: + $Server->scannPort($port); + + if ($Server->getErrno() == 0) { + echo SUCCESSFULL . ","; + } else { + echo FAILED . "," . $Server->error; + } + break; + case 3: + $Server->loginDbServer($user, $passwd); + $Server->setDataBase($db_name, $port); + + if ($Server->errno == 0) { + $response = $Server->tryConnectServer($type); + + if ($response->status == "SUCCESS") { + echo SUCCESSFULL . ","; } else { - print (FAILED . ',' . $Server->error) ; + echo FAILED . "," . $Server->error; } } else { - print (FAILED . ',' . $Server->error) ; + echo FAILED . "," . $Server->error; } - } else { - print (FAILED . ',' . $Server->error) ; - } - break; - default: - print ('finished') ; + break; + case 4: + $Server->loginDbServer($user, $passwd); + $Server->setDataBase($db_name, $port); + + if ($Server->errno == 0) { + $response = $Server->tryConnectServer($type); + + if ($response->status == "SUCCESS") { + $response = $Server->tryOpenDataBase($type); + + if ($response->status == "SUCCESS") { + echo SUCCESSFULL . "," . $Server->error; + } else { + echo FAILED . "," . $Server->error; + } + } else { + echo FAILED . "," . $Server->error; + } + } else { + echo FAILED . "," . $Server->error; + } + break; + default: + echo "finished"; + break; + } + } else { + $connectionType = $_POST["connectionType"]; + $tns = $_POST["tns"]; + + $net = new NET(); + + switch ($step) { + case 1: + $net->loginDbServer($user, $passwd); + + if ($net->errno == 0) { + $arrayServerData = array("connectionType" => $connectionType, "tns" => $tns); + + $response = $net->tryConnectServer($type, $arrayServerData); + + if ($response->status == "SUCCESS") { + $response = $net->tryOpenDataBase($type, $arrayServerData); + + if ($response->status == "SUCCESS") { + echo SUCCESSFULL . "," . $net->error; + } else { + echo FAILED . "," . $net->error; + } + } else { + echo FAILED . "," . $net->error; + } + } else { + echo FAILED . "," . $net->error; + } + break; + default: + echo "finished"; + break; + } } break; case 'showEncodes': diff --git a/workflow/engine/templates/dbConnections/dbConnections.php b/workflow/engine/templates/dbConnections/dbConnections.php index 9c22aaf1a..dcf4d037a 100755 --- a/workflow/engine/templates/dbConnections/dbConnections.php +++ b/workflow/engine/templates/dbConnections/dbConnections.php @@ -30,84 +30,97 @@ * @LastModification 30/05/2008 */ - G::LoadClass('tree'); - G::LoadClass('net'); - $host = new net($_POST['server']); - $width_content = '430px'; - - $html = ' - - - - - '.G::loadTranslation('DBCONNECTIONS_TITLE').' - - - - - '; +G::LoadClass('tree'); +G::LoadClass('net'); - $port = $_POST['port']; - if( $port == 'default' ){ - //setting defaults ports - switch ($_POST['type']){ - case 'mysql': $port = 3306; break; - case 'pgsql': $port = 5432; break; - case 'mssql': $port = 1433; break; - case 'oracle': $port = 1521; break; - } - $_POST['port'] = $port; - $port = "default ($port)"; - } - - $tests = Array('', - G::loadTranslation('ID_HOST_NAME').' '.$_POST['server'].'', - G::loadTranslation('ID_CHECK_PORT').' '.$port.'', - G::loadTranslation('ID_CONNECT_HOST').' '.$host->ip.':'.$_POST['port'].'', +$width_content = '430px'; + +$html = ' + + + + + '.G::loadTranslation('DBCONNECTIONS_TITLE').' + + + + + '; + +$flagTns = ($_POST["type"] == "oracle" && $_POST["connectionType"] == "TNS")? 1 : 0; + +if ($flagTns == 0) { + $host = new NET($_POST["server"]); + + $port = $_POST["port"]; + + if ($port == "default") { + //setting defaults ports + switch ($_POST["type"]) { + case "mysql": $port = 3306; break; + case "pgsql": $port = 5432; break; + case "mssql": $port = 1433; break; + case "oracle": $port = 1521; break; + } + + $_POST["port"] = $port; + $port = "default ($port)"; + } + + $tests = array( + "", + G::loadTranslation('ID_HOST_NAME').' '.$_POST['server'].'', + G::loadTranslation('ID_CHECK_PORT').' '.$port.'', + G::loadTranslation('ID_CONNECT_HOST').' '.$host->ip.':'.$_POST['port'].'', G::loadTranslation('ID_OPEN_DB').'['.$_POST['db_name'].'] '.G::loadTranslation('ID_IN').' '.$_POST['type'].' '.G::loadTranslation('ID_SERVICE') ); - - $n = Array('','uno','dos','tres','cuatro','cinco'); - - for($i=1; $i - - - $tests[$i] - - - - - - - - - - - "; - } - - echo ' - - - - - - '.$html.' - - - - - - '; - +} else { + $tests = array( + "", + "Test TNS" . " " . $_POST["tns"] . "" + ); +} - print (""); - print (""); - \ No newline at end of file + $n = Array('','uno','dos','tres','cuatro','cinco'); + + for($i=1; $i + + + $tests[$i] + + + + + + + + + + + "; + } + + echo ' + + + + + + '.$html.' + + + + + + '; + + + print (""); + print (""); diff --git a/workflow/engine/xmlform/dbConnections/dbConnections_Edit.html b/workflow/engine/xmlform/dbConnections/dbConnections_Edit.html index 8bd08252f..fe3574d20 100755 --- a/workflow/engine/xmlform/dbConnections/dbConnections_Edit.html +++ b/workflow/engine/xmlform/dbConnections/dbConnections_Edit.html @@ -1,4 +1,4 @@ - + @@ -15,47 +15,58 @@ {$DBS_UID} - {$form.DBS_UID} + {$form.DBS_UID} {$DBS_TYPE} - {$form.DBS_TYPE} + {$form.DBS_TYPE} {$DBS_ENCODE} - {$form.DBS_ENCODE} + {$form.DBS_ENCODE} + + + {$DBS_CONNECTION_TYPE} + {$form.DBS_CONNECTION_TYPE} + + + + * {$DBS_TNS} + {$form.DBS_TNS} + + * {$DBS_SERVER} - {$form.DBS_SERVER} + {$form.DBS_SERVER} * {$DBS_DATABASE_NAME} - {$form.DBS_DATABASE_NAME} + {$form.DBS_DATABASE_NAME} - * {$DBS_USERNAME} + * {$DBS_USERNAME} - {$form.DBS_USERNAME} + {$form.DBS_USERNAME} {$DBS_PASSWORD} - {$form.DBS_PASSWORD} + {$form.DBS_PASSWORD} * {$DBS_PORT} - {$form.DBS_PORT} + {$form.DBS_PORT} {$DBS_DESCRIPTION} - {$form.DBS_DESCRIPTION} + {$form.DBS_DESCRIPTION} @@ -73,5 +84,5 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/workflow/engine/xmlform/dbConnections/dbConnections_Edit.xml b/workflow/engine/xmlform/dbConnections/dbConnections_Edit.xml index f3452d507..85cb04f8d 100755 --- a/workflow/engine/xmlform/dbConnections/dbConnections_Edit.xml +++ b/workflow/engine/xmlform/dbConnections/dbConnections_Edit.xml @@ -7,13 +7,24 @@ - SELECT * FROM BDCONNECTIONS + SELECT * FROM BDCONNECTIONS Engine... - + Encode... - + + + + Select type connection + Normal + TNS + + + + + TNS + Server @@ -53,17 +64,21 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/workflow/engine/xmlform/dbConnections/dbConnections_New.html b/workflow/engine/xmlform/dbConnections/dbConnections_New.html index ddb0b7851..e209fe860 100755 --- a/workflow/engine/xmlform/dbConnections/dbConnections_New.html +++ b/workflow/engine/xmlform/dbConnections/dbConnections_New.html @@ -1,4 +1,4 @@ - + @@ -18,42 +18,53 @@ * {$DBS_TYPE} - {$form.DBS_TYPE} + {$form.DBS_TYPE} * {$DBS_ENCODE} - {$form.DBS_ENCODE} + {$form.DBS_ENCODE} + + + {$DBS_CONNECTION_TYPE} + {$form.DBS_CONNECTION_TYPE} + + + + * {$DBS_TNS} + {$form.DBS_TNS} + + * {$DBS_SERVER} - {$form.DBS_SERVER} + {$form.DBS_SERVER} * {$DBS_DATABASE_NAME} - {$form.DBS_DATABASE_NAME} + {$form.DBS_DATABASE_NAME} - * {$DBS_USERNAME} + * {$DBS_USERNAME} - {$form.DBS_USERNAME} + {$form.DBS_USERNAME} {$DBS_PASSWORD} - {$form.DBS_PASSWORD} + {$form.DBS_PASSWORD} * {$DBS_PORT} - {$form.DBS_PORT} + {$form.DBS_PORT} {$DBS_DESCRIPTION} - {$form.DBS_DESCRIPTION} + {$form.DBS_DESCRIPTION} @@ -71,5 +82,5 @@ - + \ No newline at end of file diff --git a/workflow/engine/xmlform/dbConnections/dbConnections_New.xml b/workflow/engine/xmlform/dbConnections/dbConnections_New.xml index 7a2939afa..98ef1df01 100755 --- a/workflow/engine/xmlform/dbConnections/dbConnections_New.xml +++ b/workflow/engine/xmlform/dbConnections/dbConnections_New.xml @@ -6,14 +6,25 @@ - SELECT * FROM BDCONNECTIONS + SELECT * FROM BDCONNECTIONS EngineSelect... - + Encode... + + Select type connection + Normal + TNS + + + + + TNS + + Server @@ -57,10 +68,17 @@ showEncodes(); onChangeType(); }.extend(getField('DBS_TYPE'))); - + function cancel(){ oPanel.remove(); - } + } + + hideRowById("DBS_CONNECTION_TYPE"); + hideRowById("DBS_TNS"); + + leimnud.event.add(getField("DBS_CONNECTION_TYPE"), "change", function() { + showEncodes(); + }); ]]> \ No newline at end of file