Fixing delete shelf button javascript problem. Now works well with and without javasc...
[koha.git] / opac / opac-user.pl
index 3639525..0e0d037 100755 (executable)
@@ -15,7 +15,6 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 use strict;
 require Exporter;
@@ -55,7 +54,8 @@ $borr->{'ethnicity'}    = fixEthnicity( $borr->{'ethnicity'} );
 if ( $borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
     $borr->{'flagged'} = 1;
 }
-
+# $make flagged available everywhere in the template
+my $patron_flagged = $borr->{'flagged'};
 if ( $borr->{'amountoutstanding'} > 5 ) {
     $borr->{'amountoverfive'} = 1;
 }
@@ -72,8 +72,10 @@ $borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'};
 my @bordat;
 $bordat[0] = $borr;
 
-$template->param( BORROWER_INFO  => \@bordat );
-$template->param( borrowernumber => $borrowernumber );
+$template->param(   BORROWER_INFO  => \@bordat,
+                    borrowernumber => $borrowernumber,
+                    patron_flagged => $patron_flagged,
+                );
 
 #get issued items ....
 my ($countissues,$issues) = GetPendingIssues($borrowernumber);
@@ -141,7 +143,7 @@ $template->param( overdues_count => $overdues_count );
 # load the branches
 my $branches = GetBranches();
 my @branch_loop;
-for my $branch_hash ( keys %$branches ) {
+for my $branch_hash (sort keys %$branches ) {
     my $selected=(C4::Context->userenv && ($branch_hash eq C4::Context->userenv->{branch})) if (C4::Context->preference('SearchMyLibraryFirst'));
     push @branch_loop,
       {