2013-03-04 11:16:46 +01:00
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
2015-05-09 13:25:40 +02:00
|
|
|
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
2024-09-18 03:27:25 +02:00
|
|
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
2024-11-04 23:53:20 +01:00
|
|
|
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
2013-03-04 11:16:46 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2013-03-04 11:16:46 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2013-03-04 16:59:39 +01:00
|
|
|
* \file htdocs/admin/ecm.php
|
2013-03-04 11:16:46 +01:00
|
|
|
* \ingroup core
|
|
|
|
|
* \brief Page to setup ECM (GED) module
|
|
|
|
|
*/
|
|
|
|
|
|
2022-08-30 22:51:30 +02:00
|
|
|
|
|
|
|
|
// Load Dolibarr environment
|
2013-03-04 11:16:46 +01:00
|
|
|
require '../main.inc.php';
|
2020-10-02 00:21:13 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
2013-03-04 11:16:46 +01:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|
|
|
|
|
2024-11-04 23:53:20 +01:00
|
|
|
/**
|
|
|
|
|
* @var Conf $conf
|
|
|
|
|
* @var DoliDB $db
|
|
|
|
|
* @var HookManager $hookmanager
|
|
|
|
|
* @var Translate $langs
|
|
|
|
|
* @var User $user
|
|
|
|
|
*/
|
|
|
|
|
|
2018-05-26 18:41:16 +02:00
|
|
|
// Load translation files required by the page
|
2013-03-04 11:16:46 +01:00
|
|
|
$langs->load("admin");
|
|
|
|
|
|
2023-01-02 02:23:28 +01:00
|
|
|
$action = GETPOST('action', 'aZ09');
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!$user->admin) {
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
2013-03-04 11:16:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Action
|
|
|
|
|
*/
|
2022-08-30 22:51:30 +02:00
|
|
|
|
|
|
|
|
// set
|
2023-01-02 02:23:28 +01:00
|
|
|
$reg = array();
|
2021-02-26 22:04:03 +01:00
|
|
|
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
|
2020-04-10 10:59:32 +02:00
|
|
|
$code = $reg[1];
|
2021-02-26 22:04:03 +01:00
|
|
|
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
|
2020-03-23 15:54:02 +01:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2020-03-23 15:54:02 +01:00
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
2013-03-04 11:16:46 +01:00
|
|
|
}
|
|
|
|
|
|
2022-08-30 22:51:30 +02:00
|
|
|
// delete
|
2021-02-26 22:04:03 +01:00
|
|
|
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
|
2020-04-10 10:59:32 +02:00
|
|
|
$code = $reg[1];
|
2021-02-26 22:04:03 +01:00
|
|
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
|
2020-03-23 15:54:02 +01:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
|
|
|
exit;
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2020-03-23 15:54:02 +01:00
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
2013-03-04 11:16:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
|
|
|
|
|
2023-01-02 02:23:28 +01:00
|
|
|
$form = new Form($db);
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$help_url = '';
|
2024-06-08 14:53:14 +02:00
|
|
|
llxHeader('', $langs->trans("ECMSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ecm');
|
2013-03-04 11:16:46 +01:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
2019-01-27 11:55:16 +01:00
|
|
|
print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
|
2013-03-22 17:10:17 +01:00
|
|
|
print '<br>';
|
|
|
|
|
|
2020-10-02 00:21:13 +02:00
|
|
|
$head = ecm_admin_prepare_head();
|
|
|
|
|
|
2021-02-15 20:13:38 +01:00
|
|
|
print dol_get_fiche_head($head, 'ecm', '', -1, '');
|
2020-10-02 00:21:13 +02:00
|
|
|
|
2019-11-05 21:24:41 +01:00
|
|
|
print '<table class="noborder centpercent">';
|
2013-03-04 11:16:46 +01:00
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
2025-01-24 13:12:48 +01:00
|
|
|
print '<td class="center" width="100px"></td>'."\n";
|
2013-03-04 11:16:46 +01:00
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
// Mail required for members
|
2017-04-14 11:22:48 +02:00
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
2013-03-04 11:16:46 +01:00
|
|
|
print '<td>'.$langs->trans("ECMAutoTree").'</td>';
|
2023-01-02 02:23:28 +01:00
|
|
|
print '<td class="center">';
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2024-09-18 03:27:25 +02:00
|
|
|
print ajax_constantonoff('ECM_AUTO_TREE_HIDEN', array(), null, 1);
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-10-24 17:00:13 +02:00
|
|
|
if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) {
|
2023-01-02 02:23:28 +01:00
|
|
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_HIDEN&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
|
|
|
|
} else {
|
|
|
|
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_HIDEN&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
2013-03-04 11:16:46 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
2018-07-28 17:26:56 +02:00
|
|
|
// End of page
|
2013-03-04 11:16:46 +01:00
|
|
|
llxFooter();
|
2018-05-26 18:41:16 +02:00
|
|
|
$db->close();
|