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

(-)a/Koha/Template/Plugin/Biblio.pm (+3 lines)
Lines 31-39 use Koha::Recalls; Link Here
31
31
32
use Koha::DateUtils qw(dt_from_string);
32
use Koha::DateUtils qw(dt_from_string);
33
33
34
# Do not use HoldsCount, it is deprecated and will be removed in a future release.
34
sub HoldsCount {
35
sub HoldsCount {
35
    my ( $self, $biblionumber ) = @_;
36
    my ( $self, $biblionumber ) = @_;
36
37
38
    warn "HoldsCount is deprecated, you should use biblio.holds.count instead";
39
37
    my $holds = Koha::Holds->search( { biblionumber => $biblionumber } );
40
    my $holds = Koha::Holds->search( { biblionumber => $biblionumber } );
38
41
39
    return $holds->count();
42
    return $holds->count();
(-)a/installer/data/mysql/atomicupdate/bug_35782.pl (+25 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "BUG_35872",
5
    description => "Biblio.HoldsCount is deprecated",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        my ($count) = $dbh->selectrow_array(
12
            q{
13
            SELECT COUNT(*)
14
            FROM letter
15
            WHERE content LIKE "%Biblio.HoldsCount%";
16
        }
17
        );
18
19
        if ($count) {
20
            say $out "WARNING - Biblio.HoldsCount is used in at least one notice template";
21
            say $out "It is deprecated and will be remove in a future version of Koha.";
22
            say $out "Replace it with biblio.holds.count instead";
23
        }
24
    },
25
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (-2 / +2 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Biblio %]
2
[% USE Biblio %]
3
[% SET biblio_object_id = object || biblionumber || biblio.biblionumber %]
3
[% SET biblio_object_id = biblio.biblionumber %]
4
4
5
<div id="menu">
5
<div id="menu">
6
    <ul>
6
    <ul>
Lines 66-72 Link Here
66
        [%- ELSE -%]
66
        [%- ELSE -%]
67
        <li>
67
        <li>
68
        [%- END -%]
68
        [%- END -%]
69
            <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio_object_id | url  %]">Holds ([% Biblio.HoldsCount( biblio_object_id ) | html %])</a>
69
            <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio_object_id | url  %]">Holds ([% biblio.holds.count | html %])</a>
70
        </li>
70
        </li>
71
        [%- END -%]
71
        [%- END -%]
72
72
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-2 / +2 lines)
Lines 562-572 Link Here
562
                                                        <span class="noholdstext">No holds allowed</span>
562
                                                        <span class="noholdstext">No holds allowed</span>
563
                                                    [% ELSE %]
563
                                                    [% ELSE %]
564
                                                        [% IF CAN_user_reserveforothers_place_holds %]
564
                                                        [% IF CAN_user_reserveforothers_place_holds %]
565
                                                            <a id="reserve_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %])</a>
565
                                                            <a id="reserve_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</a>
566
                                                            [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></span>[% END %]
566
                                                            [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></span>[% END %]
567
                                                            [% IF ( holdforclub ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;club=[% holdforclub | uri %]">Place hold for [% holdforclub_name | html %]</a></span>[% END %]
567
                                                            [% IF ( holdforclub ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;club=[% holdforclub | uri %]">Place hold for [% holdforclub_name | html %]</a></span>[% END %]
568
                                                        [% ELSE %]
568
                                                        [% ELSE %]
569
                                                            <span>Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %])</span>
569
                                                            <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
570
                                                        [% END %]
570
                                                        [% END %]
571
                                                    [% END # /IF SEARCH_RESULT.norequests %]
571
                                                    [% END # /IF SEARCH_RESULT.norequests %]
572
                                                    [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
572
                                                    [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 1041-1047 Link Here
1041
1041
1042
            [% UNLESS ( patron ) %]
1042
            [% UNLESS ( patron ) %]
1043
                [% UNLESS borrowers %]
1043
                [% UNLESS borrowers %]
1044
                    [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
1044
                    [% SET hold_count = biblio.holds.count | html %]
1045
                    [% IF hold_count %]
1045
                    [% IF hold_count %]
1046
                        <label for ="always_show_holds">Always show holds</label>
1046
                        <label for ="always_show_holds">Always show holds</label>
1047
                        [% IF always_show_holds == 'DONT' %]
1047
                        [% IF always_show_holds == 'DONT' %]
(-)a/tools/viewlog.pl (-2 / +3 lines)
Lines 130-140 if ($do_it) { Link Here
130
130
131
    if ( @modules == 1 && $object_type eq 'biblio' ) {
131
    if ( @modules == 1 && $object_type eq 'biblio' ) {
132
        # Handle 'Modification log' from cataloguing
132
        # Handle 'Modification log' from cataloguing
133
        my @itemnumbers = Koha::Items->search({ biblionumber => $object })->get_column('itemnumber');
133
        my $biblio = Koha::Biblios->find( $object );
134
        my @itemnumbers = $biblio->items->get_column('itemnumber');
134
        $search_params{'-or'} = [
135
        $search_params{'-or'} = [
135
            { -and => { object => $object, info => { -like => 'biblio%' }}},
136
            { -and => { object => $object, info => { -like => 'biblio%' }}},
136
            { -and => { object => \@itemnumbers, info => { -like => 'item%' }}},
137
            { -and => { object => \@itemnumbers, info => { -like => 'item%' }}},
137
        ];
138
        ];
139
        $template->param( biblio => $biblio );
138
    } else {
140
    } else {
139
        $search_params{info} = { -like => '%' . $info . '%' } if $info;
141
        $search_params{info} = { -like => '%' . $info . '%' } if $info;
140
        $search_params{object} = $object if $object;
142
        $search_params{object} = $object if $object;
141
- 

Return to bug 35782