Various settings in the Suggest

This commit is contained in:
Hector Cortez
2011-03-10 16:24:21 +00:00
parent c8529214e6
commit 9fbcc602c8
5 changed files with 46 additions and 10 deletions

View File

@@ -155,15 +155,25 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
if( $type == 'suggest' && isset($Fields['PME_SQLCONNECTION']) && $Fields['PME_SQLCONNECTION']!='') {
//define the dbArray with the table fields
//g::pr($Fields);
$con = Propel::getConnection($Fields['PME_SQLCONNECTION']);
$rs = $con->executeQuery("SHOW COLUMNS FROM USERS");
$result = Array();
$i=0;
while ($rs->next()) {
$result[$i++] = $rs->getRow();
}
//g::pr($result);
$tableExists = true;
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if(G::LoadSystemExist($sDataBase)){
G::LoadSystem($sDataBase);
$oDataBase = new database();
$tableExists = $oDataBase->tableExists('USERS', $Fields['PME_SQLCONNECTION']);
}
if($tableExists) {
$con = Propel::getConnection($Fields['PME_SQLCONNECTION']);
$rs = $con->executeQuery("SHOW COLUMNS FROM USERS");
$result = Array();
$i=0;
while ($rs->next()) {
$result[$i++] = $rs->getRow();
}
}
}
//g::pr($result);
if( isset($Fields['PME_HINT']) ) {

View File

@@ -59,7 +59,7 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
$_POST['form']['PME_SAVELABEL'] = 0;
}
if (isset($_POST['form']['PME_SAVELABEL'])){
if (isset($_POST['form']['PME_SAVELABEL']) && isset($_POST['form']['PME_CODE'])){
$pmeCode = $_POST['form']['PME_CODE'];
$pmeCode = str_replace("'", "''", $pmeCode);
$pmeCode = str_replace('"', '""', $pmeCode);