34 global $db, $langs, $conf, $user;
35 $langs->loadLangs(array(
'propal',
'compta',
'companies'));
40 $head[$h][0] = DOL_URL_ROOT.
'/comm/propal/card.php?id='.$object->id;
41 $head[$h][1] = $langs->trans(
'Proposal');
42 $head[$h][2] =
'comm';
45 if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
46 || (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire))))
48 $langs->load(
"sendings");
50 $head[$h][0] = DOL_URL_ROOT.
'/expedition/propal.php?id='.$object->id;
51 if ($conf->expedition_bon->enabled) $text = $langs->trans(
"Shipment");
52 if ($conf->delivery_note->enabled) $text .=
'/'.$langs->trans(
"Receivings");
54 $head[$h][2] =
'shipping';
58 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
60 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
61 $head[$h][0] = DOL_URL_ROOT.
'/comm/propal/contact.php?id='.$object->id;
62 $head[$h][1] = $langs->trans(
'ContactsAddresses');
63 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
64 $head[$h][2] =
'contact';
74 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
77 if (!empty($object->note_private)) $nbNote++;
78 if (!empty($object->note_public)) $nbNote++;
79 $head[$h][0] = DOL_URL_ROOT.
'/comm/propal/note.php?id='.$object->id;
80 $head[$h][1] = $langs->trans(
'Notes');
81 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
82 $head[$h][2] =
'note';
86 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
87 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
88 $upload_dir = $conf->propal->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
89 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
90 $nbLinks =
Link::count($db, $object->element, $object->id);
91 $head[$h][0] = DOL_URL_ROOT.
'/comm/propal/document.php?id='.$object->id;
92 $head[$h][1] = $langs->trans(
'Documents');
93 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
94 $head[$h][2] =
'document';
97 $head[$h][0] = DOL_URL_ROOT.
'/comm/propal/info.php?id='.$object->id;
98 $head[$h][1] = $langs->trans(
'Info');
99 $head[$h][2] =
'info';
114 global $langs, $conf, $user;
119 $head[$h][0] = DOL_URL_ROOT.
'/admin/propal.php';
120 $head[$h][1] = $langs->trans(
"Miscellaneous");
121 $head[$h][2] =
'general';
130 $head[$h][0] = DOL_URL_ROOT.
'/comm/admin/propal_extrafields.php';
131 $head[$h][1] = $langs->trans(
"ExtraFields");
132 $head[$h][2] =
'attributes';
135 $head[$h][0] = DOL_URL_ROOT.
'/comm/admin/propaldet_extrafields.php';
136 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
137 $head[$h][2] =
'attributeslines';
propal_admin_prepare_head()
Return array head with list of tabs to view object informations.
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.
propal_prepare_head($object)
Prepare array with list of tabs.
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).