31function salaries_prepare_head(
$object)
33 global $db, $langs,
$conf;
38 $head[$h][0] = DOL_URL_ROOT.
'/salaries/card.php?id='.
$object->id;
39 $head[$h][1] = $langs->trans(
"Salary");
40 $head[$h][2] =
'card';
43 if (isModEnabled(
'paymentbybanktransfer')) {
44 $nbStandingOrders = 0;
45 $sql =
"SELECT COUNT(pfd.rowid) as nb";
46 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_demande as pfd";
47 $sql .=
" WHERE pfd.fk_salary = ".((int)
$object->id);
48 $sql .=
" AND type = 'ban'";
49 $resql = $db->query($sql);
51 $obj = $db->fetch_object($resql);
53 $nbStandingOrders = $obj->nb;
58 $langs->load(
"banks");
59 $head[$h][0] = DOL_URL_ROOT.
'/salaries/virement_request.php?id='.
$object->id.
'&type=bank-transfer';
60 $head[$h][1] = $langs->trans(
'BankTransfer');
61 if ($nbStandingOrders > 0) {
62 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbStandingOrders.
'</span>';
64 $head[$h][2] =
'request_virement';
74 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
75 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
77 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
79 $head[$h][0] = DOL_URL_ROOT.
'/salaries/document.php?id='.
$object->id;
80 $head[$h][1] = $langs->trans(
'Documents');
81 if (($nbFiles + $nbLinks) > 0) {
82 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
84 $head[$h][2] =
'documents';
87 $head[$h][0] = DOL_URL_ROOT.
'/salaries/info.php?id='.
$object->id;
88 $head[$h][1] = $langs->trans(
"Info");
89 $head[$h][2] =
'info';
104function salaries_admin_prepare_head()
106 global
$conf, $db, $langs, $user;
109 $extrafields->fetch_name_optionals_label(
'salary');
114 $head[$h][0] = DOL_URL_ROOT.
'/salaries/admin/salaries.php';
115 $head[$h][1] = $langs->trans(
"Miscellaneous");
116 $head[$h][2] =
'general';
125 $head[$h][0] = DOL_URL_ROOT.
'/salaries/admin/salaries_extrafields.php';
126 $head[$h][1] = $langs->trans(
"ExtraFieldsSalaries");
127 $nbExtrafields = $extrafields->attributes[
'salary'][
'count'];
128 if ($nbExtrafields > 0) {
129 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
131 $head[$h][2] =
'attributes';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
static count($dbs, $objecttype, $objectid)
Return nb of links.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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).
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...