Bugzilla – Attachment 71613 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 ccode and both itemtypes in checkouts tables
Bug-20194-Display-ccode-and-both-itemtypes-in-chec.patch (text/plain), 8.08 KB, created by
Julian Maurice
on 2018-02-14 14:56:00 UTC
(
hide
)
Description:
Bug 20194: Display ccode and both itemtypes in checkouts tables
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-02-14 14:56:00 UTC
Size:
8.08 KB
patch
obsolete
>From a9f553e3219d1def6a22df41664d594b41fbd9ac Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 14 Feb 2018 12:05:59 +0100 >Subject: [PATCH] Bug 20194: Display ccode and both itemtypes in checkouts > tables > >Test plan: >1. Verify that biblioitems.itemtype, items.itype and items.ccode are > mapped to a MARC field. Otherwise create those mappings. >2. Create a biblio with an itemtype >3. Create an item with a ccode and a different itemtype for this biblio >4. Check out this item to a patron (P1) >5. Verify that both itemtypes and the ccode are displayed in the >checkouts table >6. Create a patron whose guarantor is P1 and verify that both itemtypes >and the ccode are displayed in the 'relatives checkouts' table >--- > admin/columns_settings.yml | 2 ++ > .../prog/en/includes/checkouts-table-footer.inc | 2 +- > .../prog/en/includes/checkouts-table.inc | 1 + > .../prog/en/modules/circ/circulation.tt | 1 + > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 34 ++++++++++++++++++++-- > svc/checkouts | 21 +++++++++++-- > 6 files changed, 55 insertions(+), 6 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 61fa864b38..244f087afc 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -336,6 +336,8 @@ modules: > columnname: title > - > columnname: item_type >+ - >+ columnname: ccode > - > columnname: location > - >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 3adbfa326a..415e1d5b17 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="11" style="text-align: right; font-weight:bold;">Totals:</td> >+ <td colspan="12" style="text-align: right; font-weight:bold;">Totals:</td> > <td id="totaldue" style="text-align: right;">[% totaldue %]</td> > <td id="totalfine" style="text-align: right;">[% finetotal %]</td> > <td id="totalprice" style="text-align: right;">[% totalprice %]</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 b34089d3c7..f7c68218c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -16,6 +16,7 @@ > <th scope="col">Due date</th> > <th scope="col">Title</th> > <th scope="col">Item type</th> >+ <th scope="col">Collection</th> > <th scope="col">Location</th> > <th scope="col">Home library</th> > <th scope="col">Checked out on</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index d47d7037e9..1c0d00b32e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -980,6 +980,7 @@ No patron matched <span class="ex">[% message | html %]</span> > <th scope="col">Due date</th> > <th scope="col">Title</th> > <th scope="col">Item type</th> >+ <th scope="col">Collection</th> > <th scope="col">Location</th> > <th scope="col">Checked out on</th> > <th scope="col">Checked out from</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 1d16823045..2a3c104a7e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -290,7 +290,22 @@ $(document).ready(function() { > }, > "sType": "anti-the" > }, >- { "mDataProp": "itemtype_description" }, >+ { >+ "mDataProp": function ( oObj ) { >+ let itemtypes = []; >+ >+ if ('itemtype' in oObj.itemtypes) { >+ itemtypes.push(oObj.itemtypes.itemtype.translated_description); >+ } >+ >+ if ('itype' in oObj.itemtypes) { >+ itemtypes.push(oObj.itemtypes.itype.translated_description); >+ } >+ >+ return itemtypes.join('<br>'); >+ } >+ }, >+ { "mDataProp": "ccode" }, > { "mDataProp": "location" }, > { "mDataProp": "homebranch" }, > { "mDataProp": "issuedate_formatted" }, >@@ -588,7 +603,22 @@ $(document).ready(function() { > }, > "sType": "anti-the" > }, >- { "mDataProp": "itemtype" }, >+ { >+ "mDataProp": function ( oObj ) { >+ let itemtypes = []; >+ >+ if ('itemtype' in oObj.itemtypes) { >+ itemtypes.push(oObj.itemtypes.itemtype.translated_description); >+ } >+ >+ if ('itype' in oObj.itemtypes) { >+ itemtypes.push(oObj.itemtypes.itype.translated_description); >+ } >+ >+ return itemtypes.join('<br>'); >+ } >+ }, >+ { "mDataProp": "ccode" }, > { "mDataProp": "location" }, > { "mDataProp": "issuedate_formatted" }, > { "mDataProp": "branchname" }, >diff --git a/svc/checkouts b/svc/checkouts >index fefadeeeea..5bf55f87ea 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -87,6 +87,7 @@ my $sql = ' > issues.branchcode, > branches.branchname, > >+ items.ccode, > items.itype, > biblioitems.itemtype, > >@@ -148,7 +149,16 @@ 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 $itemtypes; >+ foreach my $key (qw(itemtype itype)) { >+ if ($c->{$key}) { >+ my $itemtype = Koha::ItemTypes->find($c->{$key}); >+ if ($itemtype) { >+ $itemtypes->{$key} = $itemtype->TO_JSON; >+ $itemtypes->{$key}->{translated_description} = $itemtype->translated_description; >+ } >+ } >+ } > my $location; > if ( $c->{location} ) { > my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); >@@ -164,13 +174,18 @@ while ( my $c = $sth->fetchrow_hashref() ) { > my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); > $damaged = $av->count ? $av->next->lib : ''; > } >+ my $ccode; >+ if ($c->{ccode}) { >+ my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $c->{ccode} }); >+ $ccode = $av->count ? $av->next->lib : $c->{ccode}; >+ } > my $checkout = { > DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, > title => $c->{title}, > author => $c->{author}, > barcode => $c->{barcode}, >- itemtype => $item_level_itypes ? $c->{itype} : $c->{itemtype}, >- itemtype_description => $itemtype ? $itemtype->translated_description : q{}, >+ itemtypes => $itemtypes, >+ ccode => $ccode, > location => $location, > homebranch => $c->{homebranch}, > itemnotes => $c->{itemnotes}, >-- >2.14.2
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