-
Notifications
You must be signed in to change notification settings - Fork 0
/
counselling.routing.inc
361 lines (316 loc) · 12.6 KB
/
counselling.routing.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<?php
/**
* Implements hook_menu().
*/
function counselling_menu() {
$items = [];
// Patient routes
$items['bereavement-counselling'] = [
'title' => 'Bereavement counselling service',
'page callback' => '\Drupal\\counselling\\Controller\\BereavementCounselling::build',
'access arguments' => ['create patient profile'],
'type' => MENU_CALLBACK,
];
$items['bereavement-counselling/thank-you/%'] = [
'title' => 'Thank you',
'title arguments' => [2],
'page callback' => '\Drupal\\counselling\\Controller\\ThankYou::build',
'page arguments' => [2],
'access arguments' => ['create patient profile'],
'type' => MENU_CALLBACK,
];
$items['bereavement-counselling/register/your-details'] = [
'title' => 'Register for online bereavement counselling service',
'page callback' => '\Drupal\\counselling\\Controller\\PatientRegistration::details',
'access callback' => 'counselling_booking_access',
'access arguments' => [1],
'type' => MENU_CALLBACK,
'file' => 'src/Form/patient_register_form.php',
];
$items['bereavement-counselling/register/your-assessment'] = [
'title' => 'Book your appointment',
'page callback' => '\Drupal\\counselling\\Controller\\PatientRegistration::assessment',
'access callback' => 'counselling_booking_access',
'access arguments' => [1],
'type' => MENU_CALLBACK,
'file' => 'src/Form/patient_booking_form.php',
];
$items['bereavement-counselling/register/confirm'] = [
'title' => 'Confirm your assessment booking',
'page callback' => '\Drupal\\counselling\\Controller\\PatientRegistration::confirm',
'access callback' => 'counselling_booking_access',
'access arguments' => [1],
'type' => MENU_CALLBACK,
'file' => 'src/Form/patient_confirm_form.php',
];
$items['bereavement-counselling/book/new'] = [
'title' => 'Book your appointment',
'page callback' => '\Drupal\\counselling\\Controller\\PatientBooking::book',
'access callback' => 'counselling_booking_access',
'access arguments' => [1],
'type' => MENU_CALLBACK,
'file' => 'src/Form/patient_booking_form.php',
];
$items['bereavement-counselling/book/confirm'] = [
'title' => 'Confirm your booking',
'page callback' => '\Drupal\\counselling\\Controller\\PatientBooking::confirm',
'access callback' => 'counselling_booking_access',
'access arguments' => [1],
'type' => MENU_CALLBACK,
'file' => 'src/Form/patient_confirm_form.php',
];
$items['bereavement-counselling/booking-confirmation'] = [
'title' => 'Your video support session has been booked',
'title callback' => 'counselling_booking_confirmation_title',
'page callback' => '\Drupal\\counselling\\Controller\\BookingConfirmation::build',
'access arguments' => ['create patient profile'],
'type' => MENU_CALLBACK,
];
$items['user/%user/counselling/patient'] = [
'title' => 'Counselling',
'page callback' => '\Drupal\\counselling\\Controller\\PatientProfile::redirect',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['view', 1],
'file' => 'src/Form/patient_manage_form.php',
'type' => MENU_LOCAL_TASK,
'weight' => 99,
];
$items['user/%user/counselling/patient/appointments'] = [
'title' => 'Appointments',
'page callback' => '\Drupal\\counselling\\Controller\\PatientProfile::appointments',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['appointments', 1],
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 0,
];
$items['user/%user/counselling/patient/book-appointment'] = [
'title' => 'Book Appointment',
'page callback' => '\Drupal\\counselling\\Controller\\PatientProfile::book',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['book', 1],
'type' => MENU_LOCAL_TASK,
'weight' => 1,
];
$items['user/%user/counselling/patient/view'] = [
'title' => 'View profile',
'page callback' => '\Drupal\\counselling\\Controller\\PatientProfile::view',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['view', 1],
'type' => MENU_LOCAL_TASK,
'weight' => 2,
];
$items['user/%user/counselling/patient/edit'] = [
'title' => 'Edit profile',
'page callback' => '\Drupal\\counselling\\Controller\\PatientProfile::edit',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['edit', 1],
'file' => 'src/Form/patient_manage_form.php',
'type' => MENU_LOCAL_TASK,
'weight' => 3,
];
$items['user/%user/counselling/disable'] = [
'title' => 'Leave counselling service',
'page callback' => '\Drupal\\counselling\\Controller\\LeaveService::build',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['leave', 1],
'type' => MENU_CALLBACK,
'file' => 'src/Form/counselling_leave_form.php',
];
$items['user/%user/counselling/patient/enable'] = [
'title' => 'Re-enable profile',
'page callback' => '\Drupal\\counselling\\Controller\\PatientProfile::enable',
'page arguments' => [1],
'access callback' => 'patient_user_access',
'access arguments' => ['enable', 1],
'file' => 'src/Form/patient_enable_form.php',
'type' => MENU_CALLBACK,
'weight' => 3,
];
// Admin routes
$items['admin/counselling'] = [
'title' => t('Counselling'),
'page callback' => '\Drupal\\counselling\\Controller\\AdminPages::redirect',
'type' => MENU_NORMAL_ITEM,
'access arguments' => ['edit any appointment'],
];
$items['admin/counselling/appointments'] = [
'title' => t('Appointments'),
'page callback' => '\Drupal\\counselling\\Controller\\AdminPages::appointments',
'type' => MENU_LOCAL_TASK,
'access arguments' => ['edit any appointment'],
'weight' => 0,
];
$items['admin/counselling/practitioners'] = [
'title' => t('Practitioners'),
'page callback' => '\Drupal\\counselling\\Controller\\AdminPages::practitioners',
'type' => MENU_LOCAL_TASK,
'access arguments' => ['edit any practitioner profile'],
'weight' => 1,
];
$items['admin/counselling/patients'] = [
'title' => t('Patients'),
'page callback' => '\Drupal\\counselling\\Controller\\AdminPages::patients',
'type' => MENU_LOCAL_TASK,
'access arguments' => ['view any patient profile'],
'weight' => 2,
];
$items['admin/counselling/settings'] = [
'title' => t('Settings'),
'page callback' => '\Drupal\\counselling\\Controller\\AdminPages::settings',
'type' => MENU_LOCAL_TASK,
'access arguments' => ['administer appointment'],
'weight' => 3,
'file' => 'src/Form/counselling_settings_form.php',
];
$items['admin/counselling/email-test'] = [
'title' => t('Test email'),
'page callback' => 'drupal_get_form',
'page arguments' => ['counselling_email_test_form'],
'type' => MENU_LOCAL_TASK,
'access arguments' => ['administer appointment'],
'weight' => 4,
'file' => 'src/Form/counselling_email_test_form.php',
];
$items['admin/content/appointment/%appointment/cancel'] = [
'type' => MENU_CALLBACK,
'title' => 'Cancel Appointment',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentCancel::admin',
'page arguments' => [3],
'access callback' => 'appointment_access',
'access arguments' => ['cancel', 3],
'file' => 'src/Form/appointment_cancel_form.php',
];
$items['admin/content/appointment/%appointment/assign'] = [
'type' => MENU_CALLBACK,
'title' => 'Assign patient',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentAssign::build',
'page arguments' => [3],
'access callback' => 'appointment_access',
'access arguments' => ['assign', 3],
'file' => 'src/Form/appointment_assign_form.php',
];
// Practitioner routes
$items['user/%user/counselling/practitioner'] = [
'title' => 'Counselling',
'page callback' => '\Drupal\\counselling\\Controller\\PractitionerProfile::redirect',
'page arguments' => [1],
'access arguments' => ['view own practitioner profile'],
'file' => 'src/Form/practitioner_manage_form.php',
'type' => MENU_LOCAL_TASK,
'weight' => 99,
];
$items['user/%user/counselling/practitioner/appointments'] = [
'title' => 'Appointments',
'page callback' => '\Drupal\\counselling\\Controller\\PractitionerProfile::appointments',
'page arguments' => [1],
'access arguments' => ['create appointment'],
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 0,
];
$items['user/%user/counselling/practitioner/create-appointment'] = [
'title' => 'Add appointment',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentCreate::build',
'page arguments' => [1],
'access arguments' => ['create appointment'],
'type' => MENU_LOCAL_TASK,
'weight' => 1,
];
$items['user/%user/counselling/practitioner/view'] = [
'title' => 'View profile',
'page callback' => '\Drupal\\counselling\\Controller\\PractitionerProfile::view',
'page arguments' => [1],
'access callback' => 'practitioner_user_access',
'access arguments' => ['view', 1],
'type' => MENU_LOCAL_TASK,
'file' => 'src/Form/practitioner_manage_form.php',
'weight' => 2,
];
$items['user/%user/counselling/practitioner/edit'] = [
'title' => 'Edit profile',
'page callback' => '\Drupal\\counselling\\Controller\\PractitionerProfile::edit',
'page arguments' => [1],
'access callback' => 'practitioner_user_access',
'access arguments' => ['edit', 1],
'file' => 'src/Form/practitioner_manage_form.php',
'type' => MENU_LOCAL_TASK,
'weight' => 3,
];
$items['user/%user/counselling/practitioner/create'] = [
'title' => 'Create',
'type' => MENU_CALLBACK,
'page callback' => '\Drupal\\counselling\\Controller\\PractitionerProfile::create',
'page arguments' => [1],
'access callback' => 'practitioner_user_access',
'access arguments' => ['create', 1],
'file' => 'src/Form/practitioner_manage_form.php',
];
// Appointment routes
$items['appointment/%appointment/cancel'] = [
'type' => MENU_CALLBACK,
'title' => 'Cancel Appointment',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentCancel::build',
'page arguments' => [1],
'access callback' => 'appointment_access',
'access arguments' => ['cancel', 1],
'file' => 'src/Form/appointment_cancel_form.php',
];
$items['appointment/%appointment/update'] = [
'type' => MENU_CALLBACK,
'title' => 'Update Appointment',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentUpdate::build',
'page arguments' => [1],
'access callback' => 'appointment_access',
'access arguments' => ['update', 1],
'file' => 'src/Form/appointment_update_form.php',
];
$items['appointment/%appointment/feedback'] = [
'type' => MENU_CALLBACK,
'title' => 'Leave feedback',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentFeedback::build',
'page arguments' => [1],
'access callback' => 'appointment_access',
'access arguments' => ['feedback', 1],
'file' => 'src/Form/appointment_feedback_form.php',
];
$items['appointment/%appointment/change'] = [
'type' => MENU_CALLBACK,
'title' => 'Change appointment',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentChange::build',
'page arguments' => [1],
'access callback' => 'appointment_access',
'access arguments' => ['change', 1],
'file' => 'src/Form/appointment_change_form.php',
];
$items['appointment/%appointment/room'] = [
'type' => MENU_CALLBACK,
'title' => 'Room',
'page callback' => '\Drupal\\counselling\\Controller\\AppointmentRoom::build',
'page arguments' => [1],
'access callback' => 'appointment_access',
'access arguments' => ['room', 1],
];
// Entity public routes
$items['bereavement-counselling/practitioner/%practitioner'] = [
'type' => MENU_CALLBACK,
'title callback' => 'counselling_profile_title',
'title arguments' => [1,2],
'page callback' => '\Drupal\\counselling\\Controller\\PractitionerPublic::build',
'page arguments' => [2],
'access arguments' => ['view any practitioner badge'],
];
$items['bereavement-counselling/patient/%patient'] = [
'type' => MENU_CALLBACK,
'title callback' => 'counselling_profile_title',
'title arguments' => [1,2],
'page callback' => '\Drupal\\counselling\\Controller\\PatientPublic::build',
'page arguments' => [2],
'access arguments' => ['view any patient profile'],
];
return $items;
}