diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 68e3f079361..c16453b73b4 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -347,6 +347,25 @@ function ajax_dialog($title,$message,$w=350,$h=150) return $msg; } + +/** + * Make a input box content all selected + * + * @param string $htmlname Id of html object + * @param int $addlink Add a link to after + */ +function ajax_autoselect($htmlname, $addlink=0) +{ + global $langs; + $out = ''; + if ($addlink) $out.=' '.$langs->trans("Link").''; + return $out; +} + /** * Convert a html select field into an ajax combobox. * Use ajax_combobox() only for small combo list! If not, use instead ajax_autocompleter(). diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 133f1554b49..bb4d4650344 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -338,18 +338,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current $url=$urlwithouturlroot.dol_buildpath('/public/opensurvey/studs.php',1).'?sondage='.$object->id_sondage; -$urllink=''; -print $urllink; -if ($action != 'edit') -{ - print ''; - print ' '.$langs->trans("Link").''; - -} +print ''; +if ($action != 'edit') print ajax_autoselect("opensurveyurl", 1); print ''; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 1496bb3552e..4c1cb588f1f 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -209,7 +209,8 @@ function showPaypalPaymentUrl($type,$ref) $out='

'; $out.=img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'
'; $url=getPaypalPaymentUrl(0,$type,$ref); - $out.='
'; + $out.=''; + $out.=ajax_autoselect("paypalurl", 0); return $out; }