dolibarr  7.0.0-beta
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@capnetworks.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 $langs->load("admin");
33 $langs->load("sendings");
34 $langs->load("deliveries");
35 
36 if (!$user->admin)
38 
39 $action=GETPOST('action','alpha');
40 
41 
42 /*
43  * Actions
44  */
45 
46 // Shipment note
47 if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
48 {
49  // This option should always be set to on when module is on.
50  dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity);
51 }
52 /*
53 if ($action == 'activate_sending')
54 {
55  dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity);
56  header("Location: confexped.php");
57  exit;
58 }
59 if ($action == 'disable_sending')
60 {
61  dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity);
62  header("Location: confexped.php");
63  exit;
64 }
65 */
66 
67 // Delivery note
68 if ($action == 'activate_delivery')
69 {
70  dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); // We must also enable this
71  dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1",'chaine',0,'',$conf->entity);
72  header("Location: confexped.php");
73  exit;
74 }
75 else if ($action == 'disable_delivery')
76 {
77  dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity);
78  header("Location: confexped.php");
79  exit;
80 }
81 
82 
83 /*
84  * View
85  */
86 
87 $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/";
88 $form=new Form($db);
89 
90 llxHeader("",$langs->trans("SendingsSetup"));
91 
92 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
93 print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
94 print '<br>';
96 
97 dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending');
98 
99 // Miscellaneous parameters
100 
101 print '<table class="noborder" width="100%">';
102 print '<tr class="liste_titre">';
103 print '<td>'.$langs->trans("Feature").'</td>';
104 print '<td width="20">&nbsp;</td>';
105 print '<td class="center">'.$langs->trans("Status").'</td>';
106 print '</tr>'."\n";
107 
108 // expedition activation/desactivation
109 print "<tr>";
110 print '<td>'.$langs->trans("SendingsAbility").'</td>';
111 print '<td>';
112 print '</td>';
113 print '<td class="center">';
114 print $langs->trans("Required");
115 /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
116 {
117  print '<a href="confexped.php?action=activate_sending">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
118 }
119 else
120 {
121  print '<a href="confexped.php?action=disable_sending">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
122 }*/
123 print "</td>";
124 print '</tr>';
125 
126 // Bon de livraison activation/desactivation
127 print '<tr>';
128 print '<td>';
129 print $langs->trans("DeliveriesOrderAbility");
130 print '<br>'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
131 print '</td>';
132 print '<td>';
133 print '</td>';
134 print '<td class="center">';
135 
136 if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
137 {
138  print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
139 }
140 else
141 {
142  print '<a href="confexped.php?action=disable_delivery">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
143 }
144 
145 print "</td>";
146 print '</tr>';
147 print '</table>';
148 
149 print '</div>';
150 
151 llxFooter();
152 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
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:485
if(empty($reshook)) $form
View.
Definition: perms.php:103
expedition_admin_prepare_head()
Return array head with list of tabs to view object informations.
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
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'une constante dans la base de donnees.
Definition: admin.lib.php:410
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
print
Draft customers invoices.
Definition: index.php:91