@@ -, +, @@ --- circ/returns.pl | 50 ++------------- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 72 +++++++++++----------- 2 files changed, 40 insertions(+), 82 deletions(-) --- a/circ/returns.pl +++ a/circ/returns.pl @@ -177,11 +177,7 @@ if ( $query->param('reserve_id') ) { itembiblionumber => $iteminfo->{'biblionumber'}, iteminfo => $iteminfo->{'author'}, name => $name, - borrowernumber => $borrowernumber, - borcnum => $patron->cardnumber, - borfirstname => $patron->firstname, - borsurname => $patron->surname, - borcategory => $patron->category->description, + patron => $patron, diffbranch => 1, ); } @@ -300,7 +296,6 @@ if ($barcode) { ccode => $biblio->{'ccode'}, itembiblionumber => $biblio->{'biblionumber'}, biblionumber => $biblio->{'biblionumber'}, - borrower => $borrower, additional_materials => $materials, issue => $issue, ); @@ -409,23 +404,8 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { my $patron = Koha::Patrons->find( $reserve->{'borrowernumber'} ); my $name = $patron->surname . ", " . $patron->title . " " . $patron->firstname; $template->param( - # FIXME The full patron object should be passed to the template - wname => $name, - wborfirstname => $patron->firstname, - wborsurname => $patron->surname, - wborcategory => $patron->category->description, - wbortitle => $patron->title, - wborphone => $patron->phone, - wboremail => $patron->email, - streetnumber => $patron->streetnumber, - address => $patron->address, - address2 => $patron->address2, - city => $patron->city, - zipcode => $patron->zipcode, - state => $patron->state, - country => $patron->country, - wborrowernumber => $reserve->{'borrowernumber'}, - wborcnum => $patron->cardnumber, + wname => $name, + patron => $patron, ); } $template->param( @@ -459,22 +439,6 @@ if ( $messages->{'ResFound'}) { # FIXME The full patron object should be passed to the template found => 1, name => $patron->surname . ", " . $patron->title . " " . $patron->firstname, - borfirstname => $patron->firstname, - borsurname => $patron->surname, - borcategory => $patron->category->description, - bortitle => $patron->title, - borphone => $patron->phone, - boremail => $patron->email, - boraddress => $patron->address, - boraddress2 => $patron->address2, - streetnumber => $patron->streetnumber, - city => $patron->city, - zipcode => $patron->zipcode, - state => $patron->state, - country => $patron->country, - borcnum => $patron->cardnumber, - debarred => $patron->debarred, - gonenoaddress => $patron->gonenoaddress, barcode => $barcode, destbranch => $reserve->{'branchcode'}, borrowernumber => $reserve->{'borrowernumber'}, @@ -581,13 +545,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { } else { $ri{return_overdue} = 1 if (DateTime->compare($duedate, $dropboxdate) == -1); } - $ri{borrowernumber} = $patron->borrowernumber; - $ri{borcnum} = $patron->cardnumber; - $ri{borfirstname} = $patron->firstname; - $ri{borsurname} = $patron->surname; - $ri{bortitle} = $patron->title; - $ri{bornote} = $patron->borrowernotes; - $ri{borcategorycode}= $patron->categorycode; + $ri{patron} = $patron, $ri{borissuescount} = Koha::Checkouts->count( { borrowernumber => $b->{'borrowernumber'} } ); } else { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -55,7 +55,7 @@ $(document).ready(function () { $(".modal").on('hidden.bs.modal', function (e) { $("#barcode").focus(); }); [% IF print_slip %] - Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&biblionumber=[% biblionumber %]'); + Dopop('hold-transfer-slip.pl?borrowernumber=[% patron.borrowernumber %]&biblionumber=[% biblionumber %]'); [% END %] var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %] @@ -222,8 +222,8 @@ $(document).ready(function () { [% IF return_date_was_overriden && Borrowers.IsDebarred( borrower ) %]

- - [% borrower.firstname %] [% borrower.surname %] + + [% patron.firstname %] [% patron.surname %] is restricted. Please verify this patron should still be restricted.

@@ -245,13 +245,13 @@ $(document).ready(function () {

[% itembarcode |html %]: [% title |html %]

-[% IF ( wborcnum ) %]
Hold for:
+[% IF ( patron.cardnumber ) %]
Hold for:
@@ -260,7 +260,7 @@ $(document).ready(function () { - + @@ -293,23 +293,23 @@ $(document).ready(function () {

Hold for:

@@ -327,7 +327,7 @@ $(document).ready(function () { [% END %] - + @@ -368,12 +368,12 @@ $(document).ready(function () {

[% itembarcode |html %]: [% title |html %]

Hold for:

[% IF ( transfertodo ) %]

Transfer to: [% Branches.GetName( destbranch ) %]

@@ -384,7 +384,7 @@ $(document).ready(function () { - + [% FOREACH inputloo IN inputloop %] @@ -488,25 +488,25 @@ $(document).ready(function () { [% END %]
Hold for:
  • - - [% borsurname %], [% borfirstname %] + + [% patron.surname %], [% patron.firstname %] - ([% borcnum %]) - - [% borcategory %] + ([% patron.cardnumber %]) + - [% patron.category.description %]
  • [% INCLUDE display_holdpatron_address %] - [% IF ( borphone ) %] -
  • [% borphone %]
  • + [% IF ( patron.phone ) %] +
  • [% patron.phone %]
  • [% END %] - [% IF ( boremail ) %] + [% IF ( patron.email ) %]
  • [% IF ( transfertodo ) %] - [% boremail %] + [% patron.email %] [% ELSE %] - [% boremail %] + [% patron.email %] [% END %]
  • [% END %] @@ -515,11 +515,11 @@ $(document).ready(function () { [% INCLUDE display_bormessagepref %] [% END %] - [% IF ( debarred ) %] + [% IF ( patron.debarred ) %]
  • Patron is RESTRICTED
  • [% END %] - [% IF ( gonenoaddress ) %] + [% IF ( patron.gonenoaddress ) %]
  • Patron's address is in doubt
  • [% END %] @@ -539,7 +539,7 @@ $(document).ready(function () { [% END %] - + --