From 34c7295cbcd23606be3f3cd3d73ee9088d7f469d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 21:01:30 +0200 Subject: [PATCH] Make code more jquery compliant --- htdocs/core/class/html.formticket.class.php | 29 ++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index daafa88333f..2aa2fc85966 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -697,7 +697,8 @@ class FormTicket if ($num_rows == 1) { return ''; } - $stringtoprint .= ' '; + $stringtoprint .= ' '; + $levelid = 1; while ($levelid <= $use_multilevel) { $tabscript = array(); @@ -741,7 +742,7 @@ class FormTicket $iselected = $groupticketchild == $obj->code ?'selected':''; $stringtoprint .= ''; if (empty($tabscript[$groupcodefather])) { - $tabscript[$groupcodefather] = 'if($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value == "'.dol_escape_js($groupcodefather).'"){ + $tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value == "'.dol_escape_js($groupcodefather).'"){ $(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show() console.log("We show childs tickets of '.$groupcodefather.' group ticket") }else{ @@ -756,23 +757,31 @@ class FormTicket dol_print_error($this->db); } $stringtoprint .=''; + //$stringtoprint .= ajax_combobox($htmlname.'_child_'.$levelid); $stringtoprint .=''; } + $stringtoprint .= ajax_combobox($htmlname); + return $stringtoprint; } }