Bug 14299: Today's checkouts not always sorting correctly
[koha.git] / circ / transferstoreceive.pl
index ddb7f4a..bd184c9 100755 (executable)
@@ -5,22 +5,22 @@
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use strict;
 use warnings;
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Context;
 use C4::Output;
 use C4::Branch;     # GetBranches
@@ -43,7 +43,7 @@ my $itemnumber = $input->param('itemnumber');
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "circ/transferstoreceive.tmpl",
+        template_name   => "circ/transferstoreceive.tt",
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
@@ -89,14 +89,17 @@ foreach my $br ( keys %$branches ) {
             my $gettitle     = GetBiblioFromItemNumber( $num->{'itemnumber'} );
             my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $gettitle->{'itype'} : $gettitle->{'itemtype'} );
 
-            $getransf{'datetransfer'} = format_date( $num->{'datesent'} );
+            $getransf{'datetransfer'} = $num->{'datesent'};
             $getransf{'itemtype'} = $itemtypeinfo ->{'description'};
-                       foreach (qw(title biblionumber itemnumber barcode homebranch holdingbranch itemcallnumber)) {
+                       foreach (qw(title author biblionumber itemnumber barcode homebranch holdingbranch itemcallnumber)) {
                $getransf{$_} = $gettitle->{$_};
                        }
 
+            my $record = GetMarcBiblio($gettitle->{'biblionumber'});
+            $getransf{'subtitle'} = GetRecordValue('subtitle', $record, GetFrameworkCode($gettitle->{'biblionumber'}));
+
             # we check if we have a reserv for this transfer
-            my @checkreserv = GetReservesFromItemnumber($num->{'itemnumber'} );
+            my @checkreserv = GetReservesFromItemnumber($num->{'itemnumber'});
             if ( $checkreserv[0] ) {
                 my $getborrower = GetMemberDetails( $checkreserv[1] );
                 $getransf{'borrowernum'}       = $getborrower->{'borrowernumber'};
@@ -117,7 +120,6 @@ foreach my $br ( keys %$branches ) {
 $template->param(
     branchesloop => \@branchesloop,
     show_date    => format_date(C4::Dates->today('iso')),
-       'dateformat_' . (C4::Context->preference("dateformat") || '') => 1,
        TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'),
        latetransfers => $latetransfers ? 1 : 0,
 );