33 $langs->load(
"assets");
38 $head[$h][0] = DOL_URL_ROOT.
'/asset/admin/setup.php';
39 $head[$h][1] = $langs->trans(
"Settings");
40 $head[$h][2] =
'settings';
53 $head[$h][0] = DOL_URL_ROOT.
'/asset/admin/assets_extrafields.php';
54 $head[$h][1] = $langs->trans(
"ExtraFields");
55 $head[$h][2] =
'attributes';
58 $head[$h][0] = DOL_URL_ROOT.
'/asset/admin/assets_type_extrafields.php';
59 $head[$h][1] = $langs->trans(
"ExtraFieldsAssetsType");
60 $head[$h][2] =
'attributes_type';
76 global $db, $langs, $conf;
78 $langs->load(
"assets");
83 $head[$h][0] = DOL_URL_ROOT.
'/asset/card.php?id='.$object->id;
84 $head[$h][1] = $langs->trans(
"Card");
85 $head[$h][2] =
'card';
98 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
99 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
101 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
102 $nbLinks =
Link::count($db, $object->element, $object->id);
103 $head[$h][0] = DOL_URL_ROOT.
'/asset/document.php?id='.$object->id;
104 $head[$h][1] = $langs->trans(
'Documents');
105 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
106 $head[$h][2] =
'documents';
110 if (!empty($object->note_private)) $nbNote++;
111 if (!empty($object->note_public)) $nbNote++;
112 $head[$h][0] = DOL_URL_ROOT.
'/asset/note.php?id='.$object->id;
113 $head[$h][1] = $langs->trans(
"Notes");
114 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
115 $head[$h][2] =
'note';
118 $head[$h][0] = DOL_URL_ROOT.
'/asset/info.php?id='.$object->id;
119 $head[$h][1] = $langs->trans(
"Info");
120 $head[$h][2] =
'info';
136 global $langs, $conf, $user;
141 $head[$h][0] = DOL_URL_ROOT.
'/asset/type.php?rowid='.$object->id;
142 $head[$h][1] = $langs->trans(
"Card");
143 $head[$h][2] =
'card';
asset_admin_prepare_head()
Prepare admin pages header.
Class to manage asset type.
asset_type_prepare_head(AssetType $object)
Return array head with list of tabs to view object informations.
asset_prepare_head(Asset $object)
Prepare admin pages header.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
static count($db, $objecttype, $objectid)
Return nb of links.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).