Bugzilla – Attachment 17185 Details for
Bug 9987
biblioitemnumber is useless for orders.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9987: Add itemtype description instead of code
Bug-9987-Add-itemtype-description-instead-of-code.patch (text/plain), 4.93 KB, created by
Jonathan Druart
on 2013-04-04 10:25:10 UTC
(
hide
)
Description:
Bug 9987: Add itemtype description instead of code
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-04-04 10:25:10 UTC
Size:
4.93 KB
patch
obsolete
>From d3c1af53d1a963924c332861b172027b3eb5d17d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 4 Apr 2013 12:09:37 +0200 >Subject: [PATCH] Bug 9987: Add itemtype description instead of code > >In ordered.pl and spent.pl, the codes are displayed, instead of >descriptions. > >Links for the ordernumber should be changed. In ordered.pl, we are >redirected to the receive page. In spent.pl, the links are deleted. >--- > Koha/Template/Plugin/KohaItemType.pm | 44 ++++++++++++++++++++ > .../intranet-tmpl/prog/en/modules/acqui/ordered.tt | 5 ++- > .../intranet-tmpl/prog/en/modules/acqui/spent.tt | 5 ++- > 3 files changed, 50 insertions(+), 4 deletions(-) > create mode 100644 Koha/Template/Plugin/KohaItemType.pm > >diff --git a/Koha/Template/Plugin/KohaItemType.pm b/Koha/Template/Plugin/KohaItemType.pm >new file mode 100644 >index 0000000..efa3da3 >--- /dev/null >+++ b/Koha/Template/Plugin/KohaItemType.pm >@@ -0,0 +1,44 @@ >+package Koha::Template::Plugin::KohaItemType; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+use Template::Plugin; >+use base qw( Template::Plugin ); >+ >+use C4::Koha; >+ >+=pod >+ >+This plugin allows one to get the description for an item type from within a template. >+ >+First, include the line '[% USE KohaItemType %]' at the top >+of the template to enable the plugin. >+ >+To use, call KohaItemType.GetByCode with the code of the item type. >+ >+For example: [% KohaItemType.GetByCode( 'CF' ) %] >+will print the OPAC description for the CF value stored in itemtypes.description. >+ >+=cut >+ >+sub GetByCode { >+ my ( $self, $code ) = @_; >+ my $itemtype = getitemtypeinfo( $code ); >+ return $itemtype->{description}; >+} >+ >+1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt >index 23441f8..56ce1ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE KohaItemType %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Ordered</title> > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >@@ -59,7 +60,7 @@ > </td> > <td class="cell"> > [% IF ( CAN_user_acquisition_order_manage ) %] >- <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber %]&booksellerid=[% order.booksellerid %]&basketno=[% order.basketno %]">[% order.ordernumber %]</a> >+ <a href="/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=[% order.ordernumber %]&biblio=[% order.biblionumber %]&invoiceid=[% order.invoiceid %]">[% order.ordernumber %]</a> > [% ELSE %] > [% order.ordernumber %] > [% END %] >@@ -68,7 +69,7 @@ > <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a> > </td> > <td class="cell"> >- [% order.itype %] >+ [% KohaItemType.GetByCode( order.itype ) %] > </td> > <td class="cell"> > [% order.left %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >index 95634d0..8e7b6b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE KohaItemType %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Spent</title> > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >@@ -62,7 +63,7 @@ > [% order.title %] > </td> > <td class="cell"> >- <a href="/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=[% order.ordernumber %]&biblio=[% order.biblionumber %]&invoiceid=[% order.invoiceid %]">[% order.ordernumber %]</a> >+ [% order.ordernumber %] > </td> > <td class="cell"> > <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a> >@@ -71,7 +72,7 @@ > <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a> > </td> > <td class="cell"> >- [% order.itype %] >+ [% KohaItemType.GetByCode( order.itype ) %] > </td> > <td class="cell"> > [% order.quantityreceived %] >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9987
:
17184
|
17185
|
17435
|
17436
|
17575
|
19016