From 3a64efa76b3afbcc8fa0a889429ed8268aa61b57 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 1 Dec 2005 15:31:57 +0000 Subject: [PATCH] adding filter on itemtype when searching a biblio when adding a subscription --- bull/subscription-bib-search.pl | 91 +------------------ .../intranet-tmpl/default/en/bull/search.tmpl | 10 ++ 2 files changed, 11 insertions(+), 90 deletions(-) diff --git a/bull/subscription-bib-search.pl b/bull/subscription-bib-search.pl index ca62bd5e09..3480b0d134 100755 --- a/bull/subscription-bib-search.pl +++ b/bull/subscription-bib-search.pl @@ -34,62 +34,10 @@ use C4::Acquisition; use C4::SearchMarc; use C4::Koha; # XXX subfield_is_koha_internal_p -# Creates the list of active tags using the active MARC configuration -sub create_marclist { - my $dbh = C4::Context->dbh; - my $tagslib = &MARCgettagslib($dbh,1); - my @marcarray; - push @marcarray,""; - my $widest_menu_item_width = 0; - for (my $pass = 1; $pass <= 2; $pass += 1) - { - for (my $tabloop = 0; $tabloop<=9;$tabloop++) - { - my $separator_inserted_p = 0; # FIXME... should not use!! - foreach my $tag (sort(keys (%{$tagslib}))) - { - foreach my $subfield (sort(keys %{$tagslib->{$tag}})) - { - next if subfield_is_koha_internal_p($subfield); - next unless ($tagslib->{$tag}->{$subfield}->{tab} eq $tabloop); - my $menu_item = "$tag$subfield - $tagslib->{$tag}->{$subfield}->{lib}"; - if ($pass == 1) - { - $widest_menu_item_width = length $menu_item if($widest_menu_item_width < length $menu_item); - } else { - if (!$separator_inserted_p) - { - my $w = int(($widest_menu_item_width - 3 + 0.5)/2); - my $s = ('-' x ($w * 4/5)); - push @marcarray, "$s $tabloop $s"; - $separator_inserted_p = 1; - } - push @marcarray, $menu_item; - } - } - } - } - } - return \@marcarray; -} # Creates a scrolling list with the associated default value. # Using more than one scrolling list in a CGI assigns the same default value to all the # scrolling lists on the page !?!? That's why this function was written. -sub create_scrolling_list { - my ($params) = @_; - my $scrollist = sprintf("\n"; - - return $scrollist; -} my $query=new CGI; my $type=$query->param('type'); @@ -209,23 +157,6 @@ if ($op eq "do_search") { flagsrequired => {catalogue => 1}, debug => 1, }); - #$template->param(loggedinuser => $loggedinuser); - - my $marcarray = create_marclist(); - - my $marclist = CGI::scrolling_list(-name=>"marclist", - -values=> $marcarray, - -size=>1, - -multiple=>0, - -onChange => "sql_update()", - ); - - my @statements = (); - - # Considering initial search with 3 criterias - push @statements, { "marclist" => $marclist, "first" => 1 }; - push @statements, { "marclist" => $marclist, "first" => 0 }; - push @statements, { "marclist" => $marclist, "first" => 0 }; my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description"); $sth->execute; my @itemtype; @@ -244,28 +175,8 @@ if ($op eq "do_search") { -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 $CGIbranch=CGI::scrolling_list( -name => 'value', - -values => \@select_branch, - -labels => \%select_branches, - -size => 1, - -multiple => 0 ); - $sth->finish; - - - $template->param("statements" => \@statements, - "nbstatements" => 3, + $template->param( CGIitemtype => $CGIitemtype, - CGIbranch => $CGIbranch, ); } diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl index fb9a57e1ff..8f4d8064dd 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl @@ -17,6 +17,16 @@

+

+ + + "> + + + + + "> +

Results per page :