Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bed19453

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID bed19453fb654f69ad972911a4533ca89f8ae0c9
  • Vorgänger d814a525
  • Nachfolger 9ebaa094

Funktion »like« von Form nach DBUtils verschoben

Das ist eine Datenbank-Quoting-Funktion und hat daher nichts mehr in
Form zu suchen.

Unterschiede anzeigen:

SL/IC.pm
591 591

  
592 592
  if ($form->{partnumber}) {
593 593
    $where .= qq| AND (p.partnumber ILIKE ?)|;
594
    push(@values, $::form->like($form->{partnumber}));
594
    push(@values, like($form->{partnumber}));
595 595
  }
596 596

  
597 597
  if ($form->{description}) {
598 598
    $where .= qq| AND (p.description ILIKE ?)|;
599
    push(@values, $::form->like($form->{description}));
599
    push(@values, like($form->{description}));
600 600
  }
601 601

  
602 602
  # retrieve assembly items
......
652 652
  while (my ($column, $table) = each(%columns)) {
653 653
    next unless ($form->{"${column}_$i"});
654 654
    $where .= qq| AND ${table}.${column} ILIKE ?|;
655
    push(@values, $::form->like($form->{"${column}_$i"}));
655
    push(@values, like($form->{"${column}_$i"}));
656 656
  }
657 657

  
658 658
  if ($form->{id}) {
......
917 917
    next unless $form->{$_};
918 918
    $form->{"l_$_"} = '1'; # show the column
919 919
    push @where_tokens, "$table_prefix{$_}$_ ILIKE ?";
920
    push @bind_vars,    $::form->like($form->{$_});
920
    push @bind_vars,    like($form->{$_});
921 921
  }
922 922

  
923 923
  foreach (@simple_l_switches) {
......
958 958
  # fortunately makemodel doesn't need to be displayed later, so adding a special clause to where_token is sufficient.
959 959
  if ($form->{make}) {
960 960
    push @where_tokens, 'mv.name ILIKE ?';
961
    push @bind_vars, $::form->like($form->{make});
961
    push @bind_vars, like($form->{make});
962 962
  }
963 963
  if ($form->{model}) {
964 964
    push @where_tokens, 'mm.model ILIKE ?';
965
    push @bind_vars, $::form->like($form->{model});
965
    push @bind_vars, like($form->{model});
966 966
  }
967 967

  
968 968
  # special case: sorting by partnumber
......
1156 1156
    next unless ($form->{$column});
1157 1157

  
1158 1158
    $where .= qq| AND $item ILIKE ?|;
1159
    push(@where_values, $::form->like($form->{$column}));
1159
    push(@where_values, like($form->{$column}));
1160 1160
  }
1161 1161

  
1162 1162
  foreach my $item (qw(description serialnumber)) {
1163 1163
    next unless ($form->{$item});
1164 1164

  
1165 1165
    $where .= qq| AND (${item} ILIKE ?)|;
1166
    push(@where_values, $::form->like($form->{$item}));
1166
    push(@where_values, like($form->{$item}));
1167 1167
  }
1168 1168

  
1169 1169

  
......
1197 1197
  foreach my $column (qw(make model)) {
1198 1198
    next unless ($form->{$column});
1199 1199
    $where .= qq| AND p.id IN (SELECT DISTINCT parts_id FROM makemodel WHERE $column ILIKE ?|;
1200
    push(@where_values, $::form->like($form->{$column}));
1200
    push(@where_values, like($form->{$column}));
1201 1201
  }
1202 1202

  
1203 1203
  $main::lxdebug->leave_sub();
......
1411 1411

  
1412 1412
  if ($sortorder eq "all") {
1413 1413
    $where .= qq| AND (partnumber ILIKE ?) AND (description ILIKE ?)|;
1414
    push(@values, $::form->like($form->{partnumber}), $::form->like($form->{description}));
1414
    push(@values, like($form->{partnumber}), like($form->{description}));
1415 1415

  
1416 1416
  } elsif ($sortorder eq "partnumber") {
1417 1417
    $where .= qq| AND (partnumber ILIKE ?)|;
1418
    push(@values, $::form->like($form->{partnumber}));
1418
    push(@values, like($form->{partnumber}));
1419 1419

  
1420 1420
  } elsif ($sortorder eq "description") {
1421 1421
    $where .= qq| AND (description ILIKE ?)|;
1422
    push(@values, $::form->like($form->{description}));
1422
    push(@values, like($form->{description}));
1423 1423
    $order = "description";
1424 1424

  
1425 1425
  }

Auch abrufbar als: Unified diff