note.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /* Copyright (C) 2001-2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
  5. * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
  6. * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/contact/note.php
  23. * \brief Tab for notes on contact
  24. * \ingroup societe
  25. */
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
  29. $action = GETPOST('action','aZ09');
  30. // Load translation files required by the page
  31. $langs->load("companies");
  32. // Security check
  33. $id = GETPOST('id','int');
  34. if ($user->societe_id) $id=$user->societe_id;
  35. $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
  36. $object = new Contact($db);
  37. if ($id > 0) $object->fetch($id);
  38. $permissionnote=$user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
  39. /*
  40. * Actions
  41. */
  42. include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
  43. /*
  44. * View
  45. */
  46. $now=dol_now();
  47. $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
  48. $form = new Form($db);
  49. $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
  50. llxHeader('', $title, $help_url);
  51. if ($id > 0)
  52. {
  53. /*
  54. * Affichage onglets
  55. */
  56. if (! empty($conf->notification->enabled)) $langs->load("mails");
  57. $head = contact_prepare_head($object);
  58. dol_fiche_head($head, 'note', $title, -1, 'contact');
  59. $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  60. $morehtmlref='<div class="refidno">';
  61. if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
  62. {
  63. $objsoc=new Societe($db);
  64. $objsoc->fetch($object->socid);
  65. // Thirdparty
  66. $morehtmlref.=$langs->trans('ThirdParty') . ' : ';
  67. if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
  68. else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
  69. }
  70. $morehtmlref.='</div>';
  71. dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
  72. $cssclass='titlefield';
  73. //if ($action == 'editnote_public') $cssclass='titlefieldcreate';
  74. //if ($action == 'editnote_private') $cssclass='titlefieldcreate';
  75. print '<div class="fichecenter">';
  76. print '<div class="underbanner clearboth"></div>';
  77. print '<table class="border centpercent">';
  78. // Civility
  79. print '<tr><td class="'.$cssclass.'">'.$langs->trans("UserTitle").'</td><td>';
  80. print $object->getCivilityLabel();
  81. print '</td></tr>';
  82. print "</table>";
  83. $cssclass="titlefield";
  84. include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
  85. print '</div>';
  86. dol_fiche_end();
  87. }
  88. llxFooter();
  89. $db->close();