Newer
Older
import { $gettext } from '../lib/gettext';
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
class Resources
{
static addUserToPermissionList(user_id, table_element)
{
if (!user_id || !table_element) {
return;
}
var is_temporary_table = false;
var table_id = jQuery(table_element).attr('id');
if (table_id === 'TemporaryPermissionList') {
is_temporary_table = true;
}
var template_row = jQuery(table_element).find('tr.resource-permission-list-template')[0];
if (!template_row) {
//Something is wrong with the HTML
return;
}
var temp_perms_row = false;
if (jQuery(template_row).attr('data-temp-perms') === '1') {
temp_perms_row = true;
}
if (!is_temporary_table) {
//Check if the user is already in the list:
var trs = jQuery(table_element).find('tr');
for (var tr of trs) {
if (jQuery(tr).data('user_id') === user_id) {
//We have found a table entry for the user specified by
//user_id. Nothing to do here.
return;
}
}
}
var insert_function = function(user_id = null, username = null) {
var new_row = jQuery(template_row).clone(true);
jQuery(new_row).removeClass('invisible');
jQuery(new_row).removeClass('resource-permission-list-template');
jQuery(new_row).attr('data-user_id', user_id);
var row_tds = jQuery(new_row).children('td');
//Set the name-TD's content:
var user_td_index = 1;
jQuery(row_tds[user_td_index]).children('input').removeAttr('disabled');
if (username) {
jQuery(row_tds[user_td_index]).append(username);
} else {
jQuery(row_tds[user_td_index]).append('ID ' + user_id);
}
var user_id_input = jQuery(row_tds[user_td_index]).children('input')[0];
if (!user_id_input) {
return;
}
jQuery(user_id_input).val(user_id);
var perm_select = jQuery(row_tds[user_td_index + 1]).children()[0];
if (temp_perms_row) {
//Set the time input fields to useful values:
var begin = new Date();
begin.setHours(begin.getHours() + 1);
var begin_month = (begin.getMonth() + 1).toString();
if (begin_month.length === 1) {
begin_month = '0' + begin_month;
}
var begin_date = begin.getDate()
+ '.'
+ begin_month
+ '.'
+ begin.getFullYear();
var begin_time = begin.getHours() + ':00';
if (begin.getHours() < 10) {
begin_time = '0' + begin_time;
}
var end = new Date();
end.setDate(end.getDate() + 14);
var end_month = (end.getMonth() + 1).toString();
if (end_month.length === 1) {
end_month = '0' + end_month;
}
var end_date = end.getDate()
+ '.'
+ end_month
+ '.'
+ end.getFullYear();
var end_time = end.getHours() + ':00';
if (end.getHours() < 10) {
end_time = '0' + end_time;
}
var begin_td_inputs = jQuery(row_tds[user_td_index + 2]).children();
jQuery(begin_td_inputs[0]).addClass('has-date-picker');
jQuery(begin_td_inputs[1]).addClass('has-time-picker');
jQuery(begin_td_inputs[1]).timepicker({timeFormat: 'HH:mm'});
jQuery(begin_td_inputs[0]).val(begin_date);
jQuery(begin_td_inputs[1]).val(begin_time);
var end_td_inputs = jQuery(row_tds[user_td_index + 3]).children();
jQuery(end_td_inputs[0]).addClass('has-date-picker');
jQuery(end_td_inputs[1]).addClass('has-time-picker');
jQuery(end_td_inputs[1]).timepicker({timeFormat: 'HH:mm'});
jQuery(end_td_inputs[0]).val(end_date);
jQuery(end_td_inputs[1]).val(end_time);
}
var last_tr = jQuery(table_element).find('tr:last')[0];
if (!last_tr) {
//Something is wrong with the HTML.
return;
}
jQuery(last_tr).parent().append(new_row);
//Make the empty permission list message box
//invisible if it is still visible:
jQuery('#ResourceEmptyPermissionListMessage').addClass('invisible');
//Trigger a table update so that the tablesorter will re-sort
//the table:
jQuery(table_element).trigger('update');
};
STUDIP.api.GET(
`user/${user_id}`
).done(function(data) {
var username = data.name.family
+ ', '
+ data.name.given;
if (data.name.prefix) {
username += ', ' + data.name.prefix;
}
if (data.name.suffix) {
username += ' ' + data.name.suffix;
}
username += ' (' + data.name.username +')'
+ ' (' + data.perms + ')';
insert_function(user_id, username);
}).fail(function() {
insert_function(user_id);
});
}
static addCourseUsersToPermissionList(course_id, table_element)
{
if (!course_id || !table_element) {
return;
}
STUDIP.api.GET(
`course/${course_id}/members`,
{
data: {
//The limit '0' results in a division by zero.
//Hopefully, the limit is set to a value high enough:
limit: 1000000
}
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
}
).done(function(data) {
for (var attribute in data.collection) {
var user_id = data.collection[attribute].member.id;
STUDIP.Resources.addUserToPermissionList(
user_id,
table_element
);
}
});
}
static removeUserFromPermissionList(html_node)
{
if (!html_node) {
return;
}
var row = jQuery(html_node).parent().parent();
var tbody = jQuery(row).parent();
STUDIP.Dialog.confirm(
$gettext('Soll die ausgewählte Berechtigung wirklich entfernt werden?')
).done(function () {
jQuery(row).remove();
if (jQuery(tbody).children().length < 3) {
//No special permissions available: show the empty permission list
//message box:
jQuery('#ResourceEmptyPermissionListMessage').removeClass('invisible');
}
});
}
//Room search related methods:
static addSearchCriteriaToRoomSearchWidget(select_node)
{
if (!select_node) {
return;
}
let selected_option = jQuery(select_node).find(":selected")[0];
if (!selected_option) {
return;
}
let option_value = jQuery(selected_option).val();
if (!option_value) {
//The first option which is left blank intentionally
//has been selected.
return;
}
let option_title = jQuery(selected_option).data('title');
let option_type = jQuery(selected_option).data('type');
let option_select_options = jQuery(selected_option).data('select_options').split(';;');
let option_range_search = jQuery(selected_option).data('range-search');
if (option_type === 'bool') {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="'
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
)[0];
} else if (option_type === 'select') {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="select"]'
)[0];
} else if (option_type === 'date') {
if (option_range_search) {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="date_range"]'
)[0];
} else {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="date"]'
)[0];
}
} else if (option_type === 'num') {
if (option_range_search) {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="range"]'
)[0];
} else {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="num"]'
)[0];
}
} else {
template = jQuery(select_node).parent().parent().find(
'.criteria-list .template[data-template-type="other"]'
)[0];
}
if (!template) {
return;
}
let criteria_list = jQuery(template).parent();
let new_criteria = jQuery(template).clone();
jQuery(new_criteria).attr('class', 'item');
jQuery(new_criteria).attr('data-criteria', option_value);
let new_criteria_text_field = jQuery(new_criteria).find('span')[0];
jQuery(new_criteria_text_field).text(option_title);
if (option_type === 'bool') {
let new_criteria_input = jQuery(new_criteria).find('input[type=checkbox]');
jQuery(new_criteria_input).attr('name', option_value);
let new_criteria_hidden_input = jQuery(new_criteria).find('input[type=hidden]');
jQuery(new_criteria_hidden_input).attr('name', 'options_' + option_value);
} else if (option_type === 'select') {
let new_criteria_select = jQuery(new_criteria).find('select')[0];
jQuery(new_criteria_select).attr('name', option_value);
//Build the option elements from the data-options field:
if (!option_select_options) {
//Something is wrong.
return;
}
for (let option of option_select_options) {
const opt = $('<option>', {
value: option,
text: option,
});
options.push(opt);
} else if (option_type === 'date') {
let time_inputs = jQuery(new_criteria).find('input[data-time="yes"]');
let date_inputs = jQuery(new_criteria).find('input[type="date"]');
if (time_inputs.length < 2) {
//Something is wrong with the HTML.
return;
}
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
jQuery(time_inputs[0]).attr('name', option_value + '_begin_time');
jQuery(time_inputs[1]).attr('name', option_value + '_end_time');
jQuery(time_inputs[0]).val(
now.getHours() + ':00'
);
jQuery(time_inputs[1]).val(
(now.getHours() + 2) + ':00'
);
if (option_range_search) {
//We must fill two date fields.
if (date_inputs.length < 2) {
//Something is wrong with the HTML.
return;
}
jQuery(date_inputs[0]).attr('name', option_value + '_begin_date');
jQuery(date_inputs[1]).attr('name', option_value + '_end_date');
jQuery(date_inputs[0]).val(
now.getFullYear() + '-'
+ (now.getMonth() + 1) + '-'
+ (now.getDate() + 1)
);
jQuery(date_inputs[1]).val(
now.getFullYear() + '-'
+ (now.getMonth() + 1) + '-'
+ (now.getDate() + 2)
);
} else {
//One date field, two time fields.
if (date_inputs.length < 1) {
//Something is wrong with the HTML.
return;
}
jQuery(date_inputs[0]).attr('name', option_value + '_date');
jQuery(date_inputs[0]).val(
now.getFullYear() + '-'
+ (now.getMonth() + 1) + '-'
+ (now.getDate() + 1)
);
}
} else {
if (option_type === 'num' && option_range_search) {
let new_criteria_inputs = jQuery(new_criteria).find('input');
jQuery(new_criteria_inputs[0]).attr('name', option_value);
let min_input = new_criteria_inputs[1];
let max_input = new_criteria_inputs[2];
jQuery(min_input).attr({name: option_value + '_min', type: 'number'});
jQuery(max_input).attr({name: option_value + '_max', type: 'number'});
let new_criteria_input = jQuery(new_criteria).find('input')[0];
jQuery(new_criteria_input).attr('name', option_value);
if (option_type === 'num') {
jQuery(new_criteria_input).attr('type', 'number');
} else {
jQuery(new_criteria_input).attr('type', 'text');
}
}
}
jQuery(criteria_list).append(new_criteria);
//hide the criteria in the select list:
jQuery(selected_option).addClass('invisible');
//set the select field to the first option:
jQuery(select_node).val('');
}
static removeSearchCriteriaFromRoomSearchWidget(icon_node)
{
if (!icon_node) {
return;
}
let input = jQuery(icon_node).parent().find('label').find('input');
let criteria_name = jQuery(input).attr('name');
let form = jQuery(icon_node).parents('form')[0];
if (!form) {
return;
}
let select_element = jQuery(form).find('select.criteria-selector');
jQuery(icon_node).parent().remove();
//enable the option in the select field:
let disabled_option = jQuery(select_element).find(
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
'option[value="' + criteria_name + '"]'
)[0];
jQuery(disabled_option).removeClass('invisible');
//Trigger change event:
jQuery(form).find('.room-search-widget_criteria-list_input').trigger('change');
}
static submitRoomSearchWidgetForm(input_node)
{
if (!input_node) {
return;
}
//find the form element:
var form = jQuery(input_node).parents('form')[0];
if (!form) {
return;
}
jQuery(form).submit();
}
//Resource request related methods:
static addPropertyToRequest(event)
{
var select = jQuery(event.target).siblings('select.requestable-properties-select')[0];
if (!select) {
return;
}
var table = jQuery(event.target).parents('.resource-request-properties-table')[0];
if (!table) {
return;
}
var tbody = jQuery(table).find('tbody')[0];
if (!tbody) {
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
}
var selected_option = jQuery(select).find(':selected')[0];
if (!selected_option) {
return;
}
var property_id = jQuery(selected_option).val();
var option_html = jQuery(selected_option).data('input-html');
if (!property_id || !option_html) {
return;
}
var template = jQuery(tbody).find('tr.template')[0];
if (!template) {
return;
}
var new_row = jQuery(template).clone();
if (!new_row) {
return;
}
jQuery(new_row).removeClass('template');
jQuery(new_row).removeClass('invisible');
jQuery(new_row).attr('data-property_id', property_id);
var row_cells = jQuery(new_row).find('td');
jQuery(row_cells[0]).text(jQuery(selected_option).text());
jQuery(row_cells[1]).html(option_html);
jQuery(tbody).append(new_row);
jQuery(tbody).find('.empty-table-message').addClass('invisible');
jQuery(selected_option).attr('disabled', 'disabled');
jQuery(selected_option).removeAttr('selected');
jQuery(select).val([]);
}
//ResourceBookingInterval methods:
static toggleBookingIntervalStatus(event)
{
Moritz Strohm
committed
event.preventDefault();
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
var li = jQuery(event.target).parents('tr')[0];
if (!li) {
//Something is wrong with the HTML.
return;
}
var interval_id = jQuery(li).data('interval_id');
if (!interval_id) {
return;
}
STUDIP.api.POST(
`resources/booking_interval/${interval_id}/toggle_takes_place`
).done(function(data) {
if (data['takes_place'] === undefined) {
//Something went wrong: do nothing.
return;
}
if (data['takes_place'] === '1') {
//Switch on the icons and text for the "takes place"
//status and switch off the other ones:
jQuery(li).find('.takes-place-revive').addClass('invisible');
jQuery(li).find('.takes-place-delete').removeClass('invisible');
jQuery(li).find('.booking-list-interval-date').removeClass('not-taking-place');
} else {
//Do the opposite of the if-block above:
jQuery(li).find('.takes-place-delete').addClass('invisible');
jQuery(li).find('.takes-place-revive').removeClass('invisible');
jQuery(li).find('.booking-list-interval-date').addClass('not-taking-place');
}
});
}
//Methods for the resource category form:
static addResourcePropertyToTable(event)
{
var select = jQuery(event.target).siblings('select')[0];
if (!select) {
//Something is wrong with the HTML
return;
}
var selected_property_id = jQuery(select).val();
var selected_property = jQuery(select).children(
'option:selected'
)[0];
if (!selected_property) {
return;
}
var selected_property_name = jQuery(selected_property).text();
if (!selected_property_id || !selected_property_name) {
//Invalid option
return;
}
var table = jQuery(event.target).parents(
'table'
)[0];
if (!table) {
return;
}
var template = jQuery(table).find('tr.template')[0];
if (!template) {
return;
}
var new_row = jQuery(template).clone();
if (!new_row) {
return;
}
var columns = jQuery(new_row).find('td');
var text_field = jQuery(new_row).find('.name');
jQuery(text_field).text(selected_property_name);
var set_input = jQuery(new_row).find('.property-input');
jQuery(set_input).attr(
'name',
'prop[' + selected_property_id + ']'
);
var value_input = jQuery(new_row).find('.value-input');
jQuery(value_input).attr(
'name',
'prop_value[' + selected_property_id + ']'
);
var requestable_input = jQuery(new_row).find('.requestable-input');
jQuery(requestable_input).attr(
'name',
'prop_requestable[' + selected_property_id + ']'
);
var protected_input = jQuery(new_row).find('.protected-input');
jQuery(protected_input).attr(
'name',
'prop_protected[' + selected_property_id + ']'
);
var tbody = jQuery(table).find('tbody')[0];
if (!tbody) {
return;
}
jQuery(new_row).removeClass('invisible');
jQuery(new_row).removeClass('template');
jQuery(new_row).data('property_id', selected_property_id);
jQuery(tbody).append(new_row);
jQuery(selected_property).attr('disabled', 'disabled');
jQuery(selected_property).removeAttr('selected');
jQuery(select).val([]);
}
//Methods for opening or closing of ressource tree elements:
static toggleTreeNode(treenode)
{
var arr = treenode.children("img");
if (arr.hasClass('rotated')) {
arr.attr('style', 'transform: rotate(0deg)');
} else {
arr.attr('style', 'transform: rotate(90deg)');
}
arr.toggleClass('rotated') ;
treenode.children(".resource-tree").children("li").toggle();
}
static moveTimeOptions(bookingtype_val)
{
if(bookingtype_val === 'single') {
$(".time-option-container").hide();
$(".block-booking-item").hide();
$(".repetition-booking-item").hide();
$("#BookingStartDateInput").show();
$(".semester-selector").parent().hide();
$(".manual-time-option").prop('checked', true).trigger('change');
} else {
var time_options = $(".time-option-container");
$(".time-option-container").detach();
if(bookingtype_val === 'block') {
$("#BlockBookingFieldset").prepend(time_options);
$("#BlockEndLabel").show();
$("#RepetitionEndLabel").hide();
$(".block-booking-item").show();
$(".repetition-booking-item").hide();
} else {
$("#RepetitionBookingFieldset").prepend(time_options);
$("#RepetitionEndLabel").show();
$("#BlockEndLabel").hide();
$(".repetition-booking-item").show();
$(".block-booking-item").hide();
}
$(".time-option-container").show();
}
//Fullcalendar specialisations:
static updateEventUrlsInCalendar(calendar_event)
{
if (!calendar_event) {
return;
}
STUDIP.api.GET(
`resources/booking/${calendar_event.extendedProps.studip_parent_object_id}/intervals`,
{
data: {
begin: STUDIP.Fullcalendar.toRFC3339String(calendar_event.start),
end: STUDIP.Fullcalendar.toRFC3339String(calendar_event.end)
}
}
).done(function (data) {
return;
}
var new_interval_id = data[0].interval_id;
calendar_event.setExtendedProp('studip_object_id', new_interval_id);
if (new_interval_id) {
var move_url = calendar_event.extendedProps.studip_api_urls['move'];
var resize_url = calendar_event.extendedProps.studip_api_urls['resize'];
move_url = move_url.replace(
'&interval_id=' + new_interval_id
);
resize_url = resize_url.replace(
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
'&interval_id=' + new_interval_id
);
var studip_api_urls = calendar_event.extendedProps.studip_api_urls;
studip_api_urls['move'] = move_url;
studip_api_urls['resize'] = resize_url;
calendar_event.setExtendedProp('studip_api_urls', studip_api_urls);
}
});
}
static resizeEventInRoomGroupBookingPlan(info)
{
STUDIP.Fullcalendar.defaultResizeEventHandler(info);
STUDIP.Resources.updateEventUrlsInCalendar(info.event);
}
static dropEventInRoomGroupBookingPlan(info)
{
STUDIP.Fullcalendar.defaultDropEventHandler(info);
STUDIP.Resources.updateEventUrlsInCalendar(info.event);
}
static toggleRequestMarked(source_node)
{
if (!source_node) {
return;
}
var request_id = jQuery(source_node).data('request_id');
if (!request_id) {
return;
}
STUDIP.api.POST(
`resources/request/${request_id}/toggle_marked`
).done(function(data) {
jQuery(source_node).attr('data-marked', data.marked);
jQuery(source_node).parent().attr('data-sort-value', data.marked);
jQuery(source_node).parents('table.request-list').trigger('update');
});
}
static bookAllCalendarRequests()
{
var calendarSektion = $('*[data-resources-fullcalendar="1"]')[0];
if (calendarSektion) {
var calendar = calendarSektion.calendar;
if (calendar) {
if (!$('#loading-spinner').length) {
$('<div id="loading-spinner" style="position: absolute; top: calc(50% - 55px); left: calc(50% + 135px); z-index: 9001;">').html(
$('<img>').attr('src', STUDIP.ASSETS_URL + 'images/loading-indicator.svg')
.css({
width: 64,
height: 64
})
)
);
}
$('.fc-request-event').each(function(){
var objectData = $(this).data();
var existingRequestEvent = calendar.getEventById(objectData.eventId);
if (existingRequestEvent) {
var bookingURL = 'dispatch.php/resources/room_request/quickbook/'
+ objectData.eventRequest +'/'
+ objectData.eventResource +'/'
+ objectData.eventMetadate;
jQuery.ajax(
STUDIP.URLHelper.getURL(bookingURL),
{
method: 'get',
dataType: 'json',
}
);
}
});
document.location.reload(true);
}
}
}
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
//Class properties:
Resources.definedResourceClasses = [
'Resource', 'Room', 'Building', 'Location'
];
class Messages
{
static selectRoom(room_id, room_name)
{
if (!room_id) {
return;
}
var selection_area = jQuery('.resources_messages-form .selection-area')[0];
if (!selection_area) {
return;
}
var template = jQuery(selection_area).find('.template')[0];
if (!template) {
return;
}
var new_room = jQuery(template).clone();
jQuery(new_room).removeClass('template');
jQuery(new_room).removeClass('invisible');
jQuery(new_room).find('span').text(room_name);
jQuery(new_room).find('input[type="hidden"]').val(room_id);
jQuery(selection_area).append(new_room);
}
}
Resources.Messages = Messages;
class BookingPlan
{
static insertEntry(new_entry, date, begin_hour, end_hour)
{
//Get the resource-ID from the current URL:
var results = window.location.href.match(
/dispatch.php\/resources\/resource\/booking_plan\/([a-z0-9]{1,32})/
);
if (results.length === 0) {
//No resource-ID found.
jQuery(new_entry).remove();
return;
}
var resource_id = results[1];
//Now we re-format the time from begin_hour and end_hour.
//In case the data-dragged attribute is set for the
//calendar entry we just add two hours to the start time
//to get the end time.
var dragged = jQuery(new_entry).data('dragged');
if (dragged) {
end_hour = begin_hour + 2;
}
begin_hour += ':00';
if (end_hour > 23) {
end_hour = '23:59';
} else {
end_hour += ':00';
}
var result = STUDIP.Dialog.fromURL(
STUDIP.URLHelper.getURL(
'dispatch.php/resources/booking/add/' + resource_id,
{
'begin_date': date,
'begin_time': begin_hour,
'end_date': date,
'end_time': end_hour
}
), {size: 'auto'}
);
}
}
Resources.BookingPlan = BookingPlan;
export default Resources;