mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- Creation of n-n links with no attributes no longer prompts since it's not needed !
SVN:trunk[519]
This commit is contained in:
@@ -70,7 +70,11 @@ class UILinksWidget
|
||||
}
|
||||
}
|
||||
}
|
||||
$sAttributes = "['".implode("','", $aAttributes)."']";
|
||||
$sAttributes = '[]';
|
||||
if (count($aAttributes) > 0)
|
||||
{
|
||||
$sAttributes = "['".implode("','", $aAttributes)."']";
|
||||
}
|
||||
if ($oCurrentValuesSet != null)
|
||||
{
|
||||
// Serialize the link set into a JSon object
|
||||
|
||||
@@ -54,14 +54,31 @@ function LinksWidget(id, sLinkedClass, sExtKeyToMe, sExtKeyToRemote, aAttributes
|
||||
}
|
||||
this.aPreviousLinks = this.aLinks; // Save the list in case of cancellation
|
||||
this.aLinks = new Array(); // rebuild the list of links from scratch
|
||||
if (oSelected.length > 0)
|
||||
if (this.aAttributes.length == 0)
|
||||
{
|
||||
$('#LinkDlg_'+this.id).dialog('open');
|
||||
// No attributes on the link, no need for the extra dialog box
|
||||
// Process the results directly
|
||||
for(i=0; i<this.aObjectBeingLinked.length; i++)
|
||||
{
|
||||
oLink = {};
|
||||
oLink[this.sExtKeyToRemote] = this.aObjectBeingLinked[i];
|
||||
this.aLinks.push(oLink);
|
||||
}
|
||||
this.Refresh();
|
||||
// Grey out the 'Add...' button
|
||||
$('#ac_add_'+this.id).attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Refresh();
|
||||
$('#ac_add_'+this.id).attr('disabled', 'disabled');
|
||||
if (oSelected.length > 0)
|
||||
{
|
||||
$('#LinkDlg_'+this.id).dialog('open');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Refresh();
|
||||
$('#ac_add_'+this.id).attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user