info.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2015 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/contact/info.php
  21. * \ingroup societe
  22. * \brief Onglet info d'un contact
  23. */
  24. require '../main.inc.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
  28. // Load translation files required by the page
  29. $langs->load("companies");
  30. // Security check
  31. $id = GETPOST("id", 'int');
  32. if ($user->socid) {
  33. $socid = $user->socid;
  34. }
  35. $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
  36. $object = new Contact($db);
  37. /*
  38. * View
  39. */
  40. $form = new Form($db);
  41. $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
  42. llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
  43. if ($id > 0) {
  44. $result = $object->fetch($id, $user);
  45. $object->info($id);
  46. $head = contact_prepare_head($object);
  47. print dol_get_fiche_head($head, 'info', $title, -1, 'contact');
  48. $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  49. dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
  50. print '<div class="fichecenter">';
  51. print '<div class="underbanner clearboth"></div>';
  52. print '<br>';
  53. dol_print_object_info($object);
  54. print '</div>';
  55. print dol_get_fiche_end();
  56. }
  57. llxFooter();
  58. $db->close();