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

(-)a/admin/columns_settings.yml (+29 lines)
Lines 255-260 modules: Link Here
255
          cannot_be_toggled: 1
255
          cannot_be_toggled: 1
256
          cannot_be_modified: 1
256
          cannot_be_modified: 1
257
257
258
    reserveshistory:
259
      reserveshistory-table:
260
        -
261
          columnname: title
262
          cannot_be_toggled: 1
263
          cannot_be_modified: 1
264
        -
265
          columnname: author
266
        -
267
          columnname: barcode
268
        -
269
          columnname: branch
270
        -
271
          columnname: reservedate
272
        -
273
          columnname: notificationdate
274
        -
275
          columnname: reminderdate
276
        -
277
          columnname: expirationdate
278
        -
279
          columnname: waitingdate
280
        -
281
          columnname: cancellationdate
282
        -
283
          columnname: itemtype
284
        -
285
          columnname: status
286
258
  reports:
287
  reports:
259
    lostitems:
288
    lostitems:
260
      lostitems-table:
289
      lostitems-table:
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+5 lines)
Lines 88-93 Link Here
88
            [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation history</a></li>
88
            [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation history</a></li>
89
        [% END %]
89
        [% END %]
90
    [% END %]
90
    [% END %]
91
    [% IF ( CAN_user_borrowers ) %]
92
        [% IF ( intranetreadinghistory ) %]
93
            [% IF ( reserveshistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/reserveshistory.pl?borrowernumber=[% borrowernumber %]">Reserves history</a></li>
94
        [% END %]
95
    [% END %]
91
    [% IF ( CAN_user_parameters ) %]
96
    [% IF ( CAN_user_parameters ) %]
92
        [% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrowernumber %]&amp;src=circ">Modification log</a></li>
97
        [% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrowernumber %]&amp;src=circ">Modification log</a></li>
93
    [% END %]
98
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/reserveshistory.tt (+135 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% USE Koha %]
3
[% USE AuthorisedValues %]
4
[% USE Branches %]
5
[% USE ColumnsSettings %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Reserves History for [% INCLUDE 'patron-title.inc' %]</title>
8
[% INCLUDE 'doc-head-close.inc' %]
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
[% INCLUDE 'datatables.inc' %]
11
[% INCLUDE 'columns_settings.inc' %]
12
<script type="text/javascript" id="js">
13
//<![CDATA[
14
15
 $(document).ready(function() {
16
    var columns_settings = [% ColumnsSettings.GetColumns('members', 'reserveshistory', 'reserveshistory-table', 'json') %];
17
    var table = KohaTable("#table_reserveshistory", {
18
        "sPaginationType": "four_button",
19
        "aaSorting": [[4, 'desc']],
20
        "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
21
        "aoColumnDefs": [
22
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
23
            { "sType": "title-string", "aTargets" : [ "title-string" ] }
24
        ]
25
    }, columns_settings);
26
 });
27
//]]>
28
</script>
29
</head>
30
<body id="pat_reserveshistory" class="pat">
31
[% INCLUDE 'header.inc' %]
32
[% INCLUDE 'patron-search.inc' %]
33
34
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Reserves history for [% INCLUDE 'patron-title.inc' %]</div>
35
36
<div id="doc3" class="yui-t2">
37
    <div id="bd">
38
    <div id="yui-main">
39
    <div class="yui-b">
40
[% INCLUDE 'members-toolbar.inc' %]
41
<h1>Reserves history</h1>
42
43
[% UNLESS Koha.Preference('intranetreadinghistory') %]
44
    <div class="dialog alert">Staff members are not allowed to access patron's reserves history</div>
45
[% ELSIF is_anonymous %]
46
    <div class="dialog alert">This is the anonymous patron, so no reserves history is displayed.</div>
47
[% ELSIF ( !holds ) %]
48
    <div class="dialog message">This patron has no reserves history.</div>
49
[% ELSE %]
50
51
<div id="reserveshistory" style="overflow:hidden">
52
  <table id="table_reserveshistory">
53
      <thead>
54
        <th class="anti-the">Title</th>
55
        <th>Author</th>
56
        <th>Barcode</th>
57
        <th>Library</th>
58
        <th class="title-string">Reserve date</th>
59
        <th class="title-string">Notification date</th>
60
        <th class="title-string">Reminder date</th>
61
        <th class="title-string">Expiration date</th>
62
        <th class="title-string">Waiting date</th>
63
        <th class="title-string">Cancellation date</th>
64
        <th>Item type</th>
65
        <th>Status</th>
66
      </thead>
67
      <tbody>
68
      [% FOREACH hold IN holds %]
69
          <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblio.biblionumber %]">[% hold.biblio.title |html %]</a></td>
70
          <td>[% hold.biblio.author %]</td>
71
          <td>[% hold.item.barcode %]</td>
72
          <td>[% Branches.GetName( hold.branchcode ) %]</td>
73
          <td><span title="[% hold.reservedate %]">[% hold.reservedate | $KohaDates %]</span></td>
74
          <td>
75
              [% IF hold.notificationdate %]
76
                  <span title="[% hold.notificationdate %]">[% hold.notificationdate | $KohaDates %]</span>
77
              [% ELSE %]
78
                  <span title="0000-00-00"></span>
79
              [% END %]
80
          </td>
81
          <td>
82
              [% IF hold.reminderdate %]
83
                  <span title="[% hold.reminderdate %]">[% hold.reminderdate | $KohaDates %]</span>
84
              [% ELSE %]
85
                  <span title="0000-00-00"></span>
86
              [% END %]
87
          </td>
88
          <td>
89
              [% IF hold.expirationdate %]
90
                  <span title="[% hold.expirationdate %]">[% hold.expirationdate | $KohaDates %]</span>
91
              [% ELSE %]
92
                  <span title="0000-00-00"></span>
93
              [% END %]
94
          </td>
95
          <td>
96
              [% IF hold.waitingdate %]
97
                  <span title="[% hold.waitingdate %]">[% hold.waitingdate | $KohaDates %]</span>
98
              [% ELSE %]
99
                  <span title="0000-00-00"></span>
100
              [% END %]
101
          </td>
102
          <td>
103
              [% IF hold.cancellationdate %]
104
                  <span title="[% hold.cancellationdate %]">[% hold.cancellationdate | $KohaDates %]</span>
105
              [% ELSE %]
106
                  <span title="0000-00-00"></span>
107
              [% END %]
108
          </td>
109
          <td>[% hold.itemtype %]</td>
110
          <td>
111
          [% IF hold.found == 'W' %]
112
              Waiting
113
          [% ELSIF hold.found == 'T' %]
114
              In transit
115
          [% ELSIF hold.cancellationdate %]
116
              Cancelled
117
          [% ELSE %]
118
              In queue
119
          [% END %]
120
          </td>
121
        </tr>
122
      [% END %]
123
      </tbody>
124
  </table>
125
</div>
126
127
[% END %]
128
</div>
129
</div>
130
131
<div class="yui-b">
132
[% INCLUDE 'circ-menu.inc' %]
133
</div>
134
</div>
135
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/members/reserveshistory.pl (-1 / +96 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
#
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use CGI qw ( -utf8 );
21
22
use C4::Auth;
23
use C4::Output;
24
25
use Koha::Patrons;
26
27
my $input = CGI->new;
28
29
my $borrowernumber;
30
my $cardnumber;
31
my @all_holds;
32
33
my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/reserveshistory.tt",
34
                query => $input,
35
                type => "intranet",
36
                authnotrequired => 0,
37
                flagsrequired => {borrowers => 1},
38
                debug => 1,
39
                });
40
41
my $patron;
42
43
if ($input->param('cardnumber')) {
44
    $cardnumber = $input->param('cardnumber');
45
    $patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
46
}
47
if ($input->param('borrowernumber')) {
48
    $borrowernumber = $input->param('borrowernumber');
49
    $patron = Koha::Patrons->find( $borrowernumber );
50
}
51
52
unless ( $patron ) {
53
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
54
    exit;
55
}
56
57
my $holds;
58
my $old_holds;
59
60
if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){
61
    # use of 'eq' in the above comparison is intentional -- the
62
    # system preference value could be blank
63
    $template->param( is_anonymous => 1 );
64
} else {
65
    $holds = $patron->holds;
66
    $old_holds = $patron->old_holds;
67
68
    while (my $hold = $holds->next) {
69
        push @all_holds, $hold;
70
    }
71
72
    while (my $hold = $old_holds->next) {
73
        push @all_holds, $hold;
74
    }
75
}
76
77
if ( $patron->category->category_type eq 'C') {
78
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
79
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
80
    $template->param( 'catcode' => $patron_categories->next )  if $patron_categories->count == 1;
81
}
82
83
$template->param( adultborrower => 1 ) if ( $patron->category->category_type eq 'A' || $patron->category->category_type eq 'I' );
84
85
$template->param( picture => 1 ) if $patron->image;
86
87
$template->param(%{ $patron->unblessed });
88
89
$template->param(
90
    reserveshistoryview => 1,
91
    borrowernumber      => $borrowernumber,
92
    patron              => $patron,
93
    holds               => \@all_holds,
94
);
95
96
output_html_with_http_headers $input, $cookie, $template->output;

Return to bug 14919