diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-03-02 21:20:59 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-03-02 21:20:59 +0100 |
commit | 6a734a094be259faca8f34a3a4653ba0c8535b27 (patch) | |
tree | 1f6a68e43daa40a241c172420d07ada19a3df224 | |
parent | f0e991a90db5d5f13b432c166a22092fd3075a36 (diff) |
visibility_form: use visibility_str
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index caa7805..6a8e1f9 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -1909,7 +1909,7 @@ sub visibility_form { my $user_level = $user->{default_visibility_str}; my $uid = $user->{id}; my $status = $self->get_user_status; - my $visibility = $status->{visibility}; + my $visibility = $status->{visibility_str}; my $journey; if ($journey_id) { @@ -1919,7 +1919,7 @@ sub visibility_form { with_datetime => 1, with_visibility => 1, ); - $visibility = $journey->{visibility}; + $visibility = $journey->{visibility_str}; } if ( $action eq 'save' ) { @@ -1932,8 +1932,6 @@ sub visibility_form { ); } elsif ( $dep_ts and $dep_ts != $status->{sched_departure}->epoch ) { - - # TODO find and update appropriate past journey (if it exists) $self->render( 'edit_visibility', error => 'old', @@ -1942,7 +1940,6 @@ sub visibility_form { ); } else { - $self->app->log->debug("set visibility"); if ($dep_ts) { $self->in_transit->update_visibility( uid => $uid, @@ -1962,22 +1959,7 @@ sub visibility_form { return; } - # todo use visibility_str - if ( not defined $visibility ) { - $self->param( status_level => 'default' ); - } - elsif ( $visibility == 100 ) { - $self->param( status_level => 'public' ); - } - elsif ( $visibility == 80 ) { - $self->param( status_level => 'travelynx' ); - } - elsif ( $visibility == 30 ) { - $self->param( status_level => 'unlisted' ); - } - elsif ( $visibility == 10 ) { - $self->param( status_level => 'private' ); - } + $self->param( status_level => $visibility ); if ($journey_id) { $self->render( |