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

(-)a/Koha/Template/Plugin/AuthorisedValues.pm (+30 lines)
Lines 68-73 sub GetCategories { Link Here
68
    ];
68
    ];
69
}
69
}
70
70
71
sub GetDescriptionsByKohaField {
72
    my ( $self, $params ) = @_;
73
    return Koha::AuthorisedValues->get_descriptions_by_koha_field(
74
        { kohafield => $params->{kohafield} } );
75
}
76
77
sub GetDescriptionByKohaField {
78
    my ( $self, $params ) = @_;
79
    my $av = Koha::AuthorisedValues->get_description_by_koha_field(
80
        {
81
            kohafield        => $params->{kohafield},
82
            authorised_value => $params->{authorised_value},
83
        }
84
    );
85
    return %$av
86
            ? $params->{opac}
87
                ? $av->{opac_description}
88
                : $av->{lib}
89
            : ''; # Maybe we should return $params->{authorised_value}?
90
91
}
92
71
1;
93
1;
72
94
73
=head1 NAME
95
=head1 NAME
Lines 93-98 the following TT code: [% AuthorisedValues.GetByCode( 'CATEGORY', 'AUTHORISED_VA Link Here
93
115
94
The parameters are identical to those used by the subroutine C4::Koha::GetAuthValueDropbox
116
The parameters are identical to those used by the subroutine C4::Koha::GetAuthValueDropbox
95
117
118
=head2 GetDescriptionsByKohaField
119
120
The parameters are identical to those used by the subroutine Koha::AuthorisedValues->get_descriptions_by_koha_field
121
122
=head2 GetDescriptionByKohaField
123
124
The parameters are identical to those used by the subroutine Koha::AuthorisedValues->get_description_by_koha_field
125
96
=head1 AUTHOR
126
=head1 AUTHOR
97
127
98
Kyle M Hall <kyle@bywatersolutions.com>
128
Kyle M Hall <kyle@bywatersolutions.com>
(-)a/admin/columns_settings.yml (+2 lines)
Lines 285-290 modules: Link Here
285
        -
285
        -
286
          columnname: location
286
          columnname: location
287
        -
287
        -
288
          columnname: notforloan
289
        -
288
          columnname: notes
290
          columnname: notes
289
291
290
  circ:
292
  circ:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (-9 / +30 lines)
Lines 67-72 Link Here
67
                    <th>Item type</th>
67
                    <th>Item type</th>
68
                    <th>Current location</th>
68
                    <th>Current location</th>
69
                    <th>Location</th>
69
                    <th>Location</th>
70
                    <th>Not for loan status</th>
70
                    <th>Notes</th>
71
                    <th>Notes</th>
71
                </tr>
72
                </tr>
72
            </thead>
73
            </thead>
Lines 77-83 Link Here
77
                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
78
                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
78
                        </td>
79
                        </td>
79
                        <td>[% item.biblio.author %]</td>
80
                        <td>[% item.biblio.author %]</td>
80
                        <td>[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) %]</td>
81
                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
81
                        <td>
82
                        <td>
82
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
83
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
83
                        </td>
84
                        </td>
Lines 89-94 Link Here
89
                        <td>[% item.effective_itemtype %]</td>
90
                        <td>[% item.effective_itemtype %]</td>
90
                        <td>[% Branches.GetName(item.holdingbranch) %]</td>
91
                        <td>[% Branches.GetName(item.holdingbranch) %]</td>
91
                        <td>[% item.location %]</td>
92
                        <td>[% item.location %]</td>
93
                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
92
                        <td>[% item.itemnotes %]</td>
94
                        <td>[% item.itemnotes %]</td>
93
                    </tr>
95
                    </tr>
94
                [% END %]
96
                [% END %]
Lines 113-127 Link Here
113
                [% END %]
115
                [% END %]
114
            </select></li>
116
            </select></li>
115
117
116
    <li><label for="loststatusfilter">Lost status: </label><select name="loststatusfilter" id="loststatusfilter">
118
    <li>
117
                <option value="">All</option>
119
        <label for="loststatusfilter">Lost status: </label>
118
                [% FOREACH loststatusloo IN loststatusloop %]
120
        <select name="loststatusfilter" id="loststatusfilter">
119
                [% IF ( loststatusloo.selected ) %]<option value="[% loststatusloo.authorised_value %]" selected="selected">[% loststatusloo.lib %]</option>
121
            <option value="">All</option>
120
		[% ELSE %]
122
            [% FOREACH l IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.itemlost') %]
121
		<option value="[% loststatusloo.authorised_value %]">[% loststatusloo.lib %]</option>
123
                [% IF l.authorised_value == lostfilter %]
122
		[% END %]
124
                    <option value="[% l.authorised_value %]" selected="selected">[% l.lib %]</option>
125
                [% ELSE %]
126
                    <option value="[% l.authorised_value %]">[% l.lib %]</option>
123
                [% END %]
127
                [% END %]
124
            </select></li>
128
            [% END %]
129
        </select>
130
    </li>
131
132
    <li>
133
        <label for="notforloanfilter">Not for loan: </label>
134
        <select name="notforloanfilter" id="notforloanfilter">
135
            <option value="">All</option>
136
            [% FOREACH n IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.notforloan') %]
137
                [% IF n.authorised_value == notforloanfilter %]
138
                    <option value="[% n.authorised_value %]" selected="selected">[% n.lib %]</option>
139
                [% ELSE %]
140
                    <option value="[% n.authorised_value %]">[% n.lib %]</option>
141
                [% END %]
142
            [% END %]
143
        </select>
144
    </li>
145
125
</ol></fieldset>
146
</ol></fieldset>
126
<fieldset class="action">    <input type="submit" value="Submit" />
147
<fieldset class="action">    <input type="submit" value="Submit" />
127
    <input type="hidden" name="get_items" value="1" /></fieldset>
148
    <input type="hidden" name="get_items" value="1" /></fieldset>
(-)a/reports/itemslost.pl (-6 / +9 lines)
Lines 33-38 use C4::Auth; Link Here
33
use C4::Output;
33
use C4::Output;
34
use C4::Biblio;
34
use C4::Biblio;
35
use C4::Items;
35
use C4::Items;
36
37
use Koha::AuthorisedValues;
36
use Koha::DateUtils;
38
use Koha::DateUtils;
37
39
38
my $query = new CGI;
40
my $query = new CGI;
Lines 55-60 if ($get_items) { Link Here
55
    my $barcodefilter    = $params->{'barcodefilter'}    || undef;
57
    my $barcodefilter    = $params->{'barcodefilter'}    || undef;
56
    my $itemtypesfilter  = $params->{'itemtypesfilter'}  || undef;
58
    my $itemtypesfilter  = $params->{'itemtypesfilter'}  || undef;
57
    my $loststatusfilter = $params->{'loststatusfilter'} || undef;
59
    my $loststatusfilter = $params->{'loststatusfilter'} || undef;
60
    my $notforloanfilter = $params->{'notforloanfilter'} || undef;
58
61
59
    my $params = {
62
    my $params = {
60
        ( $branchfilter ? ( homebranch => $branchfilter ) : () ),
63
        ( $branchfilter ? ( homebranch => $branchfilter ) : () ),
Lines 63-68 if ($get_items) { Link Here
63
            ? ( itemlost => $loststatusfilter )
66
            ? ( itemlost => $loststatusfilter )
64
            : ( itemlost => { '!=' => 0 } )
67
            : ( itemlost => { '!=' => 0 } )
65
        ),
68
        ),
69
        (
70
            $notforloanfilter
71
            ? ( notforloan => $notforloanfilter )
72
            : ()
73
        ),
66
        ( $barcodefilter ? ( barcode => { like => "%$barcodefilter%" } ) : () ),
74
        ( $barcodefilter ? ( barcode => { like => "%$barcodefilter%" } ) : () ),
67
    };
75
    };
68
76
Lines 89-100 if ($get_items) { Link Here
89
# getting all itemtypes
97
# getting all itemtypes
90
my $itemtypes = Koha::ItemTypes->search_with_localization;
98
my $itemtypes = Koha::ItemTypes->search_with_localization;
91
99
92
# get lost statuses
93
my $lost_status_loop = C4::Koha::GetAuthorisedValues( 'LOST' );
94
95
$template->param(
100
$template->param(
96
                  itemtypes => $itemtypes,
101
    itemtypes => $itemtypes,
97
                  loststatusloop => $lost_status_loop,
98
);
102
);
99
103
100
# writing the template
104
# writing the template
101
- 

Return to bug 9573