From c8cd55e158c87fe67983f129b0a6cd96161910e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= Date: Tue, 6 Oct 2020 15:57:50 +0200 Subject: [PATCH] debug access right after rename class #14697 --- htdocs/commande/card.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/functions2.lib.php | 2 +- htdocs/core/lib/order.lib.php | 10 +++++----- htdocs/core/lib/propal.lib.php | 4 ++-- htdocs/core/lib/sendings.lib.php | 10 +++++----- htdocs/delivery/card.php | 4 ++-- htdocs/expedition/card.php | 8 ++++---- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expedition/list.php | 4 ++-- htdocs/reception/card.php | 4 ++-- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index eeec7bcd0c1..0e66e56cc87 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2555,7 +2555,7 @@ if ($action == 'create' && $usercancreate) $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->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) { + if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->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 0d1942a517d..05e1d4a2cd5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3314,7 +3314,7 @@ abstract class CommonObject } elseif ($objecttype == 'shipping') { $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; } elseif ($objecttype == 'delivery') { - $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'livraison_bon'; + $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'delivery_note'; } elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; } elseif ($objecttype == 'fichinter') { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 16526be2331..a2c7721f0f8 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -417,7 +417,7 @@ class FormFile $titletoshow = $langs->trans("Documents"); if (!empty($title)) $titletoshow = ($title == 'none' ? '' : $title); - +print($modulepart); // Show table if ($genallowed) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a27cd362827..f60043e9d97 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 = 'livraison_bon'; + $module = 'delivery_note'; } if ($element_type == 'contract') { $classpath = 'contrat/class'; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5188cd02e30..1f4cbfa9644 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 = 'livraison_bon'; + $module = 'delivery_note'; } 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 939b731f135..4e2f2fac24d 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->livraison_bon->enabled && $user->rights->expedition->livraison->lire)) + || ($conf->delivery_note->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->livraison_bon->enabled) $text .= ' - '; - if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings"); + if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) $text .= ' - '; + if ($conf->delivery_note->enabled) $text .= $langs->trans("Receivings"); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''.($nbShipments ? $nbShipments : 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 ($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 ($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 a1dab5cd6cb..126a62fdf5e 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->livraison_bon->enabled) && $user->rights->expedition->livraison->lire)))) + || (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->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->livraison_bon->enabled) $text .= '/'.$langs->trans("Receivings"); + if ($conf->delivery_note->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 447310c8ad2..23f009b6234 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->livraison_bon->enabled && $user->rights->expedition->livraison->lire) + if ($conf->delivery_note->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->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,"; + //if ($conf->delivery_note->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->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"; + //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"; $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->livraison_bon->enabled)) + if (!empty($conf->delivery_note->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->livraison_bon->enabled)) + if (!empty($conf->delivery_note->enabled)) { include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; $expedition->id = $objp->sendingid; diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 0b0ddda1794..68e037d430f 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -57,7 +57,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Security check $id = GETPOST('id', 'int'); if ($user->socid) $socid = $user->socid; -$result = restrictedArea($user, 'expedition', $id, 'livraison', 'livraison'); +$result = restrictedArea($user, 'expedition', $id, 'delivery', 'livraison'); $object = new Delivery($db); $extrafields = new ExtraFields($db); @@ -681,7 +681,7 @@ if ($action == 'create') // Create. Seems to no be used $genallowed = $user->rights->expedition->livraison->lire; $delallowed = $user->rights->expedition->livraison->creer; - print $formfile->showdocuments('livraison', $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + print $formfile->showdocuments('delivery', $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); /* * Linked object block (of linked shipment) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f4f087aa5a3..37c7119d814 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -399,7 +399,7 @@ if (empty($reshook)) /* * Build a receiving receipt */ - elseif ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer) + elseif ($action == 'create_delivery' && $conf->delivery_note->enabled && $user->rights->expedition->livraison->creer) { $result = $object->create_delivery($user); if ($result > 0) @@ -2046,13 +2046,13 @@ if ($action == 'create') $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->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; + //if ($conf->delivery_note->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->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"; + //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"; $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 @@ if ($action == 'create') // This is just to generate a delivery receipt //var_dump($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'])) + if ($conf->delivery_note->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 dd6b9992064..e475053dcda 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -873,7 +873,7 @@ class Expedition extends CommonObject // phpcs:enable global $conf; - if ($conf->livraison_bon->enabled) + if ($conf->delivery_note->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 73db3ef8fe9..4270fe7421b 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -127,8 +127,8 @@ $arrayfields = array( '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->livraison_bon->enabled) ? 0 : 1)), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)), + '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)), '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 ed4f52c501b..e0e5f6f5d03 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1665,13 +1665,13 @@ if ($action == 'create') $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->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; + //if ($conf->delivery_note->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->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"; + //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"; $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;