summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2010-02-04 10:00:44 +0000
committerivan <ivan>2010-02-04 10:00:44 +0000
commit7f9b83d3bdaab8581479ae98b46909130a89f2af (patch)
tree8189f453bff554dc3e103d97d4e9e9877ad795f4 /httemplate
parent8516d20fbbe18462879871f684a7cbda6e6404d4 (diff)
add ability to edit referring customer, RT#7174
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/cust_main/top_misc.html9
-rw-r--r--httemplate/elements/search-cust_main.html12
2 files changed, 18 insertions, 3 deletions
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')
%) {
<TR>
@@ -52,8 +53,8 @@
</TD>
</TR>
<INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
-% } elsif ( ! $conf->exists('disable_customer_referrals') ) {
+% } elsif ( ! $conf->exists('disable_customer_referrals') ) {
<TR>
<TD ALIGN="right">Referring customer</TD>
@@ -61,13 +62,13 @@
<!-- <INPUT TYPE="text" NAME="referral_custnum" VALUE=""> -->
<% include('/elements/search-cust_main.html',
'field_name' => 'referral_custnum',
+ 'curr_value' => $cust_main->referral_custnum,
)
%>
</TD>
</TR>
-% } else {
-
+% } else {
<INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
% }
@@ -92,6 +93,8 @@ my $custnum = $opt{'custnum'};
my $conf = new FS::Conf;
+my $curuser = $FS::CurrentUser::CurrentUser;
+
my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
</%init>
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
+ );
+
+</%doc>
<INPUT TYPE="hidden" NAME="<% $opt{'field_name'} %>" VALUE="<% $value %>">
<!-- some false laziness w/ misc/batch-cust_pay.html, though not as bad as i'd thought at first... -->