Forráskód Böngészése

rename folder admin/livraison.php and dependencies #14697

Aurélien 4 éve
szülő
commit
af7c23b2ac

+ 3 - 3
htdocs/admin/livraison.php → htdocs/admin/delivery.php

@@ -24,9 +24,9 @@
  */
 
 /**
- *      \file       htdocs/admin/livraison.php
- *      \ingroup    livraison
- *      \brief      Page d'administration/configuration du module Delivery
+ *      \file       htdocs/admin/delivery.php
+ *      \ingroup    delivery
+ *      \brief      age to setup extra fields of delivery
  */
 require '../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

+ 3 - 3
htdocs/admin/livraison_extrafields.php → htdocs/admin/delivery_extrafields.php

@@ -22,9 +22,9 @@
  */
 
 /**
- *      \file       htdocs/admin/livraison_extrafields.php
- *		\ingroup    livraison
- *		\brief      Page to setup extra fields of livraison
+ *      \file       htdocs/admin/delivery_extrafields.php
+ *		\ingroup    delivery
+ *		\brief      Page to setup extra fields of delivery
  */
 
 require '../main.inc.php';

+ 3 - 3
htdocs/admin/livraisondet_extrafields.php → htdocs/admin/deliverydet_extrafields.php

@@ -24,9 +24,9 @@
  */
 
 /**
- *      \file       htdocs/admin/livraisondet_extrafields.php
- *		\ingroup    livraison
- *		\brief      Page to setup extra fields of livraison
+ *      \file       htdocs/admin/deliverydet_extrafields.php
+ *		\ingroup    delivery
+ *		\brief      Page to setup extra fields of delivery
  */
 
 require '../main.inc.php';

+ 1 - 1
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 '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id.'">'.$langs->trans('CreateShipment').'</a>';
 							} else {

+ 1 - 1
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 = 'livraison/class'; $subelement = 'livraison'; $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') {

+ 3 - 3
htdocs/core/class/conf.class.php

@@ -122,7 +122,7 @@ class Conf
 		// First level object
 		// TODO Remove this part.
 		$this->expedition_bon = new stdClass();
-		$this->livraison_bon = new stdClass();
+		$this->delivery_note = new stdClass();
 		$this->fournisseur = new stdClass();
 		$this->product			= new stdClass();
 		$this->service			= new stdClass();
@@ -370,8 +370,8 @@ class Conf
 
 		// Sous module bons d'expedition
 		$this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0);
-		// Sous module bons de livraison
-		$this->livraison_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 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);
 
 		// Module fournisseur
 		if (!empty($this->fournisseur))

+ 4 - 4
htdocs/core/lib/expedition.lib.php

@@ -53,7 +53,7 @@ function expedition_prepare_head(Expedition $object)
 
 	if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
 	{
-		$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
+		$head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
 		$head[$h][1] = $langs->trans("Receivings");
 		$h++;
 	}
@@ -111,7 +111,7 @@ function expedition_admin_prepare_head()
 
 	if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
 	{
-		$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
+		$head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
 		$head[$h][1] = $langs->trans("Receivings");
 		$head[$h][2] = 'receivings';
 		$h++;
@@ -119,7 +119,7 @@ function expedition_admin_prepare_head()
 
 	if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
 	{
-		$head[$h][0] = DOL_URL_ROOT.'/admin/livraison_extrafields.php';
+		$head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php';
 		$head[$h][1] = $langs->trans("ExtraFields");
 		$head[$h][2] = 'attributes_receivings';
 		$h++;
@@ -127,7 +127,7 @@ function expedition_admin_prepare_head()
 
 	if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
 	{
-		$head[$h][0] = DOL_URL_ROOT.'/admin/livraisondet_extrafields.php';
+		$head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php';
 		$head[$h][1] = $langs->trans("ExtraFieldsLines");
 		$head[$h][2] = 'attributeslines_receivings';
 		$h++;

+ 3 - 3
htdocs/core/lib/functions.lib.php

@@ -8650,9 +8650,9 @@ function getElementProperties($element_type)
 		$module = 'expedition_bon';
 	}
 	if ($element_type == 'delivery') {
-		$classpath = 'livraison/class';
-		$subelement = 'livraison';
-		$module = 'livraison_bon';
+		$classpath = 'delivery/class';
+		$subelement = 'delivery';
+		$module = 'delivery_note';
 	}
 	if ($element_type == 'contract') {
 		$classpath = 'contrat/class';

+ 3 - 3
htdocs/core/lib/functions2.lib.php

@@ -1791,9 +1791,9 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
 		$myobject = 'expedition';
 		$module = 'expedition_bon';
 	} elseif ($objecttype == 'delivery') {
-		$classpath = 'livraison/class';
-		$myobject = 'livraison';
-		$module = 'livraison_bon';
+		$classpath = 'delivery/class';
+		$myobject = 'delivery';
+		$module = 'delivery_note';
 	} elseif ($objecttype == 'contract') {
 		$classpath = 'contrat/class';
 		$module = 'contrat';

+ 5 - 5
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 .= '<span class="badge marginleftonlyshort">'.($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 .= '</span>';
 		$head[$h][1] = $text;
 		$head[$h][2] = 'shipping';

+ 2 - 2
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++;

+ 5 - 5
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 '<td>';
 			    print '</td>';
 			}*/
-			if (!empty($conf->livraison_bon->enabled))
+			if (!empty($conf->delivery_note->enabled))
 			{
 				print '<td>'.$langs->trans("DeliveryOrder").'</td>';
 				//print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
@@ -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;

+ 4 - 4
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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
 			}

+ 1 - 1
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)
 			{

+ 2 - 2
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)))
 );
 

+ 1 - 1
htdocs/install/mysql/tables/llx_menu.sql

@@ -39,7 +39,7 @@ CREATE TABLE llx_menu
 	langs         varchar(100),								-- Lang file to load for translation
 	level         smallint,									-- Deprecated. Not used.
 	perms         text,										-- Condition to show enabled or disabled
-	enabled       text NULL default '1', 		            -- Condition to show or hide
+	enabled       text NULL, 		            -- Condition to show or hide
 	usertype      integer NOT NULL DEFAULT 0,				-- 0 if menu for all users, 1 for external only, 2 for internal only
 	tms           timestamp
 	

+ 2 - 2
htdocs/install/upgrade2.php

@@ -2090,11 +2090,11 @@ function migrate_commande_livraison($db, $langs, $conf)
 
                     if ($resql2)
                     {
-                    	$date_livraison = $db->jdate($obj->date_livraison);
+                    	$delivery_date = $db->jdate($obj->date_livraison);
 
                         $sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET";
                         $sqlu .= " ref_client='".$db->escape($obj->ref_client)."'";
-                        $sqlu .= ", date_livraison='".$db->idate($date_livraison)."'";
+                        $sqlu .= ", date_livraison='".$db->idate($delivery_date)."'";
                         $sqlu .= " WHERE rowid = ".$obj->rowid;
                         $resql3 = $db->query($sqlu);
                         if (!$resql3)

+ 2 - 2
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;