Bugzilla – Attachment 127245 Details for
Bug 28450
Make Account summary print tables configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28450: Make Account summary print tables configurable
Bug-28450-Make-Account-summary-print-tables-config.patch (text/plain), 19.64 KB, created by
Jonathan Druart
on 2021-11-03 12:11:10 UTC
(
hide
)
Description:
Bug 28450: Make Account summary print tables configurable
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-11-03 12:11:10 UTC
Size:
19.64 KB
patch
obsolete
>From 5aa0b0598f3f0cd3878a32c5f34da40eacfaf643 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 12 Oct 2021 10:32:05 +0000 >Subject: [PATCH] Bug 28450: Make Account summary print tables configurable > >This patch adds table settings for the three tables which appear on the >patron's "Print summary" view. This will allow the administrator to >set a default configuration for columns on the print summary page. > >To test, apply the patch and restart-all to load the revised columns >settings YAML. Rebuild the staff interface SCSS >(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). > >- Go to Administration -> Table settings -> Circulation. >- Under the "Circulation tables" heading you should see a "Jump to" link > to "print_summary." >- In the settings for the print_summary page you should see three > tables: print-summary-checkouts, print-summary-fines, and > print-summary-holds. >- Locate a patron account which has checkouts, fines, and holds. > - From the patron detail view click "Print -> Print summary." > - A new window should open with the print summary view. All tables > should display correctly. > - Test that the "Columns" buttons work correctly to show and hide > columns. >- Make changes to the default settings for these tables to confirm that > they work on the print summary page. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > admin/columns_settings.yml | 50 ++++ > koha-tmpl/intranet-tmpl/prog/css/print.css | 4 +- > .../intranet-tmpl/prog/css/src/_tables.scss | 27 ++ > .../prog/css/src/staff-global.scss | 10 + > .../en/modules/members/moremember-print.tt | 281 ++++++++++++------ > 5 files changed, 278 insertions(+), 94 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 7ae940217c9..18f4ce0c0ee 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -1343,6 +1343,56 @@ modules: > - > columnname: non-public_note > >+ print_summary: >+ print-summary-checkouts: >+ columns: >+ - >+ columnname: title >+ - >+ columnname: author >+ - >+ columnname: call_number >+ - >+ columnname: item_type >+ - >+ columnname: date_due >+ - >+ columnname: barcode >+ - >+ columnname: inventory_number >+ - >+ columnname: charge >+ - >+ columnname: price >+ - >+ columnname: status >+ >+ print-summary-holds: >+ columns: >+ - >+ columnname: title >+ - >+ columnname: author >+ - >+ columnname: placed_on >+ - >+ columnname: expires_on >+ - >+ columnname: pick up_location >+ >+ print-summary-fines: >+ columns: >+ - >+ columnname: date >+ - >+ columnname: description_of_charges >+ - >+ columnname: note >+ - >+ columnname: amount >+ - >+ columnname: outstanding >+ > opac: > biblio-detail: > holdingst: >diff --git a/koha-tmpl/intranet-tmpl/prog/css/print.css b/koha-tmpl/intranet-tmpl/prog/css/print.css >index aa012990f5e..71915fc930f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/print.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/print.css >@@ -213,6 +213,7 @@ tfoot td, tfoot td:last-child { > } > > td.credit, td.debit, td.sum { >+ color: #000; > font-family : "Courier New", Courier, monospace; > text-align : right; > } >@@ -307,7 +308,8 @@ fieldset.action, > .print, > .ui-tabs-nav, > .browse-controls, >-.cart-controls { >+.cart-controls, >+button.dt-button { > display: none; > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss >index 44e2b32ae4e..138764992f4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss >@@ -26,6 +26,33 @@ table { > margin: 0 .5em 0 0; > } > } >+ >+ button { >+ &.dt-button { >+ background: transparent none; >+ border: 0; >+ color: #595959; >+ font-size: 60%; >+ margin: 0 .5em; >+ >+ &:hover:not(.disabled):active:not(.disabled) { >+ background: transparent none; >+ border: 0; >+ box-shadow: none; >+ color: #000; >+ } >+ >+ &:hover:not(.disabled) { >+ background: transparent none; >+ border: 0; >+ color: #000; >+ } >+ } >+ } >+ >+ div.dt-button-collection { >+ font-size: 70%; >+ } > } > > &.invis { >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index c2d2ff032ba..a10fb9ef120 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -2279,6 +2279,16 @@ td { > min-height: unset; > padding: 0; > } >+ >+ &.credit, >+ &.debit, >+ &.total { >+ text-align: right; >+ >+ tfoot & { >+ color: #000; >+ } >+ } > } > > .cover-image { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >index 5de14933b35..874df51a622 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >@@ -3,6 +3,7 @@ > [% USE KohaDates %] > [% USE Price %] > [% USE ItemTypes %] >+[% USE TablesSettings %] > [% PROCESS 'member-display-address-style.inc' %] > [% SET footerjs = 1 %] > >@@ -31,72 +32,108 @@ > </ul> > > [% IF ( issues ) %] >- <table> >+ <table id="print-summary-checkouts"> > <caption>Items checked out</caption> >- <tr> >- <th>Title</th> >- <th>Author</th> >- <th>Call number</th> >- <th>Item type</th> >- <th>Date due</th> >- <th>Barcode</th> >- <th>Inventory number</th> >- <th>Charge</th> >- <th>Price</th> >- <th>Status</th> >- </tr> >- >- [% FOREACH issue IN issues %] >- [% IF ( issue.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %] >- <td> >- [% issue.title | html %] >- <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issue.itemnumber | uri %]&biblionumber=[% issue.biblionumber | uri %]&bi=[% issue.biblioitemnumber | uri %]"></a> >+ <thead> >+ <tr> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Call number</th> >+ <th>Item type</th> >+ <th>Date due</th> >+ <th>Barcode</th> >+ <th>Inventory number</th> >+ <th>Charge</th> >+ <th>Price</th> >+ <th>Status</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH issue IN issues %] >+ <tr> >+ <td> >+ [% INCLUDE 'biblio-title.inc' biblio=issue link = 0 %] >+ </td> >+ <td>[% issue.author | html %]</td> >+ <td>[% issue.itemcallnumber | html %]</td> >+ <td>[% ItemTypes.GetDescription( issue.itype ) | html %]</td> >+ <td>[% issue.date_due | $KohaDates as_due_date => 1 %]</td> >+ <td>[% issue.barcode | html %]</td> >+ <td>[% issue.stocknumber | html %]</td> >+ [% IF ( issue.charge <= 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% issue.charge | $Price %] >+ </td> >+ [% IF ( issue.replacementprice <= 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% issue.replacementprice | $Price %] >+ </td> >+ <td>[% IF ( issue.overdue ) %]Overdue![% ELSE %] [% END %]</td> >+ </tr> >+ [% END %] >+ </tbody> >+ <tfoot> >+ <tr> >+ <td></td> >+ <td></td> >+ <td></td> >+ <td></td> >+ <td></td> >+ <td></td> >+ <td style="text-align: right; font-weight:bold;">Totals:</td> >+ [% IF ( totaldue <= 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% totaldue | $Price %] >+ </td> >+ [% IF ( totalprice <= 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% totalprice | $Price %] > </td> >- <td>[% issue.author | html %]</td> >- <td>[% issue.itemcallnumber | html %]</td> >- <td>[% ItemTypes.GetDescription( issue.itype ) | html %]</td> >- <td>[% issue.date_due | $KohaDates as_due_date => 1 %]</td> >- <td>[% issue.barcode | html %]</td> >- <td>[% issue.stocknumber | html %]</td> >- <td>[% issue.charge | $Price %]</td> >- <td>[% issue.replacementprice | $Price %]</td> >- <td>[% IF ( issue.overdue ) %]Overdue![% ELSE %] [% END %]</td> >+ <td></td> > </tr> >- [% END %] >- >- <tr> >- <td colspan="7" style="text-align: right; font-weight:bold;">Totals:</td> >- <td>[% totaldue | $Price %]</td> >- <td>[% totalprice | $Price %]</td> >- <td colspan="3"> </td> >- </tr> >- </table> >- [% END %] >+ </tfoot> >+ </table> >+ [% END %] > > [% IF ( reserves ) %] >- <table> >+ <table id="print-summary-holds"> > <caption>Pending holds</caption> >- <tr> >- <th>Title</th> >- <th>Author</th> >- <th>Placed on</th> >- <th>Expires on</th> >- <th>Pick up location</th> >- </tr> >- >- [% FOREACH reserve IN reserves %] >+ <thead> > <tr> >- <td>[% reserve.title | html %]</td> >- <td>[% reserve.author | html %]</td> >- <td>[% reserve.reservedate | $KohaDates %]</td> >- <td>[% reserve.expirationdate | $KohaDates %]</td> >- <td>[% reserve.waiting_at | html %]</td> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Placed on</th> >+ <th>Expires on</th> >+ <th>Pick up location</th> > </tr> >- [% END %] >+ </thead> >+ <tbody> >+ [% FOREACH reserve IN reserves %] >+ <tr> >+ <td>[% reserve.title | html %]</td> >+ <td>[% reserve.author | html %]</td> >+ <td>[% reserve.reservedate | $KohaDates %]</td> >+ <td>[% reserve.expirationdate | $KohaDates %]</td> >+ <td>[% reserve.waiting_at | html %]</td> >+ </tr> >+ [% END %] >+ </tbody> > </table> > [% END %] > [% IF accounts && totaldue != 0 %] >- <table id="table_account_fines"> >+ <table id="print-summary-fines"> > <caption>Account fines and payments</caption> > <thead> > <tr> >@@ -107,46 +144,62 @@ > <th>Outstanding</th> > </tr> > </thead> >- >- [% FOREACH account IN accounts %] >- <tr> >- <td>[% account.date | $KohaDates %]</td> >- <td> >- [% PROCESS account_type_description account=account %] >- [%- IF account.payment_type %] >- , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %] >- [% END %] >- [%- IF account.description %] >- , [% account.description | html %] >- [% END %] >- >- [% IF ( account.itemnumber AND account.debit_type_code != 'OVERDUE' ) %] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a> >- [% END %] >- </td> >- <td> >- [% account.note | html_line_break %] >- </td> >- [% IF ( account.amount < 0 ) %] >- <td class="credit" style="text-align: right;"> >- [% ELSE %] >- <td class="debit" style="text-align: right;"> >- [% END %][% account.amount | $Price %] >- </td> >- [% IF ( account.amountoutstanding < 0 ) %] >- <td class="credit" style="text-align: right;"> >- [% ELSE %] >- <td class="debit" style="text-align: right;"> >- [% END %] >- [% account.amountoutstanding | $Price %] >- </td> >- </tr> >- [% END %] >- >+ <tbody> >+ [% FOREACH account IN accounts %] >+ <tr> >+ <td>[% account.date | $KohaDates %]</td> >+ <td> >+ [% PROCESS account_type_description account=account %] >+ [%- IF account.payment_type %] >+ , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %] >+ [% END %] >+ [%- IF account.description %] >+ , [% account.description | html %] >+ [% END %] >+ >+ [% IF ( account.itemnumber AND account.debit_type_code != 'OVERDUE' ) %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a> >+ [% END %] >+ </td> >+ <td> >+ [% account.note | html_line_break %] >+ </td> >+ [% IF ( account.amount <= 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% account.amount | $Price %] >+ </td> >+ [% IF ( account.amountoutstanding <= 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% account.amountoutstanding | $Price %] >+ </td> >+ </tr> >+ [% END %] >+ </tbody> > <tfoot> > <tr> >- <td colspan="4">Total due</td> >- <td colspan="2" style="text-align:right;">[% totaldue | $Price %]</td> >+ <td></td> >+ <td></td> >+ <td ></td> >+ [% IF ( totaldue < 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ Total due: >+ </td> >+ [% IF ( totaldue < 0 ) %] >+ <td class="credit"> >+ [% ELSE %] >+ <td class="debit"> >+ [% END %] >+ [% totaldue | $Price %] >+ </td> > </tr> > </tfoot> > </table> >@@ -154,6 +207,48 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'slip-print.inc' #printThenClose %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ <script> >+ var checkouts_columns = [% TablesSettings.GetColumns( 'circ', 'print_summary', 'print-summary-checkouts', 'json' ) | $raw %]; >+ var holds_columns = [% TablesSettings.GetColumns( 'circ', 'print_summary', 'print-summary-holds', 'json' ) | $raw %]; >+ var fines_columns = [% TablesSettings.GetColumns( 'circ', 'print_summary', 'print-summary-fines', 'json' ) | $raw %]; >+ >+ function moveColumnsButton( tableId ){ >+ /* Hide the export button */ >+ $("#" + tableId + "_wrapper").find("button.export_controls").remove(); >+ /* We don't show the table controls toolbar here, so the columns settings button looks better as part of the caption */ >+ $("#" + tableId).find("caption").append( $("#" + tableId + "_wrapper").find("button.columns_controls") ); >+ } >+ >+ $(document).ready(function() { >+ >+ KohaTable("print-summary-checkouts", { >+ "dom": "Bt", >+ "paging": "false", >+ initComplete: function( settings) { >+ moveColumnsButton( settings.nTable.id ); >+ } >+ }, checkouts_columns); >+ >+ KohaTable("print-summary-holds", { >+ "dom": "Bt", >+ "paging": "false", >+ initComplete: function( settings) { >+ moveColumnsButton( settings.nTable.id ); >+ } >+ }, holds_columns); >+ >+ KohaTable("print-summary-fines", { >+ "dom": "Bt", >+ "paging": "false", >+ initComplete: function( settings) { >+ moveColumnsButton( settings.nTable.id ); >+ } >+ }, fines_columns); >+ >+ }); >+ </script> > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.25.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 28450
:
126088
|
126134
|
127122
| 127245