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

(-)a/C4/Members.pm (-14 / +7 lines)
Lines 1073-1082 C<items> tables of the Koha database. Link Here
1073
sub GetAllIssues {
1073
sub GetAllIssues {
1074
    my ( $borrowernumber, $order, $limit ) = @_;
1074
    my ( $borrowernumber, $order, $limit ) = @_;
1075
1075
1076
    #FIXME: sanity-check order and limit
1076
    my $dbh = C4::Context->dbh;
1077
    my $dbh   = C4::Context->dbh;
1078
    my $query =
1077
    my $query =
1079
  "SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp 
1078
'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
1080
  FROM issues 
1079
  FROM issues 
1081
  LEFT JOIN items on items.itemnumber=issues.itemnumber
1080
  LEFT JOIN items on items.itemnumber=issues.itemnumber
1082
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
1081
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
Lines 1089-1108 sub GetAllIssues { Link Here
1089
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
1088
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
1090
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
1089
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
1091
  WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL
1090
  WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL
1092
  order by $order";
1091
  order by ' . $dbh->quote($order);
1093
    if ( $limit != 0 ) {
1092
    if ($limit && $limit=~m/(\d+)/) {
1094
        $query .= " limit $limit";
1093
        $query .= " limit $1";
1095
    }
1094
    }
1096
1095
1097
    my $sth = $dbh->prepare($query);
1096
    my $sth = $dbh->prepare($query);
1098
    $sth->execute($borrowernumber, $borrowernumber);
1097
    $sth->execute( $borrowernumber, $borrowernumber );
1099
    my @result;
1098
    return $sth->fetchall_arrayref( {} );
1100
    my $i = 0;
1101
    while ( my $data = $sth->fetchrow_hashref ) {
1102
        push @result, $data;
1103
    }
1104
1105
    return \@result;
1106
}
1099
}
1107
1100
1108
1101
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-14 / +23 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
3
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 26-32 Link Here
26
	<div class="yui-b">
27
	<div class="yui-b">
27
[% INCLUDE 'circ-toolbar.inc' %]
28
[% INCLUDE 'circ-toolbar.inc' %]
28
<h1>Circulation history</h1>
29
<h1>Circulation history</h1>
29
[% IF ( loop_reading ) %]
30
[% IF loop_reading %]
30
<form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
31
<form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
31
32
32
33
Lines 43-71 Link Here
43
    <th>Date due</th>
44
    <th>Date due</th>
44
    <th>Return date</th>
45
    <th>Return date</th>
45
</thead>
46
</thead>
46
[% FOREACH loop_readin IN loop_reading %]
47
[% FOREACH issue IN loop_reading %]
47
    [% IF ( loop_readin.returndate ) %]<tr>[% ELSE %]<tr class="onissue">[% END %]
48
    [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
48
        <td>
49
        <td>
49
            [% loop_readin.issuestimestamp %]
50
            [% issue.issuestimestamp | $KohaDates %]
50
        </td>
51
        </td>
51
        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_readin.biblionumber %]">[% loop_readin.title |html %]</a></td>
52
        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% issue.biblionumber %]">[% issue.title |html %]</a></td>
52
53
53
        <td>[% loop_readin.author %]</td>
54
        <td>[% issue.author %]</td>
54
55
55
        <td>[% loop_readin.classification %]</td>
56
        <td>
57
            [% IF issue.classification %]
58
                [% issue.classification %]
59
            [% ELSE %]
60
                [% issue.itemcallnumber %]
61
            [% END %]
62
       </td>
56
63
57
        <td>[% loop_readin.barcode %]</td>
64
        <td>[% issue.barcode %]</td>
58
65
59
            <td>
66
            <td>
60
        [% loop_readin.renewals %]</td>
67
        [% issue.renewals %]</td>
61
            <td>
68
            <td>
62
        [% loop_readin.issuedate %]</td>
69
        [% issue.issuedate | $KohaDates %]</td>
63
            <td>
70
            <td>
64
        [% loop_readin.issuingbranch %]</td>
71
        [% issue.issuingbranch %]</td>
65
			<td>[% IF ( loop_readin.date_due ) %][% loop_readin.date_due %][% ELSE %]&nbsp;[% END %]</td>
72
                  <td>[% IF issue.date_due %]
73
                    [% issue.date_due | $KohaDates %]
74
                [% ELSE %]&nbsp;[% END %]</td>
66
            <td>
75
            <td>
67
        [% IF ( loop_readin.returndate ) %]
76
        [% IF  issue.returndate %]
68
            [% loop_readin.returndate %]
77
            [% issue.returndate | $KohaDates %]
69
        [% ELSE %]
78
        [% ELSE %]
70
            Checked Out
79
            Checked Out
71
        [% END %]
80
        [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt (-17 / +54 lines)
Lines 26-32 $(document).ready(function(){ Link Here
26
<!--CONTENT-->
26
<!--CONTENT-->
27
<h3><a href="/cgi-bin/koha/opac-user.pl">[% firstname %] [% surname %]'s account</a> <img src="[% themelang %]../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Checkout history</h3>
27
<h3><a href="/cgi-bin/koha/opac-user.pl">[% firstname %] [% surname %]'s account</a> <img src="[% themelang %]../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Checkout history</h3>
28
28
29
[% UNLESS ( count ) %]
29
[% IF READING_RECORD.size() == 0 %]
30
You have never borrowed anything from this library.
30
You have never borrowed anything from this library.
31
[% ELSE %]
31
[% ELSE %]
32
<div id="opac-user-readingrec" class="statictabs">
32
<div id="opac-user-readingrec" class="statictabs">
Lines 61-90 You have never borrowed anything from this library. Link Here
61
<th>Date</th>
61
<th>Date</th>
62
</tr>
62
</tr>
63
63
64
[% FOREACH READING_RECOR IN READING_RECORD %]
64
[% FOREACH issue IN READING_RECORD %]
65
65
66
[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
66
[% IF  loop.even  %]<tr class="highlight">[% ELSE %]<tr>[% END %]
67
<td>
67
<td>
68
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="http://www.amazon.com/gp/reader/[% READING_RECOR.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% READING_RECOR.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
68
[% IF  OPACAmazonEnabled %]
69
    [% IF  OPACAmazonCoverImages %]
70
        [% IF  issue.normalized_isbn %]
71
            <a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% issue.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>
72
        [% ELSE %]
73
             <span class="no-image">No cover image available</span>
74
        [% END %]
75
    [% END %]
76
[% END %]
69
77
70
    [% IF ( GoogleJackets ) %][% IF ( READING_RECOR.normalized_isbn ) %]<div style="block" title="[% READING_RECOR.biblionumber |url %]" class="[% READING_RECOR.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
78
[% IF GoogleJackets %]
79
    [% IF  issue.normalized_isbn %]
80
        <div style="block" title="[% issue.biblionumber |url %]" class="[% issue.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
81
    [% ELSE %]
82
       <span class="no-image">No cover image available</span>
83
    [% END %]
84
[% END %]
71
85
72
    [% IF ( BakerTaylorEnabled ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% READING_RECOR.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% READING_RECOR.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
86
[% IF BakerTaylorEnabled %]
87
    [% IF issue.normalized_isbn %]
88
      <a href="https://[% BakerTaylorBookstoreURL |html %][% issue.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% issue.normalized_isbn %]" /></a>
89
    [% ELSE %]
90
       <span class="no-image">No cover image available</span>
91
    [% END %]
92
[% END %]
73
93
74
	[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
94
[% IF SyndeticsEnabled %]
75
	<img src="https://secure.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% READING_RECOR.normalized_upc %]&amp;oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" />
95
    [% IF SyndeticsCoverImages %]
76
	[% ELSE %]
96
        [% IF  using_https  %]
77
	<img src="http://www.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% READING_RECOR.normalized_upc %]&amp;oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %]
97
<img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% issue.normalized_upc %]&amp;oclc=[% issue.normalized_oclc %]" alt="" class="thumbnail" />
98
       [% ELSE %]
99
<img src="http://www.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% issue.normalized_upc %]&amp;oclc=[% issue.normalized_oclc %]" alt="" class="thumbnail" />
100
       [% END %]
101
    [% END %]
102
[% END %]
78
</td>
103
</td>
79
<td>[% IF ( READING_RECOR.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% ELSE %]
104
<td>
80
[% IF ( READING_RECOR.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% ELSE %]
105
[% IF  issue.BiblioDefaultViewmarc %]
81
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% END %][% END %]
106
     <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF  issue.subtitle  %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
107
[% ELSIF issue.BiblioDefaultViewisbd %]
108
     <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
109
[% ELSE %]
110
     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
111
[% END %]
82
                    <span class="item-details">
112
                    <span class="item-details">
83
                        [% READING_RECOR.author %]
113
                        [% issue.author %]
84
                    </span></td>
114
                    </span></td>
85
<td>[% UNLESS ( noItemTypeImages ) %][% IF ( READING_RECOR.imageurl ) %]<img src="[% READING_RECOR.imageurl %]" alt="" />[% END %][% END %] [% READING_RECOR.description %]</td>
115
<td>
86
<td>[% READING_RECOR.itemcallnumber %]</td>
116
[% UNLESS ( noItemTypeImages ) %][% IF ( issue.imageurl ) %]<img src="[% issue.imageurl %]" alt="" />[% END %][% END %] [% issue.description %]</td>
87
<td>[% IF ( READING_RECOR.returndate ) %][% READING_RECOR.returndate | $KohaDates %][% ELSE %]<em>(Checked out)</em>[% END %]</td>
117
<td>[% issue.itemcallnumber %]</td>
118
<td>
119
[% IF issue.returndate %]
120
    [% issue.returndate | $KohaDates %]
121
[% ELSE %]
122
    <em>(Checked out)</em>
123
[% END %]
124
</td>
88
</tr>
125
</tr>
89
126
90
[% END %]
127
[% END %]
(-)a/members/readingrec.pl (-60 / +42 lines)
Lines 28-34 use CGI; Link Here
28
use C4::Auth;
28
use C4::Auth;
29
use C4::Output;
29
use C4::Output;
30
use C4::Members;
30
use C4::Members;
31
use C4::Branch;
31
use C4::Branch qw(GetBranches);
32
use List::MoreUtils qw/any uniq/;
32
use List::MoreUtils qw/any uniq/;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
34
Lines 62-104 if ($input->param('borrowernumber')) { Link Here
62
62
63
my $order = 'date_due desc';
63
my $order = 'date_due desc';
64
my $limit = 0;
64
my $limit = 0;
65
my ( $issues ) = GetAllIssues($borrowernumber,$order,$limit);
65
my $issues = GetAllIssues($borrowernumber,$order,$limit);
66
66
67
my @loop_reading;
67
my $branches = GetBranches();
68
my @barcodes;
68
foreach my $issue ( @{$issues} ) {
69
my $today = C4::Dates->new();
69
    $issue->{issuingbranch} = $branches->{ $issue->{branchcode} }->{branchname};
70
$today = $today->output("iso");
71
72
foreach my $issue (@{$issues}){
73
 	my %line;
74
 	$line{issuestimestamp} = format_date($issue->{'issuestimestamp'});
75
	$line{biblionumber}    = $issue->{'biblionumber'};
76
	$line{title}           = $issue->{'title'};
77
	$line{author}          = $issue->{'author'};
78
	$line{classification}  = $issue->{'classification'} || $issue->{'itemcallnumber'};
79
	$line{date_due}        = format_sqldatetime($issue->{date_due});
80
	$line{returndate}      = format_sqldatetime($issue->{returndate});
81
	$line{issuedate}       = format_sqldatetime($issue->{issuedate});
82
	$line{issuingbranch}   = GetBranchName($issue->{'branchcode'});
83
	$line{renewals}        = $issue->{'renewals'};
84
	$line{barcode}         = $issue->{'barcode'};
85
	$line{volumeddesc}     = $issue->{'volumeddesc'};
86
	push(@loop_reading,\%line);
87
    if (($input->param('op') eq 'export_barcodes') and ($today eq $issue->{'returndate'})) {
88
        push( @barcodes, $issue->{'barcode'} );
89
    }
90
}
70
}
91
71
92
if ($input->param('op') eq 'export_barcodes') {
72
#   barcode export
93
    my $borrowercardnumber = GetMember( borrowernumber => $borrowernumber )->{'cardnumber'} ;
73
if ( $input->param('op') eq 'export_barcodes' ) {
74
    my $today = C4::Dates->new();
75
    $today = $today->output('iso');
76
    my @barcodes =
77
      map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues};
78
    my $borrowercardnumber =
79
      GetMember( borrowernumber => $borrowernumber )->{'cardnumber'};
94
    my $delimiter = "\n";
80
    my $delimiter = "\n";
95
    binmode( STDOUT, ":encoding(UTF-8)");
81
    binmode( STDOUT, ":encoding(UTF-8)" );
96
    print $input->header(
82
    print $input->header(
97
        -type       => 'application/octet-stream',
83
        -type       => 'application/octet-stream',
98
        -charset    => 'utf-8',
84
        -charset    => 'utf-8',
99
        -attachment => "$today-$borrowercardnumber-checkinexport.txt"
85
        -attachment => "$today-$borrowercardnumber-checkinexport.txt"
100
    );
86
    );
101
    my $content = join($delimiter, uniq(@barcodes));
87
    my $content = join $delimiter, uniq(@barcodes);
102
    print $content;
88
    print $content;
103
    exit;
89
    exit;
104
}
90
}
Lines 115-120 if (! $limit){ Link Here
115
	$limit = 'full';
101
	$limit = 'full';
116
}
102
}
117
103
104
118
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
105
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
119
$template->param( picture => 1 ) if $picture;
106
$template->param( picture => 1 ) if $picture;
120
107
Lines 127-162 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
127
}
114
}
128
115
129
$template->param(
116
$template->param(
130
						readingrecordview => 1,
117
    readingrecordview => 1,
131
						biblionumber => $data->{'biblionumber'},
118
    title             => $data->{title},
132
						title => $data->{'title'},
119
    initials          => $data->{initials},
133
						initials => $data->{'initials'},
120
    surname           => $data->{surname},
134
						surname => $data->{'surname'},
121
    othernames        => $data->{othernames},
135
						othernames => $data->{'othernames'},
122
    borrowernumber    => $borrowernumber,
136
						borrowernumber => $borrowernumber,
123
    firstname         => $data->{firstname},
137
						limit => $limit,
124
    cardnumber        => $data->{cardnumber},
138
						firstname => $data->{'firstname'},
125
    categorycode      => $data->{categorycode},
139
						cardnumber => $data->{'cardnumber'},
126
    category_type     => $data->{category_type},
140
					    categorycode => $data->{'categorycode'},
127
    categoryname      => $data->{description},
141
					    category_type => $data->{'category_type'},
128
    address           => $data->{address},
142
					   # category_description => $data->{'description'},
129
    address2          => $data->{address2},
143
					    categoryname	=> $data->{'description'},
130
    city              => $data->{city},
144
					    address => $data->{'address'},
131
    state             => $data->{state},
145
						address2 => $data->{'address2'},
132
    zipcode           => $data->{zipcode},
146
					    city => $data->{'city'},
133
    country           => $data->{country},
147
					    state => $data->{'state'},
134
    phone             => $data->{phone},
148
						zipcode => $data->{'zipcode'},
135
    email             => $data->{email},
149
						country => $data->{'country'},
136
    branchcode        => $data->{branchcode},
150
						phone => $data->{'phone'},
137
    is_child          => ( $data->{category_type} eq 'C' ),
151
						email => $data->{'email'},
138
    branchname        => $branches->{ $data->{branchcode} }->{branchname},
152
			   			branchcode => $data->{'branchcode'},
139
    loop_reading      => $issues,
153
			   			is_child        => ($data->{'category_type'} eq 'C'),
140
    activeBorrowerRelationship =>
154
			   			branchname => GetBranchName($data->{'branchcode'}),
141
      ( C4::Context->preference('borrowerRelationship') ne '' ),
155
						showfulllink => (scalar @loop_reading > 50),					
156
						loop_reading => \@loop_reading,
157
						activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
158
);
142
);
159
output_html_with_http_headers $input, $cookie, $template->output;
143
output_html_with_http_headers $input, $cookie, $template->output;
160
144
161
162
(-)a/opac/opac-readingrecord.pl (-44 / +33 lines)
Lines 27-34 use C4::Biblio; Link Here
27
use C4::Circulation;
27
use C4::Circulation;
28
use C4::Members;
28
use C4::Members;
29
use Koha::DateUtils;
29
use Koha::DateUtils;
30
use MARC::Record;
30
31
31
use C4::Output;
32
use C4::Output;
33
use C4::Charset qw(StripNonXmlChars);
32
34
33
my $query = new CGI;
35
my $query = new CGI;
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Lines 50-104 $template->param(%{$borr}); Link Here
50
my $itemtypes = GetItemTypes();
52
my $itemtypes = GetItemTypes();
51
53
52
# get the record
54
# get the record
53
my $order  = $query->param('order') || '';
55
my $order = $query->param('order') || '';
54
if ( $order eq '' ) {
55
    $order = "date_due desc";
56
    $template->param( orderbydate => 1 );
57
}
58
59
if ( $order eq 'title' ) {
56
if ( $order eq 'title' ) {
60
    $template->param( orderbytitle => 1 );
57
    $template->param( orderbytitle => 1 );
61
}
58
}
62
59
elsif ( $order eq 'author' ) {
63
if ( $order eq 'author' ) {
64
    $template->param( orderbyauthor => 1 );
60
    $template->param( orderbyauthor => 1 );
65
}
61
}
66
67
my $limit = $query->param('limit') || 50;
68
if ( $limit eq 'full' ) {
69
    $limit = 0;
70
}
71
else {
62
else {
72
    $limit = 50;
63
    $order = "date_due desc";
64
    $template->param( orderbydate => 1 );
73
}
65
}
74
66
75
my ( $issues ) = GetAllIssues( $borrowernumber, $order, $limit );
67
76
68
my $limit = $query->param('limit');
77
69
$limit = ( $limit eq 'full' ) ? 0 : 50;
78
my @loop_reading;
70
79
71
my $issues = GetAllIssues( $borrowernumber, $order, $limit );
80
foreach my $issue (@{$issues} ) {
72
81
    my %line;
73
my $itype_attribute =
82
	
74
  ( C4::Context->preference('item-level_itypes') ) ? 'itype' : 'itemtype';
83
    my $record = GetMarcBiblio($issue->{'biblionumber'});
75
84
76
foreach my $issue ( @{$issues} ) {
85
	# XISBN Stuff
77
    $issue->{normalized_isbn} = GetNormalizedISBN( $issue->{isbn} );
86
	my $isbn               = GetNormalizedISBN($issue->{'isbn'});
78
    if ( $issue->{$itype_attribute} ) {
87
	$line{normalized_isbn} = $isbn;
79
        $issue->{description} =
88
    $line{biblionumber}    = $issue->{'biblionumber'};
80
          $itemtypes->{ $issue->{$itype_attribute} }->{description};
89
    $line{title}           = $issue->{'title'};
81
        $issue->{imageurl} =
90
    $line{author}          = $issue->{'author'};
82
          getitemtypeimagelocation( 'opac',
91
    $line{itemcallnumber}  = $issue->{'itemcallnumber'};
83
            $itemtypes->{ $issue->{$itype_attribute} }->{imageurl} );
92
    $line{date_due}        = $issue->{'date_due'};
84
    }
93
    $line{returndate}      = $issue->{'returndate'};
85
    if ( $issue->{marcxml} ) {
94
    $line{volumeddesc}     = $issue->{'volumeddesc'};
86
        my $marcxml = StripNonXmlChars( $issue->{marcxml} );
95
    $issue->{'itemtype'}   = C4::Context->preference('item-level_itypes') ? $issue->{'itype'} : $issue->{'itemtype'};
87
        my $marc_rec =
96
    if($issue->{'itemtype'}) {
88
          MARC::Record::new_from_xml( $marcxml, 'utf8',
97
        $line{'description'}   = $itemtypes->{ $issue->{'itemtype'} }->{'description'};
89
            C4::Context->preference('marcflavour') );
98
        $line{imageurl}        = getitemtypeimagelocation( 'opac', $itemtypes->{ $issue->{'itemtype'}  }->{'imageurl'} );
90
        $issue->{subtitle} =
91
          GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} );
99
    }
92
    }
100
    push( @loop_reading, \%line );
101
    $line{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($issue->{'biblionumber'}));
102
}
93
}
103
94
104
if (C4::Context->preference('BakerTaylorEnabled')) {
95
if (C4::Context->preference('BakerTaylorEnabled')) {
Lines 125-135 for(qw(AmazonCoverImages GoogleJackets)) { # BakerTaylorEnabled handled above Link Here
125
}
116
}
126
117
127
$template->param(
118
$template->param(
128
    READING_RECORD => \@loop_reading,
119
    READING_RECORD => $issues,
129
    limit          => $limit,
120
    limit          => $limit,
130
    showfulllink   => 1,
121
    showfulllink   => 1,
131
	readingrecview => 1,
122
    readingrecview => 1,
132
	count          => scalar @loop_reading,
133
);
123
);
134
124
135
output_html_with_http_headers $query, $cookie, $template->output;
125
output_html_with_http_headers $query, $cookie, $template->output;
136
- 

Return to bug 8017