Lines 5-10
Link Here
|
5 |
[% USE Branches %] |
5 |
[% USE Branches %] |
6 |
[% USE ItemTypes %] |
6 |
[% USE ItemTypes %] |
7 |
[% USE Price %] |
7 |
[% USE Price %] |
|
|
8 |
[% USE AuthorisedValues %] |
8 |
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] |
9 |
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] |
9 |
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] |
10 |
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] |
10 |
|
11 |
|
Lines 715-721
Link Here
|
715 |
<div id="opac-user-article-requests"> |
716 |
<div id="opac-user-article-requests"> |
716 |
[% IF logged_in_user.article_requests_current.count %] |
717 |
[% IF logged_in_user.article_requests_current.count %] |
717 |
<table id="article-requests-table" class="table table-bordered table-striped"> |
718 |
<table id="article-requests-table" class="table table-bordered table-striped"> |
718 |
<caption>Article requests <span class="count">([% logged_in_user.article_requests_current.count | html %] total)</span></caption> |
719 |
<caption>Article requests <span class="count"></span></caption> |
719 |
<thead> |
720 |
<thead> |
720 |
<tr> |
721 |
<tr> |
721 |
<th class="anti-the article-request-record-title">Record title</th> |
722 |
<th class="anti-the article-request-record-title">Record title</th> |
Lines 803-814
Link Here
|
803 |
</td> |
804 |
</td> |
804 |
|
805 |
|
805 |
<td class="article-request-cancel"> |
806 |
<td class="article-request-cancel"> |
806 |
<span class="tdlabel">Cancel:</span> |
807 |
<button data-title="[% ar.biblio.title | html %] [% ar.item.enumchron | html %]" data-article-request_id="[% ar.id | html %]" class="btn btn-sm btn-danger btn-delete-article-request"><i class="fa fa-remove" aria-hidden="true"></i> Cancel</button> |
807 |
<form action="/cgi-bin/koha/opac-article-request-cancel.pl" id="delete_article_request_[% ar.id | html %]"> |
|
|
808 |
<legend class="sr-only">Cancel article request</legend> |
809 |
<input type="hidden" name="id" value="[% ar.id | html %]" /> |
810 |
<button data-title="[% ar.biblio.title | html %] [% ar.item.enumchron | html %]" data-article-request_id="[% ar.id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-article-request"><i class="fa fa-remove" aria-hidden="true"></i> Cancel</button> |
811 |
</form> |
812 |
</td> |
808 |
</td> |
813 |
</tr> |
809 |
</tr> |
814 |
[% END %] |
810 |
[% END %] |
Lines 845-850
Link Here
|
845 |
[% INCLUDE 'calendar.inc' %] |
841 |
[% INCLUDE 'calendar.inc' %] |
846 |
[% INCLUDE 'datatables.inc' %] |
842 |
[% INCLUDE 'datatables.inc' %] |
847 |
<script> |
843 |
<script> |
|
|
844 |
var AR_CAPTION_COUNT = _("(%s total)"); |
845 |
|
846 |
|
848 |
function tableInit( tableId ){ |
847 |
function tableInit( tableId ){ |
849 |
if( tableId == "checkoutst" ){ |
848 |
if( tableId == "checkoutst" ){ |
850 |
$(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> "); |
849 |
$(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> "); |
Lines 854-859
Link Here
|
854 |
} |
853 |
} |
855 |
} |
854 |
} |
856 |
$(document).ready(function(){ |
855 |
$(document).ready(function(){ |
|
|
856 |
$('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% logged_in_user.article_requests_current.count | html %]')); |
857 |
$('#opac-user-views').tabs(); |
857 |
$('#opac-user-views').tabs(); |
858 |
$(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); |
858 |
$(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); |
859 |
$(".suspend-until").prop("readonly",1); |
859 |
$(".suspend-until").prop("readonly",1); |
Lines 863-868
Link Here
|
863 |
var hold_title = $(this).data("title"); |
863 |
var hold_title = $(this).data("title"); |
864 |
var reserve_id = $(this).data("reserve_id"); |
864 |
var reserve_id = $(this).data("reserve_id"); |
865 |
confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){ |
865 |
confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){ |
|
|
866 |
$("#bootstrap-confirm-box-modal").remove() |
866 |
if( result ){ |
867 |
if( result ){ |
867 |
$("#delete_hold_" + reserve_id ).submit(); |
868 |
$("#delete_hold_" + reserve_id ).submit(); |
868 |
} |
869 |
} |
Lines 874-885
Link Here
|
874 |
e.preventDefault(); |
875 |
e.preventDefault(); |
875 |
var article_request = $(this).data("title"); |
876 |
var article_request = $(this).data("title"); |
876 |
var article_request_id = $(this).data("article-request_id"); |
877 |
var article_request_id = $(this).data("article-request_id"); |
877 |
confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), function( result ){ |
878 |
(function(row){ |
|
|
879 |
var doCancel = function( result ){ |
880 |
$("#bootstrap-confirm-box-modal").remove(); |
878 |
if( result ){ |
881 |
if( result ){ |
879 |
$("#delete_article_request_" + article_request_id ).submit(); |
882 |
$.ajax({ |
|
|
883 |
type: "DELETE", |
884 |
url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id, |
885 |
success: function( data ) { |
886 |
row.parents('tr').hide({ |
887 |
duration: 'slow', |
888 |
complete: function() { |
889 |
var ar_tab = $('a[href="#opac-user-article-requests"'); |
890 |
var ar_table = $('#article-requests-table'); |
891 |
var ar_length = $('tbody tr:visible', ar_table).length; |
892 |
var ar_count = $('caption .count', ar_table); |
893 |
|
894 |
ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')')); |
895 |
ar_count.html(AR_CAPTION_COUNT.format(ar_length)); |
896 |
} |
897 |
}); |
898 |
} |
899 |
}); |
880 |
} |
900 |
} |
881 |
} |
901 |
}; |
882 |
); |
902 |
confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), doCancel); |
|
|
903 |
})($(this)) |
883 |
}); |
904 |
}); |
884 |
|
905 |
|
885 |
$("#suspend_all_submit").on("click", function(e){ |
906 |
$("#suspend_all_submit").on("click", function(e){ |
Lines 887-892
Link Here
|
887 |
var title = _("Are you sure you want to suspend all holds?"); |
908 |
var title = _("Are you sure you want to suspend all holds?"); |
888 |
var body = _("All holds will be suspended."); |
909 |
var body = _("All holds will be suspended."); |
889 |
confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){ |
910 |
confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){ |
|
|
911 |
$("#bootstrap-confirm-box-modal").remove() |
890 |
if( result ){ |
912 |
if( result ){ |
891 |
$("#suspend_all_holds").submit(); |
913 |
$("#suspend_all_holds").submit(); |
892 |
} |
914 |
} |
Lines 899-904
Link Here
|
899 |
var title = _("Are you sure you want to resume all suspended holds?"); |
921 |
var title = _("Are you sure you want to resume all suspended holds?"); |
900 |
var body = _("All holds will resume."); |
922 |
var body = _("All holds will resume."); |
901 |
confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){ |
923 |
confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){ |
|
|
924 |
$("#bootstrap-confirm-box-modal").remove() |
902 |
if( result ){ |
925 |
if( result ){ |
903 |
$("#resume_all_holds").submit(); |
926 |
$("#resume_all_holds").submit(); |
904 |
} |
927 |
} |
905 |
- |
|
|