dolibarr 21.0.0-alpha
websiteaccount.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
33{
34 global $db, $langs, $conf;
35
36 $h = 0;
37 $head = array();
38
39 $head[$h][0] = DOL_URL_ROOT.'/website/websiteaccount_card.php?id='.$object->id;
40 $head[$h][1] = $langs->trans("WebsiteAccount");
41 $head[$h][2] = 'card';
42 $h++;
43
44 /*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) {
45 $nbNote = 0;
46 if(!empty($object->fields['note_private'])) $nbNote++;
47 if(!empty($object->fields['note_public'])) $nbNote++;
48 $head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id;
49 $head[$h][1] = $langs->trans('Notes');
50 if ($nbNote > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
51 $head[$h][2] = 'note';
52 $h++;
53 }*/
54
55 /*
56 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
57 require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
58 $upload_dir = $conf->monmodule->dir_output . "/websiteaccount/" . dol_sanitizeFileName($object->ref);
59 $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
60 $nbLinks=Link::count($db, $object->element, $object->id);
61 $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id;
62 $head[$h][1] = $langs->trans('Documents');
63 if (($nbFiles+$nbLinks) > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.($nbFiles+$nbLinks).'</span>' : '');
64 $head[$h][2] = 'document';
65 $h++;
66
67 $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_agenda.php", 1).'?id='.$object->id;
68 $head[$h][1] = $langs->trans("Events");
69 $head[$h][2] = 'agenda';
70 $h++;
71 */
72
73 // Show more tabs from modules
74 // Entries must be declared in modules descriptor with line
75 //$this->tabs = array(
76 // 'entity:+tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
77 //); // to add new tab
78 //$this->tabs = array(
79 // 'entity:-tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
80 //); // to remove a tab
81 complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website');
82
83 complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website', 'remove');
84
85 return $head;
86}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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).
websiteaccountPrepareHead($object)
Prepare array of tabs for SocieteAccount.