2 function areyousure_delete() {
3 if (confirm(<% mt('Permanently delete this service?') |js_string %>) == true)
4 window.location.href = '<% $cancel_url %>';
7 % if ( $cancel_date ) {
8 | <I><% mt("Canceled [_1]", time2str('%b %o %Y', $cancel_date) ) |h %></I>
10 % if ( $curuser->access_right('Provision customer service') ) {
11 | <A HREF="<% $edit_url %>"><% mt("Edit this [_1]", $label) |h %></A>
14 % if ( $curuser->access_right('Unprovision customer service') ) {
15 | <A HREF="javascript:areyousure_delete()"><% mt('Unprovision this Service') |h %></A>
17 <& /elements/manage_device_link.html,
19 'part_svc' => $opt{'part_svc'} || $cust_svc->part_svc,
20 'manage_link' => $opt{'manage_link'},
21 'manage_link_text' => $opt{'manage_link_text'},
22 'manage_link-new_window' => $opt{'manage_link-new_window'},
27 my $svc_x = $opt{'svc'} or die "'svc' required";
28 my $svcdb = $opt{'table'} || $svc_x->table;
29 my $edit_url = ($opt{'edit_url'} ||
30 $p . 'edit/' . $svcdb . '.cgi?' ). $svc_x->svcnum;
31 my $cancel_url = $p . 'misc/unprovision.cgi?' . $svc_x->svcnum;
32 my $cust_svc = $svc_x->cust_svc; # always exists
33 my $cancel_date = $cust_svc->pkg_cancel_date;
34 my ($label) = $cust_svc->label;
35 my $curuser = $FS::CurrentUser::CurrentUser;