33 global $db, $langs, $conf, $user;
38 $head[$h][0] = DOL_URL_ROOT.
'/contrat/card.php?id='.$object->id;
39 $head[$h][1] = $langs->trans(
"ContractCard");
40 $head[$h][2] =
'card';
43 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
45 $head[$h][0] = DOL_URL_ROOT.
'/contrat/contact.php?id='.$object->id;
46 $head[$h][1] = $langs->trans(
"ContactsAddresses");
48 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
50 $head[$h][2] =
'contact';
60 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
62 if (!empty($object->note_private)) {
65 if (!empty($object->note_public)) {
68 $head[$h][0] = DOL_URL_ROOT.
'/contrat/note.php?id='.$object->id;
69 $head[$h][1] = $langs->trans(
"Notes");
71 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
73 $head[$h][2] =
'note';
77 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
78 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
79 $upload_dir = $conf->contrat->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
80 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
81 $nbLinks =
Link::count($db, $object->element, $object->id);
82 $head[$h][0] = DOL_URL_ROOT.
'/contrat/document.php?id='.$object->id;
83 $head[$h][1] = $langs->trans(
"Documents");
84 if (($nbFiles + $nbLinks) > 0) {
85 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
87 $head[$h][2] =
'documents';
90 $head[$h][0] = DOL_URL_ROOT.
'/contrat/agenda.php?id='.$object->id;
91 $head[$h][1] .= $langs->trans(
"Events");
92 if (
isModEnabled(
'agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
94 $head[$h][1] .= $langs->trans(
"Agenda");
96 $head[$h][2] =
'agenda';
111 global $langs, $conf;
116 $head[$h][0] = DOL_URL_ROOT.
"/admin/contract.php";
117 $head[$h][1] = $langs->trans(
"Contracts");
118 $head[$h][2] =
'contract';
127 $head[$h][0] = DOL_URL_ROOT.
'/contrat/admin/contract_extrafields.php';
128 $head[$h][1] = $langs->trans(
"ExtraFields");
129 $head[$h][2] =
'attributes';
132 $head[$h][0] = DOL_URL_ROOT.
'/contrat/admin/contractdet_extrafields.php';
133 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
134 $head[$h][2] =
'attributeslines';
contract_admin_prepare_head()
Return array head with list of tabs to view object informations.
Class to manage contracts.
contract_prepare_head(Contrat $object)
Prepare array with list of tabs.
static count($dbs, $objecttype, $objectid)
Return nb of links.
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.
isModEnabled($module)
Is Dolibarr module enabled.
liste_contact($status=-1, $source= 'external', $list=0, $code= '')
Get array of all contacts for an object.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).