BUG 0000 PM tables - a import issue fixed
This commit is contained in:
@@ -1330,27 +1330,15 @@ var additionalTablesDataDelete = function(sUID, sKeys) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sKeys = substr($sKeys, 0, -1);
|
$sKeys = substr($sKeys, 0, -1);
|
||||||
$sqlExists = "SELECT COUNT(" . $aField['FLD_NAME'] . ") AS NRO_REGS FROM `" . $aData['ADD_TAB_NAME'] . "` ";
|
$oClass = new $sClassName;
|
||||||
$rsExists = $stmt->executeQuery( $sqlExists, ResultSet::FETCHMODE_ASSOC);
|
foreach ($aFields as $sKey => $sValue) {
|
||||||
$rsExists->next();
|
if(!preg_match("/\(?\)/", $sKey))
|
||||||
$aRow2 = $rsExists->getRow();
|
eval('$oClass->set' . $this->getPHPName($sKey) . '($aFields["' . $sKey . '"]);');
|
||||||
|
|
||||||
if ( $aRow2['NRO_REGS'] !='0' ) {
|
|
||||||
$oClass = new $sClassName;
|
|
||||||
foreach ($aFields as $sKey => $sValue) {
|
|
||||||
if(!preg_match("/\(?\)/", $sKey))
|
|
||||||
eval('$oClass->set' . $this->getPHPName($sKey) . '($aFields["' . $sKey . '"]);');
|
|
||||||
}
|
|
||||||
if ($oClass->validate()) {
|
|
||||||
$oConnection->begin();
|
|
||||||
$iResult = $oClass->save();
|
|
||||||
$oConnection->commit();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else {
|
if ($oClass->validate()) {
|
||||||
return false;
|
$iResult = $oClass->save();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception $oError) {
|
catch (Exception $oError) {
|
||||||
throw($oError);
|
throw($oError);
|
||||||
|
|||||||
Reference in New Issue
Block a user