33 global $db, $langs, $conf;
35 $langs->load(
"mymodule@mymodule");
37 $showtabofpagecontact =
getDolGlobalInt(
'MAIN_MYMODULE_SHOW_PAGE_OF_CONTACT');
38 $showtabofpagenote =
getDolGlobalInt(
'MAIN_MYMODULE_SHOW_PAGE_OF_NOTE');
39 $showtabofpagedocument =
getDolGlobalInt(
'MAIN_MYMODULE_SHOW_PAGE_OF_DOCUMENT');
40 $showtabofpageagenda =
getDolGlobalInt(
'MAIN_MYMODULE_SHOW_PAGE_OF_AGENDA');
46 $head[$h][1] = $langs->trans(
"MyObject");
47 $head[$h][2] =
'card';
50 if ($showtabofpagecontact) {
52 $head[$h][1] = $langs->trans(
"Contacts");
53 $head[$h][2] =
'contact';
57 if ($showtabofpagenote) {
58 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
60 if (!empty(
$object->note_private)) {
63 if (!empty(
$object->note_public)) {
67 $head[$h][1] = $langs->trans(
'Notes');
69 $head[$h][1] .= (!
getDolGlobalInt(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' :
'');
71 $head[$h][2] =
'note';
76 if ($showtabofpagedocument) {
77 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
78 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
80 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
83 $head[$h][1] = $langs->trans(
'Documents');
84 if (($nbFiles + $nbLinks) > 0) {
85 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
87 $head[$h][2] =
'document';
91 if ($showtabofpageagenda) {
93 $head[$h][1] = $langs->trans(
"Events");
94 $head[$h][2] =
'agenda';
if(! $sortfield) if(! $sortorder) $object
static count($dbs, $objecttype, $objectid)
Return nb of links.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dolBuildUrl($url, $params=[], $addtoken=false)
Return path of url.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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).
myobjectPrepareHead($object)
Prepare array of tabs for MyObject.