summaryrefslogtreecommitdiff
path: root/httemplate/view/elements
diff options
context:
space:
mode:
authormark <mark>2011-04-01 02:52:24 +0000
committermark <mark>2011-04-01 02:52:24 +0000
commitb65b8096089410001dfbcd35f9a56f9405b9f5f1 (patch)
treedf16b0422007bd876bc969bdff857d8a510b0aca /httemplate/view/elements
parent19b0c403fbf697a1de92f12abc8a2104daca07bc (diff)
svc_hardware and svc_dish, #11454
Diffstat (limited to 'httemplate/view/elements')
-rw-r--r--httemplate/view/elements/svc_Common.html5
-rw-r--r--httemplate/view/elements/svc_edit_link.html24
2 files changed, 25 insertions, 4 deletions
diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html
index de49b50d2..7a7539da2 100644
--- a/httemplate/view/elements/svc_Common.html
+++ b/httemplate/view/elements/svc_Common.html
@@ -51,10 +51,7 @@ function areyousure(href) {
Service #<B><% $svcnum %></B>
% my $url = $opt{'edit_url'} || $p. 'edit/'. $opt{'table'}. '.cgi?';
-| <A HREF="<%$url%><%$svcnum%>">Edit this <% $label %></A>
-
-| <A HREF="javascript:areyousure('<%$p.'misc/unprovision.cgi?'.$svcnum%>')">
-Unprovision this Service</A>
+| <% include('/view/elements/svc_edit_link.html', 'svc' => $svc_x) %>
<BR>
<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
diff --git a/httemplate/view/elements/svc_edit_link.html b/httemplate/view/elements/svc_edit_link.html
new file mode 100644
index 000000000..a85d38077
--- /dev/null
+++ b/httemplate/view/elements/svc_edit_link.html
@@ -0,0 +1,24 @@
+% if ( $cancel_date ) {
+<I>Canceled <% time2str('%b %o %Y', $cancel_date) %></I>
+% } else {
+<SCRIPT>
+function areyousure_delete() {
+ if (confirm("Permanently delete this service?") == true)
+ window.location.href = '<% $cancel_url %>';
+}
+</SCRIPT>
+<A HREF="<% $edit_url %>">Edit this <% $label %></A> |
+<A HREF="javascript:areyousure_delete()">
+Unprovision this Service</A>
+% }
+<%init>
+my %opt = @_;
+my $svc_x = $opt{'svc'} or die "'svc' required";
+my $svcdb = $opt{'table'} || $svc_x->table;
+my $edit_url = $opt{'edit_url'} ||
+ $p . 'edit/' . $svcdb . '.cgi?' . $svc_x->svcnum;
+my $cancel_url = $p . 'misc/unprovision.cgi?' . $svc_x->svcnum;
+my $cust_svc = $svc_x->cust_svc; # always exists
+my $cancel_date = $cust_svc->pkg_cancel_date;
+my ($label) = $cust_svc->label;
+</%init>