Revision fcf1cda2
Von Bernd Bleßmann vor etwa 2 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
sub action_save_phone_note {
|
||
my ($self) = @_;
|
||
|
||
if (!$::form->{phone_note}->{subject} || !$::form->{phone_note}->{body}) {
|
||
return $self->js->flash('error', t8('Phone note needs a subject and a body.'))->render;
|
||
}
|
||
|
||
my $phone_note;
|
||
if ($::form->{phone_note}->{id}) {
|
||
$phone_note = first { $_->id == $::form->{phone_note}->{id} } @{$self->order->phone_notes};
|
||
return $self->js->flash('error', t8('Phone note not found for this order.'))->render if !$phone_note;
|
||
}
|
||
|
||
$phone_note = SL::DB::Note->new() if !$phone_note;
|
||
my $is_new = !$phone_note->id;
|
||
|
||
$phone_note->assign_attributes(%{ $::form->{phone_note} },
|
||
Order-Controller: Parsen von Telefonnotizen in sub ausgelagert