diff --git a/application/ui.linkswidget.class.inc.php b/application/ui.linkswidget.class.inc.php index ef2d60be7..6fdf1e612 100644 --- a/application/ui.linkswidget.class.inc.php +++ b/application/ui.linkswidget.class.inc.php @@ -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 diff --git a/js/linkswidget.js b/js/linkswidget.js index 948cec3fe..7747f2f1c 100644 --- a/js/linkswidget.js +++ b/js/linkswidget.js @@ -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 0) + { + $('#LinkDlg_'+this.id).dialog('open'); + } + else + { + this.Refresh(); + $('#ac_add_'+this.id).attr('disabled', 'disabled'); + } } }