Bugzilla – Attachment 94947 Details for
Bug 20194
Display both biblioitems.itemtype and items.itype in circulation screens
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20194: Display both biblioitems.itemtype and items.itype in circulation screens
Bug-20194-Display-both-biblioitemsitemtype-and-ite.patch (text/plain), 10.59 KB, created by
Martin Renvoize (ashimema)
on 2019-11-01 11:16:04 UTC
(
hide
)
Description:
Bug 20194: Display both biblioitems.itemtype and items.itype in circulation screens
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-01 11:16:04 UTC
Size:
10.59 KB
patch
obsolete
>From bf694b3c2d0df1977e4fe22c16a2702beb42dcc4 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Thu, 25 Oct 2018 11:19:01 +0200 >Subject: [PATCH] Bug 20194: Display both biblioitems.itemtype and items.itype > in circulation screens > >Test plan: >1. Verify that biblioitems.itemtype, items.itype are > mapped to a MARC field. Otherwise create those mappings. >2. Create a biblio with an itemtype >3. Create an item with a different itemtype for this biblio >4. Check out this item to a patron (P1) >5. Verify that both itemtypes are displayed in the >checkouts table (moremember.pl, circulation.pl, returns.pl) >6. Create a patron whose guarantor is P1 and verify that both itemtypes >and the ccode are displayed in the 'relatives checkouts' table > >Followed test plan, patch worked as described, also passes QA test tool >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > admin/columns_settings.yml | 6 ++++++ > circ/returns.pl | 4 +++- > .../prog/en/includes/checkouts-table-footer.inc | 2 +- > .../prog/en/includes/checkouts-table.inc | 1 + > .../prog/en/includes/relatives-issues-table.inc | 1 + > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 8 ++++++-- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 12 +++++++++++- > svc/checkouts | 7 +++++-- > 8 files changed, 34 insertions(+), 7 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 4b8600367c..c1fdf398ca 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -582,6 +582,8 @@ modules: > columnname: due_date > - > columnname: title >+ - >+ columnname: record_type > - > columnname: item_type > - >@@ -795,6 +797,8 @@ modules: > columnname: due_date > - > columnname: title >+ - >+ columnname: record_type > - > columnname: item_type > - >@@ -869,6 +873,8 @@ modules: > - > columnname: dateaccessioned > is_hidden: 1 >+ - >+ columnname: record_type > - > columnname: itype > - >diff --git a/circ/returns.pl b/circ/returns.pl >index ddce95ab75..5e7d8e24bc 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -589,6 +589,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { > my $item = Koha::Items->find({ barcode => $bar_code }); > next unless $item; # FIXME The item has been deleted in the meantime, > # we could handle that better displaying a message in the template >+ > my $biblio = $item->biblio; > # FIXME pass $item to the template and we are done here... > $ri{itembiblionumber} = $biblio->biblionumber; >@@ -599,7 +600,8 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { > $ri{itemauthor} = $biblio->author; > $ri{itemcallnumber} = $item->itemcallnumber; > $ri{dateaccessioned} = $item->dateaccessioned; >- $ri{itemtype} = $item->effective_itemtype; >+ $ri{recordtype} = $biblio->itemtype; >+ $ri{itemtype} = $item->itype; > $ri{itemnote} = $item->itemnotes; > $ri{itemnotes_nonpublic} = $item->itemnotes_nonpublic; > $ri{ccode} = $item->ccode; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc >index 931d92f36c..9b62491d4a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc >@@ -1,6 +1,6 @@ > <tfoot> > <tr> >- <td colspan="13" style="text-align: right; font-weight:bold;">Totals:</td> >+ <td colspan="14" style="text-align: right; font-weight:bold;">Totals:</td> > <td id="totaldue" style="text-align: right;"></td> > <td id="totalfine" style="text-align: right;"></td> > <td id="totalprice" style="text-align: right;"></td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index f1bc60ff4b..7b967bec89 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -15,6 +15,7 @@ > <th scope="col">Due date</th> > <th scope="col">Due date</th> > <th scope="col">Title</th> >+ <th scope="col">Record-level item type</th> > <th scope="col">Item type</th> > <th scope="col">Collection</th> > <th scope="col">Location</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/relatives-issues-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/relatives-issues-table.inc >index 28addf4815..97e9ba6bd1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/relatives-issues-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/relatives-issues-table.inc >@@ -7,6 +7,7 @@ > <th scope="col">Due date (unformatted, hidden)</th> > <th scope="col">Due date</th> > <th scope="col">Title</th> >+ <th scope="col">Record-level item type</th> > <th scope="col">Item type</th> > <th scope="col">Collection code</th> > <th scope="col">Location</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index bafaf0e955..a65294b985 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -794,7 +794,8 @@ > <th class="ci-shelvinglocation">Shelving location</th> > <th class="ci-callnumber">Call number</th> > <th class="ci-dateaccessioned">Date acquired</th> >- <th class="ci-type">Type</th> >+ <th class="ci-recordlevelitemtype">Record-level itemtype</th> >+ <th class="ci-itemtype">Item type</th> > <th class="ci-patron">Patron</th> > <th class="ci-note">Note</th> > </tr> >@@ -844,7 +845,10 @@ > <td class="ci-dateaccessioned"> > [% riloo.dateaccessioned | $KohaDates %] > </td> >- <td class="ci-type"> >+ <td class="ci-recordlevelitemtype"> >+ [% ItemTypes.GetDescription( riloo.recordtype ) | html %] >+ </td> >+ <td class="ci-itemtype"> > [% ItemTypes.GetDescription( riloo.itemtype ) | html %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) | html %] > </td> > <td class="ci-patron"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 2bfd18e6cf..d07f8200cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -346,6 +346,11 @@ $(document).ready(function() { > }, > "sType": "anti-the" > }, >+ { >+ "mDataProp": function ( oObj ) { >+ return oObj.recordtype_description.escapeHtml(); >+ } >+ }, > { > "mDataProp": function ( oObj ) { > return oObj.itemtype_description.escapeHtml(); >@@ -607,7 +612,7 @@ $(document).ready(function() { > > // Build a summary of checkouts grouped by itemtype > var checkoutsByItype = json.aaData.reduce(function (obj, row) { >- obj[row.itemtype_description] = (obj[row.itemtype_description] || 0) + 1; >+ obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1; > return obj; > }, {}); > var ul = $('<ul>'); >@@ -724,6 +729,11 @@ $(document).ready(function() { > }, > "sType": "anti-the" > }, >+ { >+ "mDataProp": function ( oObj ) { >+ return oObj.recordtype_description.escapeHtml(); >+ } >+ }, > { > "mDataProp": function ( oObj ) { > return oObj.itemtype_description.escapeHtml(); >diff --git a/svc/checkouts b/svc/checkouts >index 053b589843..2da2b0177b 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -161,7 +161,9 @@ while ( my $c = $sth->fetchrow_hashref() ) { > my ( $renewals_count, $renewals_allowed, $renewals_remaining ) = > GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); > >- my $itemtype = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); >+ my $type_for_stat = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); >+ my $itemtype = Koha::ItemTypes->find( $c->{itype} ); >+ my $recordtype = Koha::ItemTypes->find( $c->{itemtype} ); > my $location; > if ( $c->{location} ) { > my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); >@@ -194,8 +196,9 @@ while ( my $c = $sth->fetchrow_hashref() ) { > part_name => $c->{part_name} // '', > author => $c->{author}, > barcode => $c->{barcode}, >- itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, >+ type_for_stat => $type_for_stat ? $type_for_stat->translated_description : q{}, > itemtype_description => $itemtype ? $itemtype->translated_description : q{}, >+ recordtype_description => $recordtype ? $recordtype->translated_description : q{}, > collection => $collection, > location => $location, > homebranch => $c->{homebranch}, >-- >2.20.1
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 20194
:
71613
|
71614
|
71615
|
81161
|
81202
|
93221
| 94947