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

(-)a/C4/Circulation.pm (+11 lines)
Lines 1506-1511 sub AddIssue { Link Here
1506
                auto_renew      => $auto_renew ? 1 : 0,
1506
                auto_renew      => $auto_renew ? 1 : 0,
1507
            };
1507
            };
1508
1508
1509
            # Get ID of logged in user.  if called from a batch job,
1510
            # no user session exists and C4::Context->userenv() returns
1511
            # the scalar '0'. Only do this is the syspref says so
1512
            if ( C4::Context->preference('RecordIssuer') ) {
1513
                my $userenv = C4::Context->userenv();
1514
                my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : undef;
1515
                if ($usernumber) {
1516
                    $issue_attributes->{issuer} = $usernumber;
1517
                }
1518
            }
1519
1509
            # In the case that the borrower has an on-site checkout
1520
            # In the case that the borrower has an on-site checkout
1510
            # and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout
1521
            # and SwitchOnSiteCheckouts is enabled this converts it to a regular checkout
1511
            $issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } );
1522
            $issue = Koha::Checkouts->find( { itemnumber => $item_object->itemnumber } );
(-)a/C4/Members.pm (-2 / +4 lines)
Lines 276-291 sub GetAllIssues { Link Here
276
'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
276
'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
277
  FROM issues
277
  FROM issues
278
  LEFT JOIN items on items.itemnumber=issues.itemnumber
278
  LEFT JOIN items on items.itemnumber=issues.itemnumber
279
  LEFT JOIN borrowers on borrowers.borrowernumber=issues.issuer
279
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
280
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
280
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
281
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
281
  WHERE borrowernumber=?
282
  WHERE issues.borrowernumber=?
282
  UNION ALL
283
  UNION ALL
283
  SELECT *, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
284
  SELECT *, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
284
  FROM old_issues
285
  FROM old_issues
285
  LEFT JOIN items on items.itemnumber=old_issues.itemnumber
286
  LEFT JOIN items on items.itemnumber=old_issues.itemnumber
287
  LEFT JOIN borrowers on borrowers.borrowernumber=old_issues.issuer
286
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
288
  LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
287
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
289
  LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
288
  WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL
290
  WHERE old_issues.borrowernumber=? AND old_issues.itemnumber IS NOT NULL
289
  order by ' . $order;
291
  order by ' . $order;
290
    if ($limit) {
292
    if ($limit) {
291
        $query .= " limit $limit";
293
        $query .= " limit $limit";
(-)a/Koha/Checkout.pm (+15 lines)
Lines 106-111 sub patron { Link Here
106
    return Koha::Patron->_new_from_dbic( $patron_rs );
106
    return Koha::Patron->_new_from_dbic( $patron_rs );
107
}
107
}
108
108
109
=head3 issued_by
110
111
my $issued_by = $checkout->issued_by
112
113
Return the patron by whom the checkout was done
114
115
=cut
116
117
sub issued_by {
118
    my ( $self ) = @_;
119
    my $issued_by_rs = $self->_result->issuer;
120
    return Koha::Patron->_new_from_dbic( $issued_by_rs );
121
}
122
109
=head3 to_api_mapping
123
=head3 to_api_mapping
110
124
111
This method returns the mapping for representing a Koha::Checkout object
125
This method returns the mapping for representing a Koha::Checkout object
Lines 117-122 sub to_api_mapping { Link Here
117
    return {
131
    return {
118
        issue_id        => 'checkout_id',
132
        issue_id        => 'checkout_id',
119
        borrowernumber  => 'patron_id',
133
        borrowernumber  => 'patron_id',
134
        issuer          => 'issuer_id',
120
        itemnumber      => 'item_id',
135
        itemnumber      => 'item_id',
121
        date_due        => 'due_date',
136
        date_due        => 'due_date',
122
        branchcode      => 'library_id',
137
        branchcode      => 'library_id',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt (+10 lines)
Lines 37-42 Link Here
37
            [% END %]
37
            [% END %]
38
            <th>Barcode</th>
38
            <th>Barcode</th>
39
            <th>Checked out from</th>
39
            <th>Checked out from</th>
40
            [% IF Koha.Preference('RecordIssuer') %]
41
            <th>Checked out by</th>
42
            [% END %]
40
            <th>Renewed</th>
43
            <th>Renewed</th>
41
            <th class='title-string'>Checkout on</th>
44
            <th class='title-string'>Checkout on</th>
42
            <th class='title-string'>Due date</th>
45
            <th class='title-string'>Due date</th>
Lines 63-68 Link Here
63
                    [% ELSE %]
66
                    [% ELSE %]
64
                        &nbsp;
67
                        &nbsp;
65
                    [% END %]</td>
68
                    [% END %]</td>
69
                [% IF Koha.Preference('RecordIssuer') %]
70
                <td>[% IF checkout.issuer %]
71
                    <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% checkout.issuer | uri %]">
72
                    [% checkout.issued_by.firstname | html %] [% checkout.issued_by.surname | html %]
73
                    </a>
74
                    [% END %]</td>
75
                [% END %]
66
                <td>[% IF checkout.renewals %]
76
                <td>[% IF checkout.renewals %]
67
                        Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates  with_hours => 1 %]</small>
77
                        Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates  with_hours => 1 %]</small>
68
                            [% END %]
78
                            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-1 / +6 lines)
Lines 58-63 Link Here
58
        <th>Number of renewals</th>
58
        <th>Number of renewals</th>
59
        <th class="title-string">Checked out on</th>
59
        <th class="title-string">Checked out on</th>
60
        <th>Checked out from</th>
60
        <th>Checked out from</th>
61
        [% IF Koha.Preference('RecordIssuer') %]
62
        <th>Checked out by</th>
63
        [% END %]
61
        <th class="title-string">Date due</th>
64
        <th class="title-string">Date due</th>
62
        <th class="title-string">Return date</th>
65
        <th class="title-string">Return date</th>
63
        </tr>
66
        </tr>
Lines 94-99 Link Here
94
            <span title="[% issue.issuedate | html %]">[% issue.issuedate |$KohaDates  with_hours => 1 %]</span>
97
            <span title="[% issue.issuedate | html %]">[% issue.issuedate |$KohaDates  with_hours => 1 %]</span>
95
          </td>
98
          </td>
96
          <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
99
          <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
100
          [% IF Koha.Preference('RecordIssuer') %]
101
          <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issue.issuer | uri %]">[% issue.firstname | html %] [% issue.surname | html %]</a></td>
102
          [% END %]
97
          <td>
103
          <td>
98
            [% IF issue.date_due %]
104
            [% IF issue.date_due %]
99
                <span title="[% issue.date_due | html %]">[% issue.date_due |$KohaDates  with_hours => 1 %]</span>
105
                <span title="[% issue.date_due | html %]">[% issue.date_due |$KohaDates  with_hours => 1 %]</span>
100
- 

Return to bug 23916