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

(-)a/Koha/Template/Plugin/KohaItemType.pm (+44 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::KohaItemType;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
use Template::Plugin;
20
use base qw( Template::Plugin );
21
22
use C4::Koha;
23
24
=pod
25
26
This plugin allows one to get the description for an item type from within a template.
27
28
First, include the line '[% USE KohaItemType %]' at the top
29
of the template to enable the plugin.
30
31
To use, call KohaItemType.GetByCode with the code of the item type.
32
33
For example: [% KohaItemType.GetByCode( 'CF' ) %]
34
will print the OPAC description for the CF value stored in itemtypes.description.
35
36
=cut
37
38
sub GetByCode {
39
    my ( $self, $code ) = @_;
40
    my $itemtype = getitemtypeinfo( $code );
41
    return $itemtype->{description};
42
}
43
44
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt (-2 / +3 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE KohaItemType %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Ordered</title>
4
<title>Koha &rsaquo; Acquisitions &rsaquo; Ordered</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 59-65 Link Here
59
	</td>
60
	</td>
60
	<td class="cell">
61
	<td class="cell">
61
        [% IF ( CAN_user_acquisition_order_manage ) %]
62
        [% IF ( CAN_user_acquisition_order_manage ) %]
62
            <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber %]&amp;booksellerid=[% order.booksellerid %]&amp;basketno=[% order.basketno %]">[% order.ordernumber %]</a>
63
            <a href="/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=[% order.ordernumber %]&amp;biblio=[% order.biblionumber %]&amp;invoiceid=[% order.invoiceid %]">[% order.ordernumber %]</a>
63
        [% ELSE %]
64
        [% ELSE %]
64
            [% order.ordernumber %]
65
            [% order.ordernumber %]
65
        [% END %]
66
        [% END %]
Lines 68-74 Link Here
68
	    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a>
69
	    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a>
69
	</td>
70
	</td>
70
	<td class="cell">
71
	<td class="cell">
71
	    [% order.itype %]
72
        [% KohaItemType.GetByCode( order.itype ) %]
72
	</td>
73
	</td>
73
	<td class="cell">
74
	<td class="cell">
74
	    [% order.left %]
75
	    [% order.left %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt (-3 / +3 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE KohaItemType %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Spent</title>
4
<title>Koha &rsaquo; Acquisitions &rsaquo; Spent</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 62-68 Link Here
62
	    [% order.title %]
63
	    [% order.title %]
63
	</td>
64
	</td>
64
	<td class="cell">
65
	<td class="cell">
65
            <a href="/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=[% order.ordernumber %]&amp;biblio=[% order.biblionumber %]&amp;invoiceid=[% order.invoiceid %]">[% order.ordernumber %]</a>
66
        [% order.ordernumber %]
66
	</td>
67
	</td>
67
	<td class="cell">
68
	<td class="cell">
68
	    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a>
69
	    <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a>
Lines 71-77 Link Here
71
	    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a>
72
	    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a>
72
	</td>
73
	</td>
73
	<td class="cell">
74
	<td class="cell">
74
	    [% order.itype %]
75
        [% KohaItemType.GetByCode( order.itype ) %]
75
	</td>
76
	</td>
76
	<td class="cell">
77
	<td class="cell">
77
	    [% order.quantityreceived %]
78
	    [% order.quantityreceived %]
78
- 

Return to bug 10090