[freeside-commits] branch master updated. 2e4fa975e054554beac71883436b143267d7aa12

Ivan ivan at 420.am
Wed Jan 28 02:26:58 PST 2015


The branch, master has been updated
       via  2e4fa975e054554beac71883436b143267d7aa12 (commit)
       via  f4b7701c4c1e574ebe29e05db694d131d2799b35 (commit)
       via  a2faeced765b00c0339fd86d7905cb77318e3d20 (commit)
       via  0928a6aa2ef66fedcdc0429c6450e26a3df5f444 (commit)
      from  e43f8075d053e3f1d969d8f762ab510a2de126de (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 2e4fa975e054554beac71883436b143267d7aa12
Merge: f4b7701 e43f807
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jan 28 02:26:52 2015 -0800

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


e43f8075d053e3f1d969d8f762ab510a2de126de
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 00cea1a..9669ac2 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1172,6 +1172,12 @@ sub print_generic {
            join(', ', map "$_=>".$line_item->{$_}, keys %$line_item). "\n"
         if $DEBUG > 1;
 
+      push @buf, ( [ $line_item->{'description'},
+                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
+                   ],
+                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
+                 );
+
       $line_item->{'ref'} = $line_item->{'pkgnum'};
       $line_item->{'product_code'} = $line_item->{'pkgpart'} || 'N/A'; # mt()?
       $line_item->{'section'} = $section;
@@ -1184,11 +1190,6 @@ sub print_generic {
       $line_item->{'ext_description'} ||= [];
  
       push @detail_items, $line_item;
-      push @buf, ( [ $line_item->{'description'},
-                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
-                   ],
-                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
-                 );
     }
 
     if ( $section->{'description'} ) {

commit f4b7701c4c1e574ebe29e05db694d131d2799b35
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jan 28 02:26:47 2015 -0800

    optimize cust_pay__otaker_ivan upgrade fix (pretty obsolete at this point?)

diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 87fad02..df567a5 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -942,10 +942,11 @@ sub _upgrade_data {  #class method
 
     #not the most efficient, but hey, it only has to run once
 
-    my $where = "WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) ".
-                "  AND usernum IS NULL ".
-                "  AND 0 < ( SELECT COUNT(*) FROM cust_main                 ".
-                "              WHERE cust_main.custnum = cust_pay.custnum ) ";
+    my $where = " WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' )
+                    AND usernum IS NULL
+                    AND EXISTS ( SELECT 1 FROM cust_main                    
+                                   WHERE cust_main.custnum = cust_pay.custnum )
+                ";
 
     my $count_sql = "SELECT COUNT(*) FROM cust_pay $where";
 

e43f8075d053e3f1d969d8f762ab510a2de126de
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 00cea1a..9669ac2 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1172,6 +1172,12 @@ sub print_generic {
            join(', ', map "$_=>".$line_item->{$_}, keys %$line_item). "\n"
         if $DEBUG > 1;
 
+      push @buf, ( [ $line_item->{'description'},
+                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
+                   ],
+                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
+                 );
+
       $line_item->{'ref'} = $line_item->{'pkgnum'};
       $line_item->{'product_code'} = $line_item->{'pkgpart'} || 'N/A'; # mt()?
       $line_item->{'section'} = $section;
@@ -1184,11 +1190,6 @@ sub print_generic {
       $line_item->{'ext_description'} ||= [];
  
       push @detail_items, $line_item;
-      push @buf, ( [ $line_item->{'description'},
-                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
-                   ],
-                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
-                 );
     }
 
     if ( $section->{'description'} ) {

commit a2faeced765b00c0339fd86d7905cb77318e3d20
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jan 28 02:24:07 2015 -0800

    sticky customer notes, RT#29311

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index ca6d169..b7611c1 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2013,13 +2013,14 @@ sub tables_hashref {
 
     'cust_main_note' => {
       'columns' => [
-        'notenum',  'serial',  '',     '', '', '', 
-        'custnum',  'int',  '',     '', '', '', 
-        'classnum',      'int',     'NULL', '', '', '', 
-        '_date',    @date_type, '', '', 
-        'otaker',   'varchar', 'NULL',    32, '', '', 
-        'usernum',   'int', 'NULL', '', '', '',
-        'comments', 'text', 'NULL', '', '', '', 
+        'notenum',   'serial',    '',  '', '', '', 
+        'custnum',      'int',    '',  '', '', '', 
+        'classnum',     'int', 'NULL', '', '', '', 
+        '_date',          @date_type,      '', '', 
+        'otaker',   'varchar', 'NULL', 32, '', '', 
+        'usernum',      'int', 'NULL', '', '', '',
+        'comments',    'text', 'NULL', '', '', '', 
+        'sticky',       'int',     '', '',  0, '',
       ],
       'primary_key'  => 'notenum',
       'unique'       => [],
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 9f95620..30dbc04 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2139,8 +2139,8 @@ Returns all notes (see L<FS::cust_main_note>) for this customer.
 
 sub notes {
   my($self,$orderby_classnum) = (shift,shift);
-  my $orderby = "_DATE DESC";
-  $orderby = "CLASSNUM ASC, $orderby" if $orderby_classnum;
+  my $orderby = "sticky DESC, _date DESC";
+  $orderby = "classnum ASC, $orderby" if $orderby_classnum;
   qsearch( 'cust_main_note',
            { 'custnum' => $self->custnum },
            '',
diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm
index 7125807..ee63883 100644
--- a/FS/FS/cust_main_note.pm
+++ b/FS/FS/cust_main_note.pm
@@ -112,6 +112,7 @@ sub check {
     || $self->ut_numbern('_date')
     || $self->ut_textn('otaker')
     || $self->ut_anything('comments')
+    || $self->ut_numbern('sticky')
   ;
   return $error if $error;
 
diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi
index 6159056..a089db2 100755
--- a/httemplate/edit/cust_main_note.cgi
+++ b/httemplate/edit/cust_main_note.cgi
@@ -18,17 +18,24 @@
     <BR>
 % }
 
-% if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) {
-  <TEXTAREA NAME="comment_plain" ROWS="12" COLS="60"><% 
-  join '', split /<br \/>| /, $comment 
-  %></TEXTAREA>
-% }
-% else {
-<% include('/elements/htmlarea.html', 'field' => 'comment_html',
-                                      'curr_value' => $comment) %>
+% if ( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) {
+    <TEXTAREA NAME="comment_plain" ROWS="12" COLS="60"><% 
+    join '', split /<br \/>| /, $comment 
+    %></TEXTAREA>
+% } else {
+    <& /elements/htmlarea.html, 'field'      => 'comment_html',
+                                'curr_value' => $comment
+    &>
 % }
 
-<BR><BR>
+<BR>
+
+<& /elements/checkbox.html, 'field'      => 'sticky',
+                            'value'      => 1,
+                            'curr_value' => $sticky,
+&>
+Sticky note<BR><BR>
+
 <INPUT TYPE="submit" VALUE="<% $notenum ? emt("Apply changes") : emt("Add Note") %>">
 
 </FORM>
@@ -42,6 +49,7 @@ my $conf = new FS::Conf;
 my $comment;
 my $notenum = '';
 my $classnum;
+my $sticky = 0;
 if ( $cgi->param('error') ) {
   $comment     = $cgi->param('comment');
   $classnum = $cgi->param('classnum');
@@ -52,6 +60,7 @@ if ( $cgi->param('error') ) {
   die "no such note: ". $notenum unless $note;
   $comment = $note->comments;
   $classnum = $note->classnum;
+  $sticky = $note->sticky;
 }
 
 $comment =~ s/\r//g; # remove weird line breaks to protect FCKeditor
diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi
index 227297e..53e616a 100755
--- a/httemplate/edit/process/cust_main_note.cgi
+++ b/httemplate/edit/process/cust_main_note.cgi
@@ -33,6 +33,7 @@ my $new = new FS::cust_main_note ( {
   _date    => time,
   usernum  => $FS::CurrentUser::CurrentUser->usernum,
   comments => $comment,
+  sticky   => scalar( $cgi->param('sticky') ),
 } );
 
 my $error;
diff --git a/httemplate/view/cust_main/notes/notes.html b/httemplate/view/cust_main/notes/notes.html
index 6a7a06a..fa45a68 100644
--- a/httemplate/view/cust_main/notes/notes.html
+++ b/httemplate/view/cust_main/notes/notes.html
@@ -34,6 +34,10 @@
 
 % my $bgcolor1 = '#eeeeee';
 % my $bgcolor2 = '#ffffff';
+% my %sticky_color = ( '#eeeeee' => '#ffff66',
+%                      '#ffffff' => '#ffffb8',
+%                    );
+%
 % my $bgcolor = '';
 % my $last_classnum = -1;
 % my $skipheader = 0;
@@ -56,7 +60,7 @@
 %                                             ";notenum=$notenum",
 %                            'actionlabel' => emt('Edit customer note'),
 %                            'width'       => 616,
-%                            'height'      => 538, #575
+%                            'height'      => 575,
 %                            'frame'       => 'top',
 %                        );
 %   my $clickjs = qq!onclick="$onclick"!;
@@ -103,21 +107,23 @@
 % $last_classnum = $note->classnum;
 % }
 
+% my $color = $note->sticky ? $sticky_color{$bgcolor} : $bgcolor;
+
     <TR>
-      <% note_datestr($note,$conf,$bgcolor) %>
-      <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+      <% note_datestr($note,$conf,$color) %>
+      <TD CLASS="grid" BGCOLOR="<% $color %>">
          <% $note->usernum ? $note->access_user->name : $note->otaker %>
       </TD>
 % if ($conf->exists('note-classes') && $conf->config('note-classes') == 1) {
-      <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+      <TD CLASS="grid" BGCOLOR="<% $color %>">
 	<% $note->classname %>   
       </TD>
 % }
-      <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+      <TD CLASS="grid" BGCOLOR="<% $color %>">
         <% $note->comments | defang %>
       </TD>
 % if($edit) {
-      <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD>
+      <TD CLASS="grid" BGCOLOR="<% $color %>"><% $edit %></TD>
 % }
     </TR>
 

e43f8075d053e3f1d969d8f762ab510a2de126de
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 00cea1a..9669ac2 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1172,6 +1172,12 @@ sub print_generic {
            join(', ', map "$_=>".$line_item->{$_}, keys %$line_item). "\n"
         if $DEBUG > 1;
 
+      push @buf, ( [ $line_item->{'description'},
+                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
+                   ],
+                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
+                 );
+
       $line_item->{'ref'} = $line_item->{'pkgnum'};
       $line_item->{'product_code'} = $line_item->{'pkgpart'} || 'N/A'; # mt()?
       $line_item->{'section'} = $section;
@@ -1184,11 +1190,6 @@ sub print_generic {
       $line_item->{'ext_description'} ||= [];
  
       push @detail_items, $line_item;
-      push @buf, ( [ $line_item->{'description'},
-                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
-                   ],
-                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
-                 );
     }
 
     if ( $section->{'description'} ) {

commit 0928a6aa2ef66fedcdc0429c6450e26a3df5f444
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jan 27 12:10:59 2015 -0800

    log_sent_mail description

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 39f12c2..f9a1696 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -773,7 +773,7 @@ sub reason_type_options {
   {
     'key'         => 'log_sent_mail',
     'section'     => 'notification',
-    'description' => 'Enable logging of template-generated email.',
+    'description' => 'Enable logging of all sent email.',
     'type'        => 'checkbox',
   },
 

e43f8075d053e3f1d969d8f762ab510a2de126de
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 00cea1a..9669ac2 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1172,6 +1172,12 @@ sub print_generic {
            join(', ', map "$_=>".$line_item->{$_}, keys %$line_item). "\n"
         if $DEBUG > 1;
 
+      push @buf, ( [ $line_item->{'description'},
+                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
+                   ],
+                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
+                 );
+
       $line_item->{'ref'} = $line_item->{'pkgnum'};
       $line_item->{'product_code'} = $line_item->{'pkgpart'} || 'N/A'; # mt()?
       $line_item->{'section'} = $section;
@@ -1184,11 +1190,6 @@ sub print_generic {
       $line_item->{'ext_description'} ||= [];
  
       push @detail_items, $line_item;
-      push @buf, ( [ $line_item->{'description'},
-                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
-                   ],
-                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
-                 );
     }
 
     if ( $section->{'description'} ) {

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

Summary of changes:
 FS/FS/Conf.pm                              |    2 +-
 FS/FS/Schema.pm                            |   15 ++++++++-------
 FS/FS/cust_main.pm                         |    4 ++--
 FS/FS/cust_main_note.pm                    |    1 +
 FS/FS/cust_pay.pm                          |    9 +++++----
 httemplate/edit/cust_main_note.cgi         |   27 ++++++++++++++++++---------
 httemplate/edit/process/cust_main_note.cgi |    1 +
 httemplate/view/cust_main/notes/notes.html |   18 ++++++++++++------
 8 files changed, 48 insertions(+), 29 deletions(-)




More information about the freeside-commits mailing list