[freeside-commits] branch master updated. 4900c030d29982ae70dc69c05bb177e96b7c7c57

Ivan ivan at 420.am
Thu Nov 13 14:36:15 PST 2014


The branch, master has been updated
       via  4900c030d29982ae70dc69c05bb177e96b7c7c57 (commit)
       via  52a824f9b11ca266be10c76894eaf6607344c8d0 (commit)
       via  4af695fe8521e17dd67ba34df929f35fdad4c505 (commit)
       via  d353c1f9bbfee93e96219851af27a78f56837c50 (commit)
      from  af501d08494e5930d53da1cb1f02e65e2a6ebd07 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4900c030d29982ae70dc69c05bb177e96b7c7c57
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Nov 13 14:36:11 2014 -0800

    status labels

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index b2949a5..f446b88 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4294,10 +4294,14 @@ sub ucfirst_cust_status {
 
 =item cust_status_label
 
+=item status_label
+
 Returns the display label for this status.
 
 =cut
 
+sub status_label { shift->cust_status_label(@_); }
+
 sub cust_status_label {
   my $self = shift;
   __PACKAGE__->statuslabels->{$self->cust_status};
diff --git a/httemplate/elements/select-cust_main-status.html b/httemplate/elements/select-cust_main-status.html
index bdbaac7..4885a0e 100644
--- a/httemplate/elements/select-cust_main-status.html
+++ b/httemplate/elements/select-cust_main-status.html
@@ -11,7 +11,7 @@
             <% ref($value) && $value->{$option} || $option eq $value
                ? 'SELECTED' : ''
             %>
-    ><% $option %>
+    ><% FS::cust_main->statuslabels->{$option} %>
 
 % } 
 

commit 52a824f9b11ca266be10c76894eaf6607344c8d0
Merge: 4af695f af501d0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Nov 13 14:28:36 2014 -0800

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 4af695fe8521e17dd67ba34df929f35fdad4c505
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Nov 13 14:28:30 2014 -0800

    tyop

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 77267cf..ca6588e 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4944,7 +4944,7 @@ and customer address. Include units.',
   {
     'key'         => 'default_phone_countrycode',
     'section'     => '',
-    'description' => 'Default countrcode',
+    'description' => 'Default countrycode',
     'type'        => 'text',
   },
 

commit d353c1f9bbfee93e96219851af27a78f56837c50
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Nov 13 14:26:08 2014 -0800

    status labels

diff --git a/FS/FS/ClientAPI/Agent.pm b/FS/FS/ClientAPI/Agent.pm
index 923920d..baa05ca 100644
--- a/FS/FS/ClientAPI/Agent.pm
+++ b/FS/FS/ClientAPI/Agent.pm
@@ -140,7 +140,7 @@ sub agent_list_customers {
                          my $cust_main = $_;
                          my $hashref = $cust_main->hashref;
                          $hashref->{$_} = $cust_main->$_()
-                           foreach qw(name status statuscolor);
+                           foreach qw(name status statuscolor status_label);
                          delete $hashref->{$_} foreach qw( payinfo paycvv );
                          $hashref;
                    } @cust_main
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index bcfe35c..ec114ff 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -464,8 +464,9 @@ sub customer_info {
                     );
 
     $return{has_ship_address} = $cust_main->has_ship_address;
-    $return{status} = $cust_main->status;
+    $return{status} = $cust_main->status_label; #$cust_main->status; #better to break anyone obscurely testing for strings in self-service than to have to upgrade every front-end to get the new status to display
     $return{statuscolor} = $cust_main->statuscolor;
+    $return{status_label} = $cust_main->status_label;
 
     # compatibility: some places in selfservice use this to determine
     # if there's a ship address
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index bab7e30..99c3560 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -225,7 +225,7 @@ sub cust_header {
 
   my %header2method = (
     'Customer'                 => 'name',
-    'Cust. Status'             => 'ucfirst_cust_status',
+    'Cust. Status'             => 'cust_status_label',
     'Cust#'                    => 'custnum',
     'Name'                     => 'contact',
     'Company'                  => 'company',
diff --git a/FS/FS/UI/Web/small_custview.pm b/FS/FS/UI/Web/small_custview.pm
index 2290ba3..d7cede6 100644
--- a/FS/FS/UI/Web/small_custview.pm
+++ b/FS/FS/UI/Web/small_custview.pm
@@ -36,7 +36,7 @@ sub small_custview {
 
   $html .= 'Customer #<B>'. $cust_main->display_custnum. '</B></A>'.
     ' - <B><FONT COLOR="#'. $cust_main->statuscolor. '">'.
-    ucfirst($cust_main->status). '</FONT></B>';
+    $cust_main->status_label. '</FONT></B>';
 
   my @part_tag = $cust_main->part_tag;
   if ( @part_tag ) {
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm
index d76379f..7aa7ce3 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -236,7 +236,7 @@ sub upgrade {
   }
 
   local($FS::cust_main::ignore_expired_card) = 1;
-  local($FS::cust_main::ignore_illegal_zip) = 1;
+  #this is long-gone... would need to set an equivalent in cust_location #local($FS::cust_main::ignore_illegal_zip) = 1;
   local($FS::cust_main::ignore_banned_card) = 1;
   local($FS::cust_main::skip_fuzzyfiles) = 1;
 
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index e5982a9..b2949a5 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -17,14 +17,6 @@ use base qw( FS::cust_main::Packages
 
 require 5.006;
 use strict;
-use vars qw( $DEBUG $me $conf
-             @encrypted_fields
-             $import
-             $ignore_expired_card $ignore_banned_card $ignore_illegal_zip
-             $ignore_invalid_card
-             $skip_fuzzyfiles
-             @paytypes
-           );
 use Carp;
 use Scalar::Util qw( blessed );
 use Time::Local qw(timelocal);
@@ -86,21 +78,24 @@ use FS::cust_payby;
 # 1 is mostly method/subroutine entry and options
 # 2 traces progress of some operations
 # 3 is even more information including possibly sensitive data
-$DEBUG = 0;
-$me = '[FS::cust_main]';
+our $DEBUG = 0;
+our $me = '[FS::cust_main]';
+
+our $import = 0;
+our $ignore_expired_card = 0;
+our $ignore_banned_card = 0;
+our $ignore_invalid_card = 0;
 
-$import = 0;
-$ignore_expired_card = 0;
-$ignore_banned_card = 0;
-$ignore_invalid_card = 0;
+our $skip_fuzzyfiles = 0;
 
-$skip_fuzzyfiles = 0;
+our $ucfirst_nowarn = 0;
 
- at encrypted_fields = ('payinfo', 'paycvv');
+our @encrypted_fields = ('payinfo', 'paycvv');
 sub nohistory_fields { ('payinfo', 'paycvv'); }
 
- at paytypes = ('', 'Personal checking', 'Personal savings', 'Business checking', 'Business savings');
+our @paytypes = ('', 'Personal checking', 'Personal savings', 'Business checking', 'Business savings');
 
+our $conf;
 #ask FS::UID to run this stuff for us later
 #$FS::UID::callback{'FS::cust_main'} = sub { 
 install_callback FS::UID sub { 
@@ -4230,17 +4225,29 @@ Returns a status string for this customer, currently:
 
 =over 4
 
-=item prospect - No packages have ever been ordered
+=item prospect
+
+No packages have ever been ordered.  Displayed as "No packages".
+
+=item ordered
+
+Recurring packages all are new (not yet billed).
 
-=item ordered - Recurring packages all are new (not yet billed).
+=item active
 
-=item active - One or more recurring packages is active
+One or more recurring packages is active.
 
-=item inactive - No active recurring packages, but otherwise unsuspended/uncancelled (the inactive status is new - previously inactive customers were mis-identified as cancelled)
+=item inactive
 
-=item suspended - All non-cancelled recurring packages are suspended
+No active recurring packages, but otherwise unsuspended/uncancelled (the inactive status is new - previously inactive customers were mis-identified as cancelled).
 
-=item cancelled - All recurring packages are cancelled
+=item suspended
+
+All non-cancelled recurring packages are suspended.
+
+=item cancelled
+
+All recurring packages are cancelled.
 
 =back
 
@@ -4267,17 +4274,35 @@ sub cust_status {
 
 =item ucfirst_status
 
+Deprecated, use the cust_status_label method instead.
+
 Returns the status with the first character capitalized.
 
 =cut
 
-sub ucfirst_status { shift->ucfirst_cust_status(@_); }
+sub ucfirst_status {
+  carp "ucfirst_status deprecated, use cust_status_label" unless $ucfirst_nowarn;
+  local($ucfirst_nowarn) = 1;
+  shift->ucfirst_cust_status(@_);
+}
 
 sub ucfirst_cust_status {
+  carp "ucfirst_cust_status deprecated, use cust_status_label" unless $ucfirst_nowarn;
   my $self = shift;
   ucfirst($self->cust_status);
 }
 
+=item cust_status_label
+
+Returns the display label for this status.
+
+=cut
+
+sub cust_status_label {
+  my $self = shift;
+  __PACKAGE__->statuslabels->{$self->cust_status};
+}
+
 =item statuscolor
 
 Returns a hex triplet color string for this customer's status.
diff --git a/FS/FS/cust_main/Status.pm b/FS/FS/cust_main/Status.pm
index f84ff0f..c17bb57 100644
--- a/FS/FS/cust_main/Status.pm
+++ b/FS/FS/cust_main/Status.pm
@@ -68,6 +68,21 @@ sub statuscolors {
 
 }
 
+sub statuslabels {
+  #my $self = shift; #i guess i'm a class method
+
+  my %statuslabels = (
+      'prospect'  => 'No packages',
+      'active'    => 'Active',
+      'ordered'   => 'Ordered',
+      'inactive'  => 'Inactive',
+      'suspended' => 'Suspended',
+      'cancelled' => 'Cancelled',
+  );
+
+  \%statuslabels;
+}
+
 =item cancelled_sql
 
 =cut
diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm
index 4b151e7..ded6cc6 100644
--- a/FS/FS/cust_main_Mixin.pm
+++ b/FS/FS/cust_main_Mixin.pm
@@ -235,12 +235,25 @@ linked to a customer.
 =cut
 
 sub ucfirst_cust_status {
+  carp "ucfirst_cust_status deprecated, use cust_status_label";
   my $self = shift;
   $self->cust_linked
     ? ucfirst( $self->cust_status(@_) ) 
     : $self->cust_unlinked_msg;
 }
 
+=item cust_status_label
+
+=cut
+
+sub cust_status_label {
+  my $self = shift;
+
+  $self->cust_linked
+    ? FS::cust_main::cust_status_label($self)
+    : $self->cust_unlinked_msg;
+}
+
 =item cust_statuscolor
 
 Given an object that contains fields from cust_main (say, from a JOINed
diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm
index 2fc66b4..08f0ada 100644
--- a/FS/FS/msg_template.pm
+++ b/FS/FS/msg_template.pm
@@ -528,7 +528,7 @@ sub substitutions {
       balance
       credit_limit
       invoicing_list_emailonly
-      cust_status ucfirst_cust_status cust_statuscolor
+      cust_status ucfirst_cust_status cust_statuscolor cust_status_label
 
       signupdate dundate
       packages recurdates
diff --git a/fs_selfservice/FS-SelfService/cgi/list_customers.html b/fs_selfservice/FS-SelfService/cgi/list_customers.html
index 9746347..b302624 100644
--- a/fs_selfservice/FS-SelfService/cgi/list_customers.html
+++ b/fs_selfservice/FS-SelfService/cgi/list_customers.html
@@ -20,7 +20,7 @@
       $OUT .=
         '<TR>'.
         "$td<FONT COLOR=\"". $customer->{'statuscolor'}. '">'.
-          ucfirst($customer->{'status'}). "</TD>". "$td</TD>".
+          $customer->{'status_label'}. "</TD>". "$td</TD>".
         "$td$a". $customer->{'name'}. "</A></TD>".
         '</TR>';
         #"$td</TD>".
diff --git a/fs_selfservice/FS-SelfService/cgi/small_custview.html b/fs_selfservice/FS-SelfService/cgi/small_custview.html
index 308eae9..919df56 100644
--- a/fs_selfservice/FS-SelfService/cgi/small_custview.html
+++ b/fs_selfservice/FS-SelfService/cgi/small_custview.html
@@ -1,7 +1,7 @@
 <DIV ID="fs_small_custview">
   
 Customer #<B><%= $display_custnum %></B>
- - <B><FONT COLOR="#<%= $statuscolor %>"><%= ucfirst($status)%></FONT></B>
+ - <B><FONT COLOR="#<%= $statuscolor %>"><%= $status_label %></FONT></B>
 
 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="<%= $box_bgcolor ||= '#c0c0c0' %>">
   <TR>
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index ae5085e..353ae17 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -17,7 +17,7 @@
 % if ( $custnum ) { 
   <% mt('Customer #') |h %><B><% $cust_main->display_custnum %></B> - 
   <B><FONT COLOR="#<% $cust_main->statuscolor %>">
-    <% ucfirst($cust_main->status) %>
+    <% $cust_main->status_label %>
   </FONT></B>
   <BR><BR>
 % } 
diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html
index 6c9d2f4..aac4cd4 100644
--- a/httemplate/edit/msg_template.html
+++ b/httemplate/edit/msg_template.html
@@ -203,9 +203,9 @@ my %substitutions = (
     '$balance'        => 'Current balance',
     '$credit_limit'   => 'Credit limit',
     '$invoicing_list_emailonly' => 'Billing email address',
-    '$cust_status'    => 'Status',
-    '$ucfirst_cust_status'  => 'Status, capitalized',
-    '$cust_statuscolor'     => 'Status color code',
+    #'$cust_status'    => 'Status (raw internal label)',
+    '$cust_status_label' => 'Status (display label)',
+    '$cust_statuscolor'  => 'Status color code',
     '$company_name'   => 'Our company name',
     '$company_address'=> 'Our company address',
     '$company_phonenum' => 'Our phone number',
diff --git a/httemplate/misc/xmlhttp-cust_main-duplicates.html b/httemplate/misc/xmlhttp-cust_main-duplicates.html
index 7cd4633..eac396d 100644
--- a/httemplate/misc/xmlhttp-cust_main-duplicates.html
+++ b/httemplate/misc/xmlhttp-cust_main-duplicates.html
@@ -8,7 +8,7 @@ Choose an existing customer
 <TR>
   <TD ALIGN="right" VALIGN="top"><B><% $custnum %>: </B></TD>
   <TD ALIGN="left">
-    <% $_->name |h %>—<B><FONT COLOR="#<%$_->statuscolor%>"><%$_->ucfirst_cust_status%></FONT></B><BR>
+    <% $_->name |h %>—<B><FONT COLOR="#<%$_->statuscolor%>"><%$_->cust_status_label%></FONT></B><BR>
 <% $_->address1 |h %><BR>
 <% $_->city |h %>, <% $_->state %>  <% $_->zip %>
   </TD>
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi
index b3bf468..f40df56 100644
--- a/httemplate/misc/xmlhttp-cust_main-search.cgi
+++ b/httemplate/misc/xmlhttp-cust_main-search.cgi
@@ -15,7 +15,7 @@
 %   my $return = [ map [ $_->custnum,
 %                        $_->name,
 %                        $_->balance,
-%                        $_->ucfirst_status,
+%                        $_->status_label,
 %                        $_->statuscolor,
 %                        scalar($_->open_cust_bill),
 %                        $_->display_custnum,
@@ -65,7 +65,7 @@ sub findbycustnum {
   [ $c->custnum,
     $c->name,
     $c->balance,
-    $c->ucfirst_status,
+    $c->status_label,
     $c->statuscolor,
     scalar($c->open_cust_bill),
     $c->display_custnum,
@@ -93,7 +93,7 @@ sub findbycustnum_or_agent_custid {
   [ map [ $_->custnum,
           $_->name,
           $_->balance,
-          $_->ucfirst_status,
+          $_->status_label,
           $_->statuscolor,
           scalar($_->open_cust_bill),
           $_->display_custnum,
diff --git a/httemplate/search/cust_bill_pkg_referral.html b/httemplate/search/cust_bill_pkg_referral.html
index f8e2ea7..1bc3b10 100644
--- a/httemplate/search/cust_bill_pkg_referral.html
+++ b/httemplate/search/cust_bill_pkg_referral.html
@@ -100,7 +100,7 @@
   'color' => [ ('') x (5 + $x),
                 sub {
                   my $cust_pkg = shift->cust_pkg;
-                  $cust_pkg ? ucfirst($cust_pkg->statuscolor) : '';
+                  $cust_pkg ? $cust_pkg->statuscolor : '';
                 },
                ('') x 6,
              ],
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 0b0dd4f..f48ea3f 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -150,15 +150,15 @@
 %      ? qq!<A HREF="$view"><FONT SIZE=-1>!. encode_entities($company). '</FONT></A>'
 %      : '<FONT SIZE=-1> </FONT>';
 %    
-%    my $status = $cust_main->status;
-%    my $statuscol = $cust_main->statuscolor;
+%    my $status_label = $cust_main->status_label;
+%    my $statuscolor = $cust_main->statuscolor;
 
     <TR>
       <TD CLASS="grid" ALIGN="right" BGCOLOR="<% $bgcolor %>" ROWSPAN=<% $rowspan %>>
         <A HREF="<% $view %>"><FONT SIZE=-1><% $cust_main->display_custnum %></FONT></A>
       </TD>
       <TD CLASS="grid" ALIGN="center" BGCOLOR="<% $bgcolor %>" ROWSPAN=<% $rowspan %>>
-        <FONT SIZE="-1" COLOR="#<% $statuscol %>"><B><% ucfirst($status) %></B></FONT>
+        <FONT SIZE="-1" COLOR="#<% $statuscolor %>"><B><% $status_label %></B></FONT>
       </TD>
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ROWSPAN=<% $rowspan %>>
         <A HREF="<% $view %>"><FONT SIZE=-1><% "$last, $first" |h %></FONT></A>
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
index 0d011f6..15def32 100644
--- a/httemplate/view/cust_main/misc.html
+++ b/httemplate/view/cust_main/misc.html
@@ -7,7 +7,7 @@
 
 <TR>
   <TD ALIGN="right"><% mt('Status') |h %></TD>
-  <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% ucfirst($cust_main->status) %></B></FONT></TD>
+  <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% $cust_main->status_label %></B></FONT></TD>
 </TR>
 
 % my @part_tag = $cust_main->part_tag;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/Agent.pm                           |    2 +-
 FS/FS/ClientAPI/MyAccount.pm                       |    3 +-
 FS/FS/Conf.pm                                      |    2 +-
 FS/FS/UI/Web.pm                                    |    2 +-
 FS/FS/UI/Web/small_custview.pm                     |    2 +-
 FS/FS/Upgrade.pm                                   |    2 +-
 FS/FS/cust_main.pm                                 |   77 ++++++++++++++------
 FS/FS/cust_main/Status.pm                          |   15 ++++
 FS/FS/cust_main_Mixin.pm                           |   13 ++++
 FS/FS/msg_template.pm                              |    2 +-
 .../FS-SelfService/cgi/list_customers.html         |    2 +-
 .../FS-SelfService/cgi/small_custview.html         |    2 +-
 httemplate/edit/cust_main.cgi                      |    2 +-
 httemplate/edit/msg_template.html                  |    6 +-
 httemplate/elements/select-cust_main-status.html   |    2 +-
 httemplate/misc/xmlhttp-cust_main-duplicates.html  |    2 +-
 httemplate/misc/xmlhttp-cust_main-search.cgi       |    6 +-
 httemplate/search/cust_bill_pkg_referral.html      |    2 +-
 httemplate/search/cust_main.cgi                    |    6 +-
 httemplate/view/cust_main/misc.html                |    2 +-
 20 files changed, 105 insertions(+), 47 deletions(-)




More information about the freeside-commits mailing list