30function salaries_prepare_head($object)
32 global $db, $langs, $conf;
37 $head[$h][0] = DOL_URL_ROOT.
'/salaries/card.php?id='.$object->id;
38 $head[$h][1] = $langs->trans(
"Salary");
39 $head[$h][2] =
'card';
42 if (isModEnabled(
'paymentbybanktransfer')) {
43 $nbStandingOrders = 0;
44 $sql =
"SELECT COUNT(pfd.rowid) as nb";
45 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
46 $sql .=
" WHERE pfd.fk_salary = ".((int) $object->id);
47 $sql .=
" AND type = 'ban'";
48 $resql = $db->query($sql);
50 $obj = $db->fetch_object($resql);
52 $nbStandingOrders = $obj->nb;
57 $langs->load(
"banks");
58 $head[$h][0] = DOL_URL_ROOT.
'/salaries/virement_request.php?id='.$object->id.
'&type=bank-transfer';
59 $head[$h][1] = $langs->trans(
'BankTransfer');
60 if ($nbStandingOrders > 0) {
61 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbStandingOrders.
'</span>';
63 $head[$h][2] =
'request_virement';
73 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
74 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
76 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
77 $nbLinks =
Link::count($db, $object->element, $object->id);
78 $head[$h][0] = DOL_URL_ROOT.
'/salaries/document.php?id='.$object->id;
79 $head[$h][1] = $langs->trans(
'Documents');
80 if (($nbFiles + $nbLinks) > 0) {
81 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
83 $head[$h][2] =
'documents';
86 $head[$h][0] = DOL_URL_ROOT.
'/salaries/info.php?id='.$object->id;
87 $head[$h][1] = $langs->trans(
"Info");
88 $head[$h][2] =
'info';
103function salaries_admin_prepare_head()
105 global $conf, $db, $langs, $user;
108 $extrafields->fetch_name_optionals_label(
'salary');
113 $head[$h][0] = DOL_URL_ROOT.
'/salaries/admin/salaries.php';
114 $head[$h][1] = $langs->trans(
"Miscellaneous");
115 $head[$h][2] =
'general';
124 $head[$h][0] = DOL_URL_ROOT.
'/salaries/admin/salaries_extrafields.php';
125 $head[$h][1] = $langs->trans(
"ExtraFieldsSalaries");
126 $nbExtrafields = $extrafields->attributes[
'salary'][
'count'];
127 if ($nbExtrafields > 0) {
128 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
130 $head[$h][2] =
'attributes';
static count($dbs, $objecttype, $objectid)
Return nb of links.
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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
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).