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

/htdocs/adherent/lib/member.lib.php

https://bitbucket.org/speedealing/speedealing
PHP | 161 lines | 81 code | 28 blank | 52 comment | 5 complexity | 5c9c511a4a68e8d427988b6f29c92388 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  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 3 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. *
  25. * @param Object $object Member
  26. * @return array head
  27. */
  28. function member_prepare_head($object)
  29. {
  30. global $langs, $conf, $user;
  31. $h = 0;
  32. $head = array();
  33. $head[$h][0] = DOL_URL_ROOT.'/adherent/fiche.php?id='.$object->id;
  34. $head[$h][1] = $langs->trans("MemberCard");
  35. $head[$h][2] = 'general';
  36. $h++;
  37. if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
  38. {
  39. $langs->load("ldap");
  40. $head[$h][0] = DOL_URL_ROOT.'/adherent/ldap.php?id='.$object->id;
  41. $head[$h][1] = $langs->trans("LDAPCard");
  42. $head[$h][2] = 'ldap';
  43. $h++;
  44. }
  45. // Show agenda tab
  46. if (! empty($conf->agenda->enabled))
  47. {
  48. $head[$h][0] = DOL_URL_ROOT."/adherent/agenda.php?id=".$object->id;
  49. $head[$h][1] = $langs->trans('Agenda');
  50. $head[$h][2] = 'agenda';
  51. $h++;
  52. }
  53. // Show category tab
  54. if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
  55. {
  56. $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3';
  57. $head[$h][1] = $langs->trans('Categories');
  58. $head[$h][2] = 'category';
  59. $h++;
  60. }
  61. // Show more tabs from modules
  62. // Entries must be declared in modules descriptor with line
  63. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  64. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  65. complete_head_from_modules($conf,$langs,$object,$head,$h,'member');
  66. return $head;
  67. }
  68. /**
  69. * Return array head with list of tabs to view object informations
  70. *
  71. * @param Object $object Member
  72. * @return array head
  73. */
  74. function member_admin_prepare_head($object)
  75. {
  76. global $langs, $conf, $user;
  77. $h = 0;
  78. $head = array();
  79. $head[$h][0] = DOL_URL_ROOT.'/adherent/admin/adherent.php';
  80. $head[$h][1] = $langs->trans("Miscellanous");
  81. $head[$h][2] = 'general';
  82. $h++;
  83. // Show more tabs from modules
  84. // Entries must be declared in modules descriptor with line
  85. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  86. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  87. complete_head_from_modules($conf,$langs,$object,$head,$h,'member_admin');
  88. $head[$h][0] = DOL_URL_ROOT.'/adherent/admin/adherent_extrafields.php';
  89. $head[$h][1] = $langs->trans("ExtraFields");
  90. $head[$h][2] = 'attributes';
  91. $h++;
  92. $head[$h][0] = DOL_URL_ROOT.'/adherent/admin/public.php';
  93. $head[$h][1] = $langs->trans("BlankSubscriptionForm");
  94. $head[$h][2] = 'public';
  95. $h++;
  96. complete_head_from_modules($conf,$langs,$object,$head,$h,'member_admin','remove');
  97. return $head;
  98. }
  99. /**
  100. * Return array head with list of tabs to view object stats informations
  101. *
  102. * @param Object $object Member or null
  103. * @return array head
  104. */
  105. function member_stats_prepare_head($object)
  106. {
  107. global $langs, $conf, $user;
  108. $h = 0;
  109. $head = array();
  110. $head[$h][0] = DOL_URL_ROOT.'/adherent/stats/index.php';
  111. $head[$h][1] = $langs->trans("Subscriptions");
  112. $head[$h][2] = 'statssubscription';
  113. $h++;
  114. $head[$h][0] = DOL_URL_ROOT.'/adherent/stats/geo.php?mode=memberbycountry';
  115. $head[$h][1] = $langs->trans("Country");
  116. $head[$h][2] = 'statscountry';
  117. $h++;
  118. $head[$h][0] = DOL_URL_ROOT.'/adherent/stats/geo.php?mode=memberbystate';
  119. $head[$h][1] = $langs->trans("State");
  120. $head[$h][2] = 'statsstate';
  121. $h++;
  122. $head[$h][0] = DOL_URL_ROOT.'/adherents/stats/geo.php?mode=memberbytown';
  123. $head[$h][1] = $langs->trans('Town');
  124. $head[$h][2] = 'statstown';
  125. $h++;
  126. // Show more tabs from modules
  127. // Entries must be declared in modules descriptor with line
  128. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  129. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  130. complete_head_from_modules($conf,$langs,$object,$head,$h,'member_stats');
  131. return $head;
  132. }
  133. ?>