koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha C4/Auth.pm C4/Search.pm koha-tmpl/opac-tmp... [dev_week]


From: Joshua Ferraro
Subject: [Koha-cvs] koha C4/Auth.pm C4/Search.pm koha-tmpl/opac-tmp... [dev_week]
Date: Mon, 24 Jul 2006 05:26:19 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Joshua Ferraro <kados>  06/07/24 05:26:19

Modified files:
        C4             : Auth.pm Search.pm 
        koha-tmpl/opac-tmpl/npl/en/includes: doc-head-close.inc 
                                             navigation.inc 
        opac           : opac-zoomsearch.pl 

Log message:
        clean up on faceted results

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Auth.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.36.2.18.2.3&r2=1.36.2.18.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.99.2.11.2.11&r2=1.99.2.11.2.12
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/includes/doc-head-close.inc?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.11.2.1&r2=1.1.2.11.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/includes/navigation.inc?cvsroot=koha&only_with_tag=dev_week&r1=1.2.2.4.2.5&r2=1.2.2.4.2.6
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-zoomsearch.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.14&r2=1.1.2.15

Patches:
Index: C4/Auth.pm
===================================================================
RCS file: /sources/koha/koha/C4/Auth.pm,v
retrieving revision 1.36.2.18.2.3
retrieving revision 1.36.2.18.2.4
diff -u -b -r1.36.2.18.2.3 -r1.36.2.18.2.4
--- C4/Auth.pm  23 Jul 2006 22:25:38 -0000      1.36.2.18.2.3
+++ C4/Auth.pm  24 Jul 2006 05:26:19 -0000      1.36.2.18.2.4
@@ -219,7 +219,8 @@
                                TemplateEncoding => 
C4::Context->preference("TemplateEncoding"),
                                opacuserlogin => 
C4::Context->preference("opacuserlogin"),
                                opacbookbag => 
C4::Context->preference("opacbookbag"),
-                               facets => 
C4::Context->preference("default_facets"),
+                               default_facets => 
C4::Context->preference("default_facets"),
+                               opacfacets => 
C4::Context->preference("opacfacets"),
                );
        }
        $template->param(

Index: C4/Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.99.2.11.2.11
retrieving revision 1.99.2.11.2.12
diff -u -b -r1.99.2.11.2.11 -r1.99.2.11.2.12
--- C4/Search.pm        23 Jul 2006 22:25:38 -0000      1.99.2.11.2.11
+++ C4/Search.pm        24 Jul 2006 05:26:19 -0000      1.99.2.11.2.12
@@ -35,7 +35,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.99.2.11.2.11 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.99.2.11.2.12 $' =~ /\d+/g;
           shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -237,7 +237,6 @@
     for (my $i = 0 ; $i <= $#{$value} ; $i++) {
         $ccl_query.= @$value[$i];
     }
-    #warn "CCL: $ccl_query";
     my ($error,$count,$facets,@results) = 
searchZOOM('search','ccl',$ccl_query,$number_of_results,$startfrom,$then_sort_by);
 
     my @result = ();

Index: koha-tmpl/opac-tmpl/npl/en/includes/doc-head-close.inc
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/opac-tmpl/npl/en/includes/doc-head-close.inc,v
retrieving revision 1.1.2.11.2.1
retrieving revision 1.1.2.11.2.2
diff -u -b -r1.1.2.11.2.1 -r1.1.2.11.2.2
--- koha-tmpl/opac-tmpl/npl/en/includes/doc-head-close.inc      24 Jul 2006 
04:57:52 -0000      1.1.2.11.2.1
+++ koha-tmpl/opac-tmpl/npl/en/includes/doc-head-close.inc      24 Jul 2006 
05:26:19 -0000      1.1.2.11.2.2
@@ -22,97 +22,9 @@
        @import url(<!-- TMPL_VAR NAME="themelang" -->/includes/livesearch.css);
 </style>
 <!-- /TMPL_IF -->
-
-<!-- Tigra Menus -->
-<style type="text/css">
-.intd td {
-    padding: 0;
-}
-i_txt0_0 {
-       color: #000000;
-       font-size: 14px;
-}
-td .intd {
-       width: 100px; 
-}
-.intd table {
-    border-collapse: separate;
-       margin : 0;
-       padding : 0;
-}
-.ctrl {
-       padding:0;
-}
-</style>
-<script type="text/javascript" language="javascript" src="<!-- TMPL_VAR 
NAME="themelang" -->/includes/tigra/tree.js"></script>
-<script type="text/javascript" language="javascript" src="<!-- TMPL_VAR 
NAME="themelang" -->/includes/tigra/tree_tpl.js"></script>
-<script type="text/javascript" language="javascript">
-<!-- TMPL_IF NAME="total" -->
-var LIMITS_TREE = [
-['Further limit search to', null,
-
-               <!-- TMPL_IF NAME=branchloop -->
-               ['Branch', 'null',
-               <!-- TMPL_LOOP NAME=branchloop -->
-            ['<!-- TMPL_VAR NAME=branchname 
-->','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and branch=<!-- TMPL_VAR NAME=value -->'],
-            <!-- /TMPL_LOOP -->
-        ],
-        <!-- /TMPL_IF -->
-               <!-- TMPL_IF NAME=itemtypeloop -->
-               ['Collection Code', 'null',
-                       <!-- TMPL_LOOP NAME=itemtypeloop -->
-                       ['<!-- TMPL_VAR NAME=description 
-->','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and collection=<!-- TMPL_VAR NAME=value -->'],
-            <!-- /TMPL_LOOP -->
-               ],
-               <!-- /TMPL_IF -->
-                       
-               ['Format', 'null',
-                       ['Regular 
Print','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=a'],
-                       ['Large 
Print','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=b'],
-                       
['Braille','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=b'],
-                       
['Manuscript','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!--
 TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=a'],
-                       
['Microform','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!--
 TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=a'],
-                       ['CD 
Audio','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=a'],
-                       ['Cassette 
Recording','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=a'],
-                       ['LP 
Recording','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=t and 
material-designation=a'],
-                       ['Videocassette 
(VHS)','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=v and 
material-designation=f'],
-                       ['Videodisk 
(DVD)','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=v and 
material-designation=d'],
-                       ['CD-ROM 
(Computer)','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and material-category=c and 
material-designation=o'],
-               ],
-               ['Audience',    'null',
-                       
['Easy','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and (audience=a or audience=b)' ],
-                       
['Juvenile','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and (audience=j or audience=c)' ],
-                       ['Young 
Adult','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and audience=d' ],
-                       
['Adult','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and audience=e' ],
-               ],
-               ['Content',  'null',
-                       ['Fiction',''],
-                       ['Non-Fiction',''],
-                       ['Biography',''],
-                       ['Mystery',''],
-                       ['Thesis/Dissertation',''],
-                       ['Musical Recording',''],
-                       ['non-Musical Recording',''],
-               ],
-               ['Language', 'null',
-                       
['&#20013;&#25991;','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!--
 TMPL_VAR NAME=searchdesc --> and language=chi'],
-                       
['deutsch','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and language=ger'],
-                       
['english','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and language=eng'],
-                       
['espa&ntilde;ol','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!--
 TMPL_VAR NAME=searchdesc --> and language=spa'],
-                       
['fran&ccedil;ais','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!--
 TMPL_VAR NAME=searchdesc --> and language=fre'],
-                       
['italiano','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!-- 
TMPL_VAR NAME=searchdesc --> and language=ita'],
-                       
['&#26085;&#26412;&#35486;','/cgi-bin/koha/opac-zoomsearch.pl?op=get_results&amp;ccl_query=<!--
 TMPL_VAR NAME=searchdesc --> and language=jpn'],
-               ],
-
-       ],
-];
-<!-- TMPL_ELSE -->
-var LIMITS_TREE = '';
+<!-- TMPL_IF NAME="opacfacets" -->
+<!-- TMPL_INCLUDE NAME="opacfacets.inc" -->
 <!-- /TMPL_IF -->
-
-<!-- TMPL_VAR NAME="facets" -->
-</script>
-<!-- /Tigra -->
 <script language="javascript" type="text/javascript">
 function Help() {
        newin=window.open("/cgi-bin/koha/help.pl","Koha 
Help",'width=600,height=600,toolbar=false,scrollbars=yes');

Index: koha-tmpl/opac-tmpl/npl/en/includes/navigation.inc
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/opac-tmpl/npl/en/includes/navigation.inc,v
retrieving revision 1.2.2.4.2.5
retrieving revision 1.2.2.4.2.6
diff -u -b -r1.2.2.4.2.5 -r1.2.2.4.2.6
--- koha-tmpl/opac-tmpl/npl/en/includes/navigation.inc  24 Jul 2006 04:57:52 
-0000      1.2.2.4.2.5
+++ koha-tmpl/opac-tmpl/npl/en/includes/navigation.inc  24 Jul 2006 05:26:19 
-0000      1.2.2.4.2.6
@@ -17,7 +17,7 @@
 
 <div style="overflow: auto;" id="nav">
 <!-- TMPL_VAR NAME="OpacNav" -->
-<!-- TMPL_IF NAME="facets" -->
+<!-- TMPL_IF NAME="opacfacets" -->
     <!-- Sample -->
     <table style="width:18%; padding : 0; margin : 0;">
     <tr><td class="intd">

Index: opac/opac-zoomsearch.pl
===================================================================
RCS file: /sources/koha/koha/opac/Attic/opac-zoomsearch.pl,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -b -r1.1.2.14 -r1.1.2.15
--- opac/opac-zoomsearch.pl     23 Jul 2006 22:08:19 -0000      1.1.2.14
+++ opac/opac-zoomsearch.pl     24 Jul 2006 05:26:19 -0000      1.1.2.15
@@ -33,15 +33,72 @@
 
 my $query=new CGI;
 my $op = $query->param('op'); # show the search form or execute the search
+
+### Gather up all our search queries
+## CQL
 my $cql_query = $query->param('cql_query');
-my $ccl_query = $query->param('ccl_query');
+## CCL
+my @previous_ccl_queries; # array of hashes
+my @previous_ccl_queries_array = $query->param('previous_ccl_queries');
+my @ccl_query = $query->param('ccl_query');
+my $ccl_query;
+foreach my $ccl (@ccl_query) {
+       $ccl_query.=" $ccl";
+}
+my $flush_search_history = $query->param('flush_search_history');
+if ($flush_search_history) {
+       @previous_ccl_queries_array = 0;
+}
+else {
+       push @previous_ccl_queries_array, $ccl_query;
+}
+# put the queries in a form the template can use
+my $previous_ccl_queries_hash;
+foreach my $ccl (@previous_ccl_queries_array) {
+       $previous_ccl_queries_hash->{'ccl'} = $ccl if $ccl;
+       push @previous_ccl_queries, $previous_ccl_queries_hash->{'ccl'};
+}
+## PQF
 my $pqf_query = $query->param('pqf_query');
+
 my @newresults;
 my ($template,$borrowernumber,$cookie);
 my @forminputs;                # this is for the links to navigate among the 
results when they are more than the maximum number of results per page
 my $searchdesc; 
 my $search_type = $query->param('search_type');
 
+use C4::Koha;
+my $dbh = C4::Context->dbh;
+##Itemtypes (Collection Codes)
+my $itemtypequery="Select itemtype,description from itemtypes order by 
description";    my $sth=$dbh->prepare($itemtypequery);
+$sth->execute;
+my @itemtypeloop;
+my %itemtypes;
+while (my ($value,$lib) = $sth->fetchrow_array) {
+        my %row =(
+            value => $value,
+            description => $lib,
+            );
+        push @itemtypeloop, \%row;
+
+}
+$sth->finish;
+
+##Branches
+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;
+}
+
 ## Check if we're searching
 if ($op eq 'get_results') { # Yea, we're searching, load the results template
        ($template, $borrowernumber, $cookie)
@@ -117,9 +174,12 @@
        $template->param(FORMINPUTS => address@hidden);
        #$template->param(pqf_query => $pqf_query);
        $template->param(ccl_query => $ccl_query);
+       $searchdesc =~ s/\'/&apos;/g;
+       $searchdesc =~ s/\"/&quot;/g;
        $template->param(searchdesc => $searchdesc );
        $template->param(results_per_page =>  $number_of_results );
        $template->param(SEARCH_RESULTS => address@hidden);
+       $template->param(PREVIOUS_CCL_QUERIES => address@hidden);
        $template->param(facets => $facets);
 
        #this is to show the page numbers to navigate among the results, 
whether it has to show the number highlighted or not
@@ -248,7 +308,10 @@
                        $koha_spsuggest_sth->finish;
 
                        $template->param( koha_spsuggest => $koha_spsuggest ) 
unless $num;
-                       $template->param( SPELL_SUGGEST => address@hidden );
+                       $template->param( SPELL_SUGGEST => address@hidden,
+                                               branchloop=>address@hidden,
+                                                       
itemtypeloop=>address@hidden,
+                       );
                }
        }
        
@@ -267,42 +330,6 @@
                     authnotrequired => 1,
                 });
 
-       # pass on the query history
-       use C4::Koha;
-       my $dbh = C4::Context->dbh;
-##Itemtypes (Collection Codes)
-       my $itemtypequery="Select itemtype,description from itemtypes order by 
description";
-       my $sth=$dbh->prepare($itemtypequery);
-       $sth->execute;
-       my @itemtypeloop;
-       my %itemtypes;
-       while (my ($value,$lib) = $sth->fetchrow_array) {
-               my %row =(      
-                       value => $value,
-                       description => $lib,
-                       );
-               push @itemtypeloop, \%row;
-       
-       }
-       $sth->finish;
-
-##Branches
-       my @branches;
-       my @select_branch;
-       my %select_branches;
-       my $branches = getallbranches();
-       my @branchloop;
-       #push @branchloop, (value => "", selected => 1,branchname =>"");
-       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;
-       }
-
        # set the default tab, etc.
        my $search_type = $query->param('query_form');
        if ((!$search_type) || ($search_type eq 'advanced'))  {




reply via email to

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