diff --git a/gulliver/system/class.database_mysql.php b/gulliver/system/class.database_mysql.php index 5c6346d67..0176bb02c 100644 --- a/gulliver/system/class.database_mysql.php +++ b/gulliver/system/class.database_mysql.php @@ -717,14 +717,29 @@ class database extends database_base { /** * Determining the existence of a table */ - function tableExists ($table, $db) { - $tables = mysql_list_tables ($db); - while (list ($temp) = @mysql_fetch_array ($tables)) { - if ($temp == $table) { - return TRUE; - } - } - return FALSE; + function tableExists($tableName, $database) + { + @mysql_select_db($database); + $tables = array(); + $tablesResult = mysql_query("SHOW TABLES FROM $database;"); + while ($row = @mysql_fetch_row($tablesResult)) $tables[] = $row[0]; + if(in_array($tableName, $tables)) { + return TRUE; + } + return FALSE; } - + +/* + * Determining the existence of a table (Depricated) + */ +// function tableExists ($table, $db) { +// $tables = mysql_list_tables ($db); +// while (list ($temp) = @mysql_fetch_array ($tables)) { +// if ($temp == $table) { +// return TRUE; +// } +// } +// return FALSE; +// } + } \ No newline at end of file diff --git a/workflow/engine/methods/cases/cases_StepToReviseInputs.php b/workflow/engine/methods/cases/cases_StepToReviseInputs.php index 112fa016d..5f55ebdf1 100644 --- a/workflow/engine/methods/cases/cases_StepToReviseInputs.php +++ b/workflow/engine/methods/cases/cases_StepToReviseInputs.php @@ -61,6 +61,7 @@ $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE'; $oTemplatePower->prepare(); $G_PUBLISH = new Publisher; $oHeadPublisher =& headPublisher::getSingleton(); +// Check if these code needs to be removed since the interface ar now moving to ExtJS $oHeadPublisher->addScriptCode(' var Cse = {}; Cse.panels = {}; @@ -76,6 +77,7 @@ $oHeadPublisher->addScriptCode(' '.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').' }); '); +// Check if these code needs to be removed since the interface ar now moving to ExtJS $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); if(!isset($_GET['position'])) $_GET['position'] = 1; @@ -144,6 +146,7 @@ G::RenderPage('publish', 'blank'); \ No newline at end of file diff --git a/workflow/engine/methods/cases/cases_StepToReviseOutputs.php b/workflow/engine/methods/cases/cases_StepToReviseOutputs.php index 0d71e420f..b6bbd37dc 100644 --- a/workflow/engine/methods/cases/cases_StepToReviseOutputs.php +++ b/workflow/engine/methods/cases/cases_StepToReviseOutputs.php @@ -52,6 +52,7 @@ $oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html'); $oTemplatePower->prepare(); $G_PUBLISH = new Publisher; $oHeadPublisher =& headPublisher::getSingleton(); +// check if the code for the addScriptCode is necessary since the interface is now based in ExtJs $oHeadPublisher->addScriptCode(' var Cse = {}; Cse.panels = {}; @@ -76,6 +77,7 @@ if(!isset($_GET['ex'])) $_GET['ex']=0; ?> \ No newline at end of file diff --git a/workflow/engine/methods/dynaforms/fields_Edit.php b/workflow/engine/methods/dynaforms/fields_Edit.php index de4dd28b0..0e35c54ae 100644 --- a/workflow/engine/methods/dynaforms/fields_Edit.php +++ b/workflow/engine/methods/dynaforms/fields_Edit.php @@ -161,7 +161,10 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons if(G::LoadSystemExist($sDataBase)){ G::LoadSystem($sDataBase); $oDataBase = new database(); - $tableExists = $oDataBase->tableExists('USERS', $Fields['PME_SQLCONNECTION']); + $dataBase = $Fields['PME_SQLCONNECTION']; + if($Fields['PME_SQLCONNECTION']=='workflow') + $dataBase = DB_NAME; + $tableExists = $oDataBase->tableExists('USERS', $dataBase); } if($tableExists) { $con = Propel::getConnection($Fields['PME_SQLCONNECTION']);