mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-09 21:46:34 +02:00
decription encoding on request
This commit is contained in:
parent
c67234d2de
commit
58bc4ae931
6 changed files with 32 additions and 20 deletions
|
@ -1948,8 +1948,11 @@ sub bikes_available(){
|
|||
$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}";
|
||||
#$return->{$id}->{description} = "$record->{$id}->{txt01}";
|
||||
$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01}));
|
||||
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
$return->{$id}->{description} = "$description";
|
||||
#$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $description));
|
||||
|
||||
$return->{$id}->{state} = "$dbt->{copri_conf}->{bike_state}->{$record->{$id}->{int10}}";
|
||||
$return->{$id}->{lock_state} = "$dbt->{copri_conf}->{lock_state}->{$record->{$id}->{int20}}";
|
||||
|
||||
|
@ -2113,8 +2116,11 @@ sub bikes_all(){
|
|||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
$return->{$id}->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{barcode}";
|
||||
#$return->{$id}->{description} = "$record->{$id}->{txt01}";
|
||||
$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01}));
|
||||
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
$return->{$id}->{description} = "$description";
|
||||
#$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $description));
|
||||
|
||||
|
||||
$return->{$id}->{state} = "$dbt->{copri_conf}->{bike_state}->{$record->{$id}->{int10}}";
|
||||
$return->{$id}->{service_state} = "0";
|
||||
|
@ -2285,8 +2291,10 @@ sub stations_available(){
|
|||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
#$return->{$id}->{description} = "$record->{$id}->{txt01}";
|
||||
$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01}));
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
$return->{$id}->{description} = "$description";
|
||||
#$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $description));
|
||||
|
||||
$return->{$id}->{state} = "$dbt->{copri_conf}->{bike_state}->{$record->{$id}->{int10}}";
|
||||
$return->{$id}->{gps_radius} = "$record->{$id}->{int06}";
|
||||
$return->{$id}->{station_group} = "";
|
||||
|
@ -2418,9 +2426,10 @@ sub stations_all(){
|
|||
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
if($return->{$id}->{description}){
|
||||
#$return->{$id}->{description} = "$record->{$id}->{txt01}";
|
||||
$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01}));
|
||||
if($record->{$id}->{description}){
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
$return->{$id}->{description} = "$description";
|
||||
#$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $description));
|
||||
}else{
|
||||
$return->{$id}->{description} = "---";
|
||||
}
|
||||
|
|
|
@ -148,7 +148,9 @@ sub fetch_operator_json {
|
|||
my $res = $ua->request($req);
|
||||
if ($res->is_success) {
|
||||
#print $res->content;
|
||||
return $res->content;
|
||||
#return $res->content;
|
||||
my $encoded = Encode::encode('utf-8', Encode::decode('iso-8859-1',$res->content));
|
||||
return $encoded;
|
||||
}else {
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -465,12 +465,12 @@ elsif($q->param('request') eq "bikes_available"){
|
|||
$response = { %$response, %$auth };
|
||||
$bw->log("Y bikes_available by c_id $authraw->{c_id}, Tarif:",$authraw->{txt30},"");
|
||||
|
||||
#sig first save
|
||||
if($varenv{syshost} eq "shareeapp-sx"){
|
||||
($response->{bikes},my $return2copri->{bikes}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
(my $response_bikes_disabled,my $return2copri->{bikes}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
$tk->sigbike_cupdate($return2copri->{bikes});
|
||||
}else{
|
||||
$response->{bikes} = $apif->bikes_available($q,\%varenv,$authraw);
|
||||
}
|
||||
$response->{bikes} = $apif->bikes_available($q,\%varenv,$authraw);
|
||||
}
|
||||
if(ref($response->{bikes}) ne "HASH"){
|
||||
$response->{response_state} = "Failure 5003: cannot find any user defined bike tariff";
|
||||
|
@ -672,12 +672,13 @@ elsif($q->param('request') eq "stations_available"){
|
|||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
$response = { %$response, %$auth };
|
||||
|
||||
#sig first save
|
||||
if($varenv{syshost} eq "shareeapp-sx"){
|
||||
($response->{stations},my $return2copri->{stations}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
(my $response_stations_disabled,my $return2copri->{stations}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
$tk->sigstation_cupdate($return2copri->{stations});
|
||||
}else{
|
||||
($response->{stations}, my $response_raw) = $apif->stations_available($q,\%varenv,$authraw,"");
|
||||
}
|
||||
($response->{stations}, my $response_raw) = $apif->stations_available($q,\%varenv,$authraw,"");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ sub sig_available {
|
|||
#FIXME charset encoding
|
||||
$response_out->{$station}->{description} = "";
|
||||
#$response_out->{$station}->{description} = "$resp->{site}->{address}" || "";
|
||||
#$response_out->{$station}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1',$resp->{site}->{address})) || "";
|
||||
$response_out->{$station}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1',$resp->{site}->{address})) || "";
|
||||
$response_out->{$station}->{station_group} = ["SX300101"];#Lastenrad alias type_id
|
||||
$response_out->{$station}->{gps}->{latitude} = "$resp->{site}->{lat}" || "";
|
||||
$response_out->{$station}->{gps}->{longitude} = "$resp->{site}->{lon}" || "";
|
||||
|
|
|
@ -279,7 +279,7 @@ EOF
|
|||
$kind_of_payment = "$_paymentstate[1]" if($ctadr->{int03} == 2);
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdescr'},"Payone Zahlungsart"),"\n";
|
||||
print $q->td({-class=>'tdval'},"$kind_of_payment"),"\n";
|
||||
print $q->td({-class=>'tdval'},"$kind_of_payment | aus Kunden Stammdaten"),"\n";
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdescr'},"Payone TXID"),"\n";
|
||||
print $q->td({-class=>'tdval'},"$ctt->{txt16}"),"\n";
|
||||
|
|
|
@ -45,9 +45,9 @@ sub tpl(){
|
|||
#my $api_test = "sharee_fr01"; my $bike="FR1538";
|
||||
#my $api_test = "sharee_fr01"; my $bike="FR1005";#E-Lastenrad (bike_group=300101, bike_node=300102)
|
||||
#my $api_test = "sharee_fr01"; my $bike="FR4781";#Tracking and BVB test
|
||||
my $api_test = "sharee_kn"; my $bike="KN1011";
|
||||
#my $api_test = "sharee_kn"; my $bike="KN1011";
|
||||
#my $api_test = "sharee_wue"; my $bike="WUE5525";
|
||||
#my $api_test = "sharee_sx"; my $bike="S3X1001";
|
||||
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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue