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 90-97 sub search { Link Here
90
        $term .= '%' # end with anything
90
        $term .= '%' # end with anything
91
            if $term !~ /%$/;
91
            if $term !~ /%$/;
92
        $term = "%$term" # begin with anythin unless start_with
92
        $term = "%$term" # begin with anythin unless start_with
93
            if (defined $searchtype) && $searchtype eq "contain"
93
            if $searchtype eq 'contain' && $term !~ /^%/;
94
                && $term !~ /^%/;
95
94
96
        my @where_strs_or;
95
        my @where_strs_or;
97
        for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) {
96
        for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) {
Lines 210-220 $params is a hashref with some keys: Link Here
210
209
211
=item searchtype
210
=item searchtype
212
211
213
  Can be 'contain' or 'start_with'. Used for the searchmember parameter.
212
  Can be 'contain' or 'start_with' (default value). Used for the searchmember parameter.
214
213
215
=item searchfieldstype
214
=item searchfieldstype
216
215
217
  Can be 'standard', 'email', 'borrowernumber', 'phone', 'address' or 'dateofbirth', 'sort1', 'sort2'
216
  Can be 'standard' (default value), 'email', 'borrowernumber', 'phone', 'address' or 'dateofbirth', 'sort1', 'sort2'
218
217
219
=item dt_params
218
=item dt_params
220
219
221
- 

Return to bug 15252