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 ''; - if ($useinecm) print ''.img_view().'   '; - if ($permtodelete) print ''.img_delete().''; + if ($useinecm) print ''.img_view().'   '; + if ($permtodelete) print ''.img_delete().''; else print ' '; print ""; print "\n"; diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index 62427857749..d9088ba83ba 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -757,8 +757,11 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, }); } -/* This is to allow to transform all select box into ajax autocomplete box - * with just one line: $(function() { $( "#listmotifcons" ).combobox(); }); +/* + * ================================================================= + * This is to allow to transform all select box into ajax autocomplete box + * with just one line: $(function() { $( "#idofmylist" ).combobox(); }); + * ================================================================= */ (function( $ ) { $.widget( "ui.combobox", { diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index e5b8a1d5f12..82a6dadcfb8 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -290,10 +290,10 @@ function ajax_dialog($title,$message,$w=350,$h=150) } /** - * Convert a select html field into an ajax combobox + * Convert a html select field into an ajax combobox * - * @param string $htmlname Name of html field - * @param array $event Event options + * @param string $htmlname Name of html select field + * @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 Return html string to convert a select field into a combo */ function ajax_combobox($htmlname, $event=array()) diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index af33f004067..304e9718637 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -168,7 +168,7 @@ if ($action == 'confirm_deletefile') { $langs->load("other"); $result=$ecmdir->fetch($section); - if (! $result > 0) + if (! ($result > 0)) { dol_print_error($db,$ecmdir->error); exit; @@ -396,7 +396,7 @@ print $langs->trans("ECMAreaDesc")."
"; print $langs->trans("ECMAreaDesc2")."
"; print "
\n"; -// Confirm remove file +// Confirm remove file (for non javascript users) if ($action == 'delete' && empty($conf->use_javascript_ajax)) { $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);