Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bc40bcab

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID bc40bcabc425b99f3b79a5544684a6fe8674adfe
  • Vorgänger 9ebaa094
  • Nachfolger 0bf92081

(I)LIKE-Argumente immer mit Funktion SL::DBUtils::like erstellen

Unterschiede anzeigen:

SL/Form.pm
2499 2499
    my $where;
2500 2500
    if ($self->{customernumber} ne "") {
2501 2501
      $where = qq|(vc.customernumber ILIKE ?)|;
2502
      push(@values, '%' . $self->{customernumber} . '%');
2502
      push(@values, like($self->{customernumber}));
2503 2503
    } else {
2504 2504
      $where = qq|(vc.name ILIKE ?)|;
2505
      push(@values, '%' . $self->{$table} . '%');
2505
      push(@values, like($self->{$table}));
2506 2506
    }
2507 2507

  
2508 2508
    $query =
......
2519 2519
         JOIN $table vc ON (a.${table}_id = vc.id)
2520 2520
         WHERE NOT (a.amount = a.paid) AND (vc.name ILIKE ?)
2521 2521
         ORDER BY vc.name~;
2522
    push(@values, '%' . $self->{$table} . '%');
2522
    push(@values, like($self->{$table}));
2523 2523
  }
2524 2524

  
2525 2525
  $self->{name_list} = selectall_hashref_query($self, $dbh, $query, @values);
......
2744 2744

  
2745 2745
    $sth = $dbh->prepare($query);
2746 2746

  
2747
    do_statement($self, $sth, $query, '%' . $module . '%');
2747
    do_statement($self, $sth, $query, like($module));
2748 2748

  
2749 2749
    $self->{accounts} = "";
2750 2750
    while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
......
2819 2819
                ORDER BY c.accno|;
2820 2820

  
2821 2821
    $sth = $dbh->prepare($query);
2822
    do_statement($self, $sth, $query, "%$module%");
2822
    do_statement($self, $sth, $query, like($module));
2823 2823

  
2824 2824
    $self->{accounts} = "";
2825 2825
    while ($ref = $sth->fetchrow_hashref("NAME_lc")) {

Auch abrufbar als: Unified diff