Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0af1d584

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 0af1d5843dd19643ace9d75701702c813b64a9ba
  • Vorgänger f8fcb767
  • Nachfolger a78e5571

Deaktiviere Löschen-Button bei festen Verknüpfungen (order, ap)

Unterschiede anzeigen:

SL/Controller/Order.pm
41 41
use SL::Helper::UserPreferences::PositionsScrollbar;
42 42
use SL::Helper::UserPreferences::UpdatePositions;
43 43

  
44
use SL::DB::Helper::HardRecordLinks;
45

  
44 46
use SL::Controller::Helper::GetModels;
45 47

  
46 48
use List::Util qw(first sum0);
......
2416 2418
    $has_final_invoice               = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->type} @$lr;
2417 2419
  }
2418 2420

  
2421
  my $has_hard_links = SL::DB::Helper::HardRecordLinks->get_count($self->order);
2422

  
2419 2423
  my $right_for         = { map { $_ => $_.'_edit' } @{$self->valid_types} };
2420 2424
  $right_for->{ sales_order_intake_type() } = 'sales_order_edit';
2421 2425
  $right_for->{ purchase_quotation_intake_type() } = 'request_quotation_edit';
......
2656 2660
        confirm  => $::locale->text('Do you really want to delete this object?'),
2657 2661
        disabled => !$may_edit_create  ? t8('You do not have the permissions to access this function.')
2658 2662
                  : !$self->order->id  ? t8('This object has not been saved yet.')
2663
                  : $has_hard_links    ? t8('This object has hard links. Please delete them first.')
2659 2664
                  :                      undef,
2660 2665
        only_if  => $deletion_allowed,
2661 2666
      ],

Auch abrufbar als: Unified diff