View | Details | Raw Unified | Return to bug 6539
Collapse All | Expand All

(-)a/C4/Search.pm (-6 / +21 lines)
Lines 33-38 use C4::Debug; Link Here
33
use C4::Items;
33
use C4::Items;
34
use YAML;
34
use YAML;
35
use URI::Escape;
35
use URI::Escape;
36
use Business::ISBN;
36
37
37
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
38
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
38
39
Lines 1423-1429 sub searchResults { Link Here
1423
    #find branchname
1424
    #find branchname
1424
    #get branch information.....
1425
    #get branch information.....
1425
    my %branches;
1426
    my %branches;
1426
    my $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches"); # FIXME : use C4::Branch::GetBranches
1427
    my $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches ");                
1427
    $bsth->execute();
1428
    $bsth->execute();
1428
    while ( my $bdata = $bsth->fetchrow_hashref ) {
1429
    while ( my $bdata = $bsth->fetchrow_hashref ) {
1429
        $branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'};
1430
        $branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'};
Lines 1671-1677 sub searchResults { Link Here
1671
		    ($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber});
1672
		    ($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber});
1672
                }
1673
                }
1673
1674
1674
                # item is withdrawn, lost, damaged, not for loan, reserved or in transit
1675
                # item is withdrawn, lost or damaged
1675
                if (   $item->{wthdrawn}
1676
                if (   $item->{wthdrawn}
1676
                    || $item->{itemlost}
1677
                    || $item->{itemlost}
1677
                    || $item->{damaged}
1678
                    || $item->{damaged}
Lines 1686-1693 sub searchResults { Link Here
1686
                    $item_in_transit_count++ if $transfertwhen ne '';
1687
                    $item_in_transit_count++ if $transfertwhen ne '';
1687
		    $item_onhold_count++     if $reservestatus eq 'Waiting';
1688
		    $item_onhold_count++     if $reservestatus eq 'Waiting';
1688
                    $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
1689
                    $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
1689
                    
1690
1690
                    # can place hold on item ?
1691
 # can place hold on item ?
1691
                    if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems'))
1692
                    if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems'))
1692
                      && !$item->{itemlost}
1693
                      && !$item->{itemlost}
1693
                      && !$item->{withdrawn}
1694
                      && !$item->{withdrawn}
Lines 1695-1700 sub searchResults { Link Here
1695
                        $can_place_holds = 1;
1696
                        $can_place_holds = 1;
1696
                    }
1697
                    }
1697
                    
1698
                    
1699
1698
                    $other_count++;
1700
                    $other_count++;
1699
1701
1700
                    my $key = $prefix . $item->{status};
1702
                    my $key = $prefix . $item->{status};
Lines 2599-2607 $template->param ( MYLOOP => C4::Search::z3950_search_args($searchscalar) ) Link Here
2599
2601
2600
=cut
2602
=cut
2601
2603
2604
2605
2606
2602
sub z3950_search_args {
2607
sub z3950_search_args {
2603
    my $bibrec = shift;
2608
    my $bibrec = shift;
2604
    $bibrec = { title => $bibrec } if !ref $bibrec;
2609
    my $isbn = Business::ISBN->new($bibrec); 
2610
 
2611
    if (defined $isbn && $isbn->is_valid)
2612
    {
2613
    $bibrec = { isbn => $bibrec } if !ref $bibrec;
2614
}
2615
else {
2616
     $bibrec = { title => $bibrec } if !ref $bibrec;
2617
}
2605
    my $array = [];
2618
    my $array = [];
2606
    for my $field (qw/ lccn isbn issn title author dewey subject /)
2619
    for my $field (qw/ lccn isbn issn title author dewey subject /)
2607
    {
2620
    {
Lines 2641-2646 OR adds a new authority record Link Here
2641
=cut
2654
=cut
2642
2655
2643
2656
2657
2658
2659
2644
sub BiblioAddAuthorities{
2660
sub BiblioAddAuthorities{
2645
  my ( $record, $frameworkcode ) = @_;
2661
  my ( $record, $frameworkcode ) = @_;
2646
  my $dbh=C4::Context->dbh;
2662
  my $dbh=C4::Context->dbh;
2647
- 

Return to bug 6539