27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
29require_once DOL_DOCUMENT_ROOT.
'/webhook/lib/webhook.lib.php';
40$langs->loadLangs(array(
"admin",
"webhook"));
43$hookmanager->initHooks(array(
'webhooksetup',
'globalsetup'));
51$action =
GETPOST(
'action',
'aZ09');
52$backtopage =
GETPOST(
'backtopage',
'alpha');
53$modulepart =
GETPOST(
'modulepart',
'aZ09');
55$value =
GETPOST(
'value',
'alpha');
56$label =
GETPOST(
'label',
'alpha');
57$scandir =
GETPOST(
'scan_dir',
'alpha');
67if (!class_exists(
'FormSetup')) {
68 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
73$setupnotempty = count($formSetup->items);
80include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
82if ($action ==
'updateMask') {
83 $maskconst =
GETPOST(
'maskconst',
'aZ09');
84 $maskvalue =
GETPOST(
'maskvalue',
'alpha');
86 if ($maskconst && preg_match(
'/_MASK$/', $maskconst)) {
98} elseif ($action ==
'setmod') {
100 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
101 if (!empty($tmpobjectkey)) {
102 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
"_ADDON";
105} elseif ($action ==
'set') {
108} elseif ($action ==
'del') {
111 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
112 if (!empty($tmpobjectkey)) {
113 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
119} elseif ($action ==
'setdoc') {
121 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
122 if (!empty($tmpobjectkey)) {
123 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
127 $conf->global->$constforval = $value;
130} elseif ($action ==
'unsetdoc') {
131 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
132 if (!empty($tmpobjectkey)) {
133 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
145$page_name =
"WebhookSetup";
147llxHeader(
'', $langs->trans($page_name), $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-webhook');
150$linkback =
'<a href="'.($backtopage ? $backtopage : 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>';
161print
'<span class="opacitymedium">'.$langs->trans(
"WebhookSetupPage", $langs->transnoentitiesnoconv(
"Targets")).
'...</span><br><br>';
164if ($action ==
'edit') {
165 print $formSetup->generateOutput(
true);
168 if (!empty($formSetup->items)) {
169 print $formSetup->generateOutput();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
webhookAdminPrepareHead()
Prepare admin pages header.