Revision 115e5a24
Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
6 | 6 |
use Clone qw(clone); |
7 | 7 |
use SL::DB::Part; |
8 | 8 |
use SL::DB::PartsGroup; |
9 |
use SL::DB::PriceRuleItem; |
|
9 | 10 |
use SL::DB::Shop; |
10 | 11 |
use SL::Controller::Helper::GetModels; |
11 | 12 |
use SL::Locale::String qw(t8); |
... | ... | |
1266 | 1267 |
sub _setup_form_action_bar { |
1267 | 1268 |
my ($self) = @_; |
1268 | 1269 |
|
1269 |
my $may_edit = $::auth->assert('part_service_assembly_edit', 'may fail'); |
|
1270 |
my $may_edit = $::auth->assert('part_service_assembly_edit', 'may fail'); |
|
1271 |
my $used_in_pricerules = !!SL::DB::Manager::PriceRuleItem->get_all_count(where => [type => 'part', value_int => $self->part->id]); |
|
1270 | 1272 |
|
1271 | 1273 |
for my $bar ($::request->layout->get('actionbar')) { |
1272 | 1274 |
$bar->add( |
... | ... | |
1292 | 1294 |
disabled => !$self->part->id ? t8('This object has not been saved yet.') |
1293 | 1295 |
: !$may_edit ? t8('You do not have the permissions to access this function.') |
1294 | 1296 |
: !$self->part->orphaned ? t8('This object has already been used.') |
1297 |
: $used_in_pricerules ? t8('This object is used in price rules.') |
|
1295 | 1298 |
: undef, |
1296 | 1299 |
], |
1297 | 1300 |
|
Auch abrufbar als: Unified diff
Artikel nicht löschen können, wenn in Preisregeln verwendet.
behebt #353
"Preisregeln Wenn Artikel gelöscht wird"