Bugzilla – Attachment 89171 Details for
Bug 21946
Group circulation by item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21946: Fix display of parent types
Bug-21946-Fix-display-of-parent-types.patch (text/plain), 6.63 KB, created by
Nick Clemens (kidclamp)
on 2019-05-01 11:02:35 UTC
(
hide
)
Description:
Bug 21946: Fix display of parent types
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-05-01 11:02:35 UTC
Size:
6.63 KB
patch
obsolete
>From 759aeaa39e63fa850f2daed80a0dafbae72b60e9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywateersolutions.com> >Date: Fri, 5 Apr 2019 13:40:30 +0000 >Subject: [PATCH] Bug 21946: Fix display of parent types > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >--- > Koha/ItemType.pm | 13 +++++ > admin/itemtypes.pl | 2 +- > .../prog/en/modules/admin/itemtypes.tt | 57 +++++++++++++++------- > 3 files changed, 54 insertions(+), 18 deletions(-) > >diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm >index 63c113c83d..cfdd6d03fb 100644 >--- a/Koha/ItemType.pm >+++ b/Koha/ItemType.pm >@@ -125,6 +125,19 @@ sub may_article_request { > return ( $guess->{ $itemtype // q{} } || $guess->{ '*' } ) ? 1 : q{}; > } > >+=head3 parent >+ >+ Returns the ItemType object of the parent_type or undef. >+ >+=cut >+ >+sub parent { >+ my ( $self ) = @_; >+ my $parent_rs = $self->_result->parent_type; >+ return unless $parent_rs; >+ return Koha::ItemType->_new_from_dbic( $parent_rs ); >+ >+} > =head3 type > > =cut >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 79ee3f1a9d..546e54288b 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -75,7 +75,7 @@ if ( $op eq 'add_form' ) { > } elsif ( $op eq 'add_validate' ) { > my $is_a_modif = $input->param('is_a_modif'); > my $itemtype = Koha::ItemTypes->find($itemtype_code); >- my $parent_type = $input->param('parent_type'); >+ my $parent_type = $input->param('parent_type') || undef; > my $description = $input->param('description'); > my $rentalcharge = $input->param('rentalcharge'); > my $rentalcharge_daily = $input->param('rentalcharge_daily'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index 2e8a06a3f2..cd380a87b8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -118,6 +118,7 @@ Item types administration > <label for="parent_type">Parent item type: </label> > [% IF !is_a_parent && parent_types %] > <select name="parent_type" id="parent_type"> >+ <option value="">None</option> > [% FOREACH pt IN parent_types %] > [% IF parent_type == pt.itemtype %] > <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option> >@@ -355,9 +356,9 @@ Item types administration > <table id="table_item_type"> > <thead> > [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %] >+ <th>Description</th> > <th>Code</th> > <th>Parent code</th> >- <th>Description</th> > <th>Search category</th> > <th>Not for loan</th> > <th>Hide in OPAC</th> >@@ -378,6 +379,43 @@ Item types administration > </td> > [% END %] > <td> >+ [% IF itemtype.parent_type %] >+ [% IF itemtype.parent.translated_descriptions.size %] >+ [% itemtype.parent.description | html %] (default)<br/> >+ [% ELSE %] >+ [% itemtype.parent.description | html %] >+ [% END %] >+ </br> >+ [% IF itemtype.translated_descriptions.size %] >+ [% itemtype.description | html %] (default)<br/> >+ [% FOR description IN itemtype.translated_descriptions %] >+ [% IF description.translation == itemtype.translated_description %] >+ -- <b>[% description.translation | html %]</b> >+ [% ELSE %] >+ -- [% description.translation | html %] ([% description.lang | html %]) >+ [% END %] >+ <br/> >+ [% END %] >+ [% ELSE %] >+ -- [% itemtype.description | html %] >+ [% END %] >+ [% ELSE %] >+ [% IF itemtype.translated_descriptions.size %] >+ [% itemtype.description | html %] (default)<br/> >+ [% FOR description IN itemtype.translated_descriptions %] >+ [% IF description.translation == itemtype.translated_description %] >+ <b>[% description.translation | html %]</b> >+ [% ELSE %] >+ [% description.translation | html %] ([% description.lang | html %]) >+ [% END %] >+ <br/> >+ [% END %] >+ [% ELSE %] >+ [% itemtype.description | html %] >+ [% END %] >+ [% END %] >+ </td> >+ <td> > <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]"> > [% itemtype.itemtype | html %] > </a> >@@ -385,21 +423,6 @@ Item types administration > <td> > [% itemtype.parent_type | html %] > </td> >- <td> >- [% IF itemtype.translated_descriptions.size %] >- [% itemtype.description | html %] (default)<br/> >- [% FOR description IN itemtype.translated_descriptions %] >- [% IF description.translation == itemtype.translated_description %] >- <b>[% description.translation | html %]</b> >- [% ELSE %] >- [% description.translation | html %] ([% description.lang | html %]) >- [% END %] >- <br/> >- [% END %] >- [% ELSE %] >- [% itemtype.description | html %] >- [% END %] >- </td> > <td>[% itemtype.searchcategory | html %]</td> > <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td> > <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td> >@@ -455,7 +478,7 @@ Item types administration > "aoColumnDefs": [ > { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, > ], >- "aaSorting": [[ 2, "asc" ]], >+ "aaSorting": [[ 1, "asc" ]], > "iDisplayLength": 10, > "sPaginationType": "four_button" > })); >-- >2.11.0
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 21946
:
87713
|
87714
|
87715
|
87716
|
87717
|
87718
|
87719
|
88392
|
88574
|
88575
|
88576
|
88577
|
88578
|
88579
|
88580
|
88581
|
88926
|
88927
|
88928
|
88929
|
88930
|
88931
|
88932
|
88933
|
88934
|
89167
|
89168
|
89169
|
89170
|
89171
|
89172
|
89173
|
89174
|
89175
|
89176
|
93075
|
93076
|
93077
|
93078
|
93079
|
93080
|
93081
|
93082
|
93083
|
93084
|
93086
|
93087
|
93088
|
93089
|
93090
|
93091
|
93092
|
93093
|
93094
|
93095
|
93096
|
93097
|
93098
|
93099
|
93100
|
93101
|
93102
|
93103
|
93104
|
93105
|
96977
|
96978
|
96979
|
96980
|
96981
|
96982
|
96983
|
96984
|
96985
|
96986
|
96987
|
99419
|
99420
|
99421
|
99422
|
99423
|
99424
|
107035
|
107036
|
107037
|
107038
|
107039
|
107040
|
107041
|
107278
|
107279
|
107280
|
107281
|
107282
|
107283
|
107284
|
107467
|
107489
|
107686
|
107687
|
107688
|
107689
|
107690
|
107691
|
107692
|
107693
|
107694
|
107701
|
107733