Skip to content
Snippets Groups Projects
Commit 67b3e3da authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX #6784

parent cea98ce5
No related branches found
No related tags found
No related merge requests found
...@@ -354,9 +354,9 @@ function ajax_dialog($title,$message,$w=350,$h=150) ...@@ -354,9 +354,9 @@ function ajax_dialog($title,$message,$w=350,$h=150)
* Make content of an input box selected when we click into input field. * Make content of an input box selected when we click into input field.
* *
* @param string $htmlname Id of html object * @param string $htmlname Id of html object
* @param int $addlink Add a link to after * @param string $addlink Add a 'link to' after
*/ */
function ajax_autoselect($htmlname, $addlink=0) function ajax_autoselect($htmlname, $addlink='')
{ {
global $langs; global $langs;
$out = '<script type="text/javascript"> $out = '<script type="text/javascript">
...@@ -364,7 +364,7 @@ function ajax_autoselect($htmlname, $addlink=0) ...@@ -364,7 +364,7 @@ function ajax_autoselect($htmlname, $addlink=0)
jQuery("#'.$htmlname.'").click(function() { jQuery(this).select(); } ); jQuery("#'.$htmlname.'").click(function() { jQuery(this).select(); } );
}); });
</script>'; </script>';
if ($addlink) $out.=' <a href="'.$url.'" target="_blank">'.$langs->trans("Link").'</a>'; if ($addlink) $out.=' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
return $out; return $out;
} }
......
...@@ -332,9 +332,9 @@ $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($ ...@@ -332,9 +332,9 @@ $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current //$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; $url=$urlwithroot.'/public/opensurvey/studs.php?sondage='.$object->id_sondage;
print '<input type="text" style="width: 60%" '.($action == 'edit' ? 'disabled' : '').' id="opensurveyurl" name="opensurveyurl" value="'.$url.'">'; print '<input type="text" style="width: 60%" '.($action == 'edit' ? 'disabled' : '').' id="opensurveyurl" name="opensurveyurl" value="'.$url.'">';
if ($action != 'edit') print ajax_autoselect("opensurveyurl", 1); if ($action != 'edit') print ajax_autoselect("opensurveyurl", $url);
print '</td></tr>'; print '</td></tr>';
......
...@@ -47,6 +47,9 @@ $nblignes=$object->fetch_lines(); ...@@ -47,6 +47,9 @@ $nblignes=$object->fetch_lines();
//If the survey has not yet finished, then it can be modified //If the survey has not yet finished, then it can be modified
$canbemodified = ((empty($object->date_fin) || $object->date_fin > dol_now()) && $object->status != Opensurveysondage::STATUS_CLOSED); $canbemodified = ((empty($object->date_fin) || $object->date_fin > dol_now()) && $object->status != Opensurveysondage::STATUS_CLOSED);
// Security check
if (empty($conf->opensurvey->enabled)) accessforbidden('',0,0,1);
/* /*
* Actions * Actions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment