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

(-)a/Koha/Hold.pm (+1 lines)
Lines 252-257 Returns the related Koha::Patron object for this Hold Link Here
252
252
253
=cut
253
=cut
254
254
255
# FIXME Should be renamed with ->patron
255
sub borrower {
256
sub borrower {
256
    my ($self) = @_;
257
    my ($self) = @_;
257
258
(-)a/catalogue/detail.pl (-9 / +4 lines)
Lines 252-262 foreach my $item (@items) { Link Here
252
        $itemfields{$_} = 1 if ( $item->{$_} );
252
        $itemfields{$_} = 1 if ( $item->{$_} );
253
    }
253
    }
254
254
255
    if (C4::Context->preference('HidePatronName')){
256
        $item->{'hidepatronname'} = 1;
257
    }
258
259
260
    # checking for holds
255
    # checking for holds
261
    my $item_object = Koha::Items->find( $item->{itemnumber} );
256
    my $item_object = Koha::Items->find( $item->{itemnumber} );
262
    my $holds = $item_object->holds_placed_before_today;
257
    my $holds = $item_object->holds_placed_before_today;
Lines 264-278 foreach my $item (@items) { Link Here
264
        my $patron = Koha::Patrons->find( $first_hold->borrowernumber );
259
        my $patron = Koha::Patrons->find( $first_hold->borrowernumber );
265
        $item->{backgroundcolor} = 'reserved';
260
        $item->{backgroundcolor} = 'reserved';
266
        $item->{reservedate}     = $first_hold->reservedate;
261
        $item->{reservedate}     = $first_hold->reservedate;
267
        $item->{ReservedForBorrowernumber}     = $first_hold->borrowernumber;
262
        $item->{ReservedFor}     = $patron,
268
        $item->{ReservedForSurname}     = $patron->surname;
269
        $item->{ReservedForFirstname}   = $patron->firstname;
270
        $item->{ExpectedAtLibrary}      = $first_hold->branchcode;
263
        $item->{ExpectedAtLibrary}      = $first_hold->branchcode;
271
        $item->{Reservedcardnumber}     = $patron->cardnumber;
272
        # Check waiting status
264
        # Check waiting status
273
        $item->{waitingdate} = $first_hold->waitingdate;
265
        $item->{waitingdate} = $first_hold->waitingdate;
274
    }
266
    }
275
267
268
    if ( my $checkout = $item_object->checkout ) {
269
        $item->{CheckedOutFor} = $checkout->patron;
270
    }
276
271
277
	# Check the transit status
272
	# Check the transit status
278
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
273
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
(-)a/catalogue/moredetail.pl (-10 / +3 lines)
Lines 61-68 if($query->cookie("holdfor")){ Link Here
61
    );
61
    );
62
}
62
}
63
63
64
my $hidepatronname = C4::Context->preference("HidePatronName");
65
66
# get variables
64
# get variables
67
65
68
my $biblionumber=$query->param('biblionumber');
66
my $biblionumber=$query->param('biblionumber');
Lines 186-199 foreach my $item (@items){ Link Here
186
        $item->{'issue'}= 0;
184
        $item->{'issue'}= 0;
187
    }
185
    }
188
186
189
    unless ($hidepatronname) {
187
    if ( $item->{'borrowernumber'} ) {
190
        if ( $item->{'borrowernumber'} ) {
188
        my $curr_borrower = Koha::Patrons->find( $item->{borrowernumber} );
191
            my $curr_borrower = Koha::Patrons->find( $item->{borrowernumber} );
189
        $item->{patron} = $curr_borrower;
192
            $item->{borrowerfirstname} = $curr_borrower->firstname;
193
            $item->{borrowersurname} = $curr_borrower->surname;
194
        }
195
    }
190
    }
196
197
}
191
}
198
192
199
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
193
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
Lines 224-230 $template->param( Link Here
224
    itemnumber          => $itemnumber,
218
    itemnumber          => $itemnumber,
225
    z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
219
    z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
226
    subtitle            => $subtitle,
220
    subtitle            => $subtitle,
227
    hidepatronname      => $hidepatronname,
228
);
221
);
229
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
222
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
230
$template->{'VARS'}->{'searchid'} = $query->param('searchid');
223
$template->{'VARS'}->{'searchid'} = $query->param('searchid');
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc (-24 / +61 lines)
Lines 1-27 Link Here
1
[%- IF ( borrower.borrowernumber ) %]
1
[%- USE Koha -%]
2
    [%- IF borrower.category_type == 'I' %]
2
[%- USE Branches -%]
3
        [%- borrower.surname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %]
3
[%- SET data = {} -%]
4
    [%- ELSE %]
4
[%- IF patron -%]
5
        [%- IF invert_name %]
5
    [%- SET data.category_type  = patron.category.category_type -%]
6
            [%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %]
6
    [%- SET data.surname        = patron.surname -%]
7
        [%- ELSE %]
7
    [%- SET data.othernames     = patron.othernames -%]
8
            [%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %]
8
    [%- SET data.surname        = patron.surname -%]
9
        [%- END -%]
9
    [%- SET data.firstname      = patron.firstname -%]
10
    [%- SET data.cardnumber     = patron.cardnumber -%]
11
    [%- SET data.borrowernumber = patron.borrowernumber -%]
12
[%- ELSIF ( borrower.borrowernumber ) -%]
13
    [%- SET data.category_type  = borrower.category_type -%]
14
    [%- SET data.surname        = borrower.surname -%]
15
    [%- SET data.othernames     = borrower.othernames -%]
16
    [%- SET data.surname        = borrower.surname -%]
17
    [%- SET data.firstname      = borrower.firstname -%]
18
    [%- SET data.cardnumber     = borrower.cardnumber -%]
19
    [%- SET data.borrowernumber = borrower.borrowernumber -%]
20
[%- ELSIF ( borrowernumber ) -%]
21
    [%- SET data.category_type  = category_type -%]
22
    [%- SET data.surname        = surname -%]
23
    [%- SET data.othernames     = othernames -%]
24
    [%- SET data.surname        = surname -%]
25
    [%- SET data.firstname      = firstname -%]
26
    [%- SET data.cardnumber     = cardnumber -%]
27
    [%- SET data.borrowernumber = borrowernumber -%]
28
[%- END -%]
29
[%- SET display_patron_name = 1 -%]
30
[%- SET display_cardnumber  = 1 -%]
31
[%- IF hide_patron_infos_if_needed %] [%# Should only be set if patron is set -%]
32
    [%- SET can_see_patron_infos = logged_in_user.can_see_patron_infos( patron ) -%]
33
    [%- UNLESS can_see_patron_infos -%]
34
        [%- SET display_patron_name = 0 -%]
35
        [%- SET display_cardnumber  = 0 -%]
36
    [%- ELSIF Koha.Preference('HidePatronName') -%]
37
        [%- SET display_patron_name = 0 -%]
38
    [%- END -%]
39
[%- END -%]
40
[%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%]
41
    [%- IF link_to == 'circulation_reserves' %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% data.borrowernumber %]#reserves">
42
    [%- ELSE %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]">
10
    [%- END -%]
43
    [%- END -%]
11
    [%- IF ( borrower.cardnumber ) -%]
44
[%- END -%]
12
        ([% borrower.cardnumber | html %])
45
[%- IF data.category_type == 'I' -%]
13
    [%- END %]
46
    [%- UNLESS display_patron_name %][%- data.surname | html %] [% IF data.othernames %] [% END %]([% data.othernames | html %]) [% END -%]
14
[%- ELSIF ( borrowernumber ) %]
47
[%- ELSIF display_patron_name -%]
15
    [%- IF category_type == 'I' %]
48
    [%- IF invert_name -%]
16
        [%- surname | html %] [% IF othernames %] ([% othernames | html %]) [% END %]
49
        [%- data.surname | html %], [% data.firstname | html %] [% IF data.othernames %] ([% data.othernames | html %]) [% END -%]
17
    [%- ELSE %]
50
    [%- ELSE -%]
18
        [%- IF invert_name %]
51
        [%- data.firstname | html %] [% IF data.othernames %] ([% data.othernames | html %]) [% END %] [% data.surname | html -%]
19
            [%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %]
52
    [%- END -%]
20
        [%- ELSE %]
53
    [%- IF display_cardnumber AND data.cardnumber %]([% data.cardnumber | html %])[% END -%]
21
            [%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %]
54
[%- ELSIF display_cardnumber -%]
22
        [%- END %]
55
    [%- IF data.cardnumber -%][%# FIXME Cardnumber should always be defined, right? -%]
56
        [%- data.cardnumber | html -%]
23
    [%- END -%]
57
    [%- END -%]
24
    [%- IF ( cardnumber ) -%]
58
[%- ELSE -%]
25
        ([% cardnumber | html %])
59
    A patron from library [% Branches.GetName( patron.branchcode ) -%]
26
    [%- END %]
60
[%- END -%]
61
62
[%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%]
63
    </a>
27
[%- END -%]
64
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-16 / +6 lines)
Lines 675-681 function verify_images() { Link Here
675
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
675
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
676
                    <td class="status">
676
                    <td class="status">
677
677
678
                        [% IF ( item.datedue ) %]
678
                        [% IF item.CheckedOutFor %]
679
                          [% IF item.onsite_checkout %]
679
                          [% IF item.onsite_checkout %]
680
                            <span>Currently in local use
680
                            <span>Currently in local use
681
                          [% ELSE %]
681
                          [% ELSE %]
Lines 683-698 function verify_images() { Link Here
683
                          [% END %]
683
                          [% END %]
684
                                [% UNLESS ( item.NOTSAMEBRANCH ) %]
684
                                [% UNLESS ( item.NOTSAMEBRANCH ) %]
685
                                  [% IF item.onsite_checkout %]
685
                                  [% IF item.onsite_checkout %]
686
                                    by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
686
                                    by
687
                                  [% ELSE %]
687
                                  [% ELSE %]
688
                                    to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
688
                                    to
689
                                  [% END %]
689
                                  [% END %]
690
                                        [% IF ( item.hidepatronname ) %]
690
                                  [% INCLUDE 'patron-title.inc' patron=item.CheckedOutFor hide_patron_infos_if_needed=1 %]
691
                                            [% item.cardnumber %]
692
                                        [% ELSE %]
693
                                            [% item.firstname %] [% item.surname %]
694
                                        [% END %]
695
                                    </a>
696
                                [% END %]
691
                                [% END %]
697
                                : due [% item.datedue %]
692
                                : due [% item.datedue %]
698
                            </span>
693
                            </span>
Lines 742-754 function verify_images() { Link Here
742
                                Item-level hold (placed [% item.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( item.ExpectedAtLibrary ) %].
737
                                Item-level hold (placed [% item.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( item.ExpectedAtLibrary ) %].
743
                            [% END %]
738
                            [% END %]
744
                            [% IF ( canreservefromotherbranches ) %]
739
                            [% IF ( canreservefromotherbranches ) %]
745
                                Hold for: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.ReservedForBorrowernumber %]">
740
                                Hold for:
746
                                    [% IF ( item.hidepatronname ) %]
741
                                [% INCLUDE 'patron-title.inc' patron=item.ReservedFor hide_patron_infos_if_needed=1 %]
747
                                        [% item.Reservedcardnumber %]
748
                                    [% ELSE %]
749
                                        [% item.ReservedForFirstname _ " " _ item.ReservedForSurname _ " (" _ item.Reservedcardnumber _ ")" %]
750
                                    [% END %]
751
                                </a>
752
                            [% END %]
742
                            [% END %]
753
                        [% END %]
743
                        [% END %]
754
                        [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate ) %]
744
                        [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-7 / +1 lines)
Lines 773-785 function checkMultiHold() { Link Here
773
    [% END %]
773
    [% END %]
774
774
775
        <td>
775
        <td>
776
          <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" >
776
          [% INCLUDE 'patron-title.inc' patron=reserveloo.patron hide_patron_infos_if_needed=1 %]
777
	  [% IF ( reserveloo.hidename ) %]
778
	      [% reserveloo.cardnumber (reserveloo.borrowernumber) %]
779
	  [% ELSE %]
780
	      [% reserveloo.firstname %] [% reserveloo.surname %]
781
	  [% END %]
782
	  </a>
783
        </td>
777
        </td>
784
        <td>[% reserveloo.notes %]</td>
778
        <td>[% reserveloo.notes %]</td>
785
        <td>[% reserveloo.date %]</td>
779
        <td>[% reserveloo.date %]</td>
(-)a/reserve/request.pl (-9 / +1 lines)
Lines 566-584 foreach my $biblionumber (@biblionumbers) { Link Here
566
            }
566
            }
567
        }
567
        }
568
568
569
        #     get borrowers reserve info
570
        if ( C4::Context->preference('HidePatronName') ) {
571
            $reserve{'hidename'}   = 1;
572
            $reserve{'cardnumber'} = $res->borrower()->cardnumber();
573
        }
574
        $reserve{'expirationdate'} = output_pref( { dt => dt_from_string( $res->expirationdate ), dateonly => 1 } )
569
        $reserve{'expirationdate'} = output_pref( { dt => dt_from_string( $res->expirationdate ), dateonly => 1 } )
575
          unless ( !defined( $res->expirationdate ) || $res->expirationdate eq '0000-00-00' );
570
          unless ( !defined( $res->expirationdate ) || $res->expirationdate eq '0000-00-00' );
576
        $reserve{'date'}           = output_pref( { dt => dt_from_string( $res->reservedate ), dateonly => 1 } );
571
        $reserve{'date'}           = output_pref( { dt => dt_from_string( $res->reservedate ), dateonly => 1 } );
577
        $reserve{'borrowernumber'} = $res->borrowernumber();
572
        $reserve{'borrowernumber'} = $res->borrowernumber();
578
        $reserve{'biblionumber'}   = $res->biblionumber();
573
        $reserve{'biblionumber'}   = $res->biblionumber();
579
        $reserve{'borrowernumber'} = $res->borrowernumber();
574
        $reserve{'patron'}         = $res->borrower;
580
        $reserve{'firstname'}      = $res->borrower()->firstname();
581
        $reserve{'surname'}        = $res->borrower()->surname();
582
        $reserve{'notes'}          = $res->reservenotes();
575
        $reserve{'notes'}          = $res->reservenotes();
583
        $reserve{'waiting_date'}   = $res->waitingdate();
576
        $reserve{'waiting_date'}   = $res->waitingdate();
584
        $reserve{'waiting_until'}  = $res->is_waiting() ? $res->waiting_expires_on() : undef;
577
        $reserve{'waiting_until'}  = $res->is_waiting() ? $res->waiting_expires_on() : undef;
585
- 

Return to bug 18403