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

(-)a/C4/Members.pm (-21 lines)
Lines 73-80 BEGIN { Link Here
73
        &GetAge
73
        &GetAge
74
        &GetTitles
74
        &GetTitles
75
75
76
        &GetHideLostItemsPreference
77
78
        &GetMemberAccountRecords
76
        &GetMemberAccountRecords
79
        &GetBorNotifyAcctRecord
77
        &GetBorNotifyAcctRecord
80
78
Lines 1281-1305 sub SetAge{ Link Here
1281
    return $borrower;
1279
    return $borrower;
1282
}    # sub SetAge
1280
}    # sub SetAge
1283
1281
1284
=head2 GetHideLostItemsPreference
1285
1286
  $hidelostitemspref = &GetHideLostItemsPreference($borrowernumber);
1287
1288
Returns the HideLostItems preference for the patron category of the supplied borrowernumber
1289
C<&$hidelostitemspref>return value of function, 0 or 1
1290
1291
=cut
1292
1293
sub GetHideLostItemsPreference {
1294
    my ($borrowernumber) = @_;
1295
    my $dbh = C4::Context->dbh;
1296
    my $query = "SELECT hidelostitems FROM borrowers,categories WHERE borrowers.categorycode = categories.categorycode AND borrowernumber = ?";
1297
    my $sth = $dbh->prepare($query);
1298
    $sth->execute($borrowernumber);
1299
    my $hidelostitems = $sth->fetchrow;    
1300
    return $hidelostitems;    
1301
}
1302
1303
=head2 GetBorrowersToExpunge
1282
=head2 GetBorrowersToExpunge
1304
1283
1305
  $borrowers = &GetBorrowersToExpunge(
1284
  $borrowers = &GetBorrowersToExpunge(
(-)a/C4/Search.pm (-2 / +3 lines)
Lines 26-38 use Koha::Libraries; Link Here
26
use Lingua::Stem;
26
use Lingua::Stem;
27
use C4::Search::PazPar2;
27
use C4::Search::PazPar2;
28
use XML::Simple;
28
use XML::Simple;
29
use C4::Members qw(GetHideLostItemsPreference);
30
use C4::XSLT;
29
use C4::XSLT;
31
use C4::Reserves;    # GetReserveStatus
30
use C4::Reserves;    # GetReserveStatus
32
use C4::Debug;
31
use C4::Debug;
33
use C4::Charset;
32
use C4::Charset;
34
use Koha::AuthorisedValues;
33
use Koha::AuthorisedValues;
35
use Koha::Libraries;
34
use Koha::Libraries;
35
use Koha::Patrons;
36
use YAML;
36
use YAML;
37
use URI::Escape;
37
use URI::Escape;
38
use Business::ISBN;
38
use Business::ISBN;
Lines 2080-2086 sub searchResults { Link Here
2080
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item
2080
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item
2081
            my $userenv = C4::Context->userenv;
2081
            my $userenv = C4::Context->userenv;
2082
            if ( $item->{onloan}
2082
            if ( $item->{onloan}
2083
                && !( C4::Members::GetHideLostItemsPreference( $userenv->{'number'} ) && $item->{itemlost} ) )
2083
                && $userenv
2084
                && !( Koha::Patrons->find($userenv->{number})->category->hidelostitems && $item->{itemlost} ) )
2084
            {
2085
            {
2085
                $onloan_count++;
2086
                $onloan_count++;
2086
                my $key = $prefix . $item->{onloan} . $item->{barcode};
2087
                my $key = $prefix . $item->{onloan} . $item->{barcode};
(-)a/catalogue/detail.pl (-1 / +3 lines)
Lines 42-47 use C4::HTML5Media; Link Here
42
use C4::CourseReserves qw(GetItemCourseReservesInfo);
42
use C4::CourseReserves qw(GetItemCourseReservesInfo);
43
use C4::Acquisition qw(GetOrdersByBiblionumber);
43
use C4::Acquisition qw(GetOrdersByBiblionumber);
44
use Koha::AuthorisedValues;
44
use Koha::AuthorisedValues;
45
use Koha::Patrons;
45
use Koha::Virtualshelves;
46
use Koha::Virtualshelves;
46
47
47
my $query = CGI->new();
48
my $query = CGI->new();
Lines 132-139 my $dbh = C4::Context->dbh; Link Here
132
133
133
my @all_items = GetItemsInfo( $biblionumber );
134
my @all_items = GetItemsInfo( $biblionumber );
134
my @items;
135
my @items;
136
my $patron = Koha::Patrons->find( $borrowernumber );
135
for my $itm (@all_items) {
137
for my $itm (@all_items) {
136
    push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);
138
    push @items, $itm unless ( $itm->{itemlost} && $patron->category->hidelostitems && !$showallitems);
137
}
139
}
138
140
139
# flag indicating existence of at least one item linked via a host record
141
# flag indicating existence of at least one item linked via a host record
(-)a/catalogue/moredetail.pl (-2 / +3 lines)
Lines 32-44 use C4::Auth; Link Here
32
use C4::Serials;
32
use C4::Serials;
33
use C4::Members; # to use GetMember
33
use C4::Members; # to use GetMember
34
use C4::Search;		# enabled_staff_search_views
34
use C4::Search;		# enabled_staff_search_views
35
use C4::Members qw/GetHideLostItemsPreference/;
36
use C4::Reserves qw(GetReservesFromBiblionumber);
35
use C4::Reserves qw(GetReservesFromBiblionumber);
37
36
38
use Koha::Acquisition::Bookseller;
37
use Koha::Acquisition::Bookseller;
39
use Koha::AuthorisedValues;
38
use Koha::AuthorisedValues;
40
use Koha::DateUtils;
39
use Koha::DateUtils;
41
use Koha::Items;
40
use Koha::Items;
41
use Koha::Patrons;
42
42
43
my $query=new CGI;
43
my $query=new CGI;
44
44
Lines 93-101 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber); Link Here
93
my $fw = GetFrameworkCode($biblionumber);
93
my $fw = GetFrameworkCode($biblionumber);
94
my @all_items= GetItemsInfo($biblionumber);
94
my @all_items= GetItemsInfo($biblionumber);
95
my @items;
95
my @items;
96
my $patron = Koha::Patrons->find( $loggedinuser );
96
for my $itm (@all_items) {
97
for my $itm (@all_items) {
97
    push @items, $itm unless ( $itm->{itemlost} && 
98
    push @items, $itm unless ( $itm->{itemlost} && 
98
                               GetHideLostItemsPreference($loggedinuser) &&
99
                               $patron->category->hidelostitems &&
99
                               !$showallitems && 
100
                               !$showallitems && 
100
                               ($itemnumber != $itm->{itemnumber}));
101
                               ($itemnumber != $itm->{itemnumber}));
101
}
102
}
(-)a/reserve/request.pl (-2 / +4 lines)
Lines 45-50 use C4::Search; # enabled_staff_search_views Link Here
45
use Koha::DateUtils;
45
use Koha::DateUtils;
46
use Koha::Holds;
46
use Koha::Holds;
47
use Koha::Libraries;
47
use Koha::Libraries;
48
use Koha::Patrons;
48
49
49
my $dbh = C4::Context->dbh;
50
my $dbh = C4::Context->dbh;
50
my $input = new CGI;
51
my $input = new CGI;
Lines 201-206 $template->param( messageborrower => $messageborrower ); Link Here
201
# FIXME launch another time GetMember perhaps until
202
# FIXME launch another time GetMember perhaps until
202
my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold );
203
my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold );
203
204
205
my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
206
204
my $itemdata_enumchron = 0;
207
my $itemdata_enumchron = 0;
205
my @biblioloop = ();
208
my @biblioloop = ();
206
foreach my $biblionumber (@biblionumbers) {
209
foreach my $biblionumber (@biblionumbers) {
Lines 412-418 foreach my $biblionumber (@biblionumbers) { Link Here
412
                    : $item->{itemlost} == 2 ? "(long overdue)"
415
                    : $item->{itemlost} == 2 ? "(long overdue)"
413
                      : "";
416
                      : "";
414
                $item->{backgroundcolor} = 'other';
417
                $item->{backgroundcolor} = 'other';
415
                if (GetHideLostItemsPreference($borrowernumber) && !$showallitems) {
418
                if ($logged_in_patron->category->hidelostitems && !$showallitems) {
416
                    $item->{hide} = 1;
419
                    $item->{hide} = 1;
417
                    $hiddencount++;
420
                    $hiddencount++;
418
                }
421
                }
419
- 

Return to bug 17556