summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorivan <ivan>2010-11-07 00:56:35 +0000
committerivan <ivan>2010-11-07 00:56:35 +0000
commit2d73473ce78c22160b618e93802a9551c9c77d69 (patch)
tree8d994b6c1ee7deccdd38140f49feb1ecafbc3986 /httemplate/view
parent36c606eedba19978d1b5e0e1bf30d3069f28be64 (diff)
certificates ala communigate, RT#7515
Diffstat (limited to 'httemplate/view')
-rw-r--r--httemplate/view/elements/svc_Common.html10
-rw-r--r--httemplate/view/svc_Common.html4
-rw-r--r--httemplate/view/svc_cert.cgi34
3 files changed, 45 insertions, 3 deletions
diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html
index 8a352f3fa..618d33eed 100644
--- a/httemplate/view/elements/svc_Common.html
+++ b/httemplate/view/elements/svc_Common.html
@@ -18,6 +18,10 @@
# defaults to "edit/$table.cgi?", will have svcnum appended
'edit_url' =>
+
+ #at the very bottom (well, as low as you can go from here)
+ 'html_foot' => '',
+
)
</%doc>
@@ -56,12 +60,14 @@ Unprovision this Service</A>
% foreach my $f ( @$fields ) {
%
-% my($field, $type);
+% my($field, $type, $value);
% if ( ref($f) ) {
% $field = $f->{'field'},
+% $value = $f->{'value'} ? &{ $f->{'value'} }($svc_x) : $svc_x->$field;
% $type = $f->{'type'} || 'text',
% } else {
% $field = $f;
+% $value = $svc_x->$field;
% $type = 'text';
% }
%
@@ -78,7 +84,7 @@ Unprovision this Service</A>
% #eventually more options for <SELECT>, etc. fields
- <TD BGCOLOR="#ffffff"><% $svc_x->$field %><TD>
+ <TD BGCOLOR="#ffffff"><% $value %><TD>
</TR>
diff --git a/httemplate/view/svc_Common.html b/httemplate/view/svc_Common.html
index defbee974..7ed63c7aa 100644
--- a/httemplate/view/svc_Common.html
+++ b/httemplate/view/svc_Common.html
@@ -1,6 +1,6 @@
<% include('elements/svc_Common.html',
'table' => $table,
- 'edit_url' => $p."edit/svc_Common.html?svcdb=$table;svcnum=",
+ 'edit_url' => $edit_url, #$p."edit/svc_Common.html?svcdb=$table;svcnum=",
%opt,
)
%>
@@ -12,6 +12,8 @@ $cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unparsable svcdb";
my $table = $1;
require "FS/$table.pm";
+my $edit_url = svc_url( 'm' => $m, 'action' => 'edit', 'svcdb' => $table, query => '' );
+
my %opt;
if ( UNIVERSAL::can("FS::$table", 'table_info') ) {
$opt{'name'} = "FS::$table"->table_info->{'name'};
diff --git a/httemplate/view/svc_cert.cgi b/httemplate/view/svc_cert.cgi
new file mode 100644
index 000000000..92902d6d2
--- /dev/null
+++ b/httemplate/view/svc_cert.cgi
@@ -0,0 +1,34 @@
+<% include('elements/svc_Common.html',
+ 'table' => 'svc_cert',
+ 'labels' => \%labels,
+ #'html_foot' => $html_foot,
+ 'fields' => \@fields,
+ )
+%>
+<%init>
+
+my $fields = FS::svc_cert->table_info->{'fields'};
+my %labels = map { $_ => ( ref($fields->{$_})
+ ? $fields->{$_}{'label'}
+ : $fields->{$_}
+ );
+ }
+ keys %$fields;
+
+my @fields = (
+ { field=>'privatekey',
+ value=> sub {
+ my $svc_cert = shift;
+ if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) {
+ '<FONT COLOR="#33ff33">Verification OK</FONT>';
+ } elsif ( $svc_cert->privatekey ) {
+ '<FONT COLOR="#ff0000">Verification error</FONT>';
+ } else {
+ '<I>(none)</I>';
+ }
+ },
+ },
+ qw( organization organization_unit city state country cert_contact )
+);
+
+</%init>