From b58684af980dcfb132094213d6d42db2e4d07165 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Sep 2021 14:31:33 +0200 Subject: [PATCH 1/6] Fix trans --- htdocs/langs/en_US/contracts.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 49a65fdb39d..937c5a7397b 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -36,7 +36,7 @@ CloseAContract=Close a contract ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? ConfirmValidateContract=Are you sure you want to validate this contract under name %s? ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? -ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? +ConfirmCloseContract=This will close all services (expired or not). Are you sure you want to close this contract? ConfirmCloseService=Are you sure you want to close this service with date %s? ValidateAContract=Validate a contract ActivateService=Activate service From f288f36b71c83cfa91c94f9036675042b2647867 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 01:42:54 +0200 Subject: [PATCH 2/6] NEW Can use textarea field into confirm popup. Reponsive --- htdocs/contrat/card.php | 8 ++--- htdocs/core/class/html.form.class.php | 12 +++++++ .../core/tpl/admin_extrafields_view.tpl.php | 33 +++++++++++++------ 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 5aba990c14f..bd360a7e481 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1202,12 +1202,8 @@ if ($action == 'create') { } print "\n"; -} else /* *************************************************************************** */ -/* */ -/* Mode vue et edition */ -/* */ -/* *************************************************************************** */ -{ +} else { + // View and edit mode $now = dol_now(); if ($object->id > 0) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 48774c0fe66..0cd217010c5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4745,6 +4745,18 @@ class Form $more .= '
'.$input['label'].'
'."\n"; } elseif ($input['type'] == 'password') { $more .= '
'.$input['label'].'
'."\n"; + } elseif ($input['type'] == 'textarea') { + /*$more .= '
'.$input['label'].'
'; + $more .= ''; + $more .= '
'."\n";*/ + $moreonecolumn .= '
'; + $moreonecolumn .= $input['label'].'
'; + $moreonecolumn .= ''; + $moreonecolumn .= '
'; } elseif ($input['type'] == 'select') { if (empty($morecss)) { $morecss = 'minwidth100'; diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 284407383d4..c6d25410713 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -84,18 +84,31 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel } print ''; - print "".$extrafields->attributes[$elementtype]['pos'][$key]."\n"; - print "".$extrafields->attributes[$elementtype]['label'][$key]."\n"; // We don't translate here, we want admin to know what is the key not translated value + // Position + print "".dol_escape_htmltag($extrafields->attributes[$elementtype]['pos'][$key])."\n"; + // Label + print "".dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."\n"; // We don't translate here, we want admin to know what is the key not translated value + // Label translated print "".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."\n"; - print "".$key."\n"; - print "".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."\n"; - print ''.$extrafields->attributes[$elementtype]['size'][$key]."\n"; - print ''.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."\n"; + // Key + print "".dol_escape_htmltag($key)."\n"; + // Type + print "".dol_escape_htmltag($type2label[$extrafields->attributes[$elementtype]['type'][$key]])."\n"; + // Size + print ''.dol_escape_htmltag($extrafields->attributes[$elementtype]['size'][$key])."\n"; + // Computed field + print ''.dol_escape_htmltag($extrafields->attributes[$elementtype]['computed'][$key])."\n"; + // Is unique ? print ''.yn($extrafields->attributes[$elementtype]['unique'][$key])."\n"; + // Is mandatory ? print ''.yn($extrafields->attributes[$elementtype]['required'][$key])."\n"; + // Can always be editable ? print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."\n"; - print ''.$extrafields->attributes[$elementtype]['list'][$key]."\n"; - print ''.$extrafields->attributes[$elementtype]['printable'][$key]."\n"; + // Visible + print ''.dol_escape_htmltag($extrafields->attributes[$elementtype]['list'][$key])."\n"; + // Print on PDF + print ''.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key])."\n"; + // Summable print ''.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."\n"; if (!empty($conf->multicompany->enabled)) { print ''; @@ -116,8 +129,8 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel print ''; } print ''; - print ''.img_edit().''; - print '  '.img_delete().''; + print ''.img_edit().''; + print '  '.img_delete().''; print ''."\n"; print ""; } From 8e90a374e064dbc218fa79d13329cff2465a2bb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 01:47:18 +0200 Subject: [PATCH 3/6] Responsive --- htdocs/core/tpl/admin_extrafields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index c6d25410713..2f1c113fcf5 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -89,7 +89,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel // Label print "".dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."\n"; // We don't translate here, we want admin to know what is the key not translated value // Label translated - print "".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."\n"; + print ''.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$key]))."\n"; // Key print "".dol_escape_htmltag($key)."\n"; // Type From 319a531571fab4091b6d6e20275f8ece51d30e62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 01:51:25 +0200 Subject: [PATCH 4/6] Trans --- htdocs/langs/en_US/admin.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 76dd117dbd8..eb1ce338864 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2163,4 +2163,5 @@ APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s OldImplementation=Old implementation -PDF_SHOW_LINK_TO_ONLINE_PAYMENT=If some online payment modules are enabled (Paypal, Stripe, ...), add a link on the PDF to make the online payment \ No newline at end of file +PDF_SHOW_LINK_TO_ONLINE_PAYMENT=If some online payment modules are enabled (Paypal, Stripe, ...), add a link on the PDF to make the online payment +EnabledCondition=Condition to have field enabled (if not enabled, visibility will always be off) \ No newline at end of file From 7d77a71696c147e2c72b5c1798dc63438a75a27f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 02:17:08 +0200 Subject: [PATCH 5/6] Fix missing id --- htdocs/core/class/html.form.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0cd217010c5..fc83af67851 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4727,7 +4727,7 @@ class Form foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) { if ($input['type'] == 'hidden') { - $more .= ''."\n"; + $more .= ''."\n"; } } } @@ -4742,9 +4742,9 @@ class Form $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); if ($input['type'] == 'text') { - $more .= '
'.$input['label'].'
'."\n"; + $more .= '
'.$input['label'].'
'."\n"; } elseif ($input['type'] == 'password') { - $more .= '
'.$input['label'].'
'."\n"; + $more .= '
'.$input['label'].'
'."\n"; } elseif ($input['type'] == 'textarea') { /*$more .= '
'.$input['label'].'
'; $more .= ''; $moreonecolumn .= '
'; @@ -4779,7 +4779,7 @@ class Form } elseif ($input['type'] == 'checkbox') { $more .= '
'; $more .= '
'.$input['label'].'
'; - $more .= ' 
'; } - $more .= '
'.$selval.''; + $more .= ''; $more .= '
'."\n"; $i++; } @@ -4933,7 +4933,7 @@ class Form inputvalue = $("#" + inputname + more).val(); } if (typeof inputvalue == "undefined") { inputvalue=""; } - console.log("check inputname="+inputname+" inputvalue="+inputvalue); + console.log("formconfirm check inputname="+inputname+" inputvalue="+inputvalue); options += "&" + inputname + "=" + encodeURIComponent(inputvalue); }); } From 5850b68f79408942047794291ccf6454c548fa3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:22:06 +0200 Subject: [PATCH 6/6] Fix css --- htdocs/salaries/paiement_salary.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index a266a2ed88b..749ce8f9575 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -315,8 +315,11 @@ if ($action == 'create') { print ""; // Bouton Save payment - print '
'.$langs->trans("ClosePaidSalaryAutomatically"); - print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print ''; print '     '; print ''; print '
';