conferenceorbooth_contact.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <?php
  2. /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2021 Florian HENRY <florian.henry@scopen.fr>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/eventorganization/conferenceorbooth_contact.php
  20. * \ingroup eventorganization
  21. * \brief Tab for contacts linked to ConferenceOrBooth
  22. */
  23. require '../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
  31. require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
  32. require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
  33. // Load translation files required by the page
  34. $langs->loadLangs(array("eventorganization", "projects", "companies", "other", "mails"));
  35. $id = GETPOST('id', 'int');
  36. $ref = GETPOST('ref', 'alpha');
  37. $lineid = GETPOST('lineid', 'int');
  38. $socid = GETPOST('socid', 'int');
  39. $action = GETPOST('action', 'aZ09');
  40. $confirm = GETPOST('confirm', 'alpha');
  41. $cancel = GETPOST('cancel', 'aZ09');
  42. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothcard'; // To manage different context of search
  43. $backtopage = GETPOST('backtopage', 'alpha');
  44. $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
  45. $withproject = GETPOST('withproject', 'int');
  46. // Initialize technical objects
  47. $object = new ConferenceOrBooth($db);
  48. $extrafields = new ExtraFields($db);
  49. $projectstatic = new Project($db);
  50. $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
  51. $hookmanager->initHooks(array('conferenceorboothcontact', 'globalcard')); // Note that conf->hooks_modules contains array
  52. // Fetch optionals attributes and labels
  53. $extrafields->fetch_name_optionals_label($object->table_element);
  54. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  55. // Load object
  56. include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
  57. // Security check
  58. if ($user->socid > 0) {
  59. accessforbidden();
  60. }
  61. $isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
  62. $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
  63. $permissiontoread = $user->rights->eventorganization->read;
  64. $permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
  65. $permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
  66. $permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
  67. $permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
  68. $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
  69. // Security check
  70. if ($user->socid > 0) {
  71. accessforbidden();
  72. }
  73. $isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
  74. $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
  75. if (!$permissiontoread) {
  76. accessforbidden();
  77. }
  78. /*
  79. * Actions
  80. */
  81. $parameters = array();
  82. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  83. if ($reshook < 0) {
  84. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  85. }
  86. if ($action == 'addcontact' && $permission) { // Add a new contact
  87. $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
  88. $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
  89. $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
  90. if ($result >= 0) {
  91. header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
  92. exit;
  93. } else {
  94. if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
  95. $langs->load("errors");
  96. setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
  97. } else {
  98. setEventMessages($object->error, $object->errors, 'errors');
  99. }
  100. }
  101. } elseif ($action == 'swapstatut' && $permission) {
  102. // Toggle the status of a contact
  103. $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
  104. } elseif ($action == 'deletecontact' && $permission) {
  105. // Deletes a contact
  106. $result = $object->delete_contact($lineid);
  107. if ($result >= 0) {
  108. header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
  109. exit;
  110. } else {
  111. dol_print_error($db);
  112. }
  113. }
  114. /*
  115. * View
  116. */
  117. $form = new Form($db);
  118. $formcompany = new FormCompany($db);
  119. $contactstatic = new Contact($db);
  120. $userstatic = new User($db);
  121. $title = $langs->trans('ConferenceOrBooth')." - ".$langs->trans('ContactsAddresses');
  122. $help_url = '';
  123. //$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
  124. llxHeader('', $title, $help_url);
  125. /* *************************************************************************** */
  126. /* */
  127. /* View and edit mode */
  128. /* */
  129. /* *************************************************************************** */
  130. $result = $projectstatic->fetch($object->fk_project);
  131. if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
  132. $projectstatic->fetchComments();
  133. }
  134. if (!empty($projectstatic->socid)) {
  135. $projectstatic->fetch_thirdparty();
  136. }
  137. $withProjectUrl='';
  138. $object->project = clone $projectstatic;
  139. if (!empty($withproject)) {
  140. // Tabs for project
  141. $tab = 'eventorganisation';
  142. $withProjectUrl = "&withproject=1";
  143. $head = project_prepare_head($projectstatic);
  144. print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
  145. $param = ($mode == 'mine' ? '&mode=mine' : '');
  146. // Project card
  147. $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  148. $morehtmlref = '<div class="refidno">';
  149. // Title
  150. $morehtmlref .= $projectstatic->title;
  151. // Thirdparty
  152. if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
  153. $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
  154. }
  155. $morehtmlref .= '</div>';
  156. // Define a complementary filter for search of next/prev ref.
  157. if (empty($user->rights->project->all->lire)) {
  158. $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
  159. $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
  160. }
  161. dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  162. print '<div class="fichecenter">';
  163. print '<div class="fichehalfleft">';
  164. print '<div class="underbanner clearboth"></div>';
  165. print '<table class="border tableforfield centpercent">';
  166. // Usage
  167. if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
  168. print '<tr><td class="tdtop">';
  169. print $langs->trans("Usage");
  170. print '</td>';
  171. print '<td>';
  172. if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
  173. print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
  174. $htmltext = $langs->trans("ProjectFollowOpportunity");
  175. print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
  176. print '<br>';
  177. }
  178. if (empty($conf->global->PROJECT_HIDE_TASKS)) {
  179. print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
  180. $htmltext = $langs->trans("ProjectFollowTasks");
  181. print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
  182. print '<br>';
  183. }
  184. if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
  185. print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
  186. $htmltext = $langs->trans("ProjectBillTimeDescription");
  187. print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
  188. print '<br>';
  189. }
  190. if (!empty($conf->eventorganization->enabled)) {
  191. print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
  192. $htmltext = $langs->trans("EventOrganizationDescriptionLong");
  193. print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
  194. }
  195. print '</td></tr>';
  196. }
  197. // Visibility
  198. print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
  199. if ($projectstatic->public) {
  200. print $langs->trans('SharedProject');
  201. } else {
  202. print $langs->trans('PrivateProject');
  203. }
  204. print '</td></tr>';
  205. // Date start - end
  206. print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
  207. $start = dol_print_date($projectstatic->date_start, 'day');
  208. print ($start ? $start : '?');
  209. $end = dol_print_date($projectstatic->date_end, 'day');
  210. print ' - ';
  211. print ($end ? $end : '?');
  212. if ($projectstatic->hasDelay()) {
  213. print img_warning("Late");
  214. }
  215. print '</td></tr>';
  216. // Budget
  217. print '<tr><td>'.$langs->trans("Budget").'</td><td>';
  218. if (strcmp($projectstatic->budget_amount, '')) {
  219. print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
  220. }
  221. print '</td></tr>';
  222. // Other attributes
  223. $cols = 2;
  224. $objectconf = $object;
  225. $object = $projectstatic;
  226. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
  227. $object = $objectconf;
  228. print '</table>';
  229. print '</div>';
  230. print '<div class="fichehalfright">';
  231. print '<div class="underbanner clearboth"></div>';
  232. print '<table class="border tableforfield centpercent">';
  233. // Description
  234. print '<td class="tdtop">'.$langs->trans("Description").'</td><td>';
  235. print nl2br($projectstatic->description);
  236. print '</td></tr>';
  237. // Categories
  238. if ($conf->categorie->enabled) {
  239. print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
  240. print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
  241. print "</td></tr>";
  242. }
  243. print '<tr><td>';
  244. $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
  245. $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
  246. print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
  247. print '</td><td>';
  248. print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
  249. print "</td></tr>";
  250. print '<tr><td>';
  251. $typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : '');
  252. $htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
  253. print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
  254. print '</td><td>';
  255. print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
  256. print "</td></tr>";
  257. print '<tr><td>';
  258. print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
  259. print '</td><td>';
  260. print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
  261. print "</td></tr>";
  262. print '<tr><td>';
  263. print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
  264. print '</td><td>';
  265. print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
  266. print "</td></tr>";
  267. print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
  268. // Define $urlwithroot
  269. $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
  270. $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
  271. // Show message
  272. $message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
  273. $message .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
  274. $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
  275. print $message;
  276. print "</td></tr>";
  277. // Link to the submit vote/register page
  278. print '<tr><td>';
  279. //print '<span class="opacitymedium">';
  280. print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
  281. //print '</span>';
  282. print '</td><td>';
  283. $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $projectstatic->id);
  284. $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $projectstatic->id), 'md5');
  285. $linksuggest .= '&securekey='.urlencode($encodedsecurekey);
  286. //print '<div class="urllink">';
  287. //print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
  288. print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
  289. print '<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
  290. //print '</div>';
  291. //print ajax_autoselect("linkregister");
  292. print '</td></tr>';
  293. // Link to the subscribe
  294. print '<tr><td>';
  295. //print '<span class="opacitymedium">';
  296. print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
  297. //print '</span>';
  298. print '</td><td>';
  299. $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.((int) $projectstatic->id).'&type=global';
  300. $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $projectstatic->id), 'md5');
  301. $link_subscription .= '&securekey='.urlencode($encodedsecurekey);
  302. //print '<div class="urllink">';
  303. //print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
  304. print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.'" class="quatrevingtpercent">'.$link_subscription.'</a></div>';
  305. print '<a target="_blank" rel="noopener noreferrer" rel="noopener noreferrer" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
  306. //print '</div>';
  307. //print ajax_autoselect("linkregister");
  308. print '</td></tr>';
  309. print '</table>';
  310. print '</div>';
  311. print '</div>';
  312. print '<div class="clearboth"></div>';
  313. print dol_get_fiche_end();
  314. print '<br>';
  315. }
  316. if ($object->id) {
  317. /*
  318. * Show tabs
  319. */
  320. $head = conferenceorboothPrepareHead($object, $withproject);
  321. print dol_get_fiche_head($head, 'contact', $langs->trans("ConferenceOrBooth"), -1, $object->picto);
  322. $linkback = '<a href="'.dol_buildpath('/eventorganization/conferenceorbooth_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
  323. $morehtmlref = '<div class="refidno">';
  324. /*
  325. // Ref customer
  326. $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
  327. $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
  328. // Thirdparty
  329. $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
  330. // Project
  331. if (! empty($conf->projet->enabled))
  332. {
  333. $langs->load("projects");
  334. $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
  335. if ($permissiontoadd)
  336. {
  337. if ($action != 'classify')
  338. //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
  339. $morehtmlref.=' : ';
  340. if ($action == 'classify') {
  341. //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
  342. $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
  343. $morehtmlref.='<input type="hidden" name="action" value="classin">';
  344. $morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
  345. $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
  346. $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
  347. $morehtmlref.='</form>';
  348. } else {
  349. $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
  350. }
  351. } else {
  352. if (! empty($object->fk_project)) {
  353. $proj = new Project($db);
  354. $proj->fetch($object->fk_project);
  355. $morehtmlref .= ': '.$proj->getNomUrl();
  356. } else {
  357. $morehtmlref .= '';
  358. }
  359. }
  360. }*/
  361. $morehtmlref .= '</div>';
  362. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
  363. print dol_get_fiche_end();
  364. print '<br>';
  365. // Contacts lines (modules that overwrite templates must declare this into descriptor)
  366. $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
  367. foreach ($dirtpls as $reldir) {
  368. $res = @include dol_buildpath($reldir.'/contacts.tpl.php');
  369. if ($res) {
  370. break;
  371. }
  372. }
  373. }
  374. // End of page
  375. llxFooter();
  376. $db->close();