summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Account.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-09-24 18:19:17 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-09-24 18:19:17 +0200
commitde074342de0bdc3604a0610a0c5f9cce5338bb85 (patch)
tree721c6c7415945ca57779e51db5dde00e136a62c2 /lib/Travelynx/Controller/Account.pm
parent8810acf742629294713448408ab6f0719f17952f (diff)
add support for HAFAS connection suggestions; drop manual destination list
Still TODO: handle stations that have several EVAs
Diffstat (limited to 'lib/Travelynx/Controller/Account.pm')
-rw-r--r--lib/Travelynx/Controller/Account.pm30
1 files changed, 6 insertions, 24 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm
index 2664329..0d12fb8 100644
--- a/lib/Travelynx/Controller/Account.pm
+++ b/lib/Travelynx/Controller/Account.pm
@@ -799,11 +799,8 @@ sub profile {
sub insight {
my ($self) = @_;
- my $user = $self->current_user;
- my ( $use_history, $destinations ) = $self->users->use_history(
- uid => $user->{id},
- with_local_transit => 1
- );
+ my $user = $self->current_user;
+ my $use_history = $self->users->use_history( uid => $user->{id} );
if ( $self->param('action') and $self->param('action') eq 'save' ) {
if ( $self->param('on_departure') ) {
@@ -820,31 +817,16 @@ sub insight {
$use_history &= ~0x02;
}
- if ( $self->param('local_transit') ) {
- $use_history |= 0x04;
- }
- else {
- $use_history &= ~0x04;
- }
-
- if ( $self->param('destinations') ) {
- $destinations
- = [ split( qr{\r?\n\r?}, $self->param('destinations') ) ];
- }
-
$self->users->use_history(
- uid => $user->{id},
- set => $use_history,
- destinations => $destinations
+ uid => $user->{id},
+ set => $use_history
);
$self->flash( success => 'use_history' );
$self->redirect_to('account');
}
- $self->param( on_departure => $use_history & 0x01 ? 1 : 0 );
- $self->param( on_arrival => $use_history & 0x02 ? 1 : 0 );
- $self->param( local_transit => $use_history & 0x04 ? 1 : 0 );
- $self->param( destinations => join( "\n", @{$destinations} ) );
+ $self->param( on_departure => $use_history & 0x01 ? 1 : 0 );
+ $self->param( on_arrival => $use_history & 0x02 ? 1 : 0 );
$self->render('use_history');
}