Loading lib/Travelynx.pm +6 −8 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ sub startup { from user_actions left outer join stations on station_id = stations.id where user_id = ? and (action_time = to_timestamp(?) or action_time = to_timestamp(?)) and user_actions.id <= ? order by action_time desc limit 2 } Loading Loading @@ -898,10 +898,9 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} $query = $self->app->get_last_actions_query; } if ( $opt{checkin_epoch} and $opt{checkout_epoch} ) { if ( $opt{checkout_id} ) { $query = $self->app->get_journey_actions_query; $query->execute( $uid, $opt{checkin_epoch}, $opt{checkout_epoch} ); $query->execute( $uid, $opt{checkout_id}); } elsif ( $opt{after} and $opt{before} ) { Loading Loading @@ -960,7 +959,7 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} if ( $action == $match_actions[0] or ( $opt{checkout_epoch} and $raw_ts == $opt{checkout_epoch} ) ( $opt{checkout_id} and not @travels ) ) { push( Loading Loading @@ -989,8 +988,7 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} $action == $match_actions[1] and $prev_action == $match_actions[0] ) or ( $opt{checkin_epoch} and $raw_ts == $opt{checkin_epoch} ) or $opt{checkout_id} ) { my $ref = $travels[-1]; Loading Loading @@ -1041,7 +1039,7 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} ? $ref->{km_beeline} / $kmh_divisor : -1; } if ( $opt{checkin_epoch} if ( $opt{checkout_id} and $action == $self->app->action_type->{cancelled_from} ) { Loading lib/Travelynx/Controller/Traveling.pm +4 −5 Original line number Diff line number Diff line Loading @@ -310,9 +310,9 @@ sub monthly_history { sub journey_details { my ($self) = @_; my ( $uid, $checkin_ts, $checkout_ts ) = split( qr{-}, $self->stash('id') ); my ( $uid, $checkout_id ) = split( qr{-}, $self->stash('id') ); if ( $uid != $self->current_user->{id} ) { if ( not ($uid == $self->current_user->{id} and $checkout_id)) { $self->render( 'journey', error => 'notfound', Loading @@ -323,11 +323,10 @@ sub journey_details { my @journeys = $self->get_user_travels( uid => $uid, checkin_epoch => $checkin_ts, checkout_epoch => $checkout_ts, checkout_id => $checkout_id, verbose => 1, ); if ( @journeys == 0 ) { if ( @journeys == 0 or not $journeys[0]{completed}) { $self->render( 'journey', error => 'notfound', Loading templates/history.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ <tbody> % for my $travel (@{$journeys}) { % if ($travel->{completed}) { % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{checkin}->epoch . '-' . $travel->{checkout}->epoch; % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{ids}->[1]; <tr> <td><%= $travel->{sched_departure}->strftime('%d.%m.%Y') %></td> <td> Loading templates/landingpage.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ % for my $travel (get_user_travels(limit => 1)) { % if ($travel->{completed}) { <tr> % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{checkin}->epoch . '-' . $travel->{checkout}->epoch; % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{ids}->[1]; <td><%= $travel->{sched_departure}->strftime('%d.%m.%Y') %></td> <td><a href="<%= $detail_link %>"><%= $travel->{type} %> <%= $travel->{line} // $travel->{no} %></a></td> <td><a href="<%= $detail_link %>"><%= $travel->{from_name} %> → <%= $travel->{to_name} %></a></td> Loading Loading
lib/Travelynx.pm +6 −8 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ sub startup { from user_actions left outer join stations on station_id = stations.id where user_id = ? and (action_time = to_timestamp(?) or action_time = to_timestamp(?)) and user_actions.id <= ? order by action_time desc limit 2 } Loading Loading @@ -898,10 +898,9 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} $query = $self->app->get_last_actions_query; } if ( $opt{checkin_epoch} and $opt{checkout_epoch} ) { if ( $opt{checkout_id} ) { $query = $self->app->get_journey_actions_query; $query->execute( $uid, $opt{checkin_epoch}, $opt{checkout_epoch} ); $query->execute( $uid, $opt{checkout_id}); } elsif ( $opt{after} and $opt{before} ) { Loading Loading @@ -960,7 +959,7 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} if ( $action == $match_actions[0] or ( $opt{checkout_epoch} and $raw_ts == $opt{checkout_epoch} ) ( $opt{checkout_id} and not @travels ) ) { push( Loading Loading @@ -989,8 +988,7 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} $action == $match_actions[1] and $prev_action == $match_actions[0] ) or ( $opt{checkin_epoch} and $raw_ts == $opt{checkin_epoch} ) or $opt{checkout_id} ) { my $ref = $travels[-1]; Loading Loading @@ -1041,7 +1039,7 @@ qq{select * from pending_mails where email = ? and num_tries > 1;} ? $ref->{km_beeline} / $kmh_divisor : -1; } if ( $opt{checkin_epoch} if ( $opt{checkout_id} and $action == $self->app->action_type->{cancelled_from} ) { Loading
lib/Travelynx/Controller/Traveling.pm +4 −5 Original line number Diff line number Diff line Loading @@ -310,9 +310,9 @@ sub monthly_history { sub journey_details { my ($self) = @_; my ( $uid, $checkin_ts, $checkout_ts ) = split( qr{-}, $self->stash('id') ); my ( $uid, $checkout_id ) = split( qr{-}, $self->stash('id') ); if ( $uid != $self->current_user->{id} ) { if ( not ($uid == $self->current_user->{id} and $checkout_id)) { $self->render( 'journey', error => 'notfound', Loading @@ -323,11 +323,10 @@ sub journey_details { my @journeys = $self->get_user_travels( uid => $uid, checkin_epoch => $checkin_ts, checkout_epoch => $checkout_ts, checkout_id => $checkout_id, verbose => 1, ); if ( @journeys == 0 ) { if ( @journeys == 0 or not $journeys[0]{completed}) { $self->render( 'journey', error => 'notfound', Loading
templates/history.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ <tbody> % for my $travel (@{$journeys}) { % if ($travel->{completed}) { % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{checkin}->epoch . '-' . $travel->{checkout}->epoch; % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{ids}->[1]; <tr> <td><%= $travel->{sched_departure}->strftime('%d.%m.%Y') %></td> <td> Loading
templates/landingpage.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ % for my $travel (get_user_travels(limit => 1)) { % if ($travel->{completed}) { <tr> % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{checkin}->epoch . '-' . $travel->{checkout}->epoch; % my $detail_link = '/journey/' . current_user()->{id} . '-' . $travel->{ids}->[1]; <td><%= $travel->{sched_departure}->strftime('%d.%m.%Y') %></td> <td><a href="<%= $detail_link %>"><%= $travel->{type} %> <%= $travel->{line} // $travel->{no} %></a></td> <td><a href="<%= $detail_link %>"><%= $travel->{from_name} %> → <%= $travel->{to_name} %></a></td> Loading