From e2c558f9cc61ed040f85d0610b146a76ea2c8bf2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Feb 2023 01:34:45 +0100 Subject: [PATCH] Debug v17 --- htdocs/compta/facture/card.php | 51 +++++++++++---------------- htdocs/core/class/html.form.class.php | 16 +++++---- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ccfedf5ad4a..4ea4306a465 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3188,7 +3188,7 @@ if ($action == 'create') { $arrayoutstandingbills = $soc->getOutstandingBills(); $outstandingBills = $arrayoutstandingbills['opened']; print ' - '.$langs->trans('CurrentOutstandingBill').': '; - print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + print ''.price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency).''; if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) { print img_warning($langs->trans("OutstandingBillReached")); @@ -3307,7 +3307,7 @@ if ($action == 'create') { print '
'; $tmp = ' '; $tmp = $tmp.''; - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3, 'standardonsmartphone'); print ''; print '
'; print $desc; @@ -3346,7 +3346,7 @@ if ($action == 'create') { jQuery("#radio_deposit").prop("checked", true); setRadioForTypeOfIncoice(); }); - jQuery("#radio_standard, #radio_deposit, #radio_replacement, #radio_template").change(function() { + jQuery("#radio_standard, #radio_deposit, #radio_replacement, #radio_creditnote, #radio_template").change(function() { setRadioForTypeOfIncoice(); }); function setRadioForTypeOfIncoice() { @@ -3362,10 +3362,10 @@ if ($action == 'create') { }); '; - $tmp = $tmp.''; - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); print ''; print ''; if (($origin == 'propal') || ($origin == 'commande')) { @@ -3404,7 +3404,7 @@ if ($action == 'create') { print '
'; $tmp = ' '; $tmp = $tmp.''; - $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3, 'firstsituationonsmartphone'); print $desc; print '
'; @@ -3417,7 +3417,7 @@ if ($action == 'create') { $tmp .= ' disabled'; } $tmp .= '> '; - $text = ' '; + $text = $tmp.' '; $text .= 'id > 0) { $text .= ' disabled'; @@ -3486,26 +3486,18 @@ if ($action == 'create') { if (!empty($conf->global->INVOICE_USE_SITUATION)) { print '
'; $tmp = ' '; - $text = ' '; + $text = $tmp.' '; $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); - print $desc; - print '
'; - - print '
'; - $tmp = ' '; - $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3, 'firstsituationonsmartphone'); print $desc; print '
'; } print '
'; $tmp = ' '; - $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); + $text = $tmp.' '; + //$text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc").'

'.$langs->trans("YouMustCreateInvoiceFromThird"), 1, 'help', '', 0, 3, 'replacementonsmartphone'); print $desc; print '
'; } @@ -3565,7 +3557,6 @@ if ($action == 'create') { }); '; $text = ' '; - // $text.=''; $text .= ' 0 ? 'checked' : '').' /> "; print '
    0 ? 'checked' : '').' /> "; print ''; @@ -3595,9 +3586,9 @@ if ($action == 'create') { } else { $tmp = ' '; } - $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + $text = $tmp.' '; + //$text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc").'

'.$langs->trans("YouMustCreateInvoiceFromThird"), 1, 'help', '', 0, 3, 'creditnoteonsmartphone'); print $desc; print ''."\n"; } @@ -3606,9 +3597,8 @@ if ($action == 'create') { // Template invoice print '
'; $tmp = ' '; - $text = ' '; - //$text.= '('.$langs->trans("YouMustCreateStandardInvoiceFirst").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("YouMustCreateStandardInvoiceFirstDesc"), 1, 'help', '', 0, 3); + $text = $tmp.' '; + $desc = $form->textwithpicto($text, $langs->transnoentities("YouMustCreateStandardInvoiceFirstDesc"), 1, 'help', '', 0, 3, 'templateonsmartphone'); print $desc; print '
'; @@ -3629,7 +3619,8 @@ if ($action == 'create') { $(document).ready(function() { var listType = {'.$jsListType.'}; $("[name=\'type\'").change(function() { - if($( this ).prop("checked")) + console.log("change name=type"); + if ($( this ).prop("checked")) { if(($( this ).val() in listType)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6fef01d3f7e..5ee6efac42f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -724,7 +724,7 @@ class Form * @param string $extracss Add a CSS style to td, div or span tag * @param int $noencodehtmltext Do not encode into html entity the htmltext * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span - * @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') + * @param string $tooltiptrigger ''=Tooltip on hover and hidden on smartphone, 'abconsmartphone'=Tooltip on hover and on click on smartphone, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable') * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) * @return string HTML code of text, picto, tooltip */ @@ -732,11 +732,6 @@ class Form { global $conf, $langs; - $alt = ''; - if ($tooltiptrigger) { - $alt = $langs->transnoentitiesnoconv("ClickToShowHelp"); - } - //For backwards compatibility if ($type == '0') { $type = 'info'; @@ -744,6 +739,15 @@ class Form $type = 'help'; } + if (preg_match('/onsmartphone$/', $tooltiptrigger) && empty($conf->dol_no_mouse_hover)) { + $tooltiptrigger = preg_replace('/^.*onsmartphone$/', '', $tooltiptrigger); + } + + $alt = ''; + if ($tooltiptrigger) { + $alt = $langs->transnoentitiesnoconv("ClickToShowHelp"); + } + // If info or help with no javascript, show only text if (empty($conf->use_javascript_ajax)) { if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') {
'; + $tmp = $tmp.''; + $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3, 'depositonsmartphone'); print $desc; print '