[freeside-commits] branch FREESIDE_3_BRANCH updated. 715120170b58861d2957266a2802df2e412979c8

Mark Wells mark at 420.am
Sat Dec 6 09:51:05 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  715120170b58861d2957266a2802df2e412979c8 (commit)
       via  56efb22e0fe7adb1aebad517c6975edbf6e1c921 (commit)
      from  56d10a0d13cc291eb5ee6197c35b10407794f89c (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 715120170b58861d2957266a2802df2e412979c8
Author: Mark Wells <mark at freeside.biz>
Date:   Sat Dec 6 09:50:32 2014 -0800

    slightly more cautious fix for sorting the reason selector, #31702

diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html
index 5f36a36..3f6c880 100644
--- a/httemplate/elements/select-table.html
+++ b/httemplate/elements/select-table.html
@@ -9,6 +9,7 @@ Example:
     ##
     'table'          => 'table_name',
     'name_col'       => 'name_column', #or method if you pass an order_by
+                                       # order_by is currently broken, though
    
     #strongly recommended (you want your forms to be "sticky" on errors, right?)
     'curr_value'     => 'current_value',
@@ -89,14 +90,13 @@ Example:
     <OPTION VALUE=""><% $opt{'empty_label'} || 'all' %>
 % }
 
-%# foreach my $record ( sort {    $a->$name_col() cmp $b->$name_col()
-%#                             || $a->$key()      <=> $b->$key()
-%#                           }
-%#                           @records
-%#                    )
-%# {
-% # show records in query order, or preserve the order they were given
-% foreach my $record (@records) {
+% # XXX fix this eventually, when we have time to test it
+% foreach my $record ( sort {    $a->$name_col() cmp $b->$name_col()
+%                             || $a->$key()      <=> $b->$key()
+%                           }
+%                           @records
+%                    )
+% {
 %   my $recvalue = $record->$key();
 %   my $selected;
 %   if ( $opt{'all_selected'} ) {
diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html
index 2dce9ef..52dc956 100755
--- a/httemplate/elements/tr-select-reason.html
+++ b/httemplate/elements/tr-select-reason.html
@@ -70,8 +70,7 @@ Example:
   'id'              => $id,
   'table'           => 'reason',
   'records'         => \@reasons,
-  'label_callback'  => sub { my $reason = shift;
-                             $reason->type . ' : ' .  $reason->reason },
+  'name_col'        => 'label',
   'disable_empty'   => 1,
   'pre_options'     => [ 0 => 'Select reason...' ],
   'post_options'    => \@post_options,
@@ -177,11 +176,11 @@ if ($class eq 'C') {
 
 my @reasons = qsearch({
   'table'           => 'reason',
+  'select'          => "reason.*, (type || ' : ' || reason) AS label",
   'addl_from'       => ' LEFT JOIN reason_type'.
                        ' ON (reason.reason_type = reason_type.typenum)',
   'hashref'         => { disabled => '' },
   'extra_sql'       => " AND reason_type.class = '$class'",
-  'order_by'        => ' ORDER BY type, reason',
 });
 
 my %all_hints;

commit 56efb22e0fe7adb1aebad517c6975edbf6e1c921
Author: Mark Wells <mark at freeside.biz>
Date:   Sat Dec 6 09:48:09 2014 -0800

    fix stupid compile error

diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index 72cd856..23dbce9 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -267,10 +267,6 @@ sub replace {
   my $old = shift;
   $old ||= $self->replace_old;
   # the following fields are immutable
-  if ($self->get('unlock')) {
-    # well, mostly immutable
-    warn "WARNING: locationnum ".$old->locationnum." MODIFIED IN PLACE\n";
-  } else {
   foreach (qw(address1 address2 city state zip country)) {
     if ( $self->$_ ne $old->$_ ) {
       return "can't change cust_location field $_";

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

Summary of changes:
 FS/FS/cust_location.pm                    |    4 ----
 httemplate/elements/select-table.html     |   16 ++++++++--------
 httemplate/elements/tr-select-reason.html |    5 ++---
 3 files changed, 10 insertions(+), 15 deletions(-)




More information about the freeside-commits mailing list