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

(-)a/C4/Search.pm (-6 / +29 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;
1428
              if ( C4::Context->preference("searchMyLibraryOnly")  )
1429
           {
1430
            $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches WHERE branchcode = '". C4::Branch::mybranch() ."' "); # FIXME : use C4::Branch::GetBranches
1431
            }
1432
            else
1433
            {
1434
             $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches ");                
1435
            }
1427
    $bsth->execute();
1436
    $bsth->execute();
1428
    while ( my $bdata = $bsth->fetchrow_hashref ) {
1437
    while ( my $bdata = $bsth->fetchrow_hashref ) {
1429
        $branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'};
1438
        $branches{ $bdata->{'branchcode'} } = $bdata->{'branchname'};
Lines 1671-1677 sub searchResults { Link Here
1671
		    ($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber});
1680
		    ($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber});
1672
                }
1681
                }
1673
1682
1674
                # item is withdrawn, lost, damaged, not for loan, reserved or in transit
1683
                # item is withdrawn, lost or damaged
1675
                if (   $item->{wthdrawn}
1684
                if (   $item->{wthdrawn}
1676
                    || $item->{itemlost}
1685
                    || $item->{itemlost}
1677
                    || $item->{damaged}
1686
                    || $item->{damaged}
Lines 1686-1693 sub searchResults { Link Here
1686
                    $item_in_transit_count++ if $transfertwhen ne '';
1695
                    $item_in_transit_count++ if $transfertwhen ne '';
1687
		    $item_onhold_count++     if $reservestatus eq 'Waiting';
1696
		    $item_onhold_count++     if $reservestatus eq 'Waiting';
1688
                    $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
1697
                    $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
1689
                    
1698
1690
                    # can place hold on item ?
1699
 # can place hold on item ?
1691
                    if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems'))
1700
                    if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems'))
1692
                      && !$item->{itemlost}
1701
                      && !$item->{itemlost}
1693
                      && !$item->{withdrawn}
1702
                      && !$item->{withdrawn}
Lines 1695-1700 sub searchResults { Link Here
1695
                        $can_place_holds = 1;
1704
                        $can_place_holds = 1;
1696
                    }
1705
                    }
1697
                    
1706
                    
1707
1698
                    $other_count++;
1708
                    $other_count++;
1699
1709
1700
                    my $key = $prefix . $item->{status};
1710
                    my $key = $prefix . $item->{status};
Lines 2599-2607 $template->param ( MYLOOP => C4::Search::z3950_search_args($searchscalar) ) Link Here
2599
2609
2600
=cut
2610
=cut
2601
2611
2612
2613
2614
2602
sub z3950_search_args {
2615
sub z3950_search_args {
2603
    my $bibrec = shift;
2616
    my $bibrec = shift;
2604
    $bibrec = { title => $bibrec } if !ref $bibrec;
2617
    my $isbn = Business::ISBN->new($bibrec); 
2618
 
2619
    if (defined $isbn && $isbn->is_valid)
2620
    {
2621
    $bibrec = { isbn => $bibrec } if !ref $bibrec;
2622
}
2623
else {
2624
     $bibrec = { title => $bibrec } if !ref $bibrec;
2625
}
2605
    my $array = [];
2626
    my $array = [];
2606
    for my $field (qw/ lccn isbn issn title author dewey subject /)
2627
    for my $field (qw/ lccn isbn issn title author dewey subject /)
2607
    {
2628
    {
Lines 2641-2646 OR adds a new authority record Link Here
2641
=cut
2662
=cut
2642
2663
2643
2664
2665
2666
2667
2644
sub BiblioAddAuthorities{
2668
sub BiblioAddAuthorities{
2645
  my ( $record, $frameworkcode ) = @_;
2669
  my ( $record, $frameworkcode ) = @_;
2646
  my $dbh=C4::Context->dbh;
2670
  my $dbh=C4::Context->dbh;
2647
- 

Return to bug 6539