33function supplier_proposal_prepare_head(
$object)
35 global $db, $langs, $conf, $user;
38 $langs->loadLangs(array(
"supplier_proposal",
"compta"));
43 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/card.php?id='.
$object->id;
44 $head[$h][1] = $langs->trans(
'CommRequests');
45 $head[$h][2] =
'comm';
49 $nbContact = count(
$object->liste_contact(-1,
'internal')) + count(
$object->liste_contact(-1,
'external'));
50 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/contact.php?id='.
$object->id;
51 $head[$h][1] = $langs->trans(
'ContactsAddresses');
53 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
55 $head[$h][2] =
'contact';
67 if (!empty(
$object->note_private)) {
70 if (!empty(
$object->note_public)) {
73 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/note.php?id='.
$object->id;
74 $head[$h][1] = $langs->trans(
'Notes');
76 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
78 $head[$h][2] =
'note';
82 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
83 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
85 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
87 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/document.php?id='.
$object->id;
88 $head[$h][1] = $langs->trans(
'Documents');
89 if (($nbFiles + $nbLinks) > 0) {
90 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
92 $head[$h][2] =
'document';
95 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/info.php?id='.
$object->id;
96 $head[$h][1] = $langs->trans(
'Info');
97 $head[$h][2] =
'info';
112function supplier_proposal_admin_prepare_head()
114 global $langs, $conf, $user, $db;
117 $extrafields->fetch_name_optionals_label(
'supplier_proposal');
118 $extrafields->fetch_name_optionals_label(
'supplier_proposaldet');
123 $head[$h][0] = DOL_URL_ROOT.
'/admin/supplier_proposal.php';
124 $head[$h][1] = $langs->trans(
"Miscellaneous");
125 $head[$h][2] =
'general';
134 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/admin/supplier_proposal_extrafields.php';
135 $head[$h][1] = $langs->trans(
"ExtraFields");
136 $nbExtrafields = $extrafields->attributes[
'supplier_proposal'][
'count'];
137 if ($nbExtrafields > 0) {
138 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
140 $head[$h][2] =
'attributes';
143 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/admin/supplier_proposaldet_extrafields.php';
144 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
145 $nbExtrafields = $extrafields->attributes[
'supplier_proposaldet'][
'count'];
146 if ($nbExtrafields > 0) {
147 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
149 $head[$h][2] =
'attributeslines';
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.
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 dolibarr global constant string value.