[otrs-cvs] ITSMLocation/Kernel/System ITSMLocation.pm,1.17,1.18

CVS commits notifications of OTRS.org cvs-log at otrs.org
Sat May 3 14:18:45 GMT 2008


Comments:
Update of /home/cvs/ITSMLocation/Kernel/System
In directory lancelot:/tmp/cvs-serv28228/Kernel/System

Modified Files:
	ITSMLocation.pm 
Log Message:
Fixed bug# 2875 - Case sensitive CI search not possible.

Author: mh

Index: ITSMLocation.pm
===================================================================
RCS file: /home/cvs/ITSMLocation/Kernel/System/ITSMLocation.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ITSMLocation.pm	4 Apr 2008 10:24:08 -0000	1.17
--- ITSMLocation.pm	3 May 2008 14:18:40 -0000	1.18
***************
*** 684,704 ****
          $SQL .= "AND valid_id IN ($ValidIDString) ";
      }
!     if ( $Param{Name} ) {
!         $SQL .= "AND name LIKE '$Param{Name}' ";
!     }
!     if ( $Param{Phone1} ) {
!         $SQL .= "AND phone1 LIKE '$Param{Phone1}' ";
!     }
!     if ( $Param{Phone2} ) {
!         $SQL .= "AND phone2 LIKE '$Param{Phone2}' ";
!     }
!     if ( $Param{Fax} ) {
!         $SQL .= "AND fax LIKE '$Param{Fax}' ";
!     }
!     if ( $Param{Email} ) {
!         $SQL .= "AND email LIKE '$Param{Email}' ";
!     }
!     if ( $Param{Address} ) {
!         $SQL .= "AND address LIKE '$Param{Address}' ";
      }
  
--- 684,708 ----
          $SQL .= "AND valid_id IN ($ValidIDString) ";
      }
! 
!     # define the element hash
!     my %Elements = (
!         Name    => 'name',
!         Phone1  => 'phone1',
!         Phone2  => 'phone2',
!         Fax     => 'fax',
!         Email   => 'email',
!         Address => 'address',
!     );
! 
!     # add elements to the sql string
!     ELEMENT:
!     for my $Element ( keys %Elements ) {
! 
!         next ELEMENT if !$Param{$Element};
! 
!         # prepare like string
!         $Self->_PrepareLikeString( \$Param{$Element} );
! 
!         $SQL .= "AND LOWER($Elements{$Element}) LIKE LOWER('$Param{$Element}') ";
      }
  
***************
*** 774,777 ****
--- 778,806 ----
  }
  
+ =item _PrepareLikeString()
+ 
+ internal function to prepare like strings
+ 
+     $ConfigItemObject->_PrepareLikeString( $StringRef );
+ 
+ =cut
+ 
+ sub _PrepareLikeString {
+     my ( $Self, $Value ) = @_;
+ 
+     return if !$Value;
+     return if ref $Value ne 'SCALAR';
+ 
+     # replace * with %
+     ${$Value} =~ s{ \*+ }{%}xmsg;
+ 
+     # Hotfix for MSSQL bug# 2227
+     return if $Self->{DBObject}->GetDatabaseFunction('Type') ne 'mssql';
+ 
+     ${$Value} =~ s{ \[ }{[[]}xmsg;
+ 
+     return;
+ }
+ 
  1;
  


More information about the cvs-log mailing list