[freeside-commits] freeside/httemplate/edit part_svc.cgi, 1.52,
1.53 svc_acct.cgi, 1.41, 1.42
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Oct 24 19:22:35 PDT 2006
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv10626/httemplate/edit
Modified Files:
part_svc.cgi svc_acct.cgi
Log Message:
limited domain select
Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_svc.cgi,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- part_svc.cgi 23 Aug 2006 22:25:37 -0000 1.52
+++ part_svc.cgi 25 Oct 2006 02:22:33 -0000 1.53
@@ -73,17 +73,20 @@
% select_table => 'svc_acct_pop',
% select_key => 'popnum',
% select_label => 'city',
+% disable_select => 1,
% },
% 'username' => {
% desc => 'Username',
% type => 'text',
% disable_default => 1,
% disable_fixed => 1,
+% disable_select => 1,
% },
% 'quota' => {
% desc => '',
% type => 'text',
% disable_inventory => 1,
+% disable_select => 1,
% },
% '_password' => 'Password',
% 'gid' => 'GID (when blank, defaults to UID)',
@@ -93,6 +96,7 @@
% type =>'select',
% select_list => [ $conf->config('shells') ],
% disable_inventory => 1,
+% disable_select => 1,
% },
% 'finger' => 'Real name (GECOS)',
% 'domsvc' => {
@@ -102,15 +106,18 @@
% select_key => 'svcnum',
% select_label => 'domain',
% disable_inventory => 1,
+% disable_select => 1,
% },
% 'usergroup' => {
% desc =>'RADIUS groups',
% type =>'radius_usergroup_selector',
+% disable_select => 1,
% disable_inventory => 1,
% },
% 'seconds' => { desc => '',
% type => 'text',
% disable_inventory => 1,
+% disable_select => 1,
% },
% },
%
@@ -148,11 +155,13 @@
% 'countrycode' => { desc => 'Country code',
% type => 'text',
% disable_inventory => 1,
+% disable_select => 1,
% },
% 'phonenum' => 'Phone number',
% 'pin' => { desc => 'Personal Identification Number',
% type => 'text',
% disable_inventory => 1,
+% disable_select => 1,
% },
% },
%
@@ -200,6 +209,10 @@
% 'condition' =>
% sub { ref($_[0]) && $_[0]->{disable_fixed} },
% },
+% 'S' => { 'desc' => 'Selectable Choice',
+% 'condition' =>
+% sub { !ref($_[0]) || $_[0]->{disable_select} },
+% },
%# need to template-ize httemplate/edit/svc_* first
%# 'M' => { 'desc' => 'Manual selection from inventory',
%# 'condition' => $inv_sub,
@@ -329,7 +342,7 @@
% " what.form.${layer}__${field}_classnum.disabled = true;".
% " what.form.${layer}__${field}_classnum.style.backgroundColor = '#dddddd';".
% " }".
-% ' } else if ( f == "D" || f == "F" ) { //enable, text box',
+% ' } else if ( f == "D" || f == "F" || f =="S" ) { //enable, text box',
% " what.form.${layer}__${field}.disabled = false;".
% " what.form.${layer}__${field}.style.backgroundColor = '#ffffff';".
% " what.form.${layer}__${field}.style.display = '';".
@@ -384,20 +397,22 @@
%
% } elsif ( $def->{type} eq 'select' ) {
%
-% $html .= qq!<SELECT NAME="${layer}__${field}" $disabled>!;
+% $html .= qq!<SELECT NAME="${layer}__${field}" $disabled!;
+% $html .= ' multiple' if $flag == 'S';
+% $html .= '>';
% $html .= '<OPTION> </OPTION>' unless $value;
% if ( $def->{select_table} ) {
% foreach my $record ( qsearch( $def->{select_table}, {} ) ) {
% my $rvalue = $record->getfield($def->{select_key});
% $html .= qq!<OPTION VALUE="$rvalue"!.
-% ( $rvalue==$value ? ' SELECTED>' : '>' ).
-% $record->getfield($def->{select_label}). '</OPTION>';
+% (grep(/^$rvalue$/, split(',',$value)) ? ' SELECTED>' : '>' ).
+% $record->getfield($def->{select_label}). '</OPTION>';
% } #next $record
% } else { # select_list
% foreach my $item ( @{$def->{select_list}} ) {
% $html .= qq!<OPTION VALUE="$item"!.
-% ( $item eq $value ? ' SELECTED>' : '>' ).
-% $item. '</OPTION>';
+% (grep(/^$item$/, split(',',$value)) ? ' SELECTED>' : '>' ).
+% $item. '</OPTION>';
% } #next $item
% } #endif
% $html .= '</SELECT>';
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_acct.cgi,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- svc_acct.cgi 23 Aug 2006 22:25:37 -0000 1.41
+++ svc_acct.cgi 25 Oct 2006 02:22:33 -0000 1.42
@@ -216,7 +216,14 @@
% }
% }
%
-% if ($cust_pkg && !$conf->exists('svc_acct-alldomains') ) {
+% if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'S' ) {
+% foreach my $domain
+% (split(',',$part_svc->part_svc_column('domsvc')->columnvalue)) {
+% my $svc_domain =
+% qsearchs('svc_domain', { 'svcnum' => $domain } );
+% $svc_domain{$svc_domain->svcnum} = $svc_domain if $svc_domain;
+% }
+% }elsif ($cust_pkg && !$conf->exists('svc_acct-alldomains') ) {
% my @cust_svc =
% map { qsearch('cust_svc', { 'pkgnum' => $_->pkgnum } ) }
% qsearch('cust_pkg', { 'custnum' => $cust_pkg->custnum } );
More information about the freeside-commits
mailing list