ecm.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. /**
  19. * \file htdocs/admin/ecm.php
  20. * \ingroup core
  21. * \brief Page to setup ECM (GED) module
  22. */
  23. require '../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  25. $langs->load("admin");
  26. if (! $user->admin) accessforbidden();
  27. /*
  28. * Action
  29. */
  30. if (preg_match('/set_(.*)/',$action,$reg))
  31. {
  32. $code=$reg[1];
  33. if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
  34. {
  35. header("Location: ".$_SERVER["PHP_SELF"]);
  36. exit;
  37. }
  38. else
  39. {
  40. dol_print_error($db);
  41. }
  42. }
  43. if (preg_match('/del_(.*)/',$action,$reg))
  44. {
  45. $code=$reg[1];
  46. if (dolibarr_del_const($db, $code, $conf->entity) > 0)
  47. {
  48. header("Location: ".$_SERVER["PHP_SELF"]);
  49. exit;
  50. }
  51. else
  52. {
  53. dol_print_error($db);
  54. }
  55. }
  56. /*
  57. * View
  58. */
  59. $help_url='';
  60. llxHeader('',$langs->trans("ECMSetup"),$help_url);
  61. $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  62. print load_fiche_titre($langs->trans("ECMSetup"),$linkback,'title_setup');
  63. print '<br>';
  64. print '<table class="noborder" width="100%">';
  65. print '<tr class="liste_titre">';
  66. print '<td>'.$langs->trans("Description").'</td>';
  67. print '<td align="center" width="20">&nbsp;</td>';
  68. print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
  69. print '</tr>';
  70. $var=true;
  71. $form = new Form($db);
  72. // Mail required for members
  73. print '<tr class="oddeven">';
  74. print '<td>'.$langs->trans("ECMAutoTree").'</td>';
  75. print '<td align="center" width="20">&nbsp;</td>';
  76. print '<td align="center" width="100">';
  77. if ($conf->use_javascript_ajax)
  78. {
  79. print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
  80. }
  81. else
  82. {
  83. if (empty($conf->global->ECM_AUTO_TREE_ENABLED))
  84. {
  85. print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  86. }
  87. else if(! empty($conf->global->USER_MAIL_REQUIRED))
  88. {
  89. print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
  90. }
  91. }
  92. print '</td></tr>';
  93. print '</table>';
  94. llxFooter();
  95. $db->close();