* GPL v3+ */ $res = 0; if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; if (!$res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; dol_include_once('/eplan/lib/eplan.lib.php'); $langs->loadLangs(array('admin', 'eplan@eplan')); if (!$user->admin && !$user->hasRight('eplan', 'admin')) { accessforbidden(); } $action = GETPOST('action', 'aZ09'); if ($action == 'save' && $user->admin) { $pwa_url = GETPOST('EPLAN_PWA_URL', 'alpha'); $pwa_url = rtrim($pwa_url, '/'); dolibarr_set_const($db, 'EPLAN_PWA_URL', $pwa_url, 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("EplanSettingsSaved"), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']); exit; } $page_name = "EplanSetup"; llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-eplan page-admin-setup'); $head = eplanAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $langs->trans("EplanSetup"), -1, 'fa-drafting-compass'); $pwa_url = getDolGlobalString('EPLAN_PWA_URL'); print '
'.$langs->trans("EplanOpenPwaDesc").'
'; print ''.$langs->trans("EplanInstallHint").'
'; print '| '.$langs->trans("EplanAbout").' | |
| '.$langs->trans("EplanAboutText").' | |
| '.$langs->trans("EplanFeatures").' | |
| '; print $langs->trans("EplanFeature".$i).' |