N°1109 - itop-object-copier Create ticket from CI was not adding the CI in the CI list of the newly created ticket.

* Fix 'add_to_list' command.
* Fix Adding a n-n link at the creation time.

SVN:trunk[5053]
This commit is contained in:
Eric Espié
2017-10-19 14:39:15 +00:00
parent fb22107be8
commit bbde89e0f9
4 changed files with 42 additions and 25 deletions

View File

@@ -168,7 +168,7 @@ class UILinksWidget
$sPrefix .= "[-$iUniqueId][";
$sNameSuffix = "]"; // To make a tabular form
$aArgs['prefix'] = $sPrefix;
$aArgs['wizHelper'] = "oWizardHelper{$this->m_iInputId}_".$iUniqueId;
$aArgs['wizHelper'] = "oWizardHelper{$this->m_iInputId}_".($iUniqueId < 0 ? -$iUniqueId : $iUniqueId);
$aArgs['this'] = $oNewLinkObj;
$aRow['form::checkbox'] = "<input class=\"selection\" data-remote-id=\"$iRemoteObjKey\" data-link-id=\"\" data-unique-id=\"$iUniqueId\" type=\"checkbox\" onClick=\"oWidget".$this->m_iInputId.".OnSelectChange();\" value=\"-$iUniqueId\">";
foreach($this->m_aEditableFields as $sFieldCode)
@@ -185,12 +185,17 @@ class UILinksWidget
}
$sState = '';
$oP->add_script(
<<<EOF
// Rows created with ajax call need OnLinkAdded call.
// Rows added before loading the form cannot call OnLinkAdded.
if ($iUniqueId > 0)
{
$oP->add_script(
<<<EOF
PrepareWidgets();
oWidget{$this->m_iInputId}.OnLinkAdded($iUniqueId, $iRemoteObjKey);
EOF
);
);
}
}
if(!$bReadOnly)