[freeside-commits] freeside/FS/FS svc_Common.pm,1.39.2.3,1.39.2.4
Ivan,,,
ivan at wavetail.420.am
Wed Jul 9 12:35:47 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15960
Modified Files:
Tag: FREESIDE_1_7_BRANCH
svc_Common.pm
Log Message:
service searching should be case-insensitive now
Index: svc_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_Common.pm,v
retrieving revision 1.39.2.3
retrieving revision 1.39.2.4
diff -u -d -r1.39.2.3 -r1.39.2.4
--- svc_Common.pm 12 Mar 2008 16:22:10 -0000 1.39.2.3
+++ svc_Common.pm 9 Jul 2008 19:35:44 -0000 1.39.2.4
@@ -40,13 +40,15 @@
Class method which returns an SQL fragment to search for STRING in FIELD.
+It is now case-insensitive by default.
+
=cut
sub search_sql_field {
my( $class, $field, $string ) = @_;
my $table = $class->table;
my $q_string = dbh->quote($string);
- "$table.$field = $q_string";
+ "lc($table.$field) = lc($q_string)";
}
#fallback for services that don't provide a search...
@@ -203,7 +205,6 @@
my $objects = $options{'child_objects'} || [];
my $depend_jobnums = $options{'depend_jobnum'} || [];
$depend_jobnums = [ $depend_jobnums ] unless ref($depend_jobnums);
- my $error;
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
@@ -216,9 +217,6 @@
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- $error = $self->check;
- return $error if $error;
-
my $svcnum = $self->svcnum;
my $cust_svc = $svcnum ? qsearchs('cust_svc',{'svcnum'=>$self->svcnum}) : '';
#unless ( $svcnum ) {
@@ -229,7 +227,7 @@
'pkgnum' => $self->pkgnum,
'svcpart' => $self->svcpart,
} );
- $error = $cust_svc->insert;
+ my $error = $cust_svc->insert;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
@@ -245,13 +243,9 @@
$self->svcpart($cust_svc->svcpart);
}
- $error = $self->set_auto_inventory;
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return $error;
- }
-
- $error = $self->SUPER::insert;
+ my $error = $self->set_auto_inventory
+ || $self->check
+ || $self->SUPER::insert;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
More information about the freeside-commits
mailing list