From 094c2c3027e6e769996fb58f621aedb93ae316b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 01:02:49 +0200 Subject: [PATCH 1/6] Fix condition on a field --- htdocs/projet/class/project.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7ee71bc1569..849c1c53398 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -345,6 +345,7 @@ class Project extends CommonObject $this->fields['accept_booth_suggestions']['enabled'] = 0; $this->fields['price_registration']['enabled'] = 0; $this->fields['price_booth']['enabled'] = 0; + $this->fields['max_attendees']['enabled'] = 0; } } From 9881e7753d0fa9d638e8c9326968e4529cfd4ac0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 01:35:54 +0200 Subject: [PATCH 2/6] Fix regression --- .../societe/mod_codeclient_elephant.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 820dfafdc7e..100799dff95 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -172,27 +172,32 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode "ErrorBadMaskBadRazMonth", "ErrorCantUseRazWithYearOnOneDigit", ); + + $cssforerror = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') == 'mod_codeclient_elephant' ? 'error' : 'opacitymedium'); + if ($type != 1) { $examplecust = $this->getNextValue($objsoc, 0); - if (!$examplecust) { - $examplecust = '
'.$langs->trans('NotConfigured').'
'; + if (!$examplecust && ($cssforerror == 'error' || $this->error != 'NotConfigured')) { + $langs->load("errors"); + $examplecust = ''.$langs->trans('ErrorBadMask').''; $error = 1; } if (in_array($examplecust, $errmsg)) { $langs->load("errors"); - $examplecust = '
'.$langs->trans($examplecust).'
'; + $examplecust = ''.$langs->trans($examplecust).''; $error = 1; } } if ($type != 0) { $examplesup = $this->getNextValue($objsoc, 1); - if (!$examplesup) { - $examplesup = '
'.$langs->trans('NotConfigured').'
'; + if (!$examplesup && ($cssforerror == 'error' || $this->error != 'NotConfigured')) { + $langs->load("errors"); + $examplesup = ''.$langs->trans('ErrorBadMask').''; $error = 1; } if (in_array($examplesup, $errmsg)) { $langs->load("errors"); - $examplesup = '
'.$langs->trans($examplesup).'
'; + $examplesup = ''.$langs->trans($examplesup).''; $error = 1; } } @@ -202,11 +207,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode } elseif ($type == 1) { return $examplesup; } else { - if ($error == 1) { - return $examplecust.' '.$examplesup; - } else { - return $examplecust.'
'.$examplesup; - } + return $examplecust.'
'.$examplesup; } } From 2ac4103af8ea42b422a572b87afad10025a5aa7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 10:20:31 +0200 Subject: [PATCH 3/6] Fix css --- htdocs/compta/sociales/list.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 365cdf93a2f..4772b9c45bd 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -451,7 +451,8 @@ if (!empty($arrayfields['p.ref']['checked'])) { if (!empty($arrayfields['cs.fk_user']['checked'])) { // Employee print ''; - print $form->select_dolusers($search_users, 'search_users', 1, null, 0, '', '', '0', '0', 0, '', 0, '', '', 0, 0, true); + print $form->select_dolusers($search_users, 'search_users', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150', 0, 0, true); + print ''; } // Filter: Type @@ -592,7 +593,7 @@ while ($i < min($num, $limit)) { if (isModEnabled('accounting')) { $typelabelpopup .= ' - '.$langs->trans("AccountancyCode").': '.$obj->type_accountancy_code; } - print ''.dol_escape_htmltag($typelabeltoshow).''; + print ''.dol_escape_htmltag($typelabeltoshow).''; if (!$i) { $totalarray['nbfield']++; } @@ -600,7 +601,7 @@ while ($i < min($num, $limit)) { // Date if (!empty($arrayfields['cs.date_ech']['checked'])) { - print ''.dol_print_date($db->jdate($obj->date_ech), 'day').''; + print ''.dol_print_date($db->jdate($obj->date_ech), 'day').''; if (!$i) { $totalarray['nbfield']++; } @@ -608,7 +609,7 @@ while ($i < min($num, $limit)) { // Date end period if (!empty($arrayfields['cs.periode']['checked'])) { - print ''.dol_print_date($db->jdate($obj->periode), 'day').''; + print ''.dol_print_date($db->jdate($obj->periode), 'day').''; if (!$i) { $totalarray['nbfield']++; } @@ -616,7 +617,7 @@ while ($i < min($num, $limit)) { // Project ref if (!empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; if ($obj->project_id > 0) { print $projectstatic->getNomUrl(1); } @@ -628,7 +629,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['cs.fk_user']['checked'])) { // Employee - print ""; + print ''; if (!empty($obj->fk_user)) { if (!empty($TLoadedUsers[$obj->fk_user])) { $ustatic = $TLoadedUsers[$obj->fk_user]; @@ -647,7 +648,7 @@ while ($i < min($num, $limit)) { // Type if (!empty($arrayfields['cs.fk_mode_reglement']['checked'])) { - print ''; + print 'payment_code)).'">'; if (!empty($obj->payment_code)) { print $langs->trans("PaymentTypeShort".$obj->payment_code); } @@ -659,7 +660,7 @@ while ($i < min($num, $limit)) { // Account if (!empty($arrayfields['cs.fk_account']['checked'])) { - print ''; + print ''; if ($obj->fk_account > 0) { $bankstatic->id = $obj->fk_account; $bankstatic->ref = $obj->bref; @@ -682,7 +683,7 @@ while ($i < min($num, $limit)) { // Amount if (!empty($arrayfields['cs.amount']['checked'])) { - print ''.price($obj->amount).''; + print ''.price($obj->amount).''; if (!$i) { $totalarray['nbfield']++; } @@ -694,7 +695,7 @@ while ($i < min($num, $limit)) { // Status if (!empty($arrayfields['cs.paye']['checked'])) { - print ''.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).''; + print ''.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).''; if (!$i) { $totalarray['nbfield']++; } From e0f76fd8f93a37559e67af32b1a485b73be751c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 11:53:52 +0200 Subject: [PATCH 4/6] Fix modify cursor on submit after a confirmation. --- htdocs/core/class/html.form.class.php | 19 ++++++++++++++----- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0107dd8641d..5729b87cc6f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5152,7 +5152,8 @@ class Form var options = "&token='.urlencode(newToken()).'"; var inputok = '.json_encode($inputok).'; /* List of fields into form */ var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; - if (inputok.length>0) { + + if (inputok.length > 0) { $.each(inputok, function(i, inputname) { var more = ""; var inputvalue; @@ -5168,14 +5169,19 @@ class Form }); } var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options; - if (pageyes.length > 0) { location.href = urljump; } - $(this).dialog("close"); + if (pageyes.length > 0) { + // The call to urljump can be slow, so we set the wait cursor + jQuery("html,body,#id-container").addClass("cursorwait"); + location.href = urljump; + console.log("after location.href"); + } + $(this).dialog("close"); }, "'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { var options = "&token='.urlencode(newToken()).'"; var inputko = '.json_encode($inputko).'; /* List of fields into form */ var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'"; - if (inputko.length>0) { + if (inputko.length > 0) { $.each(inputko, function(i, inputname) { var more = ""; if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } @@ -5186,7 +5192,10 @@ class Form } var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options; //alert(urljump); - if (pageno.length > 0) { location.href = urljump; } + if (pageno.length > 0) { + location.href = urljump; + console.log("after location.href"); + } $(this).dialog("close"); } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 90cc6b420f8..fc4fafc60af 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -887,6 +887,9 @@ textarea.centpercent { .cursornotallowed { cursor: not-allowed; } +.cursorwait { + cursor: wait; +} .backgroundblank { background-color: #fff; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f1c314426a2..7521172121f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1032,6 +1032,9 @@ textarea.centpercent { .cursormove { cursor: move; } +.cursorwait { + cursor: wait; +} .cursornotallowed { cursor: not-allowed; } From 3abff910357a033f28e14475488b4681a7c01eca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 12:01:15 +0200 Subject: [PATCH 5/6] Fix alternative name not visible in tooltip --- htdocs/societe/list.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 137ddd1c7cb..18999ed9a1f 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1445,24 +1445,19 @@ while ($i < min($num, $limit)) { } } if (!empty($arrayfields['s.nom']['checked'])) { - $savalias = $obj->name_alias; - if (!empty($arrayfields['s.name_alias']['checked'])) { - $companystatic->name_alias = ''; - } print 'global->MAIN_SOCIETE_SHOW_COMPLETE_NAME) ? ' class="tdoverflowmax200"' : '').' data-key="ref">'; if ($contextpage == 'poslist') { - print $obj->name; + print dol_escape_htmltag($obj->name); } else { - print $companystatic->getNomUrl(1, '', 100, 0, 1); + print $companystatic->getNomUrl(1, '', 100, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); } print "\n"; - $companystatic->name_alias = $savalias; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; + print ''; print dol_escape_htmltag($companystatic->name_alias); print "\n"; if (!$i) { @@ -1471,7 +1466,7 @@ while ($i < min($num, $limit)) { } // Barcode if (!empty($arrayfields['s.barcode']['checked'])) { - print ''.dol_escape_htmltag($obj->barcode).''; + print ''.dol_escape_htmltag($obj->barcode).''; if (!$i) { $totalarray['nbfield']++; } From 08be53494f58c33d29c3ac690710d8978db20168 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 17:43:34 +0200 Subject: [PATCH 6/6] trans --- htdocs/admin/system/perf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index f43bc3bf49a..fba5f9efb75 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("install", "other", "admin")); +$langs->loadLangs(array("install", "other", "admin", "products")); if (!$user->admin) { accessforbidden();