Revision 65604fea
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/Controller/Letter.pm | ||
---|---|---|
379 | 379 |
my %column_defs = ( |
380 | 380 |
date => { text => t8('Date'), sub => sub { $_[0]->date_as_date } }, |
381 | 381 |
subject => { text => t8('Subject'), sub => sub { $_[0]->subject }, |
382 |
obj_link => sub { $self->url_for(action => 'edit', 'letter.id' => $_[0]->id, callback => $self->models->get_callback) } }, |
|
382 |
obj_link => sub { $self->url_for(action => 'edit', 'letter.id' => $_[0]->id, is_sales => $self->is_sales, callback => $self->models->get_callback) } },
|
|
383 | 383 |
letternumber => { text => t8('Letternumber'), sub => sub { $_[0]->letternumber }, |
384 |
obj_link => sub { $self->url_for(action => 'edit', 'letter.id' => $_[0]->id, callback => $self->models->get_callback) } }, |
|
384 |
obj_link => sub { $self->url_for(action => 'edit', 'letter.id' => $_[0]->id, is_sales => $self->is_sales, callback => $self->models->get_callback) } },
|
|
385 | 385 |
customer_id => { text => t8('Customer'), sub => sub { SL::DB::Manager::Customer->find_by_or_create(id => $_[0]->customer_id)->displayable_name }, visible => $self->is_sales }, |
386 | 386 |
vendor_id => { text => t8('Vendor'), sub => sub { SL::DB::Manager::Vendor->find_by_or_create(id => $_[0]->vendor_id)->displayable_name }, visible => !$self->is_sales}, |
387 | 387 |
contact => { text => t8('Contact'), sub => sub { $_[0]->contact ? $_[0]->contact->full_name : '' } }, |
... | ... | |
588 | 588 |
} |
589 | 589 |
|
590 | 590 |
sub check_auth_edit { |
591 |
$::form->{is_sales} ? $::auth->assert('sales_letter_edit')
|
|
592 |
: $::auth->assert('purchase_letter_edit');
|
|
591 |
$_[0]->is_sales ? $::auth->assert('sales_letter_edit')
|
|
592 |
: $::auth->assert('purchase_letter_edit'); |
|
593 | 593 |
} |
594 | 594 |
|
595 | 595 |
sub check_auth_report { |
596 |
$::form->{is_sales} ? $::auth->assert('sales_letter_report')
|
|
597 |
: $::auth->assert('purchase_letter_report');
|
|
596 |
$_[0]->is_sales ? $::auth->assert('sales_letter_report')
|
|
597 |
: $::auth->assert('purchase_letter_report'); |
|
598 | 598 |
} |
599 | 599 |
|
600 | 600 |
sub setup_load_letter_draft_action_bar { |
Auch abrufbar als: Unified diff
Briefe: Rechteprüfung gefixed
Beim Öffnen eines Briefes aus dem Bericht wurde die Info is_sales nicht
mitgegeben. Daher wurde immer auf Rechte im Einkauf geprüft, egal, ob
Ein- oder Verkauf.
- $self->is_sales verwenden, denn das prüft, ob $::form->{is_sales} vorhanden
ist
- is_sales der URL für den Link auf den Brief mitgeben