&AddSearchHistory
&GetDistinctValues
&enabled_staff_search_views
+ &SimpleSearch
);
# make all your functions, whether exported or not;
warn "QUERY BEFORE LIMITS: >$query<" if $DEBUG;
# add limits
- my $group_OR_limits;
+ my %group_OR_limits;
my $availability_limit;
foreach my $this_limit (@limits) {
if ( $this_limit =~ /available/ ) {
# group_OR_limits, prefixed by mc-
# OR every member of the group
elsif ( $this_limit =~ /mc/ ) {
-
- if ( $this_limit =~ /mc-ccode:/ ) {
+ my ($k,$v) = split(/:/, $this_limit,2);
+ if ( $k !~ /mc-i(tem)?type/ ) {
# in case the mc-ccode value has complicating chars like ()'s inside it we wrap in quotes
$this_limit =~ tr/"//d;
- my ($k,$v) = split(/:/, $this_limit,2);
$this_limit = $k.":\"".$v."\"";
}
- $group_OR_limits .= " or " if $group_OR_limits;
- $limit_desc .= " or " if $group_OR_limits;
- $group_OR_limits .= "$this_limit";
+ $group_OR_limits{$k} .= " or " if $group_OR_limits{$k};
+ $limit_desc .= " or " if $group_OR_limits{$k};
+ $group_OR_limits{$k} .= "$this_limit";
$limit_cgi .= "&limit=$this_limit";
$limit_desc .= " $this_limit";
}
}
}
}
- if ($group_OR_limits) {
+ foreach my $k (keys (%group_OR_limits)) {
$limit .= " and " if ( $query || $limit );
- $limit .= "($group_OR_limits)";
+ $limit .= "($group_OR_limits{$k})";
}
if ($availability_limit) {
$limit .= " and " if ( $query || $limit );
foreach my $code ( keys %subfieldstosearch ) {
$item->{$code} = $field->subfield( $subfieldstosearch{$code} );
}
+ $item->{description} = $itemtypes{ $item->{itype} }{description};
# Hidden items
if ($is_opac) {
$onloan_items->{$key}->{branchname} = $item->{branchname};
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} };
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber};
+ $onloan_items->{$key}->{description} = $item->{description};
$onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} );
# if something's checked out and lost, mark it as 'long overdue'
if ( $item->{itemlost} ) {
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value;
$other_items->{$key}->{count}++ if $item->{$hbranch};
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} };
+ $other_items->{$key}->{description} = $item->{description};
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} );
}
# item is available
$can_place_holds = 1;
$available_count++;
$available_items->{$prefix}->{count}++ if $item->{$hbranch};
- foreach (qw(branchname itemcallnumber hideatopac)) {
+ foreach (qw(branchname itemcallnumber hideatopac description)) {
$available_items->{$prefix}->{$_} = $item->{$_};
}
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };