[Koha-bugs] [Bug 7515] authorized value code showing in opac for public note

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 23 11:03:19 CET 2012


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

Julian Maurice <julian.maurice at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julian.maurice at biblibre.com

--- Comment #7 from Julian Maurice <julian.maurice at biblibre.com> 2012-02-23 10:03:19 UTC ---
QA comment:

In GetItemsInfo I think that all added code can be replaced by two already
existing subs:

    my $sql_itemnotes = "
        SELECT authorised_value
        FROM   marc_subfield_structure
        WHERE  kohafield = 'items.itemnotes'
        AND    frameworkcode = ?
    ";
    my $sth_itemnotes = $dbh->prepare( $sql_itemnotes );
    $sth_itemnotes->execute( $data->{'frameworkcode'} );
    my ($authorised_valuecode) = $sth_itemnotes->fetchrow;

can be replaced by:

    my ($authorised_valuecode) = C4::Koha::GetAuthValCode('items.itemnotes',
$data->{frameworkcode});

and

    my $lib = $opac ? 'lib_opac' : 'lib';
    if ($authorised_valuecode) {
        $sth_itemnotes = $dbh->prepare(
            "SELECT $lib FROM authorised_values
             WHERE  category=?
             AND authorised_value=?"
        );
        $sth_itemnotes->execute( $authorised_valuecode, $data->{'itemnotes'} );
        my ($lib) = $sth_itemnotes->fetchrow;
        $data->{'itemnotes'} = $lib;
    }

can be replaced by:

    $data->{itemnotes} =
C4::Koha::GetKohaAuthorisedValueLib($authorised_valuecode, $data->{itemnotes},
$opac);

Does anybody agree?

-- 
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