2004-10-19 18:58:50 +00:00
|
|
|
<?php
|
2026-05-21 20:05:28 +00:00
|
|
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
|
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
|
|
|
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
|
|
|
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
|
|
|
|
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
|
|
|
|
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
|
|
|
|
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
|
|
|
|
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
2026-06-25 17:01:16 +00:00
|
|
|
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
2026-05-21 20:05:28 +00:00
|
|
|
* Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
2003-06-11 13:20:49 +00: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
|
2013-01-16 14:36:08 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2003-06-11 13:20:49 +00:00
|
|
|
* (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 19:55:30 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2003-06-11 13:20:49 +00:00
|
|
|
*/
|
2004-08-29 12:01:58 +00:00
|
|
|
|
2005-04-02 20:15:25 +00:00
|
|
|
/**
|
2009-05-06 15:45:50 +00:00
|
|
|
* \file htdocs/admin/fichinter.php
|
|
|
|
|
* \ingroup fichinter
|
2009-12-09 19:04:54 +00:00
|
|
|
* \brief Setup page of module Interventions
|
2008-09-04 23:44:36 +00:00
|
|
|
*/
|
2004-08-29 12:01:58 +00:00
|
|
|
|
2022-09-07 18:08:59 +00:00
|
|
|
// Load Dolibarr environment
|
2012-08-22 21:24:21 +00:00
|
|
|
require '../main.inc.php';
|
2024-11-04 22:53:20 +00:00
|
|
|
/**
|
|
|
|
|
* @var Conf $conf
|
|
|
|
|
* @var DoliDB $db
|
|
|
|
|
* @var HookManager $hookmanager
|
|
|
|
|
* @var Societe $mysoc
|
|
|
|
|
* @var Translate $langs
|
|
|
|
|
* @var User $user
|
|
|
|
|
*/
|
2026-05-21 20:05:28 +00:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
2024-11-04 22:53:20 +00:00
|
|
|
|
2018-05-26 16:41:16 +00:00
|
|
|
// Load translation files required by the page
|
|
|
|
|
$langs->loadLangs(array('admin', 'errors', 'interventions', 'other'));
|
2004-08-29 12:01:58 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!$user->admin) {
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
2004-08-29 12:01:58 +00:00
|
|
|
|
2020-09-16 17:39:50 +00:00
|
|
|
$action = GETPOST('action', 'aZ09');
|
2019-01-27 10:55:16 +00:00
|
|
|
$value = GETPOST('value', 'alpha');
|
2022-01-26 12:49:46 +00:00
|
|
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
|
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
$label = GETPOST('label', 'alpha');
|
|
|
|
|
$scandir = GETPOST('scan_dir', 'alpha');
|
2019-11-14 11:09:15 +00:00
|
|
|
$type = 'ficheinter';
|
2003-06-11 13:20:49 +00:00
|
|
|
|
2011-09-12 19:49:40 +00:00
|
|
|
|
2006-04-28 22:54:02 +00:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
2024-11-10 10:16:23 +00:00
|
|
|
$error = 0;
|
2017-06-01 10:11:45 +00:00
|
|
|
|
|
|
|
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($action == 'updateMask') {
|
2023-01-04 14:10:09 +00:00
|
|
|
$maskconst = GETPOST('maskconst', 'aZ09');
|
2019-11-14 11:09:15 +00:00
|
|
|
$maskvalue = GETPOST('maskvalue', 'alpha');
|
2024-09-18 01:27:25 +00:00
|
|
|
|
|
|
|
|
$res = 0;
|
|
|
|
|
|
2023-01-04 14:10:09 +00:00
|
|
|
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
|
2021-02-26 21:04:03 +00:00
|
|
|
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
|
|
|
|
}
|
2011-08-31 18:47:29 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2011-08-31 14:28:42 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!$error) {
|
2020-10-31 13:32:18 +00:00
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
|
|
|
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
|
|
|
}
|
2024-01-23 19:18:33 +00:00
|
|
|
} elseif ($action == 'specimen') { // For Intervention card
|
2019-11-14 11:09:15 +00:00
|
|
|
$modele = GETPOST('module', 'alpha');
|
2007-08-29 07:55:34 +00:00
|
|
|
|
|
|
|
|
$inter = new Fichinter($db);
|
|
|
|
|
$inter->initAsSpecimen();
|
|
|
|
|
|
2012-03-24 17:15:07 +00:00
|
|
|
// Search template files
|
2023-12-04 10:41:14 +00:00
|
|
|
$file = '';
|
|
|
|
|
$classname = '';
|
2019-11-14 11:09:15 +00:00
|
|
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
2021-02-26 21:04:03 +00:00
|
|
|
foreach ($dirmodels as $reldir) {
|
2020-10-31 13:32:18 +00:00
|
|
|
$file = dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0);
|
2021-02-26 21:04:03 +00:00
|
|
|
if (file_exists($file)) {
|
2012-03-24 17:15:07 +00:00
|
|
|
$classname = "pdf_".$modele;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-12 15:15:45 +00:00
|
|
|
if ($classname !== '') {
|
2012-08-22 21:11:24 +00:00
|
|
|
require_once $file;
|
2007-08-29 07:55:34 +00:00
|
|
|
|
2012-03-24 17:15:07 +00:00
|
|
|
$module = new $classname($db);
|
2024-03-24 20:36:04 +00:00
|
|
|
'@phan-var-force ModelePDFFicheinter $module';
|
2007-08-29 07:55:34 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($module->write_file($inter, $langs) > 0) {
|
2007-08-29 07:55:34 +00:00
|
|
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
|
|
|
|
|
return;
|
2020-05-21 07:35:30 +00:00
|
|
|
} else {
|
2015-10-28 18:28:18 +00:00
|
|
|
setEventMessages($module->error, $module->errors, 'errors');
|
|
|
|
|
dol_syslog($module->error, LOG_ERR);
|
2008-10-28 20:05:23 +00:00
|
|
|
}
|
2020-05-21 07:35:30 +00:00
|
|
|
} else {
|
2015-10-28 18:28:18 +00:00
|
|
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
2009-02-20 22:53:15 +00:00
|
|
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
2007-08-29 07:55:34 +00:00
|
|
|
}
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'set') {
|
|
|
|
|
// Activate a model
|
2012-04-03 15:00:45 +00:00
|
|
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'del') {
|
2012-04-03 15:00:45 +00:00
|
|
|
$ret = delDocumentModel($value, $type);
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($ret > 0) {
|
2025-08-06 17:25:15 +00:00
|
|
|
if (getDolGlobalString('FICHEINTER_ADDON_PDF') == "$value") {
|
2021-02-26 21:04:03 +00:00
|
|
|
dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
|
|
|
|
|
}
|
2008-09-04 23:44:36 +00:00
|
|
|
}
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'setdoc') {
|
|
|
|
|
// Set default model
|
|
|
|
|
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
|
2009-04-27 20:37:50 +00:00
|
|
|
// La constante qui a ete lue en avant du nouveau set
|
|
|
|
|
// on passe donc par une variable pour avoir un affichage coherent
|
2011-08-31 14:28:42 +00:00
|
|
|
$conf->global->FICHEINTER_ADDON_PDF = $value;
|
2008-09-04 23:44:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// On active le modele
|
2012-04-03 15:00:45 +00:00
|
|
|
$ret = delDocumentModel($value, $type);
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($ret > 0) {
|
2012-04-03 15:00:45 +00:00
|
|
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
2008-09-04 23:44:36 +00:00
|
|
|
}
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'setmod') {
|
2024-01-11 08:59:52 +00:00
|
|
|
// TODO Verify if the chosen numbering module can be activated
|
|
|
|
|
// by calling method canBeActivated
|
2006-07-30 01:55:08 +00:00
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'set_FICHINTER_FREE_TEXT') {
|
2020-09-17 23:29:17 +00:00
|
|
|
$freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
|
2019-07-18 16:19:51 +00:00
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
|
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2019-07-18 16:19:51 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!$error) {
|
2020-10-31 13:32:18 +00:00
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
|
|
|
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
|
|
|
}
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') {
|
2019-11-14 11:09:15 +00:00
|
|
|
$draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
|
2019-01-27 10:55:16 +00:00
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
2013-03-22 16:10:17 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2013-03-22 16:10:17 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!$error) {
|
2020-10-31 13:32:18 +00:00
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
|
|
|
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
|
|
|
}
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') {
|
2026-05-21 20:05:28 +00:00
|
|
|
$setFichInterPrintProducts = GETPOSTINT('value');
|
|
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", $setFichInterPrintProducts, 'yesno', 0, '', $conf->entity);
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2013-05-21 09:44:11 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (!$error) {
|
2020-10-31 13:32:18 +00:00
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
2026-05-21 20:05:28 +00:00
|
|
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
2020-10-31 13:32:18 +00:00
|
|
|
}
|
2016-07-25 15:18:13 +00:00
|
|
|
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
|
2026-05-21 20:05:28 +00:00
|
|
|
$setFichInterUseServiceDuration = GETPOSTINT('value');
|
|
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", $setFichInterUseServiceDuration, 'yesno', 0, '', $conf->entity);
|
2021-01-23 16:49:08 +00:00
|
|
|
if (!($res > 0)) {
|
2016-07-25 15:18:13 +00:00
|
|
|
$error++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!$error) {
|
|
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
2026-05-21 20:05:28 +00:00
|
|
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
2016-07-25 15:18:13 +00:00
|
|
|
}
|
2017-09-07 09:58:22 +00:00
|
|
|
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
|
2026-05-21 20:05:28 +00:00
|
|
|
$setFichInterWithoutDuration = GETPOSTINT('value');
|
|
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", $setFichInterWithoutDuration, 'yesno', 0, '', $conf->entity);
|
2021-01-23 16:49:08 +00:00
|
|
|
if (!($res > 0)) {
|
2020-10-31 13:32:18 +00:00
|
|
|
$error++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!$error) {
|
|
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
2026-05-21 20:05:28 +00:00
|
|
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
2020-10-31 13:32:18 +00:00
|
|
|
}
|
2017-09-07 13:31:19 +00:00
|
|
|
} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
|
2026-05-21 20:05:28 +00:00
|
|
|
$setFichInterDateWithoutHour = GETPOSTINT('value');
|
|
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", $setFichInterDateWithoutHour, 'yesno', 0, '', $conf->entity);
|
2021-01-23 16:49:08 +00:00
|
|
|
if (!($res > 0)) {
|
2020-10-31 13:32:18 +00:00
|
|
|
$error++;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-20 14:33:48 +00:00
|
|
|
if (!$error) {
|
|
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
2026-05-21 20:05:28 +00:00
|
|
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
2022-10-20 14:33:48 +00:00
|
|
|
}
|
|
|
|
|
} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") {
|
2026-05-21 20:05:28 +00:00
|
|
|
$setFichInterAllowOnlineSign = GETPOSTINT('value');
|
|
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", $setFichInterAllowOnlineSign, 'yesno', 0, '', $conf->entity);
|
2022-10-20 14:33:48 +00:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!$error) {
|
|
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
2026-05-21 20:05:28 +00:00
|
|
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
2022-10-20 14:33:48 +00:00
|
|
|
}
|
|
|
|
|
} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") {
|
2026-05-21 20:05:28 +00:00
|
|
|
$setFichInterAllowExternalDownload = GETPOSTINT('value');
|
|
|
|
|
$res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", $setFichInterAllowExternalDownload, 'yesno', 0, '', $conf->entity);
|
2022-10-20 14:33:48 +00:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-31 13:32:18 +00:00
|
|
|
if (!$error) {
|
|
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
2026-05-21 20:05:28 +00:00
|
|
|
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
2020-10-31 13:32:18 +00:00
|
|
|
}
|
2013-05-21 09:44:11 +00:00
|
|
|
}
|
|
|
|
|
|
2006-04-28 22:54:02 +00:00
|
|
|
|
2017-09-07 09:58:22 +00:00
|
|
|
|
2006-04-28 22:54:02 +00:00
|
|
|
/*
|
2011-08-31 18:47:29 +00:00
|
|
|
* View
|
2006-04-28 22:54:02 +00:00
|
|
|
*/
|
2003-06-11 13:20:49 +00:00
|
|
|
|
2019-11-14 11:09:15 +00:00
|
|
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
2012-03-24 17:15:07 +00:00
|
|
|
|
2024-06-08 12:53:14 +00:00
|
|
|
llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-fichinter');
|
2006-04-28 22:54:02 +00:00
|
|
|
|
2019-11-14 11:09:15 +00:00
|
|
|
$form = new Form($db);
|
2003-06-11 13:20:49 +00:00
|
|
|
|
2025-10-17 00:31:07 +00:00
|
|
|
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
2025-08-09 18:44:30 +00:00
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
|
2004-02-20 23:40:13 +00:00
|
|
|
|
|
|
|
|
|
2019-11-14 11:09:15 +00:00
|
|
|
$head = fichinter_admin_prepare_head();
|
2013-03-22 16:10:17 +00:00
|
|
|
|
2020-10-22 20:50:03 +00:00
|
|
|
print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
|
2013-03-22 16:10:17 +00:00
|
|
|
|
|
|
|
|
// Interventions numbering model
|
2006-07-30 01:55:08 +00:00
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
|
2006-07-30 01:55:08 +00:00
|
|
|
|
2021-06-12 23:27:04 +00:00
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2019-11-05 20:24:41 +00:00
|
|
|
print '<table class="noborder centpercent">';
|
2006-07-30 01:55:08 +00:00
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td width="100">'.$langs->trans("Name").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("Example").'</td>';
|
2010-02-24 23:29:46 +00:00
|
|
|
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
2013-05-07 20:04:08 +00:00
|
|
|
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
2006-07-30 01:55:08 +00:00
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
clearstatcache();
|
|
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
foreach ($dirmodels as $reldir) {
|
2012-03-24 17:15:07 +00:00
|
|
|
$dir = dol_buildpath($reldir."core/modules/fichinter/");
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (is_dir($dir)) {
|
2011-04-15 07:54:10 +00:00
|
|
|
$handle = opendir($dir);
|
2021-02-26 21:04:03 +00:00
|
|
|
if (is_resource($handle)) {
|
|
|
|
|
while (($file = readdir($handle)) !== false) {
|
|
|
|
|
if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) {
|
2011-04-15 07:54:10 +00:00
|
|
|
$file = $reg[1];
|
2019-01-27 10:55:16 +00:00
|
|
|
$classname = substr($file, 4);
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2013-03-22 16:10:17 +00:00
|
|
|
require_once $dir.$file.'.php';
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2023-12-04 10:41:14 +00:00
|
|
|
$module = new $file();
|
2014-09-25 10:07:11 +00:00
|
|
|
|
2024-08-17 17:32:52 +00:00
|
|
|
'@phan-var-force ModeleNumRefFicheinter $module';
|
|
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($module->isEnabled()) {
|
2013-03-22 16:10:17 +00:00
|
|
|
// Show modules according to features level
|
2023-11-27 11:24:18 +00:00
|
|
|
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
2021-02-26 21:04:03 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
2023-11-27 11:24:18 +00:00
|
|
|
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
|
2021-02-26 21:04:03 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
2014-09-25 10:07:11 +00:00
|
|
|
|
2017-05-31 23:53:55 +00:00
|
|
|
|
2024-08-17 17:32:52 +00:00
|
|
|
print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
|
2023-08-09 16:00:31 +00:00
|
|
|
print $module->info($langs);
|
2011-04-15 07:54:10 +00:00
|
|
|
print '</td>';
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2020-10-31 13:32:18 +00:00
|
|
|
// Show example of numbering model
|
|
|
|
|
print '<td class="nowrap">';
|
|
|
|
|
$tmp = $module->getExample();
|
2020-11-28 01:09:27 +00:00
|
|
|
if (preg_match('/^Error/', $tmp)) {
|
|
|
|
|
$langs->load("errors");
|
|
|
|
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
2021-02-26 21:04:03 +00:00
|
|
|
} elseif ($tmp == 'NotConfigured') {
|
2021-09-05 00:25:32 +00:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
2021-02-26 21:04:03 +00:00
|
|
|
} else {
|
|
|
|
|
print $tmp;
|
|
|
|
|
}
|
2020-10-31 13:32:18 +00:00
|
|
|
print '</td>'."\n";
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2019-12-12 09:31:08 +00:00
|
|
|
print '<td class="center">';
|
2025-08-06 20:01:32 +00:00
|
|
|
if (getDolGlobalString('FICHEINTER_ADDON') == $classname) {
|
2019-01-27 10:55:16 +00:00
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
2020-05-21 07:35:30 +00:00
|
|
|
} else {
|
2021-09-19 16:03:38 +00:00
|
|
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($classname).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
2011-04-15 07:54:10 +00:00
|
|
|
}
|
|
|
|
|
print '</td>';
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2019-11-14 11:09:15 +00:00
|
|
|
$ficheinter = new Fichinter($db);
|
2011-04-15 07:54:10 +00:00
|
|
|
$ficheinter->initAsSpecimen();
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2011-04-15 07:54:10 +00:00
|
|
|
// Info
|
2019-11-14 11:09:15 +00:00
|
|
|
$htmltooltip = '';
|
|
|
|
|
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
|
|
|
|
$nextval = $module->getNextValue($mysoc, $ficheinter);
|
2020-10-31 13:32:18 +00:00
|
|
|
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
|
|
|
|
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
|
|
|
|
if ($nextval) {
|
2021-02-26 21:04:03 +00:00
|
|
|
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
2020-10-31 13:32:18 +00:00
|
|
|
$nextval = $langs->trans($nextval);
|
2021-02-26 21:04:03 +00:00
|
|
|
}
|
2020-10-31 13:32:18 +00:00
|
|
|
$htmltooltip .= $nextval.'<br>';
|
|
|
|
|
} else {
|
|
|
|
|
$htmltooltip .= $langs->trans($module->error).'<br>';
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-12-12 09:31:08 +00:00
|
|
|
print '<td class="center">';
|
2025-02-08 00:49:29 +00:00
|
|
|
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
2011-04-15 07:54:10 +00:00
|
|
|
print '</td>';
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2011-04-15 07:54:10 +00:00
|
|
|
print '</tr>';
|
|
|
|
|
}
|
2008-09-04 23:44:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
2011-04-15 07:54:10 +00:00
|
|
|
closedir($handle);
|
2008-09-04 23:44:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
2006-07-30 01:55:08 +00:00
|
|
|
}
|
|
|
|
|
|
2021-06-12 23:27:04 +00:00
|
|
|
print '</table>';
|
|
|
|
|
print '</div>';
|
|
|
|
|
|
|
|
|
|
print '<br>';
|
2006-07-30 01:55:08 +00:00
|
|
|
|
|
|
|
|
|
2013-03-22 16:10:17 +00:00
|
|
|
/*
|
|
|
|
|
* Documents models for Interventions
|
|
|
|
|
*/
|
2006-07-30 01:55:08 +00:00
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
|
2003-06-11 13:20:49 +00:00
|
|
|
|
2006-04-28 22:54:02 +00:00
|
|
|
// Defini tableau def des modeles
|
2019-11-14 11:09:15 +00:00
|
|
|
$type = 'ficheinter';
|
2006-04-28 22:54:02 +00:00
|
|
|
$def = array();
|
|
|
|
|
$sql = "SELECT nom";
|
2019-11-14 11:09:15 +00:00
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
2020-09-19 21:11:38 +00:00
|
|
|
$sql .= " WHERE type = '".$db->escape($type)."'";
|
2025-10-02 08:56:12 +00:00
|
|
|
$sql .= " AND entity = ".((int) $conf->entity);
|
2019-11-14 11:09:15 +00:00
|
|
|
$resql = $db->query($sql);
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($resql) {
|
2006-04-28 22:54:02 +00:00
|
|
|
$i = 0;
|
2019-11-14 11:09:15 +00:00
|
|
|
$num_rows = $db->num_rows($resql);
|
2021-02-26 21:04:03 +00:00
|
|
|
while ($i < $num_rows) {
|
2006-04-28 22:54:02 +00:00
|
|
|
$array = $db->fetch_array($resql);
|
2024-04-27 20:01:34 +00:00
|
|
|
if (is_array($array)) {
|
|
|
|
|
array_push($def, $array[0]);
|
|
|
|
|
}
|
2006-04-28 22:54:02 +00:00
|
|
|
$i++;
|
|
|
|
|
}
|
2020-05-21 07:35:30 +00:00
|
|
|
} else {
|
2009-02-20 22:53:15 +00:00
|
|
|
dol_print_error($db);
|
2006-04-28 22:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-06-12 23:27:04 +00:00
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2019-11-05 20:24:41 +00:00
|
|
|
print '<table class="noborder centpercent">';
|
2004-12-10 20:04:59 +00:00
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td>'.$langs->trans("Name").'</td>';
|
2005-04-19 23:24:28 +00:00
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
2010-02-24 23:29:46 +00:00
|
|
|
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
|
2006-04-28 22:54:02 +00:00
|
|
|
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
2013-05-07 20:04:08 +00:00
|
|
|
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
2013-05-07 20:38:34 +00:00
|
|
|
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
|
2004-12-10 20:04:59 +00:00
|
|
|
print "</tr>\n";
|
2003-06-11 13:20:49 +00:00
|
|
|
|
|
|
|
|
clearstatcache();
|
|
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
foreach ($dirmodels as $reldir) {
|
2020-01-20 00:05:30 +00:00
|
|
|
$realpath = $reldir."core/modules/fichinter/doc";
|
|
|
|
|
$dir = dol_buildpath($realpath);
|
2011-04-15 07:54:10 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if (is_dir($dir)) {
|
2019-11-14 11:09:15 +00:00
|
|
|
$handle = opendir($dir);
|
2021-02-26 21:04:03 +00:00
|
|
|
if (is_resource($handle)) {
|
2024-03-09 01:43:57 +00:00
|
|
|
$filelist = array();
|
2021-02-26 21:04:03 +00:00
|
|
|
while (($file = readdir($handle)) !== false) {
|
2019-11-14 11:09:15 +00:00
|
|
|
$filelist[] = $file;
|
2014-09-25 10:07:11 +00:00
|
|
|
}
|
|
|
|
|
closedir($handle);
|
|
|
|
|
arsort($filelist);
|
2011-05-04 18:34:16 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
foreach ($filelist as $file) {
|
|
|
|
|
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
|
|
|
|
if (file_exists($dir.'/'.$file)) {
|
2020-10-31 13:32:18 +00:00
|
|
|
$name = substr($file, 4, dol_strlen($file) - 16);
|
|
|
|
|
$classname = substr($file, 0, dol_strlen($file) - 12);
|
|
|
|
|
|
|
|
|
|
require_once $dir.'/'.$file;
|
|
|
|
|
$module = new $classname($db);
|
|
|
|
|
|
2024-08-17 17:32:52 +00:00
|
|
|
'@phan-var-force ModelePDFFicheinter $module';
|
|
|
|
|
|
2020-10-31 13:32:18 +00:00
|
|
|
$modulequalified = 1;
|
2023-11-27 11:24:18 +00:00
|
|
|
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
2021-02-26 21:04:03 +00:00
|
|
|
$modulequalified = 0;
|
|
|
|
|
}
|
2023-11-27 11:24:18 +00:00
|
|
|
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
|
2021-02-26 21:04:03 +00:00
|
|
|
$modulequalified = 0;
|
|
|
|
|
}
|
2020-10-31 13:32:18 +00:00
|
|
|
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($modulequalified) {
|
2020-10-31 13:32:18 +00:00
|
|
|
print '<tr class="oddeven"><td width="100">';
|
2023-12-04 10:41:14 +00:00
|
|
|
print(empty($module->name) ? $name : $module->name);
|
2020-10-31 13:32:18 +00:00
|
|
|
print "</td><td>\n";
|
2021-02-26 21:04:03 +00:00
|
|
|
if (method_exists($module, 'info')) {
|
2024-08-17 17:32:52 +00:00
|
|
|
print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
|
2021-02-26 21:04:03 +00:00
|
|
|
} else {
|
|
|
|
|
print $module->description;
|
|
|
|
|
}
|
2020-10-31 13:32:18 +00:00
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Active
|
2021-02-26 21:04:03 +00:00
|
|
|
if (in_array($name, $def)) {
|
2020-10-31 13:32:18 +00:00
|
|
|
print "<td align=\"center\">\n";
|
2021-09-19 12:41:46 +00:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
2020-10-31 13:32:18 +00:00
|
|
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
|
|
|
|
print '</a>';
|
|
|
|
|
print "</td>";
|
|
|
|
|
} else {
|
|
|
|
|
print "<td align=\"center\">\n";
|
2021-09-19 12:41:46 +00:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
2020-10-31 13:32:18 +00:00
|
|
|
print "</td>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Default
|
|
|
|
|
print "<td align=\"center\">";
|
2025-08-06 17:25:15 +00:00
|
|
|
if (getDolGlobalString('FICHEINTER_ADDON_PDF') == "$name") {
|
2020-10-31 13:32:18 +00:00
|
|
|
print img_picto($langs->trans("Default"), 'on');
|
|
|
|
|
} else {
|
2021-09-19 16:03:38 +00:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
2020-10-31 13:32:18 +00:00
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Info
|
|
|
|
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
|
|
|
|
|
|
|
|
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
|
|
|
|
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
|
|
|
|
|
print '<td class="center">';
|
2025-02-08 00:49:29 +00:00
|
|
|
print $form->textwithpicto('', $htmltooltip, -1, 'info');
|
2020-10-31 13:32:18 +00:00
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Preview
|
|
|
|
|
print '<td class="center">';
|
2021-02-26 21:04:03 +00:00
|
|
|
if ($module->type == 'pdf') {
|
2026-06-25 17:01:16 +00:00
|
|
|
print '<a href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'specimen', 'module' => $name], true).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
2020-10-31 13:32:18 +00:00
|
|
|
} else {
|
2025-01-08 16:45:28 +00:00
|
|
|
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
|
2020-10-31 13:32:18 +00:00
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '</tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-04-15 07:54:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-06-11 13:20:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
2021-06-12 23:27:04 +00:00
|
|
|
print '</div>';
|
2008-06-09 18:55:24 +00:00
|
|
|
print "<br>";
|
|
|
|
|
|
2013-03-22 16:10:17 +00:00
|
|
|
/*
|
|
|
|
|
* Other options
|
|
|
|
|
*/
|
|
|
|
|
|
2019-01-27 10:55:16 +00:00
|
|
|
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
2021-06-12 23:27:04 +00:00
|
|
|
|
|
|
|
|
print '<div class="div-table-responsive-no-min">';
|
2019-11-05 20:24:41 +00:00
|
|
|
print '<table class="noborder centpercent">';
|
2008-06-09 18:55:24 +00:00
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td>'.$langs->trans("Parameter").'</td>';
|
2025-01-24 12:12:48 +00:00
|
|
|
print '<td align="center" width="60"></td>';
|
2008-06-09 18:55:24 +00:00
|
|
|
print "<td> </td>\n";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
2019-11-14 11:09:15 +00:00
|
|
|
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
|
|
|
|
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
2019-07-18 16:19:51 +00:00
|
|
|
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
2021-02-26 21:04:03 +00:00
|
|
|
foreach ($substitutionarray as $key => $val) {
|
|
|
|
|
$htmltext .= $key.'<br>';
|
|
|
|
|
}
|
2019-11-14 11:09:15 +00:00
|
|
|
$htmltext .= '</i>';
|
2019-07-18 16:19:51 +00:00
|
|
|
|
|
|
|
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
2019-12-18 22:12:31 +00:00
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
2019-07-18 16:19:51 +00:00
|
|
|
print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
|
|
|
|
|
print '<tr class="oddeven"><td colspan="2">';
|
|
|
|
|
print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
2019-11-14 11:09:15 +00:00
|
|
|
$variablename = 'FICHINTER_FREE_TEXT';
|
2023-10-24 15:00:13 +00:00
|
|
|
if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
|
2022-06-21 18:25:25 +00:00
|
|
|
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
2020-05-21 07:35:30 +00:00
|
|
|
} else {
|
2020-10-31 13:32:18 +00:00
|
|
|
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
2022-06-21 21:39:31 +00:00
|
|
|
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
2020-10-31 13:32:18 +00:00
|
|
|
print $doleditor->Create();
|
2019-07-18 16:19:51 +00:00
|
|
|
}
|
|
|
|
|
print '</td><td class="right">';
|
2021-08-24 15:04:17 +00:00
|
|
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
2019-07-18 16:19:51 +00:00
|
|
|
print "</td></tr>\n";
|
|
|
|
|
print '</form>';
|
2009-12-09 19:04:54 +00:00
|
|
|
|
2008-06-09 18:55:24 +00:00
|
|
|
//Use draft Watermark
|
|
|
|
|
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
2019-12-18 22:12:31 +00:00
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
2008-06-09 18:55:24 +00:00
|
|
|
print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
|
2017-04-14 11:02:29 +00:00
|
|
|
print '<tr class="oddeven"><td>';
|
2017-10-31 10:17:44 +00:00
|
|
|
print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
2017-04-27 15:16:19 +00:00
|
|
|
print '</td><td>';
|
2022-07-24 16:59:07 +00:00
|
|
|
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
|
2019-01-22 10:46:12 +00:00
|
|
|
print '</td><td class="right">';
|
2021-08-24 15:04:17 +00:00
|
|
|
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
2008-06-09 18:55:24 +00:00
|
|
|
print "</td></tr>\n";
|
2015-09-29 16:27:39 +00:00
|
|
|
print '</form>';
|
2026-05-21 20:05:28 +00:00
|
|
|
|
|
|
|
|
// Print products on fichinter
|
|
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
print '<td width="80%">'.$langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
print '<td class="center">';
|
|
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('FICHINTER_PRINT_PRODUCTS');
|
|
|
|
|
} else {
|
|
|
|
|
if (getDolGlobalString('FICHINTER_PRINT_PRODUCTS')) {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
|
|
|
} else {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
|
|
|
}
|
|
|
|
|
print '</a>';
|
2021-02-26 21:04:03 +00:00
|
|
|
}
|
2026-05-21 20:05:28 +00:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
2016-07-25 15:18:13 +00:00
|
|
|
// Use services duration
|
2017-04-24 14:36:58 +00:00
|
|
|
print '<tr class="oddeven">';
|
2026-05-21 20:05:28 +00:00
|
|
|
print '<td width="80%">'.$langs->trans("UseServicesDurationOnFichinter").'</td>';
|
|
|
|
|
print '<td> </td>';
|
2019-12-12 09:31:08 +00:00
|
|
|
print '<td class="center">';
|
2026-05-21 20:05:28 +00:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('FICHINTER_USE_SERVICE_DURATION');
|
|
|
|
|
} else {
|
|
|
|
|
if (getDolGlobalString('FICHINTER_USE_SERVICE_DURATION')) {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
|
|
|
} else {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
|
|
|
}
|
|
|
|
|
print '</a>';
|
|
|
|
|
}
|
2016-07-25 15:18:13 +00:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
2026-05-21 20:05:28 +00:00
|
|
|
|
2017-09-07 09:58:22 +00:00
|
|
|
// Use duration
|
|
|
|
|
print '<tr class="oddeven">';
|
2026-05-21 20:05:28 +00:00
|
|
|
print '<td width="80%">'.$langs->trans("UseDurationOnFichinter").'</td>';
|
|
|
|
|
print '<td> </td>';
|
2019-12-12 09:31:08 +00:00
|
|
|
print '<td class="center">';
|
2026-05-21 20:05:28 +00:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('FICHINTER_WITHOUT_DURATION');
|
|
|
|
|
} else {
|
|
|
|
|
if (getDolGlobalString('FICHINTER_WITHOUT_DURATION')) {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
|
|
|
} else {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
|
|
|
}
|
|
|
|
|
print '</a>';
|
|
|
|
|
}
|
2017-09-07 09:58:22 +00:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
2026-05-21 20:05:28 +00:00
|
|
|
|
|
|
|
|
// Use date without hour
|
2017-09-07 13:31:19 +00:00
|
|
|
print '<tr class="oddeven">';
|
2026-05-21 20:05:28 +00:00
|
|
|
print '<td width="80%">'.$langs->trans("UseDateWithoutHourOnFichinter").'</td>';
|
|
|
|
|
print '<td> </td>';
|
2019-12-12 09:31:08 +00:00
|
|
|
print '<td class="center">';
|
2026-05-21 20:05:28 +00:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('FICHINTER_DATE_WITHOUT_HOUR');
|
|
|
|
|
} else {
|
|
|
|
|
if (getDolGlobalString('FICHINTER_DATE_WITHOUT_HOUR')) {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
|
|
|
} else {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
|
|
|
}
|
|
|
|
|
print '</a>';
|
|
|
|
|
}
|
2017-09-07 13:31:19 +00:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
2026-05-21 20:05:28 +00:00
|
|
|
|
2022-10-20 16:54:45 +00:00
|
|
|
// Allow online signing
|
2022-10-20 14:33:48 +00:00
|
|
|
print '<tr class="oddeven">';
|
2026-05-21 20:05:28 +00:00
|
|
|
print '<td width="80%">'.$langs->trans("AllowOnlineSign").'</td>';
|
|
|
|
|
print '<td> </td>';
|
2022-10-20 14:33:48 +00:00
|
|
|
print '<td class="center">';
|
2026-05-21 20:05:28 +00:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('FICHINTER_ALLOW_ONLINE_SIGN');
|
|
|
|
|
} else {
|
|
|
|
|
if (getDolGlobalString('FICHINTER_ALLOW_ONLINE_SIGN')) {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
|
|
|
} else {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
|
|
|
}
|
|
|
|
|
print '</a>';
|
|
|
|
|
}
|
2022-10-20 14:33:48 +00:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
2026-05-21 20:05:28 +00:00
|
|
|
|
2022-10-20 14:33:48 +00:00
|
|
|
// Allow external download
|
|
|
|
|
print '<tr class="oddeven">';
|
2026-05-21 20:05:28 +00:00
|
|
|
print '<td width="80%">'.$langs->trans("AllowExternalDownload").'</td>';
|
|
|
|
|
print '<td> </td>';
|
2022-10-20 14:33:48 +00:00
|
|
|
print '<td class="center">';
|
2026-05-21 20:05:28 +00:00
|
|
|
if ($conf->use_javascript_ajax) {
|
|
|
|
|
print ajax_constantonoff('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD');
|
|
|
|
|
} else {
|
|
|
|
|
if (getDolGlobalString('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD')) {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=0">';
|
|
|
|
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
|
|
|
} else {
|
|
|
|
|
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=1">';
|
|
|
|
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
|
|
|
}
|
|
|
|
|
print '</a>';
|
|
|
|
|
}
|
2022-10-20 14:33:48 +00:00
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
2017-09-07 13:31:19 +00:00
|
|
|
|
2008-06-09 18:55:24 +00:00
|
|
|
print '</table>';
|
2021-06-12 23:27:04 +00:00
|
|
|
print '</div>';
|
2008-06-09 18:55:24 +00:00
|
|
|
|
|
|
|
|
print '<br>';
|
2003-06-11 13:20:49 +00:00
|
|
|
|
2018-07-28 16:03:14 +00:00
|
|
|
// End of page
|
2015-12-07 09:56:37 +00:00
|
|
|
llxFooter();
|
2003-06-11 13:20:49 +00:00
|
|
|
$db->close();
|