dolibarr  13.0.2
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 <https://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', 'aZ09');
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_DELIVERY", "1", 'chaine', 0, '', $conf->entity);
71  header("Location: confexped.php");
72  exit;
73 } elseif ($action == 'disable_delivery')
74 {
75  dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity);
76  header("Location: confexped.php");
77  exit;
78 }
79 
80 
81 /*
82  * View
83  */
84 
85 $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/";
86 $form = new Form($db);
87 
88 llxHeader("", $langs->trans("SendingsSetup"));
89 
90 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
91 print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup');
92 print '<br>';
94 
95 print dol_get_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment');
96 
97 // Miscellaneous parameters
98 
99 print '<table class="noborder centpercent">';
100 print '<tr class="liste_titre">';
101 print '<td>'.$langs->trans("Feature").'</td>';
102 print '<td width="20">&nbsp;</td>';
103 print '<td class="center">'.$langs->trans("Status").'</td>';
104 print '</tr>'."\n";
105 
106 // expedition activation/desactivation
107 print "<tr>";
108 print '<td>'.$langs->trans("SendingsAbility").'</td>';
109 print '<td>';
110 print '</td>';
111 print '<td class="center">';
112 print $langs->trans("Required");
113 /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
114 {
115  print '<a href="confexped.php?action=activate_sending">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
116 }
117 else
118 {
119  print '<a href="confexped.php?action=disable_sending">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
120 }*/
121 print "</td>";
122 print '</tr>';
123 
124 // Delivery note activate/deactivate Bon de livraison activation/desactivation
125 print '<tr>';
126 print '<td>';
127 print $langs->trans("DeliveriesOrderAbility");
128 print '<br>'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
129 print '</td>';
130 print '<td>';
131 print '</td>';
132 print '<td class="center">';
133 
134 if (empty($conf->global->MAIN_SUBMODULE_DELIVERY))
135 {
136  print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
137 } else {
138  print '<a href="confexped.php?action=disable_delivery">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
139 }
140 
141 print "</td>";
142 print '</tr>';
143 print '</table>';
144 
145 print '</div>';
146 
147 // End of page
148 llxFooter();
149 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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:575
expedition_admin_prepare_head()
Return array head with list of tabs to view object informations.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:499
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
llxFooter()
Empty footer.
Definition: wrapper.php:59