X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg-fcc.html;h=69e7d8f31678315b13b52d7b189295e583e22c96;hp=9462c324847881d4d9fbf51586fa13fa8ef643d5;hb=HEAD;hpb=0f359d5480aa1621d73ee802f420e8951abc620d diff --git a/httemplate/browse/part_pkg-fcc.html b/httemplate/browse/part_pkg-fcc.html index 9462c3248..69e7d8f31 100755 --- a/httemplate/browse/part_pkg-fcc.html +++ b/httemplate/browse/part_pkg-fcc.html @@ -3,14 +3,12 @@ 'menubar' => \@menubar, 'html_init' => $html_init, 'html_form' => $html_form, - 'html_posttotal' => $html_posttotal, 'name' => 'package definitions', 'disableable' => 1, 'disabled_statuspos' => 4, 'agent_virt' => 1, - 'agent_null_right' => [ $edit, $edit_global ], - 'agent_null_right_link' => $edit_global, - 'agent_pos' => 6, + 'agent_null_right' => $edit_global, + 'agent_pos' => 3, 'query' => { 'select' => $select, 'table' => 'part_pkg', @@ -31,14 +29,22 @@ my $curuser = $FS::CurrentUser::CurrentUser; -my $edit = 'Edit package definitions'; -my $edit_global = 'Edit global package definitions'; +my $edit = 'Edit FCC report configuration'; +my $edit_global = 'Edit FCC report configuration for all agents'; my $acl_edit = $curuser->access_right($edit); my $acl_edit_global = $curuser->access_right($edit_global); die "access denied" unless $acl_edit || $acl_edit_global; +if ( $cgi->param('redirect') ) { + my $session = $cgi->param('redirect'); + my $pref = $curuser->option("redirect$session"); + die "unknown redirect session $session\n" unless length($pref); + $cgi = new CGI($pref); + $cgi->param('redirect', $session); +} + my $conf = new FS::Conf; my $orderby = 'pkgpart'; @@ -88,22 +94,6 @@ my $select = join(',', my $addl_from = FS::Report::FCC_477::join_optionnames(@optionnames); -#restore this so pagination works -$cgi->param('classnum', $classnum) if length($classnum); - -#should hide this if there aren't any classes -my $html_posttotal = - "
( show class: ". - include('/elements/select-pkg_class.html', - #'curr_value' => $classnum, - 'value' => $classnum, #insist on 0 :/ - 'onchange' => 'filter_change()', - 'pre_options' => [ '-1' => 'all', - '0' => '(none)', ], - 'disable_empty' => 1, - ). - ' )'; - my $link = [ $p.'edit/part_pkg.cgi?', 'pkgpart' ]; my @header = ( '#', 'Package', 'Comment' ); @@ -176,26 +166,49 @@ $extra_count = ( $count_extra_sql ? ' AND ' : ' WHERE ' ). $extra_count if $extra_count; my $count_query = "SELECT COUNT(*) FROM part_pkg $count_extra_sql $extra_count"; +# in case of error redirect +if ( $cgi->param('redirect') ) { + push @header, ''; + push @fields, sub { + my $part_pkg = shift; + my $pkgpart = $part_pkg->pkgpart; + '' . $cgi->param("error$pkgpart") || '' . '' + }; + $align .= 'l'; +} + my $html_init = include('/elements/init_overlib.html') . include('/elements/input-fcc_options.html', js_only => 1) . - include('.style'); - -my $html_form = ''; -my $html_foot = ''; -# insert a checkbox column -unshift @header, ''; -unshift @fields, sub { - ''; -}; -unshift @links, ''; -$align = 'c'.$align; + include('.style') . + include('.script'); +my $html_form = qq!
+ + ( show class: !. + include('/elements/select-pkg_class.html', + #'curr_value' => $classnum, + 'value' => $classnum, #insist on 0 :/ + 'onchange' => 'filter_change()', + 'pre_options' => [ '-1' => 'all', + '0' => '(none)', ], + 'disable_empty' => 1, + ). + ' ) +

'; -$html_form = qq!!; -$html_foot = qq! - -
!; +# pass the page selection through so we can jump back to the current spot +if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) { + $html_form .= qq!!; +} +if ( $cgi->param('offset') =~ /^(\d+)$/ ) { + $html_form .= qq!!; +} + +# restore this only after creating $html_form +$cgi->param('classnum', $classnum) if length($classnum); + +my $html_foot = ''; my @menubar = ( 'Package definitions' => $p.'browse/part_pkg.cgi' ); @@ -213,3 +226,17 @@ my @menubar = } +<%def .script> + +