note.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
  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/adherents/note.php
  21. * \ingroup member
  22. * \brief Tab for note of a member
  23. */
  24. require '../main.inc.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
  28. // Load translation files required by the page
  29. $langs->loadLangs(array("companies", "members", "bills"));
  30. $action = GETPOST('action', 'aZ09');
  31. $id = GETPOST('id', 'int');
  32. // Security check
  33. $result = restrictedArea($user, 'adherent', $id);
  34. $object = new Adherent($db);
  35. $result = $object->fetch($id);
  36. if ($result > 0) {
  37. $adht = new AdherentType($db);
  38. $result = $adht->fetch($object->typeid);
  39. }
  40. $permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
  41. /*
  42. * Actions
  43. */
  44. include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
  45. /*
  46. * View
  47. */
  48. $title = $langs->trans("Member")." - ".$langs->trans("Note");
  49. $helpurl = "EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros";
  50. llxHeader("", $title, $helpurl);
  51. $form = new Form($db);
  52. if ($id) {
  53. $head = member_prepare_head($object);
  54. print dol_get_fiche_head($head, 'note', $langs->trans("Member"), -1, 'user');
  55. print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
  56. print '<input type="hidden" name="token" value="'.newToken().'">';
  57. $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  58. dol_banner_tab($object, 'id', $linkback);
  59. print '<div class="fichecenter">';
  60. print '<div class="underbanner clearboth"></div>';
  61. print '<table class="border centpercent tableforfield">';
  62. // Login
  63. if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
  64. print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
  65. }
  66. // Type
  67. print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
  68. // Morphy
  69. print '<tr><td class="titlefield">'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
  70. /*print '<td rowspan="'.$rowspan.'" class="center" valign="middle" width="25%">';
  71. print $form->showphoto('memberphoto',$member);
  72. print '</td>';*/
  73. print '</tr>';
  74. // Company
  75. print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
  76. // Civility
  77. print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
  78. print '</tr>';
  79. print "</table>";
  80. print '</div>';
  81. $cssclass = 'titlefield';
  82. $permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
  83. include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
  84. print dol_get_fiche_end();
  85. }
  86. // End of page
  87. llxFooter();
  88. $db->close();