Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur
2024-05-07 10:28:27 +02:00
19 changed files with 84 additions and 30 deletions

View File

@@ -2409,6 +2409,8 @@ ResetSms
ResourceNotAssignedToTheTask ResourceNotAssignedToTheTask
ResourcePageIndex ResourcePageIndex
ResourceTypeCode ResourceTypeCode
ResourceTypeID
ResourceTypeLabel
ResponsibleOfRecruitement ResponsibleOfRecruitement
Rest Rest
RestOfEurope RestOfEurope
@@ -3172,6 +3174,7 @@ descWORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE
descWORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE descWORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE
descWORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE descWORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE
descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE
descWORKFLOW_SUM_INVOICES_AMOUNT_CLASSIFY_BILLED_ORDER
descWORKFLOW_TICKET_CLOSE_INTERVENTION descWORKFLOW_TICKET_CLOSE_INTERVENTION
descWORKFLOW_TICKET_CREATE_INTERVENTION descWORKFLOW_TICKET_CREATE_INTERVENTION
descWORKFLOW_TICKET_LINK_CONTRACT descWORKFLOW_TICKET_LINK_CONTRACT

View File

@@ -46,6 +46,7 @@ InstallChoiceRecommanded
IsInPackage IsInPackage
MailNoChangePossible MailNoChangePossible
MailSentBy MailSentBy
MaxNbOfLinesForBoxes
ModuleBuilderDesc2 ModuleBuilderDesc2
ModulesMarketPlaceDesc ModulesMarketPlaceDesc
MoveField MoveField
@@ -68,7 +69,9 @@ ThirdPartyCustomersWithIdProf12
TicketPublicInfoCreateTicket TicketPublicInfoCreateTicket
TitreRequestCP TitreRequestCP
UseAsciiDocFormat UseAsciiDocFormat
UsePassword
ViewPageInNewTab ViewPageInNewTab
WEBSITE_PAGE_EXAMPLE
YourTicketSuccessfullySaved YourTicketSuccessfullySaved
# #
# ██████╗ █████╗ ██████╗ ████████╗██████╗ # ██████╗ █████╗ ██████╗ ████████╗██████╗

View File

@@ -138,7 +138,10 @@ abstract class CommonObjectLine extends CommonObject
public $remise_percent; 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; public $info_bits;

View File

@@ -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[] * @return string[]
*/ */
@@ -2579,6 +2579,9 @@ class ExtraFields
$type2label[$key] = $langs->transnoentitiesnoconv($val); $type2label[$key] = $langs->transnoentitiesnoconv($val);
} }
if (!getDolGlobalString('MAIN_USE_EXTRAFIELDS_ICON')) {
unset($type2label['icon']);
}
if (!getDolGlobalString('MAIN_USE_GEOPHP')) { if (!getDolGlobalString('MAIN_USE_GEOPHP')) {
unset($type2label['point']); unset($type2label['point']);
unset($type2label['multipts']); unset($type2label['multipts']);

View File

@@ -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 CommonObject $object Dolibarr common object
* @param string $module Override object element, for example to use 'mycompany' instead of 'societe' * @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 * @return string|null The path of the relative directory of the module
* @since Dolibarr V18 * @since Dolibarr V18
*/ */
function getMultidirOutput($object, $module = '') function getMultidirOutput($object, $module = '', $mode = 'output')
{ {
global $conf; global $conf;
@@ -137,16 +139,56 @@ function getMultidirOutput($object, $module = '')
if (empty($module) && !empty($object->element)) { if (empty($module) && !empty($object->element)) {
$module = $object->element; $module = $object->element;
} }
// Special case for backward compatibility // Special case for backward compatibility
if ($module == 'fichinter') { if ($module == 'fichinter') {
$module = 'ficheinter'; $module = 'ficheinter';
} }
// Get the relative path of directory
if ($mode == 'output' || $mode == 'version') {
if (isset($conf->$module) && property_exists($conf->$module, 'multidir_output')) { if (isset($conf->$module) && property_exists($conf->$module, 'multidir_output')) {
return $conf->$module->multidir_output[(empty($object->entity) ? $conf->entity : $object->entity)]; return $conf->$module->multidir_output[(empty($object->entity) ? $conf->entity : $object->entity)];
} else { } else {
return 'error-diroutput-not-defined-for-this-object='.$module; 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-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 * Return dolibarr global constant string value
@@ -4911,7 +4953,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
$fakey = 'fa-'.$pictowithouttext; $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'; $morecss .= ' em092';
} }
if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) { 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', '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', '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', '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', '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', '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', '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', 'lock' => '#ddd', 'lot' => '#a69944',
'map-marker-alt' => '#aaa', 'mrp' => '#a69944', 'product' => '#a69944', 'service' => '#a69944', 'inventory' => '#a69944', 'stock' => '#a69944', 'movement' => '#a69944', 'map-marker-alt' => '#aaa', 'mrp' => '#a69944', 'product' => '#a69944', 'service' => '#a69944', 'inventory' => '#a69944', 'stock' => '#a69944', 'movement' => '#a69944',
'other' => '#ddd', 'world' => '#986c6a', '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', //'shipment'=>'#a69944',
'security' => '#999', 'square' => '#888', 'stop-circle' => '#888', 'stats' => '#444', 'switch_off' => '#999', 'security' => '#999', 'square' => '#888', 'stop-circle' => '#888', 'stats' => '#444', 'switch_off' => '#999',
'technic' => '#999', 'tick' => '#282', 'timespent' => '#555', '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 ?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. * @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/' * @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 = '') function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '')
{ {

View File

@@ -75,7 +75,7 @@ function product_prepare_head($object)
|| (isModEnabled('margin') && $user->hasRight("margin", "liretous")) || (isModEnabled('margin') && $user->hasRight("margin", "liretous"))
) { ) {
if ($usercancreadprice) { 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][1] = $langs->trans("BuyingPrices");
$head[$h][2] = 'suppliers'; $head[$h][2] = 'suppliers';
$h++; $h++;

View File

@@ -34,7 +34,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
} }
$value = $datenotinstring; $value = $datenotinstring;
} else { } 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 field is a computed field, we make computation to get value
if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) {

View File

@@ -1349,7 +1349,7 @@ class ProductFournisseur extends Product
$label .= $this->displayPriceProductFournisseurLog($logPrices); $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') { if ($option != 'nolink') {
// Add param to save lastsearch_values or not // Add param to save lastsearch_values or not

View File

@@ -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) { if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/productnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
$title = $object->name." - ".$title; $title = $object->name." - ".$title;
} }
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-agenda');
if (isModEnabled('notification')) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");

View File

@@ -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 // Load object modBarCodeProduct
$res = 0; $res = 0;

View File

@@ -5462,7 +5462,7 @@ class Product extends CommonObject
} }
if ($option == 'supplier' || $option == 'category') { 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') { } elseif ($option == 'stock') {
$url = DOL_URL_ROOT.'/product/stock/product.php?id='.$this->id; $url = DOL_URL_ROOT.'/product/stock/product.php?id='.$this->id;
} elseif ($option == 'composition') { } elseif ($option == 'composition') {

View File

@@ -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'; $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) { if ($object->id) {

View File

@@ -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) { if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/productnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
$title = $object->name." - ".$title; $title = $object->name." - ".$title;
} }
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-messaging');
if (isModEnabled('notification')) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");

View File

@@ -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'; $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)) { if ($id > 0 || !empty($ref)) {
/* /*

View File

@@ -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'; $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); $head = product_prepare_head($object);
$titre = $langs->trans("CardProduct".$object->type); $titre = $langs->trans("CardProduct".$object->type);

View File

@@ -28,7 +28,7 @@
*/ */
/** /**
* \file htdocs/product/fournisseurs.php * \file htdocs/product/price_suppliers.php
* \ingroup product * \ingroup product
* \brief Page of tab suppliers for products * \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'; $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 ($id > 0 || $ref) {
if ($result) { 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 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
if ($usercancreate) { if ($usercancreate) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.((int) $object->id).'&action=create_price&token='.newToken().'">'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/price_suppliers.php?id='.((int) $object->id).'&action=create_price&token='.newToken().'">';
print $langs->trans("AddSupplierPrice").'</a>'; print $langs->trans("AddSupplierPrice").'</a>';
} }
} }

View File

@@ -178,7 +178,7 @@ if ($id > 0 || !empty($ref)) {
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield centpercent">';
$nboflines = show_stats_for_company($product, $socid); $nboflines = show_stats_for_company($product, $socid);

View File

@@ -556,7 +556,7 @@ if ($id > 0 || $ref) {
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios'; $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
} }
llxHeader('', $title, $helpurl); llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-card_stock');
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
?> ?>

View File

@@ -191,7 +191,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) {
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios'; $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
} }
llxHeader('', $title, $helpurl); llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-translation');
$form = new Form($db); $form = new Form($db);
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);