dolibarr 24.0.0-beta
webhook_triggerhistory.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2025 Alice Adminson <myemail@mycompany.com>
3 * Copyright (C) 2026 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
32{
33 global $db, $langs, $conf;
34
35 $langs->load("webhook@webhook");
36
37 $h = 0;
38 $head = array();
39
40 $head[$h][0] = dolBuildUrl(DOL_DOCUMENT_ROOT.'/webhook/triggerhistory_card.php', ['id' => $object->id]);
41 $head[$h][1] = $langs->trans("Card");
42 $head[$h][2] = 'card';
43 $h++;
44
45 if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) {
46 $nbNote = 0;
47 if (!empty($object->note_private)) {
48 $nbNote++;
49 }
50 if (!empty($object->note_public)) {
51 $nbNote++;
52 }
53 $head[$h][0] = dolBuildUrl(DOL_DOCUMENT_ROOT.'/webhook/triggerhistory_note.php', ['id' => $object->id]);
54 $head[$h][1] = $langs->trans('Notes');
55 if ($nbNote > 0) {
56 $head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
57 }
58 $head[$h][2] = 'note';
59 $h++;
60 }
61
62 // Show more tabs from modules
63 // Entries must be declared in modules descriptor with line
64 //$this->tabs = array(
65 // 'entity:+tabname:Title:@webhook:/webhook/mypage.php?id=__ID__'
66 //); // to add new tab
67 //$this->tabs = array(
68 // 'entity:-tabname:Title:@webhook:/webhook/mypage.php?id=__ID__'
69 //); // to remove a tab
70 complete_head_from_modules($conf, $langs, $object, $head, $h, 'triggerhistory@webhook');
71
72 complete_head_from_modules($conf, $langs, $object, $head, $h, 'triggerhistory@webhook', 'remove');
73
74 return $head;
75}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
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.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
triggerhistoryPrepareHead($object)
Prepare array of tabs for.