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 310-315 modules: Link Here
310
        -
310
        -
311
          columnname: location
311
          columnname: location
312
        -
312
        -
313
          columnname: notforloan
314
        -
313
          columnname: notes
315
          columnname: notes
314
316
315
  circ:
317
  circ:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (-9 / +30 lines)
Lines 49-54 Link Here
49
                    <th>Item type</th>
49
                    <th>Item type</th>
50
                    <th>Current location</th>
50
                    <th>Current location</th>
51
                    <th>Location</th>
51
                    <th>Location</th>
52
                    <th>Not for loan status</th>
52
                    <th>Notes</th>
53
                    <th>Notes</th>
53
                </tr>
54
                </tr>
54
            </thead>
55
            </thead>
Lines 59-65 Link Here
59
                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
60
                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.biblio.title |html %]</a>
60
                        </td>
61
                        </td>
61
                        <td>[% item.biblio.author %]</td>
62
                        <td>[% item.biblio.author %]</td>
62
                        <td>[% AuthorisedValues.GetByCode( 'LOST', item.itemlost ) %]</td>
63
                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
63
                        <td>
64
                        <td>
64
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
65
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber %]" title="[% item.itemnotes %]">[% item.barcode %]</a>
65
                        </td>
66
                        </td>
Lines 71-76 Link Here
71
                        <td>[% item.effective_itemtype %]</td>
72
                        <td>[% item.effective_itemtype %]</td>
72
                        <td>[% Branches.GetName(item.holdingbranch) %]</td>
73
                        <td>[% Branches.GetName(item.holdingbranch) %]</td>
73
                        <td>[% item.location %]</td>
74
                        <td>[% item.location %]</td>
75
                        <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
74
                        <td>[% item.itemnotes %]</td>
76
                        <td>[% item.itemnotes %]</td>
75
                    </tr>
77
                    </tr>
76
                [% END %]
78
                [% END %]
Lines 95-109 Link Here
95
                [% END %]
97
                [% END %]
96
            </select></li>
98
            </select></li>
97
99
98
    <li><label for="loststatusfilter">Lost status: </label><select name="loststatusfilter" id="loststatusfilter">
100
    <li>
99
                <option value="">All</option>
101
        <label for="loststatusfilter">Lost status: </label>
100
                [% FOREACH loststatusloo IN loststatusloop %]
102
        <select name="loststatusfilter" id="loststatusfilter">
101
                [% IF ( loststatusloo.selected ) %]<option value="[% loststatusloo.authorised_value %]" selected="selected">[% loststatusloo.lib %]</option>
103
            <option value="">All</option>
102
		[% ELSE %]
104
            [% FOREACH l IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.itemlost') %]
103
		<option value="[% loststatusloo.authorised_value %]">[% loststatusloo.lib %]</option>
105
                [% IF l.authorised_value == lostfilter %]
104
		[% END %]
106
                    <option value="[% l.authorised_value %]" selected="selected">[% l.lib %]</option>
107
                [% ELSE %]
108
                    <option value="[% l.authorised_value %]">[% l.lib %]</option>
105
                [% END %]
109
                [% END %]
106
            </select></li>
110
            [% END %]
111
        </select>
112
    </li>
113
114
    <li>
115
        <label for="notforloanfilter">Not for loan: </label>
116
        <select name="notforloanfilter" id="notforloanfilter">
117
            <option value="">All</option>
118
            [% FOREACH n IN AuthorisedValues.GetDescriptionsByKohaField( kohafield => 'items.notforloan') %]
119
                [% IF n.authorised_value == notforloanfilter %]
120
                    <option value="[% n.authorised_value %]" selected="selected">[% n.lib %]</option>
121
                [% ELSE %]
122
                    <option value="[% n.authorised_value %]">[% n.lib %]</option>
123
                [% END %]
124
            [% END %]
125
        </select>
126
    </li>
127
107
</ol></fieldset>
128
</ol></fieldset>
108
<fieldset class="action">    <input type="submit" value="Submit" />
129
<fieldset class="action">    <input type="submit" value="Submit" />
109
    <input type="hidden" name="get_items" value="1" /></fieldset>
130
    <input type="hidden" name="get_items" value="1" /></fieldset>
(-)a/reports/itemslost.pl (-6 / +9 lines)
Lines 32-37 use C4::Auth; Link Here
32
use C4::Output;
32
use C4::Output;
33
use C4::Biblio;
33
use C4::Biblio;
34
use C4::Items;
34
use C4::Items;
35
36
use Koha::AuthorisedValues;
35
use Koha::DateUtils;
37
use Koha::DateUtils;
36
38
37
my $query = new CGI;
39
my $query = new CGI;
Lines 54-59 if ($get_items) { Link Here
54
    my $barcodefilter    = $params->{'barcodefilter'}    || undef;
56
    my $barcodefilter    = $params->{'barcodefilter'}    || undef;
55
    my $itemtypesfilter  = $params->{'itemtypesfilter'}  || undef;
57
    my $itemtypesfilter  = $params->{'itemtypesfilter'}  || undef;
56
    my $loststatusfilter = $params->{'loststatusfilter'} || undef;
58
    my $loststatusfilter = $params->{'loststatusfilter'} || undef;
59
    my $notforloanfilter = $params->{'notforloanfilter'} || undef;
57
60
58
    my $params = {
61
    my $params = {
59
        ( $branchfilter ? ( homebranch => $branchfilter ) : () ),
62
        ( $branchfilter ? ( homebranch => $branchfilter ) : () ),
Lines 62-67 if ($get_items) { Link Here
62
            ? ( itemlost => $loststatusfilter )
65
            ? ( itemlost => $loststatusfilter )
63
            : ( itemlost => { '!=' => 0 } )
66
            : ( itemlost => { '!=' => 0 } )
64
        ),
67
        ),
68
        (
69
            $notforloanfilter
70
            ? ( notforloan => $notforloanfilter )
71
            : ()
72
        ),
65
        ( $barcodefilter ? ( barcode => { like => "%$barcodefilter%" } ) : () ),
73
        ( $barcodefilter ? ( barcode => { like => "%$barcodefilter%" } ) : () ),
66
    };
74
    };
67
75
Lines 88-99 if ($get_items) { Link Here
88
# getting all itemtypes
96
# getting all itemtypes
89
my $itemtypes = Koha::ItemTypes->search_with_localization;
97
my $itemtypes = Koha::ItemTypes->search_with_localization;
90
98
91
# get lost statuses
92
my $lost_status_loop = C4::Koha::GetAuthorisedValues( 'LOST' );
93
94
$template->param(
99
$template->param(
95
                  itemtypes => $itemtypes,
100
    itemtypes => $itemtypes,
96
                  loststatusloop => $lost_status_loop,
97
);
101
);
98
102
99
# writing the template
103
# writing the template
100
- 

Return to bug 9573