note.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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', 'alpha');
  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. {
  38. $adht = new AdherentType($db);
  39. $result=$adht->fetch($object->typeid);
  40. }
  41. $permissionnote=$user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
  42. /*
  43. * Actions
  44. */
  45. include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
  46. /*
  47. * View
  48. */
  49. $title=$langs->trans("Member") . " - " . $langs->trans("Note");
  50. $helpurl="EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros";
  51. llxHeader("", $title, $helpurl);
  52. $form = new Form($db);
  53. if ($id)
  54. {
  55. $head = member_prepare_head($object);
  56. dol_fiche_head($head, 'note', $langs->trans("Member"), -1, 'user');
  57. print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
  58. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  59. $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  60. dol_banner_tab($object, 'rowid', $linkback);
  61. print '<div class="fichecenter">';
  62. print '<div class="underbanner clearboth"></div>';
  63. print '<table class="border centpercent tableforfield">';
  64. // Login
  65. if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
  66. {
  67. print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
  68. }
  69. // Type
  70. print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
  71. // Morphy
  72. print '<tr><td class="titlefield">'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
  73. /*print '<td rowspan="'.$rowspan.'" class="center" valign="middle" width="25%">';
  74. print $form->showphoto('memberphoto',$member);
  75. print '</td>';*/
  76. print '</tr>';
  77. // Company
  78. print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
  79. // Civility
  80. print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
  81. print '</tr>';
  82. print "</table>";
  83. print '</div>';
  84. $cssclass='titlefield';
  85. $permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
  86. include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
  87. dol_fiche_end();
  88. }
  89. // End of page
  90. llxFooter();
  91. $db->close();