diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 0a4a622f4a8..48c861fdd95 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -656,11 +656,11 @@ class FormTicket print ajax_combobox('select'.$htmlname); } elseif ($htmlname!='') { $groupticket=GETPOST($htmlname, 'aZ09'); - $groupticketchild=GETPOST($htmlname.'_child', 'aZ09'); + $child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0; $arraycodenotparent[] = ""; $arrayidused = array(); $stringtoprint = ''.$langs->trans("GroupOfTicket").' '; - $stringtoprint .= ''; $stringtoprint .= ''; $sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, "; @@ -697,13 +697,17 @@ class FormTicket } if ($num_rows_level0 == 1) { return ''; + } else { + $stringtoprint .= ''; + $stringtoprint .= ''; } + $stringtoprint .= ''; $stringtoprint .= ' '; $levelid = 1; while ($levelid <= $use_multilevel) { $tabscript = array(); - $stringtoprint .= ''; $stringtoprint .= ''; $sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctcjoin.code as codefather, "; @@ -742,7 +746,7 @@ class FormTicket if ($isparent == 'NOTPARENT') { $arraycodenotparent[] = $groupvalue; } - $iselected = $groupticketchild == $obj->code ?'selected':''; + $iselected = $groupticket == $obj->code ?'selected':''; $stringtoprint .= ''; if (empty($tabscript[$groupcodefather])) { $tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value == "'.dol_escape_js($groupcodefather).'"){ @@ -760,15 +764,43 @@ class FormTicket dol_print_error($this->db); } $stringtoprint .=''; - //$stringtoprint .= ajax_combobox($htmlname.'_child_'.$levelid); $stringtoprint .=''; } - + $stringtoprint .=''; $stringtoprint .= ajax_combobox($htmlname); return $stringtoprint;