circulation cleaning continued: bufixing
authortipaul <tipaul>
Tue, 17 Apr 2007 08:44:49 +0000 (08:44 +0000)
committertipaul <tipaul>
Tue, 17 Apr 2007 08:44:49 +0000 (08:44 +0000)
17 files changed:
C4/Biblio.pm
C4/Circulation.pm
C4/Context.pm
C4/Reserves2.pm
circ/branchreserves.pl
circ/circulation.pl
circ/currenttransfers.pl
circ/returns.pl
circ/waitingreservestransfers.pl
koha-tmpl/intranet-tmpl/prog/en/circ/branchreserves.tmpl
koha-tmpl/intranet-tmpl/prog/en/circ/currenttransfers.tmpl
koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl
koha-tmpl/intranet-tmpl/prog/en/circ/waitingreservestransfers.tmpl
members/member-flags.pl
members/member-password.pl
opac/opac-shelves.pl
serials/serials-edit.pl

index 758abdf..0434053 100644 (file)
@@ -66,7 +66,7 @@ push @EXPORT, qw(
   &GetMarcSeries
 
   &GetItemsInfo
-  &GetItemFromBarcode
+  &GetItemnumberFromBarcode
   &get_itemnumbers_of
   &GetXmlBiblio
 
@@ -1133,17 +1133,17 @@ sub GetBiblioItemData {
     return ($data);
 }    # sub &GetBiblioItemData
 
-=head2 GetItemFromBarcode
+=head2 GetItemnumberFromBarcode
 
 =over 4
 
-$result = GetItemFromBarcode($barcode);
+$result = GetItemnumberFromBarcode($barcode);
 
 =back
 
 =cut
 
-sub GetItemFromBarcode {
+sub GetItemnumberFromBarcode {
     my ($barcode) = @_;
     my $dbh = C4::Context->dbh;
 
@@ -1497,13 +1497,12 @@ sub GetMarcBiblio {
       $dbh->prepare("select marcxml from biblioitems where biblionumber=? ");
     $sth->execute($biblionumber);
     my ($marcxml) = $sth->fetchrow;
-#     warn "marcxml : $marcxml";
     MARC::File::XML->default_record_format(C4::Context->preference('marcflavour'));
-    $marcxml =~ s/\x1e//g;
-    $marcxml =~ s/\x1f//g;
-    $marcxml =~ s/\x1d//g;
-    $marcxml =~ s/\x0f//g;
-    $marcxml =~ s/\x0c//g;
+    $marcxml =~ s/\x1e//g;
+    $marcxml =~ s/\x1f//g;
+    $marcxml =~ s/\x1d//g;
+    $marcxml =~ s/\x0f//g;
+    $marcxml =~ s/\x0c//g;
     my $record = MARC::Record->new();
     $record = MARC::Record::new_from_xml( $marcxml, "utf8",C4::Context->preference('marcflavour')) if $marcxml;
     return $record;
@@ -1593,9 +1592,7 @@ sub GetMarcItem {
     
     my $marcxml = GetXmlBiblio($biblionumber);
     my $record = MARC::Record->new();
-#     warn "marcxml :$marcxml";
     $record = MARC::Record::new_from_xml( $marcxml, "utf8", $marcflavour );
-#     warn "record :".$record->as_formatted;
     # now, find where the itemnumber is stored & extract only the item
     my ( $itemnumberfield, $itemnumbersubfield ) =
       GetMarcFromKohaField( $dbh, 'items.itemnumber', '' );
@@ -2101,7 +2098,6 @@ sub TransformHtmlToMarc {
     # the last has not been included inside the loop... do it now !
     $record->insert_fields_ordered($field) if $field;
 
-    #     warn "HTML2MARC=".$record->as_formatted;
     $record->encoding('UTF-8');
 
     #    $record->MARC::File::USMARC::update_leader();
@@ -3654,6 +3650,9 @@ Joshua Ferraro jmf@liblime.com
 
 # $Id$
 # $Log$
+# Revision 1.196  2007/04/17 08:48:00  tipaul
+# circulation cleaning continued: bufixing
+#
 # Revision 1.195  2007/04/04 16:46:22  tipaul
 # HUGE COMMIT : code cleaning circulation.
 #
index 56fb3ce..66c98fc 100755 (executable)
@@ -221,7 +221,7 @@ sub transferbook {
     my %env;
     my $dotransfer      = 1;
     my $branches        = GetBranches();
-    my $item = GetItemFromBarcode( $barcode );
+    my $item = GetItemnumberFromBarcode( $barcode );
     my $issue      = GetItemIssues($item->{itemnumber});
 
     # bad barcode..
@@ -697,7 +697,7 @@ sub CanBookBeIssued {
     my ( $env, $borrower, $barcode, $year, $month, $day, $inprocess ) = @_;
     my %needsconfirmation;    # filled with problems that needs confirmations
     my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
-    my $item = GetItem(GetItemFromBarcode( $barcode ));
+    my $item = GetItem(GetItemnumberFromBarcode( $barcode ));
     my $issue = GetItemIssue($item->{itemnumber});
     my $dbh             = C4::Context->dbh;
 
@@ -877,7 +877,7 @@ Issue a book. Does no check, they are done in CanBookBeIssued. If we reach this
 =item C<$date> contains the max date of return. calculated if empty.
 
 AddIssue does the following things :
-- step 0°: check that there is a borrowernumber & a barcode provided
+- step 0: check that there is a borrowernumber & a barcode provided
 - check for RENEWAL (book issued & being issued to the same patron)
     - renewal YES = Calculate Charge & renew
     - renewal NO  = 
@@ -1219,7 +1219,7 @@ sub AddReturn {
     
     die '$branch not defined' unless defined $branch;  # just in case (bug 170)
     # get information on item
-    my $iteminformation = GetItemIssue( GetItemFromBarcode($barcode));
+    my $iteminformation = GetItemIssue( GetItemnumberFromBarcode($barcode));
     if ( not $iteminformation ) {
         $messages->{'BadBarcode'} = $barcode;
         $doreturn = 0;
@@ -1240,7 +1240,7 @@ sub AddReturn {
 
     # check that the book has been cancelled
     if ( $iteminformation->{'wthdrawn'} ) {
-        $messages->{'wthdrawn'} = 1;itemnumber
+        $messages->{'wthdrawn'} = 1;
         $doreturn = 0;
     }
 
@@ -1311,8 +1311,6 @@ if ( $iteminformation->{'holdingbranch'} ne C4::Context->userenv->{'branch'} )
     my ( $resfound, $resrec ) =
       CheckReserves( $iteminformation->{'itemnumber'} );
     if ($resfound) {
-
-#    my $tobrcd = ReserveWaiting($resrec->{'itemnumber'}, $resrec->{'borrowernumber'});
         $resrec->{'ResFound'}   = $resfound;
         $messages->{'ResFound'} = $resrec;
         $reserveDone = 1;
@@ -1409,7 +1407,7 @@ sub GetItemIssue {
     if ( $datedue < $today ) {
         $data->{'overdue'} = 1;
     }
-    my $itemnumber = $data->{'itemnumber'};
+    $data->{'itemnumber'} = $itemnumber; # fill itemnumber, in case item is not on issue
     $sth->finish;
     return ($data);
 }
index aac3206..6a25a4a 100644 (file)
@@ -544,7 +544,8 @@ sub _new_dbh
                 $db_user, $db_passwd);
     # Koha 3.0 is utf-8, so force utf8 communication between mySQL and koha, whatever the mysql default config.
     # this is better than modifying my.cnf (and forcing all communications to be in utf8)
-     $dbh->do("set NAMES 'utf8'") if ($dbh);
+    $dbh->do("set NAMES 'utf8'") if ($dbh);
+    $dbh->{'mysql_enable_utf8'}=1; #enable
     return $dbh;
 }
 
@@ -874,6 +875,9 @@ Joshua Ferraro <jmf at liblime dot com>
 =cut
 
 # $Log$
+# Revision 1.55  2007/04/17 08:48:00  tipaul
+# circulation cleaning continued: bufixing
+#
 # Revision 1.54  2007/03/29 16:45:53  tipaul
 # Code cleaning of Biblio.pm (continued)
 #
index eb3bca6..8d04d11 100755 (executable)
@@ -129,7 +129,7 @@ sub OtherReserves {
             );
 
             #launch the subroutine dotransfer
-            C4::Circulation::Circ2::dotransfer(
+            C4::Circulation::dotransfer(
                 $itemnumber,
                 $iteminfo->{'holdingbranch'},
                 $checkreserves->{'branchcode'}
@@ -1387,22 +1387,23 @@ sub FindReservesInQueue {
 
 =head2 GetReservesToBranch
 
-@transreserv = GetReservesToBranch( $frombranch, $excludingbranch );
+@transreserv = GetReservesToBranch( $frombranch );
+
+Get reserve list for a given branch
 
 =cut
 
 sub GetReservesToBranch {
-    my ( $frombranch, $excludingbranch ) = @_;
+    my ( $frombranch ) = @_;
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare(
         "SELECT borrowernumber,reservedate,itemnumber,timestamp
          FROM reserves 
          WHERE priority='0' AND cancellationdate is null  
            AND branchcode=?
-           AND branchcode!=?
            AND found IS NULL "
     );
-    $sth->execute( $frombranch, $excludingbranch );
+    $sth->execute( $frombranch );
     my @transreserv;
     my $i = 0;
     while ( my $data = $sth->fetchrow_hashref ) {
index 42a502a..8dea604 100755 (executable)
@@ -27,6 +27,8 @@ use C4::Branch; # GetBranchName
 use C4::Auth;
 use C4::Date;
 use C4::Circulation;
+use C4::Members;
+use C4::Biblio;
 
 use Date::Calc qw(
   Today
@@ -103,7 +105,7 @@ if ($item) {
 
 #              if the document is not in his homebranch location and there is not reservation after, we transfer it
     if ( ( $fbr ne $tbr ) and ( not $nextreservinfo ) ) {
-        C4::Circulation::Circ2::dotransfer( $item, $fbr, $tbr );
+        dotransfer( $item, $fbr, $tbr );
     }
 }
 
index 04bc673..6c90171 100755 (executable)
@@ -413,7 +413,7 @@ if ($borrower) {
             if ($restype) {
                 $it->{'can_renew'} = 0;
             }
-            push @todaysissues, $issueslist->{$it};
+            push @todaysissues, $it;
         }
         else {
             (
index 9d0bc1a..2c4c4a6 100755 (executable)
@@ -26,7 +26,9 @@ use C4::Output;
 use C4::Branch;
 use C4::Auth;
 use C4::Date;
+use C4::Biblio;
 use C4::Circulation;
+use C4::Members;
 use C4::Interface::CGI::Output;
 use Date::Calc qw(
   Today
index ce4781e..3b08ca5 100755 (executable)
@@ -33,6 +33,8 @@ use C4::Output;
 use C4::Print;
 use C4::Reserves2;
 use C4::Auth;
+use C4::Biblio;
+use C4::Members;
 use C4::Interface::CGI::Output;
 use C4::Branch; # GetBranchName
 use C4::Koha;   # FIXME : is it still useful ?
@@ -155,22 +157,36 @@ if ( $query->param('resbarcode') ) {
     }
 }
 
-my $iteminformation;
 my $borrower;
 my $returned = 0;
 my $messages;
+my $issueinformation;
 my $barcode = $query->param('barcode');
 
 # actually return book and prepare item table.....
 if ($barcode) {
     # decode cuecat
     $barcode = cuecatbarcodedecode($barcode);
-    ( $returned, $messages, $iteminformation, $borrower ) =
+#
+# save the return
+#
+    ( $returned, $messages, $issueinformation, $borrower ) =
       AddReturn( $barcode, C4::Context->userenv->{'branch'} );
+    # get biblio description
+    my $biblio = GetBiblioFromItemNumber($issueinformation->{'itemnumber'});
+    $template->param(
+        title            => $biblio->{'title'},
+        homebranch       => $biblio->{'homebranch'},
+        author           => $biblio->{'author'},
+        itembarcode      => $biblio->{'barcode'},
+        itemtype         => $biblio->{'itemtype'},
+        ccode            => $biblio->{'ccode'},
+        itembiblionumber => $biblio->{'biblionumber'},    
+    );
     if ($returned) {
         $returneditems{0}    = $barcode;
         $riborrowernumber{0} = $borrower->{'borrowernumber'};
-        $riduedate{0}        = $iteminformation->{'date_due'};
+        $riduedate{0}        = $issueinformation->{'date_due'};
         my %input;
         $input{counter}        = 0;
         $input{first}          = 1;
@@ -181,8 +197,8 @@ if ($barcode) {
 
         # check if the branch is the same as homebranch
         # if not, we want to put a message
-        if ( $iteminformation->{'homebranch'} ne C4::Context->userenv->{'branch'} ) {
-            $template->param( homebranch => $iteminformation->{'homebranch'} );
+        if ( $biblio->{'homebranch'} ne C4::Context->userenv->{'branch'} ) {
+            $template->param( homebranch => $biblio->{'homebranch'} );
         }
     }
     elsif ( !$messages->{'BadBarcode'} ) {
@@ -205,14 +221,6 @@ if ($barcode) {
         }
         push( @inputloop, \%input );
     }
-    $template->param(
-        returned  => $returned,
-        itemtitle => $iteminformation->{'title'},
-
-        #                                                                      itembc => $iteminformation->{'barcode'},
-        #                                                                      itemdatedue => $iteminformation->{'datedue'},
-        itemauthor => $iteminformation->{'author'}
-    );
 }
 $template->param( inputloop => \@inputloop );
 
@@ -224,14 +232,9 @@ my $reserved = 0;
 #  if the document is transfered, we have warning message .
 
 if ( $messages->{'WasTransfered'} ) {
-
-    my $iteminfo = GetBiblioFromItemNumber( 0, $barcode );
-
     $template->param(
         found          => 1,
         transfer       => 1,
-        itemhomebranch =>
-          $branches->{ $iteminfo->{'homebranch'} }->{'branchname'}
     );
 
 }
@@ -245,13 +248,11 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
         WrongTransferItem => $messages->{'WrongTransferItem'},
     );
 
-    my $res        = $messages->{'ResFound'};
-    my $branchname = $branches->{ $res->{'branchcode'} }->{'branchname'};
-    my ($borr) = GetMemberDetails( $res->{'borrowernumber'}, 0 );
+    my $reserve        = $messages->{'ResFound'};
+    my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'};
+    my ($borr) = GetMemberDetails( $reserve->{'borrowernumber'}, 0 );
     my $name =
       $borr->{'surname'} . " " . $borr->{'title'} . " " . $borr->{'firstname'};
-    my $iteminfo = GetBiblioFromItemNumber( 0, $barcode );
-        
         $template->param(
             wname           => $name,
             wborfirstname   => $borr->{'firstname'},
@@ -262,29 +263,22 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
             wborstraddress  => $borr->{'streetaddress'},
             wborcity        => $borr->{'city'},
             wborzip         => $borr->{'zipcode'},
-            wborrowernumber => $res->{'borrowernumber'},
+            wborrowernumber => $reserve->{'borrowernumber'},
             wborcnum        => $borr->{'cardnumber'},
-            witemtitle        => $iteminfo->{'title'},
-            witemauthor       => $iteminfo->{'author'},
-            witembarcode      => $iteminfo->{'barcode'},
-            witemtype         => $iteminfo->{'itemtype'},
-            wccode            => $iteminfo->{'ccode'},
-            witembiblionumber => $iteminfo->{'biblionumber'},
             wtransfertFrom    => C4::Context->userenv->{'branch'},
         );
 }
 
 
+#
+# reserve found and item arrived at the expected branch
+#
 if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) {
-    my $res        = $messages->{'ResFound'};
-    my $branchname = $branches->{ $res->{'branchcode'} }->{'branchname'};
-    my ($borr) = GetMemberDetails( $res->{'borrowernumber'}, 0 );
-    my $name =
-      $borr->{'surname'} . " " . $borr->{'title'} . " " . $borr->{'firstname'};
-    my $iteminfo = GetBiblioFromItemNumber( 0, $barcode );
-
-    if ( $res->{'ResFound'} eq "Waiting" ) {
-        if ( C4::Context->userenv->{'branch'} eq $res->{'branchcode'} ) {
+    my $reserve        = $messages->{'ResFound'};
+    my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'};
+    my ($borr) = GetMemberDetails( $reserve->{'borrowernumber'}, 0 );
+    if ( $reserve->{'ResFound'} eq "Waiting" ) {
+        if ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ) {
             $template->param( waiting => 1 );
         }
         else {
@@ -293,7 +287,7 @@ if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) {
 
         $template->param(
             found          => 1,
-            name           => $name,
+            name           => $borr->{'surname'} . " " . $borr->{'title'} . " " . $borr->{'firstname'},
             borfirstname   => $borr->{'firstname'},
             borsurname     => $borr->{'surname'},
             bortitle       => $borr->{'title'},
@@ -302,29 +296,23 @@ if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) {
             borstraddress  => $borr->{'streetaddress'},
             borcity        => $borr->{'city'},
             borzip         => $borr->{'zipcode'},
-            borrowernumber => $res->{'borrowernumber'},
+            borrowernumber => $reserve->{'borrowernumber'},
             borcnum        => $borr->{'cardnumber'},
             debarred       => $borr->{'debarred'},
             gonenoaddress  => $borr->{'gonenoaddress'},
             currentbranch  => $branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
-            itemnumber       => $res->{'itemnumber'},
-            itemtitle        => $iteminfo->{'title'},
-            itemauthor       => $iteminfo->{'author'},
-            itembarcode      => $iteminfo->{'barcode'},
-            itemtype         => $iteminfo->{'itemtype'},
-            ccode            => $iteminfo->{'ccode'},
-            itembiblionumber => $iteminfo->{'biblionumber'}
+            itemnumber       => $reserve->{'itemnumber'},
         );
 
     }
-    if ( $res->{'ResFound'} eq "Reserved" ) {
+    if ( $reserve->{'ResFound'} eq "Reserved" ) {
         my @da         = localtime( time() );
         my $todaysdate =
             sprintf( "%0.2d", ( $da[3] + 1 ) ) . "/"
           . sprintf( "%0.2d", ( $da[4] + 1 ) ) . "/"
           . ( $da[5] + 1900 );
 
-        if ( C4::Context->userenv->{'branch'} eq $res->{'branchcode'} ) {
+        if ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ) {
             $template->param( intransit => 0 );
         }
         else {
@@ -334,24 +322,17 @@ if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) {
         $template->param(
             found          => 1,
             currentbranch  => $branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
-            name           => $name,
             destbranchname =>
-              $branches->{ $res->{'branchcode'} }->{'branchname'},
-            destbranch    => $res->{'branchcode'},
-            transfertodo => ( C4::Context->userenv->{'branch'} eq $res->{'branchcode'} ? 0 : 1 ),
+              $branches->{ $reserve->{'branchcode'} }->{'branchname'},
+            destbranch    => $reserve->{'branchcode'},
+            transfertodo => ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ? 0 : 1 ),
             reserved => 1,
             today            => $todaysdate,
-            itemnumber       => $res->{'itemnumber'},
-            itemtitle        => $iteminfo->{'title'},
-            itemauthor       => $iteminfo->{'author'},
-            itembarcode      => $iteminfo->{'barcode'},
-            itemtype         => $iteminfo->{'itemtype'},
-            ccode            => $iteminfo->{'ccode'},
-            itembiblionumber => $iteminfo->{'biblionumber'},
+            itemnumber       => $reserve->{'itemnumber'},
             borsurname       => $borr->{'surname'},
             bortitle         => $borr->{'title'},
             borfirstname     => $borr->{'firstname'},
-            borrowernumber   => $res->{'borrowernumber'},
+            borrowernumber   => $reserve->{'borrowernumber'},
             borcnum          => $borr->{'cardnumber'},
             borphone         => $borr->{'phone'},
             borstraddress    => $borr->{'streetaddress'},
@@ -441,14 +422,14 @@ if ($borrower) {
             my @waitingitemloop;
             my $items = $flags->{$flag}->{'itemlist'};
             foreach my $item (@$items) {
-                my $iteminformation =
+                my $biblio =
                   GetBiblioFromItemNumber( $item->{'itemnumber'});
                 my %waitingitem;
-                $waitingitem{biblionum} = $iteminformation->{'biblionumber'};
-                $waitingitem{barcode}   = $iteminformation->{'barcode'};
-                $waitingitem{title}     = $iteminformation->{'title'};
+                $waitingitem{biblionum} = $biblio->{'biblionumber'};
+                $waitingitem{barcode}   = $biblio->{'barcode'};
+                $waitingitem{title}     = $biblio->{'title'};
                 $waitingitem{brname}    =
-                  $branches->{ $iteminformation->{'holdingbranch'} }
+                  $branches->{ $biblio->{'holdingbranch'} }
                   ->{'branchname'};
                 push( @waitingitemloop, \%waitingitem );
             }
@@ -460,15 +441,15 @@ if ($borrower) {
             foreach my $item ( sort { $a->{'date_due'} cmp $b->{'date_due'} }
                 @$items )
             {
-                my $iteminformation =
-                  GetBiblioFromItemNumber( $item->{'itemnumber'}, 0 );
+                my $biblio =
+                  GetBiblioFromItemNumber( $item->{'itemnumber'});
                 my %overdueitem;
                 $overdueitem{duedate}   = format_date( $item->{'date_due'} );
-                $overdueitem{biblionum} = $iteminformation->{'biblionumber'};
-                $overdueitem{barcode}   = $iteminformation->{'barcode'};
-                $overdueitem{title}     = $iteminformation->{'title'};
+                $overdueitem{biblionum} = $biblio->{'biblionumber'};
+                $overdueitem{barcode}   = $biblio->{'barcode'};
+                $overdueitem{title}     = $biblio->{'title'};
                 $overdueitem{brname}    =
-                  $branches->{ $iteminformation->{'holdingbranch'} }
+                  $branches->{ $biblio->{'holdingbranch'} }
                   ->{'branchname'};
                 push( @itemloop, \%overdueitem );
             }
@@ -527,12 +508,12 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
         }
 
         #        my %ri;
-        my $iteminformation = GetBiblioFromItemNumber( 0, $barcode );
-        $ri{itembiblionumber} = $iteminformation->{'biblionumber'};
-        $ri{itemtitle}        = $iteminformation->{'title'};
-        $ri{itemauthor}       = $iteminformation->{'author'};
-        $ri{itemtype}         = $iteminformation->{'itemtype'};
-        $ri{ccode}            = $iteminformation->{'ccode'};
+        my $biblio = GetBiblioFromItemNumber(GetItemnumberFromBarcode($barcode));
+        $ri{itembiblionumber} = $biblio->{'biblionumber'};
+        $ri{itemtitle}        = $biblio->{'title'};
+        $ri{itemauthor}       = $biblio->{'author'};
+        $ri{itemtype}         = $biblio->{'itemtype'};
+        $ri{ccode}            = $biblio->{'ccode'};
         $ri{barcode}          = $barcode;
     }
     else {
index 916b6c9..102a038 100755 (executable)
@@ -27,6 +27,8 @@ use C4::Branch; # GetBranches
 use C4::Auth;
 use C4::Date;
 use C4::Circulation;
+use C4::Reserves2;
+use C4::Members;
 use Date::Calc qw(
   Today
   Add_Delta_Days
@@ -37,8 +39,6 @@ use C4::Biblio;
 
 my $input = new CGI;
 
-my $theme = $input->param('theme');    # only used if allowthemeoverride is set
-
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
         template_name   => "circ/waitingreservestransfers.tmpl",
@@ -77,25 +77,22 @@ foreach my $br ( keys %$branches ) {
     my %branchloop;
     $branchloop{'branchname'} = $branches->{$br}->{'branchname'};
     $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'};
-
-    #  warn " branch=>".$branches->{$br}->{'branchcode'};
     my @getreserves =
-      GetReservesToBranch( $branches->{$br}->{'branchcode'}, $default );
+      GetReservesToBranch( $branches->{$br}->{'branchcode'} );
     if (@getreserves) {
         foreach my $num (@getreserves) {
             my %getreserv;
             my %env;
             my $gettitle     = GetBiblioFromItemNumber( $num->{'itemnumber'} );
+#             use Data::Dumper;
+#             warn Dumper($gettitle);
+            warn "ITEM : ".$gettitle->{'title'};
             my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );
             if ( $gettitle->{'holdingbranch'} eq $default ) {
                 my $getborrower =
                   GetMemberDetails( $num->{'borrowernumber'} );
                 $getreserv{'reservedate'} =
                   format_date( $num->{'reservedate'} );
-
-#my $calcDate=DateCalc($num->{'reservedate'},"+".C4::Context->preference('TransfersMaxDaysWarning')."  days");
-#my $warning=Date_Cmp(ParseDate("today"),$calcDate);
-
                 my ( $reserve_year, $reserve_month, $reserve_day ) = split /-/,
                   $num->{'reservedate'};
                 ( $reserve_year, $reserve_month, $reserve_day ) =
@@ -119,12 +116,10 @@ foreach my $br ( keys %$branches ) {
                 $getreserv{'borrowernum'}    = $getborrower->{'borrowernumber'};
                 $getreserv{'borrowername'}   = $getborrower->{'surname'};
                 $getreserv{'borrowerfirstname'} = $getborrower->{'firstname'};
-
-                if ( $getborrower->{'emailaddress'} ) {
-                    $getreserv{'borrowermail'} = $getborrower->{'emailaddress'};
-                }
+                $getreserv{'borrowermail'} = $getborrower->{'emailaddress'};
                 $getreserv{'borrowerphone'} = $getborrower->{'phone'};
                 push( @reservloop, \%getreserv );
+                warn "=".$getreserv{'title'}.">>".$gettitle->{'title'};
             }
         }
 
index ab9deea..a1530f6 100644 (file)
@@ -48,7 +48,7 @@
                                        <td><p><!-- TMPL_VAR NAME="waitingdate" --></p> <!-- TMPL_IF NAME="messcompa" --> Reserve Over <!-- /TMPL_IF --></td>
                                        <td>
                                                <p>
-                                                       <a href="/cgi-bin/koha/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
+                                                       <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
                                                        &nbsp; (<b><!-- TMPL_VAR NAME="itemtype" --></b>)
                                                        <br />Barcode : <!-- TMPL_VAR NAME="barcode" -->
                                                </p>
index ae3bfbb..36aa344 100755 (executable)
@@ -5,18 +5,19 @@
 <!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
 
 <div id="mainbloc">
-       <h1 class="circulation">Transfers in wait for your library the : <!-- TMPL_VAR NAME="show_date" --></h1>
+       <h1 class="circulation">Transfers made TO your library the : <!-- TMPL_VAR NAME="show_date" --></h1>
+        <p>You are the destination of this transfer</p>
        <div id="resultlist">
        <!-- TMPL_LOOP NAME="branchesloop" -->
                <!-- TMPL_IF NAME="branchcode" -->
                <table>
                <tr>
-                       <th class="circulation" colspan="5">current transfers from the library : <!-- TMPL_VAR NAME="branchname" --> </th>
+                       <th class="circulation" colspan="5">Coming from <!-- TMPL_VAR NAME="branchname" --> </th>
                </tr>
                <tr>
                        <th class="circulation">Date of transfer</th>
                        <th class="circulation">Title</th>
-                       <th class="circulation">Borrower</th>
+                       <th class="circulation">Reserved by </th>
                        <th class="circulation">Localisation</th>
                        <th class="circulation">Action</th>
                </tr>
@@ -37,9 +38,9 @@
        <!-- TMPL_VAR NAME="borrowermail" --></a><!--/TMPL_IF-->
                                        </p>
                                <!-- TMPL_ELSE -->
-                                       <P>
-                                       Transfer without reserv linked
-                                       </P>
+                                       <p>
+                                       None
+                                       </p>
                                <!-- /TMPL_IF -->
                                </td>
                                <td><p><!-- TMPL_VAR NAME="homebranch" --> <!-- TMPL_VAR NAME="itemcallnumber" --></p></td>
index b09215b..9fe7f7c 100644 (file)
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Circulation &rsaquo; Returns<!-- TMPL_IF Name="returned" -->: <!-- TMPL_VAR Name="itemtitle" --><!-- /TMPL_IF --></title>
+<title>Koha &rsaquo; Circulation &rsaquo; Returns <!-- TMPL_VAR Name="title" --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 
 <!-- TMPL_INCLUDE NAME="menus.inc" -->
 <!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
 
 <!-- case of a mistake in transfert loop -->
+<!-- TMPL_IF Name="WrongTransfer" -->
+    <h3 class="problem">This item was not transfered initialy to this library !</h3>
+    <table>
+    <tr>
+        <th>Title : </th>
+        <td>           
+                <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" --></a>
+        </td>
+    </tr>
+    <tr><th>Reserved for: </th>
+    <td>
+    <!-- TMPL_IF Name="wborcnum"-->
+        <ul>
+                    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR Name="wborcnum" --></a></li>
+        <li><!-- TMPL_VAR Name="wborsurname" -->, <!-- TMPL_VAR Name="wborfirstname" --> </li>
+        <li><!-- TMPL_VAR Name="wborstraddress" --><br />
+        <!-- TMPL_VAR Name="wborcity" -->  <!-- TMPL_VAR NAME="wborzip" --></li>
+        <li><!-- TMPL_VAR Name="wborphone" --></li>
+        </ul>
+    <!-- TMPL_ELSE-->
+            No reservation linked
+    <!-- /TMPL_IF -->
+        </td>
+        </tr>
+        <tr><th>Action : </th>
+            <td class="problem">
+                this document must be transfered to : <!-- TMPL_VAR Name="TransferWaitingAt" -->
+            </td>
+        </tr>
+    </table>
+    <form method="post" action="returns.pl" name="mainform" id="mainform">
+            <input type="hidden" name="WT-itemNumber" value="<!-- TMPL_VAR Name="WrongTransferItem" -->" />
+            <input type="hidden" name="WT-waitingAt" value="<!-- TMPL_VAR Name="TransferWaitingAt" -->" />
+            <input type="hidden" name="WT-From" value="<!-- TMPL_VAR Name="wtransfertFrom" -->" />
+        <input type="submit" value="Send this document" />
+    </form>
+<!-- /TMPL_IF -->
 
-       <!-- TMPL_IF Name="WrongTransfer" -->
-               <h3 class="problem">This item was not transfered initialy to this library !</h3>
-        
+<!-- TMPL_IF Name="found" -->
+<!-- case of a reservation found, and display info -->
+    <!-- TMPL_IF Name="waiting" -->
+        <h3>Waiting Reserve Found in your library</h3>
         <table>
+        <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" --></a></caption>
         <tr>
-               <th>Title : </th>
-               <td>            
-                       <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="witemtitle" --></a>
-               </td>
-       </tr>
-        <tr><th>Reserved for: </th>
-        <td>
-        <!-- TMPL_IF Name="wborcnum"-->
+            <th>Patron: </th>
+            <td>
             <ul>
-                        <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR Name="wborcnum" --></a></li>
-            <li><!-- TMPL_VAR Name="wborsurname" -->, <!-- TMPL_VAR Name="wborfirstname" --> </li>
-            <li><!-- TMPL_VAR Name="wborstraddress" --><br />
-            <!-- TMPL_VAR Name="wborcity" -->  <!-- TMPL_VAR NAME="wborzip" --></li>
-            <li><!-- TMPL_VAR Name="wborphone" --></li>
+                <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR Name="borcnum" --></a></li>
+                <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" --> </li>
+                <li><!-- TMPL_VAR Name="borstraddress" --><br />
+                <!-- TMPL_VAR Name="borcity" -->  <!-- TMPL_VAR NAME="borzip" --></li>
+                <li><!-- TMPL_VAR Name="borphone" --></li>
             </ul>
-        <!-- TMPL_ELSE-->
-               No reservation linked
-        <!-- /TMPL_IF -->
-         </td>
-         </tr>
-         <tr><th>Action : </th>
-               <td class="problem">
-                this document must be transfered to : <!-- TMPL_VAR Name="TransferWaitingAt" -->
-               </td>
-         </tr>
+            </td>
+        </tr>
         </table>
         <form method="post" action="returns.pl" name="mainform" id="mainform">
-                <input type="hidden" name="WT-itemNumber" value="<!-- TMPL_VAR Name="WrongTransferItem" -->" />
-                <input type="hidden" name="WT-waitingAt" value="<!-- TMPL_VAR Name="TransferWaitingAt" -->" />
-                <input type="hidden" name="WT-From" value="<!-- TMPL_VAR Name="wtransfertFrom" -->" />
-         <input type="submit" value="Send this document" />
-        </form>
-            
-<!-- /TMPL_IF -->
-        
-<!-- TMPL_IF Name="found" -->
-<!-- case of a reservation found, and display info -->
-
-       <!-- TMPL_IF Name="waiting" -->
-        <h3>Waiting Reserve Found in your library</h3>
-        <table>
-        <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
-        <tr><th>Patron: </th><td>
-            <ul>
-                        <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR Name="borcnum" --></a></li>
-            <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" --> </li>
-            <li><!-- TMPL_VAR Name="borstraddress" --><br />
-            <!-- TMPL_VAR Name="borcity" -->  <!-- TMPL_VAR NAME="borzip" --></li>
-            <li><!-- TMPL_VAR Name="borphone" --></li>
-            </ul></td></tr>
-        </table><form method="post" action="returns.pl" name="mainform" id="mainform">
-            <input type="submit" value="Confirm" /><!-- TMPL_LOOP Name="inputloop" -->
+            <input type="submit" value="Confirm" />
+            <!-- TMPL_LOOP Name="inputloop" -->
                 <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
                 <input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
                 <input type="hidden" name="bn-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
             <!-- /TMPL_LOOP -->
-            <input type="hidden" name="barcode" value="0" />
-            </form>
-<!-- /TMPL_IF -->
+                <input type="hidden" name="barcode" value="0" />
+                </form>
+    <!-- /TMPL_IF -->
 
-       <!-- TMPL_IF Name="diffbranch" -->
-       <h3>Reserve With necesary transfert Found</h3>
+    <!-- TMPL_IF Name="diffbranch" -->
+        <h3>Reserve needing transfert found</h3>
         <table>
-        <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
-        <tr><th>Patron: </th><td>
-            <ul>
+            <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" --></a></caption>
+            <tr>
+                <th>Patron: </th>
+                <td>
+                    <ul>
                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR Name="borcnum" --></a></li>
-            <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" --> </li>
-            <li><!-- TMPL_VAR Name="borstraddress" --><br />
-            <!-- TMPL_VAR Name="borcity" -->  <!-- TMPL_VAR NAME="borzip" --></li>
-            <li><!-- TMPL_VAR Name="borphone" --></li>
-            </ul></td></tr>
-       <!-- TMPL_IF name="transfertodo" -->
-    <tr><th>Transfer to:</th><td><!-- TMPL_VAR Name="destbranchname" --></td></tr>
-       <!-- /TMPL_IF -->
-        </table><form method="post" action="returns.pl" name="mainform" id="mainform">
-            <input type="submit" value="Confirm" /><!-- TMPL_LOOP Name="inputloop" -->
+                        <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" --> </li>
+                        <li><!-- TMPL_VAR Name="borstraddress" --><br />
+                        <!-- TMPL_VAR Name="borcity" -->  <!-- TMPL_VAR NAME="borzip" --></li>
+                        <li><!-- TMPL_VAR Name="borphone" --></li>
+                    </ul>
+                </td>
+            </tr>
+            <!-- TMPL_IF name="transfertodo" -->
+                <tr><th>Transfer to:</th><td><!-- TMPL_VAR Name="destbranchname" --></td></tr>
+            <!-- /TMPL_IF -->
+        </table>
+        <form method="post" action="returns.pl" name="mainform" id="mainform">
+            <input type="submit" value="Confirm" />
+            <!-- TMPL_LOOP Name="inputloop" -->
                 <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
                 <input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
                 <input type="hidden" name="bn-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
             <!-- /TMPL_LOOP -->
             <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR Name="destbranch" -->" />
             <input type="hidden" name="barcode" value="0" />
-            </form>                    
-        <!-- /TMPL_IF -->
-        
-<!-- case of a return of item, but with no reservation after, if the document must return to his homebranch -->
-        <!-- TMPL_IF Name="transfer" -->
-            <h2>This item must return to his homebranch :</h2>
-            <p><span class="problem">The document <!-- TMPL_VAR NAME="itemtitle" --> (<!-- TMPL_VAR NAME="itemauthor" -->) Must be returned to his homebranch(<b><!-- TMPL_VAR NAME="itemhomebranch" --></b>)</span></p>
-                <form method="post" action="returns.pl">
-                    <!-- TMPL_LOOP Name="inputloop" -->
-                        <input type="hidden" name="ri-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="barcode" -->">
-                        <input type="hidden" name="dd-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="duedate" -->">
-                        <input type="hidden" name="bn-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
-                    <!-- /TMPL_LOOP -->
-                    <input type="hidden" name="barcode" value="0">
-                    <input type="submit" value="OK">
-                </form>
-        <!-- /TMPL_IF -->
-        
-        
-        <!-- TMPL_IF Name="diffbranch" -->
-            <h3>Item Consigned:</h3>
-        
+        </form>                        
+    <!-- /TMPL_IF -->
+
+    <!-- case of a return of item, but with no reservation after, if the document must return to his homebranch -->
+    <!-- TMPL_IF Name="transfer" -->
+        <h2>This item must return to his homebranch :</h2>
+        <p><span class="problem">The document <!-- TMPL_VAR NAME="title" --> (<!-- TMPL_VAR NAME="author" -->) Must be returned to his homebranch(<b><!-- TMPL_VAR NAME="homebranch" --></b>)</span></p>
+            <form method="post" action="returns.pl">
+                <!-- TMPL_LOOP Name="inputloop" -->
+                    <input type="hidden" name="ri-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="barcode" -->">
+                    <input type="hidden" name="dd-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="duedate" -->">
+                    <input type="hidden" name="bn-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
+                <!-- /TMPL_LOOP -->
+                <input type="hidden" name="barcode" value="0">
+                <input type="submit" value="OK">
+            </form>
+    <!-- /TMPL_IF -->
+    
+    <!-- TMPL_IF Name="diffbranch" -->
+        <h3>Item Consigned:</h3>
         <table>
-        <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
-        <tr><th>Patron:</th><td><!-- TMPL_VAR Name="name" --></td></tr>
-        </table><form method="post" action="returns.pl" name="mainform" id="mainform"><input type="submit" value="OK" />
+        <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" --></a></caption>
+        <tr>
+            <th>Patron:</th>
+            <td><!-- TMPL_VAR Name="name" --></td>
+        </tr>
+        </table>
+        <form method="post" action="returns.pl" name="mainform" id="mainform"><input type="submit" value="OK" />
             <!-- TMPL_LOOP Name="inputloop" -->
                 <!-- TMPL_UNLESS Name="first" -->
                     <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
                 <!-- /TMPL_UNLESS -->
             <!-- /TMPL_LOOP -->
             <input type="hidden" name="barcode" value="0" />
-            
-            </form>
+        </form>
+    <!-- /TMPL_IF -->
+    
+    
+    <!-- case of simple return no issue or transfer but with a reservation  -->
+    <!-- TMPL_IF Name="reserved" -->
+        <!-- TMPL_IF Name="transfertodo"-->
+            <h3>Reserve With necesary transfert Found</h3>
+        <!-- TMPL_ELSE -->
+            <h3>Waiting Reserve Found in your library</h3>
         <!-- /TMPL_IF -->
-        
-<!-- case of simple return no issue or transfer but with a reservation  -->
-
-        <!-- TMPL_IF Name="reserved" -->
-               <!-- TMPL_IF Name="transfertodo"-->
-               <h3>Reserve With necesary transfert Found</h3>
-               <!-- TMPL_ELSE -->
-               <h3>Waiting Reserve Found in your library</h3>
-               <!-- /TMPL_IF -->
-               
-            <table>
-            <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
-            <tr><th>Patron: </th><td>
-            <ul>
+        <table>
+            <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="title" --></a></caption>
+            <tr>
+                <th>Patron: </th>
+                <td>
+                    <ul>
                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR Name="borcnum" --></a></li>
-            <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" --> </li>
-            <li><!-- TMPL_VAR Name="borstraddress" --><br />
-            <!-- TMPL_VAR Name="borcity" --> <!-- TMPL_VAR NAME="borzip" --></li>
-            <li><!-- TMPL_VAR Name="borphone" --></li>
-            </ul></td></tr>
-               <!-- TMPL_IF name="transfertodo" -->
-                <tr><th>Transfer to:</th><td><!-- TMPL_VAR Name="destbranchname" --></td></tr>
-               <!-- /TMPL_IF -->     
+                    <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" --> </li>
+                    <li><!-- TMPL_VAR Name="borstraddress" --><br />
+                    <!-- TMPL_VAR Name="borcity" --> <!-- TMPL_VAR NAME="borzip" --></li>
+                    <li><!-- TMPL_VAR Name="borphone" --></li>
+                    </ul>
+                </td>
+            </tr>
+            <!-- TMPL_IF name="transfertodo" -->
+                <tr><th>Transfer to:</th><td><!-- TMPL_VAR Name="destbranchname" --></td></tr>
+            <!-- /TMPL_IF -->     
+        </table>
+        <form method="post" action="returns.pl" name="mainform" id="mainform">
+            <input type="submit" value="Confirm" />
+            <!-- TMPL_LOOP Name="inputloop" -->
+                    <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
+                    <input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
+                    <input type="hidden" name="bn-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
+            <!-- /TMPL_LOOP -->
+            <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
+            <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
+            <input type="hidden" name="resbarcode" value="<!-- TMPL_VAR Name="barcode" -->" />
+            <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR Name="destbranch" -->" />
+        </form>
+    <!-- /TMPL_IF -->
 
-           </table>
-            <form method="post" action="returns.pl" name="mainform" id="mainform">
-               <input type="submit" value="Confirm" />
-               <!-- TMPL_LOOP Name="inputloop" -->
-                       <input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
-                       <input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
-                       <input type="hidden" name="bn-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
-               <!-- /TMPL_LOOP -->
-               <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
-               <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
-               <input type="hidden" name="resbarcode" value="<!-- TMPL_VAR Name="barcode" -->" />
-               <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR Name="destbranch" -->" />
-            </form>
-        <!-- /TMPL_IF -->
-    
 <!-- TMPL_ELSE -->
-<h1>Circulation &rsaquo; Returns</h1>
-    
+    <h1>Circulation &rsaquo; Returns</h1>
     <form method="post" action="/cgi-bin/koha/circ/returns.pl"  name="mainform" id="mainform">
             <fieldset>
             <legend>Enter item barcode</legend>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF Name="returned" -->
-<table>
+    <table>
         <tr><th>Item Information</th><th>Patron Information</th></tr>
-        <tr><td><!-- TMPL_VAR Name="itemtitle" -->
-        </td><td>
-<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR Name="riborrowernumber" -->"><!-- TMPL_VAR Name="riborcnum" --></a>
-        <!-- TMPL_VAR Name="riborsurname" -->, <!-- TMPL_VAR Name="ribortitle" --> <!-- TMPL_VAR Name="riborfirstname" -->
-
-<!-- TMPL_IF Name="flagset" -->
-(<!-- TMPL_LOOP Name="flagloop" -->
-<!-- TMPL_VAR Name="flag" -->, 
-<!-- /TMPL_LOOP -->)<!-- /TMPL_IF -->
-</td></tr></table>
-
+        <tr>
+            <td><!-- TMPL_VAR Name="title" --></td>
+            <td>
+                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR Name="riborrowernumber" -->"><!-- TMPL_VAR Name="riborcnum" --></a>
+                <!-- TMPL_VAR Name="riborsurname" -->, <!-- TMPL_VAR Name="ribortitle" --> <!-- TMPL_VAR Name="riborfirstname" -->
+                <!-- TMPL_IF Name="flagset" -->
+                (<!-- TMPL_LOOP Name="flagloop" -->
+                <!-- TMPL_VAR Name="flag" -->, 
+                <!-- /TMPL_LOOP -->)<!-- /TMPL_IF -->
+            </td>
+        </tr>
+    </table>
 <!-- /TMPL_IF -->
-
-
-
 <!-- TMPL_IF Name="riloop" -->
-        <h2>Returned Items</h2>
-        <table>
+    <h2>Returned Items</h2>
+    <table>
         <tr>
             <th>Title</th>
             <th>Itemtype</th>
                     <!-- TMPL_VAR Name="itemtitle" --></a>
                     <br /><!-- TMPL_VAR Name="itemauthor" -->
             </td>
-            <td><!-- TMPL_VAR Name="ccode" --></td>
+            <td><!-- TMPL_VAR Name="itemtype" --> <!-- TMPL_VAR Name="ccode" --></td>
             <td>
             <!-- TMPL_IF Name="duedate" -->
                 <!-- TMPL_IF Name="early" --><!-- /TMPL_IF --><!-- TMPL_VAR Name="month" -->/<!-- TMPL_VAR Name="day" -->/<!-- TMPL_VAR Name="year" --><!-- TMPL_IF Name="early" --></span><!-- /TMPL_IF -->
             <!-- /TMPL_IF -->
             </td></tr>
         <!-- /TMPL_LOOP -->
-        </table>
-        
+    </table>
 <!-- /TMPL_IF -->
 
 <script type="text/JavaScript" language="JavaScript">
index e2bd09c..724e15f 100644 (file)
@@ -30,7 +30,7 @@
                                <td><p><!-- TMPL_VAR NAME="reservedate" --></p> <!-- TMPL_IF NAME="messcompa" --> Reserve over <!-- /TMPL_IF --></td>
                                <td>
                                        <p>
-                                               <a href="/cgi-bin/koha/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
+                                               <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a>
                                                &nbsp; (<b><!-- TMPL_VAR NAME="itemtype" --> </b>)
                                                <br />Barcode : <!-- TMPL_VAR NAME="barcode" -->
                                        </p>
index 236cc17..18bc587 100755 (executable)
@@ -10,7 +10,7 @@ use CGI;
 use C4::Output;
 use C4::Auth;
 use C4::Context;
-use C4::Circulation;
+use C4::Members;
 #use C4::Acquisitions;
 
 use C4::Interface::CGI::Output;
@@ -38,11 +38,6 @@ my %env;
 $env{'nottodayissues'}=1;
 my %member2;
 $member2{'borrowernumber'}=$member;
-my $issues=GetBorrowerIssues(\%member2);
-my $i=0;
-foreach (sort keys %$issues) {
-    $i++;
-}
 
 if ($input->param('newflags')) {
     my $dbh=C4::Context->dbh();
index 70a93f2..f874c63 100755 (executable)
@@ -38,11 +38,11 @@ my %env;
 $env{'nottodayissues'}=1;
 my %member2;
 $member2{'borrowernumber'}=$member;
-my $issues=GetBorrowerIssues(\%member2);
-my $i=0;
-foreach (sort keys %$issues) {
-    $i++;
-}
+my $issues=GetBorrowerIssues(\%member2);
+my $i=0;
+foreach (sort keys %$issues) {
+    $i++;
+}
 
 my ($bor,$flags)=GetMemberDetails( $member,'');
 my $newpassword = $input->param('newpassword');
index ab34669..ee4439b 100755 (executable)
@@ -86,7 +86,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 if ( $query->param('modifyshelfcontents') ) {
     my $shelfnumber = $query->param('viewshelf');
     my $barcode     = $query->param('addbarcode');
-    my ($item) = GetItemFromBarcode($barcode);
+    my ($item) = GetItemnumberFromBarcode($barcode);
     if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
         AddToShelf( $item->{'itemnumber'}, $shelfnumber );
         foreach ( $query->param ) {
@@ -229,6 +229,9 @@ output_html_with_http_headers $query, $cookie, $template->output;
 
 #
 # $Log$
+# Revision 1.11  2007/04/17 08:52:19  tipaul
+# circulation cleaning continued: bufixing
+#
 # Revision 1.10  2007/04/04 16:46:23  tipaul
 # HUGE COMMIT : code cleaning circulation.
 #
index 4da3c76..a931813 100755 (executable)
@@ -227,7 +227,7 @@ if ($op eq 'serialchangestatus') {
               }
             }
             # check for item barcode # being unique
-            my $exists = GetItemFromBarcode($record->subfield($tagfield,$tagsubfield)) if ($record->subfield($tagfield,$tagsubfield));
+            my $exists = GetItemnumberFromBarcode($record->subfield($tagfield,$tagsubfield)) if ($record->subfield($tagfield,$tagsubfield));
   #           push @errors,"barcode_not_unique" if($exists);
             $template->param("barcode_not_unique" => 1,'errserialseq'=>$serialseqs[$index]);
             # if barcode exists, don't create, but report The problem.