39 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/expensereport/card.php', [
'id' =>
$object->id]);
40 $head[$h][1] = $langs->trans(
"ExpenseReport");
41 $head[$h][2] =
'card';
50 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
51 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
53 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
55 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/expensereport/document.php', [
'id' =>
$object->id]);
56 $head[$h][1] = $langs->trans(
'Documents');
57 if (($nbFiles + $nbLinks) > 0) {
58 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
60 $head[$h][2] =
'documents';
65 if (!empty(
$object->note_private)) {
68 if (!empty(
$object->note_public)) {
71 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/expensereport/note.php', [
'id' =>
$object->id]);
72 $head[$h][1] = $langs->trans(
'Notes');
74 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
76 $head[$h][2] =
'note';
80 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/expensereport/info.php', [
'id' =>
$object->id]);
81 $head[$h][1] = $langs->trans(
"Info");
82 $head[$h][2] =
'info';
101 global $langs,
$conf;
106 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/expensereport/payment/card.php', [
'id' =>
$object->id]);
107 $head[$h][1] = $langs->trans(
"ExpenseReportPayment");
108 $head[$h][2] =
'payment';
117 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/expensereport/payment/info.php', [
'id' =>
$object->id]);
118 $head[$h][1] = $langs->trans(
"Info");
119 $head[$h][2] =
'info';
134 global $langs,
$conf, $user, $extrafields;
136 $extrafields->fetch_name_optionals_label(
'expensereport');
141 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/expensereport.php");
142 $head[$h][1] = $langs->trans(
"ExpenseReports");
143 $head[$h][2] =
'expensereport';
146 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/expensereport_rules.php");
147 $head[$h][1] = $langs->trans(
"ExpenseReportsRules");
148 $head[$h][2] =
'expenserules';
152 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/expensereport_ik.php");
153 $head[$h][1] = $langs->trans(
"ExpenseReportsIk");
154 $head[$h][2] =
'expenseik';
164 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/admin/expensereport_extrafields.php');
165 $head[$h][1] = $langs->trans(
"ExtraFields");
166 $nbExtrafields = $extrafields->attributes[
'expensereport'][
'count'];
167 if ($nbExtrafields > 0) {
168 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
170 $head[$h][2] =
'attributes';
if(! $sortfield) if(! $sortorder) $object
static count($dbs, $objecttype, $objectid)
Return nb of links.
Class to manage payments of expense report.
expensereport_prepare_head($object)
Prepare array with list of tabs.
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_admin_prepare_head()
Return array head with list of tabs to view object information.
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, $anchor='')
Return path of url.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.