View | Details | Raw Unified | Return to bug 15783
Collapse All | Expand All

(-)a/reports/guided_reports.pl (-3 / +12 lines)
Lines 33-38 use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/; Link Here
33
use C4::Context;
33
use C4::Context;
34
use C4::Log;
34
use C4::Log;
35
use Koha::DateUtils qw/dt_from_string output_pref/;
35
use Koha::DateUtils qw/dt_from_string output_pref/;
36
use Koha::AuthorisedValue;
36
37
37
=head1 NAME
38
=head1 NAME
38
39
Lines 998-1009 sub create_non_existing_group_and_subgroup { Link Here
998
        my $report_groups = C4::Reports::Guided::get_report_groups;
999
        my $report_groups = C4::Reports::Guided::get_report_groups;
999
        if (not exists $report_groups->{$group}) {
1000
        if (not exists $report_groups->{$group}) {
1000
            my $groupdesc = $input->param('groupdesc') // $group;
1001
            my $groupdesc = $input->param('groupdesc') // $group;
1001
            C4::Koha::AddAuthorisedValue('REPORT_GROUP', $group, $groupdesc);
1002
            Koha::AuthorisedValue->new({
1003
                category => 'REPORT_GROUP',
1004
                authorised_value => $group,
1005
                lib => $groupdesc,
1006
            })->store;
1002
        }
1007
        }
1003
        if (defined $subgroup and $subgroup ne '') {
1008
        if (defined $subgroup and $subgroup ne '') {
1004
            if (not exists $report_groups->{$group}->{subgroups}->{$subgroup}) {
1009
            if (not exists $report_groups->{$group}->{subgroups}->{$subgroup}) {
1005
                my $subgroupdesc = $input->param('subgroupdesc') // $subgroup;
1010
                my $subgroupdesc = $input->param('subgroupdesc') // $subgroup;
1006
                C4::Koha::AddAuthorisedValue('REPORT_SUBGROUP', $subgroup, $subgroupdesc, $group);
1011
                Koha::AuthorisedValue->new({
1012
                    category => 'REPORT_SUBGROUP',
1013
                    authorised_value => $subgroup,
1014
                    lib => $subgroupdesc,
1015
                    lib_opac => $group,
1016
                })->store;
1007
            }
1017
            }
1008
        }
1018
        }
1009
    }
1019
    }
1010
- 

Return to bug 15783