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))
46 $head[$h][0] = DOL_URL_ROOT.
'/contrat/contact.php?id='.$object->id;
47 $head[$h][1] = $langs->trans(
"ContactsAddresses");
48 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
49 $head[$h][2] =
'contact';
59 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
62 if (!empty($object->note_private)) $nbNote++;
63 if (!empty($object->note_public)) $nbNote++;
64 $head[$h][0] = DOL_URL_ROOT.
'/contrat/note.php?id='.$object->id;
65 $head[$h][1] = $langs->trans(
"Notes");
66 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
67 $head[$h][2] =
'note';
71 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
72 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
73 $upload_dir = $conf->contrat->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
74 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
75 $nbLinks =
Link::count($db, $object->element, $object->id);
76 $head[$h][0] = DOL_URL_ROOT.
'/contrat/document.php?id='.$object->id;
77 $head[$h][1] = $langs->trans(
"Documents");
78 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
79 $head[$h][2] =
'documents';
82 $head[$h][0] = DOL_URL_ROOT.
'/contrat/agenda.php?id='.$object->id;
83 $head[$h][1] .= $langs->trans(
"Events");
84 if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
87 $head[$h][1] .= $langs->trans(
"Agenda");
89 $head[$h][2] =
'agenda';
104 global $langs, $conf;
109 $head[$h][0] = DOL_URL_ROOT.
"/admin/contract.php";
110 $head[$h][1] = $langs->trans(
"Contracts");
111 $head[$h][2] =
'contract';
120 $head[$h][0] = DOL_URL_ROOT.
'/contrat/admin/contract_extrafields.php';
121 $head[$h][1] = $langs->trans(
"ExtraFields");
122 $head[$h][2] =
'attributes';
125 $head[$h][0] = DOL_URL_ROOT.
'/contrat/admin/contractdet_extrafields.php';
126 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
127 $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.
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.
liste_contact($status=-1, $source= 'external', $list=0, $code= '')
Get array of all contacts for an object.
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).