summaryrefslogtreecommitdiff
path: root/lib/Travelynx
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-08-23 12:02:22 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-08-23 12:02:22 +0200
commita40aa1936bc088c76145600a2b074f8fb20079f5 (patch)
tree58be9cc212eff4196eec5b30bf5fc36de788dc02 /lib/Travelynx
parentf6d56d3134f6045726cb1d4ed8700382575bb686 (diff)
Allow comments to be edited
Diffstat (limited to 'lib/Travelynx')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 7599dd0..43730bc 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -608,6 +608,20 @@ sub edit_journey {
}
}
}
+ for my $key (qw(comment)) {
+ if (
+ defined $self->param($key)
+ and ( not $journey->{user_data}
+ or $journey->{user_data}{$key} ne $self->param($key) )
+ )
+ {
+ $error = $self->update_journey_part( $db, $journey->{id}, $key,
+ $self->param($key) );
+ if ($error) {
+ last;
+ }
+ }
+ }
if ( not $error ) {
$journey = $self->get_journey(
@@ -631,6 +645,11 @@ sub edit_journey {
$key => $journey->{$key}->strftime('%d.%m.%Y %H:%M') );
}
}
+ for my $key (qw(comment)) {
+ if ( $journey->{user_data} and $journey->{user_data}{$key} ) {
+ $self->param( $key => $journey->{user_data}{$key} );
+ }
+ }
$self->render(
'edit_journey',