2
0
forked from Wavyzz/dolibarr

Ajout possibilit de activer/dsactiver les expditions et les bon de livraison, renommage de MAIN_MODULE_EXPEDITION en MAIN_SUBMODULE_EXPEDITION

This commit is contained in:
Regis Houssin
2006-05-15 12:46:15 +00:00
parent 061a096399
commit 5b283b2940
7 changed files with 210 additions and 12 deletions

177
htdocs/admin/confexped.php Normal file
View File

@@ -0,0 +1,177 @@
<?php
/* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
*
* 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 '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="140">'.$langs->trans("Name").'</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">'.$langs->trans("Active").'</td>';
print "</tr>\n";
print "<form method=\"post\" action=\"produit.php\">";
print "<input type=\"hidden\" name=\"action\" value=\"sending\">";
print "<tr ".$bc[false].">";
print '<td width="80%">'.$langs->trans("SendingsAbility").'</td>';
print '<td align="center">';
if($conf->global->MAIN_SUBMODULE_EXPEDITION == 1)
{
print img_tick();
}
print '</td>';
print "<td align=\"center\">";
if($conf->global->MAIN_SUBMODULE_EXPEDITION == 0)
{
print '<a href="produit.php?action=activate_sending">'.$langs->trans("Activate").'</a>';
}
else if($conf->global->MAIN_SUBMODULE_EXPEDITION == 1)
{
print '<a href="produit.php?action=disable_sending">'.$langs->trans("Disable").'</a>';
}
print "</td>";
print '</tr>';
print '</table>';
print '</form>';
// Bon de livraison activation/desactivation
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="140">'.$langs->trans("Name").'</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">'.$langs->trans("Active").'</td>';
print "</tr>\n";
print "<form method=\"post\" action=\"produit.php\">";
print "<input type=\"hidden\" name=\"action\" value=\"delivery\">";
print "<tr ".$bc[false].">";
print '<td width="80%">'.$langs->trans("DeliveriesAbility").'</td>';
print '<td align="center">';
if($conf->global->MAIN_SUBMODULE_LIVRAISON == 1)
{
print img_tick();
}
print '</td>';
print "<td align=\"center\">";
if($conf->global->MAIN_SUBMODULE_LIVRAISON == 0)
{
print '<a href="produit.php?action=activate_delivery">'.$langs->trans("Activate").'</a>';
}
else if($conf->global->MAIN_SUBMODULE_LIVRAISON == 1)
{
print '<a href="produit.php?action=disable_delivery">'.$langs->trans("Disable").'</a>';
}
print "</td>";
print '</tr>';
print '</table>';
print '</form>';
$db->close();
llxFooter();
?>

View File

@@ -119,14 +119,21 @@ $html=new Form($db);
$h = 0; $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][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending"); $head[$h][1] = $langs->trans("Sending");
$hselected=$h; $hselected=$h;
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; if ($conf->global->MAIN_SUBMODULE_LIVRAISON)
$head[$h][1] = $langs->trans("Delivery"); {
$h++; $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Delivery");
$h++;
}
dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));

View File

@@ -119,15 +119,23 @@ $html=new Form($db);
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Sending"); $head[$h][1] = $langs->trans("Setup");
$h++; $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][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Delivery"); $head[$h][1] = $langs->trans("Delivery");
$hselected=$h; $hselected=$h;
$h++; $h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/* /*

View File

@@ -113,7 +113,7 @@ Module70Desc=Interventions' management
Module75Name=Trips Module75Name=Trips
Module75Desc=Trips' management Module75Desc=Trips' management
Module80Name=Sendings Module80Name=Sendings
Module80Desc=Sendings' management Module80Desc=Sendings and delivery orders' management
Module85Name=Banks and cash Module85Name=Banks and cash
Module85Desc=Management of bank or cash accounts Module85Desc=Management of bank or cash accounts
Module86Name=OSCommerce Module86Name=OSCommerce
@@ -458,6 +458,7 @@ NumberOfProductShowInSelect=Max number of products in combos select lists (0=no
##### Sendings ##### ##### Sendings #####
SendingsSetup=Sending module setup SendingsSetup=Sending module setup
SendingsReceiptModel=Sending receipt model SendingsReceiptModel=Sending receipt model
SendingsAbility=Sendings ability
##### Syslog ##### ##### Syslog #####
SyslogSetup=Syslog module setup SyslogSetup=Syslog module setup
SyslogOutput=Log output SyslogOutput=Log output
@@ -482,4 +483,5 @@ MailingSetup=Mailing module setup
MailingEMailFrom=Sender EMail (From) for emails sent by emailing module MailingEMailFrom=Sender EMail (From) for emails sent by emailing module
##### Deliveries ##### ##### Deliveries #####
DeliveryOrderNumberingModules=Delivery order numbering module DeliveryOrderNumberingModules=Delivery order numbering module
DeliveryOrderModel=Delivery order model DeliveryOrderModel=Delivery order model
DeliveriesOrderAbility=Deliveries order ability

View File

@@ -113,7 +113,7 @@ Module70Desc=Gestion des interventions
Module75Name=D<>placements Module75Name=D<>placements
Module75Desc=Gestion des d<>placements Module75Desc=Gestion des d<>placements
Module80Name=Exp<78>ditions Module80Name=Exp<78>ditions
Module80Desc=Gestion des exp<78>ditions Module80Desc=Gestion des exp<78>ditions et bons de livraison
Module85Name=Banques et caisses Module85Name=Banques et caisses
Module85Desc=Gestion des comptes financiers de type Comptes bancaires, postaux ou Caisses liquides Module85Desc=Gestion des comptes financiers de type Comptes bancaires, postaux ou Caisses liquides
Module86Name=OSCommerce Module86Name=OSCommerce
@@ -458,6 +458,7 @@ NumberOfProductShowInSelect=Nombre de produits max dans les listes d
##### Sendings ##### ##### Sendings #####
SendingsSetup=Configuration du module Exp<78>ditions/Livraisons SendingsSetup=Configuration du module Exp<78>ditions/Livraisons
SendingsReceiptModel=Mod<6F>le du bordereau d'exp<78>dition SendingsReceiptModel=Mod<6F>le du bordereau d'exp<78>dition
SendingsAbility=Prise en charge des exp<78>ditions
##### Syslog ##### ##### Syslog #####
SyslogSetup=Configuration du module Syslog SyslogSetup=Configuration du module Syslog
SyslogOutput=Sortie des log SyslogOutput=Sortie des log
@@ -483,3 +484,4 @@ MailingEMailFrom=Email emetteur (From) des mails envoy
##### Deliveries ##### ##### Deliveries #####
DeliveryOrderNumberingModules=Module de num<75>rotation des bons de livraison DeliveryOrderNumberingModules=Module de num<75>rotation des bons de livraison
DeliveryOrderModel=Mod<6F>le de bon de livraison DeliveryOrderModel=Mod<6F>le de bon de livraison
DeliveriesOrderAbility=Prise en charge des bons de livraison

View File

@@ -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_output=DOL_DATA_ROOT."/commande";
$conf->commande->dir_images=DOL_DATA_ROOT."/commande/images"; $conf->commande->dir_images=DOL_DATA_ROOT."/commande/images";
// Module expeditions // 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_output=DOL_DATA_ROOT."/expedition";
$conf->expedition->dir_images=DOL_DATA_ROOT."/expedition/images"; $conf->expedition->dir_images=DOL_DATA_ROOT."/expedition/images";
// Module expeditions // Module bon de livraison
$conf->livraison->enabled=defined("MAIN_MODULE_EXPEDITION")?MAIN_MODULE_EXPEDITION:0; $conf->livraison->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0;
$conf->livraison->dir_output=DOL_DATA_ROOT."/livraison"; $conf->livraison->dir_output=DOL_DATA_ROOT."/livraison";
$conf->livraison->dir_images=DOL_DATA_ROOT."/livraison/images"; $conf->livraison->dir_images=DOL_DATA_ROOT."/livraison/images";
// Module societe // Module societe

View File

@@ -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 (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_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'); 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';