note.php 3.8 KB

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