From db5d13003d4020d9d2bc78ebc565e748622237f4 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 9 May 2012 15:20:07 -0700 Subject: disable advertising sources, RT#17638 --- httemplate/browse/part_referral.html | 35 ++++++++++++++++++++++++++++------- httemplate/edit/part_referral.html | 5 ++++- 2 files changed, 32 insertions(+), 8 deletions(-) (limited to 'httemplate') diff --git a/httemplate/browse/part_referral.html b/httemplate/browse/part_referral.html index 9cc32c459..c7374673f 100755 --- a/httemplate/browse/part_referral.html +++ b/httemplate/browse/part_referral.html @@ -6,6 +6,13 @@ Where a customer heard about your service. Tracked for informational purposes. Add a new advertising source

+<% $cgi->param('showdisabled') + ? do { $cgi->param('showdisabled', 0); + '( hide disabled advertising sources )'; } + : do { $cgi->param('showdisabled', 1); + '( show disabled advertising sources )'; } +%> + <% include('/elements/table-grid.html') %> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; @@ -13,8 +20,12 @@ Where a customer heard about your service. Tracked for informational purposes. Advertising source -% if ( $show_agentnums ) { +% if ( ! $cgi->param('showdisabled') ) { + +% } + +% if ( $show_agentnums ) { Agent % } @@ -27,7 +38,7 @@ Where a customer heard about your service. Tracked for informational purposes. -%foreach my $part_referral ( FS::part_referral->all_part_referral(1) ) { +%foreach my $part_referral ( FS::part_referral->all_part_referral(1,!scalar($cgi->param('showdisabled'))) ) { % % if ( $bgcolor eq $bgcolor1 ) { % $bgcolor = $bgcolor2; @@ -55,6 +66,16 @@ Where a customer heard about your service. Tracked for informational purposes. % } <% $part_referral->referral %><% $a ? '' : '' %> + +% if ( ! $cgi->param('showdisabled') ) { + + <% $part_referral->disabled + ? 'DISABLED' + : 'Active' + %> + +% } + % if ( $show_agentnums ) { <% $part_referral->agentnum ? $part_referral->agent->agent : '(global)' %> @@ -73,11 +94,11 @@ Where a customer heard about your service. Tracked for informational purposes. - + - +
<% $num_cust %>customers customers 
<% $num_pkg %>packages packages 
@@ -94,7 +115,7 @@ Where a customer heard about your service. Tracked for informational purposes. % or die dbh->errstr; - Total + param('showdisabled') %>Total % for my $period ( keys %after ) { % my @param = ( $today-$after{$period}, % $today+$before{$period}, @@ -108,11 +129,11 @@ Where a customer heard about your service. Tracked for informational purposes. - + - +
<% $num_cust %>customers customers 
<% $num_pkg %>packages packages 
diff --git a/httemplate/edit/part_referral.html b/httemplate/edit/part_referral.html index daf8773f0..e9fd79452 100755 --- a/httemplate/edit/part_referral.html +++ b/httemplate/edit/part_referral.html @@ -3,9 +3,12 @@ 'table' => 'part_referral', 'fields' => [ 'referral', { field=>'agentnum', type=>'select-agent', }, + { field=>'disabled', type=>'checkbox', value=>'Y' } , ], - 'labels' => { 'referral' => 'Advertising source', + 'labels' => { 'refnum' => 'Ad Source', + 'referral' => 'Advertising source', 'agentnum' => 'Agent', + 'disabled' => 'Disabled', }, 'viewall_dir' => 'browse', ) -- cgit v1.2.1