diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d3e80221e12..69c5b37ce69 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -654,7 +654,7 @@ class Form * @param int $showempty Add an empty field * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box - * @param array $event Event options + * @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @return string HTML string with */ function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array()) @@ -2315,8 +2315,8 @@ class Form $autoOpen=false; $dialogconfirm.='-'.$button; } - $pageyes=$page.'&action='.$action.'&confirm=yes'; - $pageno=($useajax == 2?$page.'&confirm=no':''); + $pageyes=(preg_match('/\?/',$page)?'&':'?').'action='.$action.'&confirm=yes'; + $pageno=($useajax == 2 ? (preg_match('/\?/',$page)?'&':'?').'confirm=no':''); // Add input fields into list of fields to read during submit (inputok and inputko) if (is_array($formquestion)) { @@ -2823,17 +2823,17 @@ class Form } /** - * Output html select to select thirdparty + * Output html select to select thirdparty * - * @param string $page Page - * @param string $selected Id preselected - * @param string $htmlname Name of HTML select + * @param string $page Page + * @param string $selected Id preselected + * @param string $htmlname Name of HTML select * @param string $filter Optionnal filters criteras * @param int $showempty Add an empty field * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box - * @param array $event Event options - * @return void + * @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @return void */ function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array()) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d4f22200fdb..b67e05defc7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -576,7 +576,7 @@ class FormFile * @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this * @param Object $object Object on which document is linked to * @param string $modulepart Value for modulepart used by download or viewimage wrapper - * @param string $param Parameters on sort links + * @param string $param Parameters on sort links (param must start with &, example &aaa=bbb&ccc=ddd) * @param int $forcedownload Force to open dialog box "Save As" when clicking on file * @param string $relativepath Relative path of docs (autodefined if not provided) * @param int $permtodelete Permission to delete @@ -678,9 +678,10 @@ class FormFile print ''; } // Delete or view link + // ($param must start with &) print '