From: ivan Date: Thu, 4 Feb 2010 10:00:44 +0000 (+0000) Subject: add ability to edit referring customer, RT#7174 X-Git-Tag: freeside_1_9_2~83 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=7f9b83d3bdaab8581479ae98b46909130a89f2af;p=freeside.git add ability to edit referring customer, RT#7174 --- diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm index 46e740cc1..03b98763a 100644 --- a/FS/FS/AccessRight.pm +++ b/FS/FS/AccessRight.pm @@ -94,6 +94,7 @@ tie my %rights, 'Tie::IxHash', 'View customer', #'View Customer | View tickets', 'Edit customer', + 'Edit referring customer', 'View customer history', 'Cancel customer', 'Complimentary customer', #aka users-allow_comp diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index 041050664..3d6c4862d 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -43,6 +43,7 @@ %if ( $cust_main->referral_custnum % and $referring_cust_main = % qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) +% and ! $curuser->access_right('Edit referring customer') %) { @@ -52,8 +53,8 @@ -% } elsif ( ! $conf->exists('disable_customer_referrals') ) { +% } elsif ( ! $conf->exists('disable_customer_referrals') ) { Referring customer @@ -61,13 +62,13 @@ <% include('/elements/search-cust_main.html', 'field_name' => 'referral_custnum', + 'curr_value' => $cust_main->referral_custnum, ) %> -% } else { - +% } else { % } @@ -92,6 +93,8 @@ my $custnum = $opt{'custnum'}; my $conf = new FS::Conf; +my $curuser = $FS::CurrentUser::CurrentUser; + my $r = qq!* !; diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html index dbcc2ed0b..ef0d22ced 100644 --- a/httemplate/elements/search-cust_main.html +++ b/httemplate/elements/search-cust_main.html @@ -1,3 +1,15 @@ +<%doc> + +Example: + + include( '/elements/search-cust_main.html, + 'field_name' => 'custnum', + 'find_button' => 1, #add a "find" button to the field + 'curr_value' => 54, #current value + 'value => 32, #deprecated synonym for curr_value + ); + +