[freeside-commits] freeside/httemplate/edit part_svc.cgi, 1.71.2.1, 1.71.2.2
Ivan,,,
ivan at wavetail.420.am
Mon Nov 8 12:00:39 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv5070
Modified Files:
Tag: FREESIDE_2_1_BRANCH
part_svc.cgi
Log Message:
hide communigate fields in svc_acct and svc_domain when there's no communigate exports, RT#10515
Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_svc.cgi,v
retrieving revision 1.71.2.1
retrieving revision 1.71.2.2
diff -u -w -d -r1.71.2.1 -r1.71.2.2
--- part_svc.cgi 7 Nov 2010 00:57:15 -0000 1.71.2.1
+++ part_svc.cgi 8 Nov 2010 20:00:37 -0000 1.71.2.2
@@ -101,12 +101,14 @@
%
% my $columns = 3;
% my $count = 0;
+% my $communigate = 0;
% my @part_export =
% map { qsearch( 'part_export', {exporttype => $_ } ) }
% keys %{FS::part_export::export_info($layer)};
% $html .= '<BR><BR>'. table().
% "<TR><TH COLSPAN=$columns>Exports</TH></TR><TR>";
% foreach my $part_export ( @part_export ) {
+% $communigate++ if $part_export->exporttype =~ /^communigate/;
% $html .= '<TD><INPUT TYPE="checkbox"'.
% ' NAME="exportnum'. $part_export->exportnum. '" VALUE="1" ';
% $html .= 'CHECKED'
@@ -133,16 +135,17 @@
% my $bgcolor;
%
% #yucky kludge
-% my @fields = defined( dbdef->table($layer) )
-% ? grep {
-% $_ ne 'svcnum' &&
-% ( !FS::part_svc->svc_table_fields($layer)
-% ->{$_}->{disable_part_svc_column} ||
-% $part_svc->part_svc_column($_)->columnflag
+% my @fields = ();
+% if ( defined( dbdef->table($layer) ) ) {
+% @fields = grep {
+% $_ ne 'svcnum'
+% && ( $communigate || !$communigate_fields{$layer}->{$_} )
+% && ( !FS::part_svc->svc_table_fields($layer)
+% ->{$_}->{disable_part_svc_column}
+% || $part_svc->part_svc_column($_)->columnflag
% )
+% } fields($layer);
% }
-% fields($layer)
-% : ();
% push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge
% $part_svc->svcpart($clone) if $clone; #haha, undone below
%
@@ -421,7 +424,21 @@
my $hashref = $part_svc->hashref;
# my $p_svcdb = $part_svc->svcdb || 'svc_acct';
-
+my %communigate_fields = (
+ 'svc_acct' => { map { $_=>1 }
+ qw( file_quota file_maxnum file_maxsize
+ password_selfchange password_recover
+ ),
+ grep /^cgp_/, fields('svc_acct')
+ },
+ 'svc_domain' => { map { $_=>1 }
+ qw( max_accounts trailer parent_svcnum ),
+ grep /^(cgp|acct_def)_/, fields('svc_domain')
+ },
+ #'svc_forward' => { map { $_=>1 } qw( ) },
+ #'svc_mailinglist' => { map { $_=>1 } qw( ) },
+ #'svc_cert' => { map { $_=>1 } qw( ) },
+);
</%init>
More information about the freeside-commits
mailing list