PageRenderTime 58ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/core/lib/member.lib.php

https://github.com/asterix14/dolibarr
PHP | 172 lines | 93 code | 31 blank | 48 comment | 5 complexity | 10c5f38fac5dbd1549cbadcd9c426f15 MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. * or see http://www.gnu.org/
  17. */
  18. /**
  19. * \file htdocs/core/lib/member.lib.php
  20. * \brief Ensemble de fonctions de base pour les adherents
  21. */
  22. /**
  23. * Return array head with list of tabs to view object informations
  24. * @param object Member
  25. * @return array head
  26. */
  27. function member_prepare_head($object)
  28. {
  29. global $langs, $conf, $user;
  30. $h = 0;
  31. $head = array();
  32. $head[$h][0] = DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$object->id;
  33. $head[$h][1] = $langs->trans("MemberCard");
  34. $head[$h][2] = 'general';
  35. $h++;
  36. if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
  37. {
  38. $langs->load("ldap");
  39. $head[$h][0] = DOL_URL_ROOT.'/adherents/ldap.php?id='.$object->id;
  40. $head[$h][1] = $langs->trans("LDAPCard");
  41. $head[$h][2] = 'ldap';
  42. $h++;
  43. }
  44. if (! empty($user->rights->adherent->cotisation->lire))
  45. {
  46. $head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$object->id;
  47. $head[$h][1] = $langs->trans("Subscriptions");
  48. $head[$h][2] = 'subscription';
  49. $h++;
  50. }
  51. // Show category tab
  52. if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
  53. {
  54. $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3';
  55. $head[$h][1] = $langs->trans('Categories');
  56. $head[$h][2] = 'category';
  57. $h++;
  58. }
  59. // Show more tabs from modules
  60. // Entries must be declared in modules descriptor with line
  61. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  62. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  63. complete_head_from_modules($conf,$langs,$object,$head,$h,'member');
  64. $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
  65. $head[$h][1] = $langs->trans("Note");
  66. $head[$h][2] = 'note';
  67. $h++;
  68. $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
  69. $head[$h][1] = $langs->trans("Documents");
  70. $head[$h][2] = 'document';
  71. $h++;
  72. $head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$object->id;
  73. $head[$h][1] = $langs->trans("Info");
  74. $head[$h][2] = 'info';
  75. $h++;
  76. return $head;
  77. }
  78. /**
  79. * Return array head with list of tabs to view object informations
  80. * @param object Member
  81. * @return array head
  82. */
  83. function member_admin_prepare_head($object)
  84. {
  85. global $langs, $conf, $user;
  86. $h = 0;
  87. $head = array();
  88. $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent.php';
  89. $head[$h][1] = $langs->trans("Miscellanous");
  90. $head[$h][2] = 'general';
  91. $h++;
  92. // Show more tabs from modules
  93. // Entries must be declared in modules descriptor with line
  94. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  95. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  96. complete_head_from_modules($conf,$langs,$object,$head,$h,'member_admin');
  97. $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_extrafields.php';
  98. $head[$h][1] = $langs->trans("ExtraFields");
  99. $head[$h][2] = 'attributes';
  100. $h++;
  101. $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/public.php';
  102. $head[$h][1] = $langs->trans("BlankSubscriptionForm");
  103. $head[$h][2] = 'public';
  104. $h++;
  105. complete_head_from_modules($conf,$langs,$object,$head,$h,'member_admin','remove');
  106. return $head;
  107. }
  108. /**
  109. * Return array head with list of tabs to view object stats informations
  110. * @param object Member
  111. * @return array head
  112. */
  113. function member_stats_prepare_head($object)
  114. {
  115. global $langs, $conf, $user;
  116. $h = 0;
  117. $head = array();
  118. $head[$h][0] = DOL_URL_ROOT.'/adherents/stats/index.php';
  119. $head[$h][1] = $langs->trans("Subscriptions");
  120. $head[$h][2] = 'statssubscription';
  121. $h++;
  122. $head[$h][0] = DOL_URL_ROOT.'/adherents/stats/geo.php?mode=memberbycountry';
  123. $head[$h][1] = $langs->trans("Country");
  124. $head[$h][2] = 'statscountry';
  125. $h++;
  126. $head[$h][0] = DOL_URL_ROOT.'/adherents/stats/geo.php?mode=memberbystate';
  127. $head[$h][1] = $langs->trans("State");
  128. $head[$h][2] = 'statsstate';
  129. $h++;
  130. $head[$h][0] = DOL_URL_ROOT.'/adherents/stats/geo.php?mode=memberbytown';
  131. $head[$h][1] = $langs->trans('Town');
  132. $head[$h][2] = 'statstown';
  133. $h++;
  134. // Show more tabs from modules
  135. // Entries must be declared in modules descriptor with line
  136. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  137. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  138. complete_head_from_modules($conf,$langs,$object,$head,$h,'member_stats');
  139. return $head;
  140. }
  141. ?>