Bugzilla – Attachment 93044 Details for
Bug 23602
Library limitations should display in the item types table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23602: Display branch limitations in itemtype table
Bug-23602-Display-branch-limitations-in-itemtype-t.patch (text/plain), 3.54 KB, created by
Maryse Simard
on 2019-09-20 19:31:27 UTC
(
hide
)
Description:
Bug 23602: Display branch limitations in itemtype table
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-09-20 19:31:27 UTC
Size:
3.54 KB
patch
obsolete
>From 6947895502499e190ea3eb029ae1d75f95a894f4 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Fri, 13 Sep 2019 10:55:30 -0300 >Subject: [PATCH] Bug 23602: Display branch limitations in itemtype table > >This patch adds a column in itemtype table to display branch limitations. > >To test: >1) Open item types admin page. >CHECK => there is no column for branch limitations, even if you add a limitation in an item type. >2) Apply this patch >SUCCESS => A new column appears that displays branch limitations per item type >3) Sign off > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > admin/itemtypes.pl | 10 ++++++++-- > .../intranet-tmpl/prog/en/modules/admin/itemtypes.tt | 17 +++++++++++++++++ > 2 files changed, 25 insertions(+), 2 deletions(-) > >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 80b13c6..05f394e 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -196,9 +196,15 @@ if ( $op eq 'add_form' ) { > } > > if ( $op eq 'list' ) { >- my $itemtypes = Koha::ItemTypes->search; >+ my @itypes = Koha::ItemTypes->search->as_list; >+ my @itemtypes; >+ foreach my $itype (@itypes) { >+ my $itemtype = $itype->unblessed; >+ $itemtype->{branches} = $itype->library_limits ? $itype->library_limits->as_list : []; >+ push @itemtypes, $itemtype; >+ } > $template->param( >- itemtypes => $itemtypes, >+ itemtypes => \@itemtypes, > messages => \@messages, > ); > } >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 6ac7988..715a71b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -359,6 +359,7 @@ Item types administration > <th>Default replacement cost</th> > <th>Processing fee (when lost)</th> > <th>Checkin message</th> >+ <th>Branches limitations</th> > <th>Actions</th> > </thead> > [% FOREACH itemtype IN itemtypes %] >@@ -411,6 +412,22 @@ Item types administration > <td>[% itemtype.defaultreplacecost | $Price %]</td> > <td>[% itemtype.processfee | $Price %]</td> > <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td> >+ <td> >+ [% IF itemtype.branches.size > 0 %] >+ [% branches_str = "" %] >+ [% FOREACH branch IN itemtype.branches %] >+ [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %] >+ [% END %] >+ <span href="#" title="[% branches_str | html %]"> >+ [% IF itemtype.branches.size > 1 %] >+ [% itemtype.branches.size | html %] branches limitations >+ [% ELSE %] >+ [% itemtype.branches.size | html %] branch limitation >+ [% END %] >+ [% ELSE %] >+ No limitation >+ [% END %] >+ </td> > <td class="actions"> > <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> > <a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a> >-- >2.7.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 23602
:
92800
|
92815
|
92816
|
93044
|
93046
|
93200
|
93201
|
93202
|
93205