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

(-)a/C4/Members.pm (-13 / +6 lines)
Lines 1069-1078 C<items> tables of the Koha database. Link Here
1069
sub GetAllIssues {
1069
sub GetAllIssues {
1070
    my ( $borrowernumber, $order, $limit ) = @_;
1070
    my ( $borrowernumber, $order, $limit ) = @_;
1071
1071
1072
    #FIXME: sanity-check order and limit
1072
    my $dbh = C4::Context->dbh;
1073
    my $dbh   = C4::Context->dbh;
1074
    my $query =
1073
    my $query =
1075
  "SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp 
1074
'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
1076
  FROM issues 
1075
  FROM issues 
1077
  LEFT JOIN items on items.itemnumber=issues.itemnumber
1076
  LEFT JOIN items on items.itemnumber=issues.itemnumber
1078
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
1077
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
Lines 1085-1104 sub GetAllIssues { Link Here
1085
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
1084
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
1086
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
1085
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
1087
  WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL
1086
  WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL
1088
  order by $order";
1087
  order by ' . $order;
1089
    if ( $limit != 0 ) {
1088
    if ($limit) {
1090
        $query .= " limit $limit";
1089
        $query .= " limit $limit";
1091
    }
1090
    }
1092
1091
1093
    my $sth = $dbh->prepare($query);
1092
    my $sth = $dbh->prepare($query);
1094
    $sth->execute($borrowernumber, $borrowernumber);
1093
    $sth->execute( $borrowernumber, $borrowernumber );
1095
    my @result;
1094
    return $sth->fetchall_arrayref( {} );
1096
    my $i = 0;
1097
    while ( my $data = $sth->fetchrow_hashref ) {
1098
        push @result, $data;
1099
    }
1100
1101
    return \@result;
1102
}
1095
}
1103
1096
1104
1097
(-)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="toptabs">
32
<div id="opac-user-readingrec" class="toptabs">
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 (-61 / +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-105 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
    my $return_dt = Koha::DateUtils::dt_from_string($issue->{'returndate'}, 'iso');
88
    if ( ( $input->param('op') eq 'export_barcodes' ) and ( $today eq $return_dt->ymd() ) ) {
89
        push( @barcodes, $issue->{'barcode'} );
90
    }
91
}
70
}
92
71
93
if ($input->param('op') eq 'export_barcodes') {
72
#   barcode export
94
    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'};
95
    my $delimiter = "\n";
80
    my $delimiter = "\n";
96
    binmode( STDOUT, ":encoding(UTF-8)");
81
    binmode( STDOUT, ":encoding(UTF-8)" );
97
    print $input->header(
82
    print $input->header(
98
        -type       => 'application/octet-stream',
83
        -type       => 'application/octet-stream',
99
        -charset    => 'utf-8',
84
        -charset    => 'utf-8',
100
        -attachment => "$today-$borrowercardnumber-checkinexport.txt"
85
        -attachment => "$today-$borrowercardnumber-checkinexport.txt"
101
    );
86
    );
102
    my $content = join($delimiter, uniq(@barcodes));
87
    my $content = join $delimiter, uniq(@barcodes);
103
    print $content;
88
    print $content;
104
    exit;
89
    exit;
105
}
90
}
Lines 116-121 if (! $limit){ Link Here
116
	$limit = 'full';
101
	$limit = 'full';
117
}
102
}
118
103
104
119
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
105
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
120
$template->param( picture => 1 ) if $picture;
106
$template->param( picture => 1 ) if $picture;
121
107
Lines 128-163 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
128
}
114
}
129
115
130
$template->param(
116
$template->param(
131
						readingrecordview => 1,
117
    readingrecordview => 1,
132
						biblionumber => $data->{'biblionumber'},
118
    title             => $data->{title},
133
						title => $data->{'title'},
119
    initials          => $data->{initials},
134
						initials => $data->{'initials'},
120
    surname           => $data->{surname},
135
						surname => $data->{'surname'},
121
    othernames        => $data->{othernames},
136
						othernames => $data->{'othernames'},
122
    borrowernumber    => $borrowernumber,
137
						borrowernumber => $borrowernumber,
123
    firstname         => $data->{firstname},
138
						limit => $limit,
124
    cardnumber        => $data->{cardnumber},
139
						firstname => $data->{'firstname'},
125
    categorycode      => $data->{categorycode},
140
						cardnumber => $data->{'cardnumber'},
126
    category_type     => $data->{category_type},
141
					    categorycode => $data->{'categorycode'},
127
    categoryname      => $data->{description},
142
					    category_type => $data->{'category_type'},
128
    address           => $data->{address},
143
					   # category_description => $data->{'description'},
129
    address2          => $data->{address2},
144
					    categoryname	=> $data->{'description'},
130
    city              => $data->{city},
145
					    address => $data->{'address'},
131
    state             => $data->{state},
146
						address2 => $data->{'address2'},
132
    zipcode           => $data->{zipcode},
147
					    city => $data->{'city'},
133
    country           => $data->{country},
148
					    state => $data->{'state'},
134
    phone             => $data->{phone},
149
						zipcode => $data->{'zipcode'},
135
    email             => $data->{email},
150
						country => $data->{'country'},
136
    branchcode        => $data->{branchcode},
151
						phone => $data->{'phone'},
137
    is_child          => ( $data->{category_type} eq 'C' ),
152
						email => $data->{'email'},
138
    branchname        => $branches->{ $data->{branchcode} }->{branchname},
153
			   			branchcode => $data->{'branchcode'},
139
    loop_reading      => $issues,
154
			   			is_child        => ($data->{'category_type'} eq 'C'),
140
    activeBorrowerRelationship =>
155
			   			branchname => GetBranchName($data->{'branchcode'}),
141
      ( C4::Context->preference('borrowerRelationship') ne '' ),
156
						showfulllink => (scalar @loop_reading > 50),					
157
						loop_reading => \@loop_reading,
158
						activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
159
);
142
);
160
output_html_with_http_headers $input, $cookie, $template->output;
143
output_html_with_http_headers $input, $cookie, $template->output;
161
144
162
163
(-)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