From 125bdfb341732dfa27fe4f1d583e201015bd619a 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. --- .../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 e0a3bb38909..29b8c7545df 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 199c0bdc844..02725ed684f 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1264,6 +1264,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 8aec41dfcb6..ca700ad9a74 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 0a391642376..c858bd6cbbc 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 @@ -125,6 +125,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