diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index ff618611b33..1ff43dad64a 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -256,10 +256,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/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 6e7bba1e5de..7ec25ff428b 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -95,7 +95,7 @@ if (isModEnabled('mrp') && $user->hasRight('mrp', 'read') && !getDolGlobalString if (isModEnabled('project') && !getDolGlobalString('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') && !getDolGlobalString('MAIN_SEARCHFORM_TASK_DISABLED') && $user->hasRight('projet', 'lire')) { +if (isModEnabled('project') && !getDolGlobalString('MAIN_SEARCHFORM_TASK_DISABLED') && !getDolGlobalString('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/class/notify.class.php b/htdocs/core/class/notify.class.php index 1e7f2a166ff..2153cd08669 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -930,14 +930,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); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 0a7e7d25dfb..851aacdadd3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -552,14 +552,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 (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $langs->load("members"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2d89a39b03a..a9a32b18b3b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -887,13 +887,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 @@ -914,12 +914,12 @@ Permission609=Delete stickers Permission611=Read attributes of variants Permission612=Create/Update attributes of variants Permission613=Delete attributes of variants -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 @@ -991,7 +991,7 @@ Permission2515=Setup documents directories Permission2610=Generate/modify users API key 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=Read skill/job/position Permission4002=Create/modify skill/job/position @@ -1028,9 +1028,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 @@ -1055,7 +1055,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 diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 625cb2bfc51..681abb1aedc 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -322,6 +322,7 @@ ErrorFixThisHere=Fix this here ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Error: The URL of you current instance (%s) does not match the URL defined into your OAuth2 login setup (%s). Doing OAuth2 login in such a configuration is not allowed. ErrorMenuExistValue=A Menu already exist with this Title or URL ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without the option %s +ErrorGeneratingBarcode=Error while generating the barcode (probably invalid code shape) ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet ErrorObjectNotFound = The object %s is not found, please check your url ErrorCountryCodeMustBe2Char=Country code must be a 2 character string diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 70aa3479b8d..42a0c5bc976 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -322,6 +322,7 @@ ErrorFixThisHere= Corrigez ceci ici ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Erreur : L'URL de votre instance actuelle (%s) ne correspond pas à l'URL définie dans votre configuration de connexion OAuth2 (%s). La connexion OAuth2 dans une telle configuration n'est pas autorisée. ErrorMenuExistValue=Un menu existe déjà avec ce titre ou cette URL ErrorSVGFilesNotAllowedAsLinksWithout=Les fichiers SVG ne sont pas autorisés en tant que liens externes sans l'option %s +ErrorGeneratingBarcode=Erreur à la génération du code-barre (probablement une valeur invalide) ErrorTypeMenu=Impossible d'ajouter un autre menu pour le même module sur la barre de navigation, pas encore géré ErrorObjectNotFound = L'objet %s n'est pas trouvé, veuillez vérifier votre url ErrorCountryCodeMustBe2Char=Le code pays doit être une chaîne de 2 caractères diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 681f0fe44ec..3647aac9d01 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) . ')';