X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Fcust_main.cgi;h=2e8d74625cedd795542c6e2bcf601e2b5367a5f5;hb=d2b55d07a9e6e64a38877136d7974ab93e14f1ed;hp=322f0674e933ac9962ee7ca06b2f74bae5a56aa4;hpb=8d4abaa99403699aa5b5f02e899d2ea33980f913;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 322f0674e..2e8d74625 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,869 +1,213 @@
-
-<%
-
-my $conf = new FS::Conf;
-
-my %uiview = ();
-my %uiadd = ();
-foreach my $part_svc ( qsearch('part_svc',{}) ) {
- $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
- $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
-}
-
-print header("Customer View", menubar(
- 'Main Menu' => popurl(2)
-));
-
-%>
-
-
-
-<%
-
-die "No customer specified (bad URL)!" unless $cgi->keywords;
-my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
-$query =~ /^(\d+)$/;
-my $custnum = $1;
-my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
-die "Customer not found!" unless $cust_main;
-
-print qq!Edit this customer!;
-
-%>
-
-
-
-<%
-
-print qq! | !.
- 'Cancel this customer'
- if $cust_main->ncancelled_pkgs;
-
-print qq! | !.
- 'Delete this customer'
- if $conf->exists('deletecustomers');
-
-unless ( $conf->exists('disable_customer_referrals') ) {
- print qq! | !,
- qq!Refer a new customer!;
-
- print qq! | !,
- qq!View this customer's referrals!;
-}
-
-print '
';
-
-my $signupurl = $conf->config('signupurl');
-if ( $signupurl ) {
-print "This customer's signup URL: ".
- "$signupurl?ref=$custnum
";
-}
-
-%>
-
-
-<%= &itable() %>
+<& /elements/header-cust_main.html, view=>$view, cust_main=>$cust_main &>
+
+% ###
+% # Basics
+% ###
+
+% if ( $view eq 'basics' ) {
+
+% my $br = 0;
+
+% if ( $conf->config('cust_main-external_links') ) {
+ <% $br++ ? ' | ' : '' %>
+% my @links = split(/\n/, $conf->config('cust_main-external_links'));
+% foreach my $link (@links) {
+% $link =~ /^\s*(\S+)\s+(.*?)(\s*\(([^\)]*)\))?$/ or next;
+% my($url, $label, $alt) = ($1, $2, $4);
+ <% $label |h %>
+% }
+% }
+
+% if ( $br ) {
+
+% }
+
+%my $signupurl = $conf->config('signupurl');
+%if ( $signupurl ) {
+ <% mt('This customer\'s signup URL:') |h %>
+ <% $signupurl %>?ref=<% $custnum %>
+
+% }
+
+
- <%= include('cust_main/contacts.html', $cust_main ) %>
+ <& cust_main/contacts.html, $cust_main &>
+ + <& cust_main/misc.html, $cust_main &> |
-
- <%= include('cust_main/misc.html', $cust_main ) %>
- <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
- - <%= include('cust_main/billing.html', $cust_main ) %> - <% } %> + |
+ <& cust_main/billing.html, $cust_main &>
+ + <& cust_main/cust_payby.html, $cust_main &> |
<%= encode_entities($cust_main->comments) %>+
Package | -Status | -Services | -|
---|---|---|---|
>
- <%=$pkg->{pkgnum}%>:
- <%=$pkg->{pkg}%> - <%=$pkg->{comment}%> -<% unless ($pkg->{cancel}) { %> - ( <%=pkg_change_link($pkg)%> ) - ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$custnum)%> ) -<% } %> - |
-<%
- #foreach (qw(setup last_bill next_bill susp expire cancel)) {
- # print qq! ! . pkg_datestr($pkg,$_,$conf) . qq! | \n!; - #} - print "". &itable(''); - - sub myfreq { - my $part_pkg = shift; - my $freq = $part_pkg->freq_pretty; - $freq =~ s/ / /g; - $freq; - } - - if ( $pkg->{cancel} ) { #status: cancelled - - print ' | |
Cancelled | '. - ''. pkg_datestr($pkg,'cancel',$conf). ' | ||
Never billed | |||
Setup | ". - pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". - pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Suspended | ". - pkg_datestr($pkg, 'susp',$conf). ' | ||
Suspended | '. - ''. pkg_datestr($pkg,'susp',$conf). ' | ||
Never billed | |||
Setup | ". - pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". - pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Expires | ". - pkg_datestr($pkg, 'expire',$conf). ' | ||
( '. pkg_unsuspend_link($pkg). - ' | '. pkg_cancel_link($pkg). ' ) | |||
Not yet billed ('; - unless ( $pkg->{freq} ) { - print 'one-time charge) | |||
( '. pkg_cancel_link($pkg). - ' ) | '; - } else { - print 'billed '. myfreq($pkg->{part_pkg}). ')|||
One-time charge | |||
Billed | '. - pkg_datestr($pkg,'setup',$conf). ' | ||
Active'. - ', billed '. myfreq($pkg->{part_pkg}). ' | |||
Setup | '. - pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". - pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Next bill | ". - pkg_datestr($pkg, 'next_bill',$conf). ' | ||
Expires | ". - pkg_datestr($pkg, 'expire',$conf). ' | ||
( '. pkg_suspend_link($pkg). - ' | '. pkg_cancel_link($pkg). ' ) |