diff options
author | ivan <ivan> | 2006-12-29 08:51:34 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-12-29 08:51:34 +0000 |
commit | 633c48448d9468690b7ad77eb6ff7c660a286658 (patch) | |
tree | 4e08051f8d805e7e95c8dffe5e3e73b0c360f965 /httemplate/view/elements | |
parent | 6cb5c702b17b98be46adea4539e15d5f312e5be1 (diff) |
service refactor!
Diffstat (limited to 'httemplate/view/elements')
-rw-r--r-- | httemplate/view/elements/svc_Common.html | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 35434632e..7b8df3a74 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -12,6 +12,9 @@ % # if not specified all columns (except for the primary key) will be viewable % # 'fields' => [ % # ] +% # +% # # defaults to "edit/$table.cgi?", will have svcnum appended +% # 'edit_url' => % % my(%opt) = @_; % @@ -21,9 +24,15 @@ % #|| [ grep { $_ ne 'svcnum' } dbdef->table($table)->columns ]; % || [ grep { $_ ne 'svcnum' } fields($table) ]; % -% my($query) = $cgi->keywords; -% $query =~ /^(\d+)$/; -% my $svcnum = $1; +% my $svcnum; +% if ( $cgi->param('svcnum') ) { +% $cgi->param('svcnum') =~ /^(\d+)$/ or die "unparsable svcnum"; +% $svcnum = $1; +% } else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/ or die "no svcnum"; +% $svcnum = $1; +% } % my $svc_x = qsearchs( $opt{'table'}, { 'svcnum' => $svcnum } ) % or die "Unknown svcnum $svcnum in ". $opt{'table'}. " table\n"; % @@ -69,7 +78,8 @@ Service #<B><% $svcnum %></B> -| <A HREF="<%$p%>edit/<% $opt{'table'} %>.cgi?<%$svcnum%>">Edit this <% $label %></A> +% my $url = $opt{'edit_url'} || $p. 'edit/'. $opt{'table'}. '.cgi?'; +| <A HREF="<%$url%><%$svcnum%>">Edit this <% $label %></A> <BR> <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %> |