koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/opac opac-search.pl [rel_2_2]


From: Joshua Ferraro
Subject: [Koha-cvs] koha/opac opac-search.pl [rel_2_2]
Date: Wed, 08 Mar 2006 18:49:51 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Joshua Ferraro <address@hidden> 06/03/08 18:49:51

Modified files:
        opac           : opac-search.pl 

Log message:
        Adding a new way to return branches to the template as requested by
        owen. I preserved the old method so that paul can decide whether to
        switch default templates or not.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/opac/opac-search.pl.diff?only_with_tag=rel_2_2&tr1=1.21.2.15&tr2=1.21.2.16&r1=text&r2=text

Patches:
Index: koha/opac/opac-search.pl
diff -u koha/opac/opac-search.pl:1.21.2.15 koha/opac/opac-search.pl:1.21.2.16
--- koha/opac/opac-search.pl:1.21.2.15  Wed Mar  8 13:46:55 2006
+++ koha/opac/opac-search.pl    Wed Mar  8 18:49:51 2006
@@ -11,6 +11,7 @@
 use C4::SearchMarc;
 use C4::Acquisition;
 use C4::Biblio;
+use C4::Koha;
 # use C4::Search;
 
 my $classlist='';
@@ -177,7 +178,7 @@
        my  @itemtype;
        my %itemtypes;
        push @itemtype, "";
-       $itemtypes{''} = "";
+       $itemtypes{''} = "Any Document Type";
        while (my ($value,$lib) = $sth->fetchrow_array) {
                push @itemtype, $value;
                $itemtypes{$value}=$lib;
@@ -189,26 +190,41 @@
                                -size     => 1,
                                -multiple => 0 );
        $sth->finish;
-       
-       my @branches;
-       my @select_branch;
-       my %select_branches;
-       my ($count2,@branches)=branches();
-       push @select_branch, "";
-       $select_branches{''} = "";
-       for (my $i=0;$i<$count2;$i++){
-               push @select_branch, $branches[$i]->{'branchcode'};#
-               $select_branches{$branches[$i]->{'branchcode'}} = 
$branches[$i]->{'branchname'};
+
+       my @oldbranches;
+       my @oldselect_branch;
+       my %oldselect_branches;
+       my ($oldcount2,@oldbranches)=branches();
+       push @oldselect_branch, "";
+       $oldselect_branches{''} = "";
+       for (my $i=0;$i<$oldcount2;$i++){
+               push @oldselect_branch, $oldbranches[$i]->{'branchcode'};#
+               $oldselect_branches{$oldbranches[$i]->{'branchcode'}} = 
$oldbranches[$i]->{'branchname'};
        }
        my $CGIbranch=CGI::scrolling_list( -name     => 'value',
-                               -values   => address@hidden,
-                               -labels   => \%select_branches,
+                               -values   => address@hidden,
+                               -labels   => \%oldselect_branches,
                                -size     => 1,
                                -multiple => 0 );
        $sth->finish;
-    
+
+       my @branches;
+       my @select_branch;
+       my %select_branches;
+       my $branches = getallbranches();
+       my @branchloop;
+       foreach my $thisbranch (keys %$branches) {
+        my $selected = 1 if (C4::Context->userenv && ($thisbranch eq 
C4::Context->userenv->{branch}));
+        my %row =(value => $thisbranch,
+                                selected => $selected,
+                                branchname => 
$branches->{$thisbranch}->{'branchname'},
+                        );
+        push @branchloop, \%row;
+       }
+ 
        
$template->param('Disable_Dictionary'=>C4::Context->preference("Disable_Dictionary"))
 if (C4::Context->preference("Disable_Dictionary"));
        $template->param(classlist => $classlist,
+                                       branchloop=>address@hidden,
                                        CGIitemtype => $CGIitemtype,
                                        CGIbranch => $CGIbranch,
                                        suggestion => 
C4::Context->preference("suggestion"),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]