[freeside-commits] freeside/FS/FS cust_main.pm, 1.271.2.26, 1.271.2.27
Ivan,,,
ivan at wavetail.420.am
Fri Nov 9 09:42:14 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv21026
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_main.pm
Log Message:
mysql fix for regexen, 1.7-style
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.271.2.26
retrieving revision 1.271.2.27
diff -u -d -r1.271.2.26 -r1.271.2.27
--- cust_main.pm 9 Nov 2007 00:44:47 -0000 1.271.2.26
+++ cust_main.pm 9 Nov 2007 17:42:11 -0000 1.271.2.27
@@ -22,7 +22,7 @@
use Business::CreditCard 0.28;
use Locale::Country;
use Data::Dumper;
-use FS::UID qw( getotaker dbh );
+use FS::UID qw( getotaker dbh driver_name );
use FS::Record qw( qsearchs qsearch dbdef );
use FS::Misc qw( send_email generate_ps do_print );
use FS::Msgcat qw(gettext);
@@ -5268,11 +5268,20 @@
sub _agent_plandata {
my( $self, $option ) = @_;
+ my $regexp = '';
+ if ( driver_name =~ /^Pg/i ) {
+ $regexp = '~';
+ } elsif ( driver_name =~ /^mysql/i ) {
+ $regexp = 'REGEXP';
+ } else {
+ die "don't know how to use regular expressions in ". driver_name. " databases";
+ }
+
my $part_bill_event = qsearchs( 'part_bill_event',
{
'payby' => $self->payby,
'plan' => 'send_agent',
- 'plandata' => { 'op' => '~',
+ 'plandata' => { 'op' => $regexp,
'value' => "(^|\n)agentnum ".
'([0-9]*, )*'.
$self->agentnum.
More information about the freeside-commits
mailing list