Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f0d897b6

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID f0d897b6b9ffbbfe98c0dbc1638ef30c9b798729
  • Vorgänger c05d863e
  • Nachfolger 56bfdfdc

Dienstleistungen: makemodels auch speichern

Nachtrag zu c6a4a05a9ad2ae02, Dienstleistungen müssen auch korrekt gespeichert
und geladen werden.

Fix zu Bug 1829

Unterschiede anzeigen:

SL/IC.pm
164 164
  #correct rows
165 165
  $form->{price_rows} = $i - 1;
166 166

  
167
  unless ($form->{item} eq 'service') {
168

  
169
    # get makes
170
    if ($form->{makemodel}) {
171
    #hli
172
      $query = qq|SELECT m.make, m.model,m.lastcost,m.lastcost,m.lastupdate,m.sortorder FROM makemodel m | .
173
               qq|WHERE m.parts_id = ? order by m.sortorder asc|;
174
      my @values = ($form->{id});
175
      $sth = $dbh->prepare($query);
176
      $sth->execute(@values) || $form->dberror("$query (" . join(', ', @values) . ")");
177

  
178
      my $i = 1;
179

  
180
      while (($form->{"make_$i"}, $form->{"model_$i"}, $form->{"old_lastcost_$i"},
181
                $form->{"lastcost_$i"}, $form->{"lastupdate_$i"}, $form->{"sortorder_$i"}) = $sth->fetchrow_array)
182
      {
183
        $i++;
184
      }
185
      $sth->finish;
186
      $form->{makemodel_rows} = $i - 1;
187

  
167
  # get makes
168
  if ($form->{makemodel}) {
169
  #hli
170
    $query = qq|SELECT m.make, m.model,m.lastcost,m.lastcost,m.lastupdate,m.sortorder FROM makemodel m | .
171
             qq|WHERE m.parts_id = ? order by m.sortorder asc|;
172
    my @values = ($form->{id});
173
    $sth = $dbh->prepare($query);
174
    $sth->execute(@values) || $form->dberror("$query (" . join(', ', @values) . ")");
175

  
176
    my $i = 1;
177

  
178
    while (($form->{"make_$i"}, $form->{"model_$i"}, $form->{"old_lastcost_$i"},
179
              $form->{"lastcost_$i"}, $form->{"lastupdate_$i"}, $form->{"sortorder_$i"}) = $sth->fetchrow_array)
180
    {
181
      $i++;
188 182
    }
183
    $sth->finish;
184
    $form->{makemodel_rows} = $i - 1;
185

  
189 186
  }
190 187

  
191 188
  # get translations
......
330 327
    }
331 328
    $sth->finish;
332 329

  
333
    if ($form->{item} ne 'service') {
334
      # delete makemodel records
335
      do_query($form, $dbh, qq|DELETE FROM makemodel WHERE parts_id = ?|, conv_i($form->{id}));
336
    }
330
    # delete makemodel records
331
    do_query($form, $dbh, qq|DELETE FROM makemodel WHERE parts_id = ?|, conv_i($form->{id}));
337 332

  
338 333
    if ($form->{item} eq 'assembly') {
339 334
      # delete assembly records

Auch abrufbar als: Unified diff