From 404e15242c14aaba6b4a65d6e545de519c5c007e Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 23 Oct 2023 15:16:55 +0000 Subject: [PATCH] Bug 35131: Show the patron cardnumber as a borcode in the patron record To test: 1. Apply patch, updatedatabase, yarn build, and restart services 2. Search for the system preference 'ShowBarcodeOnPatronRecord' and set it to something other than 'Don't show'. 3. Now go to any page that shows the 'patroninfo' section. ( circ/circulation.pl, members/moremember.pl, members/pay.pl, etc ) 4. Make sure this patron has a cardnumber. 5. From any of the aforementioned pages make sure you can see the patron barcode. 6. Try many different barcode types, making sure they each display well. 7. Remove the patron cardnumber and confirm that nothing displays. Signed-off-by: Owen Leonard Signed-off-by: Kyle M Hall --- .../data/mysql/atomicupdate/bug_35131.pl | 12 +++++++----- .../prog/css/src/staff-global.scss | 4 ++++ .../prog/en/includes/circ-menu.inc | 7 +++++-- .../en/modules/admin/preferences/patrons.pref | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_35131.pl b/installer/data/mysql/atomicupdate/bug_35131.pl index 729a54707d4..11cc3701155 100755 --- a/installer/data/mysql/atomicupdate/bug_35131.pl +++ b/installer/data/mysql/atomicupdate/bug_35131.pl @@ -1,15 +1,17 @@ use Modern::Perl; return { - bug_number => 35131, + bug_number => 35131, description => "Add preference ShowBarcodeOnPatronRecord", - up => sub { + up => sub { my ($args) = @_; - my ($dbh, $out) = @$args{qw(dbh out)}; - $dbh->do(q{ + my ( $dbh, $out ) = @$args{qw(dbh out)}; + $dbh->do( + q{ INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ShowBarcodeOnPatronRecord', '0', '|0|Code39|COOP2of5|EAN13|EAN8|IATA2of5|Industrial2of5|ITF|Matrix2of5|NW7|QRcode|UPCA|UPCE', 'Show a patron carnumber as a barcode on the patron record ', 'Choice') - }); + } + ); say $out "Added new system preference 'ShowBarcodeOnPatronRecord'"; }, }; 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 99b2ad0d896..3ca8eb34256 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1269,6 +1269,10 @@ dd { > div { width: 100%; } + + #patron-barcode { + margin-left: 0.9em; + } } .patroninfo-section { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index ead8c18fbef..5483163620d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -11,7 +11,11 @@ [% patron_type_class = 'is-staff' %] [% END %]
- +[% IF patron.cardnumber && Koha.Preference('ShowBarcodeOnPatronRecord') %] +
+ [% patron.cardnumber | html %] +
+[% END %] [% IF ( patronimages ) %]
[% ELSE %] @@ -58,7 +62,6 @@ [% IF patron.pronouns %]
  • ([% patron.pronouns | html %])
  • [% END %] - [% PROCESS 'display-address-style' %] [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index c2043b85dd3..211c5ed3d9b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -135,6 +135,25 @@ Patrons: class: integer - days. Leave empty to disable this behavior. - "
    NOTE: This system preference requires the misc/cronjobs/cleanup_database.pl cronjob. Ask your system administrator to schedule it." + - + - "Show a " + - pref: ShowBarcodeOnPatronRecord + default: no + choices: + 0: "Don't show" + Code39: "Code39" + COOP2of5: "COOP2of5" + EAN13: "EAN13" + EAN8: "EAN8" + IATA2of5: "IATA2of5" + Industrial2of5: "Industrial2of5" + ITF: "ITF" + Matrix2of5: "Matrix2of5" + NW7: "NW7" + QRcode: "QRcode" + UPCA: "UPCA" + UPCE: "UPCE" + - " barcode of the patron record." Membership expiry: - -- 2.30.2