One can search on only one limit (for instance : Get ALL Documents from ONE branch)
Sorting branches for results. Signed-off-by: Chris Cormack <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
230d8a902e
commit
46984721c5
20
C4/Search.pm
20
C4/Search.pm
|
|
@ -248,7 +248,7 @@ sub getRecords {
|
|||
$expanded_facet, $branches, $query_type,
|
||||
$scan
|
||||
) = @_;
|
||||
warn "Query : $koha_query";
|
||||
# warn "Query : $koha_query";
|
||||
my @servers = @$servers_ref;
|
||||
my @sort_by = @$sort_by_ref;
|
||||
|
||||
|
|
@ -790,9 +790,9 @@ sub buildQuery {
|
|||
$human_search_desc =~ s/^ //g;
|
||||
my $koha_query = $query;
|
||||
|
||||
#warn "QUERY:".$koha_query;
|
||||
#warn "SEARCHDESC:".$human_search_desc;
|
||||
#warn "FEDERATED QUERY:".$federated_query;
|
||||
# warn "QUERY:".$koha_query;
|
||||
# warn "SEARCHDESC:".$human_search_desc;
|
||||
# warn "FEDERATED QUERY:".$federated_query;
|
||||
return ( undef, $human_search_desc, $koha_query, $federated_query );
|
||||
}
|
||||
|
||||
|
|
@ -971,16 +971,14 @@ sub searchResults {
|
|||
|
||||
# Last resort
|
||||
elsif ( $item->{'holdingbranch'} ) {
|
||||
$items->{ $item->{'homebranch'} }->{count}++;
|
||||
$items->{ $item->{'holdingbranch'} }->{count}++;
|
||||
}
|
||||
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{itemcallnumber} = $item->{itemcallnumber};
|
||||
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{location} = $item->{location};
|
||||
$items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{branchcode} = $item->{homebranch};
|
||||
}
|
||||
} # notforloan, item level and biblioitem level
|
||||
for my $key ( keys %$items ) {
|
||||
|
||||
#warn "key: $key";
|
||||
for my $key ( sort keys %$items ) {
|
||||
my $this_item = {
|
||||
branchname => $branches{$items->{$key}->{branchcode}},
|
||||
branchcode => $items->{$key}->{branchcode},
|
||||
|
|
@ -1058,9 +1056,9 @@ sub searchResults {
|
|||
}
|
||||
|
||||
|
||||
=head2 EditBiblios
|
||||
=head2 ModBiblios
|
||||
|
||||
($countchanged,$listunchanged) = EditBiblios($listbiblios, $tagsubfield,$initvalue,$targetvalue,$test);
|
||||
($countchanged,$listunchanged) = ModBiblios($listbiblios, $tagsubfield,$initvalue,$targetvalue,$test);
|
||||
|
||||
this function changes all the values $initvalue in subfield $tag$subfield in any record in $listbiblios
|
||||
test parameter if set donot perform change to records in database.
|
||||
|
|
@ -1089,7 +1087,7 @@ $template->param(countchanged => $countchanged, loopunchanged=>$listunchanged);
|
|||
|
||||
=cut
|
||||
|
||||
sub EditBiblios{
|
||||
sub ModBiblios{
|
||||
my ($listbiblios,$tagsubfield,$initvalue,$targetvalue,$test)=@_;
|
||||
my $countmatched;
|
||||
my @unmatched;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ my ($template,$borrowernumber,$cookie);
|
|||
# decide which template to use
|
||||
my $template_name;
|
||||
my @params = $cgi->param("limit");
|
||||
if ((@params>1) || ($cgi->param("q")) ) {
|
||||
if ((@params>=1) || ($cgi->param("q")) ) {
|
||||
$template_name = 'catalogue/results.tmpl';
|
||||
}
|
||||
else {
|
||||
|
|
@ -215,7 +215,7 @@ query parser.
|
|||
my $branches = GetBranches();
|
||||
my @branch_loop;
|
||||
push @branch_loop, {value => "", branchname => "All Branches", };
|
||||
for my $branch_hash (keys %$branches) {
|
||||
for my $branch_hash (sort keys %$branches) {
|
||||
push @branch_loop, {value => "branch: $branch_hash", branchname => $branches->{$branch_hash}->{'branchname'}, };
|
||||
}
|
||||
$template->param(branchloop => \@branch_loop,);
|
||||
|
|
@ -397,7 +397,7 @@ if ($@ || $error) {
|
|||
my $op=$cgi->param("operation");
|
||||
if ($op eq "bulkedit"){
|
||||
my ($countchanged,$listunchanged)=
|
||||
EditBiblios($results_hashref->{'biblioserver'}->{"RECORDS"},
|
||||
ModBiblios($results_hashref->{'biblioserver'}->{"RECORDS"},
|
||||
$params->{"tagsubfield"},
|
||||
$params->{"inputvalue"},
|
||||
$params->{"targetvalue"},
|
||||
|
|
|
|||
Loading…
Reference in New Issue