Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / view / elements / svc_edit_link.html
index a85d380..2de5ecf 100644 (file)
@@ -1,24 +1,36 @@
-% if ( $cancel_date ) {
-<I>Canceled <% time2str('%b %o %Y', $cancel_date) %></I>
-% } else {
 <SCRIPT>
 function areyousure_delete() {
-  if (confirm("Permanently delete this service?") == true)
+  if (confirm(<% mt('Permanently delete this service?') |js_string %>) == true)
     window.location.href = '<% $cancel_url %>';
 }
 </SCRIPT>
-<A HREF="<% $edit_url %>">Edit this <% $label %></A> | 
-<A HREF="javascript:areyousure_delete()">
-Unprovision this Service</A>
+% if ( $cancel_date ) {
+| <I><% mt("Canceled [_1]", time2str('%b %o %Y', $cancel_date) ) |h %></I>
+% } else {
+%   if ( $curuser->access_right('Provision customer service') ) {
+| <A HREF="<% $edit_url %>"><% mt("Edit this [_1]", $label) |h %></A>
+%   }
+% }
+% if ( $curuser->access_right('Unprovision customer service') ) {
+| <A HREF="javascript:areyousure_delete()"><% mt('Unprovision this Service') |h %></A>
 % }
+<& /elements/manage_device_link.html, 
+       'svc' => $svc_x,
+       'part_svc' => $opt{'part_svc'} || $cust_svc->part_svc,
+       'manage_link' => $opt{'manage_link'},
+       'manage_link_text' => $opt{'manage_link_text'},
+       'manage_link-new_window' => $opt{'manage_link-new_window'},
+       'prepend' => '| '
+&>
 <%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 $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;
+my $curuser = $FS::CurrentUser::CurrentUser;
 </%init>