diff options
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 9 | ||||
-rwxr-xr-x | httemplate/edit/process/svc_acct.cgi | 12 | ||||
-rwxr-xr-x | httemplate/edit/svc_acct.cgi | 26 | ||||
-rw-r--r-- | httemplate/elements/communigate_pro-accessmodes.html | 30 | ||||
-rw-r--r-- | httemplate/pref/pref-process.html | 2 | ||||
-rw-r--r-- | httemplate/pref/pref.html | 4 | ||||
-rw-r--r-- | httemplate/view/elements/svc_export_settings.html | 36 | ||||
-rw-r--r-- | httemplate/view/svc_acct/basics.html | 2 |
8 files changed, 95 insertions, 26 deletions
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index d74e0f20d..6428960dd 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -292,6 +292,7 @@ that field. % } elsif ( $def->{type} eq 'select-svc_pbx.html' ) { % % $html .= include('/elements/select-svc_pbx.html', +% 'curr_value' => $value, % 'element_name' => "${layer}__${field}", % 'element_etc' => $disabled, % 'multiple' => ($flag eq 'S'), @@ -305,6 +306,14 @@ that field. % $html .= FS::svc_acct::radius_usergroup_selector( % [ split(',', $value) ], "${layer}__${field}" ); % +% } elsif ( $def->{type} eq 'communigate_pro-accessmodes' ) { +% +% $html .= include('/elements/communigate_pro-accessmodes.html', +% 'element_name_prefix' => "${layer}__${field}_", +% 'curr_value' => $value, +% #doesn't work#'element_etc' => $disabled, +% ); +% % } elsif ( $def->{type} eq 'disabled' ) { % % $html .= diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index 1712d51a8..a4c60ef9e 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -31,6 +31,18 @@ foreach (map { $_,$_."_threshold" } qw( upbytes downbytes totalbytes )) { $cgi->param($_, FS::UI::bytecount::parse_bytecount($cgi->param($_)) ); } +#unmunge cgp_accessmodes (falze laziness-ish w/part_svc.pm::process) +unless ( $cgi->param('cgp_accessmodes') ) { + $cgi->param('cgp_accessmodes', + join(' ', + sort map { /^cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; } + grep $cgi->param($_), + grep /^cgp_accessmodes_([\w\/]+)$/, + $cgi->param() + ) + ); +} + my %hash = $svcnum ? $old->hash : (); map { $hash{$_} = scalar($cgi->param($_)); diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index 065ce701d..0254ec186 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -243,7 +243,9 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR> % } -% if ( $communigate ) { +% if ( $communigate +% && $part_svc->part_svc_column('cgp_type')->columnflag ne 'F' ) +% { <TR> <TD ALIGN="right">Mailbox type</TD> @@ -258,17 +260,27 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR> </TD> </TR> - <TR> +% } else { + <INPUT TYPE="hidden" NAME="cgp_type" VALUE="<% $svc_acct->cgp_type() %>"> +% } + + +% if ( $communigate +% && $part_svc->part_svc_column('cgp_accessmodes')->columnflag ne 'F' ) +% { + <TR> - <TD ALIGN="right">Mailbox type</TD> - <TD>XXX checkbox thingie!! + <TD ALIGN="right">Enabled services</TD> + <TD> + <% include( '/elements/communigate_pro-accessmodes.html', + 'curr_value' => $svc_acct->cgp_accessmodes, + ) + %> </TD> </TR> - % } else { - <INPUT TYPE="hidden" NAME="cgp_type" VALUE="<% $svc_acct->cgp_type() %>"> - <INPUT TYPE="hidden" NAME="cgp_accessmodes" VALUE="<% $svc_acct->cgp_accessmodes() %>"> + <INPUT TYPE="hidden" NAME="cgp_accessmodes" VALUE="<% $svc_acct->cgp_accessmodes() |h %>"> % } diff --git a/httemplate/elements/communigate_pro-accessmodes.html b/httemplate/elements/communigate_pro-accessmodes.html new file mode 100644 index 000000000..6ce9ca587 --- /dev/null +++ b/httemplate/elements/communigate_pro-accessmodes.html @@ -0,0 +1,30 @@ +<% include( 'checkboxes.html', + 'element_name_prefix' => 'cgp_accessmodes_', + 'names_list' => \@names, + 'checked_callback' => $callback, + %opt, + ) +%> +<%once> + +my @names = (qw( + Mail Relay Signal Mobile TLS POP IMAP MAPI + AirSync SIP XMPP WebMail XIMSS FTP ACAP PWD + LDAP RADIUS S/MIME WebCAL WebSite PBX HTTP +)); + +</%once> +<%init> + +my %opt = @_; +my $curr_value = $opt{'curr_value'}; + +$curr_value = { map { $_=>1 } split(/\s+/, $curr_value) } + unless ref($curr_value); + +my $callback = sub { + my( $cgi, $name ) = @_; + $curr_value->{$name}; +}; + +</%init> diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index 2b6c969f8..708583df5 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -47,7 +47,7 @@ unless ( $error ) { # if ($access_user) { email_address snom-ip snom-username snom-password vonage-fromnumber vonage-username vonage-password - show_pkgnum show_confitem_counts + show_pkgnum show_confitem_counts export_getsettings show_db_profile save_db_profile height width availHeight availWidth colorDepth ); diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index 5cd75e26c..7ded18377 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -84,6 +84,10 @@ Development <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD> </TR> <TR> + <TH>Show export data on service view (when available): </TH> + <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD> + </TR> + <TR> <TH>Show database profiling (when available): </TH> <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD> </TR> diff --git a/httemplate/view/elements/svc_export_settings.html b/httemplate/view/elements/svc_export_settings.html index 026280546..a3c09110f 100644 --- a/httemplate/view/elements/svc_export_settings.html +++ b/httemplate/view/elements/svc_export_settings.html @@ -1,26 +1,28 @@ -% my ( $settings, $defaults ) = $svc_x->export_getsettings; -% if ( keys %$settings ) { +% if ( $FS::CurrentUser::CurrentUser->option('export_getsettings') ) { + +% my ( $settings, $defaults ) = $svc_x->export_getsettings; +% if ( keys %$settings ) { %# XXX a way to label this "Communigate pro settings".. just a config maybe - External settings - <% ntable('#cccccc',2) %> + External settings + <% ntable('#cccccc',2) %> -% foreach my $key ( keys %$settings ) { - <TR> - <TD ALIGN="right"><% $key |h %></TD> - <TD BGCOLOR="<% $defaults->{$key} ? '#eeeeee' : '#ffffff' %>"> - <% $defaults->{$key} ? '<I>' : '<B>' %> - <% $settings->{$key} |h %> - <% $defaults->{$key} ? '</I>' : '</B>' %> - </TD> - </TR> -% } +% foreach my $key ( keys %$settings ) { + <TR> + <TD ALIGN="right"><% $key |h %></TD> + <TD BGCOLOR="<% $defaults->{$key} ? '#eeeeee' : '#ffffff' %>"> + <% $defaults->{$key} ? '<I>' : '<B>' %> + <% $settings->{$key} |h %> + <% $defaults->{$key} ? '</I>' : '</B>' %> + </TD> + </TR> +% } - </TABLE> - <BR> + </TABLE> + <BR> +% } % } - <%init> my $svc_x = shift; diff --git a/httemplate/view/svc_acct/basics.html b/httemplate/view/svc_acct/basics.html index 752b4833a..6eddd492d 100644 --- a/httemplate/view/svc_acct/basics.html +++ b/httemplate/view/svc_acct/basics.html @@ -109,7 +109,7 @@ <TR> <TD ALIGN="right">Enabled services</TD> - <TD BGCOLOR="#ffffff"><% $svc_acct->cgp_accessmodes %></TD> + <TD BGCOLOR="#ffffff"><% $svc_acct->cgp_accessmodes |h %></TD> </TR> <TR> |