View | Details | Raw Unified | Return to bug 23838
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-renewal-modal.inc (-2 / +2 lines)
Lines 1-9 Link Here
1
<div id="patronRenewals" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="patronRenewalsLabel" aria-hidden="true">
1
<div id="checkoutRenewals" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="checkoutRenewalsLabel" aria-hidden="true">
2
    <div class="modal-dialog">
2
    <div class="modal-dialog">
3
        <div class="modal-content">
3
        <div class="modal-content">
4
            <div class="modal-header">
4
            <div class="modal-header">
5
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
5
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
6
                <h3 id="patronRenewalsLabel"> Item renewals</h3>
6
                <h3 id="checkoutRenewalsLabel"> Item renewals</h3>
7
            </div>
7
            </div>
8
            <div class="modal-body">
8
            <div class="modal-body">
9
                <div id="retrieving" class="alert" style="display:none">Retrieving renewals...</div>
9
                <div id="retrieving" class="alert" style="display:none">Retrieving renewals...</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-4 / +4 lines)
Lines 112-118 Link Here
112
          <td>
112
          <td>
113
              [% issue.renewals_count | html %]
113
              [% issue.renewals_count | html %]
114
              [% IF issue.renewals_count > 0 %]
114
              [% IF issue.renewals_count > 0 %]
115
                  [ <a class="patron_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id | html %]" href="#">View</a> ]
115
                  [ <a class="checkout_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id | html %]" href="#">View</a> ]
116
              [% END %]
116
              [% END %]
117
          </td>
117
          </td>
118
          <td data-order="[% issue.issuedate | html %]">
118
          <td data-order="[% issue.issuedate | html %]">
Lines 159-169 Link Here
159
    [% Asset.js("js/members-menu.js") | $raw %]
159
    [% Asset.js("js/members-menu.js") | $raw %]
160
    [% INCLUDE 'datatables.inc' %]
160
    [% INCLUDE 'datatables.inc' %]
161
    [% INCLUDE 'columns_settings.inc' %]
161
    [% INCLUDE 'columns_settings.inc' %]
162
    [% INCLUDE 'patron-renewal-modal.inc' %]
162
    [% INCLUDE 'checkout-renewal-modal.inc' %]
163
    [% INCLUDE 'patron-renewal-modal-strings.inc' %]
163
    [% INCLUDE 'checkout-renewal-modal-strings.inc' %]
164
    [% INCLUDE 'js-date-format.inc' %]
164
    [% INCLUDE 'js-date-format.inc' %]
165
    [% INCLUDE 'js-patron-format.inc' %]
165
    [% INCLUDE 'js-patron-format.inc' %]
166
    [% Asset.js("js/patron-renewal-modal.js") | $raw %]
166
    [% Asset.js("js/checkout-renewal-modal.js") | $raw %]
167
    <script id="js">
167
    <script id="js">
168
        $(document).ready(function() {
168
        $(document).ready(function() {
169
            var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
169
            var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
(-)a/koha-tmpl/intranet-tmpl/prog/js/patron-renewal-modal.js (-10 / +9 lines)
Lines 1-22 Link Here
1
$(document).ready(function(){
1
$(document).ready(function(){
2
    // Display the modal containing patron renewals details
2
    // Display the modal containing checkout renewals details
3
    $('.patron_renewals_view').on('click', function(e) {
3
    $('.checkout_renewals_view').on('click', function(e) {
4
        e.preventDefault();
4
        e.preventDefault();
5
        $('#patronRenewals #incomplete').html('').hide();
5
        $('#checkoutRenewals #incomplete').html('').hide();
6
        $('#patronRenewals #results').html('').hide();
6
        $('#checkoutRenewals #results').html('').hide();
7
        $('#patronRenewals').modal({show:true});
7
        $('#checkoutRenewals').modal({show:true});
8
        var renewals = $(this).data('renewals');
8
        var renewals = $(this).data('renewals');
9
        var checkoutID = $(this).data('issueid');
9
        var checkoutID = $(this).data('issueid');
10
        $('#patronRenewals #retrieving').show();
10
        $('#checkoutRenewals #retrieving').show();
11
        $.get({ 'url': '/api/v1/checkouts/'+checkoutID+'/renewals', 'headers': { 'x-koha-embed': 'renewer' } }, function(data) {
11
        $.get({ 'url': '/api/v1/checkouts/'+checkoutID+'/renewals', 'headers': { 'x-koha-embed': 'renewer' } }, function(data) {
12
            if (data.length < renewals) {
12
            if (data.length < renewals) {
13
                $('#patronRenewals #incomplete').append(renewed_prop.format(data.length, renewals)).show();
13
                $('#checkoutRenewals #incomplete').append(renewed_prop.format(data.length, renewals)).show();
14
            }
14
            }
15
            var items = data.map(function(item) {
15
            var items = data.map(function(item) {
16
                return createLi(item);
16
                return createLi(item);
17
            });
17
            });
18
            $('#patronRenewals #retrieving').hide();
18
            $('#checkoutRenewals #retrieving').hide();
19
            $('#patronRenewals #results').append(items).show();
19
            $('#checkoutRenewals #results').append(items).show();
20
        });
20
        });
21
    });
21
    });
22
    function createLi(renewal) {
22
    function createLi(renewal) {
23
- 

Return to bug 23838