28require_once
"../../main.inc.php";
29require_once DOL_DOCUMENT_ROOT .
"/core/lib/admin.lib.php";
30require_once DOL_DOCUMENT_ROOT .
"/webportal/lib/webportal.lib.php";
41$langs->loadLangs(array(
"admin",
"webportal",
"website"));
44$hookmanager->initHooks(array(
'webportalsetup',
'globalsetup'));
47$action =
GETPOST(
'action',
'aZ09');
48$backtopage =
GETPOST(
'backtopage',
'alpha');
49$modulepart =
GETPOST(
'modulepart',
'aZ09');
51$value =
GETPOST(
'value',
'alpha');
52$label =
GETPOST(
'label',
'alpha');
53$scandir =
GETPOST(
'scan_dir',
'alpha');
67if (!class_exists(
'FormSetup')) {
68 require_once DOL_DOCUMENT_ROOT .
'/core/class/html.formsetup.class.php';
76$userList = $formSetup->form->select_dolusers(
getDolGlobalInt(
'WEBPORTAL_USER_LOGGED'),
'WEBPORTAL_USER_LOGGED', 1,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'', 1, 2);
78$item = $formSetup->newItem(
'WEBPORTAL_USER_LOGGED');
79$item->setAsSelect($userList);
81$item->helpText = $langs->transnoentities(
'WebPortalUserLoggedHelp');
88$item = $formSetup->newItem(
'WEBPORTAL_ROOT_URL')->setAsString();
89$item->nameText = $langs->transnoentities(
'UrlPublicInterfaceLabelAdmin');
90$item->fieldAttr = array(
'placeholder' =>
'https://');
91$item->helpText = $langs->transnoentities(
'UrlPublicInterfaceHelpAdmin');
92require_once __DIR__ .
'/../class/context.class.php';
97$formSetup->newItem(
'WEBPORTAL_TITLE')->defaultFieldValue =
getDolGlobalString(
'MAIN_INFO_SOCIETE_NOM');
101if (isModEnabled(
'propal')) {
102 $formSetup->newItem(
'WEBPORTAL_PROPAL_LIST_ACCESS')->setAsYesNo();
106if (isModEnabled(
'order')) {
107 $formSetup->newItem(
'WEBPORTAL_ORDER_LIST_ACCESS')->setAsYesNo();
111if (isModEnabled(
'invoice')) {
112 $formSetup->newItem(
'WEBPORTAL_INVOICE_LIST_ACCESS')->setAsYesNo();
116if (isModEnabled(
'partnership')) {
117 $access_list = array(
118 'hidden' => $langs->trans(
'WebPortalAccessHidden'),
119 'visible' => $langs->trans(
'WebPortalAccessVisible'),
121 $item = $formSetup->newItem(
'WEBPORTAL_PARTNERSHIP_CARD_ACCESS');
122 $item->setAsSelect($access_list);
123 $item->helpText = $langs->transnoentities(
'WebPortalPartnerShipCardAccessHelp');
127if (isModEnabled(
'member')) {
128 $access_list = array(
129 'hidden' => $langs->trans(
'WebPortalAccessHidden'),
130 'visible' => $langs->trans(
'WebPortalAccessVisible'),
131 'edit' => $langs->trans(
'WebPortalAccessEdit'),
133 $item = $formSetup->newItem(
'WEBPORTAL_MEMBER_CARD_ACCESS');
134 $item->setAsSelect($access_list);
135 $item->helpText = $langs->transnoentities(
'WebPortalMemberCardAccessHelp');
139$setupnotempty += count($formSetup->items);
141$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
143$moduledir =
'webportal';
144$myTmpObjects = array();
145$myTmpObjects[
'webportal'] = array(
'label' =>
'WebPortal',
'includerefgeneration' => 0,
'includedocgeneration' => 0,
'class' =>
'WebPortal');
147$tmpobjectkey =
GETPOST(
'object',
'aZ09');
148if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) {
157include DOL_DOCUMENT_ROOT .
'/core/actions_setmoduleoptions.inc.php';
160if (empty($action) || $action ==
'update') {
169$form =
new Form($db);
172$title =
"WebPortalSetup";
174llxHeader(
'', $langs->trans($title), $help_url);
177$linkback =
'<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT .
'/admin/modules.php?restore_lastsearch_values=1') .
'">' . $langs->trans(
"BackToModuleList") .
'</a>';
188print
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
'WebPortalURL').
'</span><br>';
189if (isModEnabled(
'multicompany')) {
190 $entity_qr =
'?entity='.((int)
$conf->entity);
196$urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
197$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
200print
'<div class="urllink">';
201print
'<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.
'/public/webportal/index.php'.$entity_qr.
'">';
202print
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/webportal/index.php'.$entity_qr.
'">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
208print
info_admin($langs->trans(
"UserAccountForWebPortalAreInThirdPartyTabHelp"));
212if ($action ==
'edit') {
213 print $formSetup->generateOutput(
true);
215} elseif (!empty($formSetup->items)) {
216 print $formSetup->generateOutput();
217 print
'<div class="tabsAction">';
218 print
'<a class="butAction" href="' . $_SERVER[
"PHP_SELF"] .
'?action=edit&token=' .
newToken() .
'">' . $langs->trans(
"Modify") .
'</a>';
221 print
'<br>' . $langs->trans(
"NothingToSetup");
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
webportalAdminPrepareHead()
Prepare admin pages header.