Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 615d4ba7

Von Tamino Steinert vor etwa 1 Monat hinzugefügt

  • ID 615d4ba70be9386761e5ada433840aea79a629da
  • Vorgänger 5e2ebb85
  • Nachfolger 712f2139

S:C:Part: Flash-Logik von Artikeldruck überarbeitet

Unterschiede anzeigen:

SL/Controller/Part.pm
134 134
  my ($self) = @_;
135 135

  
136 136
  $self->save_with_render_error() or return;
137
  flash_later('info', t8('The item has been saved.'));
138 137
  $self->js_reset_part_after_save();
138
  $self->js->flash('info', t8('The item has been saved.'));
139 139

  
140 140
  my $formname    = $::form->{print_options}->{formname};
141 141
  my $language    = $::form->{print_options}->{language};
......
184 184
        file_name => $result{file_name},
185 185
      );
186 186

  
187
      flash_later('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description));
187
      $self->js->flash('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description));
188 188
      unlink $result{file_name} if $result{file_name};
189 189
    } else {
190 190
      die t8('Media \'#1\' is not supported yet/anymore.', $media);
......
193 193
    1;
194 194
  } or do {
195 195
    unlink $result{file_name} if $result{file_name};
196
    flash_later('error', t8("Creating the PDF failed!"));
197
    flash_later('error', $@);
196
    $self->js
197
      ->flash('error', t8("Creating the PDF failed!"))
198
      ->flash('error', $@);
198 199
  };
199 200

  
200
  my $redirect_url = $self->url_for(
201
    'action'  => 'edit',
202
    'part.id' => $self->part->id,
203
  );
204
  $self->js->redirect_to($redirect_url)->render;
201
  $self->js->render();
205 202
}
206 203

  
207 204
sub action_save_and_purchase_order {
......
1273 1270
      return [t8('The document has been changed by another user. Please reopen it in another window and copy the changes to the new window')];
1274 1271
  }
1275 1272

  
1276
  if (    $is_new
1277
       && $::form->{part}{partnumber}
1278
       && SL::DB::Manager::Part->find_by(partnumber => $::form->{part}{partnumber})
1279
     ) {
1280
    return $self->js->error(t8('The partnumber is already being used'))->render;
1281
  }
1282

  
1283 1273
  $self->parse_form;
1284 1274

  
1285 1275
  @errors = $self->part->validate;
......
1904 1894
          call     => [ 'kivi.Part.show_print_options' ],
1905 1895
          disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef,
1906 1896
          checks   => [ 'kivi.validate_form' ],
1897
          only_if  => !$::form->{inline_create},
1907 1898
        ],
1908 1899
        action => [
1909 1900
          $self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'),

Auch abrufbar als: Unified diff