[freeside-commits] branch FREESIDE_3_BRANCH updated. 458aa5523d0bf2ed829b42295ab482768fbae64e

Ivan ivan at 420.am
Thu Sep 11 15:57:17 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  458aa5523d0bf2ed829b42295ab482768fbae64e (commit)
       via  6039166baf177b99594832363a955d6d70b4037a (commit)
      from  ab6e4f9b42a6e7fe2031ad5f2443ef6a3584be1e (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 458aa5523d0bf2ed829b42295ab482768fbae64e
Author: David Houghton <houghton at freeside.biz>
Date:   Wed Sep 10 16:54:37 2014 -0400

    ticket: 27309; use dbh->quote
    
    Sorry, I shouldn't have missed this. I've gotten used to using either
    DBIx::Class to construct queries for me or using whole prepared statements,
    which handle the quoting automagically.  I've gotten out of practice with
    SQL created piecemeal.

diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html
index 10b3863..778799b 100644
--- a/httemplate/search/cdr.html
+++ b/httemplate/search/cdr.html
@@ -264,11 +264,9 @@ if ( $cgi->param('acctid') =~ /\d/ ) {
 if ( $cgi->param('accountcode') =~ /\S/ ) {
   my $accountcode = $cgi->param('accountcode');
   my @accountcode = map {
-    ( my $v = $_ ) =~ s/^\s+|\s+$//g;
-    if ( $v =~ /'/ ) { $v =~ s/'/\\'/g; $v = "E'$v'" }
-    elsif ( length $v ) { $v = "'$v'" }
-    length $v ? $v : ()
-  } grep /\S/, split /\R/, $accountcode;
+    ( my $v = $_ ) =~ s/^\s+|\s+$//g;    # trim margin whitespace
+    length $v ? dbh->quote($v) : ()
+  } grep /\S/, split /\R/, $accountcode;    # collect non-trivial lines
   if (@accountcode) {
     my $search = 'accountcode IN ( ' . join( ',', @accountcode ) . ' )';
     push @qsearch, $search;

commit 6039166baf177b99594832363a955d6d70b4037a
Author: David Houghton <houghton at freeside.biz>
Date:   Wed Sep 10 12:09:40 2014 -0400

    ticket: 27309; add accountcode
    
    I tested this as best I could. I worked with my fake data. I accounted
    for ' and blank lines, assuming terminal whitespace was irrelevant.

diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html
index ca303d3..10b3863 100644
--- a/httemplate/search/cdr.html
+++ b/httemplate/search/cdr.html
@@ -258,6 +258,25 @@ if ( $cgi->param('acctid') =~ /\d/ ) {
 }
 
 ###
+# accountcode
+###
+
+if ( $cgi->param('accountcode') =~ /\S/ ) {
+  my $accountcode = $cgi->param('accountcode');
+  my @accountcode = map {
+    ( my $v = $_ ) =~ s/^\s+|\s+$//g;
+    if ( $v =~ /'/ ) { $v =~ s/'/\\'/g; $v = "E'$v'" }
+    elsif ( length $v ) { $v = "'$v'" }
+    length $v ? $v : ()
+  } grep /\S/, split /\R/, $accountcode;
+  if (@accountcode) {
+    my $search = 'accountcode IN ( ' . join( ',', @accountcode ) . ' )';
+    push @qsearch, $search;
+    push @search,  $search;
+  }
+}
+
+###
 # finish it up
 ###
 
diff --git a/httemplate/search/report_cdr.html b/httemplate/search/report_cdr.html
index 0e1693b..fe840ea 100644
--- a/httemplate/search/report_cdr.html
+++ b/httemplate/search/report_cdr.html
@@ -148,6 +148,11 @@
   </TR>
 
   <TR>
+    <TD ALIGN="right">Acct Code (one per-line):</TD>
+    <TD><TEXTAREA NAME="accountcode"></TEXTAREA></TD>
+  </TR>
+
+  <TR>
     <TH CLASS="background" COLSPAN=2> </TH>
   </TR>
 

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

Summary of changes:
 httemplate/search/cdr.html        |   17 +++++++++++++++++
 httemplate/search/report_cdr.html |    5 +++++
 2 files changed, 22 insertions(+)




More information about the freeside-commits mailing list