[Koha-bugs] [Bug 20226] New: Get rid of CATCODE_MULTI param decision in patron perl scripts

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 16 11:43:20 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226

            Bug ID: 20226
           Summary: Get rid of CATCODE_MULTI param decision in patron perl
                    scripts
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: josef.moravec at gmail.com
        QA Contact: testopia at bugs.koha-community.org

In all scripts for patrons management are this few lines of code:

if ( $patron->is_child) {
    my $patron_categories = Koha::Patron::Categories->search_limited({
category_type => 'A' }, {order_by => ['categorycode']});
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if
$patron_categories->count == 1;
}

This is needed only in members-toolbar.inc for updating child to adult.

I don't think it is good idea to have these 5 lines of code repeated 10 times
in our code. Should be refactored and centralized.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list