voltage and privacy on register

This commit is contained in:
Rainer Gümpelein 2022-01-21 17:26:57 +01:00
parent f95f503bf6
commit 901c4c2a71
4 changed files with 44 additions and 7 deletions

View file

@ -1076,7 +1076,7 @@ sub booking_update(){
$dbt->update_record($dbh,$update_ct,$record_ct);
if($q->param('voltage') && $q->param('voltage') =~ /(\d+)/){
$update_cc->{int14} = $1;
$self->service_automatic($q) if($1 <= 40);
#$self->service_automatic($q) if($1 <= 40);
}
$update_cc->{txt15} = $q->escapeHTML($q->param('firmware')) if($q->param('firmware'));
$update_cc->{txt17} = $Ilockit_GUID if($Ilockit_GUID);
@ -1108,9 +1108,11 @@ sub booking_update(){
mtime => "now()",
owner => "$owner",
};
$update_cc->{int14} = $q->escapeHTML($q->param('voltage')) if($q->param('voltage'));
#my $record_cc = { c_id => $record_pos->{cc_id} };
if($q->param('voltage') && $q->param('voltage') =~ /(\d+)/){
$update_cc->{int14} = $1;
$self->service_automatic($q) if($1 <= 40);
}
my $update_pos = {
table => "contenttranspos",
@ -1295,8 +1297,10 @@ sub service_automatic {
my $self = shift;
my $q = shift || "";
my $station_id = $1 if($q->param('station') =~ /(\d+)/);
my $bike_id = $1 if($q->param('bike') =~ /(\d+)/);
my $station_id = "";
my $bike_id = "";
$station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/);
$bike_id = $1 if($q->param('bike') && $q->param('bike') =~ /(\d+)/);
my $authraw = { c_id => $owner };#default sys API
my $lock_charge = "Achtung, Fahrradschloss Ladung unter " . $q->param('voltage') . "%";
my $response = {};

View file

@ -41,12 +41,14 @@ sub tpl(){
($api_return,$users_sharee) = $apif->auth_verify($q,$coo,"");
my $initMap = $dbt->{website}->{$varenv->{syshost}}->{initMap};
my $map_zoom = $dbt->{website}->{$varenv->{syshost}}->{map_zoom} || "10";
if($dbt->{website}->{$varenv->{syshost}}->{merchant_id}){
$api_return->{authcookie} = $dbt->{website}->{$varenv->{syshost}}->{merchant_id} if(!$api_return->{authcookie});
}elsif($dbt->{operator}->{$varenv->{dbname}}->{merchant_id}){
$api_return->{authcookie} = $dbt->{operator}->{$varenv->{dbname}}->{merchant_id} if(!$api_return->{authcookie});
$initMap = $dbt->{operator}->{$varenv->{dbname}}->{initMap};
$map_zoom = $dbt->{operator}->{$varenv->{dbname}}->{map_zoom} if($dbt->{operator}->{$varenv->{dbname}}->{map_zoom});
}elsif($dbt->{primary}->{$varenv->{dbname}}->{merchant_id}){
$api_return->{authcookie} = $dbt->{primary}->{$varenv->{dbname}}->{merchant_id} if(!$api_return->{authcookie});
$initMap = $dbt->{primary}->{$varenv->{dbname}}->{initMap};
@ -75,7 +77,7 @@ print<<EOF
scrollwheel: false,
draggable: !("ontouchend" in document),
center: {lat: $lat, lng: $lng},
zoom: 13
zoom: $map_zoom
});
var ctaLayer = new google.maps.KmlLayer({

View file

@ -173,7 +173,7 @@ my $booking_update_locking = "$uriop?request=booking_update&bike=$bike&lock_stat
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_locking"},"[ booking_update_locking ]---> $booking_update_locking")),"\n";
my $booking_update_locked = "$uriop?request=booking_update&bike=$bike&lock_state=locked&authcookie=$coo";
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_locked"},"[ booking_update_locked ]---> $booking_update_locked")),"\n";
my $booking_update_unlocked = "$uriop?request=booking_update&bike=$bike&lock_state=unlocked&authcookie=$coo";
my $booking_update_unlocked = "$uriop?request=booking_update&bike=$bike&lock_state=unlocked&voltage=39&authcookie=$coo";
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_unlocked"},"[ booking_update_unlocked ]---> $booking_update_unlocked")),"\n";
my $booking_update_oc_ul = "$uriop?request=booking_update&bike=$bike&state=occupied&lock_state=unlocked&authcookie=$coo";