From 5b283b2940587ee37713e8304230ad8733ebf28c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 15 May 2006 12:46:15 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20possibilit=E9=20de=20activer/d=E9sactiv?= =?UTF-8?q?er=20les=20exp=E9ditions=20et=20les=20bon=20de=20livraison,=20r?= =?UTF-8?q?enommage=20de=20MAIN=5FMODULE=5FEXPEDITION=20en=20MAIN=5FSUBMOD?= =?UTF-8?q?ULE=5FEXPEDITION?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/confexped.php | 177 ++++++++++++++++++++++++++++++++ htdocs/admin/expedition.php | 13 ++- htdocs/admin/livraison.php | 12 ++- htdocs/langs/en_US/admin.lang | 6 +- htdocs/langs/fr_FR/admin.lang | 4 +- htdocs/master.inc.php | 6 +- mysql/migration/2.0.0-2.1.0.sql | 4 +- 7 files changed, 210 insertions(+), 12 deletions(-) create mode 100644 htdocs/admin/confexped.php diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php new file mode 100644 index 00000000000..bb5c4b07ce3 --- /dev/null +++ b/htdocs/admin/confexped.php @@ -0,0 +1,177 @@ + + * Copyright (C) 2006 Andre Cianfarani + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/confexped.php + \ingroup produit + \brief Page d'administration/configuration du module Expedition + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("admin"); +$langs->load("sendings"); + +if (!$user->admin) + accessforbidden(); + + + +if ($_POST["action"] == 'activate_sending') +{ + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", $_POST["value"]); + Header("Location: produit.php"); + exit; +} +else if ($_GET["action"] == 'disable_sending') +{ + dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION"); + Header("Location: produit.php"); + exit; +} +else if ($_GET["action"] == 'activate_delivery') +{ + dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1"); + Header("Location: produit.php"); + exit; +} +else if ($_GET["action"] == 'disable_delivery') +{ + dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON"); + Header("Location: produit.php"); + exit; +} + + +/* + * Affiche page + */ + +llxHeader("",""); + +$dir = DOL_DOCUMENT_ROOT."/expedition/mods/"; +$html=new Form($db); + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; +$head[$h][1] = $langs->trans("Setup"); +$hselected=$h; +$h++; + +if ($conf->global->MAIN_SUBMODULE_EXPEDITION) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; + $head[$h][1] = $langs->trans("Sending"); + $h++; +} + +if ($conf->global->MAIN_SUBMODULE_LIVRAISON) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; + $head[$h][1] = $langs->trans("Delivery"); + $h++; +} + +dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +/* + * Formulaire parametres divers + */ + + +// expedition activation/desactivation +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; +print ""; +print ""; +print ""; +print ''; +print ''; +print ""; +print ''; +print '
'.$langs->trans("Name").' '.$langs->trans("Active").'
'.$langs->trans("SendingsAbility").''; + +if($conf->global->MAIN_SUBMODULE_EXPEDITION == 1) +{ + print img_tick(); +} + +print '"; + +if($conf->global->MAIN_SUBMODULE_EXPEDITION == 0) +{ + print ''.$langs->trans("Activate").''; +} +else if($conf->global->MAIN_SUBMODULE_EXPEDITION == 1) +{ + print ''.$langs->trans("Disable").''; +} + +print "
'; +print ''; + +// Bon de livraison activation/desactivation +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; +print ""; +print ""; +print ""; +print ''; +print ''; +print ""; +print ''; +print '
'.$langs->trans("Name").' '.$langs->trans("Active").'
'.$langs->trans("DeliveriesAbility").''; + +if($conf->global->MAIN_SUBMODULE_LIVRAISON == 1) +{ + print img_tick(); +} + +print '"; + +if($conf->global->MAIN_SUBMODULE_LIVRAISON == 0) +{ + print ''.$langs->trans("Activate").''; +} +else if($conf->global->MAIN_SUBMODULE_LIVRAISON == 1) +{ + print ''.$langs->trans("Disable").''; +} + +print "
'; +print ''; + + +$db->close(); + +llxFooter(); +?> diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 4a204acc241..92c3747377a 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -119,14 +119,21 @@ $html=new Form($db); $h = 0; +$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; +$head[$h][1] = $langs->trans("Setup"); +$h++; + $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][1] = $langs->trans("Sending"); $hselected=$h; $h++; -$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; -$head[$h][1] = $langs->trans("Delivery"); -$h++; +if ($conf->global->MAIN_SUBMODULE_LIVRAISON) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; + $head[$h][1] = $langs->trans("Delivery"); + $h++; +} dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index ae9aefd6087..5c98e72fb83 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -119,15 +119,23 @@ $html=new Form($db); $h = 0; -$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; -$head[$h][1] = $langs->trans("Sending"); +$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; +$head[$h][1] = $langs->trans("Setup"); $h++; +if ($conf->global->MAIN_SUBMODULE_EXPEDITION) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; + $head[$h][1] = $langs->trans("Sending"); + $h++; +} + $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][1] = $langs->trans("Delivery"); $hselected=$h; $h++; + dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 99928d0b624..6a9ef1af27c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -113,7 +113,7 @@ Module70Desc=Interventions' management Module75Name=Trips Module75Desc=Trips' management Module80Name=Sendings -Module80Desc=Sendings' management +Module80Desc=Sendings and delivery orders' management Module85Name=Banks and cash Module85Desc=Management of bank or cash accounts Module86Name=OSCommerce @@ -458,6 +458,7 @@ NumberOfProductShowInSelect=Max number of products in combos select lists (0=no ##### Sendings ##### SendingsSetup=Sending module setup SendingsReceiptModel=Sending receipt model +SendingsAbility=Sendings ability ##### Syslog ##### SyslogSetup=Syslog module setup SyslogOutput=Log output @@ -482,4 +483,5 @@ MailingSetup=Mailing module setup MailingEMailFrom=Sender EMail (From) for emails sent by emailing module ##### Deliveries ##### DeliveryOrderNumberingModules=Delivery order numbering module -DeliveryOrderModel=Delivery order model \ No newline at end of file +DeliveryOrderModel=Delivery order model +DeliveriesOrderAbility=Deliveries order ability \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 99e3c7c47af..f97482fe4d7 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -113,7 +113,7 @@ Module70Desc=Gestion des interventions Module75Name=Déplacements Module75Desc=Gestion des déplacements Module80Name=Expéditions -Module80Desc=Gestion des expéditions +Module80Desc=Gestion des expéditions et bons de livraison Module85Name=Banques et caisses Module85Desc=Gestion des comptes financiers de type Comptes bancaires, postaux ou Caisses liquides Module86Name=OSCommerce @@ -458,6 +458,7 @@ NumberOfProductShowInSelect=Nombre de produits max dans les listes d ##### Sendings ##### SendingsSetup=Configuration du module Expéditions/Livraisons SendingsReceiptModel=Modèle du bordereau d'expédition +SendingsAbility=Prise en charge des expéditions ##### Syslog ##### SyslogSetup=Configuration du module Syslog SyslogOutput=Sortie des log @@ -483,3 +484,4 @@ MailingEMailFrom=Email emetteur (From) des mails envoy ##### Deliveries ##### DeliveryOrderNumberingModules=Module de numérotation des bons de livraison DeliveryOrderModel=Modèle de bon de livraison +DeliveriesOrderAbility=Prise en charge des bons de livraison diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 4499f3ca9ab..607bddf5c59 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -221,11 +221,11 @@ $conf->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0; $conf->commande->dir_output=DOL_DATA_ROOT."/commande"; $conf->commande->dir_images=DOL_DATA_ROOT."/commande/images"; // Module expeditions -$conf->expedition->enabled=defined("MAIN_MODULE_EXPEDITION")?MAIN_MODULE_EXPEDITION:0; +$conf->expedition->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0; $conf->expedition->dir_output=DOL_DATA_ROOT."/expedition"; $conf->expedition->dir_images=DOL_DATA_ROOT."/expedition/images"; -// Module expeditions -$conf->livraison->enabled=defined("MAIN_MODULE_EXPEDITION")?MAIN_MODULE_EXPEDITION:0; +// Module bon de livraison +$conf->livraison->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0; $conf->livraison->dir_output=DOL_DATA_ROOT."/livraison"; $conf->livraison->dir_images=DOL_DATA_ROOT."/livraison/images"; // Module societe diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 1a2cedeb29c..d417d8799bf 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -224,4 +224,6 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (100, 'commande', 'external', 'BILLING', 'Contact client facturation commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101, 'commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1); -insert into llx_c_pays (rowid,code,libelle) values (30, 'SG', 'Singapoure'); \ No newline at end of file +insert into llx_c_pays (rowid,code,libelle) values (30, 'SG', 'Singapoure'); + +update llx_const set name='MAIN_SUBMODULE_EXPEDITION' where name='MAIN_MODULE_EXPEDITION'; \ No newline at end of file