diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 3f1eb8d965123..46066a3f318cf 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -67,12 +67,12 @@ if ($action == 'activate_delivery') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } elseif ($action == 'disable_delivery') { - dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); + dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity); header("Location: confexped.php"); exit; } @@ -121,7 +121,7 @@ print ""; print ''; -// Bon de livraison activation/desactivation +// Delivery note activate/deactivate Bon de livraison activation/desactivation print ''; print ''; print $langs->trans("DeliveriesOrderAbility"); @@ -131,7 +131,7 @@ print ''; print ''; -if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) +if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 4ef0179d88e16..7987d4cda108e 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -95,7 +95,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php", 0); + $file = dol_buildpath($reldir."core/modules/delivery/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound = 1; @@ -112,7 +112,7 @@ if ($module->write_file($sending, $langs) > 0) { - header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=delivery&file=SPECIMEN.pdf"); return; } else { setEventMessages($module->error, $module->errors, 'errors'); @@ -134,17 +134,17 @@ $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity); + if ($conf->global->DELIVERY_ADDON_PDF == "$value") dolibarr_del_const($db, 'DELIVERY_ADDON_PDF', $conf->entity); } } if ($action == 'setdoc') { - if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) + if (dolibarr_set_const($db, "DELIVERY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent - $conf->global->LIVRAISON_ADDON_PDF = $value; + $conf->global->DELIVERY_ADDON_PDF = $value; } // On active le modele @@ -160,7 +160,7 @@ // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "DELIVERY_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -199,7 +199,7 @@ foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/"); + $dir = dol_buildpath($reldir."core/modules/delivery/"); if (is_dir($dir)) { @@ -208,7 +208,7 @@ { while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file) - 3, 3) == 'php') + if (substr($file, 0, 14) == 'mod_delivery_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { $file = substr($file, 0, dol_strlen($file) - 4); @@ -237,7 +237,7 @@ print ''."\n"; print ''; - if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") + if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -323,7 +323,7 @@ foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/doc/"); + $dir = dol_buildpath($reldir."core/modules/delivery/doc/"); if (is_dir($dir)) { @@ -378,7 +378,7 @@ // Default print ""; - if ($conf->global->LIVRAISON_ADDON_PDF == "$name") + if ($conf->global->DELIVERY_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0e66e56cc873e..eeec7bcd0c127 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2555,7 +2555,7 @@ $numshipping = $object->nb_expedition(); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { - if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->livraison->creer)) { + if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) { if ($user->rights->expedition->creer) { print ''.$langs->trans('CreateShipment').''; } else { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 05e1d4a2cd578..0d1942a517d59 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3314,7 +3314,7 @@ public function fetchObjectLinked($sourceid = null, $sourcetype = '', $targetid } elseif ($objecttype == 'shipping') { $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; } elseif ($objecttype == 'delivery') { - $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'delivery_note'; + $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'livraison_bon'; } elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; } elseif ($objecttype == 'fichinter') { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 7c2a4fd078831..e5a1aed0a64e7 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -371,7 +371,7 @@ public function setValues($db) // Sous module bons d'expedition $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0); // Sub module delivery note Sous module bons de livraison - $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 0); + $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0); // Module fournisseur if (!empty($this->fournisseur)) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f4938360e09d..1670d4bee4f20 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6749,7 +6749,7 @@ public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleI $tplpath = 'reception'; if (empty($conf->reception->enabled)) continue; // Do not show if module disabled } elseif ($objecttype == 'delivery') { - $tplpath = 'livraison'; + $tplpath = 'delivery'; if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled } elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2b98bac30c6df..16526be2331fd 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -366,7 +366,7 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, } $printer = 0; - if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'livraison', 'ticket'))) // The direct print feature is implemented only for such elements + if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) // The direct print feature is implemented only for such elements { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ?true:false; } @@ -466,11 +466,11 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, include_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php'; $modellist = ModelePdfReception::liste_modeles($this->db); } - } elseif ($modulepart == 'livraison') + } elseif ($modulepart == 'delivery') { if (is_array($genallowed)) $modellist = $genallowed; else { - include_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; + include_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; $modellist = ModelePDFDeliveryOrder::liste_modeles($this->db); } } elseif ($modulepart == 'ficheinter') diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index a7881bb9e2964..92c58d7b5dbbf 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -51,7 +51,7 @@ function expedition_prepare_head(Expedition $object) $hselected = $h; $h++; - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; $head[$h][1] = $langs->trans("Receivings"); @@ -109,7 +109,7 @@ function expedition_admin_prepare_head() $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; $head[$h][1] = $langs->trans("Receivings"); @@ -117,7 +117,7 @@ function expedition_admin_prepare_head() $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); @@ -125,7 +125,7 @@ function expedition_admin_prepare_head() $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7f2fd4ce70d20..d73bf175861d3 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2636,10 +2636,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = 1; } $original_file = $conf->expedition->dir_output."/sending/".$original_file; - } // Wrapping pour les bons de livraison - elseif ($modulepart == 'livraison' && !empty($conf->expedition->dir_output)) + } // Delivery Note Wrapping + elseif ($modulepart == 'delivery' && !empty($conf->expedition->dir_output)) { - if ($fuser->rights->expedition->livraison->{$lire} || preg_match('/^specimen/i', $original_file)) + if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f60043e9d9712..a27cd362827ce 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8652,7 +8652,7 @@ function getElementProperties($element_type) if ($element_type == 'delivery') { $classpath = 'delivery/class'; $subelement = 'delivery'; - $module = 'delivery_note'; + $module = 'livraison_bon'; } if ($element_type == 'contract') { $classpath = 'contrat/class'; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 1f4cbfa9644bf..5188cd02e3022 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1793,7 +1793,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') } elseif ($objecttype == 'delivery') { $classpath = 'delivery/class'; $myobject = 'delivery'; - $module = 'delivery_note'; + $module = 'livraison_bon'; } elseif ($objecttype == 'contract') { $classpath = 'contrat/class'; $module = 'contrat'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 4e2f2fac24d8b..939b731f13564 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -59,17 +59,17 @@ function commande_prepare_head(Commande $object) } if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) - || ($conf->delivery_note->enabled && $user->rights->expedition->livraison->lire)) + || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)) { $nbShipments = $object->getNbOfShipments(); $nbReceiption = 0; $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; $text = ''; if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments"); - if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) $text .= ' - '; - if ($conf->delivery_note->enabled) $text .= $langs->trans("Receivings"); + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - '; + if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings"); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''.($nbShipments ? $nbShipments : 0); - if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; - if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0); + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''; $head[$h][1] = $text; $head[$h][2] = 'shipping'; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 126a62fdf5ef8..a1dab5cd6cbc6 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -43,13 +43,13 @@ function propal_prepare_head($object) $h++; if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) - || (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->livraison->lire)))) + || (!empty($conf->expedition->enabled) && !empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire)))) { $langs->load("sendings"); $text = ''; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; if ($conf->expedition_bon->enabled) $text = $langs->trans("Shipment"); - if ($conf->delivery_note->enabled) $text .= '/'.$langs->trans("Receivings"); + if ($conf->livraison_bon->enabled) $text .= '/'.$langs->trans("Receivings"); $head[$h][1] = $text; $head[$h][2] = 'shipping'; $h++; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 23f009b623441..447310c8ad26f 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -47,7 +47,7 @@ function shipping_prepare_head($object) $head[$h][2] = 'shipping'; $h++; - if ($conf->delivery_note->enabled && $user->rights->expedition->livraison->lire) + if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire) { // delivery link $object->fetchObjectLinked($object->id, $object->element); @@ -213,13 +213,13 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end,"; $sql .= " ed.rowid as edrowid, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot as warehouse_id,"; $sql .= " e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,"; - //if ($conf->delivery_note->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,"; + //if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,"; $sql .= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch,'; $sql .= ' p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= ", ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; + //if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; //TODO Add link to expeditiondet_batch $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; @@ -260,7 +260,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; print ''; }*/ - if (!empty($conf->delivery_note->enabled)) + if (!empty($conf->livraison_bon->enabled)) { print ''.$langs->trans("DeliveryOrder").''; //print ''.$langs->trans("QtyReceived").''; @@ -403,7 +403,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') }*/ // Informations on receipt - if (!empty($conf->delivery_note->enabled)) + if (!empty($conf->livraison_bon->enabled)) { include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; $expedition->id = $objp->sendingid; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 27b40d48257a3..56c538af8a616 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -262,7 +262,7 @@ public function write_file($object, $outputlangs) } } - $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); + $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR"); return 0; } diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index b6e4cbc191a39..2b8987958f4fd 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -415,7 +415,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } } - $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); + $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR"); return 0; } diff --git a/htdocs/core/modules/livraison/doc/index.html b/htdocs/core/modules/delivery/doc/index.html similarity index 100% rename from htdocs/core/modules/livraison/doc/index.html rename to htdocs/core/modules/delivery/doc/index.html diff --git a/htdocs/core/modules/livraison/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php similarity index 99% rename from htdocs/core/modules/livraison/doc/pdf_storm.modules.php rename to htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 404e27b429f42..7de29cce294ad 100644 --- a/htdocs/core/modules/livraison/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -23,12 +23,12 @@ */ /** - * \file htdocs/core/modules/livraison/doc/pdf_storm.modules.php + * \file htdocs/core/modules/delivery/doc/pdf_storm.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Storm */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -157,7 +157,7 @@ public function __construct($db) /** * Function to build pdf onto disk * - * @param Livraison $object Object to generate + * @param Delivery $object Object to generate * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php similarity index 99% rename from htdocs/core/modules/livraison/doc/pdf_typhon.modules.php rename to htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 8ea980fbd5c8e..114283c677366 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -22,12 +22,12 @@ */ /** - * \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php + * \file htdocs/core/modules/delivery/doc/pdf_typhon.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Typhon */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -618,7 +618,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } } - $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); + $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR"); return 0; } @@ -844,7 +844,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // If SHIPPING contact defined on order, we use it $usecontact = false; $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING'); - if (count($arrayidcontact) > 0) + if ($arrayidcontact && count($arrayidcontact) > 0) { $usecontact = true; $result = $object->fetch_contact($arrayidcontact[0]); diff --git a/htdocs/core/modules/livraison/index.html b/htdocs/core/modules/delivery/index.html similarity index 100% rename from htdocs/core/modules/livraison/index.html rename to htdocs/core/modules/delivery/index.html diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php similarity index 90% rename from htdocs/core/modules/livraison/mod_livraison_jade.php rename to htdocs/core/modules/delivery/mod_delivery_jade.php index 1cf337814b96b..822986cffa544 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/delivery/mod_delivery_jade.php @@ -19,20 +19,20 @@ */ /** - * \file htdocs/core/modules/livraison/mod_livraison_jade.php + * \file htdocs/core/modules/delivery/mod_delivery_jade.php * \ingroup delivery * \brief Fichier contenant la classe du modele de numerotation de reference de bon de livraison Jade */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; /** - * \class mod_livraison_jade + * \class mod_delivery_jade * \brief Classe du modele de numerotation de reference de bon de livraison Jade */ -class mod_livraison_jade extends ModeleNumRefDeliveryOrder +class mod_delivery_jade extends ModeleNumRefDeliveryOrder { /** * Dolibarr version of the loaded document @@ -137,7 +137,7 @@ public function getNextValue($objsoc, $object) $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); - dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG); + dol_syslog("mod_delivery_jade::getNextValue", LOG_DEBUG); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) $max = intval($obj->max); @@ -153,7 +153,7 @@ public function getNextValue($objsoc, $object) if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s", $max + 1); - dol_syslog("mod_livraison_jade::getNextValue return ".$this->prefix.$yymm."-".$num); + dol_syslog("mod_delivery_jade::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } @@ -166,7 +166,7 @@ public function getNextValue($objsoc, $object) * @param Object $object Object livraison * @return string Texte descriptif */ - public function livraison_get_num($objsoc = 0, $object = '') + public function delivery_get_num($objsoc = 0, $object = '') { // phpcs:enable return $this->getNextValue($objsoc, $object); diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php similarity index 89% rename from htdocs/core/modules/livraison/mod_livraison_saphir.php rename to htdocs/core/modules/delivery/mod_delivery_saphir.php index ad03984a6f22b..10a979d4ee2bc 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -19,17 +19,17 @@ */ /** - * \file htdocs/core/modules/livraison/mod_livraison_saphir.php + * \file htdocs/core/modules/delivery/mod_livraison_saphir.php * \ingroup expedition * \brief Fichier contenant la classe du modele de numerotation de reference de livraison Saphir */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; /** - * \class mod_livraison_saphir + * \class mod_delivery_saphir * \brief Classe du modele de numerotation de reference de livraison Saphir */ -class mod_livraison_saphir extends ModeleNumRefDeliveryOrder +class mod_delivery_saphir extends ModeleNumRefDeliveryOrder { /** * Dolibarr version of the loaded document @@ -72,7 +72,7 @@ public function info() $texte .= '
'; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Delivery"), $langs->transnoentities("Delivery")); @@ -83,7 +83,7 @@ public function info() // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -131,7 +131,7 @@ public function getNextValue($objsoc, $object) require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask = $conf->global->LIVRAISON_SAPHIR_MASK; + $mask = $conf->global->DELIVERY_SAPHIR_MASK; if (!$mask) { @@ -139,7 +139,7 @@ public function getNextValue($objsoc, $object) return 0; } - $numFinal = get_next_value($db, $mask, 'livraison', 'ref', '', $objsoc, $object->date_livraison); + $numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->date_livraison); return $numFinal; } @@ -166,7 +166,7 @@ public function getNumRef($objsoc, $objforref) * @param Object $object Objet livraison * @return string Texte descripif */ - public function livraison_get_num($objsoc = 0, $object = '') + public function delivery_get_num($objsoc = 0, $object = '') { // phpcs:enable return $this->getNextValue($objsoc, $object); diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/delivery/modules_delivery.php similarity index 98% rename from htdocs/core/modules/livraison/modules_livraison.php rename to htdocs/core/modules/delivery/modules_delivery.php index 9bf8a9e3ca264..80e2b092d42e6 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/delivery/modules_delivery.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/livraison/modules_livraison.php + * \file htdocs/core/modules/delivery/modules_delivery.php * \ingroup expedition * \brief Fichier contenant la classe mere de generation de bon de livraison en PDF * et la classe mere de numerotation des bons de livraisons diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 19e22497a7ab3..eed6ec4ec5eba 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -103,21 +103,21 @@ public function __construct($db) $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON_PDF"; + $this->const[$r][0] = "DELIVERY_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "typhon"; $this->const[$r][3] = 'Nom du gestionnaire de generation des bons de reception en PDF'; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON_NUMBER"; + $this->const[$r][0] = "DELIVERY_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_livraison_jade"; + $this->const[$r][2] = "mod_delivery_jade"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des bons de reception'; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH"; + $this->const[$r][0] = "DELIVERY_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries"; $this->const[$r][3] = ""; diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index dc40d118f6e0a..0b0ddda17942f 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index c87c2f87df6ac..8c227dc109f8d 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -116,7 +116,7 @@ public function create($user) dol_syslog("Delivery::create"); - if (empty($this->model_pdf)) $this->model_pdf = $conf->global->LIVRAISON_ADDON_PDF; + if (empty($this->model_pdf)) $this->model_pdf = $conf->global->DELIVERY_ADDON_PDF; $error = 0; @@ -376,14 +376,14 @@ public function valid($user, $notrigger = 0) if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate))) { - if (!empty($conf->global->LIVRAISON_ADDON_NUMBER)) + if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { // Setting the command numbering module name - $modName = $conf->global->LIVRAISON_ADDON_NUMBER; + $modName = $conf->global->DELIVERY_ADDON_NUMBER; - if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/livraison/'.$modName.'.php')) + if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php')) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/'.$modName.'.php'; + require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'; $now = dol_now(); @@ -394,7 +394,7 @@ public function valid($user, $notrigger = 0) if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { - $numref = $objMod->livraison_get_num($soc, $this); + $numref = $objMod->delivery_get_num($soc, $this); } else { $numref = $this->ref; } @@ -1050,12 +1050,12 @@ public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $ if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (!empty($conf->global->LIVRAISON_ADDON_PDF)) { - $modele = $conf->global->LIVRAISON_ADDON_PDF; + } elseif (!empty($conf->global->DELIVERY_ADDON_PDF)) { + $modele = $conf->global->DELIVERY_ADDON_PDF; } } - $modelpath = "core/modules/livraison/doc/"; + $modelpath = "core/modules/delivery/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } @@ -1071,7 +1071,7 @@ public function generateDocument($modele, $outputlangs = '', $hidedetails = 0, $ public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'livraison' + 'delivery' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 37c7119d8141e..f4f087aa5a365 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -399,7 +399,7 @@ /* * Build a receiving receipt */ - elseif ($action == 'create_delivery' && $conf->delivery_note->enabled && $user->rights->expedition->livraison->creer) + elseif ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer) { $result = $object->create_delivery($user); if ($result > 0) @@ -2046,13 +2046,13 @@ $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot"; $sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition"; - //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; + //if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; $sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch'; $sql .= ', p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= ", ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; + //if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; $sql .= " AND obj.fk_".$origin." = ".$origin_id; @@ -2467,7 +2467,7 @@ // This is just to generate a delivery receipt //var_dump($object->linkedObjectsIds['delivery']); - if ($conf->delivery_note->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery'])) + if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery'])) { print ''.$langs->trans("CreateDeliveryOrder").''; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e475053dcdae0..dd6b99920648e 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -873,7 +873,7 @@ public function create_delivery($user) // phpcs:enable global $conf; - if ($conf->delivery_note->enabled) + if ($conf->livraison_bon->enabled) { if ($this->statut == self::STATUS_VALIDATED || $this->statut == self::STATUS_CLOSED) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 4270fe7421bed..73db3ef8fe972 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -127,8 +127,8 @@ 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)), + 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)), + 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)), 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) ); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index e0e5f6f5d03f3..ed4f52c501b8f 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1665,13 +1665,13 @@ $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as receptionline_id, ed.qty, ed.fk_reception as reception_id, ed.fk_entrepot"; $sql .= ", e.rowid as reception_id, e.ref as reception_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_reception"; - //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; + //if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; $sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch'; $sql .= ', p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= ", ".MAIN_DB_PREFIX."reception as e"; $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; + //if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; $sql .= " AND obj.fk_commande = ".$origin_id; diff --git a/phpstan.neon b/phpstan.neon index 71b70a42218b5..02e47e753d795 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -41,7 +41,7 @@ parameters: - %currentWorkingDirectory%/htdocs/core/modules/facture - %currentWorkingDirectory%/htdocs/core/modules/fichinter - %currentWorkingDirectory%/htdocs/core/modules/holiday - - %currentWorkingDirectory%/htdocs/core/modules/livraison + - %currentWorkingDirectory%/htdocs/core/modules/delivery #- %currentWorkingDirectory%/htdocs/core/modules/member - %currentWorkingDirectory%/htdocs/core/modules/payment - %currentWorkingDirectory%/htdocs/core/modules/product
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'