[Koha-bugs] [Bug 7379] some database fields are displayed 'as is' when they are linked to autorised values

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 3 11:51:25 CET 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7379

--- Comment #3 from Adrien SAURAT <adrien.saurat at biblibre.com> 2012-01-03 10:51:25 UTC ---
Well, refactoring could take some time and is not necessarily useful. Indenting
is quick to do and makes the file more readable (but the patch far less
readable indeed).

I'll follow any line, but it needs to be clear, Chris told me a few weeks ago
that it was good to enhance the code whenever possible without creating new
bugs for this.

======================================

I'll help you read this patch.

I used the same code already used for "ccode", adding this in opac-detail.pl :

my $copynumbers = 
GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac');

...

if ( my $copynumber = $itm->{'copynumber'} ) {
    $itm->{'copynumber'} = $copynumbers->{$copynumber} if (
defined($copynumbers) && exists( $copynumbers->{$copynumber} ) );
}


and this in detail.pl :

my $copynumbers     = GetKohaAuthorisedValues('items.copynumber', $fw);

...

my $copynumber = $item->{'copynumber'};
    $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined(
$copynumber ) && defined($copynumber) && exists( $copynumbers->{$copynumber} )
);

==========================

Next time I'll try to modify only the code surrounding the bug fix.

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the Koha-bugs mailing list