mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
servicetool station 0 fix
This commit is contained in:
parent
d134aec3ca
commit
f95f503bf6
1 changed files with 21 additions and 14 deletions
|
@ -71,8 +71,10 @@ sub fetch_merchant {
|
|||
$return->{project_id} = $value->{project};
|
||||
my $lat = "";
|
||||
my $lng = "";
|
||||
$value->{initMap} =~ s/\s//g;
|
||||
($lat,$lng) = split(/,/,$value->{initMap}) if($value->{initMap} && $value->{initMap} =~ /\d+,\d+/);
|
||||
if($value->{initMap}){
|
||||
$value->{initMap} =~ s/\s//g;
|
||||
($lat,$lng) = split(/,/,$value->{initMap}) if($value->{initMap} && $value->{initMap} =~ /\d+,\d+/);
|
||||
}
|
||||
if($lat && $lng){
|
||||
$return->{init_map}->{center}->{latitude} = $lat;
|
||||
$return->{init_map}->{center}->{longitude} = $lng;
|
||||
|
@ -1540,8 +1542,8 @@ sub bikes_all(){
|
|||
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+)/);
|
||||
$pref = { %$pref, int04 => "=::" . $q->escapeHTML($station_id) } if(looks_like_number($station_id));
|
||||
$pref = { %$pref, barcode => "=::" . $q->escapeHTML($bike_id) } if(looks_like_number($bike_id));
|
||||
$pref->{int04} = "=::$station_id" if(looks_like_number($station_id));
|
||||
$pref->{ barcode} = "=::$bike_id" if(looks_like_number($bike_id));
|
||||
|
||||
my $record = {};
|
||||
#on servicetool only stations on user_tour
|
||||
|
@ -1562,9 +1564,10 @@ sub bikes_all(){
|
|||
$bw->log("sub bikes_all with user_tour",$pref,"");
|
||||
}
|
||||
$record = $dbt->fetch_record($dbh,$pref) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
}else{
|
||||
$bw->log("sub bikes_all",$pref,"");
|
||||
$record = $dbt->fetch_record($dbh,$pref) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
#bikes_all only if authenticated
|
||||
#}else{
|
||||
# $bw->log("sub bikes_all",$pref,"");
|
||||
# $record = $dbt->fetch_record($dbh,$pref) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1732,9 +1735,9 @@ sub stations_all(){
|
|||
$station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/);
|
||||
$work_val_id = $1 if($q->param('work_val') && $q->param('work_val') =~ /(\d+)/);
|
||||
if(looks_like_number($station_id)){
|
||||
$pref->{int04} = $station_id;
|
||||
$pref->{int04} = "=::$station_id";
|
||||
}elsif($q->param('work_id') && $q->param('work_id') eq "int04" && $work_val_id){
|
||||
$pref->{int04} = $work_val_id;
|
||||
$pref->{int04} = "=::$work_val_id";
|
||||
}
|
||||
#if not shareetool then only available stations
|
||||
$pref->{int10} = 1 if(!$q->param('authcookie') || !$varenv->{merchant_id} || !$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} || $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} != 187);
|
||||
|
@ -1767,8 +1770,9 @@ sub stations_all(){
|
|||
$pref_sql .= ")";
|
||||
$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
}
|
||||
}else{
|
||||
$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
#stations_all only if authenticated
|
||||
#}else{
|
||||
#$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1791,10 +1795,13 @@ sub stations_all(){
|
|||
}
|
||||
$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}));
|
||||
if($return->{$id}->{description}){
|
||||
$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01}));
|
||||
}else{
|
||||
$return->{$id}->{description} = "---";
|
||||
}
|
||||
$return->{$id}->{state} = "$dbt->{copri_conf}->{bike_state}->{$record->{$id}->{int10}}";
|
||||
$return->{$id}->{bike_soll} = "$bike_soll";
|
||||
$return->{$id}->{bike_soll} = "$bike_soll" || "0";
|
||||
$return->{$id}->{bike_ist} = "$bikes_on_station->{$id}->{bike_ist}" || "0";
|
||||
$return->{$id}->{station_group} = "";
|
||||
if($record->{$id}->{txt24}){#sharee Ilockit with new station_group logic
|
||||
|
|
Loading…
Add table
Reference in a new issue