-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalendar.html
1240 lines (965 loc) · 57.8 KB
/
calendar.html
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
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
447
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
491
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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
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
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
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
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="calendar-page with-subnav ">
<meta charset="utf-8" />
<link href='//fonts.googleapis.com/css?family=Lato:300,400,900,400italic' rel='stylesheet' type='text/css'>
<!--jquery UI CSS-->
<link href="https://app.gettimely.com/cdn/4643ec0c18eb626ffb1f9a20cd3634fe.css" rel="stylesheet" type="text/css" />
<script>
(function () {
if (!window.TimelyGlobals) window.TimelyGlobals = {};
//A global container for storing buiness details that need to be used via JS
window.TimelyGlobals.businessId = "34933";
window.TimelyGlobals.timeFormat = "Military";
window.TimelyGlobals.is24HourTime = "True" == 'True';
window.TimelyGlobals.currencySymbol = "€";
window.TimelyGlobals.timePickerJsFormat = "G:i";
window.TimelyGlobals.mobiScrollPickerFormat = "HH:ii";
window.TimelyGlobals.mobiScrollWheelFormat = "HHii";
}());
</script>
<!--jquery v1.9.1 Includes Sizzle.js-->
<script src="https://app.gettimely.com/cdn/3682901946450b7087c7d6ad60a03a59.js"></script>
<!--<script src="http://dev.rugcentrumgent.be/wp_dev/alice/assets/js/jquery-2.0.3.min.js"></script>
<script src="http://dev.rugcentrumgent.be/wp_dev/alice/assets/js/sizzle.js"></script>
<script type="text/javascript" src="http://cdn.raygun.io/raygun4js/raygun.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script>
<script src="http://ricostacruz.com/jquery.transit/jquery.transit.min.js"></script>-->
<link href="https://app.gettimely.com/cdn/521107357c4b6d7efdad0898f93153fc.css" rel="stylesheet" type="text/css" />
<style>
.uv-bottom-right { right: 26px !important; }
</style>
<link rel='stylesheet' type='text/css' media="print" href='/Content/fullcalendar/fullcalendar.print.css' />
</head>
<body class="app-body">
<div class="timely-navbar">
<div class="rg-container-fluid">
<div class="rg-row">
<div class="col-xs-12">
<div class="rg-constrained" style="position: relative;">
<div class="timely-nav__company">
<h1>
Alice Patient Managemen
</h1>
</div>
<div class="notification-area timely-nav__notifications">
<div class="btn-group">
<a class="btn btn-xs btn-inverse dropdown-toggle" data-toggle="dropdown" href="#"><span class="notification-bell"></span></a>
<ul class="dropdown-menu right">
<li class="notifications-title">
<span>notifications</span>
<span class="mark-as-read-link">Mark all as read</span>
</li>
<li class="notification-divider"></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="rg-container-fluid">
<div class="rg-row">
<div class="calendar col-md-12">
<script>
var locationDropdowns = '';
var staffDropdowns = '';
var addInvoiceButton = '';
var canUseFlex = true;
</script>
<script>
locationDropdowns = '<span class="btn-group tip" data-original-title="Tapuz">' +
'<span class="drop-container btn">' +
'<span class="drop-arrow caret"></span>' +
'<i class="fa fa-home"></i>' +
'<span class="drop-label"></span>' +
'<select class="drop-select location-select select-menu" >' +
'<option data-location-id="52806" value="52806">Rugcentrum Gent</option>' +
'<option selected="selected" data-location-id="52805" value="52805">Rugcentrum Eeklo</option>' +
+
'</select>' +
'</span></span>';
</script>
<script>
staffDropdowns = '<span class="btn-group tip" data-original-title="">' +
'<span class="drop-container btn">' +
'<span class="drop-arrow caret"></span>' +
'<i class="fa fa-user"></i>' +
'<span class="drop-label"></span>' +
'<select class="drop-select staff-select select-menu" >' +
'<option id="all-rostered-option" data-staff-id="all-rostered" value="all-rostered">Thyl Duhameeuw</option>'+
'<option id="all-staff-option" data-staff-id="false" value="false">Guy Duhameeuw</option>'+
'<option selected="selected" data-staff-id="87675" value="87675">Thierry Duhameeuw</option>' +
'</select>' +
'</span></span>';
</script>
<div class="fc-messages"></div>
<div id="flex-pane" class="flex">
<div class="flex__inner">
<div id="customers-search">
<div class="flex__header">
<form data-bind="submit: $root.search" class="">
<div class="form-group">
<div class="input-group">
<input id="search" data-bind="event: { keydown: $root.autoSearch }" name="search" type="text" class="form-control customer-search" placeholder="Find patient" value="" />
<span class="input-group-btn">
<button type="button" class="btn" data-bind="click: $root.search"><i class="fa fa-search fa-fw"></i></button>
</span>
</div>
</div>
</form>
<div class="flex__loader-container" data-bind="visible: isLoading">
<div class="flex__loader">
<div class="flex__loader-line"></div>
<div class="flex__loader-break flex__loader-dot1"></div>
<div class="flex__loader-break flex__loader-dot2"></div>
<div class="flex__loader-break flex__loader-dot3"></div>
</div>
</div>
</div>
<div class="flex__body">
<div class="directory-container directory--calendar" data-bind="css: { 'smooth-scroll': isIpad() }, visible: !$root.showingCustomer()">
<ul class="directory name-value-list" data-bind="foreach: customers ">
<li data-bind="css: { active: $data.id == $root.chosenCustomerId() }, click: $root.goToCustomer">
<h3><a href="#" data-bind="click: $root.goToCustomer"><i class="fa fa-user"> </i><span data-bind="text: fullName"></span></a></h3>
<div></div>
</li>
</ul>
<a href="javascript:void(0);" class="btn btn-block" data-bind="click: $root.searchLoadMore, visible: $root.hasMoreCustomers() && customers().length != 0" id="load-more-results">Load more results</a>
<div data-bind="visible: customers().length == 0 && !$root.hasSearchTerm()">
<div class="flex__panel">
</div>
</div>
<div data-bind="visible: customers().length == 0 && $root.hasSearchTerm() && !isLoading()">
<div class="flex__panel">
<h3>No matches for this search</h3>
<p>
Sorry we haven't been able to find any customers matching this search.
</p>
<p>
<b>Tip:</b> As well as searching using customer names, you can also search for customers using their phone numbers and email addresses.
</p>
<hr />
</div>
</div>
</div>
<div id="customer" class="customer-container" data-bind="with: chosenCustomer, visible: showingCustomer, css: { 'smooth-scroll': isIpad() }">
<div class="flex__panel">
<div data-bind="visible: isNew || hasAlert || isVip || badCount > 0" class="flex__section" style="padding-top: 3px; margin-top:-15px;padding-bottom: 3px;">
<div class="flex__badges">
<span class="badge " data-bind="visible: isNew">New</span>
<a data-bind="visible: hasAlert, attr: { 'data-content': alert }" href="javascript:void(0);" rel="popover" data-original-title="Alerts & Contra Indicators"><i class="fa fa-exclamation-circle"></i></a>
<a data-bind="visible: isVip" data-original-title="VIP" href="javascript:void(0);" class="tip"><i class="fa fa-star"></i></a>
<a data-bind="visible: badCount > 0, attr: { 'data-content' : badCountText }" style="color: red;" href="javascript:void(0);" rel="popover" data-original-title="Customer no-shows"><i class="fa fa-thumbs-down"></i> <span data-bind="text: badCount"></span>x</a>
</div>
</div>
<h3 class="alert alert-danger" data-bind="visible: isDeleted">
<b><i class="fa fa-exclamation-circle"></i> This customer has been deleted</b>
</h3>
<h3 style="line-height: 30px;">
<a href="#" data-bind="click: $root.showSearch"><i class="fa fa-long-arrow-left fa-fw"></i></a>
<a href="#" class="fc-customer-name" data-bind="text: fullName, attr:{href: $root.viewCustomerUrl()}"></a>
</h3>
<div class="flex__section" style="padding-top: 0">
<p class="fulljustify">
<a data-bind="attr: { href: $root.editCustomerUrl() }" class="modal-open">Edit</a>
|
<a data-bind="attr: { href: $root.mergeCustomerUrl() }" class="modal-open merge-customer">Merge</a>
|
<a data-bind="attr: { href: $root.contactCustomerUrl() }" class="modal-open">Contact</a>
|
<a data-bind="attr: {'data-content': deleteHtml()}" class="pop" href="javascript:void(0);" data-original-title="Delete this customer?">Delete</a>
</p>
<p class="btn-group btn-group-justified">
<a href="#" class="btn btn-sm flex-new-booking btn-success" data-bind="attr: {'data-customer-id': id}">New appointment</a>
</p>
<p class="btn-group btn-group-justified">
<a class="btn btn-sm add-invoice">New sale</a>
</p>
<p class="btn-group btn-group-justified" data-bind="visible: concessionsAvailable">
<a class="btn btn-sm modal-open" data-modal-class="customer-concession-modal" data-bind="attr: { href: $root.addCustomerConcessionUrl()}" href="/Customer/ConcessionAdd?customerId=2666106">Add package to customer</a>
</p>
</div>
<div class="flex__section">
<ul class="name-value-list">
<li data-bind="">
<h3>Telephone</h3>
<div><a data-bind="text: telephone, visible: hasTelephone(), attr: { href: telephoneUrl() }"></a><span data-bind="text: telephone, visible: !hasTelephone()"></span></div>
</li>
<li data-bind="">
<h3>SMS number</h3>
<div><a data-bind="text: sms, visible: hasSms(), attr: { href: smsUrl() }"></a><span data-bind="text: sms, visible: !hasSms()"></span></div>
</li>
<li data-bind="visible: hasEmail()">
<h3>Email</h3>
<div><a class="tip" data-bind="text: email, visible: hasEmail(), attr: { href: emailUrl(), 'data-original-title': email }"></a><span data-bind="text: email, visible: !hasEmail()"></span></div>
</li>
<li data-bind="visible: inDebt">
<h3>Amount owing</h3>
<div data-bind="text: outstanding, attr: { class: inDebt ? 'error-text' : '' }"></div>
</li>
<li data-bind="visible: hasAlert">
<h3>Alerts</h3>
<div data-bind="text: alert"></div>
</li>
<li data-bind="visible: isVip">
<h3>VIP</h3>
<div data-bind="text: vipText"></div>
</li>
</ul>
</div>
<div class="flex__section">
<div data-bind="visible:showTimeSince">
<p><span data-bind="text: daysSinceText"></span> since last booking</p>
</div>
<div data-bind="visible:!showTimeSince()">
<p>Has no previous booking</p>
</div>
</div>
<div class="flex__section visible">
<h4>Next appointment:</h4>
<ul class="appointment-list" data-bind="template: { name: 'bookingTemplate', foreach: nextBooking }, visible: futureBookings().length > 0"></ul>
<p data-bind="visible: !hasFutureBookings()">No future appointments.</p>
<p data-bind="visible: !hasFutureBookings()" class="btn-group btn-group-justified">
<a href="#" class="btn btn-sm flex-new-booking " data-bind="attr: {'data-customer-id': id}">Book next</a>
</p>
</div>
<div class="flex__section visible">
<h4>Last appointment:</h4>
<ul class="appointment-list" data-bind="template: { name: 'bookingTemplate', foreach: lastBooking }, visible: pastBookings().length > 0"></ul>
<p data-bind="visible: !hasPastBookings()">No previous appointments.</p>
</div>
<div class="flex__section visible">
<h4>Notes:</h4>
<ul class="appointment-list" data-bind="template: { name: 'note', foreach: notes.display }, visible: notes().length > 0"></ul>
<p data-bind="visible: !hasNotes()">No notes have been recorded for this customer.</p>
<a data-bind="visible: notes.showButton, click: notes.toggleShowAll" class="expand-toggle" href="#">
<span data-bind="visible: !notes.showAll()">More notes <i class="fa fa-angle-double-down"></i></span>
<span data-bind="visible: notes.showAll()">Less notes <i class="fa fa-angle-double-up"></i></span>
</a>
<p class="btn-group btn-group-justified">
<a data-bind="attr: { href: $root.addNoteUrl() }" class="btn btn-sm modal-open">Add note</a>
<a data-bind="attr: { 'data-customer-id': id }" class="btn btn-sm print-notes">Print notes</a>
</p>
</div>
<div class="flex__section visible" data-bind="visible: concessions().length > 0 && concessionsAvailable">
<h4>Packages:</h4>
<div class="" data-bind="visible: concessions().length > 0 && concessionsAvailable">
<div class="customer-concession-list" data-bind="template: { name: 'concessionTemplate', foreach: concessions() }, visible: concessions().length > 0"></div>
</div>
</div>
<div class="flex__section" data-bind="visible: outstandingInvoices().length > 0, css: { visible: hasDetails() }">
<div>
<h4 style="margin-bottom: 5px">Unpaid invoices:</h4>
<div class="invoice-list" data-bind="template: { name: 'invoiceTemplate', foreach: outstandingInvoices.display }, visible: outstandingInvoices().length > 0">
</div>
</div>
<a data-bind="visible: outstandingInvoices.showButton, click: outstandingInvoices.toggleShowAll" class="expand-toggle expand-toggle--after-row" href="#">
<span data-bind="visible: !outstandingInvoices.showAll()">More invoices <i class="fa fa-angle-double-down"></i></span>
<span data-bind="visible: outstandingInvoices.showAll()">Less invoices <i class="fa fa-angle-double-up"></i></span>
</a>
</div>
<div class="flex__section" data-bind="visible: invoices().length > 0, css: { visible: hasDetails() }">
<div>
<h4 style="margin-bottom: 5px">All invoices:</h4>
<div class="invoice-list" data-bind="template: { name: 'invoiceTemplate', foreach: invoices.display }, visible: invoices().length > 0">
</div>
</div>
<a data-bind="visible: invoices.showButton, click: invoices.toggleShowAll" class="expand-toggle expand-toggle--after-row" href="#">
<span data-bind="visible: !invoices.showAll()">More invoices <i class="fa fa-angle-double-down"></i></span>
<span data-bind="visible: invoices.showAll()">Less invoices <i class="fa fa-angle-double-up"></i></span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var customersList = [];
var customersFlexPaneModel;
if (canUseFlex) {
$(function() {
customersFlexPaneModel = new CustomersViewModel(customersList, 52805, 34933);
ko.applyBindings(customersFlexPaneModel, $("#customers-search")[0]);
});
}
</script>
<script type="text/html" id="physicalAddressTemplate">
</script>
<script type="text/html" id="bookingTemplate">
<li>
<h3>
<a data-bind="attr: {href: editBookingUrl()}, visible: (!isCancelled || bookingId > 0), click: $root.openBookingModal"><span data-bind="text: service"></span> for <span data-bind="text: customerName" class="fc-customer-name"></span></a>
<span class="label" data-bind="visible: isPending">Pencilled-in</span>
<span class="label label-important" data-bind="visible: isCancelled">Cancelled</span>
<span class="label label-inverse" data-bind="visible: isDidNotShow">Did not show</span>
<span class="label label-success" data-bind="visible: isCompleted">Completed</span>
<span class="label label-success" data-bind="visible: isAttended">Attended</span>
<span data-bind="visible: isCancelled && classId > 0"><span data-bind="text: service"></span> for <span data-bind="text: customerName" class="fc-customer-name"></span></span>
<a href="#" data-bind="visible: isRecurring, attr:{ 'data-content': recurrenceText()}" rel="popover" data-original-title="Recurring appointment"><i class="fa fa-refresh"></i></a>
<a href="javascript:void(0);" data-bind="visible: hasComments, attr:{ 'data-content': comments}" rel="popover" data-original-title="Customer comments"><i class="fa fa-comment"></i></a>
</h3>
<div><i class="fa fa-clock-o fa-fw"></i> <span data-bind="text: startDate"></span> <span data-bind="text: startTime"></span></div>
<div><i class="fa fa-user fa-fw"></i> <span data-bind="text: staffName"></span></div>
<div><i class="fa fa-home fa-fw"></i> <span data-bind="text: location"></span></div>
<div data-bind="visible: isPending"><i class="fa fa-cog fa-fw"></i> <span class="" data-bind="visible: isPending">Pencilled-in</span></div>
<div data-bind="visible: isCancelled"><i class="fa fa-cog fa-fw"></i> <span class="label label-important" data-bind="visible: isCancelled">Cancelled</span></div>
<div style="margin-top:10px;">
<p class="btn-group btn-group-justified">
<a href="#" class="btn btn-sm show-booking" data-bind="attr: {'data-date': startDate, 'data-booking-id': bookingId, 'data-class-id': classId, 'data-staff-id': staffId, 'data-location-id': locationId}">Show</a>
<a href="#" class="btn btn-sm rebook" data-bind="visible: bookingId > 0, attr: {'data-booking-id': bookingId, 'data-class-id': classId}">Book next</a>
</p>
</div>
</li>
</script>
<script type="text/html" id="concessionTemplate">
<div class="name-value-list-row">
<div><a href="javascript:void(0)" data-bind="text: concessionName, attr: { href: editUrl }" data-modal-class="customer-concession-modal" class="modal-open"></a></div>
<ul class="name-value-list" data-bind="attr: { 'data-id': customerConcessionId }">
<li>
<h3>Usage</h3>
<div data-bind="visible: customerConcessionItems.length > 1">
<a href="#" rel="popover" data-original-title="Package items" data-bind="attr: { 'data-content': concessionItemsHtml()}" data-original-class="customer-concession-items-balloon"><i class="fa fa-list-alt fw"></i> View usage</a>
</div>
<div data-bind="visible: customerConcessionItems.length == 1, html: singleConcessionItemHtml()">
</div>
</li>
<li>
<h3>Payment</h3>
<div>
<span class="label label-success" data-bind="text: paid ? 'Paid' : 'Unpaid', css: { 'label-success': paid, 'label-warning': !paid }"></span>
</div>
</li>
<li>
<h3>Status</h3>
<div>
<span class="label" data-bind="css: {'label-success': status == 'Active', 'label-important': status == 'Expired' }, text: status"></span>
</div>
</li>
<li>
<h3>Date added</h3>
<div data-bind="text: dateCreated">
</div>
</li>
<li>
<h3>Expiry date</h3>
<div data-bind="text: expiryDate">
</div>
</li>
</ul>
<div data-bind="visible: status == 'Active' && !includesClasses" style="margin-top:10px;">
<p class="btn-group btn-group-justified">
<a data-bind="attr: { href: bookUrl, 'data-package-id': customerConcessionId, 'data-customer-id': customerId }, visible: status == 'Active' && !includesClasses" class="btn btn-sm book-package">Book package</a>
</p>
</div>
</div>
</script>
<script type="text/html" id="invoiceTemplate">
<div class="name-value-list-row">
<ul class="name-value-list">
<li>
<h3>Invoice #</h3>
<div>
<a data-bind="attr: { href: editUrl }, text: invoiceIdDisplay, visible: !isInVend"></a>
<a data-bind="attr: { href: vendSaleUrl }, text: invoiceIdDisplay, visible: isInVend" class="modal-open" data-modal-class="iframe-modal"></a>
</div>
</li>
<li>
<h3>Status</h3>
<div>
<span class="badge badge-success" data-bind="visible: paid">Paid</span><span class="badge badge-warning" data-bind=" visible: !paid">Unpaid</span>
</div>
</li>
<li data-bind="visible: isInVend">
<h3>Vend</h3>
<div>
<a data-bind="attr: { href: vendSaleUrl }, visible: isInVend" class="modal-open" data-modal-class="iframe-modal"><img src="/Images/vend-tiny.png" /></a>
</div>
</li>
<li>
<h3>Invoice date</h3>
<div>
<span data-bind="text: invoiceDate"></span>
</div>
</li>
<li>
<h3>Due date</h3>
<div>
<span data-bind="text: dueDate"></span>
</div>
</li>
<li data-bind="visible: hasReference()">
<h3>Reference</h3>
<div>
<span data-bind="text: reference"></span>
</div>
</li>
<li>
<h3>Amount</h3>
<div>
<span data-bind="text: amount"></span>
</div>
</li>
</ul>
<div data-bind="visible: !paid" style="margin-top:10px;">
<p class="btn-group btn-group-justified">
<a href="#" class="btn btn-sm modal-open" data-bind="attr: { href: payUrl }">Apply payment</a>
<a href="#" class="btn btn-sm modal-open" data-bind="attr: { href: requestUrl }">Request payment</a>
</p>
</div>
</div>
</script>
<script type="text/html" id="note">
<li>
<h3>
<span data-bind="text: title"></span>
<a data-bind="attr: { href: editUrl }" class="modal-open"><i class="fa fa-pencil-square-o fa-lg"></i></a>
<a data-bind="attr: {'data-content': deleteNoteHtml()}" class="pop" href="javascript:void(0);" data-original-title="Delete this note?"><i class="fa fa-trash-o fa-lg"></i></a>
</h3>
<div data-bind="html: noteText">
</div>
</li>
</script>
<div id="calendar">
<div class="calendar__loader-container">
<div class="calendar__loader">
<div class="calendar__loader-line"></div>
<div class="calendar__loader-break calendar__loader-dot1"></div>
<div class="calendar__loader-break calendar__loader-dot2"></div>
<div class="calendar__loader-break calendar__loader-dot3"></div>
</div>
</div>
</div>
<script type="text/javascript">
var allowedStaff = [];
allowedStaff.push(87675);
var customerId = 0;
var customerConcessionId = 0;
var rescheduleBookingId = 0;
var bookController = {
bookingId: null,
customerId: null,
customerConcessionId: null,
message: $('.fc-messages'),
action: 'rebook',
cancel: function() {
this.message.hide();
this.bookingId = null;
this.customerId = null;
}
};
var options = {
staffJson: [{"id":87675,"name":"Tapuz Switch","color":null,"textColor":null}],
defaultStaff: 87675,
allowedStaff: allowedStaff,
selectedBooking: 0,
selectedGroup: 0,
currentStaffId: 87675,
currentLocationId: 52805,
currentView: 'agendaWeek',
currentDate : '2016-01-26',
todaysDate: '2016-01-26',
selectedDate: 'false',
currentBusinessId: 34933,
calendarUrl: '/calendar',
addInvoiceUrl: '/billing/invoiceadd',
addInvoiceModalClass: 'invoice-modal',
addCustomerUrl: '/Customer/CustomerAdd',
addConcessionUrl: '/customer/concessionadd',
addGiftVoucherUrl: '/customer/giftvoucheradd',
slotMinutes: 15,
axisFormat: 'HH:mm',
localisationTimeFormat: 'HH:mm',
localisationDateFormat:'d MMM yyyy',
localisationJsTimeFormat: 'G:i',
defaultEventMinutes: 15,
firstDay: 0,
calHeaderOptions: {
left: 'add,sell,locationSelect,',
center: 'prev,jumpLeft,today,title,jumpRight,next',
right: 'resourceDay,agendaWeek,month'
},
handleEventClick: handleEventClick,
handleEventOver: handleEventOver,
handleEventOut: handleEventOut,
handleEventAfterRender: handleEventAfterRender,
handleEventAfterAllRendered: handleEventAfterAllRendered,
editable: true,
disableDragging: false,
disableResizing: false,
addInvoiceButton: addInvoiceButton,
flexToggleButton: '<span class="btn-group"><a class="btn tip fc-flex-toggle" data-original-title="Search for customers" data-placement="right" href="#"><i class="fa fa-chevron-right"></i></a></span>',
staffDropDownsHtml: staffDropdowns,
isAdministrator: false,
locationDropDownsHtml: locationDropdowns,
ignoreTimezone: false,
firstHour: 9,
firstMinute: 0,
dateFormat: 'd MMM yyyy',
timeFormat: 'HH:mm',
dateFormatReversed: 'yyyy-MM-dd',
calDayformat: 'dddd d/M',
calMonthformat: 'ddd',
calWeekformat: 'ddd d MMM',
canUseFlex: canUseFlex
};
var theCalendarController;
$(document).ready(function () {
theCalendarController = new CalController();
theCalendarController.setup(options);
if (customerId > 0 || customerConcessionId > 0) {
bookController.customerId = customerId;
bookController.customerConcessionId = customerConcessionId;
bookController.action = 'new-booking';
bookController.message.html('Choose a time for the next appointment<a class="rebook-cancel">×</a>');
bookController.message.show();
$('.rebook-cancel', bookController.message).on('click', function () {
bookController.cancel();
});
$('#calendar').fullCalendar('option', 'height', theCalendarController.getHeight());
}
if (rescheduleBookingId > 0) {
bookController.bookingId = rescheduleBookingId;
//bookController.recurring = link.data().recurring;
bookController.action = 'change-booking';
bookController.message.html('Choose a new time for this appointment. <a class="rebook-cancel">×</a>');
bookController.message.show();
$('.rebook-cancel', bookController.message).on('click', function () {
bookController.cancel();
});
self.calendar.fullCalendar('option', 'height', self.getHeight());
}
});
function handleEventAfterRender () {
var self = this;
setTimeout(function(){
setTimeout(function(){
//check if we need to highlight a booking
if (self.selectedBooking > 0 && !self.haveHighlightedBooking) {
self.haveHighlightedBooking = true;
var element = self.selectedGroup
? $('.fc-group-' + self.selectedGroup)
: $('.fc-booking-id-' + self.selectedBooking);
element.addClass('run-bounce-animation');
//Need to scroll to right position
var scrollLayer = $('.fc-scroll-layer');
var scrollPos = element.position();
if (scrollPos !== null && scrollPos !== undefined && scrollPos.top !== undefined) {
scrollLayer.scrollTop(scrollPos.top - 100);
}
setTimeout(function() { element.removeClass('run-bounce-animation'); }, 2000);
}
}, 250);
}, 200);
};
var afterAllTimeout;
function handleEventAfterAllRendered () {
clearTimeout(afterAllTimeout);
afterAllTimeout = setTimeout(function(){
$('.fc-hidden-event').removeClass('fc-hidden-event');
$('.fc-fetching').removeClass('fc-fetching');
$('#calendar .tip').tooltip();
}, 200);
//Check if we have a saved page scroll position
if (theCalendarController.currentPageScrollPosition > 0) {
$(window).scrollTop(theCalendarController.currentPageScrollPosition);
}
};
var overTimeout;
var delay = 1500;
function handleEventOver (calEvent, jsEvent, view) {
//Event expanding turned off for now
//clearTimeout(overTimeout);
//var container = $(jsEvent.currentTarget);
//var toElement = $(jsEvent.toElement);
//var ignore = toElement.hasClass('fc-event-bg');
//var isResizing = container.hasClass('ui-resizable-resizing');
//if (isResizing || ignore) {
// return true;
//}
//var contentHeight = container.find('.fc-event-content').height();
//var notesHeight = container.find('.fc-event-notes').height();
//contentHeight = (contentHeight < notesHeight ? notesHeight : contentHeight) + 5;
//var containerHeight = container.height();
//if (!(container.data('orig-height') > 0)) {
// container.data('orig-height', containerHeight);
//}
//if (containerHeight < contentHeight - 10) {
// overTimeout = setTimeout(function() {
// container.height(contentHeight);
// container.find('.fc-event-wrap').height(contentHeight);
// }, delay);
//}
};
function handleEventOut (calEvent, jsEvent, view) {
//Event expanding turned off for now
//var container = $(jsEvent.currentTarget);
//clearTimeout(overTimeout);
//var isResizing = container.hasClass('ui-resizable-resizing');
//if (isResizing) {
// return true;
//}
//container.height(container.data('orig-height'));
//container.find('.fc-event-wrap').height(container.data('orig-height'));
};
function handleEventClick(calEvent, jsEvent, view) {
var self = this;
bookController.cancel();
jsEvent.preventDefault();
jsEvent.stopPropagation();
if (calEvent.type == '6') {
var element = $(jsEvent.currentTarget ? jsEvent.currentTarget : jsEvent.srcElement);
var showOptions = {
href: calEvent.url + '&start=' + moment(calEvent.start).format('DD-MM-YYYY HH:mm:ss') + '&end='+ moment(calEvent.start).format('DD-MM-YYYY HH:mm:ss'),
outputClass: '',
modalClass: '',
isAddOperation: "no"
};
$(document).modal('showManual', showOptions);
}
else if (calEvent.type == "2" || calEvent.type == "3") {
var showOptions = {
href: calEvent.url + '?tab=' + (calEvent.type == "2" ? "details" : "customers"),
outputClass: '',
modalClass: calEvent.type == "3" ? 'booking-modal' : '',
isAddOperation: "no"
};
$(document).modal('showManual', showOptions);
}
else if (calEvent.type == "4") {
var element = $(jsEvent.currentTarget ? jsEvent.currentTarget : jsEvent.srcElement);
var popOptions = {
title: "Appointment slot on hold",
content: "This appointment has been booked online and is currently in the payment process. The slot will be released within 60 minutes if the payment isn't successful.",
placement: 'right',
balloonClass: 'calendar-balloon'
};
$(document).balloon('show', element, popOptions);
}
else if (calEvent.type == "5") {
var element = $(jsEvent.currentTarget ? jsEvent.currentTarget : jsEvent.srcElement);
var popOptions = {
title: "External appointment not editable",
content: "This appointment has been imported from an external calendar and cannot be edited via the Timely calendar. Update the appointment in the external calendar and the change will be synchronised to your Timely calendar.",
placement: 'right',
balloonClass: 'calendar-balloon'
};
$(document).balloon('show', element, popOptions);
}
else {
var element = $(jsEvent.currentTarget ? jsEvent.currentTarget : jsEvent.srcElement);
var title = '';
var body = '';
//Check to see if the appointment is part of a group
//And if it is highlight the others
if (calEvent.groupId) {
$('.fc-group-' + calEvent.groupId).addClass('fc-group-highlight');
} else {
element.addClass('fc-group-highlight');
}
var modalClass = "booking-modal";
var bookingId = calEvent.id.replace("-booking", "");
title = '<a class="fc-customer-name goto-customer" data-customer-id="' + calEvent.customerId + '" title="View details" href="/customer/customers/' + calEvent.customerId + '?tab=details">' + calEvent.popoutTitle + '</a>'
+ (_.indexOf(calEvent.className, "fc-vip") > 0 ? ' <span class="vip"><i class="fa fa-star"/> VIP</span>' : '')
+ ' <a class="customer-edit modal-open bln-close" title="Edit" href="/customer/customeredit/' + calEvent.customerId + '?tab=details&fromCalendar=true"><i class="fa fa-pencil-square-o"/></a>'
+ '<a class="customer-edit modal-open bln-close" title="Send an SMS or email" href="/message/adhoccontactcustomer/' + calEvent.customerId + '"><i class="fa fa-envelope"/></a>'
+ '<a class="customer-edit bln-close print-booking" href="javascript:void(0);" title="Print appointment details" data-booking-group-id="' + calEvent.groupId + '" data-booking-id="' + bookingId + '"><i class="fa fa-print"></i></a>'
title += '<a class="close bln-close">×</a>';
if (calEvent.phone != '' || calEvent.sms != '') {
title += '<p>';
if (calEvent.phone != '') {
title += '<a href="tel:' + calEvent.phone + '"><i class="fa fa-phone"> </i>' + calEvent.phone + '</a> ';
}
if (calEvent.sms != '') {
title += '<a href="tel:' + calEvent.sms + '"><i class="fa fa-mobile"> </i>' + calEvent.sms + '</a>';
}
title += '</p>';
}
body = (calEvent.alert == null || calEvent.alert == '' ? '' : '<div class="alert">' + calEvent.alert + '</div>')
+ (calEvent.notes == null || calEvent.notes == '' ? '' : '<div class="alert alert-info">' + calEvent.notes + ' <a class="modal-open bln-close" data-modal-class="' + modalClass + '" href="' + calEvent.url + '?tab=notes">edit</a></div>')
+ (calEvent.locationContact == null ? '' : '<p><i class="fa fa-home summary"></i> ' + calEvent.locationContact + ' <a class="modal-open bln-close" data-modal-class="booking-modal" href="/calendar/bookingmap/' + bookingId + '"><i class="fa fa-map-marker"/> Map</a></p>')
+ '<p><i class="fa fa-cog summary"></i> ' + calEvent.body + '</p>'
+ '<p><i class="fa fa-user summary"></i> ' + calEvent.resource.name + ' '
+ '<a class="staff-contact modal-open bln-close" title="Send an SMS or email" href="/message/adhoccontactstaff/' + calEvent.resource.id + '"><i class="icon-envelope"/></a>'
+ (calEvent.onlineBooking
? ' - <em>' + (calEvent.resourceRequested ? 'requested by customer' : 'automatically assigned') + '</em></p>'
: '')
+ '</p>'
+ '<p><i class="fa fa-clock-o summary"></i> ' + moment(calEvent.start).format('HH:mm') + ' — ' + moment(calEvent.end).format('HH:mm') + '</p>'
+ (calEvent.autoExpireDateTime != ''
? '<p><i class="fa fa-bomb summary"></i> Expires ' + calEvent.autoExpireDateTime + '</p>'
: '')
+ (calEvent.concessionName == null ? '' : '<p><i class="fa fa-cubes"></i> ' + calEvent.concessionName + ' redeemed')
+ '<p class="btn-group status-buttons">'
+ '<a href="' + calEvent.url + '?tab=details" class="btn btn-primary btn-small modal-open bln-close" data-modal-class="' + modalClass + '"><i class="fa fa-pencil-square-o"></i> Edit</a>'
+ '<a class="btn btn-primary btn-small bln-close change-booking" data-booking-id="' + bookingId + '" data-recurring="' + calEvent.recurring + '"><i class="fa fa-calendar"></i> Reschedule</a>'
+ '<a class="btn btn-primary btn-small bln-close rebook" data-booking-id="' + bookingId + '"><i class="fa fa-refresh"></i> Book next</a>'
+ '</p>';
if (true) {
body += '<a href="/calendar/bookingcancel/' + bookingId + '" class="cancel-link modal-open bln-close"><i class="fa fa-trash-o"> </i>Cancel</a>';
}
body += '<div style="clear:both"></div>';
if (calEvent.bookingStatusId == 1) {
body += '<a href="/dashboard/acceptbooking/' + bookingId + '" class="btn btn-small btn-success bln-close ajaxer accept status-buttons" data-refresh-cal="yes"><i class="fa fa-check"></i> Confirm</a>';
if (calEvent.invoiced) {
body += '<a href="/calendar/bookingdecline/' + bookingId + '" class="btn btn-small btn-danger modal-open bln-close accept status-buttons" data-modal-class="' + modalClass + '"><i class="fa fa-times"></i> Decline</a>';
}
else {
body += '<a href="/dashboard/declinebooking/' + bookingId + '" class="btn btn-small btn-danger bln-close ajaxer accept status-buttons" data-refresh-cal="yes"><i class="fa fa-times"></i> Decline</a>';
}
}
if (calEvent.bookingStatusId == 2) {
body += '<p class="btn-group status-buttons" data-toggle="buttons-relaxed-radio">';
if (calEvent.invoiced)
{
body += '<a href="/billing/viewinvoice/?bookingId=' + bookingId + '&fromcalendar=true" class="btn btn-small"><i class="fa ' + (calEvent.paid ? "fa-file" : "fa-file-o") + '"></i> View invoice</a>';
}
else
{
body += '<a href="/billing/invoiceadd/?updatecalendar=true&bookingId=' + bookingId + '" class="btn btn-small modal-open bln-close" data-modal-class="invoice-modal"><i class="fa fa-file-o"></i> Raise sale</a>';
}
body += '<a href="/calendar/markascomplete/' + bookingId + '" class="btn btn-small btn-completed ajaxer' + (calEvent.confirmationStatusId == 4 ? ' active' : '') + '" data-refresh-cal="yes"><i class="fa fa-check"></i> Completed</a>';
body += '<a href="/calendar/didnotshow/' + bookingId + '" class="btn btn-small ajaxer' + (calEvent.confirmationStatusId == 5 ? ' active' : '') + '" data-refresh-cal="yes"><i class="fa fa-thumbs-down"></i> Did not show</a>';
body += '</p>';
}
body += '<div style="clear:both"></div>';
var printPdf = function (url) {
var pdfIframe = $('<iframe id="iFramePdf" src="' + url + '" style="display:none;"></iframe>');
$('html').append(pdfIframe);
pdfIframe.focus();
pdfIframe[0].contentWindow.print();
}
var generateReportUrl = function(bookingGroupId) {
var dataToSend = {
printFormatId: 1,
reportTypeId: 6,
reportView: 4,
bookingGroupId: bookingGroupId
};
var reportUrl = '/report/GetReportUrlAndGo?' + $.param(dataToSend);
return reportUrl;
};
var popOptions = {
title: title,
content: body,
placement: 'right',
balloonClass: 'calendar-balloon',
afterOpen: function(balloon) {
$('.print-booking', balloon).on('mouseenter', function() {
var button = $(this);
var bookingGroupId = button.data('bookingGroupId');
button.attr('href', generateReportUrl(bookingGroupId));
});
$('.print-booking', balloon).click(function (e) {
e.preventDefault();
$('.modal-backdrop').click();
var bookingGroupId = $(this).data('bookingGroupId');
var reportUrl = generateReportUrl(bookingGroupId);
if (window.browserDuckDetected.isIE || window.browserDuckDetected.isFirefox) {
var tab = window.open('');
tab.window.location.href = reportUrl;
} else {
printPdf(reportUrl);
}
return false;
});
$('.btn-completed', balloon).click(function() {
$('.customer-concessions-form').remove();
$('.popover .arrow').css('top','50%');
$('.popover-content').find('.fa-cubes').parent().addClass('error-text').html('<i class="fa fa-cubes"></i> Redeemed package removed');
if ($(this).hasClass('active')) return;
var customerId = parseInt(calEvent.customerId, 10);
if (_.isNaN(customerId) || customerId <= 0) return;
$.ajax({
type: 'POST',
url: '/customer/getcustomerconcessionitemsforbooking/' + bookingId,
data: { 'customerId': customerId },
success: function(data) {
var customerConcessionsByService = buildCustomerConcessionsByService(data);
if (customerConcessionsByService.length > 0) {
var content = '<p>Select service to redeem for this appointment.</p><form class="customer-concessions-form">';
content += '<table class="table table-condensed table-not-bordered table-no-decoration customer-concession-table-calendar"><thead><tr><th>Service</th><th>Available</th><th>Redeem</th></tr></thead><tbody>';
$.each(customerConcessionsByService.sort(function(a,b) { return a.name < b.name; }), function(i, obj) {
content += '<tr>';
content += '<td>' + obj.name + '</td>';