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 801-812
Link Here
|
801 |
</td> |
802 |
</td> |
802 |
|
803 |
|
803 |
<td class="article-request-cancel"> |
804 |
<td class="article-request-cancel"> |
804 |
<span class="tdlabel">Cancel:</span> |
805 |
<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> |
805 |
<form action="/cgi-bin/koha/opac-article-request-cancel.pl" id="delete_article_request_[% ar.id | html %]"> |
|
|
806 |
<legend class="sr-only">Cancel article request</legend> |
807 |
<input type="hidden" name="id" value="[% ar.id | html %]" /> |
808 |
<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> |
809 |
</form> |
810 |
</td> |
806 |
</td> |
811 |
</tr> |
807 |
</tr> |
812 |
[% END %] |
808 |
[% END %] |
Lines 843-848
Link Here
|
843 |
[% INCLUDE 'calendar.inc' %] |
839 |
[% INCLUDE 'calendar.inc' %] |
844 |
[% INCLUDE 'datatables.inc' %] |
840 |
[% INCLUDE 'datatables.inc' %] |
845 |
<script> |
841 |
<script> |
|
|
842 |
var AR_CAPTION_COUNT = _("(%s total)"); |
843 |
|
844 |
|
846 |
function tableInit( tableId ){ |
845 |
function tableInit( tableId ){ |
847 |
if( tableId == "checkoutst" ){ |
846 |
if( tableId == "checkoutst" ){ |
848 |
$(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> "); |
847 |
$(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> "); |
Lines 852-857
Link Here
|
852 |
} |
851 |
} |
853 |
} |
852 |
} |
854 |
$(document).ready(function(){ |
853 |
$(document).ready(function(){ |
|
|
854 |
$('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% logged_in_user.article_requests_current.count | html %]')); |
855 |
$('#opac-user-views').tabs(); |
855 |
$('#opac-user-views').tabs(); |
856 |
$(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); |
856 |
$(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); |
857 |
$(".suspend-until").prop("readonly",1); |
857 |
$(".suspend-until").prop("readonly",1); |
Lines 861-866
Link Here
|
861 |
var hold_title = $(this).data("title"); |
861 |
var hold_title = $(this).data("title"); |
862 |
var reserve_id = $(this).data("reserve_id"); |
862 |
var reserve_id = $(this).data("reserve_id"); |
863 |
confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){ |
863 |
confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){ |
|
|
864 |
$("#bootstrap-confirm-box-modal").remove() |
864 |
if( result ){ |
865 |
if( result ){ |
865 |
$("#delete_hold_" + reserve_id ).submit(); |
866 |
$("#delete_hold_" + reserve_id ).submit(); |
866 |
} |
867 |
} |
Lines 872-883
Link Here
|
872 |
e.preventDefault(); |
873 |
e.preventDefault(); |
873 |
var article_request = $(this).data("title"); |
874 |
var article_request = $(this).data("title"); |
874 |
var article_request_id = $(this).data("article-request_id"); |
875 |
var article_request_id = $(this).data("article-request_id"); |
875 |
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 ){ |
876 |
(function(row){ |
|
|
877 |
var doCancel = function( result ){ |
878 |
$("#bootstrap-confirm-box-modal").remove(); |
876 |
if( result ){ |
879 |
if( result ){ |
877 |
$("#delete_article_request_" + article_request_id ).submit(); |
880 |
$.ajax({ |
|
|
881 |
type: "DELETE", |
882 |
url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id, |
883 |
success: function( data ) { |
884 |
row.parents('tr').hide({ |
885 |
duration: 'slow', |
886 |
complete: function() { |
887 |
var ar_tab = $('a[href="#opac-user-article-requests"'); |
888 |
var ar_table = $('#article-requests-table'); |
889 |
var ar_length = $('tbody tr:visible', ar_table).length; |
890 |
var ar_count = $('caption .count', ar_table); |
891 |
|
892 |
ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')')); |
893 |
ar_count.html(AR_CAPTION_COUNT.format(ar_length)); |
894 |
} |
895 |
}); |
896 |
} |
897 |
}); |
878 |
} |
898 |
} |
879 |
} |
899 |
}; |
880 |
); |
900 |
confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), doCancel); |
|
|
901 |
})($(this)) |
881 |
}); |
902 |
}); |
882 |
|
903 |
|
883 |
$("#suspend_all_submit").on("click", function(e){ |
904 |
$("#suspend_all_submit").on("click", function(e){ |
Lines 885-890
Link Here
|
885 |
var title = _("Are you sure you want to suspend all holds?"); |
906 |
var title = _("Are you sure you want to suspend all holds?"); |
886 |
var body = _("All holds will be suspended."); |
907 |
var body = _("All holds will be suspended."); |
887 |
confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){ |
908 |
confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){ |
|
|
909 |
$("#bootstrap-confirm-box-modal").remove() |
888 |
if( result ){ |
910 |
if( result ){ |
889 |
$("#suspend_all_holds").submit(); |
911 |
$("#suspend_all_holds").submit(); |
890 |
} |
912 |
} |
Lines 897-902
Link Here
|
897 |
var title = _("Are you sure you want to resume all suspended holds?"); |
919 |
var title = _("Are you sure you want to resume all suspended holds?"); |
898 |
var body = _("All holds will resume."); |
920 |
var body = _("All holds will resume."); |
899 |
confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){ |
921 |
confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){ |
|
|
922 |
$("#bootstrap-confirm-box-modal").remove() |
900 |
if( result ){ |
923 |
if( result ){ |
901 |
$("#resume_all_holds").submit(); |
924 |
$("#resume_all_holds").submit(); |
902 |
} |
925 |
} |
903 |
- |
|
|