combine ticket notification scrips, #15353
[freeside.git] / httemplate / view / elements / svc_edit_link.html
1 % if ( $cancel_date ) {
2 <I><% mt("Canceled [_1]", time2str('%b %o %Y', $cancel_date) ) |h %></I>
3 % } else {
4 <SCRIPT>
5 function areyousure_delete() {
6   if (confirm(<% mt('Permanently delete this service?') |js_string %>) == true)
7     window.location.href = '<% $cancel_url %>';
8 }
9 </SCRIPT>
10 <A HREF="<% $edit_url %>"><% mt("Edit this [_1]", $label) |h %></A> | 
11 <A HREF="javascript:areyousure_delete()"><% mt('Unprovision this Service') |h %></A>
12 % }
13 <%init>
14 my %opt = @_;
15 my $svc_x = $opt{'svc'} or die "'svc' required";
16 my $svcdb = $opt{'table'} || $svc_x->table;
17 my $edit_url = $opt{'edit_url'} || 
18                $p . 'edit/' . $svcdb . '.cgi?' . $svc_x->svcnum;
19 my $cancel_url = $p . 'misc/unprovision.cgi?' . $svc_x->svcnum;
20 my $cust_svc = $svc_x->cust_svc; # always exists
21 my $cancel_date = $cust_svc->pkg_cancel_date;
22 my ($label) = $cust_svc->label;
23 </%init>