Merge pull request #1436 from julceslauhub/master

BUG 11052 Notice en Report Table al hacer correr un caso con old version SOLVED
This commit is contained in:
julceslauhub
2013-03-21 10:02:19 -07:00
2 changed files with 27 additions and 25 deletions

View File

@@ -646,32 +646,34 @@ class ReportTables
$aAux = explode( '-', $aRow['REP_TAB_GRID'] );
if (isset( $aFields[$aAux[0]] )) {
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
foreach ($aTableFields as $aField) {
$sQuery .= ',`' . $aField['sFieldName'] . '`';
}
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber . ',' . $iRow;
foreach ($aTableFields as $aField) {
switch ($aField['sType']) {
case 'number':
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
break;
case 'char':
case 'text':
if (! isset( $aGridRow[$aField['sFieldName']] )) {
$aGridRow[$aField['sFieldName']] = '';
}
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
break;
case 'date':
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
break;
if (is_array($aFields[$aAux[0]])) {
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
$sQuery .= '`APP_UID`,`APP_NUMBER`,`ROW`';
foreach ($aTableFields as $aField) {
$sQuery .= ',`' . $aField['sFieldName'] . '`';
}
$sQuery .= ") VALUES ('" . $sApplicationUid . "'," . (int) $iApplicationNumber . ',' . $iRow;
foreach ($aTableFields as $aField) {
switch ($aField['sType']) {
case 'number':
$sQuery .= ',' . (isset( $aGridRow[$aField['sFieldName']] ) ? (float) str_replace( ',', '', $aGridRow[$aField['sFieldName']] ) : '0');
break;
case 'char':
case 'text':
if (! isset( $aGridRow[$aField['sFieldName']] )) {
$aGridRow[$aField['sFieldName']] = '';
}
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? mysql_real_escape_string( $aGridRow[$aField['sFieldName']] ) : '') . "'";
break;
case 'date':
$sQuery .= ",'" . (isset( $aGridRow[$aField['sFieldName']] ) ? $aGridRow[$aField['sFieldName']] : '') . "'";
break;
}
}
$sQuery .= ')';
$rs = $stmt->executeQuery( $sQuery );
}
$sQuery .= ')';
$rs = $stmt->executeQuery( $sQuery );
}
}
}

View File

@@ -166,7 +166,7 @@ Export.submit = function()
if (result.success) {
location.href = result.link;
} else {
PMExt.error(_('ID_ERROR'), result.message));
PMExt.error(_('ID_ERROR'), result.message);
}
},
failure: function(obj, resp){