Merge pull request #806 from ralpheav/master
Code Style change workflow/engine/methods/dbConnections
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* upgrade.php
|
||||
*
|
||||
@@ -12,15 +13,14 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
global $RBAC;
|
||||
@@ -44,34 +44,35 @@ $G_ID_MENU_SELECTED = 'PROCESSES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'DB_CONNECTIONS';
|
||||
*/
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass('processMap');
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcess = new processMap();
|
||||
$oCriteria = $oProcess->getConditionProcessList();
|
||||
if (ProcessPeer::doCount($oCriteria) > 0) {
|
||||
$aProcesses = array();
|
||||
$aProcesses[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char');
|
||||
$oDataset = StepPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if (ProcessPeer::doCount( $oCriteria ) > 0) {
|
||||
$aProcesses = array ();
|
||||
$aProcesses[] = array ('PRO_UID' => 'char','PRO_TITLE' => 'char' );
|
||||
$oDataset = StepPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$sProcessUID = '';
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($sProcessUID == '') {
|
||||
$sProcessUID = $aRow['PRO_UID'];
|
||||
}
|
||||
$aProcesses[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE']);
|
||||
$aProcesses[] = array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['PRO_TITLE'] );
|
||||
$oDataset->next();
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['PROCESSES'] = $aProcesses;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dbConnections/dbConnections_Events');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'dbConnections/dbConnections_Events' );
|
||||
require_once 'classes/model/DbSource.php';
|
||||
$oDBSource = new DbSource();
|
||||
$oCriteria = $oDBSource->getCriteriaDBSList($sProcessUID);
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'dbConnections/dbConnections', $oCriteria);
|
||||
$oCriteria = $oDBSource->getCriteriaDBSList( $sProcessUID );
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'dbConnections/dbConnections', $oCriteria );
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/noProcesses');
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/noProcesses' );
|
||||
}
|
||||
G::RenderPage('publish');
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @Author: Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @Description:This is a additional configuration for load all connections; if exist in a particular proccess
|
||||
* @Date: 15-05-2008
|
||||
*/
|
||||
if( isset($_SESSION['PROCESS']) ){
|
||||
$pro = include (PATH_CORE . "config/databases.php");
|
||||
G::LoadClass('dbConnections');
|
||||
|
||||
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
|
||||
foreach( $oDbConnections->connections as $db ) {
|
||||
$db['DBS_PASSWORD'] = $oDbConnections->getPassWithoutEncrypt($db);
|
||||
$dbsPort = ($db['DBS_PORT'] == '') ? ('') : (':'.$db['DBS_PORT']);
|
||||
$ENCODE = (trim($db['DBS_ENCODE']) == '')? '': '?encoding=' . $db['DBS_ENCODE'];
|
||||
if(strpos($db['DBS_SERVER'], "\\") && $db['DBS_TYPE'] == 'mssql'){
|
||||
$pro['datasources'][$db['DBS_UID']]['connection'] = $db['DBS_TYPE'] . '://' . $db['DBS_USERNAME'] . ':' . $db['DBS_PASSWORD'] . '@' . $db['DBS_SERVER'] . '/' . $db['DBS_DATABASE_NAME'] . $ENCODE;
|
||||
/**
|
||||
* Description: This is a additional configuration for load all connections; if exist in a particular proccess
|
||||
* @Date: 15-05-2008
|
||||
*
|
||||
* @author : Erik Amaru Ortiz <erik@colosa.com>
|
||||
*/
|
||||
if (isset( $_SESSION['PROCESS'] )) {
|
||||
$pro = include (PATH_CORE . "config/databases.php");
|
||||
G::LoadClass( 'dbConnections' );
|
||||
|
||||
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
|
||||
foreach ($oDbConnections->connections as $db) {
|
||||
$db['DBS_PASSWORD'] = $oDbConnections->getPassWithoutEncrypt( $db );
|
||||
$dbsPort = ($db['DBS_PORT'] == '') ? ('') : (':' . $db['DBS_PORT']);
|
||||
$ENCODE = (trim( $db['DBS_ENCODE'] ) == '') ? '' : '?encoding=' . $db['DBS_ENCODE'];
|
||||
if (strpos( $db['DBS_SERVER'], "\\" ) && $db['DBS_TYPE'] == 'mssql') {
|
||||
$pro['datasources'][$db['DBS_UID']]['connection'] = $db['DBS_TYPE'] . '://' . $db['DBS_USERNAME'] . ':' . $db['DBS_PASSWORD'] . '@' . $db['DBS_SERVER'] . '/' . $db['DBS_DATABASE_NAME'] . $ENCODE;
|
||||
} else {
|
||||
$pro['datasources'][$db['DBS_UID']]['connection'] = $db['DBS_TYPE'] . '://' . $db['DBS_USERNAME'] . ':' . $db['DBS_PASSWORD'] . '@' . $db['DBS_SERVER'] .$dbsPort. '/' . $db['DBS_DATABASE_NAME'] . $ENCODE;
|
||||
$pro['datasources'][$db['DBS_UID']]['connection'] = $db['DBS_TYPE'] . '://' . $db['DBS_USERNAME'] . ':' . $db['DBS_PASSWORD'] . '@' . $db['DBS_SERVER'] . $dbsPort . '/' . $db['DBS_DATABASE_NAME'] . $ENCODE;
|
||||
}
|
||||
$pro['datasources'][$db['DBS_UID']]['adapter'] = $db['DBS_TYPE'];
|
||||
}
|
||||
return $pro;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @Author: Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @Description:This is a additional configuration for load all connections; if exist in a particular proccess
|
||||
* @Date: 15-05-2008
|
||||
* ription:This is a additional configuration for load all connections; if exist in a particular proccess
|
||||
* @Date: 15-05-2008
|
||||
*
|
||||
* @author : Erik Amaru Ortiz <erik@colosa.com>
|
||||
*/
|
||||
|
||||
$dbHash = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH));
|
||||
|
||||
$host = $dbHash[0];
|
||||
$user = $dbHash[1];
|
||||
$pass = $dbHash[2];
|
||||
$dbName = DB_NAME;
|
||||
|
||||
$pro = include (PATH_CORE . "config/databases.php");
|
||||
|
||||
$pro['datasources']['root'] = Array ();
|
||||
$pro['datasources']['root']['connection'] = "mysql://$user:$pass@$host/$dbName?encoding=utf8";
|
||||
$pro['datasources']['root']['adapter'] = "mysql";
|
||||
|
||||
return $pro;
|
||||
$dbHash = @explode( SYSTEM_HASH, G::decrypt( HASH_INSTALLATION, SYSTEM_HASH ) );
|
||||
|
||||
$host = $dbHash[0];
|
||||
$user = $dbHash[1];
|
||||
$pass = $dbHash[2];
|
||||
$dbName = DB_NAME;
|
||||
|
||||
$pro = include (PATH_CORE . "config/databases.php");
|
||||
|
||||
$pro['datasources']['root'] = Array ();
|
||||
$pro['datasources']['root']['connection'] = "mysql://$user:$pass@$host/$dbName?encoding=utf8";
|
||||
$pro['datasources']['root']['adapter'] = "mysql";
|
||||
|
||||
return $pro;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user