contact.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. <?php
  2. /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. /**
  20. * \file htdocs/projet/tasks/contact.php
  21. * \ingroup project
  22. * \brief Actors of a task
  23. */
  24. require "../../main.inc.php";
  25. require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  30. // Load translation files required by the page
  31. $langs->loadLangs(array('projects', 'companies'));
  32. $id = GETPOST('id', 'int');
  33. $ref = GETPOST('ref', 'alpha');
  34. $action = GETPOST('action', 'aZ09');
  35. $confirm = GETPOST('confirm', 'alpha');
  36. $withproject = GETPOST('withproject', 'int');
  37. $project_ref = GETPOST('project_ref', 'alpha');
  38. $object = new Task($db);
  39. $projectstatic = new Project($db);
  40. if ($id > 0 || $ref) {
  41. $object->fetch($id, $ref);
  42. }
  43. // Security check
  44. $socid = 0;
  45. restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
  46. /*
  47. * Actions
  48. */
  49. // Add new contact
  50. if ($action == 'addcontact' && $user->rights->projet->creer) {
  51. $source = 'internal';
  52. if (GETPOST("addsourceexternal")) {
  53. $source ='external';
  54. }
  55. $result = $object->fetch($id, $ref);
  56. if ($result > 0 && $id > 0) {
  57. if ($source == 'internal') {
  58. $idfortaskuser = ((GETPOST("userid") != 0 && GETPOST('userid') != -1) ? GETPOST("userid") : 0); // GETPOST('contactid') may val -1 to mean empty or -2 to means "everybody"
  59. $typeid = GETPOST('type');
  60. } else {
  61. $idfortaskuser = ((GETPOST("contactid") > 0) ? GETPOST("contactid", 'int') : 0); // GETPOST('contactid') may val -1 to mean empty or -2 to means "everybody"
  62. $typeid = GETPOST('typecontact');
  63. }
  64. if ($idfortaskuser == -2) {
  65. $result = $projectstatic->fetch($object->fk_project);
  66. if ($result <= 0) {
  67. dol_print_error($db, $projectstatic->error, $projectstatic->errors);
  68. } else {
  69. $contactsofproject = $projectstatic->getListContactId('internal');
  70. foreach ($contactsofproject as $key => $val) {
  71. $result = $object->add_contact($val, $typeid, $source);
  72. }
  73. }
  74. } else {
  75. $result = $object->add_contact($idfortaskuser, $typeid, $source);
  76. }
  77. }
  78. if ($result >= 0) {
  79. header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
  80. exit;
  81. } else {
  82. if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
  83. $langs->load("errors");
  84. setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
  85. } else {
  86. setEventMessages($object->error, $object->errors, 'errors');
  87. }
  88. }
  89. }
  90. // bascule du statut d'un contact
  91. if ($action == 'swapstatut' && $user->rights->projet->creer) {
  92. if ($object->fetch($id, $ref)) {
  93. $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
  94. } else {
  95. dol_print_error($db);
  96. }
  97. }
  98. // Efface un contact
  99. if ($action == 'deleteline' && $user->rights->projet->creer) {
  100. $object->fetch($id, $ref);
  101. $result = $object->delete_contact(GETPOST("lineid", 'int'));
  102. if ($result >= 0) {
  103. header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : ''));
  104. exit;
  105. } else {
  106. dol_print_error($db);
  107. }
  108. }
  109. // Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
  110. if (!empty($project_ref) && !empty($withproject)) {
  111. if ($projectstatic->fetch(0, $project_ref) > 0) {
  112. $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
  113. if (count($tasksarray) > 0) {
  114. $id = $tasksarray[0]->id;
  115. } else {
  116. header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode));
  117. exit;
  118. }
  119. }
  120. }
  121. /*
  122. * View
  123. */
  124. llxHeader('', $langs->trans("Task"));
  125. $form = new Form($db);
  126. $formcompany = new FormCompany($db);
  127. $contactstatic = new Contact($db);
  128. $userstatic = new User($db);
  129. /* *************************************************************************** */
  130. /* */
  131. /* Mode vue et edition */
  132. /* */
  133. /* *************************************************************************** */
  134. if ($id > 0 || !empty($ref)) {
  135. if ($object->fetch($id, $ref) > 0) {
  136. if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
  137. $object->fetchComments();
  138. }
  139. $id = $object->id; // So when doing a search from ref, id is also set correctly.
  140. $result = $projectstatic->fetch($object->fk_project);
  141. if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
  142. $projectstatic->fetchComments();
  143. }
  144. if (!empty($projectstatic->socid)) {
  145. $projectstatic->fetch_thirdparty();
  146. }
  147. $object->project = clone $projectstatic;
  148. $userWrite = $projectstatic->restrictedProjectArea($user, 'write');
  149. if ($withproject) {
  150. // Tabs for project
  151. $tab = 'tasks';
  152. $head = project_prepare_head($projectstatic);
  153. print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'));
  154. $param = ($mode == 'mine' ? '&mode=mine' : '');
  155. // Project card
  156. $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  157. $morehtmlref = '<div class="refidno">';
  158. // Title
  159. $morehtmlref .= $projectstatic->title;
  160. // Thirdparty
  161. if ($projectstatic->thirdparty->id > 0) {
  162. $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
  163. }
  164. $morehtmlref .= '</div>';
  165. // Define a complementary filter for search of next/prev ref.
  166. if (empty($user->rights->projet->all->lire)) {
  167. $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
  168. $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
  169. }
  170. dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  171. print '<div class="fichecenter">';
  172. print '<div class="fichehalfleft">';
  173. print '<div class="underbanner clearboth"></div>';
  174. print '<table class="border tableforfield centpercent">';
  175. // Usage
  176. if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
  177. print '<tr><td class="tdtop">';
  178. print $langs->trans("Usage");
  179. print '</td>';
  180. print '<td>';
  181. if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
  182. print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
  183. $htmltext = $langs->trans("ProjectFollowOpportunity");
  184. print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
  185. print '<br>';
  186. }
  187. if (empty($conf->global->PROJECT_HIDE_TASKS)) {
  188. print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
  189. $htmltext = $langs->trans("ProjectFollowTasks");
  190. print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
  191. print '<br>';
  192. }
  193. if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
  194. 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"' : '')).'"> ';
  195. $htmltext = $langs->trans("ProjectBillTimeDescription");
  196. print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
  197. print '<br>';
  198. }
  199. if (!empty($conf->eventorganization->enabled)) {
  200. print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
  201. $htmltext = $langs->trans("EventOrganizationDescriptionLong");
  202. print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
  203. }
  204. print '</td></tr>';
  205. }
  206. // Visibility
  207. print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
  208. if ($projectstatic->public) {
  209. print $langs->trans('SharedProject');
  210. } else {
  211. print $langs->trans('PrivateProject');
  212. }
  213. print '</td></tr>';
  214. // Date start - end
  215. print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
  216. $start = dol_print_date($projectstatic->date_start, 'day');
  217. print ($start ? $start : '?');
  218. $end = dol_print_date($projectstatic->date_end, 'day');
  219. print ' - ';
  220. print ($end ? $end : '?');
  221. if ($projectstatic->hasDelay()) {
  222. print img_warning("Late");
  223. }
  224. print '</td></tr>';
  225. // Budget
  226. print '<tr><td>'.$langs->trans("Budget").'</td><td>';
  227. if (strcmp($projectstatic->budget_amount, '')) {
  228. print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
  229. }
  230. print '</td></tr>';
  231. // Other attributes
  232. $cols = 2;
  233. //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
  234. print '</table>';
  235. print '</div>';
  236. print '<div class="fichehalfright">';
  237. print '<div class="underbanner clearboth"></div>';
  238. print '<table class="border tableforfield centpercent">';
  239. // Description
  240. print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
  241. print nl2br($projectstatic->description);
  242. print '</td></tr>';
  243. // Categories
  244. if ($conf->categorie->enabled) {
  245. print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
  246. print $form->showCategories($projectstatic->id, 'project', 1);
  247. print "</td></tr>";
  248. }
  249. print '</table>';
  250. print '</div>';
  251. print '</div>';
  252. print '<div class="clearboth"></div>';
  253. print dol_get_fiche_end();
  254. print '<br>';
  255. }
  256. // To verify role of users
  257. //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
  258. //$arrayofuseridoftask=$object->getListContactId('internal');
  259. $head = task_prepare_head($object);
  260. print dol_get_fiche_head($head, 'task_contact', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
  261. $param = (GETPOST('withproject') ? '&withproject=1' : '');
  262. $linkback = GETPOST('withproject') ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : '';
  263. if (!GETPOST('withproject') || empty($projectstatic->id)) {
  264. $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
  265. $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
  266. } else {
  267. $object->next_prev_filter = " fk_projet = ".$projectstatic->id;
  268. }
  269. $morehtmlref = '';
  270. // Project
  271. if (empty($withproject)) {
  272. $result = $projectstatic->fetch($object->fk_project);
  273. $morehtmlref .= '<div class="refidno">';
  274. $morehtmlref .= $langs->trans("Project").': ';
  275. $morehtmlref .= $projectstatic->getNomUrl(1);
  276. $morehtmlref .= '<br>';
  277. // Third party
  278. $morehtmlref .= $langs->trans("ThirdParty").': ';
  279. if ($projectstatic->socid > 0) {
  280. $projectstatic->fetch_thirdparty();
  281. $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
  282. }
  283. $morehtmlref .= '</div>';
  284. }
  285. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1);
  286. print dol_get_fiche_end();
  287. /*
  288. * Lines of contacts
  289. */
  290. /*
  291. // Contacts lines (modules that overwrite templates must declare this into descriptor)
  292. $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
  293. foreach($dirtpls as $reldir)
  294. {
  295. $res=@include dol_buildpath($reldir.'/contacts.tpl.php');
  296. if ($res) break;
  297. }
  298. */
  299. /*
  300. * Add a new contact line
  301. */
  302. print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
  303. print '<input type="hidden" name="token" value="'.newToken().'">';
  304. print '<input type="hidden" name="action" value="addcontact">';
  305. print '<input type="hidden" name="id" value="'.$id.'">';
  306. if ($withproject) {
  307. print '<input type="hidden" name="withproject" value="'.$withproject.'">';
  308. }
  309. print '<table class="noborder centpercent">';
  310. if ($action != 'editline' && $user->rights->projet->creer) {
  311. print '<tr class="liste_titre">';
  312. print '<td>'.$langs->trans("NatureOfContact").'</td>';
  313. print '<td>'.$langs->trans("ThirdParty").'</td>';
  314. print '<td>'.$langs->trans("Users").'</td>';
  315. print '<td>'.$langs->trans("ContactType").'</td>';
  316. print '<td colspan="3">&nbsp;</td>';
  317. print "</tr>\n";
  318. // Ligne ajout pour contact interne
  319. print '<tr class="oddeven nohover">';
  320. print '<td class="nowrap">';
  321. print img_object('', 'user').' '.$langs->trans("Users");
  322. print '</td>';
  323. print '<td>';
  324. print $conf->global->MAIN_INFO_SOCIETE_NOM;
  325. print '</td>';
  326. print '<td>';
  327. // On recupere les id des users deja selectionnes
  328. if ($object->project->public) {
  329. $contactsofproject = ''; // Everybody
  330. } else {
  331. $contactsofproject = $projectstatic->getListContactId('internal');
  332. }
  333. print $form->select_dolusers((GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject"));
  334. print '</td>';
  335. print '<td>';
  336. $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid');
  337. print '</td>';
  338. print '<td class="right" colspan="3" ><input type="submit" class="button button-add" value="'.$langs->trans("Add").'" name="addsourceinternal"></td>';
  339. print '</tr>';
  340. // Line to add an external contact. Only if project linked to a third party.
  341. if ($projectstatic->socid) {
  342. print '<tr class="oddeven">';
  343. print '<td class="nowrap">';
  344. print img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts");
  345. print '</td>';
  346. print '<td>';
  347. $thirdpartyofproject = $projectstatic->getListContactId('thirdparty');
  348. $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $projectstatic->socid;
  349. $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', $thirdpartyofproject, 0, '&withproject='.$withproject);
  350. print '</td>';
  351. print '<td>';
  352. $contactofproject = $projectstatic->getListContactId('external');
  353. print $form->selectcontacts($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, '', false, 0, 0);
  354. $nbofcontacts = $form->num;
  355. print '</td>';
  356. print '<td>';
  357. $formcompany->selectTypeContact($object, '', 'typecontact', 'external', 'rowid');
  358. print '</td>';
  359. print '<td class="right" colspan="3" ><input type="submit" class="button" id="add-customer-contact" name="addsourceexternal" value="'.$langs->trans("Add").'"';
  360. if (!$nbofcontacts) {
  361. print ' disabled';
  362. }
  363. print '></td>';
  364. print '</tr>';
  365. }
  366. }
  367. // List of contact line
  368. print '<tr class="liste_titre">';
  369. print '<td>'.$langs->trans("Source").'</td>';
  370. print '<td>'.$langs->trans("ThirdParty").'</td>';
  371. print '<td>'.$langs->trans("TaskContact").'</td>';
  372. print '<td>'.$langs->trans("ContactType").'</td>';
  373. print '<td class="center">'.$langs->trans("Status").'</td>';
  374. print '<td colspan="2">&nbsp;</td>';
  375. print "</tr>\n";
  376. $companystatic = new Societe($db);
  377. foreach (array('internal', 'external') as $source) {
  378. $tab = $object->liste_contact(-1, $source);
  379. $num = count($tab);
  380. $i = 0;
  381. while ($i < $num) {
  382. print '<tr class="oddeven" valign="top">';
  383. // Source
  384. print '<td class="left">';
  385. if ($tab[$i]['source'] == 'internal') {
  386. print $langs->trans("User");
  387. }
  388. if ($tab[$i]['source'] == 'external') {
  389. print $langs->trans("ThirdPartyContact");
  390. }
  391. print '</td>';
  392. // Societe
  393. print '<td class="left">';
  394. if ($tab[$i]['socid'] > 0) {
  395. $companystatic->fetch($tab[$i]['socid']);
  396. print $companystatic->getNomUrl(1);
  397. }
  398. if ($tab[$i]['socid'] < 0) {
  399. print $conf->global->MAIN_INFO_SOCIETE_NOM;
  400. }
  401. if (!$tab[$i]['socid']) {
  402. print '&nbsp;';
  403. }
  404. print '</td>';
  405. // Contact
  406. print '<td>';
  407. if ($tab[$i]['source'] == 'internal') {
  408. $userstatic->id = $tab[$i]['id'];
  409. $userstatic->lastname = $tab[$i]['lastname'];
  410. $userstatic->firstname = $tab[$i]['firstname'];
  411. $userstatic->photo = $tab[$i]['photo'];
  412. $userstatic->login = $tab[$i]['login'];
  413. $userstatic->email = $tab[$i]['email'];
  414. $userstatic->statut = $tab[$i]['statuscontact'];
  415. print $userstatic->getNomUrl(-1);
  416. }
  417. if ($tab[$i]['source'] == 'external') {
  418. $contactstatic->id = $tab[$i]['id'];
  419. $contactstatic->lastname = $tab[$i]['lastname'];
  420. $contactstatic->firstname = $tab[$i]['firstname'];
  421. $contactstatic->email = $tab[$i]['email'];
  422. $contactstatic->statut = $tab[$i]['statuscontact'];
  423. print $contactstatic->getNomUrl(1);
  424. }
  425. print '</td>';
  426. // Type de contact
  427. print '<td>'.$tab[$i]['libelle'].'</td>';
  428. // Statut
  429. print '<td class="center">';
  430. // Activation desativation du contact
  431. if ($object->statut >= 0) {
  432. print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].($withproject ? '&withproject=1' : '').'">';
  433. }
  434. print $contactstatic->LibStatut($tab[$i]['status'], 3);
  435. if ($object->statut >= 0) {
  436. print '</a>';
  437. }
  438. print '</td>';
  439. // Icon update et delete
  440. print '<td class="center nowrap">';
  441. if ($user->rights->projet->creer) {
  442. print '&nbsp;';
  443. print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteline&token='.newToken().'&lineid='.$tab[$i]['rowid'].($withproject ? '&withproject=1' : '').'">';
  444. print img_picto($langs->trans('Unlink'), 'unlink');
  445. print '</a>';
  446. }
  447. print '</td>';
  448. print "</tr>\n";
  449. $i++;
  450. }
  451. }
  452. print "</table>";
  453. print "</form>";
  454. } else {
  455. print "ErrorRecordNotFound";
  456. }
  457. }
  458. if (is_object($hookmanager)) {
  459. $hookmanager->initHooks(array('contacttpl'));
  460. $parameters = array();
  461. $reshook = $hookmanager->executeHooks('formContactTpl', $parameters, $object, $action);
  462. }
  463. // End of page
  464. llxFooter();
  465. $db->close();