Skip to content

Commit

Permalink
Fix wizzard create view form where schemas, tables and fields were no…
Browse files Browse the repository at this point in the history
…t cleaned
  • Loading branch information
ioguix committed May 16, 2010
1 parent aea1bc3 commit dfefed9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion views.php
Expand Up @@ -355,7 +355,7 @@ function doWizardCreate($msg = '') {
echo "<tr>\n<td class=\"data1\">\n";

$arrTables = array();
while (!$tables->EOF) {
while (!$tables->EOF) {
$arrTmp = array();
$arrTmp['schemaname'] = $tables->fields['nspname'];
$arrTmp['tablename'] = $tables->fields['relname'];
Expand Down Expand Up @@ -445,6 +445,7 @@ function doSaveCreateWiz() {

foreach ($_POST['formFields'] AS $curField) {
$arrTmp = unserialize($curField);
$data->fieldArrayClean($arrTmp);
if (! empty($_POST['dblFldMeth']) ) { // doublon control
if (empty($tmpHsh[$arrTmp['fieldname']])) { // field does not exist
$selFields .= "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\", ";
Expand Down Expand Up @@ -485,6 +486,8 @@ function doSaveCreateWiz() {

$arrLeftLink = unserialize($curLink['leftlink']);
$arrRightLink = unserialize($curLink['rightlink']);
$data->fieldArrayClean($arrLeftLink);
$data->fieldArrayClean($arrRightLink);

$tbl1 = "\"{$arrLeftLink['schemaname']}\".\"{$arrLeftLink['tablename']}\"";
$tbl2 = "\"{$arrRightLink['schemaname']}\".\"{$arrRightLink['tablename']}\"";
Expand Down Expand Up @@ -513,6 +516,7 @@ function doSaveCreateWiz() {
if (!strlen($linkFields) ) {
foreach ($_POST['formTables'] AS $curTable) {
$arrTmp = unserialize($curTable);
$data->fieldArrayClean($arrTmp);
$linkFields .= strlen($linkFields) ? ", \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\"" : "\"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\"";
}
}
Expand All @@ -522,6 +526,7 @@ function doSaveCreateWiz() {
foreach ($_POST['formCondition'] AS $curCondition) {
if (strlen($curCondition['field']) && strlen($curCondition['txt']) ) {
$arrTmp = unserialize($curCondition['field']);
$data->fieldArrayClean($arrTmp);
$addConditions .= strlen($addConditions) ? " AND \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' "
: " \"{$arrTmp['schemaname']}\".\"{$arrTmp['tablename']}\".\"{$arrTmp['fieldname']}\" {$curCondition['operator']} '{$curCondition['txt']}' ";
}
Expand Down

0 comments on commit dfefed9

Please sign in to comment.