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

Julian Maurice <julian.maur...@biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |julian.maur...@biblibre.com

--- Comment #7 from Julian Maurice <julian.maur...@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.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to