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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-renewal-modal-strings.inc (+4 lines)
Line 0 Link Here
1
<script>
2
    var renewed_prop = _("Note: %s out of %s renewals have been logged");
3
    var renewed = _("Renewed by");
4
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-renewal-modal.inc (+18 lines)
Line 0 Link Here
1
<div id="patronRenewals" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="patronRenewalsLabel" aria-hidden="true">
2
    <div class="modal-dialog">
3
        <div class="modal-content">
4
            <div class="modal-header">
5
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
6
                <h3 id="patronRenewalsLabel"> Item renewals</h3>
7
            </div>
8
            <div class="modal-body">
9
                <div id="retrieving" class="alert" style="display:none">Retrieving renewals...</div>
10
                <div id="incomplete" class="alert" style="display:none"></div>
11
                <ul id="results" style="display:none"></ul>
12
            </div>
13
            <div class="modal-footer">
14
                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
15
            </div>
16
        </div>
17
    </div>
18
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-1 / +9 lines)
Lines 109-115 Link Here
109
          </td>
109
          </td>
110
110
111
          <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]#item[% issue.itemnumber | uri %]">[% issue.barcode | html %]</a></td>
111
          <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]#item[% issue.itemnumber | uri %]">[% issue.barcode | html %]</a></td>
112
          <td>[% issue.renewals_count | html %]</td>
112
          <td>
113
              [% issue.renewals_count | html %]
114
              [% IF issue.renewals_count > 0 %]
115
                  [ <a class="patron_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id %]" href="#">View</a> ]
116
              [% END %]
117
          </td>
113
          <td data-order="[% issue.issuedate | html %]">
118
          <td data-order="[% issue.issuedate | html %]">
114
              [% issue.issuedate |$KohaDates  with_hours => 1 %]
119
              [% issue.issuedate |$KohaDates  with_hours => 1 %]
115
          </td>
120
          </td>
Lines 154-159 Link Here
154
    [% Asset.js("js/members-menu.js") | $raw %]
159
    [% Asset.js("js/members-menu.js") | $raw %]
155
    [% INCLUDE 'datatables.inc' %]
160
    [% INCLUDE 'datatables.inc' %]
156
    [% INCLUDE 'columns_settings.inc' %]
161
    [% INCLUDE 'columns_settings.inc' %]
162
    [% INCLUDE 'patron-renewal-modal.inc' %]
163
    [% INCLUDE 'patron-renewal-modal-strings.inc' %]
164
    [% Asset.js("js/patron-renewal-modal.js") | $raw %]
157
    <script id="js">
165
    <script id="js">
158
        $(document).ready(function() {
166
        $(document).ready(function() {
159
            var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
167
            var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
(-)a/koha-tmpl/intranet-tmpl/prog/js/patron-renewal-modal.js (+25 lines)
Line 0 Link Here
1
$(document).ready(function(){
2
    // Display the modal containing patron renewals details
3
    $('.patron_renewals_view').on('click', function(e) {
4
        e.preventDefault();
5
        $('#patronRenewals #incomplete').html('').hide();
6
        $('#patronRenewals #results').html('').hide();
7
        $('#patronRenewals').modal({show:true});
8
        var renewals = $(this).data('renewals');
9
        var checkoutID = $(this).data('issueid');
10
        $('#patronRenewals #retrieving').show();
11
        $.get({ 'url': '/api/v1/checkouts/'+checkoutID+'/renewals', 'headers': { 'x-koha-embed': 'renewer' } }, function(data) {
12
            if (data.length < renewals) {
13
                $('#patronRenewals #incomplete').append(renewed_prop.format(data.length, renewals)).show();
14
            }
15
            var items = data.map(function(item) {
16
                return createLi(item);
17
            });
18
            $('#patronRenewals #retrieving').hide();
19
            $('#patronRenewals #results').append(items).show();
20
        });
21
    });
22
    function createLi(renewal) {
23
        return '<li><span style="font-weight:bold">' + renewal.timestamp + '</span> ' + renewed + ' <span style="font-weight:bold">' + renewal.renewer.firstname + ' ' + renewal.renewer.surname + '</li>';
24
    }
25
});
(-)a/members/readingrec.pl (-3 / +3 lines)
Lines 27-34 use CGI qw ( -utf8 ); Link Here
27
use C4::Auth qw( get_template_and_user );
27
use C4::Auth qw( get_template_and_user );
28
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
28
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
29
use C4::Members qw( GetAllIssues );
29
use C4::Members qw( GetAllIssues );
30
use List::MoreUtils qw( uniq );
30
use List::MoreUtils qw( any uniq );
31
use Koha::DateUtils qw( dt_from_string );
31
use Koha::DateUtils qw( dt_from_string );
32
use Koha::ActionLogs;
32
33
33
use Koha::Patrons;
34
use Koha::Patrons;
34
use Koha::Patron::Categories;
35
use Koha::Patron::Categories;
Lines 97-103 if (! $limit){ Link Here
97
$template->param(
98
$template->param(
98
    patron            => $patron,
99
    patron            => $patron,
99
    readingrecordview => 1,
100
    readingrecordview => 1,
100
    loop_reading      => $issues,
101
    loop_reading      => $issues
101
);
102
);
102
output_html_with_http_headers $input, $cookie, $template->output;
103
output_html_with_http_headers $input, $cookie, $template->output;
103
104
104
- 

Return to bug 23838