dolibarr  9.0.0
confexped.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
5  * Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>รน
6  * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
28 require '../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array('admin', 'sendings', 'deliveries'));
34 
35 if (!$user->admin)
37 
38 $action=GETPOST('action','alpha');
39 
40 
41 /*
42  * Actions
43  */
44 
45 // Shipment note
46 if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
47 {
48  // This option should always be set to on when module is on.
49  dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity);
50 }
51 /*
52 if ($action == 'activate_sending')
53 {
54  dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity);
55  header("Location: confexped.php");
56  exit;
57 }
58 if ($action == 'disable_sending')
59 {
60  dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity);
61  header("Location: confexped.php");
62  exit;
63 }
64 */
65 
66 // Delivery note
67 if ($action == 'activate_delivery')
68 {
69  dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); // We must also enable this
70  dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1",'chaine',0,'',$conf->entity);
71  header("Location: confexped.php");
72  exit;
73 }
74 else if ($action == 'disable_delivery')
75 {
76  dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity);
77  header("Location: confexped.php");
78  exit;
79 }
80 
81 
82 /*
83  * View
84  */
85 
86 $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/";
87 $form=new Form($db);
88 
89 llxHeader("",$langs->trans("SendingsSetup"));
90 
91 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
92 print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
93 print '<br>';
95 
96 dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending');
97 
98 // Miscellaneous parameters
99 
100 print '<table class="noborder" width="100%">';
101 print '<tr class="liste_titre">';
102 print '<td>'.$langs->trans("Feature").'</td>';
103 print '<td width="20">&nbsp;</td>';
104 print '<td class="center">'.$langs->trans("Status").'</td>';
105 print '</tr>'."\n";
106 
107 // expedition activation/desactivation
108 print "<tr>";
109 print '<td>'.$langs->trans("SendingsAbility").'</td>';
110 print '<td>';
111 print '</td>';
112 print '<td class="center">';
113 print $langs->trans("Required");
114 /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
115 {
116  print '<a href="confexped.php?action=activate_sending">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
117 }
118 else
119 {
120  print '<a href="confexped.php?action=disable_sending">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
121 }*/
122 print "</td>";
123 print '</tr>';
124 
125 // Bon de livraison activation/desactivation
126 print '<tr>';
127 print '<td>';
128 print $langs->trans("DeliveriesOrderAbility");
129 print '<br>'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
130 print '</td>';
131 print '<td>';
132 print '</td>';
133 print '<td class="center">';
134 
135 if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
136 {
137  print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
138 }
139 else
140 {
141  print '<a href="confexped.php?action=disable_delivery">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
142 }
143 
144 print "</td>";
145 print '</tr>';
146 print '</table>';
147 
148 print '</div>';
149 
150 // End of page
151 llxFooter();
152 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:510
expedition_admin_prepare_head()
Return array head with list of tabs to view object informations.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:435
llxHeader()
Empty header.
Definition: wrapper.php:44
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='')
Show tab header of a card.