& /elements/header.html, 'Package usage minutes' &> <& /elements/menubar.html, 'Package definitions', $p.'browse/part_pkg.cgi' &>
<& /elements/footer.html &> <%init> my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right( ['Edit package definitions', 'Edit global package definitions'] ); my @where = ("(plan = 'voip_cdr' OR plan = 'voip_inbound')", "freq != '0'", "disabled IS NULL"); push @where, FS::part_pkg->curuser_pkgs_sql unless $curuser->access_right('Edit global package definitions'); my $extra_sql = ' WHERE '.join(' AND ', @where); my @part_pkg = qsearch({ 'table' => 'part_pkg', 'extra_sql' => $extra_sql, 'order_by' => ' ORDER BY pkgpart', }); my @usage_class = sort { $a->weight <=> $b->weight } qsearch('usage_class', { disabled => '' }); my $n_usage_classes = scalar(@usage_class); my $n_cols = $n_usage_classes + 5; # minutes, shared, rollover, desc, prio %init>