- Renamed the method 'UpdateObject' into 'UpdateObjectFromPostedForm' to avoid misunderstandings.

- Fixed (again !) Trac #427: unable to empty a linkset when editing an object.

SVN:trunk[1370]
This commit is contained in:
Denis Flaven
2011-07-26 16:18:19 +00:00
parent 751ab5a4b4
commit a2b8813628
7 changed files with 22 additions and 16 deletions

View File

@@ -2325,7 +2325,7 @@ EOF
/**
* Updates the object from the POSTed parameters (form)
*/
public function UpdateObject($sFormPrefix = '', $aAttList = null)
public function UpdateObjectFromPostedForm($sFormPrefix = '', $aAttList = null)
{
$aErrors = array();
$aValues = array();

View File

@@ -610,7 +610,7 @@ EOF
$sClass = get_class($oObj);
$oObj->UpdateObject('' /* form prefix */, $aAttList);
$oObj->UpdateObjectFromPostedForm('' /* form prefix */, $aAttList);
// Optional: apply a stimulus
//

View File

@@ -377,7 +377,7 @@ EOF
public function DoCreateObject($oPage)
{
$oObj = MetaModel::NewObject($this->sTargetClass);
$aErrors = $oObj->UpdateObject($this->iId);
$aErrors = $oObj->UpdateObjectFromPostedForm($this->iId);
if (count($aErrors) == 0)
{
$oMyChange = MetaModel::NewObject("CMDBChange");

View File

@@ -182,17 +182,17 @@ class UILinksWidget
// Content
$sHtml .= "</tbody>\n";
if (count($aData) == 0)
$sEmptyRowStyle = '';
if (count($aData) != 0)
{
$sHtml .= "<tr id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_empty_row\"><td colspan=\"".count($aConfig)."\" style=\"text-align:center;\">".Dict::S('UI:Message:EmptyList:UseAdd')."<input type=\"hidden\" name=\"attr_{$this->m_sAttCode}{$this->m_sNameSuffix}\" value=\"\"></td></td>";
$sEmptyRowStyle = 'style="display:none;"';
}
else
$sHtml .= "<tr $sEmptyRowStyle id=\"{$this->m_sAttCode}{$this->m_sNameSuffix}_empty_row\"><td colspan=\"".count($aConfig)."\" style=\"text-align:center;\">".Dict::S('UI:Message:EmptyList:UseAdd')."<input type=\"hidden\" name=\"attr_{$this->m_sAttCode}{$this->m_sNameSuffix}\" value=\"\"></td></td>";
foreach($aData as $iRowId => $aRow)
{
foreach($aData as $iRowId => $aRow)
{
$sHtml .= $this->DisplayFormRow($oP, $aConfig, $aRow, $iRowId);
}
}
$sHtml .= $this->DisplayFormRow($oP, $aConfig, $aRow, $iRowId);
}
$sHtml .= "</tbody>\n";
// Footer