From a1749227331b4c4c237102f0b01393f993c483f2 Mon Sep 17 00:00:00 2001 From: Alban Durrheimer Date: Mon, 29 Apr 2024 19:29:55 +0200 Subject: [PATCH 1/9] Fix translation of permissions only en_US after 6c521073ea9215fb7baddca5e48345b20b1ab5a4 (#29525) --- htdocs/langs/en_US/admin.lang | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bd4b4d8f7a6..802d5b04648 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -849,13 +849,13 @@ Permission401=Read discounts Permission402=Create/modify discounts Permission403=Validate discounts Permission404=Delete discounts -Permission430=Use Debug Bar +Permission431=Use Debug Bar Permission511=Read salaries and payments (yours and subordinates) Permission512=Create/modify salaries and payments Permission514=Delete salaries and payments Permission517=Read salaries and payments everybody Permission519=Export salaries -Permission520=Read Loans +Permission521=Read Loans Permission522=Create/modify loans Permission524=Delete loans Permission525=Access loan calculator @@ -872,12 +872,12 @@ Permission564=Record Debits/Rejections of credit transfer Permission601=Read stickers Permission602=Create/modify stickers Permission609=Delete stickers -Permission650=Read Bills of Materials -Permission651=Create/Update Bills of Materials -Permission652=Delete Bills of Materials -Permission660=Read Manufacturing Order (MO) -Permission661=Create/Update Manufacturing Order (MO) -Permission662=Delete Manufacturing Order (MO) +Permission651=Read Bills of Materials +Permission652=Create/Update Bills of Materials +Permission653=Delete Bills of Materials +Permission661=Read Manufacturing Order (MO) +Permission662=Create/Update Manufacturing Order (MO) +Permission663=Delete Manufacturing Order (MO) Permission701=Read donations Permission702=Create/modify donations Permission703=Delete donations @@ -948,7 +948,7 @@ Permission2503=Submit or delete documents Permission2515=Setup documents directories Permission2801=Use FTP client in read mode (browse and download only) Permission2802=Use FTP client in write mode (delete or upload files) -Permission3200=Read archived events and fingerprints +Permission3201=Read archived events and fingerprints Permission3301=Generate new modules Permission4001=See employees Permission4002=Create employees @@ -975,9 +975,9 @@ Permission50152=Edit sales lines Permission50153=Edit ordered sales lines Permission50201=Read transactions Permission50202=Import transactions -Permission50330=Read objects of Zapier -Permission50331=Create/Update objects of Zapier -Permission50332=Delete objects of Zapier +Permission50331=Read objects of Zapier +Permission50332=Create/Update objects of Zapier +Permission50333=Delete objects of Zapier Permission50401=Bind products and invoices with accounting accounts Permission50411=Read operations in ledger Permission50412=Write/Edit operations in ledger @@ -1002,7 +1002,7 @@ Permission63002=Create/modify resources Permission63003=Delete resources Permission63004=Link resources to agenda events Permission64001=Allow direct printing -Permission67000=Allow printing of receipts +Permission67001=Allow printing of receipts Permission68001=Read intracomm report Permission68002=Create/modify intracomm report Permission68004=Delete intracomm report From d39adede68b2f2821279971fd18a5fe77ba265f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Apr 2024 13:17:59 +0200 Subject: [PATCH 2/9] Show more info into popup --- htdocs/takepos/invoice.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 0efc9d1c788..1cc3e036cd4 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1846,6 +1846,13 @@ if ($placeid > 0) { if ($line->product_label) { $htmlforlines .= $line->product_label; } + if (!empty($line->batch)) { + $tooltiptext .= '
'.$langs->trans("LotSerial").' : '.$line->batch.'
'; + } + if (!empty($line->fk_warehouse)) { + $tooltiptext .= ''.$langs->trans("Warehouse").' : '.$line->fk_warehouse.'
'; + } + if ($line->product_label != $line->desc) { if ($line->product_label && $line->desc) { $htmlforlines .= '
'; From 82806b00ab41d7aae034379451fbd43da168a756 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 1 May 2024 16:23:46 +0200 Subject: [PATCH 3/9] fix: SQL Error on replannish (#29548) --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 8f464034fee..684554e4ad6 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -365,7 +365,7 @@ $sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s ON p.rowid = s.fk_product'; $sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse) . ')'; -$list_warehouse_selected = ($fk_entrepot < 0) ? '0' : $fk_entrepot; +$list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? '0' : $fk_entrepot; $sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse_selected) . ')'; From ca3f43d4ead9a65eb2e308b3e2b6fd4b06619206 Mon Sep 17 00:00:00 2001 From: Jonathan Botquin <99287239+Jonathanbtq@users.noreply.github.com> Date: Wed, 1 May 2024 17:14:20 +0200 Subject: [PATCH 4/9] remove debug in terminal php (#29550) --- htdocs/takepos/admin/terminal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 0e27e0190c2..ac3715438a6 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -296,7 +296,7 @@ if (isModEnabled('stock')) { // Deprecated: CASHDESK_FORCE_DECREASE_STOCK is now always false. No more required/used. if (isModEnabled('productbatch') && getDolGlobalString('CASHDESK_FORCE_DECREASE_STOCK') && !getDolGlobalString('CASHDESK_NO_DECREASE_STOCK'.$terminal)) { - print 'aaaa'.$langs->trans('CashDeskForceDecreaseStockLabel').''; + print ''.$langs->trans('CashDeskForceDecreaseStockLabel').''; print ''; print ''.$langs->trans('CashDeskForceDecreaseStockDesc').''; print ''; From 37fcbc34b8590c6cec21fb5e204c593f510ec87c Mon Sep 17 00:00:00 2001 From: Yannis Hoareau <93135242+YannisHoareau@users.noreply.github.com> Date: Wed, 1 May 2024 17:37:12 +0200 Subject: [PATCH 5/9] FIX: search and add extrafields to tasks when conf disabled (#29542) * FIX: task could be searched even if disabled * FIX: could add extra fields to task even if disabled --- htdocs/core/ajax/selectsearchbox.php | 2 +- htdocs/core/lib/project.lib.php | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index d2379f46966..f126589909e 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -92,7 +92,7 @@ if (isModEnabled('mrp') && $user->hasRight('mrp', 'read') && empty($conf->global if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->hasRight('projet', 'lire')) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->hasRight('projet', 'lire')) { +if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->hasRight('projet', 'lire')) { $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index b04adbecdc7..d244c94cce9 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -529,14 +529,16 @@ function project_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php'; - $head[$h][1] = $langs->trans("ExtraFieldsProjectTask"); - $nbExtrafields = $extrafields->attributes['projet_task']['count']; - if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + $head[$h][0] = DOL_URL_ROOT . '/projet/admin/project_task_extrafields.php'; + $head[$h][1] = $langs->trans("ExtraFieldsProjectTask"); + $nbExtrafields = $extrafields->attributes['projet_task']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= '' . $nbExtrafields . ''; + } + $head[$h][2] = 'attributes_task'; + $h++; } - $head[$h][2] = 'attributes_task'; - $h++; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $langs->load("members"); From 03c4f7219fc79b1e0eb92a11e764384080abf14d Mon Sep 17 00:00:00 2001 From: Yannis Hoareau <93135242+YannisHoareau@users.noreply.github.com> Date: Wed, 1 May 2024 17:44:31 +0200 Subject: [PATCH 6/9] FIX: made invalid code shape error more user friendly (#29498) * FIX: barcode pdf creation die: added try catch * FIX: barcode pdf creation die: try catch refactor * FIX: barcode pdf creation die: fixed translation * FIX: barcode generation error * FIX: barcode generation error: wrong code --- htdocs/barcode/printsheet.php | 12 ++++++++++-- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 026ac36ee35..d88b876c7cd 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -231,7 +231,7 @@ if ($action == 'builddoc') { 'code'=>$code, 'encoding'=>$encoding, 'is2d'=>$is2d, - 'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF + 'photo'=>$barcodeimage ?? '' // Photo must be a file that exists with format supported by TCPDF ); } } else { @@ -255,10 +255,18 @@ if ($action == 'builddoc') { if (!$mesg) { $outputlangs = $langs; + $previousConf = getDolGlobalInt('TCPDF_THROW_ERRORS_INSTEAD_OF_DIE'); + $conf->global->TCPDF_THROW_ERRORS_INSTEAD_OF_DIE = 1; + // This generates and send PDF to output // TODO Move - $result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile)); + try { + $result = doc_label_pdf_create($db, $arrayofrecords, $modellabel, $outputlangs, $diroutput, $template, dol_sanitizeFileName($outfile)); + } catch (Exception $e) { + $mesg = $langs->trans('ErrorGeneratingBarcode'); + } + $conf->global->TCPDF_THROW_ERRORS_INSTEAD_OF_DIE = $previousConf; } } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 60fd52de1f4..046809b9405 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -304,6 +304,7 @@ ErrorValueCantBeNull=Value for %s can't be null ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission ErrorTooMuchFileInForm=Too much files in form, the maximum number is %s file(s) ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without option %s +ErrorGeneratingBarcode=Error while generating barcode (probably invalid code shape) # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 43c686cd698..c99c08e150a 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -310,6 +310,7 @@ ErrorFieldExist=La valeur pour %s existe déjà ErrorEqualModule=Module invalide dans %s. ErrorFieldValue=La valeur pour %s est incorrecte ErrorCoherenceMenu=%s is required when %s is 'left' +ErrorGeneratingBarcode=Erreur à la génération du code-barre (probablement une valeur invalide) # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. From c8d6ece3c0f297cefe72983cc64aa2e2c79224d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 2 May 2024 13:02:08 +0200 Subject: [PATCH 7/9] fix free sql (#29579) * fix free sql * Update orders_list.php --- htdocs/compta/prelevement/list.php | 2 +- htdocs/compta/prelevement/orders_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 40f0896e9fd..6eb53cfdf5d 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -545,7 +545,7 @@ if ($num == 0) { print ''.$langs->trans("None").''; } -$db->free($result); +$db->free($resql); $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 244ee01bd2d..9f7e57c1cbd 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -460,7 +460,7 @@ if ($num == 0) { print ''.$langs->trans("None").''; } -$db->free($result); +$db->free($resql); $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook From c3801bd78d5c17289bd6a737eb1758588cc56665 Mon Sep 17 00:00:00 2001 From: PsyCrow <93346975+PsyCrow-code@users.noreply.github.com> Date: Thu, 2 May 2024 05:02:51 -0600 Subject: [PATCH 8/9] FIX: PHP Warning: Undefined array key "totalam" on line 1890 (#29578) * FIX: PHP Warning: Undefined array key "totalam" on line 1890 FIX PHP Warning: Undefined array key "totalam" on line 1890 * Update list.php * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur From fdb63a654045af26e3ce2be1a2b4608a03c08362 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 May 2024 13:06:48 +0200 Subject: [PATCH 9/9] Fix related to #29580 --- htdocs/core/class/notify.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 1f8c9cf3225..fc06c0adcb0 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -852,14 +852,14 @@ class Notify // content will be sent. $mailTemplateLabel = isset($conf->global->{$notifcode.'_TEMPLATE'}) ? $conf->global->{$notifcode.'_TEMPLATE'} : ''; $emailTemplate = null; + // Set output language + $outputlangs = $langs; if (!empty($mailTemplateLabel)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($this->db); $emailTemplate = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse); } if (!empty($mailTemplateLabel) && is_object($emailTemplate) && $emailTemplate->id > 0) { - // Set output language - $outputlangs = $langs; if ($obj->default_lang && $obj->default_lang != $langs->defaultlang) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($obj->default_lang);