Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9d208f8e

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

  • ID 9d208f8e3effbecf0427f855a1d0b4473016cc39
  • Vorgänger 2869285b
  • Nachfolger adb94488

ct.pl delete_contact: Fehler abgefangen.

Unterschiede anzeigen:

bin/mozilla/ct.pl
734 734
  $::lxdebug->enter_sub;
735 735
  $::auth->assert('customer_vendor_edit');
736 736

  
737
  CT->get_contact(\%::myconfig, $::form);
737
  if (!$::form->{cp_id}) {
738
    flash('error', $::locale->text('No contact selected to delete'));
739
  } else {
738 740

  
739
  my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id});
741
    CT->get_contact(\%::myconfig, $::form);
740 742

  
741
  if ($contact->used) {
742
    $contact->detach;
743
    flash('info', $::locale->text('Contact is in use and was flagged invalid.'));
744
  } else {
745
    $contact->delete;
746
    flash('info', $::locale->text('Contact deleted.'));
743
    my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id});
744

  
745
    if ($contact->used) {
746
      $contact->detach;
747
      flash('info', $::locale->text('Contact is in use and was flagged invalid.'));
748
    } else {
749
      $contact->delete;
750
      flash('info', $::locale->text('Contact deleted.'));
751
    }
752
    delete $::form->{$_} for grep /^cp_/, keys %$::form;
747 753
  }
748
  delete $::form->{$_} for grep /^cp_/, keys %$::form;
749 754

  
750 755
  edit();
751 756

  

Auch abrufbar als: Unified diff