1
1
<?php
2
2
3
3
/**
4
- * API access to booking data
4
+ * API access to booking data for Rooms
5
5
*/
6
6
7
7
/**
8
8
* Implements hook_ctools_plugin_api().
9
9
*/
10
- function bam_api_ctools_plugin_api ($module = NULL, $api = NULL) {
10
+ function bat_api_ctools_plugin_api ($module = NULL, $api = NULL) {
11
11
if ($module == "services" && $api == "services") {
12
12
return array("version" => "3");
13
13
}
@@ -16,16 +16,16 @@ function bam_api_ctools_plugin_api($module = NULL, $api = NULL) {
16
16
/**
17
17
* Implements hook_ctools_plugin_directory().
18
18
*/
19
- function bam_api_ctools_plugin_directory ($owner, $plugin_type) {
20
- if ($owner == 'bam_api ' && $plugin_type == 'rooms_unit_field_handler') {
19
+ function bat_api_ctools_plugin_directory ($owner, $plugin_type) {
20
+ if ($owner == 'bat_api ' && $plugin_type == 'rooms_unit_field_handler') {
21
21
return 'plugins/rooms_unit_field_handler';
22
22
}
23
23
}
24
24
25
25
/**
26
26
* Implements hook_ctools_plugin_type().
27
27
*/
28
- function bam_api_ctools_plugin_type () {
28
+ function bat_api_ctools_plugin_type () {
29
29
return array(
30
30
'rooms_unit_field_handler' => array(
31
31
'use hooks' => TRUE,
@@ -36,7 +36,7 @@ function bam_api_ctools_plugin_type() {
36
36
/**
37
37
* Implements hook_permission()
38
38
*/
39
- function bam_api_permission () {
39
+ function bat_api_permission () {
40
40
return array(
41
41
'access units index service' => array(
42
42
'title' => t('Access units index service'),
@@ -76,14 +76,14 @@ function bam_api_permission() {
76
76
/**
77
77
* Implements hook_services_resources().
78
78
*/
79
- function bam_api_services_resources () {
79
+ function bat_api_services_resources () {
80
80
$resources = array();
81
81
82
82
$resources['units'] = array(
83
83
'operations' => array(
84
84
'index' => array(
85
- 'callback' => 'bam_api_services_units_index ',
86
- 'help' => t('Returns an object containing rooms units information.'),
85
+ 'callback' => 'bat_api_services_units_index ',
86
+ 'help' => t('Returns an object containing bookable unit information.'),
87
87
'access arguments' => array('access units index service'),
88
88
'args' => array(
89
89
array(
@@ -113,9 +113,9 @@ function bam_api_services_resources() {
113
113
),
114
114
),
115
115
'update' => array(
116
- 'callback' => 'bam_api_services_edit_unit ',
116
+ 'callback' => 'bat_api_services_edit_unit ',
117
117
'access arguments' => array('access edit unit service'),
118
- 'help' => t('Edit an existing Rooms Unit.'),
118
+ 'help' => t('Edit an existing Bookable Unit.'),
119
119
'args' => array(
120
120
array(
121
121
'name' => 'unit_id',
@@ -136,9 +136,9 @@ function bam_api_services_resources() {
136
136
),
137
137
'actions' => array(
138
138
'add' => array(
139
- 'callback' => 'bam_api_services_add_unit ',
139
+ 'callback' => 'bat_api_services_add_unit ',
140
140
'access arguments' => array('access add unit service'),
141
- 'help' => t('Add a new Rooms Unit.'),
141
+ 'help' => t('Add a new Bookable Unit.'),
142
142
'args' => array(
143
143
array(
144
144
'name' => 'name',
@@ -183,7 +183,7 @@ function bam_api_services_resources() {
183
183
$resources['availability'] = array(
184
184
'operations' => array(
185
185
'index' => array(
186
- 'callback' => 'bam_api_services_availability_index ',
186
+ 'callback' => 'bat_api_services_availability_index ',
187
187
'help' => t('Returns an object containing availability information.'),
188
188
'access arguments' => array('access availability index service'),
189
189
'args' => array(
@@ -211,7 +211,7 @@ function bam_api_services_resources() {
211
211
),
212
212
),
213
213
'update' => array(
214
- 'callback' => 'bam_api_services_update_availability ',
214
+ 'callback' => 'bat_api_services_update_availability ',
215
215
'access arguments' => array('access update availability service'),
216
216
'help' => t('Update the availability for a given unit.'),
217
217
'args' => array(
@@ -237,7 +237,7 @@ function bam_api_services_resources() {
237
237
$resources['pricing'] = array(
238
238
'operations' => array(
239
239
'index' => array(
240
- 'callback' => 'bam_api_services_pricing_index ',
240
+ 'callback' => 'bat_api_services_pricing_index ',
241
241
'help' => t('Returns an object containing pricing information.'),
242
242
'access arguments' => array('access pricing index service'),
243
243
'args' => array(
@@ -265,7 +265,7 @@ function bam_api_services_resources() {
265
265
),
266
266
),
267
267
'update' => array(
268
- 'callback' => 'bam_api_services_update_pricing ',
268
+ 'callback' => 'bat_api_services_update_pricing ',
269
269
'access arguments' => array('access update pricing service'),
270
270
'help' => t('Update the pricing for a given unit.'),
271
271
'args' => array(
@@ -291,7 +291,7 @@ function bam_api_services_resources() {
291
291
$resources['booking'] = array(
292
292
'operations' => array(
293
293
'index' => array(
294
- 'callback' => 'bam_api_services_booking_index ',
294
+ 'callback' => 'bat_api_services_booking_index ',
295
295
'help' => t('Returns an object containing booking information.'),
296
296
'access arguments' => array('access booking index service'),
297
297
'args' => array(
@@ -321,7 +321,7 @@ function bam_api_services_resources() {
321
321
),
322
322
'actions' => array(
323
323
'add' => array(
324
- 'callback' => 'bam_api_services_add_booking ',
324
+ 'callback' => 'bat_api_services_add_booking ',
325
325
'access arguments' => array('access add booking service'),
326
326
'help' => t('Add a new Rooms Unit.'),
327
327
'args' => array(
@@ -366,12 +366,12 @@ function bam_api_services_resources() {
366
366
*
367
367
* @param $unit_ids
368
368
*/
369
- function bam_api_services_units_index ($unit_ids, $offset, $limit) {
369
+ function bat_api_services_units_index ($unit_ids, $offset, $limit) {
370
370
$return = new stdClass();
371
371
$return->sessid = session_id();
372
372
373
373
ctools_include('plugins');
374
- $field_handlers = ctools_get_plugins('bam_api ', 'rooms_unit_field_handler');
374
+ $field_handlers = ctools_get_plugins('bat_api ', 'rooms_unit_field_handler');
375
375
376
376
$ids = array_filter(explode(',', $unit_ids));
377
377
@@ -425,7 +425,7 @@ function bam_api_services_units_index($unit_ids, $offset, $limit) {
425
425
* @param $bookable
426
426
* @param $status
427
427
*/
428
- function bam_api_services_add_unit ($name, $type, $default_state, $bookable, $status) {
428
+ function bat_api_services_add_unit ($name, $type, $default_state, $bookable, $status) {
429
429
$return = new stdClass();
430
430
$return->sessid = session_id();
431
431
@@ -461,7 +461,7 @@ function bam_api_services_add_unit($name, $type, $default_state, $bookable, $sta
461
461
* @param $unit_id
462
462
* @param $rooms_unit_data
463
463
*/
464
- function bam_api_services_edit_unit ($unit_id, $rooms_unit_data) {
464
+ function bat_api_services_edit_unit ($unit_id, $rooms_unit_data) {
465
465
$return = new stdClass();
466
466
$return->sessid = session_id();
467
467
@@ -494,7 +494,7 @@ function bam_api_services_edit_unit($unit_id, $rooms_unit_data) {
494
494
* @param $start_date
495
495
* @param $duration
496
496
*/
497
- function bam_api_services_availability_index ($unit_ids, $start_date, $duration) {
497
+ function bat_api_services_availability_index ($unit_ids, $start_date, $duration) {
498
498
$return = new stdClass();
499
499
$return->sessid = session_id();
500
500
@@ -543,7 +543,7 @@ function bam_api_services_availability_index($unit_ids, $start_date, $duration)
543
543
* @param $unit_id
544
544
* @param $availability_info
545
545
*/
546
- function bam_api_services_update_availability ($unit_id, $availability_info) {
546
+ function bat_api_services_update_availability ($unit_id, $availability_info) {
547
547
$return = new stdClass();
548
548
$return->sessid = session_id();
549
549
@@ -573,7 +573,7 @@ function bam_api_services_update_availability($unit_id, $availability_info) {
573
573
* @param $start_date
574
574
* @param $duration
575
575
*/
576
- function bam_api_services_pricing_index ($unit_ids, $start_date, $duration) {
576
+ function bat_api_services_pricing_index ($unit_ids, $start_date, $duration) {
577
577
$return = new stdClass();
578
578
$return->sessid = session_id();
579
579
@@ -610,7 +610,7 @@ function bam_api_services_pricing_index($unit_ids, $start_date, $duration) {
610
610
* @param $unit_id
611
611
* @param $pricing_info
612
612
*/
613
- function bam_api_services_update_pricing ($unit_id, $pricing_info) {
613
+ function bat_api_services_update_pricing ($unit_id, $pricing_info) {
614
614
$return = new stdClass();
615
615
$return->sessid = session_id();
616
616
@@ -634,7 +634,7 @@ function bam_api_services_update_pricing($unit_id, $pricing_info) {
634
634
* @param $start_date
635
635
* @param $duration
636
636
*/
637
- function bam_api_services_booking_index ($unit_ids, $start_date, $duration) {
637
+ function bat_api_services_booking_index ($unit_ids, $start_date, $duration) {
638
638
$return = new stdClass();
639
639
$return->sessid = session_id();
640
640
@@ -673,7 +673,7 @@ function bam_api_services_booking_index($unit_ids, $start_date, $duration) {
673
673
* @param $start_date
674
674
* @param $end_date
675
675
*/
676
- function bam_api_services_add_booking ($type, $start_date, $end_date, $unit_id) {
676
+ function bat_api_services_add_booking ($type, $start_date, $end_date, $unit_id) {
677
677
$return = new stdClass();
678
678
$return->sessid = session_id();
679
679
0 commit comments