projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service refactor!
[freeside.git]
/
httemplate
/
view
/
elements
/
svc_Common.html
diff --git
a/httemplate/view/elements/svc_Common.html
b/httemplate/view/elements/svc_Common.html
index
3543463
..
7b8df3a
100644
(file)
--- 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' => [
% # ]
% # 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) = @_;
%
%
% my(%opt) = @_;
%
@@
-21,9
+24,15
@@
% #|| [ grep { $_ ne 'svcnum' } dbdef->table($table)->columns ];
% || [ grep { $_ ne 'svcnum' } fields($table) ];
%
% #|| [ 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";
%
% 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>
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) %>
<BR>
<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>