From c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 31 Jan 2006 04:26:54 +0000 Subject: move header() to include(/elements/header.html) so it can be changed in one place, thanks to Scott Edwards --- httemplate/misc/link.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc/link.cgi') diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index 18cd378d3..e2bdda7d5 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -31,7 +31,7 @@ my $link_field2 = $link_field2{$svcdb}; %> -<%= header("Link to existing $svc") %> +<%= include("/elements/header.html","Link to existing $svc") %>
<% if ( $link_field ) { %> -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/misc/link.cgi | 124 +++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 57 deletions(-) (limited to 'httemplate/misc/link.cgi') 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 @@ -<% +% +% +%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") %> + +% 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") %> - - -<% if ( $link_field ) { %> - - <%= $link_field %> of existing service: + + <% $link_field %> of existing service:
- <% if ( $link_field2 ) { %> - - <%= $link_field2->{'label'} %> of existing service: - <% if ( $link_field2->{'type'} eq 'select' ) { %> - <% if ( $link_field2->{'select_table'} ) { %> +% if ( $link_field2 ) { + + + <% $link_field2->{'label'} %> of existing service: +% if ( $link_field2->{'type'} eq 'select' ) { +% if ( $link_field2->{'select_table'} ) { + - <% } 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'} %>) +% } +
- <% } %> -<% } else { %> +% } +% } else { + Service # of existing service: -<% } %> +% } + - - + +
-- cgit v1.2.1 From 633c48448d9468690b7ad77eb6ff7c660a286658 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2006 08:51:34 +0000 Subject: service refactor! --- httemplate/misc/link.cgi | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'httemplate/misc/link.cgi') diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index 1d1f5e133..ef72b4a5c 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -1,6 +1,3 @@ - -% -% %my %link_field = ( % 'svc_acct' => 'username', % 'svc_domain' => 'domain', @@ -16,12 +13,10 @@ % }, %); % -%my($query) = $cgi->keywords; -%my($pkgnum, $svcpart) = ('', ''); -%foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart -% $pkgnum=$1 if /^pkgnum(\d+)$/; -% $svcpart=$1 if /^svcpart(\d+)$/; -%} +%$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum'; +%my $pkgnum = $1; +%$cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart'; +%my $svcpart = $1; % %my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); %my $svc = $part_svc->getfield('svc'); @@ -29,8 +24,6 @@ %my $link_field = $link_field{$svcdb}; %my $link_field2 = $link_field2{$svcdb}; % -% - <% include("/elements/header.html","Link to existing $svc") %>
-- cgit v1.2.1