32 function supplier_proposal_prepare_head($object)
34 global $db, $langs, $conf, $user;
37 $langs->loadLangs(array(
"supplier_proposal",
"compta"));
42 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/card.php?id='.$object->id;
43 $head[$h][1] = $langs->trans(
'SupplierProposalCard');
44 $head[$h][2] =
'comm';
47 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
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');
52 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
53 $head[$h][2] =
'contact';
63 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
66 if (!empty($object->note_private)) $nbNote++;
67 if (!empty($object->note_public)) $nbNote++;
68 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/note.php?id='.$object->id;
69 $head[$h][1] = $langs->trans(
'Notes');
70 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
71 $head[$h][2] =
'note';
75 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
76 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
78 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
79 $nbLinks =
Link::count($db, $object->element, $object->id);
80 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/document.php?id='.$object->id;
81 $head[$h][1] = $langs->trans(
'Documents');
82 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
83 $head[$h][2] =
'document';
86 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/info.php?id='.$object->id;
87 $head[$h][1] = $langs->trans(
'Info');
88 $head[$h][2] =
'info';
101 function supplier_proposal_admin_prepare_head()
103 global $langs, $conf, $user;
108 $head[$h][0] = DOL_URL_ROOT.
'/admin/supplier_proposal.php';
109 $head[$h][1] = $langs->trans(
"Miscellaneous");
110 $head[$h][2] =
'general';
119 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/admin/supplier_proposal_extrafields.php';
120 $head[$h][1] = $langs->trans(
"ExtraFields");
121 $head[$h][2] =
'attributes';
124 $head[$h][0] = DOL_URL_ROOT.
'/supplier_proposal/admin/supplier_proposaldet_extrafields.php';
125 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
126 $head[$h][2] =
'attributeslines';
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.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).