info.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. // Load Dolibarr environment
  25. require '../main.inc.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
  29. // Load translation files required by the page
  30. $langs->load("companies");
  31. // Security check
  32. $id = GETPOST("id", 'int');
  33. if ($user->socid) {
  34. $socid = $user->socid;
  35. }
  36. $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
  37. $object = new Contact($db);
  38. /*
  39. * View
  40. */
  41. $form = new Form($db);
  42. $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
  43. llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
  44. if ($id > 0) {
  45. $result = $object->fetch($id, $user);
  46. $object->info($id);
  47. $head = contact_prepare_head($object);
  48. print dol_get_fiche_head($head, 'info', $title, -1, 'contact');
  49. $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  50. dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
  51. print '<div class="fichecenter">';
  52. print '<div class="underbanner clearboth"></div>';
  53. print '<br>';
  54. dol_print_object_info($object);
  55. print '</div>';
  56. print dol_get_fiche_end();
  57. }
  58. llxFooter();
  59. $db->close();