debug access right after rename class #14697
This commit is contained in:
parent
d103a9aede
commit
c8cd55e158
@ -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 {
|
||||
|
||||
@ -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') {
|
||||
|
||||
@ -417,7 +417,7 @@ class FormFile
|
||||
|
||||
$titletoshow = $langs->trans("Documents");
|
||||
if (!empty($title)) $titletoshow = ($title == 'none' ? '' : $title);
|
||||
|
||||
print($modulepart);
|
||||
// Show table
|
||||
if ($genallowed)
|
||||
{
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
|
||||
}
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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)))
|
||||
);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user