summaryrefslogtreecommitdiff
path: root/httemplate/view/elements/svc_edit_link.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/elements/svc_edit_link.html')
-rw-r--r--httemplate/view/elements/svc_edit_link.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/httemplate/view/elements/svc_edit_link.html b/httemplate/view/elements/svc_edit_link.html
new file mode 100644
index 000000000..b16261a87
--- /dev/null
+++ b/httemplate/view/elements/svc_edit_link.html
@@ -0,0 +1,23 @@
+% if ( $cancel_date ) {
+<I><% mt("Canceled [_1]", time2str('%b %o %Y', $cancel_date) ) |h %></I>
+% } else {
+<SCRIPT>
+function areyousure_delete() {
+ if (confirm(<% mt('Permanently delete this service?') |js_string %>) == true)
+ window.location.href = '<% $cancel_url %>';
+}
+</SCRIPT>
+<A HREF="<% $edit_url %>"><% mt("Edit this [_1]", $label) |h %></A> |
+<A HREF="javascript:areyousure_delete()"><% mt('Unprovision this Service') |h %></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>