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 253-263 foreach my $item (@items) { Link Here
253
        $itemfields{$_} = 1 if ( $item->{$_} );
253
        $itemfields{$_} = 1 if ( $item->{$_} );
254
    }
254
    }
255
255
256
    if (C4::Context->preference('HidePatronName')){
257
        $item->{'hidepatronname'} = 1;
258
    }
259
260
261
    # checking for holds
256
    # checking for holds
262
    my $item_object = Koha::Items->find( $item->{itemnumber} );
257
    my $item_object = Koha::Items->find( $item->{itemnumber} );
263
    my $holds = $item_object->current_holds;
258
    my $holds = $item_object->current_holds;
Lines 265-279 foreach my $item (@items) { Link Here
265
        my $patron = Koha::Patrons->find( $first_hold->borrowernumber );
260
        my $patron = Koha::Patrons->find( $first_hold->borrowernumber );
266
        $item->{backgroundcolor} = 'reserved';
261
        $item->{backgroundcolor} = 'reserved';
267
        $item->{reservedate}     = $first_hold->reservedate;
262
        $item->{reservedate}     = $first_hold->reservedate;
268
        $item->{ReservedForBorrowernumber}     = $first_hold->borrowernumber;
263
        $item->{ReservedFor}     = $patron,
269
        $item->{ReservedForSurname}     = $patron->surname;
270
        $item->{ReservedForFirstname}   = $patron->firstname;
271
        $item->{ExpectedAtLibrary}      = $first_hold->branchcode;
264
        $item->{ExpectedAtLibrary}      = $first_hold->branchcode;
272
        $item->{Reservedcardnumber}     = $patron->cardnumber;
273
        # Check waiting status
265
        # Check waiting status
274
        $item->{waitingdate} = $first_hold->waitingdate;
266
        $item->{waitingdate} = $first_hold->waitingdate;
275
    }
267
    }
276
268
269
    if ( my $checkout = $item_object->checkout ) {
270
        $item->{CheckedOutFor} = $checkout->patron;
271
    }
277
272
278
	# Check the transit status
273
	# Check the transit status
279
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
274
    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 187-200 foreach my $item (@items){ Link Here
187
        $item->{'issue'}= 0;
185
        $item->{'issue'}= 0;
188
    }
186
    }
189
187
190
    unless ($hidepatronname) {
188
    if ( $item->{'borrowernumber'} ) {
191
        if ( $item->{'borrowernumber'} ) {
189
        my $curr_borrower = Koha::Patrons->find( $item->{borrowernumber} );
192
            my $curr_borrower = Koha::Patrons->find( $item->{borrowernumber} );
190
        $item->{patron} = $curr_borrower;
193
            $item->{borrowerfirstname} = $curr_borrower->firstname;
194
            $item->{borrowersurname} = $curr_borrower->surname;
195
        }
196
    }
191
    }
197
198
}
192
}
199
193
200
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
194
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } });
Lines 225-231 $template->param( Link Here
225
    itemnumber          => $itemnumber,
219
    itemnumber          => $itemnumber,
226
    z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
220
    z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
227
    subtitle            => $subtitle,
221
    subtitle            => $subtitle,
228
    hidepatronname      => $hidepatronname,
229
);
222
);
230
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
223
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
231
$template->{'VARS'}->{'searchid'} = $query->param('searchid');
224
$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 567-585 foreach my $biblionumber (@biblionumbers) { Link Here
567
            }
567
            }
568
        }
568
        }
569
569
570
        #     get borrowers reserve info
571
        if ( C4::Context->preference('HidePatronName') ) {
572
            $reserve{'hidename'}   = 1;
573
            $reserve{'cardnumber'} = $res->borrower()->cardnumber();
574
        }
575
        $reserve{'expirationdate'} = output_pref( { dt => dt_from_string( $res->expirationdate ), dateonly => 1 } )
570
        $reserve{'expirationdate'} = output_pref( { dt => dt_from_string( $res->expirationdate ), dateonly => 1 } )
576
          unless ( !defined( $res->expirationdate ) || $res->expirationdate eq '0000-00-00' );
571
          unless ( !defined( $res->expirationdate ) || $res->expirationdate eq '0000-00-00' );
577
        $reserve{'date'}           = output_pref( { dt => dt_from_string( $res->reservedate ), dateonly => 1 } );
572
        $reserve{'date'}           = output_pref( { dt => dt_from_string( $res->reservedate ), dateonly => 1 } );
578
        $reserve{'borrowernumber'} = $res->borrowernumber();
573
        $reserve{'borrowernumber'} = $res->borrowernumber();
579
        $reserve{'biblionumber'}   = $res->biblionumber();
574
        $reserve{'biblionumber'}   = $res->biblionumber();
580
        $reserve{'borrowernumber'} = $res->borrowernumber();
575
        $reserve{'patron'}         = $res->borrower;
581
        $reserve{'firstname'}      = $res->borrower()->firstname();
582
        $reserve{'surname'}        = $res->borrower()->surname();
583
        $reserve{'notes'}          = $res->reservenotes();
576
        $reserve{'notes'}          = $res->reservenotes();
584
        $reserve{'waiting_date'}   = $res->waitingdate();
577
        $reserve{'waiting_date'}   = $res->waitingdate();
585
        $reserve{'waiting_until'}  = $res->is_waiting() ? $res->waiting_expires_on() : undef;
578
        $reserve{'waiting_until'}  = $res->is_waiting() ? $res->waiting_expires_on() : undef;
586
- 

Return to bug 18403