X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_pkg.cgi;h=7a6f49a2335e64370a4505db1c197b6ba67b53ed;hb=f0749e294656ac2615edaa59bbdb850eb3d20544;hp=2b6db8c754ca80a36bc350471645660568aff5ce;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 2b6db8c75..7a6f49a23 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -1,39 +1,36 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'html_init' => $html_init, - 'title' => 'Package Search Results', + 'title' => emt('Package Search Results'), 'name' => 'packages', 'query' => $sql_query, 'count_query' => $count_query, - #'redirect' => $link, - 'header' => [ '#', - 'Quan.', - 'Package', - 'Class', - 'Status', - 'Setup', - 'Base Recur', - 'Freq.', - 'Setup', - 'Last bill', - 'Next bill', - 'Adjourn', - 'Susp.', - 'Expire', - 'Contract end', - 'Cancel', - 'Reason', + 'header' => [ emt('#'), + emt('Quan.'), + emt('Package'), + emt('Class'), + emt('Status'), + emt('Setup'), + emt('Base Recur'), + emt('Freq.'), + emt('Setup'), + emt('Last bill'), + emt('Next bill'), + emt('Adjourn'), + emt('Susp.'), + emt('Susp. delay'), + emt('Expire'), + emt('Contract end'), + emt('Cancel'), + emt('Reason'), FS::UI::Web::cust_header( $cgi->param('cust_fields') ), - 'Services', + emt('Services'), ], 'fields' => [ 'pkgnum', 'quantity', - sub { #my $part_pkg = $part_pkg{shift->pkgpart}; - #$part_pkg->pkg; # ' - '. $part_pkg->comment; - $_[0]->pkg; # ' - '. $_[0]->comment; - }, + sub { $_[0]->pkg; }, 'classname', sub { ucfirst(shift->status); }, sub { sprintf( $money_char.'%.2f', @@ -45,22 +42,10 @@ $c->part_pkg->base_recur($c) ); }, - sub { #shift->part_pkg->freq_pretty; - - #my $part_pkg = $part_pkg{shift->pkgpart}; - #$part_pkg->freq_pretty; + sub { FS::part_pkg::freq_pretty(shift); }, - FS::part_pkg::freq_pretty(shift); - }, - - #sub { time2str('%b %d %Y', shift->setup); }, - #sub { time2str('%b %d %Y', shift->last_bill); }, - #sub { time2str('%b %d %Y', shift->bill); }, - #sub { time2str('%b %d %Y', shift->susp); }, - #sub { time2str('%b %d %Y', shift->expire); }, - #sub { time2str('%b %d %Y', shift->get('cancel')); }, ( map { time_or_blank($_) } - qw( setup last_bill bill adjourn susp expire contract_end cancel ) ), + qw( setup last_bill bill adjourn susp dundate expire contract_end cancel ) ), sub { my $self = shift; my $return = ''; @@ -73,13 +58,6 @@ }, \&FS::UI::Web::cust_fields, - #sub { ''. - # join('', map { '' } - # shift->labels - # ). - # '
'. $_->[0]. - # ':'. $_->[1]. '
'; - # }, sub { my $cust_pkg = shift; my $type = $cgi->param('_type') || ''; @@ -127,13 +105,14 @@ '', '', '', + '', FS::UI::Web::cust_colors(), '', ], - 'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', + 'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '', FS::UI::Web::cust_styles() ], 'size' => [ '', '', '', '', '-1' ], - 'align' => 'rrlccrrlrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r', + 'align' => 'rrlccrrlrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r', 'links' => [ $link, $link, @@ -152,6 +131,7 @@ '', '', '', + '', ( map { $_ ne 'Cust. Status' ? $clink : '' } FS::UI::Web::cust_header( $cgi->param('cust_fields') @@ -159,8 +139,7 @@ ), '', ], - ) -%> +&> <%init> my $curuser = $FS::CurrentUser::CurrentUser; @@ -171,8 +150,6 @@ die "access denied" my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; -# my %part_pkg = map { $_->pkgpart => $_ } qsearch('part_pkg', {}); - my %search_hash = (); #some false laziness w/misc/bulk_change_pkg.cgi @@ -202,9 +179,9 @@ $search_hash{report_option} = join(',', @report_option) if @report_option; #false laziness w/report_cust_pkg.html my %disable = ( 'all' => {}, - 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, + 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, 'contract_end'=>1, 'dundate'=>1, }, 'active' => { 'susp'=>1, 'cancel'=>1 }, - 'suspended' => { 'cancel' => 1 }, + 'suspended' => { 'cancel' =>1, 'dundate'=>1, }, 'cancelled' => {}, '' => {}, ); @@ -243,23 +220,6 @@ my $clink = sub { : ''; }; -#if ( scalar(@cust_pkg) == 1 ) { -# print $cgi->redirect("${p}view/cust_main.cgi?". $cust_pkg[0]->custnum. -# "#cust_pkg". $cust_pkg[0]->pkgnum ); - -# my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } ); -# my $rowspan = scalar(@cust_svc) || 1; - -# my $n2 = ''; -# foreach my $cust_svc ( @cust_svc ) { -# my($label, $value, $svcdb) = $cust_svc->label; -# my $svcnum = $cust_svc->svcnum; -# my $sview = $p. "view"; -# print $n2,qq!$label!, -# qq!$value!; -# $n2=""; -# } - sub time_or_blank { my $column = shift; return sub { @@ -277,18 +237,18 @@ my $html_init = sub { if ( $curuser->access_right('Bulk change customer packages') ) { $text .= include('/elements/init_overlib.html'). include( '/elements/popup_link.html', - 'label' => 'Change these packages', + 'label' => emt('Change these packages'), 'action' => "${p}misc/bulk_change_pkg.cgi?$query", - 'actionlabel' => 'Change Packages', + 'actionlabel' => emt('Change Packages'), 'width' => 569, 'height' => 210, ). '
'; if ( $curuser->access_right('Edit customer package dates') ) { $text .= include( '/elements/popup_link.html', - 'label' => 'Increment next bill date', + 'label' => emt('Increment next bill date'), 'action' => "${p}misc/bulk_pkg_increment_bill.cgi?$query", - 'actionlabel' => 'Increment Bill Date', + 'actionlabel' => emt('Increment Bill Date'), 'width' => 569, 'height' => 210, ). '
';