From 59ec20f549200bca9a35b6823ebbdb72c4617c15 Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Fri, 25 Nov 2022 23:44:32 +0100 Subject: [PATCH 1/5] Fix #20685 User Id not transmitted on Api addTimeSpent Fix #20685 User Id not transmitted on Api addTimeSpent The User ID will be transmitted to the API call (if 0 then, the user will be selected from API key) --- htdocs/projet/class/api_tasks.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 49a5d9d418b..5c1dae46822 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -545,7 +545,7 @@ class Tasks extends DolibarrApi $this->task->timespent_datehour = $newdate; $this->task->timespent_withhour = 1; $this->task->timespent_duration = $duration; - $this->task->timespent_fk_user = $user_id; + $this->task->timespent_fk_user = $uid; $this->task->timespent_note = $note; $result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0); From 9a2ce535171d70648949fa9446e1ef70b073f6f1 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 30 Nov 2022 23:41:32 +0100 Subject: [PATCH 2/5] add stamp and signature in pictowithouttext list --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 122ba41fcd8..d69366bcb36 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3678,7 +3678,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', - 'conferenceorbooth', 'eventorganization' + 'conferenceorbooth', 'eventorganization', + 'stamp', 'signature' ))) { $fakey = $pictowithouttext; $facolor = ''; From 804b806d02424a52444d2a60d73cd54dc8e247f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Dec 2022 11:37:56 +0100 Subject: [PATCH 3/5] Fix responsive --- htdocs/accountancy/journal/bankjournal.php | 56 ++++++++++++++-------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index f3049206389..a848f8505d8 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1159,19 +1159,24 @@ if (empty($action) || $action == 'view') { //var_dump($tabpay[$key]); print ''; print ''; + + // Date print "".$date.""; - print "".$ref.""; + + // Ref + print "".dol_escape_htmltag($ref).""; + // Ledger account - print ""; $accounttoshow = length_accountg($k); if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { - print ''.$langs->trans("BankAccountNotDefined").''; - } else { - print $accounttoshow; + $accounttoshow = ''.$langs->trans("BankAccountNotDefined").''; } + print ''; + print $accounttoshow; print ""; + // Subledger account - print ""; + print ''; /*$accounttoshow = length_accountg($k); if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { @@ -1179,9 +1184,12 @@ if (empty($action) || $action == 'view') { } else print $accounttoshow;*/ print ""; - print ""; - print $reflabel; + + // Label operation + print ''; + print $reflabel; // This is already html escaped content print ""; + print ''.$val["type_payment"].""; print ''.($mt >= 0 ? price($mt) : '').""; print ''.($mt < 0 ? price(-$mt) : '').""; @@ -1205,10 +1213,14 @@ if (empty($action) || $action == 'view') { print ''; print ''; + + // Date print "".$date.""; - print "".$ref.""; + + // Ref + print "".dol_escape_htmltag($ref).""; + // Ledger account - print ""; $account_ledger = $k; // Try to force general ledger account depending on type if ($tabtype[$key] == 'payment') { @@ -1237,9 +1249,9 @@ if (empty($action) || $action == 'view') { if ($tabtype[$key] == 'unknown') { // We will accept writing, but into a waiting account if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') { - print ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').''; + $accounttoshow = ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').''; } else { - print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account + $accounttoshow = ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account } } else { // We will refuse writing @@ -1262,15 +1274,15 @@ if (empty($action) || $action == 'view') { if ($tabtype[$key] == 'member') { $errorstring = 'MainAccountForSubscriptionPaymentNotDefined'; } - print ''.$langs->trans($errorstring).''; + $accounttoshow = ''.$langs->trans($errorstring).''; } - } else { - print $accounttoshow; } + print ''; + print $accounttoshow; print ""; // Subledger account - print ""; + $accounttoshowsubledger = ''; if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger $accounttoshowsubledger = length_accounta($k); if ($accounttoshow != $accounttoshowsubledger) { @@ -1282,18 +1294,20 @@ if (empty($action) || $action == 'view') { if (!empty($tabcompany[$key]['code_compta'])) { if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) { // For such case, if subledger is not defined, we won't use subledger accounts. - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").''; + $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").''; } else { - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).''; + $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).''; } } else { - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").''; + $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").''; } - } else { - print $accounttoshowsubledger; } + } else { + $accounttoshowsubledger = ''; } } + print ''; + print $accounttoshowsubledger; print ""; print "".$reflabel.""; From 88aadae934392182bdc0a777aa6707d0501990b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Dec 2022 11:46:48 +0100 Subject: [PATCH 4/5] Fix barcode choice lost if error --- htdocs/product/fournisseurs.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 9e56d452325..9c9f0d3f982 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -753,16 +753,11 @@ END; // Barcode type print ''; - print ''.$langs->trans('BarcodeType').''; + print ''.$langs->trans('GencodBuyPrice').''; print ''; - print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE")), 'fk_barcode_type', 1); - print ''; - print ''; - - // Barcode value - print ''; - print ''.$langs->trans('BarcodeValue').''; - print ''.img_picto('', 'barcode', 'class="pictofixedwidth"').''; + print img_picto('', 'barcode', 'class="pictofixedwidth"'); + print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1); + print ' '; print ''; } From a4ac90a316b897661bfd58178658a8d3367af0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 1 Dec 2022 15:15:31 +0100 Subject: [PATCH 5/5] FIX: PGSQL Int type does not have a free lenght --- htdocs/core/db/pgsql.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 543e24a1b12..3f8be6b6ad3 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1182,7 +1182,7 @@ class DoliDBPgsql extends DoliDB // phpcs:enable $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; - if (in_array($field_desc['type'], array('double', 'tinyint', 'int', 'varchar')) && $field_desc['value']) { + if (in_array($field_desc['type'], array('double', 'varchar')) && $field_desc['value']) { $sql .= "(".$field_desc['value'].")"; }