33 global $db, $langs, $conf;
38 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/card.php?id='.$object->id;
39 $head[$h][1] = $langs->trans(
"ExpenseReport");
40 $head[$h][2] =
'card';
49 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
50 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
52 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
53 $nbLinks =
Link::count($db, $object->element, $object->id);
54 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/document.php?id='.$object->id;
55 $head[$h][1] = $langs->trans(
'Documents');
56 if (($nbFiles + $nbLinks) > 0) {
57 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
59 $head[$h][2] =
'documents';
62 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
64 if (!empty($object->note_private)) {
67 if (!empty($object->note_public)) {
70 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/note.php?id='.$object->id;
71 $head[$h][1] = $langs->trans(
'Notes');
73 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
75 $head[$h][2] =
'note';
79 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/info.php?id='.$object->id;
80 $head[$h][1] = $langs->trans(
"Info");
81 $head[$h][2] =
'info';
100 global $langs, $conf;
105 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/payment/card.php?id='.$object->id;
106 $head[$h][1] = $langs->trans(
"ExpenseReportPayment");
107 $head[$h][2] =
'payment';
116 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/payment/info.php?id='.$object->id;
117 $head[$h][1] = $langs->trans(
"Info");
118 $head[$h][2] =
'info';
133 global $langs, $conf, $user, $db;
139 $extrafields->fetch_name_optionals_label(
'expensereport');
143 $head[$h][0] = DOL_URL_ROOT.
"/admin/expensereport.php";
144 $head[$h][1] = $langs->trans(
"ExpenseReports");
145 $head[$h][2] =
'expensereport';
148 $head[$h][0] = DOL_URL_ROOT.
"/admin/expensereport_rules.php";
149 $head[$h][1] = $langs->trans(
"ExpenseReportsRules");
150 $head[$h][2] =
'expenserules';
153 if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
154 $head[$h][0] = DOL_URL_ROOT.
"/admin/expensereport_ik.php";
155 $head[$h][1] = $langs->trans(
"ExpenseReportsIk");
156 $head[$h][2] =
'expenseik';
166 $head[$h][0] = DOL_URL_ROOT.
'/admin/expensereport_extrafields.php';
167 $head[$h][1] = $langs->trans(
"ExtraFields");
168 $nbExtrafields = $extrafields->attributes[
'expensereport'][
'count'];
169 if ($nbExtrafields > 0) {
170 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
172 $head[$h][2] =
'attributes';
dol_dir_list($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.
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).