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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]

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.
_______________________________________________
Koha-bugs mailing list
[email protected]
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