From a1749227331b4c4c237102f0b01393f993c483f2 Mon Sep 17 00:00:00 2001 From: Alban Durrheimer Date: Mon, 29 Apr 2024 19:29:55 +0200 Subject: [PATCH 1/4] 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 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 2/4] 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 3/4] 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 fdb63a654045af26e3ce2be1a2b4608a03c08362 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 May 2024 13:06:48 +0200 Subject: [PATCH 4/4] 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);