diff --git a/dev/translation/dynamic_translation_keys.lst b/dev/translation/dynamic_translation_keys.lst index 70460bacb3d..d5f8f42e97f 100644 --- a/dev/translation/dynamic_translation_keys.lst +++ b/dev/translation/dynamic_translation_keys.lst @@ -2409,6 +2409,8 @@ ResetSms ResourceNotAssignedToTheTask ResourcePageIndex ResourceTypeCode +ResourceTypeID +ResourceTypeLabel ResponsibleOfRecruitement Rest RestOfEurope @@ -3172,6 +3174,7 @@ descWORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE descWORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE descWORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE +descWORKFLOW_SUM_INVOICES_AMOUNT_CLASSIFY_BILLED_ORDER descWORKFLOW_TICKET_CLOSE_INTERVENTION descWORKFLOW_TICKET_CREATE_INTERVENTION descWORKFLOW_TICKET_LINK_CONTRACT diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index c8797ba190b..6b4e677bc6d 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -46,6 +46,7 @@ InstallChoiceRecommanded IsInPackage MailNoChangePossible MailSentBy +MaxNbOfLinesForBoxes ModuleBuilderDesc2 ModulesMarketPlaceDesc MoveField @@ -68,7 +69,9 @@ ThirdPartyCustomersWithIdProf12 TicketPublicInfoCreateTicket TitreRequestCP UseAsciiDocFormat +UsePassword ViewPageInNewTab +WEBSITE_PAGE_EXAMPLE YourTicketSuccessfullySaved # # ██████╗ █████╗ ██████╗ ████████╗██████╗ diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index f53dff29a56..877c5b88d8e 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -138,7 +138,10 @@ abstract class CommonObjectLine extends CommonObject public $remise_percent; /** - * @var int info_bits + * List of cumulative options: + * Bit 0: 0 for common VAT - 1 if VAT french NPR + * Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + * @var int */ public $info_bits; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 99c468ce31d..c06ddaaea55 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2565,7 +2565,7 @@ class ExtraFields } /** - * Return array with all possible types and label of extrafields + * Return array with all possible types and labels of extrafields * * @return string[] */ @@ -2579,6 +2579,9 @@ class ExtraFields $type2label[$key] = $langs->transnoentitiesnoconv($val); } + if (!getDolGlobalString('MAIN_USE_EXTRAFIELDS_ICON')) { + unset($type2label['icon']); + } if (!getDolGlobalString('MAIN_USE_GEOPHP')) { unset($type2label['point']); unset($type2label['multipts']); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index aa3112da330..6a69b33f2b5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -120,14 +120,16 @@ if (!function_exists('str_contains')) { /** - * Return the full path of the directory where a module (or an object of a module) stores its files. Path may depends on the entity if a multicompany module is enabled. + * Return the full path of the directory where a module (or an object of a module) stores its files. + * Path may depends on the entity if a multicompany module is enabled. * - * @param CommonObject $object Dolibarr common object - * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' - * @return string|null The path of the relative directory of the module + * @param CommonObject $object Dolibarr common object + * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' + * @param string $mode 'output' or 'temp' or 'version' + * @return string|null The path of the relative directory of the module * @since Dolibarr V18 */ -function getMultidirOutput($object, $module = '') +function getMultidirOutput($object, $module = '', $mode = 'output') { global $conf; @@ -137,17 +139,57 @@ function getMultidirOutput($object, $module = '') if (empty($module) && !empty($object->element)) { $module = $object->element; } + // Special case for backward compatibility if ($module == 'fichinter') { $module = 'ficheinter'; } - if (isset($conf->$module) && property_exists($conf->$module, 'multidir_output')) { - return $conf->$module->multidir_output[(empty($object->entity) ? $conf->entity : $object->entity)]; + + // Get the relative path of directory + if ($mode == 'output' || $mode == 'version') { + if (isset($conf->$module) && property_exists($conf->$module, 'multidir_output')) { + return $conf->$module->multidir_output[(empty($object->entity) ? $conf->entity : $object->entity)]; + } else { + return 'error-diroutput-not-defined-for-this-object='.$module; + } + } elseif ($mode == 'temp') { + if (isset($conf->$module) && property_exists($conf->$module, 'multidir_temp')) { + return $conf->$module->multidir_temp[(empty($object->entity) ? $conf->entity : $object->entity)]; + } else { + return 'error-dirtemp-not-defined-for-this-object='.$module; + } } else { - return 'error-diroutput-not-defined-for-this-object='.$module; + return 'error-bad-value-for-mode'; } } +/** + * Return the full path of the directory where a module (or an object of a module) stores its temporary files. + * Path may depends on the entity if a multicompany module is enabled. + * + * @param CommonObject $object Dolibarr common object + * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' + * @return string|null The path of the relative temp directory of the module + */ +function getMultidirTemp($object, $module = '') +{ + return getMultiDirOutput($object, $module, 'temp'); +} + +/** + * Return the full path of the directory where a module (or an object of a module) stores its versioned files. + * Path may depends on the entity if a multicompany module is enabled. + * + * @param CommonObject $object Dolibarr common object + * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' + * @return string|null The path of the relative version directory of the module + */ +function getMultidirVersion($object, $module = '') +{ + return getMultiDirOutput($object, $module, 'version'); +} + + /** * Return dolibarr global constant string value * @@ -4911,7 +4953,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco $fakey = 'fa-'.$pictowithouttext; } - if (in_array($pictowithouttext, array('dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) { + if (in_array($pictowithouttext, array('dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment', 'reception'))) { $morecss .= ' em092'; } if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) { @@ -4952,7 +4994,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'knowledgemanagement' => 'infobox-contrat rotate90', 'loan' => 'infobox-bank_account', 'payment' => 'infobox-bank_account', 'payment_vat' => 'infobox-bank_account', 'poll' => 'infobox-adherent', 'pos' => 'infobox-bank_account', 'project' => 'infobox-project', 'projecttask' => 'infobox-project', 'propal' => 'infobox-propal', 'proposal' => 'infobox-propal','private' => 'infobox-project', - 'reception' => 'flip', 'recruitmentjobposition' => 'infobox-adherent', 'recruitmentcandidature' => 'infobox-adherent', + 'reception' => 'flip infobox-order_supplier', 'recruitmentjobposition' => 'infobox-adherent', 'recruitmentcandidature' => 'infobox-adherent', 'resource' => 'infobox-action', 'salary' => 'infobox-bank_account', 'shapes' => 'infobox-adherent', 'shipment' => 'infobox-commande', 'supplier_invoice' => 'infobox-order_supplier', 'supplier_invoicea' => 'infobox-order_supplier', 'supplier_invoiced' => 'infobox-order_supplier', 'supplier' => 'infobox-order_supplier', 'supplier_order' => 'infobox-order_supplier', 'supplier_proposal' => 'infobox-supplier_proposal', @@ -4975,7 +5017,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco 'lock' => '#ddd', 'lot' => '#a69944', 'map-marker-alt' => '#aaa', 'mrp' => '#a69944', 'product' => '#a69944', 'service' => '#a69944', 'inventory' => '#a69944', 'stock' => '#a69944', 'movement' => '#a69944', 'other' => '#ddd', 'world' => '#986c6a', - 'partnership' => '#6c6aa8', 'playdisabled' => '#ccc', 'printer' => '#444', 'projectpub' => '#986c6a', 'reception' => '#a69944', 'resize' => '#444', 'rss' => '#cba', + 'partnership' => '#6c6aa8', 'playdisabled' => '#ccc', 'printer' => '#444', 'projectpub' => '#986c6a', 'resize' => '#444', 'rss' => '#cba', //'shipment'=>'#a69944', 'security' => '#999', 'square' => '#888', 'stop-circle' => '#888', 'stats' => '#444', 'switch_off' => '#999', 'technic' => '#999', 'tick' => '#282', 'timespent' => '#555', @@ -7509,7 +7551,7 @@ function yn($yesno, $case = 1, $color = 0) * @param ?CommonObject $object Object to use to get ref to forge the path. * @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...'). Use '' for autodetect from $object. * @return string Dir to use ending. Example '' or '1/' or '1/2/' - * @see getMultiDirOuput() + * @see getMultidirOutput() */ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '') { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a13d2ced4c8..4fe4ad6c9df 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -75,7 +75,7 @@ function product_prepare_head($object) || (isModEnabled('margin') && $user->hasRight("margin", "liretous")) ) { if ($usercancreadprice) { - $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT."/product/price_suppliers.php?id=".$object->id; $head[$h][1] = $langs->trans("BuyingPrices"); $head[$h][2] = 'suppliers'; $h++; diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 3729c2c1f4a..5b433b732a6 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -34,7 +34,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield } $value = $datenotinstring; } else { - $value = (!empty($obj->$tmpkey) ? $obj->$tmpkey : ''); + $value = (isset($obj->$tmpkey) ? $obj->$tmpkey : ''); } // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 0a3dffdf3dc..a08f43fd365 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1349,7 +1349,7 @@ class ProductFournisseur extends Product $label .= $this->displayPriceProductFournisseurLog($logPrices); } - $url = DOL_URL_ROOT.'/product/fournisseurs.php?id='.((int) $this->id).'&action=create_price&token='.newToken().'&socid='.((int) $this->fourn_id).'&rowid='.((int) $this->product_fourn_price_id); + $url = DOL_URL_ROOT.'/product/price_suppliers.php?id='.((int) $this->id).'&action=create_price&token='.newToken().'&socid='.((int) $this->fourn_id).'&rowid='.((int) $this->product_fourn_price_id); if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index b300a2749d5..be691f54a98 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -144,7 +144,7 @@ $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung'; if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/productnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { $title = $object->name." - ".$title; } -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9f597611203..bcafe29aad3 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1274,7 +1274,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { } } -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-card'); // Load object modBarCodeProduct $res = 0; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 01d81829bb6..25de2bfb072 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5462,7 +5462,7 @@ class Product extends CommonObject } if ($option == 'supplier' || $option == 'category') { - $url = DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id; + $url = DOL_URL_ROOT.'/product/price_suppliers.php?id='.$this->id; } elseif ($option == 'stock') { $url = DOL_URL_ROOT.'/product/stock/product.php?id='.$this->id; } elseif ($option == 'composition') { diff --git a/htdocs/product/document.php b/htdocs/product/document.php index e60b84b807b..ba0d59d49b2 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -208,7 +208,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } -llxHeader('', $title, $helpurl); +llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-document'); if ($object->id) { diff --git a/htdocs/product/messaging.php b/htdocs/product/messaging.php index ce9125d90c3..fc9d8b66e79 100644 --- a/htdocs/product/messaging.php +++ b/htdocs/product/messaging.php @@ -143,7 +143,7 @@ $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung'; if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/productnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { $title = $object->name." - ".$title; } -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-messaging'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/product/note.php b/htdocs/product/note.php index 6df3e689131..b097dea0898 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -106,7 +106,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen'; } -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-note'); if ($id > 0 || !empty($ref)) { /* diff --git a/htdocs/product/price.php b/htdocs/product/price.php index e6301b19aaa..fd7dccc9e2f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -885,7 +885,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } -llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs'); +llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs mod-product page-price'); $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/price_suppliers.php similarity index 99% rename from htdocs/product/fournisseurs.php rename to htdocs/product/price_suppliers.php index a5490a73a13..e97f1f31207 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/price_suppliers.php @@ -28,7 +28,7 @@ */ /** - * \file htdocs/product/fournisseurs.php + * \file htdocs/product/price_suppliers.php * \ingroup product * \brief Page of tab suppliers for products */ @@ -375,7 +375,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Lesitungen'; } -llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs'); +llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs mod-product page-price_supplier'); if ($id > 0 || $ref) { if ($result) { @@ -912,7 +912,7 @@ if ($id > 0 || $ref) { $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($usercancreate) { - print ''; + print ''; print $langs->trans("AddSupplierPrice").''; } } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 76a0b873b95..8b8a378ec01 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -178,7 +178,7 @@ if ($id > 0 || !empty($ref)) { print '
'; print '
'; - print ''; + print '
'; $nboflines = show_stats_for_company($product, $socid); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 0677267100c..8ccf0ee4c5d 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -556,7 +556,7 @@ if ($id > 0 || $ref) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } - llxHeader('', $title, $helpurl); + llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-card_stock'); if (!empty($conf->use_javascript_ajax)) { ?> diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 24f2dfd6f51..899e0d0dbb4 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -191,7 +191,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } -llxHeader('', $title, $helpurl); +llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-translation'); $form = new Form($db); $formadmin = new FormAdmin($db);