summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Account.pm
diff options
context:
space:
mode:
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');
}