* Copyright (C) 2021 Dorian Laurent * * 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 * along with this program. If not, see . */ /** * \file partnership/admin/setup.php * \ingroup partnership * \brief Partnership setup page. */ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/partnership.lib.php'; //require_once "../class/myclass.class.php"; // Translations $langs->loadLangs(array("admin", "partnership")); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); $error = 0; // Security check if (!$user->admin) { accessforbidden(); } /* * Actions */ $nomessageinsetmoduleoptions = 1; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'setting') { require_once DOL_DOCUMENT_ROOT."/core/modules/modPartnership.class.php"; $modulemenu = (GETPOST('PARTNERSHIP_IS_MANAGED_FOR', 'alpha') == 'member') ? 'member' : 'thirdparty'; $res = dolibarr_set_const($db, "PARTNERSHIP_IS_MANAGED_FOR", $modulemenu, 'chaine', 0, '', $conf->entity); $partnership = new modPartnership($db); $error += $partnership->delete_tabs(); $error += $partnership->insert_tabs(); $error += $partnership->delete_menus(); $error += $partnership->insert_menus(); if (GETPOSTISSET("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL")) { dolibarr_set_const($db, "PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL", GETPOST("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL", 'int'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "PARTNERSHIP_BACKLINKS_TO_CHECK", GETPOST("PARTNERSHIP_BACKLINKS_TO_CHECK"), 'chaine', 0, '', $conf->entity); } if ($action) { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { setEventMessages($langs->trans("SetupNotError"), null, 'errors'); } header("Location: ".$_SERVER['PHP_SELF']); exit; } /* * View */ $title = $langs->trans('PartnershipSetup'); llxHeader('', $title); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); $head = partnershipAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $title, -1, 'partnership'); $form = new Form($db); // Module to manage partnership / services code $dirpartnership = array('/core/modules/partnership/'); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); /* * Other conf */ print '
'; print ''; print ''; print ''; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; //if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { print ''; print ''; print ''; print ''; //} print '
'.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").'
'.$langs->trans("PARTNERSHIP_IS_MANAGED_FOR").''; print ''; print ajax_combobox('select_PARTNERSHIP_IS_MANAGED_FOR'); print ''.$langs->trans("partnershipforthirdpartyormember").'
'.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").''; $dnbdays = '30'; $backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays; print ''; print ''.$dnbdays.'
'; print '
'; print '
'; print load_fiche_titre($langs->trans("ReferingWebsiteCheck"), '', ''); print ''.$langs->trans("ReferingWebsiteCheckDesc").'
'; print '
'; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").'
'.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; $backlinks = (empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); print ''; print 'dolibarr.org|dolibarr.fr|dolibarr.es
'; print '
'; print '
'; print ''; print '
'; print '
'; // End of page llxFooter(); $db->close();