mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
Adding aa_ride in json bike context
This commit is contained in:
parent
b7e6c91efd
commit
63380dfbe0
3 changed files with 12 additions and 27 deletions
|
@ -1837,6 +1837,8 @@ sub bikes_available(){
|
|||
foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){
|
||||
$return->{$id}->{authed} = "$authed";
|
||||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
$return->{$id}->{aa_ride} = "0";
|
||||
$return->{$id}->{aa_ride} = "1" if($record_st->{$record->{$id}->{int04}}->{int42});
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
$return->{$id}->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{barcode}";
|
||||
|
@ -1901,15 +1903,6 @@ sub bikes_available(){
|
|||
if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $atid == $tariff_content->{$tid}->{barcode}){
|
||||
#$bw->log("bikes_available for user c_id: $auth->{c_id} if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $atid == $tariff_content->{$tid}->{barcode}) on BIKE:",$return->{$id}->{bike},"");
|
||||
|
||||
#deprecated
|
||||
$return->{$id}->{tariff_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||
$return->{$id}->{tariff_description}->{number} = "$tariff_content->{$tid}->{barcode}";
|
||||
$return->{$id}->{tariff_description}->{eur_per_hour} = "$tariff_content->{$tid}->{int02}" || "0";
|
||||
$return->{$id}->{tariff_description}->{max_eur_per_day} = "$tariff_content->{$tid}->{int17}" if($tariff_content->{$tid}->{int17});
|
||||
$return->{$id}->{tariff_description}->{free_hours} = "$tariff_content->{$tid}->{int16}" if($tariff_content->{$tid}->{int16});
|
||||
$return->{$id}->{tariff_description}->{abo_eur_per_month} = "$tariff_content->{$tid}->{int15}" if($tariff_content->{$tid}->{int15});
|
||||
|
||||
#new rental_description
|
||||
$return->{$id}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||
$return->{$id}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
||||
$return->{$id}->{rental_description}->{tarif_type} = "$adrtarif_hash->{$tariff_content->{$tid}->{barcode}}";
|
||||
|
|
|
@ -246,23 +246,18 @@ sub sig_available {
|
|||
$response_out->{$bike}->{system} = "sigo";
|
||||
$response_out->{$bike}->{bike_group} = ["SX300101"];#Lastenrad type_id
|
||||
$response_out->{$bike}->{unlock_allowed} = "1";
|
||||
$response_out->{$bike}->{tariff_description} = {};
|
||||
$response_out->{$bike}->{aa_ride} = "1";#sig default to A-A
|
||||
$response_out->{$bike}->{aa_ride} = "0" if($resp->{site}->{address} && $resp->{site}->{address} =~ /Passau/i);#A-B
|
||||
|
||||
$response_out->{$bike}->{rental_description} = {};
|
||||
if(ref($tariff_content) eq "HASH"){
|
||||
foreach my $tid (sort { $tariff_content->{$a}->{barcode} <=> $tariff_content->{$b}->{barcode} } keys (%$tariff_content)){
|
||||
#deprecated
|
||||
$response_out->{$bike}->{tariff_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||
$response_out->{$bike}->{tariff_description}->{number} = "$tariff_content->{$tid}->{barcode}";
|
||||
$response_out->{$bike}->{tariff_description}->{eur_per_hour} = "$tariff_content->{$tid}->{int02}" || "0";
|
||||
$response_out->{$bike}->{tariff_description}->{max_eur_per_day} = "$tariff_content->{$tid}->{int17}" if($tariff_content->{$tid}->{int17});
|
||||
$response_out->{$bike}->{tariff_description}->{free_hours} = "$tariff_content->{$tid}->{int16}" if($tariff_content->{$tid}->{int16});
|
||||
$response_out->{$bike}->{tariff_description}->{abo_eur_per_month} = "$tariff_content->{$tid}->{int15}" if($tariff_content->{$tid}->{int15});
|
||||
|
||||
#new rental_description
|
||||
$response_out->{$bike}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||
$response_out->{$bike}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
||||
$response_out->{$bike}->{rental_description}->{reserve_timerange} = "30";
|
||||
$response_out->{$bike}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"];# if($resp->{gps_tracker_id});
|
||||
$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AAFahrten","Dieses E-Lastenrad darf nur an der Station zurück gegeben werden an der es ausgeliehen wurde!"] if($resp->{site}->{address} && $resp->{site}->{address} !~ /Passau/i);
|
||||
|
||||
my $i = 0;
|
||||
foreach my $td (sort keys (%$td_template)){
|
||||
|
|
|
@ -342,20 +342,17 @@ sub fetch_rentalfeed {
|
|||
if($ctpos->{int11}){
|
||||
($return->{gps}->{latitude},$return->{gps}->{longitude}) = split(/,/,$ctpos->{txt06});
|
||||
|
||||
#deprecated
|
||||
$return->{tariff_description}->{name} = "$ctpos->{txt04}";
|
||||
$return->{tariff_description}->{number} = "$ctpos->{int09}";
|
||||
$return->{tariff_description}->{eur_per_hour} = "$ctpos->{int02}" || "0";
|
||||
$return->{tariff_description}->{max_eur_per_day} = "$ctpos->{int17}" || "0";
|
||||
$return->{tariff_description}->{free_hours} = "$ctpos->{int16}" if($ctpos->{int16} && $ctpos->{int16} > 0);
|
||||
$return->{tariff_description}->{abo_eur_per_month} = "$ctpos->{int15}" if($ctpos->{int15} && $ctpos->{int15} > 0);
|
||||
|
||||
#new rental_description
|
||||
$return->{rental_description}->{name} = "$ctpos->{txt04}";
|
||||
$return->{rental_description}->{id} = "$ctpos->{int09}";
|
||||
$return->{rental_description}->{reserve_timerange} = "15";
|
||||
$return->{rental_description}->{reserve_timerange} = "30" if($ctpos->{int11} == 3);
|
||||
|
||||
$return->{aa_ride} = "0";
|
||||
if($ctpos->{int42}){
|
||||
$return->{rental_description}->{rental_info}->{2} = ["AAFahrten","Dieses E-Lastenrad darf nur an der Station zurück gegeben werden an der es ausgeliehen wurde!"];
|
||||
$return->{aa_ride} = "1";
|
||||
}
|
||||
|
||||
foreach my $td (sort keys (%$td_template)){
|
||||
my $time_unit = "";
|
||||
if($td_template->{$td}->{int35} && $ctpos->{int35} && $ctpos->{int35} > 0){
|
||||
|
|
Loading…
Add table
Reference in a new issue