- Creation of n-n links with no attributes no longer prompts since it's not needed !

SVN:trunk[519]
This commit is contained in:
Denis Flaven
2010-07-01 14:29:19 +00:00
parent 702a2345f7
commit b298d3eb2e
2 changed files with 26 additions and 5 deletions

View File

@@ -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

View File

@@ -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');
}
}
}