diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
| commit | 9aee669886202be7035e6c6049fc71bc99dd3013 (patch) | |
| tree | 2fd5bf6de74f3d99270587ffb1833e4188a6373d /httemplate/browse | |
| parent | ac20214d38d9af00430423f147b5a0e50751b050 (diff) | |
| parent | 1add633372bdca3cc7163c2ce48363fed3984437 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/browse')
| -rw-r--r-- | httemplate/browse/addr_block.cgi | 136 | ||||
| -rwxr-xr-x | httemplate/browse/cust_attachment.html | 2 | ||||
| -rwxr-xr-x | httemplate/browse/part_pkg.cgi | 72 | ||||
| -rw-r--r-- | httemplate/browse/part_virtual_field.html | 2 |
4 files changed, 126 insertions, 86 deletions
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi index 46b12e65f..ba40bfd43 100644 --- a/httemplate/browse/addr_block.cgi +++ b/httemplate/browse/addr_block.cgi @@ -1,71 +1,71 @@ -<% include('elements/browse.html', - 'title' => 'Address Blocks', - 'name' => 'address block', - 'html_init' => $html_init, - 'html_foot' => $html_foot, - 'query' => { 'table' => 'addr_block', - 'hashref' => {}, - 'extra_sql' => $extra_sql, - 'order_by' => $order_by, - }, - 'count_query' => "SELECT count(*) from addr_block $count_sql", - 'header' => [ 'Address Block', - 'Router', - 'Action(s)', - '', - '', - '', - ], - 'fields' => [ 'NetAddr', - sub { my $block = shift; - my $router = $block->router; - my $result = ''; - if ($router) { - $result .= $router->routername. ' ('; - $result .= scalar($block->svc_broadband). ' services)'; - } - $result; - }, - $allocate_text, - sub { shift->router ? '' : '<FONT SIZE="-2">(split)</FONT>' }, - sub { '<FONT SIZE="-2">('. (shift->manual_flag ? 'allow' : 'prevent'). ' automatic ip assignment)</FONT>' }, - sub { - my $block = shift; - if(!$block->router && scalar($block->svc_broadband) == 0) { - return '<FONT SIZE="-2">(delete)</FONT>'; - } - ''; - }, - ], - 'links' => [ '', - '', - [ 'javascript:void(0)', '' ], - $split_link, - $autoassign_link, - sub { - my $block = shift; - if(!$block->router && scalar($block->svc_broadband) == 0) { - [ "${p}misc/delete-addr_block.html?", 'blocknum' ]; - } - }, - ], - 'link_onclicks' => [ '', - '', - $allocate_link, - '', - '', - ], - 'cell_styles' => [ '', - '', - 'border-right:none;', - 'border-left:none;', - '', - ], - 'agent_virt' => 1, - 'agent_null_right' => 'Broadband global configuration', - 'agent_pos' => 1, - ) -%> +<& elements/browse.html, + 'title' => 'Address Blocks', + 'name' => 'address block', + 'html_init' => $html_init, + 'html_foot' => $html_foot, + 'query' => { 'table' => 'addr_block', + 'hashref' => {}, + 'extra_sql' => $extra_sql, + 'order_by' => $order_by, + }, + 'count_query' => "SELECT count(*) from addr_block $count_sql", + 'header' => [ 'Address Block', + 'Router', + 'Action(s)', + '', + '', + '', + ], + 'fields' => [ 'NetAddr', + sub { my $block = shift; + my $router = $block->router; + my $result = ''; + if ($router) { + $result .= $router->routername. ' ('; + $result .= scalar($block->svc_broadband). ' services)'; + } + $result; + }, + $allocate_text, + sub { shift->router ? '' : '<FONT SIZE="-2">(split)</FONT>' }, + sub { '<FONT SIZE="-2">('. (shift->manual_flag ? 'allow' : 'prevent'). ' automatic ip assignment)</FONT>' }, + sub { + my $block = shift; + if(!$block->router && scalar($block->svc_broadband) == 0) { + return '<FONT SIZE="-2">(delete)</FONT>'; + } + ''; + }, + ], + 'sort_fields' => [], + 'links' => [ '', + '', + [ 'javascript:void(0)', '' ], + $split_link, + $autoassign_link, + sub { + my $block = shift; + if(!$block->router && scalar($block->svc_broadband) == 0) { + [ "${p}misc/delete-addr_block.html?", 'blocknum' ]; + } + }, + ], + 'link_onclicks' => [ '', + '', + $allocate_link, + '', + '', + ], + 'cell_styles' => [ '', + '', + 'border-right:none;', + 'border-left:none;', + '', + ], + 'agent_virt' => 1, + 'agent_null_right' => 'Broadband global configuration', + 'agent_pos' => 1, +&> <%init> die "access denied" diff --git a/httemplate/browse/cust_attachment.html b/httemplate/browse/cust_attachment.html index 9d62e5609..f81ec1b6b 100755 --- a/httemplate/browse/cust_attachment.html +++ b/httemplate/browse/cust_attachment.html @@ -101,7 +101,7 @@ my $orderby = $cgi->param('orderby') || 'custnum'; my $sub_cust = sub { my $c = qsearchs('cust_main', { custnum => shift->custnum } ); - return $c ? $c->name : '<FONT COLOR="red"><B>(not found)</B></FONT>'; + return $c ? encode_entities($c->name) : '<FONT COLOR="red"><B>(not found)</B></FONT>'; }; my $sub_date = sub { diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index f8de620a7..c2f1430d7 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -247,6 +247,7 @@ push @fields, sub { $part_pkg->part_pkg_discount; [ + # Line 0: Family package link (if applicable) ( !$family_pkgpart && $part_pkg->pkgpart == $part_pkg->family_pkgpart ? () : [ { @@ -257,13 +258,13 @@ push @fields, sub { 'link' => $p.'browse/part_pkg.cgi?family='.$part_pkg->family_pkgpart, } ] ), - [ + [ # Line 1: Plan type (Anniversary, Prorate, Call Rating, etc.) { data =>$plan, align=>'center', colspan=>2, }, ], - [ + [ # Line 2: Setup fee { data =>$money_char. sprintf('%.2f ', $part_pkg->option('setup_fee') ), align=>'right' @@ -278,7 +279,7 @@ push @fields, sub { align=>'left', }, ], - [ + [ # Line 3: Recurring fee { data=>( $is_recur ? $money_char. sprintf('%.2f', $part_pkg->option('recur_fee')) @@ -288,20 +289,56 @@ push @fields, sub { colspan=> ( $is_recur ? 1 : 2 ), }, ( $is_recur - ? { data => ( $is_recur - ? ' '. $part_pkg->freq_pretty. - ( $part_pkg->option('recur_fee') == 0 - && $part_pkg->recur_show_zero - ? ' (printed on invoices)' - : '' - ) - : '' ), + ? { data => ' '. $part_pkg->freq_pretty. + ( $part_pkg->option('recur_fee') == 0 + && $part_pkg->recur_show_zero + ? ' (printed on invoices)' + : '' + ), align=>'left', } : () ), ], - ( + [ { data => ' ' }, ], # Line 4: empty + ( $part_pkg->adjourn_months ? + [ # Line 5: Adjourn months + { data => mt('After [quant,_1,month], <strong>suspend</strong> the package.', + $part_pkg->adjourn_months), + align => 'left', + size => -1, + colspan => 2, + } + ] : () + ), + ( $part_pkg->contract_end_months ? + [ # Line 6: Contract end months + { data => mt('After [quant,_1,month], <strong>contract ends</strong>.', + $part_pkg->contract_end_months), + align => 'left', + size => -1, + colspan => 2, + } + ] : () + ), + ( $part_pkg->expire_months ? + [ # Line 7: Expire months and automatic transfer + { data => $part_pkg->change_to_pkgpart ? + mt('After [quant,_1,month], <strong>change to</strong> ', + $part_pkg->expire_months) . + qq(<a href="${p}edit/part_pkg.cgi?) . + $part_pkg->change_to_pkgpart . + qq(">) . $part_pkg->change_to_pkg->pkg . qq(</a>) . '.' + : mt('After [quant,_1,month], <strong>cancel</strong> the package.', + $part_pkg->expire_months) + , + align => 'left', + size => -1, + colspan => 2, + } + ] : () + ), + ( # Usage prices map { my $amount = $_->amount / ($_->target_info->{multiplier} || 1); my $label = $_->target_info->{label}; [ @@ -315,7 +352,8 @@ push @fields, sub { } $part_pkg->part_pkg_usageprice ), - ( map { my $dst_pkg = $_->dst_pkg; + ( # Supplementals + map { my $dst_pkg = $_->dst_pkg; [ { data => 'Supplemental: '. '<A HREF="#'. $dst_pkg->pkgpart . '">' . @@ -327,7 +365,8 @@ push @fields, sub { } $part_pkg->supp_part_pkg_link ), - ( map { + ( # Billing add-ons/bundle packages + map { my $dst_pkg = $_->dst_pkg; [ { data => 'Add-on: '.$dst_pkg->pkg_comment, @@ -338,7 +377,8 @@ push @fields, sub { } $part_pkg->bill_part_pkg_link ), - ( scalar(@discounts) + ( # Discounts available + scalar(@discounts) ? [ { data => '<b>Discounts</b>', align=>'center', #? @@ -360,7 +400,7 @@ push @fields, sub { @discounts : () ), - ]; + ]; # end of "middle column" # $plan_labels{$part_pkg->plan}.'<BR>'. # $money_char.sprintf('%.2f setup<BR>', $part_pkg->option('setup_fee') ). diff --git a/httemplate/browse/part_virtual_field.html b/httemplate/browse/part_virtual_field.html index 1d8fad4c6..5e3876285 100644 --- a/httemplate/browse/part_virtual_field.html +++ b/httemplate/browse/part_virtual_field.html @@ -30,6 +30,6 @@ <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + unless $FS::CurrentUser::CurrentUser->access_right('Edit custom fields'); </%init> |
