Skip to content

Commit

Permalink
rename livraison pdf and dependencies Dolibarr#14697
Browse files Browse the repository at this point in the history
  • Loading branch information
orebd committed Oct 6, 2020
1 parent af7c23b commit 1af42b3
Show file tree
Hide file tree
Showing 31 changed files with 94 additions and 94 deletions.
8 changes: 4 additions & 4 deletions htdocs/admin/confexped.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -121,7 +121,7 @@
print "</td>";
print '</tr>';

// Bon de livraison activation/desactivation
// Delivery note activate/deactivate Bon de livraison activation/desactivation
print '<tr>';
print '<td>';
print $langs->trans("DeliveriesOrderAbility");
Expand All @@ -131,7 +131,7 @@
print '</td>';
print '<td class="center">';

if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
if (empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{
print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} else {
Expand Down
22 changes: 11 additions & 11 deletions htdocs/admin/delivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
Expand All @@ -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
Expand All @@ -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);
}


Expand Down Expand Up @@ -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))
{
Expand All @@ -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);

Expand Down Expand Up @@ -237,7 +237,7 @@
print '</td>'."\n";

print '<td class="center">';
if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file")
if ($conf->global->DELIVERY_ADDON_NUMBER == "$file")
{
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -378,7 +378,7 @@

// Default
print "<td align=\"center\">";
if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
if ($conf->global->DELIVERY_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"), 'on');
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id.'">'.$langs->trans('CreateShipment').'</a>';
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/conf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/class/html.formfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/lib/expedition.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -109,23 +109,23 @@ 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");
$head[$h][2] = 'receivings';
$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");
$head[$h][2] = 'attributes_receivings';
$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");
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/lib/files.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions2.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
10 changes: 5 additions & 5 deletions htdocs/core/lib/order.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= '<span class="badge marginleftonlyshort">'.($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 .= '</span>';
$head[$h][1] = $text;
$head[$h][2] = 'shipping';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/lib/propal.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
10 changes: 5 additions & 5 deletions htdocs/core/lib/sendings.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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').")";
Expand Down Expand Up @@ -260,7 +260,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
print '<td>';
print '</td>';
}*/
if (!empty($conf->delivery_note->enabled))
if (!empty($conf->livraison_bon->enabled))
{
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
//print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/bank/doc/pdf_ban.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 1af42b3

Please sign in to comment.