dolibarr  7.0.0-beta
ecm.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
3  * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
25 require '../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
27 
28 $langs->load("admin");
29 
30 if (! $user->admin) accessforbidden();
31 
32 
33 /*
34  * Action
35  */
36 if (preg_match('/set_(.*)/',$action,$reg))
37 {
38  $code=$reg[1];
39  if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
40  {
41  header("Location: ".$_SERVER["PHP_SELF"]);
42  exit;
43  }
44  else
45  {
46  dol_print_error($db);
47  }
48 }
49 
50 if (preg_match('/del_(.*)/',$action,$reg))
51 {
52  $code=$reg[1];
53  if (dolibarr_del_const($db, $code, $conf->entity) > 0)
54  {
55  header("Location: ".$_SERVER["PHP_SELF"]);
56  exit;
57  }
58  else
59  {
60  dol_print_error($db);
61  }
62 }
63 
64 
65 /*
66  * View
67  */
68 
69 $help_url='';
70 llxHeader('',$langs->trans("ECMSetup"),$help_url);
71 
72 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
73 print load_fiche_titre($langs->trans("ECMSetup"),$linkback,'title_setup');
74 print '<br>';
75 
76 print '<table class="noborder" width="100%">';
77 print '<tr class="liste_titre">';
78 print '<td>'.$langs->trans("Description").'</td>';
79 print '<td align="center" width="20">&nbsp;</td>';
80 print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
81 print '</tr>';
82 
83 $var=true;
84 $form = new Form($db);
85 
86 // Mail required for members
87 
88 print '<tr class="oddeven">';
89 print '<td>'.$langs->trans("ECMAutoTree").'</td>';
90 print '<td align="center" width="20">&nbsp;</td>';
91 
92 print '<td align="center" width="100">';
93 if ($conf->use_javascript_ajax)
94 {
95  print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
96 }
97 else
98 {
99  if (empty($conf->global->ECM_AUTO_TREE_ENABLED))
100  {
101  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
102  }
103  else if(! empty($conf->global->USER_MAIL_REQUIRED))
104  {
105  print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
106  }
107 }
108 print '</td></tr>';
109 
110 print '</table>';
111 
112 llxFooter();
113 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
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
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
if(empty($reshook)) $form
View.
Definition: perms.php:103
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
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0)
On/off button for constant.
Definition: ajax.lib.php:500