sig private view fix

This commit is contained in:
ragu 2022-06-09 15:31:31 +02:00
parent 95d890e188
commit b959c0b2c0
6 changed files with 17 additions and 9 deletions

View file

@ -1029,8 +1029,8 @@ sub booking_update(){
bike => "$bike",
state => "",
lock_state => "",
station_lock_state => "",
co2saving => "",
#station_lock_state => "",
#co2saving => "",
response_state => "OK 1017: No update",
response_text => "Der Mietstatus wurde nicht geändert.",
};

View file

@ -158,6 +158,13 @@ sub sig_booking_update {
$q->param(-name=>'state',-value=>"available");
$q->param(-name=>'lock_state',-value=>"locked");
($rows, $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner,$sig_book) if($authraw->{c_id});
#response is for sig json after rental-end
delete $booking_values->{geo_distance};
delete $booking_values->{response_state};
delete $booking_values->{response_text};
$booking_values->{bikeId} = $sig_book->{bikeId};
$booking_values->{rentalId} = $sig_book->{rentalId};
$response = {%$response, %$booking_values};
}else{
$response->{response_state} = "Failure: there is no rental with rentalID=$rentalId";

View file

@ -105,7 +105,7 @@ sub sig_available {
#station (mainly using sigojson site object)
my $station = "SX$resp->{site}->{id}";
if($station && looks_like_number($resp->{site}->{id})){
if($station && looks_like_number($resp->{site}->{id}) && ref($bike_group) eq "ARRAY" && @{$bike_group}[0]){
print FILE "Station: $station\n";
$response_out->{$station}->{station} = "$station";
$response_out->{$station}->{authed} = "$authed";
@ -165,7 +165,7 @@ sub sig_available {
$bike_id =~ s/S[1-9]X/SX/;
$bike_id = $1 if($bike_id =~ /(\d+)/);
if($bike && looks_like_number($bike_id) && looks_like_number($resp->{site}->{id})){
if($bike && looks_like_number($bike_id) && looks_like_number($resp->{site}->{id}) && ref($bike_group) eq "ARRAY" && @{$bike_group}[0]){
print FILE "Bike: $bike\n";
$response_out->{$bike}->{bike} = "$bike";
$response_out->{$bike}->{authed} = "$authed";

View file

@ -831,7 +831,7 @@ sub sigbike_cupdate {
owner => "169",
};
$bw->log("UPDATE content from record_sig with bike nr:",$update,"");
$bw->log("sigbike_cupdate content from record_sig with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sig->{$bid});
if($rows != 1){
my $c_id = "";
@ -862,7 +862,7 @@ sub sigstation_cupdate {
owner => "169",
};
$bw->log("UPDATE content from record_sig with bike nr:",$update,"");
$bw->log("sigstation_cupdate content from record_sig with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sig->{$sid});
if($rows != 1){
my $c_id = "";

View file

@ -188,6 +188,7 @@ print $q->div({-class=>"content2_legende"}, $q->img({-style=>'height:37px;', -sr
print "$initMap|$varenv->{dbname}|$api_return->{authcookie}|$users_sharee->{c_id}" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
#print "$uri_request/GBFSout?request=stations_available&authcookie=$api_return->{authcookie}";
}
1;

View file

@ -39,14 +39,14 @@ sub tpl(){
}
my $bgcolor1 = $dbt->{primary}->{$varenv->{dbname}}->{bgcolor1};
if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $dbt->{copri_conf}->{stage} eq "test")){
if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $dbt->{copri_conf}->{stage} eq "test" || $users_sharee->{txt08} eq "sigo\@sharee.bike")){
my $coo = $q->cookie('domcookie') || $q->param('sessionid') || "";
#my $api_test = "sharee_fr01"; my $bike="FR1538";
#my $api_test = "sharee_fr01"; my $bike="FR4781";#Tracking and BVB test
#my $api_test = "sharee_kn"; my $bike="KN205";
my $api_test = "sharee_wue"; my $bike="WUE5524";
#my $api_test = "sharee_sx"; my $bike="S3X1001";
#my $api_test = "sharee_wue"; my $bike="WUE5524";
my $api_test = "sharee_sx"; my $bike="S3X1001";
#my $api_test = "sharee_ren"; my $bike="REN2";
print $q->div({-style=>'float:right;text-align:right;height:25px;padding:6px 15px;background-color:white'},$q->a({-style=>"background-color:#ffffff;color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test\&bike=$bike", -target=>'_blank'}," [ tests --> $api_test ] "),"$users_sharee->{txt08}",$q->a({-style=>"color:#$bgcolor1;", -href=>"logout_sharee$session"},"logout")),"\n";