28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
36$langs->loadLangs(array(
"admin",
"members"));
38$action =
GETPOST(
'action',
'aZ09');
40$defaultoppstatus =
getDolGlobalInt(
'PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD');
42$visibility =
GETPOST(
'PROJET_VISIBILITY',
'alpha');
55if ($action ==
'setPROJECT_ENABLE_PUBLIC') {
63if ($action ==
'update') {
64 $public =
GETPOST(
'PROJECT_ENABLE_PUBLIC');
65 $defaultoppstatus =
GETPOST(
'PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD',
'int');
66 $res =
dolibarr_set_const($db,
"PROJET_VISIBILITY", $visibility,
'chaine', 0,
'', $conf->entity);
68 $res =
dolibarr_set_const($db,
"PROJECT_ENABLE_PUBLIC", $public,
'chaine', 0,
'', $conf->entity);
69 $res =
dolibarr_set_const($db,
"PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD", $defaultoppstatus,
'chaine', 0,
'', $conf->entity);
90$title = $langs->trans(
"ProjectsSetup");
95$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
102print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
103print
'<input type="hidden" name="action" value="update">';
104print
'<input type="hidden" name="token" value="'.newToken().
'">';
109print
'<span class="opacitymedium">'.$langs->trans(
"LeadPublicFormDesc").
'</span><br><br>';
113$enabledisablehtml = $langs->trans(
"EnablePublicLeadForm").
' ';
116 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setPROJECT_ENABLE_PUBLIC&token='.newToken().
'&value=1'.$param.
'">';
117 $enabledisablehtml .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
118 $enabledisablehtml .=
'</a>';
121 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setPROJECT_ENABLE_PUBLIC&token='.newToken().
'&value=0'.$param.
'">';
122 $enabledisablehtml .=
img_picto($langs->trans(
"Activated"),
'switch_on');
123 $enabledisablehtml .=
'</a>';
125print $enabledisablehtml;
126print
'<input type="hidden" id="PROJECT_ENABLE_PUBLIC" name="PROJECT_ENABLE_PUBLIC" value="'.(!
getDolGlobalString(
'PROJECT_ENABLE_PUBLIC') ? 0 : 1).
'">';
133 print
'<div class="div-table-responsive-no-min">';
134 print
'<table class="noborder centpercent">';
136 print
'<tr class="liste_titre">';
137 print
'<td>'.$langs->trans(
"Parameter").
'</td>';
138 print
'<td class="right">'.$langs->trans(
"Value").
'</td>';
142 print
'<tr class="oddeven drag" id="trforcetype"><td>';
143 print $langs->trans(
"DefaultOpportunityStatus");
144 print
'</td><td class="right">';
145 print $formproject->selectOpportunityStatus(
'PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD', GETPOSTISSET(
'PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD') ?
GETPOST(
'PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD',
'int') : $defaultoppstatus, 1, 0, 0, 0,
'', 0, 1);
146 print
"</td></tr>\n";
150 $arrayofchoices = array(
'0' => $langs->trans(
"AssignedContacts"),
'1' => $langs->trans(
"Everyone"));
151 print
'<tr class="oddeven drag"><td>';
152 print $langs->trans(
"Visibility");
153 print
'</td><td class="right">';
154 print $form->selectarray(
'PROJET_VISIBILITY', $arrayofchoices,
getDolGlobalInt(
'PROJET_VISIBILITY'), 0);
155 print
"</td></tr>\n";
160 print
'<div class="center">';
161 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
173 print
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
'BlankSubscriptionForm').
'</span><br>';
174 if (isModEnabled(
'multicompany')) {
175 $entity_qr =
'?entity='.$conf->entity;
181 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
182 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
185 print
'<div class="urllink">';
186 print
'<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.
'/public/project/new.php'.$entity_qr.
'">';
187 print
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/project/new.php'.$entity_qr.
'">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
project_admin_prepare_head()
Prepare array with list of tabs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.