Lines 670-676
Link Here
|
670 |
</div> <!-- /div.row --> |
670 |
</div> <!-- /div.row --> |
671 |
|
671 |
|
672 |
[% INCLUDE 'patron-detail-tabs.inc' patronpage = "borrower" %] |
672 |
[% INCLUDE 'patron-detail-tabs.inc' patronpage = "borrower" %] |
673 |
|
|
|
674 |
</main> |
673 |
</main> |
675 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
674 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
676 |
|
675 |
|
Lines 685-690
Link Here
|
685 |
[% INCLUDE 'modals/resolve_return_claim.inc' %] |
684 |
[% INCLUDE 'modals/resolve_return_claim.inc' %] |
686 |
[% END %] |
685 |
[% END %] |
687 |
|
686 |
|
|
|
687 |
[% INCLUDE modals/cancel_booking.inc %] |
688 |
|
688 |
[% MACRO jsinclude BLOCK %] |
689 |
[% MACRO jsinclude BLOCK %] |
689 |
[% INCLUDE 'datatables.inc' %] |
690 |
[% INCLUDE 'datatables.inc' %] |
690 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
691 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
Lines 720-725
Link Here
|
720 |
[% END %] |
721 |
[% END %] |
721 |
[% Asset.js("js/holds.js") | $raw %] |
722 |
[% Asset.js("js/holds.js") | $raw %] |
722 |
[% INCLUDE 'calendar.inc' %] |
723 |
[% INCLUDE 'calendar.inc' %] |
|
|
724 |
[% Asset.js("js/bookings.js") | $raw %] |
725 |
[% Asset.js("js/cancel_booking_modal.js") | $raw %] |
723 |
[% INCLUDE 'str/members-menu.inc' %] |
726 |
[% INCLUDE 'str/members-menu.inc' %] |
724 |
[% Asset.js("js/members-menu.js") | $raw %] |
727 |
[% Asset.js("js/members-menu.js") | $raw %] |
725 |
[% Asset.js("js/recalls.js") | $raw %] |
728 |
[% Asset.js("js/recalls.js") | $raw %] |
Lines 748-754
Link Here
|
748 |
$('#guarantees_finesandcharges-tab').click(); |
751 |
$('#guarantees_finesandcharges-tab').click(); |
749 |
}); |
752 |
}); |
750 |
|
753 |
|
|
|
754 |
// Bookings |
755 |
var bookings_table; |
756 |
// Load bookings table on tab selection |
757 |
$("#bookings-tab").on( "click", function(){ |
758 |
if ( !bookings_table ) { |
759 |
var today = new Date(); |
760 |
var bookings_table_url = "/api/v1/bookings"; |
761 |
bookings_table = $('#bookings-table').kohaTable({ |
762 |
"ajax": { |
763 |
"url": bookings_table_url |
764 |
}, |
765 |
"embed": [ |
766 |
"biblio", |
767 |
"item", |
768 |
"patron" |
769 |
], |
770 |
"columns": [{ |
771 |
"data": "booking_id", |
772 |
"title": "Booking ID", |
773 |
"visible": false, |
774 |
"searchable": false, |
775 |
"orderable": false |
776 |
}, |
777 |
{ |
778 |
"data": "biblio.title", |
779 |
"title": "Title", |
780 |
"searchable": true, |
781 |
"orderable": true, |
782 |
"render": function(data,type,row,meta) { |
783 |
return row.biblio.title; |
784 |
} |
785 |
}, |
786 |
{ |
787 |
"data": "item.external_id", |
788 |
"title": "Item", |
789 |
"searchable": true, |
790 |
"orderable": true, |
791 |
"defaultContent": "Any item", |
792 |
"render": function(data,type,row,meta) { |
793 |
if ( row.item ) { |
794 |
return row.item.external_id; |
795 |
} else { |
796 |
return null; |
797 |
} |
798 |
} |
799 |
}, |
800 |
{ |
801 |
"data": "start_date", |
802 |
"title": "Start date", |
803 |
"searchable": true, |
804 |
"orderable": true, |
805 |
"render": function(data, type, row, meta) { |
806 |
return $datetime(row.start_date); |
807 |
} |
808 |
}, |
809 |
{ |
810 |
"data": "end_date", |
811 |
"title": "End date", |
812 |
"searchable": true, |
813 |
"orderable": true, |
814 |
"render": function(data, type, row, meta) { |
815 |
return $datetime(row.end_date); |
816 |
} |
817 |
}, |
818 |
{ |
819 |
"data": "", |
820 |
"title": "Actions", |
821 |
"searchable": false, |
822 |
"orderable": false, |
823 |
"render": function(data, type, row, meta) { |
824 |
var result = '<button type="button" class="btn btn-default btn-xs cancel-action" data-toggle="modal" data-target="#cancelBookingModal" data-booking="'+row.booking_id+'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Cancel")+'</button>'; |
825 |
return result; |
826 |
} |
827 |
}] |
828 |
}, [], 1, { patron_id: "[% patron.borrowernumber | html %]", end_date: { ">=": today.toISOString() } }); |
829 |
}; |
830 |
}); |
831 |
// Bookings |
832 |
|
751 |
}); |
833 |
}); |
|
|
834 |
|
752 |
function uncheck_sibling(me){ |
835 |
function uncheck_sibling(me){ |
753 |
nodename=me.getAttribute("name"); |
836 |
nodename=me.getAttribute("name"); |
754 |
if (nodename =="barcodes[]"){ |
837 |
if (nodename =="barcodes[]"){ |