dolibarr
20.0.0
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_20.0
htdocs
website
lib
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
*
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
31
function
websiteaccountPrepareHead
(
$object
)
32
{
33
global $db, $langs, $conf;
34
35
$h = 0;
36
$head = array();
37
38
$head[$h][0] = DOL_URL_ROOT.
'/website/websiteaccount_card.php?id='
.
$object
->id;
39
$head[$h][1] = $langs->trans(
"WebsiteAccount"
);
40
$head[$h][2] =
'card'
;
41
$h++;
42
43
/*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) {
44
$nbNote = 0;
45
if(!empty($object->fields['note_private'])) $nbNote++;
46
if(!empty($object->fields['note_public'])) $nbNote++;
47
$head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id;
48
$head[$h][1] = $langs->trans('Notes');
49
if ($nbNote > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
50
$head[$h][2] = 'note';
51
$h++;
52
}*/
53
54
/*
55
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
56
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
57
$upload_dir = $conf->monmodule->dir_output . "/websiteaccount/" . dol_sanitizeFileName($object->ref);
58
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
59
$nbLinks=Link::count($db, $object->element, $object->id);
60
$head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id;
61
$head[$h][1] = $langs->trans('Documents');
62
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.($nbFiles+$nbLinks).'</span>' : '');
63
$head[$h][2] = 'document';
64
$h++;
65
66
$head[$h][0] = dol_buildpath("/monmodule/websiteaccount_agenda.php", 1).'?id='.$object->id;
67
$head[$h][1] = $langs->trans("Events");
68
$head[$h][2] = 'agenda';
69
$h++;
70
*/
71
72
// Show more tabs from modules
73
// Entries must be declared in modules descriptor with line
74
//$this->tabs = array(
75
// 'entity:+tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
76
//); // to add new tab
77
//$this->tabs = array(
78
// 'entity:-tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
79
//); // to remove a tab
80
complete_head_from_modules
($conf, $langs,
$object
, $head, $h,
'websiteaccount@website'
);
81
82
complete_head_from_modules
($conf, $langs,
$object
, $head, $h,
'websiteaccount@website'
,
'remove'
);
83
84
return
$head;
85
}
$object
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition
card.php:58
complete_head_from_modules
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).
Definition
functions.lib.php:10776
websiteaccountPrepareHead
websiteaccountPrepareHead($object)
Prepare array of tabs for SocieteAccount.
Definition
websiteaccount.lib.php:31
Generated on Sat Oct 5 2024 01:00:29 for
dolibarr
by Doxygen 1.11.0