From 901c4c2a718a14191fac894c85dfca2f7954e1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rainer=20G=C3=BCmpelein?= Date: Fri, 21 Jan 2022 17:26:57 +0100 Subject: [PATCH] voltage and privacy on register --- copri4/main/src/Mod/APIfunc.pm | 14 ++++++--- copri4/main/src/Tpl/Karte.pm | 4 ++- copri4/main/src/scripts/tests/index.pl | 2 +- copri4/shareeapp-operator/src/Tpl/FormEdit.pm | 31 +++++++++++++++++++ 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/copri4/main/src/Mod/APIfunc.pm b/copri4/main/src/Mod/APIfunc.pm index e08e59e..e00fd78 100755 --- a/copri4/main/src/Mod/APIfunc.pm +++ b/copri4/main/src/Mod/APIfunc.pm @@ -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 = {}; diff --git a/copri4/main/src/Tpl/Karte.pm b/copri4/main/src/Tpl/Karte.pm index c9a2509..35b2cdf 100755 --- a/copri4/main/src/Tpl/Karte.pm +++ b/copri4/main/src/Tpl/Karte.pm @@ -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< $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"; diff --git a/copri4/shareeapp-operator/src/Tpl/FormEdit.pm b/copri4/shareeapp-operator/src/Tpl/FormEdit.pm index e5ed651..4d5bf3c 100755 --- a/copri4/shareeapp-operator/src/Tpl/FormEdit.pm +++ b/copri4/shareeapp-operator/src/Tpl/FormEdit.pm @@ -137,6 +137,10 @@ sub tpl(){ $sharee_agb_text->{txt01} = ""; $sharee_agb_text->{txt01} = "" if($aowner == 195 || $aowner == 185 || $aowner == 176); + my $sharee_privacy_text = {}; + $sharee_privacy_text->{ct_name} = "Datenschutzhinweise"; + $sharee_privacy_text->{txt01} = ""; + print "
\n"; print < + + +EOF +; + + my $debug=0; $debug=1 if($users_sharee->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test"); my $debug_message = ""; @@ -527,6 +553,11 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctrel->{$key}","","$required","$autofocus"), " $sharee_agb"),"\n"; print $q->hidden(-name=>"$key",-override=>1,-value=>"null"); + my $sharee_privacy = "\n"; + print $q->div({-style=>'padding-top:10px;'},"Bitte beachten Sie unsere neuen $sharee_privacy"),"\n" if($aowner == 195 || $aowner == 185 || $aowner == 176); + + #print $q->div({-class=>'content2'},"Bitte beachten Sie unsere Datenschutzhinweise."),"\n"; + }elsif(1==2 && $key =~ /int02/){#newsletter if($varenv->{wwwhost} !~ /konrad/){ print $q->label({-for=>"$key", -style=>'padding-top:10px;'},""),"\n";