From 9b6e476ab5a9f42877543065eff960928df2304b Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 6 Jul 2002 11:08:48 +0000 Subject: [PATCH] fix UI for forwards - use HTML::Widgets::SelectLayers, closes: Bug#303 --- httemplate/edit/svc_forward.cgi | 133 +++++++++++++--------------------------- httemplate/view/svc_forward.cgi | 12 +++- 2 files changed, 52 insertions(+), 93 deletions(-) diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi index 5f1466bbb..bc19fe1de 100755 --- a/httemplate/edit/svc_forward.cgi +++ b/httemplate/edit/svc_forward.cgi @@ -119,105 +119,58 @@ my($srcsvc,$dstsvc,$dst)=( #display -my $p1 = popurl(1); -print header("Mail Forward $action", '', - " onLoad=\"visualize()\""); - %> - - -<% - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); +<%= header("Mail Forward $action") %> -print qq!
!; +<% if ( $cgi->param('error') ) { %> + Error: <%= $cgi->param('error') %> +

+<% } %> -#svcnum -print qq!!; -print qq!Service #!, $svcnum ? $svcnum : " (NEW)", ""; -print qq!
!; +Service #<%= $svcnum ? "$svcnum" : " (NEW)" %>
+Service: <%= $part_svc->svc %>

-#pkgnum -print qq!!; - -#svcpart -print qq!!; - -#srcsvc -print qq!\n\nMail to "; + -#dstsvc -print qq! forwards to mailbox."; - -%> - - +<%= ntable("#cccccc",2) %> +Email to <% -print qq! Other destination: !; + tie my %tied_email, 'Tie::IxHash', + '' => 'SELECT DESTINATION', + %email, + '0' => '(other email address)'; + my $widget = new HTML::Widgets::SelectLayers( + 'selected_layer' => $dstsvc, + 'options' => \%tied_email, + 'form_name' => 'dummy', + 'form_action' => 'process/svc_forward.cgi', + 'form_select' => ['srcsvc'], + 'html_between' => '', + 'layer_callback' => sub { + my $layer = shift; + my $html = qq!!. + qq!!. + qq!!. + qq!!; + if ( $layer eq '0' ) { + $html .= ntable("#cccccc",2). + 'Destination email'. + qq!!. + ''; + } + $html .= '
'; + $html; + }, + ); %> - - -
-
- - - - +Forwards to +<%= $widget->html %> diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi index 8d2afc823..c8d1d6213 100755 --- a/httemplate/view/svc_forward.cgi +++ b/httemplate/view/svc_forward.cgi @@ -53,9 +53,15 @@ if ($dstsvc) { } print qq!Edit this information!. - "
Service #$svcnum". - "
Service: $svc". - qq!
Mail to $source forwards to $destination mailbox.!. + ntable("#cccccc",2). + 'Service number'. + qq!$svcnum!. + 'Service'. + qq!$svc!. + qq!Email to!. + qq!$source!. + qq!Forwards to !. + qq!$destination!. '
'. joblisting({'svcnum'=>$svcnum}, 1). '' ; -- 2.11.0