[freeside-commits] branch FREESIDE_3_BRANCH updated. f7c686b2da39bc975b6a197b2879aa7a6fa4fa10

Ivan ivan at 420.am
Sun Jan 18 19:46:06 PST 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  f7c686b2da39bc975b6a197b2879aa7a6fa4fa10 (commit)
      from  999c1f9c054ba51a6c5c7a3a2babe21dd17683cb (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 f7c686b2da39bc975b6a197b2879aa7a6fa4fa10
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jan 18 19:46:01 2015 -0800

    disable quotations, RT#20688, RT#22232

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 04106dc..2494241 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -97,6 +97,7 @@ tie my %rights, 'Tie::IxHash',
     #'New contact',
     #'View customer contacts',
     'Generate quotation',
+    'Disable quotation',
   ],
   
   ###
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index 8a086a7..ea3bd42 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -247,6 +247,7 @@ sub _upgrade_data { # class method
     'List prospects' => 'List contacts',
     'List customers' => 'List contacts',
     'Backdate payment' => 'Backdate credit',
+    'Generate quotation' => 'Disable quotation',
   );
 
 #  foreach my $old_acl ( keys %onetime ) {
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 8f62720..b70b82d 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -307,9 +307,11 @@ if ( $opt{'disableable'} ) {
     $opt{'query'}{'hashref'}{'disabled'} = '';
     $opt{'query'}{'extra_sql'} =~ s/^\s*WHERE/ AND/i;
 
+    my $table = $opt{'query'}{'table'};
+
     $opt{'count_query'} .=
       ( $opt{'count_query'} =~ /WHERE/i ? ' AND ' : ' WHERE ' ).
-      "( disabled = '' OR disabled IS NULL )";
+      "( $table.disabled = '' OR $table.disabled IS NULL )";
 
   } elsif (    $opt{'disabled_statuspos'}
             || $opt{'disabled_statuspos'} eq '0' ) { #add status column
@@ -360,12 +362,6 @@ unless ( $type =~ /^(csv|xml|\w*.xls)$/) {
       s/^\s*SELECT\s*(.*?)\s+FROM\s/SELECT COUNT(*) FROM /i; #silly vim:/
   }
 
-  if ( $opt{disableable} && ! $cgi->param('showdisabled') ) {
-    $opt{count_query} .=
-      ( ( $opt{count_query} =~ /WHERE/i ) ? ' AND ' : ' WHERE ' ).
-      "( disabled = '' OR disabled IS NULL )";
-  }
-
   unless ( $type eq 'html-print' ) {
 
     #setup some pagination things if we're in html mode

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

Summary of changes:
 FS/FS/AccessRight.pm                   |    1 +
 FS/FS/access_right.pm                  |    1 +
 httemplate/search/elements/search.html |   10 +++-------
 3 files changed, 5 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list