[Koha-cvs] koha/opac opac-recacquisitions.pl opac-search.p... [dev_week]

Owen Leonard oleonard at athenscounty.lib.oh.us
Tue Oct 3 16:21:33 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Owen Leonard <oleonard>	06/10/03 14:21:33

Removed files:
	opac           : opac-recacquisitions.pl opac-search.pl 
	                 opac-searchresults.pl 

Log message:
	Removing unused search scripts and their templates

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-recacquisitions.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-search.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.21.2.17.2.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-searchresults.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.16.2.5&r2=0

Patches:
Index: opac-recacquisitions.pl
===================================================================
RCS file: opac-recacquisitions.pl
diff -N opac-recacquisitions.pl
--- opac-recacquisitions.pl	9 Feb 2006 16:47:29 -0000	1.1.2.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-#!/usr/bin/perl
-use strict;
-require Exporter;
-use CGI;
-use HTML::Template;
-
-use C4::Auth;       # get_template_and_user
-use C4::Acquisition;       # get_template_and_user
-use C4::Interface::CGI::Output;
-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 Document Type";
-while (my ($value,$lib) = $sth->fetchrow_array) {
-	push @itemtype, $value;
-	$itemtypes{$value}=$lib;
-}
-
-my $CGIitemtype=CGI::scrolling_list( -name     => 'value',
-			-values   => \@itemtype,
-			-labels   => \%itemtypes,
-			-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;
-}
-
-
-
-# my $borrower = getmember('',$borrowernumber);
-my @options;
-my $counter=0;
-$template->param(CGIitemtype => $CGIitemtype,
-				branchloop=>\@branchloop
-);
-output_html_with_http_headers $input, $cookie, $template->output;

Index: opac-search.pl
===================================================================
RCS file: opac-search.pl
diff -N opac-search.pl
--- opac-search.pl	21 Jul 2006 17:46:48 -0000	1.21.2.17.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,237 +0,0 @@
-#!/usr/bin/perl
-use strict;
-require Exporter;
-
-use C4::Auth;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use CGI;
-use C4::Database;
-use HTML::Template;
-use C4::Search;
-use C4::Acquisition;
-use C4::Biblio;
-use C4::Koha;
-# use C4::Search;
-
-my $classlist='';
-
-my $dbh=C4::Context->dbh;
-my $sth=$dbh->prepare("select description,itemtype from itemtypes order by description");
-$sth->execute;
-while (my ($description,$itemtype) = $sth->fetchrow) {
-    $classlist.="<option value=\"$itemtype\">$description</option>\n";
-}
-
-
-my $query = new CGI;
-my $op = $query->param("op");
-my $type=$query->param('type');
-
-my $startfrom=$query->param('startfrom');
-$startfrom=0 if(!defined $startfrom);
-my ($template, $loggedinuser, $cookie);
-my $resultsperpage;
-my $searchdesc;
-
-if ($op eq "do_search") {
-	my @marclist = $query->param('marclist');
-	my @and_or = $query->param('and_or');
-	my @excluding = $query->param('excluding');
-	my @operator = $query->param('operator');
-	my @value = $query->param('value');
-	my $orderby = $query->param('orderby');
-	my $desc_or_asc = $query->param('desc_or_asc');
-	my $exactsearch = $query->param('exact');
-	for (my $i=0;$i<=$#marclist;$i++) {
-
-		if ($marclist[$i] eq "biblioitems.isbn") {
-			$value[$i] =~ s/-//g;
-		}
-                if ($searchdesc) { # don't put the and_or on the 1st search term
-                        $searchdesc .= $and_or[$i].$excluding[$i]." ".($marclist[$i]?$marclist[$i]:"* ")." ".$operator[$i]." ".$value[$i]." " if ($value[$i]);
-                } else {                        $searchdesc = $excluding[$i].($marclist[$i]?$marclist[$i]:"* ")." ".$operator[$i]." ".$value[$i]." " if ($value[$i]);
-                }
-        }
-	
-	$resultsperpage= $query->param('resultsperpage');
-	$resultsperpage = 19 if(!defined $resultsperpage);
-	
-	if ($exactsearch) {
-		foreach (@operator) {
-			$_='=';
-		}
-	}
-	# builds tag and subfield arrays
-	my @tags;
-
-	foreach my $marc (@marclist) {
-		if ($marc) {
-			my ($tag,$subfield) = MARCfind_marc_from_kohafield($dbh,$marc,'');
-			if ($tag) {
-				push @tags,$dbh->quote("$tag$subfield");
-			} else {
-				push @tags, $dbh->quote(substr($marc,0,4));
-			}
-		} else {
-			push @tags, "";
-		}
-	}
-	findseealso($dbh,\@tags);
-	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
-										\@excluding, \@operator, \@value,
-										$startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc);
-	if ($total ==1) {
-	if (C4::Context->preference("BiblioDefaultView") eq "normal") {
-	     print $query->redirect("/cgi-bin/koha/opac-detail.pl?bib=".@$results[0]->{biblionumber});
-	} elsif (C4::Context->preference("BiblioDefaultView") eq "marc") {
-	     print $query->redirect("/cgi-bin/koha/opac-MARCdetail.pl?bib=".@$results[0]->{biblionumber});
-	} else {
-	     print $query->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?bib=".@$results[0]->{biblionumber});
-	}
-	exit;
-	}
-	($template, $loggedinuser, $cookie)
-		= get_template_and_user({template_name => "opac-searchresults.tmpl",
-				query => $query,
-				type => 'opac',
-				authnotrequired => 1,
-				debug => 1,
-				});
-
-	# multi page display gestion
-	my $displaynext=0;
-	my $displayprev=$startfrom;
-	if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){
-		$displaynext = 1;
-	}
-
-	my @field_data = ();
-
-
-	for(my $i = 0 ; $i <= $#marclist ; $i++)
-	{
-		push @field_data, { term => "marclist", val=>$marclist[$i] };
-		push @field_data, { term => "and_or", val=>$and_or[$i] };
-		push @field_data, { term => "excluding", val=>$excluding[$i] };
-		push @field_data, { term => "operator", val=>$operator[$i] };
-		push @field_data, { term => "value", val=>$value[$i] };
-	}
-	push @field_data, {term => "desc_or_asc", val => $desc_or_asc} if $desc_or_asc;
-	push @field_data, {term => "orderby", val => $orderby} if $orderby;
-	my @numbers = ();
-
-	if ($total>$resultsperpage)
-	{
-		for (my $i=1; $i<$total/$resultsperpage+1; $i++)
-		{
-			if ($i<16)
-			{
-	    		my $highlight=0;
-	    		($startfrom==($i-1)) && ($highlight=1);
-	    		push @numbers, { number => $i,
-					highlight => $highlight ,
-					searchdata=> \@field_data,
-					startfrom => ($i-1)};
-			}
-    	}
-	}
-
-	my $from = $startfrom*$resultsperpage+1;
-	my $to;
-
- 	if($total < (($startfrom+1)*$resultsperpage))
-	{
-		$to = $total;
-	} else {
-		$to = (($startfrom+1)*$resultsperpage);
-	}
-	my $defaultview = 'BiblioDefaultView'.C4::Context->preference('BiblioDefaultView');
-	$template->param(results => $results,
-							startfrom=> $startfrom,
-							displaynext=> $displaynext,
-							displayprev=> $displayprev,
-							resultsperpage => $resultsperpage,
-							orderby => $orderby,
-							startfromnext => $startfrom+1,
-							startfromprev => $startfrom-1,
-							searchdata=>\@field_data,
-							total=>$total,
-							from=>$from,
-							to=>$to,
-							numbers=>\@numbers,
-							searchdesc=> $searchdesc,
-							$defaultview => 1,
-							);
-
-} else {
-	($template, $loggedinuser, $cookie)
-		= get_template_and_user({template_name => "opac-search.tmpl",
-					query => $query,
-					type => "opac",
-					authnotrequired => 1,
-				});
-	
-	
-	my $query="Select itemtype,description from itemtypes order by description";
-	my $sth=$dbh->prepare($query);
-	$sth->execute;
-	my  @itemtypeloop;
-	my %itemtypes;
-	while (my ($value,$lib) = $sth->fetchrow_array) {
-		my %row =(	value => $value,
-					description => $lib,
-				);
-		push @itemtypeloop, \%row;
-	}
-	$sth->finish;
-
-	my @oldbranches;
-	my @oldselect_branch;
-	my %oldselect_branches;
-	my ($oldcount2, at 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   => \@oldselect_branch,
-				-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=>\@branchloop,
-				itemtypeloop => \@itemtypeloop,
-				CGIbranch => $CGIbranch,
-				suggestion => C4::Context->preference("suggestion"),
-				virtualshelves => C4::Context->preference("virtualshelves"),
-				LibraryName => C4::Context->preference("LibraryName"),
-				OpacNav => C4::Context->preference("OpacNav"),
-				opaccredits => C4::Context->preference("opaccredits"),
-				AmazonContent => C4::Context->preference("AmazonContent"),
-				opacsmallimage => C4::Context->preference("opacsmallimage"),
-				opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
-				opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
-	);
-}
-
-output_html_with_http_headers $query, $cookie, $template->output;

Index: opac-searchresults.pl
===================================================================
RCS file: opac-searchresults.pl
diff -N opac-searchresults.pl
--- opac-searchresults.pl	8 Mar 2006 13:46:55 -0000	1.16.2.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,127 +0,0 @@
-#!/usr/bin/perl
-use strict;
-require Exporter;
-use CGI;
-use C4::Search;
-use C4::Auth;
-use C4::Interface::CGI::Output;
-use HTML::Template;
-
-my $query=new CGI;
-
-my ($template, $borrowernumber, $cookie)
-    = get_template_and_user({template_name => "opac-searchresults.tmpl",
-			     query => $query,
-			     type => "opac",
-			     authnotrequired => 1,
-			 });
-
-
-my $subject=$query->param('subject');
-
-
-
-if ($subject) {
-    $template->param(subjectsearch => $subject);
-}
-
-# get all the search variables
-# we assume that C4::Search will validate these values for us
-my @fields = ('keyword', 'subject', 'author', 'illustrator', 'itemnumber', 'isbn', 'date-before', 'date-after', 'class', 'dewey', 'branch', 'title', 'abstract', 'publisher');
-
-# collect all the fields ...
-my %search;
-
-my $forminputs;
-my $searchdesc = '';
-foreach my $field (@fields) {
-    $search{$field} = $query->param($field);
-    if ($field eq 'keyword'){
-	$search{$field} = $query->param('words') unless $search{$field};
-    }
-    if ($search{$field}) {
-	push @$forminputs, {field => $field, value => $search{$field}};
-	$searchdesc .= "$field = $search{$field}, ";
-    }
-}
-
-$search{'ttype'} = $query->param('ttype');
-push @$forminputs, {field => 'ttype', value => $search{'ttype'}};
-
-if (my $subjectitems=$query->param('subjectitems')){
-    $search{'subject'} = $subjectitems;
-    $searchdesc.="subject = $subjectitems, ";
-}
-
-@$forminputs=() unless $forminputs;
-$template->param(FORMINPUTS => $forminputs);
-
-# do the searchs ....
-my $env;
-$env->{itemcount}=1;
-my $number_of_results = 20;
-my @results;
-my $count;
-my $startfrom = $query->param('startfrom');
-my $subjectitems=$query->param('subjectitems');
-if ($subjectitems) {
-    #@results = subsearch($env,$subjectitems, $number_of_results, $startfrom);
-    @results = subsearch($env, $subjectitems);
-    $count = $#results+1;
-} else {
-    ($count, @results) = catalogsearch($env,'',\%search,$number_of_results,$startfrom);
-}
-
-my $num = 1;
-foreach my $res (@results) {
-    my @items = ItemInfo(undef, $res->{'biblionumber'}, "intra");
-    my $norequests = 1;
-    foreach my $itm (@items) {
-	$norequests = 0 unless $itm->{'notforloan'};
-    }
-    $res->{'norequests'} = $norequests;
-    # set up the even odd elements....
-    $res->{'even'} = 1 if $num % 2 == 0;
-    $res->{'odd'} = 1 if $num % 2 == 1;
-    $num++;
-}
-
-
-my $startfrom=$query->param('startfrom');
-($startfrom) || ($startfrom=0);
-
-my $resultsarray=\@results;
-($resultsarray) || (@$resultsarray=());
-
-
-# sorting out which results to display.
-$template->param(startfrom => $startfrom+1);
-($startfrom+$num<=$count) ? ($template->param(endat => $startfrom+$num)) : ($template->param(endat => $count));
-$template->param(numrecords => $count);
-my $nextstartfrom=($startfrom+$num<$count) ? ($startfrom+$num) : (-1);
-my $prevstartfrom=($startfrom-$num>=0) ? ($startfrom-$number_of_results) : (-1);
-$template->param(nextstartfrom => $nextstartfrom);
-my $displaynext=($nextstartfrom==-1) ? 0 : 1;
-my $displayprev=($prevstartfrom==-1) ? 0 : 1;
-$template->param(displaynext => $displaynext);
-$template->param(displayprev => $displayprev);
-$template->param(prevstartfrom => $prevstartfrom);
-
-$template->param(searchdesc => $searchdesc);
-$template->param(SEARCH_RESULTS => $resultsarray);
-
-my $numbers;
-@$numbers = ();
-if ($count>$number_of_results) {
-    for (my $i=1; $i<$count/$number_of_results+1; $i++) {
-	my $highlight=0;
-	my $themelang = $template->param('themelang');
-	($startfrom==($i-1)*$number_of_results+1) && ($highlight=1);
-	push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*$number_of_results+1 };
-    }
-}
-
-$template->param(numbers => $numbers,
-);
-
-output_html_with_http_headers $query, $cookie, $template->output;





More information about the Koha-cvs mailing list