Merge pull request #2131 from Jennydmz/BUG-13475

Bug 13475 Problemas al usar pmconnection.
This commit is contained in:
julceslauhub
2013-11-11 12:23:41 -08:00

View File

@@ -165,9 +165,12 @@ try {
// saving the data ina pm table in case that is a new record
if (! empty( $newValues )) {
$id = key( $newValues );
if (! $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues )) {
$newValues[$id] = $aData['APP_DATA'][$id];
$idPmtable = $oForm->fields[$id]->pmconnection->pmtable != '' ? $oForm->fields[$id]->pmconnection->pmtable : $oForm->fields[$id]->owner->tree->children[0]->attributes['pmtable'];
if (!($oAdditionalTables->updateDataInTable($idPmtable, $newValues ))) {
//<--This is to know if it is a new registry on the PM Table
$oAdditionalTables->saveDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues );
$oAdditionalTables->saveDataInTable($idPmtable, $newValues );
}
}