PageRenderTime 99ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/contact/exportimport.php

https://github.com/asterix14/dolibarr
PHP | 109 lines | 49 code | 28 blank | 32 comment | 3 complexity | c4802e525f753e2ec6e15b7b29a42969 MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2006 Regis Houssin <regis@dolibarr.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 2 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 <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/contact/exportimport.php
  20. * \ingroup societe
  21. * \brief Onglet exports-imports d'un contact
  22. */
  23. require("../main.inc.php");
  24. require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
  25. require_once(DOL_DOCUMENT_ROOT."/core/lib/contact.lib.php");
  26. $langs->load("companies");
  27. // Security check
  28. $contactid = isset($_GET["id"])?$_GET["id"]:'';
  29. if ($user->societe_id) $socid=$user->societe_id;
  30. $result = restrictedArea($user, 'contact', $contactid, 'socpeople');
  31. /*
  32. * View
  33. */
  34. llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
  35. $form = new Form($db);
  36. $contact = new Contact($db);
  37. $contact->fetch($_GET["id"], $user);
  38. $head = contact_prepare_head($contact);
  39. dol_fiche_head($head, 'exportimport', $langs->trans("ContactsAddresses"), 0, 'contact');
  40. /*
  41. * Fiche en mode visu
  42. */
  43. print '<table class="border" width="100%">';
  44. // Ref
  45. print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
  46. print $form->showrefnav($contact,'id');
  47. print '</td></tr>';
  48. // Name
  49. print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->name.'</td>';
  50. print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
  51. // Company
  52. if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
  53. {
  54. if ($contact->socid > 0)
  55. {
  56. $objsoc = new Societe($db);
  57. $objsoc->fetch($contact->socid);
  58. print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
  59. }
  60. else
  61. {
  62. print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
  63. print $langs->trans("ContactNotLinkedToCompany");
  64. print '</td></tr>';
  65. }
  66. }
  67. // Civility
  68. print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
  69. print $contact->getCivilityLabel();
  70. print '</td></tr>';
  71. print '</table>';
  72. print '</div>';
  73. print '<br>';
  74. print $langs->trans("ExportCardToFormat").': ';
  75. print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$_GET["id"].'">';
  76. print img_picto($langs->trans("VCard"),'vcard.png').' ';
  77. print $langs->trans("VCard");
  78. print '</a>';
  79. $db->close();
  80. llxFooter();
  81. ?>