parametersMenuBuilder.ts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import AbstractMenuBuilder from '~/services/layout/menuBuilder/abstractMenuBuilder'
  2. import type {MenuGroup, MenuItems} from "~/types/layout";
  3. /**
  4. * Menu Paramètres
  5. */
  6. export default class ParametersMenuBuilder extends AbstractMenuBuilder {
  7. static readonly menuName = "Parameters"
  8. /**
  9. * Construit le menu Header Configuration, ou null si aucune page accessible
  10. */
  11. build(): MenuGroup | null {
  12. const children: MenuItems = []
  13. if (!this.ability.can('display', 'parameters_page')) {
  14. return null
  15. }
  16. children.push(this.createItem('general_parameters', {name: 'fas fa-gears'},`/parameters/general_parameters`))
  17. children.push(this.createItem('website', {name: 'fas fa-globe-americas'},`/parameters/website`))
  18. if (this.organizationProfile.isSchool) {
  19. children.push(this.createItem('teaching', {name: 'fas fa-school'}, `/parameters/teaching`))
  20. children.push(this.createItem('intranet_breadcrumbs', {name: 'fas fa-arrows-down-to-people'}, `/parameters/intranet`))
  21. children.push(this.createItem('educationNotations', {name: 'fas fa-graduation-cap'}, `/parameters/education_notation`))
  22. children.push(this.createItem('bulletin', {name: 'fas fa-file-lines'}, `/parameters/bulletin`))
  23. children.push(this.createItem('education_timings_breadcrumbs', {name: 'fas fa-clock'}, `/parameters/education_timings`))
  24. children.push(this.createItem('attendance', {name: 'fas fa-user-times'}, `/parameters/attendances`))
  25. children.push(this.createItem('residenceAreas', {name: 'fas fa-location-dot'}, `/parameters/residence_areas`))
  26. }
  27. if (this.organizationProfile.hasModule('Sms')) {
  28. children.push(this.createItem('sms_option', {name: 'fas fa-mobile'}, `/parameters/sms`))
  29. }
  30. children.push(this.createItem('super_admin', {name: 'fas fa-user-gear'},`/parameters/super_admin`))
  31. // Voir nouveau découpage?
  32. // if (this.ability.can('display', 'parameters_page')) {
  33. // children.push(this.createItem('general_params', {name: 'fas fa-cogs'},`/parameters`, MENU_LINK_TYPE.V1))
  34. // }
  35. // if (this.ability.can('display', 'parameters_communication_page')) {
  36. // children.push(this.createItem('communication_params', {name: 'fas fa-comments'},`/parameters/communication`, MENU_LINK_TYPE.V1))
  37. // }
  38. // if (this.ability.can('display', 'parameters_student_page')) {
  39. // children.push(this.createItem('students_params', {name: 'fas fa-users'},`/parameters/student`, MENU_LINK_TYPE.V1))
  40. // }
  41. // if (this.ability.can('display', 'parameters_education_page')) {
  42. // children.push(this.createItem('education_params', {name: 'fas fa-graduation-cap'},`/parameters/education`, MENU_LINK_TYPE.V1))
  43. // }
  44. // if (this.ability.can('display', 'parameters_bills_page')) {
  45. // children.push(this.createItem('bills_params', {name: 'fas fa-euro-sign'},`/parameters/billing`, MENU_LINK_TYPE.V1))
  46. // }
  47. // if (this.ability.can('display', 'parameters_secure_page')) {
  48. // children.push(this.createItem('secure_params', {name: 'fas fa-lock'},`/parameters/secure`, MENU_LINK_TYPE.V1))
  49. // }
  50. if (children.length > 0) {
  51. return this.createGroup('parameters', undefined, children)
  52. }
  53. return null
  54. }
  55. }