koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha koha-tmpl/opac-tmpl/css/en/opac-recacquisi... [rel_2_2]


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha koha-tmpl/opac-tmpl/css/en/opac-recacquisi... [rel_2_2]
Date: Mon, 06 Feb 2006 13:56:22 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Henri-Damien LAURENT <address@hidden>   06/02/06 13:56:22

Modified files:
        koha-tmpl/opac-tmpl/css/en: opac-recacquisitions.tmpl 
        opac           : opac-recacquisitions.pl 

Log message:
        Adding branch selection for recent acquisitions in a new page
        Something will have be done about CGI controls in order to make them 
more multilanguage compliant (itemtype should be coped on the same basis as 
branches).
        There is a bug to be fixed in opac-search results... forgetting the 
recent acquisition parameters when changing page.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/opac-tmpl/css/en/opac-recacquisitions.tmpl.diff?only_with_tag=rel_2_2&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/opac/opac-recacquisitions.pl.diff?only_with_tag=rel_2_2&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text

Patches:
Index: koha/koha-tmpl/opac-tmpl/css/en/opac-recacquisitions.tmpl
diff -u koha/koha-tmpl/opac-tmpl/css/en/opac-recacquisitions.tmpl:1.1.2.1 
koha/koha-tmpl/opac-tmpl/css/en/opac-recacquisitions.tmpl:1.1.2.2
--- koha/koha-tmpl/opac-tmpl/css/en/opac-recacquisitions.tmpl:1.1.2.1   Fri Feb 
 3 16:31:54 2006
+++ koha/koha-tmpl/opac-tmpl/css/en/opac-recacquisitions.tmpl   Mon Feb  6 
13:56:22 2006
@@ -6,23 +6,28 @@
 <form name="f" method="post" action="/cgi-bin/koha/opac-search.pl">
        
        <div id="bloc60">
-                       <!-- TMPL_VAR name="CGIbranch" --> 
-                       <input type="hidden" name="marclist" 
value="items.homebranch" />
+                       <!-- TMPL_VAR name="CGIitemtype" --> 
+                       <input type="hidden" name="marclist" 
value="biblioitems.itemtype" />
                        <input type="hidden" name="and_or" value="and" />
                        <input type="hidden" name="excluding" value="" />
                        <input type="hidden" name="operator" value="=" />
                        <input type="hidden" name="op" value="do_search" />
                        <input type="hidden" name="type" value="opac" />
-                       <!-- TMPL_VAR name="CGIitemtype" --> 
-                       <input type="hidden" name="marclist" 
value="biblioitems.itemtype" />
+                       acquired by
+                        <select name="branch">
+                                <option value="">Any Branch</option>
+                        <!-- TMPL_LOOP name="branchloop" -->
+                                <option value="<!-- TMPL_VAR name="value" -->" 
<!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name
+="branchname" --></option>
+                        <!-- /TMPL_LOOP -->
+                        </select>
+                       <input type="hidden" name="marclist" 
value="items.homebranch" />
                        <input type="hidden" name="and_or" value="and" />
                        <input type="hidden" name="excluding" value="" />
                        <input type="hidden" name="operator" value="=" />
                        <input type="hidden" name="op" value="do_search" />
                        <input type="hidden" name="type" value="opac" />
-                       acquired in the last
-                       <input type="text" name="desc_or_asc" size="3" />
-                       days
+                       in the last <input type="text" name="desc_or_asc" 
size="3" /> days
                        <input type="hidden" name="orderby" 
value="biblio.timestamp" />
                        <input type="submit" value="OK" class="button" />
        </div>
Index: koha/opac/opac-recacquisitions.pl
diff -u koha/opac/opac-recacquisitions.pl:1.1.2.1 
koha/opac/opac-recacquisitions.pl:1.1.2.2
--- koha/opac/opac-recacquisitions.pl:1.1.2.1   Fri Feb  3 16:31:54 2006
+++ koha/opac/opac-recacquisitions.pl   Mon Feb  6 13:56:22 2006
@@ -10,12 +10,21 @@
 use C4::Koha;
 
 my $input = new CGI;
+my ($template, $borrowernumber, $cookie)
+    = get_template_and_user({template_name => "opac-recacquisitions.tmpl",
+                            type => "opac",
+                            query => $input,
+                            authnotrequired => 1,
+                            flagsrequired => {borrow => 1},
+                        });
 my $dbh = C4::Context->dbh;
 my $query="Select itemtype,description from itemtypes order by description";
 my $sth=$dbh->prepare($query);
 $sth->execute;
 my  @itemtype;
 my %itemtypes;
+push @itemtype, "";
+$itemtypes{''}="Any doc Type";
 while (my ($value,$lib) = $sth->fetchrow_array) {
        push @itemtype, $value;
        $itemtypes{$value}=$lib;
@@ -31,32 +40,23 @@
 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 $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;
 }
-my $CGIbranch=CGI::scrolling_list( -name     => 'value',
-                                               -values   => address@hidden,
-                                               -labels   => \%select_branches,
-                                               -size     => 1,
-                                               -multiple => 0 );
-$sth->finish;
 
 
-my ($template, $borrowernumber, $cookie)
-    = get_template_and_user({template_name => "opac-recacquisitions.tmpl",
-                            type => "opac",
-                            query => $input,
-                            authnotrequired => 1,
-                            flagsrequired => {borrow => 1},
-                        });
-my $borrower = getmember('',$borrowernumber);
+
+# my $borrower = getmember('',$borrowernumber);
 my @options;
 my $counter=0;
 $template->param(CGIitemtype => $CGIitemtype,
-                               CGIbranch=>$CGIbranch
+                               branchloop=>address@hidden
 );
 output_html_with_http_headers $input, $cookie, $template->output;




reply via email to

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