X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=07629dcff5fbbeb91152e3da058ea77e54516f63;hb=38458c0c9135228828b5a477ed1710ef687ec3d3;hp=144d5405c2efa5757fb1488715ff25e1954ab04d;hpb=88c42d0423368bf52d593021f704bfa38845ff71;p=freeside.git
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 144d5405c..07629dcff 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -1,439 +1,330 @@
-<%
+<% include('/elements/header.html',
+ $title,
+ '',
+ ' onUnload="myclose()"' #hmm, in billing.html
+) %>
+
+<% include('/elements/error.html') %>
+
+
-
+<% include('/elements/footer.html') %>
-<%
-my $referring_cust_main = '';
-if ( $cust_main->referral_custnum
- and $referring_cust_main =
- qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
-) {
-%>
+<%init>
-
Referring Customer:
- <%= $cust_main->referral_custnum %>: <%= $referring_cust_main->name %>
-
+my $curuser = $FS::CurrentUser::CurrentUser;
-<% } elsif ( ! $conf->exists('disable_customer_referrals') ) { %>
+#probably redundant given the checks below...
+die "access denied"
+ unless $curuser->access_right('New customer')
+ || $curuser->access_right('Edit customer');
-
Referring customer number:
-
-
-<% } else { %>
+my $conf = new FS::Conf;
-
+#get record
-<% } %>
+my($custnum, $cust_main, $ss, $stateid, $payinfo, @invoicing_list);
+my $same = '';
+my $pkgpart_svcpart = ''; #first_pkg
+my($username, $password, $popnum, $saved_domsvc) = ( '', '', 0, 0 ); #svc_acct
+my %svc_phone = ();
-
+if ( $cgi->param('error') ) {
-
-Billing address
-<%= include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %>
+ $cust_main = new FS::cust_main ( {
+ map { $_, scalar($cgi->param($_)) } fields('cust_main')
+ } );
-
+ $custnum = $cust_main->custnum;
-<% if ( defined $cust_main->dbdef_table->column('ship_last') ) { %>
+ die "access denied"
+ unless $curuser->access_right($custnum ? 'Edit customer' : 'New customer');
-
-<%
- my $checked = '';
- my $disabled = '';
- my $disabledselect = '';
- unless ( $cust_main->ship_last && $same ne 'Y' ) {
- $checked = 'CHECKED';
- $disabled = 'DISABLED style="background-color: #dddddd"';
- foreach (
- qw( last first company address1 address2 city county state zip country
- daytime night fax )
- ) {
- $cust_main->set("ship_$_", $cust_main->get($_) );
- }
- }
-%>
-
-
-Service address
-(>same as billing address)
-<%= include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %>
-
-<% } %>
-
-
-
-<%= include( 'cust_main/billing.html', $cust_main,
- 'invoicing_list' => \@invoicing_list,
- )
-%>
+ #svc_phone
+ $svc_phone{$_} = $cgi->param($_)
+ foreach qw( countrycode phonenum sip_password pin phone_name );
-
+ die "access denied"
+ unless $curuser->access_right('New customer');
-