dolibarr  9.0.0
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 // Load translation files required by the page
29 $langs->load("admin");
30 
31 if (! $user->admin) accessforbidden();
32 
33 
34 /*
35  * Action
36  */
37 if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
38 {
39  $code=$reg[1];
40  if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
41  {
42  header("Location: ".$_SERVER["PHP_SELF"]);
43  exit;
44  }
45  else
46  {
47  dol_print_error($db);
48  }
49 }
50 
51 if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
52 {
53  $code=$reg[1];
54  if (dolibarr_del_const($db, $code, $conf->entity) > 0)
55  {
56  header("Location: ".$_SERVER["PHP_SELF"]);
57  exit;
58  }
59  else
60  {
61  dol_print_error($db);
62  }
63 }
64 
65 
66 /*
67  * View
68  */
69 
70 $help_url='';
71 llxHeader('',$langs->trans("ECMSetup"),$help_url);
72 
73 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
74 print load_fiche_titre($langs->trans("ECMSetup"),$linkback,'title_setup');
75 print '<br>';
76 
77 print '<table class="noborder" width="100%">';
78 print '<tr class="liste_titre">';
79 print '<td>'.$langs->trans("Description").'</td>';
80 print '<td align="center" width="20">&nbsp;</td>';
81 print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
82 print '</tr>';
83 
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 // End of page
113 llxFooter();
114 $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.
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
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
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
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0)
On/off button for constant.
Definition: ajax.lib.php:484
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)