View | Details | Raw Unified | Return to bug 15252
Collapse All | Expand All

(-)a/C4/Utils/DataTables/Members.pm (-6 / +4 lines)
Lines 13-19 sub search { Link Here
13
    my $firstletter = $params->{firstletter};
13
    my $firstletter = $params->{firstletter};
14
    my $categorycode = $params->{categorycode};
14
    my $categorycode = $params->{categorycode};
15
    my $branchcode = $params->{branchcode};
15
    my $branchcode = $params->{branchcode};
16
    my $searchtype = $params->{searchtype};
16
    my $searchtype = $params->{searchtype} || 'start_with';
17
    my $searchfieldstype = $params->{searchfieldstype} || 'standard';
17
    my $searchfieldstype = $params->{searchfieldstype} || 'standard';
18
    my $dt_params = $params->{dt_params};
18
    my $dt_params = $params->{dt_params};
19
19
Lines 88-95 sub search { Link Here
88
        $term .= '%' # end with anything
88
        $term .= '%' # end with anything
89
            if $term !~ /%$/;
89
            if $term !~ /%$/;
90
        $term = "%$term" # begin with anythin unless start_with
90
        $term = "%$term" # begin with anythin unless start_with
91
            if (defined $searchtype) && $searchtype eq "contain"
91
            if $searchtype eq 'contain' && $term !~ /^%/;
92
                && $term !~ /^%/;
93
92
94
        my @where_strs_or;
93
        my @where_strs_or;
95
        for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) {
94
        for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) {
Lines 208-218 $params is a hashref with some keys: Link Here
208
207
209
=item searchtype
208
=item searchtype
210
209
211
  Can be 'contain' or 'start_with'. Used for the searchmember parameter.
210
  Can be 'contain' or 'start_with' (default value). Used for the searchmember parameter.
212
211
213
=item searchfieldstype
212
=item searchfieldstype
214
213
215
  Can be 'standard', 'email', 'borrowernumber', 'phone', 'address' or 'dateofbirth', 'sort1', 'sort2'
214
  Can be 'standard' (default value), 'email', 'borrowernumber', 'phone', 'address' or 'dateofbirth', 'sort1', 'sort2'
216
215
217
=item dt_params
216
=item dt_params
218
217
219
- 

Return to bug 15252