dolibarr 24.0.0-beta
triggerhistory_card.php
1<?php
2/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2025 Alice Adminson <myemail@mycompany.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
27// Load Dolibarr environment
28require '../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
41require_once DOL_DOCUMENT_ROOT.'/webhook/class/triggerhistory.class.php';
42require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_triggerhistory.lib.php';
43
44
45// Load translation files required by the page
46$langs->loadLangs(array("webhook@webhook", "other", "admin"));
47
48// Get parameters
49$id = GETPOSTINT('id');
50$ref = GETPOST('ref', 'alpha');
51$lineid = GETPOSTINT('lineid');
52
53$action = GETPOST('action', 'aZ09');
54$confirm = GETPOST('confirm', 'alpha');
55$cancel = GETPOST('cancel', 'alpha');
56$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
57$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
58$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
59$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
60$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
61
62// Initialize a technical objects
64$diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id;
65$hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array
66$soc = null;
67
68// Fetch optionals attributes and labels
69$extrafields->fetch_name_optionals_label($object->table_element);
70
71
72$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
73
74// Initialize array of search criteria
75$search_all = trim(GETPOST("search_all", 'alpha'));
76$search = array();
77foreach ($object->fields as $key => $val) {
78 if (GETPOST('search_'.$key, 'alpha')) {
79 $search[$key] = GETPOST('search_'.$key, 'alpha');
80 }
81}
82
83if (empty($action) && empty($id) && empty($ref)) {
84 $action = 'view';
85}
86
87// Load object
88include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
89
90// There is several ways to check permission.
91// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
92$permissiontoread = $permissiontoadd = $permissiontodelete = $permissionnote = $permissiondellink = (!empty($user->admin) ? 1 : 0);
93
94$upload_dir = $conf->webhook->multidir_output[!empty($object->entity) ? $object->entity : 1].'/triggerhistory';
95
96// Security check (enable the most restrictive one)
97//if ($user->socid > 0) accessforbidden();
98//if ($user->socid > 0) $socid = $user->socid;
99//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
100//restrictedArea($user, $object->module, $object, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
101if (!isModEnabled($object->module)) {
102 accessforbidden("Module ".$object->module." not enabled");
103}
104if (!$permissiontoread) {
106}
107
108$error = 0;
109
110
111/*
112 * Actions
113 */
114
115$parameters = array();
116$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
117if ($reshook < 0) {
118 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
119}
120
121if (empty($reshook)) {
122 $backurlforlist = dol_buildpath('/webhook/history_list.php', 1);
123
124 if (empty($backtopage) || ($cancel && empty($id))) {
125 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
126 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
127 $backtopage = $backurlforlist;
128 } else {
129 $backtopage = dol_buildpath('/webhook/history_card.php', 1).'?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
130 }
131 }
132 }
133
134 $triggermodname = 'WEBHOOK_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
135
136 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
137 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
138
139 // Actions when linking object each other
140 include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
141
142 // Actions when printing a doc from card
143 include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
144
145 // Action to move up and down lines of object
146 //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
147
148 // Action to build doc
149 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
150
151 if ($action == 'set_thirdparty' && $permissiontoadd) {
152 $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', null, 'date', '', $user, $triggermodname);
153 }
154 if ($action == 'classin' && $permissiontoadd) {
155 $object->setProject(GETPOSTINT('projectid'));
156 }
157
158 // Actions to send emails
159 $triggersendname = 'WEBHOOK_MYOBJECT_SENTBYMAIL';
160 $autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
161 $trackid = 'triggerhistory'.$object->id;
162 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
163}
164
165
166
167
168/*
169 * View
170 */
171
172$form = new Form($db);
173$formfile = new FormFile($db);
174$formproject = new FormProjets($db);
175
176$title = $langs->trans("TriggerHistory")." - ".$langs->trans('Card');
177//$title = $object->ref." - ".$langs->trans('Card');
178if ($action == 'create') {
179 $title = $langs->trans("NewObject", $langs->transnoentitiesnoconv("TriggerHistory"));
180}
181$help_url = '';
182
183llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-webhook page-card');
184
185// Part to create
186if ($action == 'create') {
187 if (empty($permissiontoadd)) {
188 accessforbidden('NotEnoughPermissions', 0, 1);
189 }
190
191 print load_fiche_titre($title, '', $object->picto);
192
193 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
194 print '<input type="hidden" name="token" value="'.newToken().'">';
195 print '<input type="hidden" name="action" value="add">';
196 if ($backtopage) {
197 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
198 }
199 if ($backtopageforcancel) {
200 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
201 }
202 if ($dol_openinpopup) {
203 print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">';
204 }
205
206 print dol_get_fiche_head(array(), '');
207
208
209 print '<table class="border centpercent tableforfieldcreate">'."\n";
210
211 // Common attributes
212 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
213
214 // Other attributes
215 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
216
217 print '</table>'."\n";
218
219 print dol_get_fiche_end();
220
221 print $form->buttonsSaveCancel("Create");
222
223 print '</form>';
224
225 //dol_set_focus('input[name="ref"]');
226}
227
228// Part to edit record
229if (($id || $ref) && $action == 'edit') {
230 print load_fiche_titre($langs->trans(""), '', $object->picto);
231
232 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
233 print '<input type="hidden" name="token" value="'.newToken().'">';
234 print '<input type="hidden" name="action" value="update">';
235 print '<input type="hidden" name="id" value="'.$object->id.'">';
236 if ($backtopage) {
237 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
238 }
239 if ($backtopageforcancel) {
240 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
241 }
242
243 print dol_get_fiche_head();
244
245 print '<table class="border centpercent tableforfieldedit">'."\n";
246
247 // Common attributes
248 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
249
250 // Other attributes
251 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
252
253 print '</table>';
254
255 print dol_get_fiche_end();
256
257 print $form->buttonsSaveCancel();
258
259 print '</form>';
260}
261
262// Part to show record
263if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
264 $head = triggerhistoryPrepareHead($object);
265
266 print dol_get_fiche_head($head, 'card', $langs->trans(""), -1, $object->picto, 0, '', '', 0, '', 1);
267
268 $formconfirm = '';
269
270 // Confirmation to delete (using preloaded confirm popup)
271 if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
272 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteTriggereHistoryRecord'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
273 }
274 // Confirmation to delete line
275 if ($action == 'deleteline') {
276 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
277 }
278
279 // Clone confirmation
280 if ($action == 'clone') {
281 // Create an array for form
282 $formquestion = array();
283 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
284 }
285
286 // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...)
287 // if ($action == 'xxx') {
288 // $text = $langs->trans('ConfirmActionXxx', $object->ref);
289 // if (isModEnabled('notification')) {
290 // require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
291 // $notify = new Notify($db);
292 // $text .= '<br>';
293 // $text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object);
294 // }
295
296 // $formquestion = array();
297
298 // $forcecombo=0;
299 // if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
300 // $formquestion = array(
301 // // 'text' => $langs->trans("ConfirmClone"),
302 // // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
303 // // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
304 // // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
305 // );
306 // $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
307 // }
308
309 // Call Hook formConfirm
310 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
311 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
312 if (empty($reshook)) {
313 $formconfirm .= $hookmanager->resPrint;
314 } elseif ($reshook > 0) {
315 $formconfirm = $hookmanager->resPrint;
316 }
317
318 // Print form confirm
319 print $formconfirm;
320
321
322 // Object card
323 // ------------------------------------------------------------
324 $linkback = '<a href="'.dol_buildpath('/webhook/triggerhistory_list.php', 1).'?restore_lastsearch_values=1&mode=modulesetup'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
325
326 $morehtmlref = '<div class="refidno">';
327 /*
328 // Ref customer
329 $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
330 $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(getDolGlobalInt('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalInt('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
331 // Thirdparty
332 $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
333 if (!getDolGlobalInt('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
334 $morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
335 }
336 // Project
337 if (isModEnabled('project')) {
338 $langs->load("projects");
339 $morehtmlref .= '<br>';
340 if ($permissiontoadd) {
341 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
342 if ($action != 'classify') {
343 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
344 }
345 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
346 } else {
347 if (!empty($object->fk_project)) {
348 $proj = new Project($db);
349 $proj->fetch($object->fk_project);
350 $morehtmlref .= $proj->getNomUrl(1);
351 if ($proj->title) {
352 $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
353 }
354 }
355 }
356 }
357 */
358 $morehtmlref .= '</div>';
359
360
361 dol_banner_tab($object, 'id', $linkback, 1, 'rowid', '', $morehtmlref);
362
363
364 print '<div class="fichecenter">';
365 print '<div class="fichehalfleft">';
366 print '<div class="underbanner clearboth"></div>';
367 print '<table class="border centpercent tableforfield">'."\n";
368
369 // Common attributes
370 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
371 //unset($object->fields['fk_project']); // Hide field already shown in banner
372 //unset($object->fields['fk_soc']); // Hide field already shown in banner
373 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
374
375 // Other attributes. Fields from hook formObjectOptions and Extrafields.
376 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
377
378 print '</table>';
379 print '</div>';
380 print '</div>';
381
382 print '<div class="clearboth"></div>';
383
384 print dol_get_fiche_end();
385
386
387 /*
388 * Lines
389 */
390
391 if (!empty($object->table_element_line)) {
392 // Show object lines
393 $result = $object->getLinesArray();
394
395 print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST">
396 <input type="hidden" name="token" value="' . newToken().'">
397 <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
398 <input type="hidden" name="mode" value="">
399 <input type="hidden" name="page_y" value="">
400 <input type="hidden" name="id" value="' . $object->id.'">
401 ';
402
403 if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
404 include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
405 }
406
407 print '<div class="div-table-responsive-no-min">';
408 if (!empty($object->lines) || ($object->status == $object::STATUS_ERROR && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
409 print '<table id="tablelines" class="noborder noshadow" width="100%">';
410 }
411
412 if (!empty($object->lines)) {
413 $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1);
414 }
415
416 // Form to add new line
417 if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
418 if ($action != 'editline') {
419 // Add products/services form
420
421 $parameters = array();
422 $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
423 if ($reshook < 0) {
424 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
425 }
426 if (empty($reshook)) {
427 $object->formAddObjectLine(1, $mysoc, $soc);
428 }
429 }
430 }
431
432 if (!empty($object->lines) || ($object->status == $object::STATUS_ERROR && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
433 print '</table>';
434 }
435 print '</div>';
436
437 print "</form>\n";
438 }
439
440
441 // Buttons for actions
442
443 if ($action != 'presend' && $action != 'editline') {
444 print '<div class="tabsAction">'."\n";
445 $parameters = array();
446 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
447 if ($reshook < 0) {
448 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
449 }
450
451 if (empty($reshook)) {
452 /*// Send
453 if (empty($user->socid)) {
454 print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle');
455 }
456
457 // Back to draft
458 if ($object->status == $object::STATUS_SUCCESS) {
459 print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd);
460 }*/
461
462 // Modify
463 print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
464
465 /*// Validate
466 if ($object->status == $object::STATUS_ERROR) {
467 if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
468 print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd);
469 } else {
470 $langs->load("errors");
471 print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0);
472 }
473 }
474
475 // Clone
476 if ($permissiontoadd) {
477 print dolGetButtonAction('', $langs->trans('ToClone'), 'clone', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd);
478 }
479
480 // Disable / Enable
481 if ($permissiontoadd) {
482 if ($object->status == $object::STATUS_ENABLED) {
483 print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
484 } else {
485 print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
486 }
487 }
488 if ($permissiontoadd) {
489 if ($object->status == $object::STATUS_VALIDATED) {
490 print dolGetButtonAction('', $langs->trans('Cancel'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
491 } else {
492 print dolGetButtonAction('', $langs->trans('Re-Open'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
493 }
494 }
495 */
496
497 // Delete (with preloaded confirm popup)
498 $deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
499 $buttonId = 'action-delete-no-ajax';
500 if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
501 $deleteUrl = '';
502 $buttonId = 'action-delete';
503 }
504 $params = array();
505 print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
506 }
507 print '</div>'."\n";
508 }
509
510
511 // Select mail models is same action as presend
512 if (GETPOST('modelselected')) {
513 $action = 'presend';
514 }
515
516 if ($action != 'presend') {
517 print '<div class="fichecenter"><div class="fichehalfleft">';
518 print '<a name="builddoc"></a>'; // ancre
519
520 $includedocgeneration = 0;
521
522 // Show links to link elements
523 $tmparray = $form->showLinkToObjectBlock($object, array(), array('triggerhistory'), 1);
524 if (is_array($tmparray)) {
525 $linktoelem = $tmparray['linktoelem'];
526 $htmltoenteralink = $tmparray['htmltoenteralink'];
527 print $htmltoenteralink;
528 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
529 } else {
530 // backward compatibility
531 $somethingshown = $form->showLinkedObjectBlock($object, $tmparray);
532 }
533
534 print '</div><div class="fichehalfright">';
535
536 $MAXEVENT = 10;
537
538 $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/webhook/history_agenda.php', 1).'?id='.$object->id);
539
540 print '</div></div>';
541 }
542
543 // Presend form
544 $modelmail = 'triggerhistory';
545 $defaulttopic = 'InformationMessage';
546 $diroutput = $conf->webhook->dir_output;
547 $trackid = 'triggerhistory'.$object->id;
548
549 include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
550}
551
552// End of page
553llxFooter();
554$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage building of HTML components.
global $mysoc
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
triggerhistoryPrepareHead($object)
Prepare array of tabs for.