31 global $langs, $conf, $db;
33 $langs->loadLangs(array(
"members",
"partnership"));
36 $extrafields->fetch_name_optionals_label(
'partnership');
41 $head[$h][0] =
dol_buildpath(
"/partnership/admin/setup.php", 1);
42 $head[$h][1] = $langs->trans(
"Settings");
43 $head[$h][2] =
'settings';
47 $head[$h][0] =
dol_buildpath(
"/partnership/admin/partnership_extrafields.php", 1);
48 $head[$h][1] = $langs->trans(
"ExtraFields");
49 $nbExtrafields = $extrafields->attributes[
'partnership'][
'count'];
50 if ($nbExtrafields > 0) {
51 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
53 $head[$h][2] =
'partnership_extrafields';
56 $head[$h][0] =
dol_buildpath(
"/partnership/admin/website.php", 1);
57 $head[$h][1] = $langs->trans(
"BlankSubscriptionForm");
58 $head[$h][2] =
'website';
84 global $db, $langs, $conf;
86 $langs->load(
"partnership");
91 $head[$h][0] =
dol_buildpath(
"/partnership/partnership_card.php", 1).
'?id='.$object->id;
92 $head[$h][1] = $langs->trans(
"Card");
93 $head[$h][2] =
'card';
96 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
98 if (!empty($object->note_private)) {
101 if (!empty($object->note_public)) {
104 $head[$h][0] =
dol_buildpath(
'/partnership/partnership_note.php', 1).
'?id='.$object->id;
105 $head[$h][1] = $langs->trans(
'Notes');
107 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' :
'');
109 $head[$h][2] =
'note';
113 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
114 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
115 $upload_dir = $conf->partnership->dir_output.
"/partnership/".
dol_sanitizeFileName($object->ref);
116 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
117 $nbLinks =
Link::count($db, $object->element, $object->id);
118 $head[$h][0] =
dol_buildpath(
"/partnership/partnership_document.php", 1).
'?id='.$object->id;
119 $head[$h][1] = $langs->trans(
'Documents');
120 if (($nbFiles + $nbLinks) > 0) {
121 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
123 $head[$h][2] =
'document';
126 $head[$h][0] =
dol_buildpath(
"/partnership/partnership_agenda.php", 1).
'?id='.$object->id;
127 $head[$h][1] = $langs->trans(
"Events");
128 $head[$h][2] =
'agenda';
static count($dbs, $objecttype, $objectid)
Return nb of links.
dol_dir_list($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_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
partnershipAdminPrepareHead()
Prepare admin pages header.
partnershipPrepareHead($object)
Prepare array of tabs for Partnership.