Bug 18348

Summary: SHOW_BCODE should be a column of the borrowers table
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, julian.maurice, katrin.fischer
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17825
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11922
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 4157    
Bug Blocks:    

Description Jonathan Druart 2017-03-29 20:51:54 UTC
The SHOW_BCODE is a hidden feature, not translatable and does not exist for all languages.
It sounds like it should be a column of the borrowers table
Comment 1 Katrin Fischer 2020-01-14 10:52:03 UTC
Or maybe it should be deprecated in favor of settings on the category type or a column configuration setting? Not sure hwo granular display stuff like this needs to be.
Comment 2 Caroline Cyr La Rose 2023-03-01 14:46:43 UTC
(In reply to Katrin Fischer from comment #1)
> Or maybe it should be deprecated in favor of settings on the category type
> or a column configuration setting? Not sure hwo granular display stuff like
> this needs to be.

I was leaning in the direction of something in the column settings, but right now, it seems to be set on a individual basis. If we transfer it somewhere, it probably should be somewhere in the patron categories, so as not to change the feature too much for libraries already using it?
Comment 3 Katrin Fischer 2023-04-16 01:49:12 UTC
It would be really interesting to get feedback on this from libraries using it. I think it was introduced with the extended patron attributes, maybe as some kind of example? But I never quite understood the use case.

Maybe we could even do without?
Comment 4 Katrin Fischer 2023-09-10 21:07:32 UTC
I really feel like it is overkill as a per person setting. 

I wonder who is using it?
Comment 5 Katrin Fischer 2023-09-10 21:12:26 UTC
It only seems to affect the items table in the OPAC? Maybe.

opac/opac-user.pl:

use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';

my $show_barcode = Koha::Patron::Attribute::Types->search( # FIXME we should not need this search
    { code => ATTRIBUTE_SHOW_BARCODE } )->count;
if ($show_barcode) {
    my $patron_show_barcode = $patron->get_extended_attribute(ATTRIBUTE_SHOW_BARCODE);
    undef $show_barcode if $patron_show_barcode and not $patron_show_barcode->attribute;
}
$template->param( show_barcode => 1 ) if $show_barcode;