summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-08-18 20:42:37 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-08-18 20:42:37 +0200
commit54547eb3affa06a203e687a7f4a8447e7dd5adf0 (patch)
treea44fee5f23aca7c8ba76805c9cb7b8e9d7bfafce /lib
parent379da61de4da2d74e458dcfa3f9cfc1e02cb063e (diff)
manual station entry: HAFAS support
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 0f6b64f..8f560a9 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -1095,7 +1095,17 @@ sub redirect_to_station {
my ($self) = @_;
my $station = $self->param('station');
- $self->redirect_to("/s/${station}");
+ if ( my $s = $self->app->stations->search($station) ) {
+ if ( $s->{hafas} ) {
+ $self->redirect_to("/s/${station}?hafas=1");
+ }
+ else {
+ $self->redirect_to("/s/${station}");
+ }
+ }
+ else {
+ $self->redirect_to("/s/${station}?hafas=1");
+ }
}
sub cancelled {