X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Felements%2Fsvc_edit_link.html;h=2de5ecf9c8c13a233a47bea31f93eda33a9c4c3e;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hp=b16261a87bc9e850be0050fdf554bbfa83dff0d1;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git
diff --git a/httemplate/view/elements/svc_edit_link.html b/httemplate/view/elements/svc_edit_link.html
index b16261a87..2de5ecf9c 100644
--- a/httemplate/view/elements/svc_edit_link.html
+++ b/httemplate/view/elements/svc_edit_link.html
@@ -1,23 +1,36 @@
-% if ( $cancel_date ) {
-<% mt("Canceled [_1]", time2str('%b %o %Y', $cancel_date) ) |h %>
-% } else {
-<% mt("Edit this [_1]", $label) |h %> |
-<% mt('Unprovision this Service') |h %>
+% if ( $cancel_date ) {
+| <% mt("Canceled [_1]", time2str('%b %o %Y', $cancel_date) ) |h %>
+% } else {
+% if ( $curuser->access_right('Provision customer service') ) {
+| <% mt("Edit this [_1]", $label) |h %>
+% }
+% }
+% if ( $curuser->access_right('Unprovision customer service') ) {
+| <% mt('Unprovision this Service') |h %>
% }
+<& /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>