Bugzilla – Attachment 72672 Details for
Bug 20343
Show number of checkouts by itemtype in circulation.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20343: Show number of checkouts by itemtype in circulation.pl
Bug-20343-Show-number-of-checkouts-by-itemtype-in-.patch (text/plain), 3.46 KB, created by
Biblibre Sandboxes
on 2018-03-12 11:42:32 UTC
(
hide
)
Description:
Bug 20343: Show number of checkouts by itemtype in circulation.pl
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2018-03-12 11:42:32 UTC
Size:
3.46 KB
patch
obsolete
>From 594322d59a384ea1537a3b43ec9a97e267356264 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 6 Mar 2018 14:47:46 +0100 >Subject: [PATCH] Bug 20343: Show number of checkouts by itemtype in > circulation.pl > >It is sometimes useful to have the number of checkouts grouped by >itemtype (to see if we're approaching the maximum number of checkouts >allowed for instance). >This patch adds this information above the checkouts table, in >circ/circulation.pl > >Test plan: >1. Check out some items with various item types to a patron >2. In circ/circulation.pl, click on 'Show checkouts' button to display > the table >3. Notice the line "Number of checkouts by item type" above the table, > click on it >4. See that the list of item types is displayed with a count in front of > each one >5. Compare the numbers to the checkouts in the table and verify that the > numbers are correct > >Signed-off-by: claude <claude.brayer@cea.fr> >--- > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 15 +++++++++++++++ > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 19 ++++++++++++++++++- > 2 files changed, 33 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index 3ab9d7e..e1b8f81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >@@ -385,6 +385,21 @@ legend { > width: auto; > } > >+details > summary { >+ cursor: pointer; >+} >+ >+details > summary::before { >+ content: "\f0da"; >+ display: inline-block; >+ font-family: FontAwesome; >+ width: 1em; >+} >+ >+details[open] > summary::before { >+ content: "\f0d7"; >+} >+ > #floating-save { > background-color: rgba(185, 216, 217, 0.6); > bottom: 3%; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 5167ee1..5718bbc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -475,7 +475,7 @@ $(document).ready(function() { > fnCallback(json) > } ); > }, >- "fnInitComplete": function(oSettings) { >+ "fnInitComplete": function(oSettings, json) { > // Disable rowGrouping plugin after first use > // so any sorting on the table doesn't use it > var oSettings = issuesTable.fnSettings(); >@@ -488,6 +488,23 @@ $(document).ready(function() { > } > > oSettings.aaSortingFixed = null; >+ >+ // 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; >+ return obj; >+ }, {}); >+ var ul = $('<ul>'); >+ Object.keys(checkoutsByItype).sort().forEach(function (itype) { >+ var li = $('<li>') >+ .append($('<strong>').html(itype || _("No itemtype"))) >+ .append(': ' + checkoutsByItype[itype]); >+ ul.append(li); >+ }) >+ $('<details>') >+ .append($('<summary>').html(_("Number of checkouts by item type"))) >+ .append(ul) >+ .insertBefore(oSettings.nTableWrapper) > }, > }, columns_settings).rowGrouping( > { >-- >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 20343
:
72482
|
72671
|
72672
|
72675
|
73475
|
74430
|
74431
|
74432
|
74433