diff options
author | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
commit | 3ce7691203a7737406bf2d4442f7fd84b81f847e (patch) | |
tree | 90658b097da96772224f04771888ac6ca1a940aa /httemplate/misc/link.cgi | |
parent | 15e561850b61b10a92a46d8f3e316d53d4970087 (diff) |
Will things ever be the same again?
It's the final masonize
Diffstat (limited to 'httemplate/misc/link.cgi')
-rwxr-xr-x | httemplate/misc/link.cgi | 124 |
1 files changed, 67 insertions, 57 deletions
diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index e2bdda7d5..1d1f5e133 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -1,73 +1,83 @@ <!-- mason kludge --> -<% +% +% +%my %link_field = ( +% 'svc_acct' => 'username', +% 'svc_domain' => 'domain', +%); +% +%my %link_field2 = ( +% 'svc_acct' => { label => 'Domain', +% field => 'domsvc', +% type => 'select', +% select_table => 'svc_domain', +% select_key => 'svcnum', +% select_label => 'domain' +% }, +%); +% +%my($query) = $cgi->keywords; +%my($pkgnum, $svcpart) = ('', ''); +%foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart +% $pkgnum=$1 if /^pkgnum(\d+)$/; +% $svcpart=$1 if /^svcpart(\d+)$/; +%} +% +%my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); +%my $svc = $part_svc->getfield('svc'); +%my $svcdb = $part_svc->getfield('svcdb'); +%my $link_field = $link_field{$svcdb}; +%my $link_field2 = $link_field2{$svcdb}; +% +% -my %link_field = ( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', -); -my %link_field2 = ( - 'svc_acct' => { label => 'Domain', - field => 'domsvc', - type => 'select', - select_table => 'svc_domain', - select_key => 'svcnum', - select_label => 'domain' - }, -); +<% include("/elements/header.html","Link to existing $svc") %> +<FORM ACTION="<% popurl(1) %>process/link.cgi" METHOD=POST> +% if ( $link_field ) { -my($query) = $cgi->keywords; -my($pkgnum, $svcpart) = ('', ''); -foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my $svc = $part_svc->getfield('svc'); -my $svcdb = $part_svc->getfield('svcdb'); -my $link_field = $link_field{$svcdb}; -my $link_field2 = $link_field2{$svcdb}; - -%> - -<%= include("/elements/header.html","Link to existing $svc") %> -<FORM ACTION="<%= popurl(1) %>process/link.cgi" METHOD=POST> - -<% if ( $link_field ) { %> <INPUT TYPE="hidden" NAME="svcnum" VALUE=""> - <INPUT TYPE="hidden" NAME="link_field" VALUE="<%= $link_field %>"> - <%= $link_field %> of existing service: <INPUT TYPE="text" NAME="link_value"> + <INPUT TYPE="hidden" NAME="link_field" VALUE="<% $link_field %>"> + <% $link_field %> of existing service: <INPUT TYPE="text" NAME="link_value"> <BR> - <% if ( $link_field2 ) { %> - <INPUT TYPE="hidden" NAME="link_field2" VALUE="<%= $link_field2->{field} %>"> - <%= $link_field2->{'label'} %> of existing service: - <% if ( $link_field2->{'type'} eq 'select' ) { %> - <% if ( $link_field2->{'select_table'} ) { %> +% if ( $link_field2 ) { + + <INPUT TYPE="hidden" NAME="link_field2" VALUE="<% $link_field2->{field} %>"> + <% $link_field2->{'label'} %> of existing service: +% if ( $link_field2->{'type'} eq 'select' ) { +% if ( $link_field2->{'select_table'} ) { + <SELECT NAME="link_value2"> <OPTION> </OPTION> - <% foreach my $r ( qsearch( $link_field2->{'select_table'}, {})) { %> - <% my $key = $link_field2->{'select_key'}; %> - <% my $label = $link_field2->{'select_label'}; %> - <OPTION VALUE="<%= $r->$key() %>"><%= $r->$label() %></OPTION> - <% } %> +% foreach my $r ( qsearch( $link_field2->{'select_table'}, {})) { +% my $key = $link_field2->{'select_key'}; +% my $label = $link_field2->{'select_label'}; + + <OPTION VALUE="<% $r->$key() %>"><% $r->$label() %></OPTION> +% } + </SELECT> - <% } else { %> - Don't know how to process secondary link field for <%= $svcdb %> +% } else { + + Don't know how to process secondary link field for <% $svcdb %> (type=>select but no select_table) - <% } %> - <% } else { %> - Don't know how to process secondary link field for <%= $svcdb %> - (unknown type <%= $link_field2->{'type'} %>) - <% } %> +% } +% } else { + + Don't know how to process secondary link field for <% $svcdb %> + (unknown type <% $link_field2->{'type'} %>) +% } + <BR> - <% } %> -<% } else { %> +% } +% } else { + Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE=""> -<% } %> +% } + -<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%= $pkgnum %>"> -<INPUT TYPE="hidden" NAME="svcpart" VALUE="<%= $svcpart %>"> +<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>"> +<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>"> <BR><INPUT TYPE="submit" VALUE="Link"> </FORM> </BODY> |