32 global $db, $langs, $conf;
37 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/card.php?id='.$object->id;
38 $head[$h][1] = $langs->trans(
"ExpenseReport");
39 $head[$h][2] =
'card';
48 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
49 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
51 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
52 $nbLinks =
Link::count($db, $object->element, $object->id);
53 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/document.php?id='.$object->id;
54 $head[$h][1] = $langs->trans(
'Documents');
55 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
56 $head[$h][2] =
'documents';
59 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
62 if (!empty($object->note_private)) $nbNote++;
63 if (!empty($object->note_public)) $nbNote++;
64 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/note.php?id='.$object->id;
65 $head[$h][1] = $langs->trans(
'Notes');
66 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
67 $head[$h][2] =
'note';
71 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/info.php?id='.$object->id;
72 $head[$h][1] = $langs->trans(
"Info");
73 $head[$h][2] =
'info';
96 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/payment/card.php?id='.$object->id;
97 $head[$h][1] = $langs->trans(
"ExpenseReportPayment");
98 $head[$h][2] =
'payment';
107 $head[$h][0] = DOL_URL_ROOT.
'/expensereport/payment/info.php?id='.$object->id;
108 $head[$h][1] = $langs->trans(
"Info");
109 $head[$h][2] =
'info';
124 global $langs, $conf, $user;
131 $head[$h][0] = DOL_URL_ROOT.
"/admin/expensereport.php";
132 $head[$h][1] = $langs->trans(
"ExpenseReports");
133 $head[$h][2] =
'expensereport';
136 if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
138 $head[$h][0] = DOL_URL_ROOT.
"/admin/expensereport_rules.php";
139 $head[$h][1] = $langs->trans(
"ExpenseReportsRules");
140 $head[$h][2] =
'expenserules';
144 if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
146 $head[$h][0] = DOL_URL_ROOT.
"/admin/expensereport_ik.php";
147 $head[$h][1] = $langs->trans(
"ExpenseReportsIk");
148 $head[$h][2] =
'expenseik';
158 $head[$h][0] = DOL_URL_ROOT.
'/admin/expensereport_extrafields.php';
159 $head[$h][1] = $langs->trans(
"ExtraFields");
160 $head[$h][2] =
'attributes';
expensereport_admin_prepare_head()
Return array head with list of tabs to view object informations.
payment_expensereport_prepare_head(PaymentExpenseReport $object)
Returns an array with the tabs for the "Expense report payment" section It loads tabs from modules lo...
expensereport_prepare_head($object)
Prepare array with list of tabs.
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.
Class to manage payments of expense report.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).