mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-14 07:36:29 +02:00
grouping flots
This commit is contained in:
parent
b9af62e5fc
commit
036d4dcf50
10 changed files with 83 additions and 59 deletions
|
@ -579,7 +579,7 @@ sub service_update(){
|
|||
my $auth_op = $dbt->fetch_record($dbh_operator,$adref);
|
||||
|
||||
my $user_miniquest_count = $auth_op->{int23} || 0;
|
||||
#if($user_miniquest_count <= 3){
|
||||
if($user_miniquest_count <= 3){
|
||||
$user_miniquest_count++;
|
||||
my $update_op = {
|
||||
table => "contentadr",
|
||||
|
@ -587,7 +587,7 @@ sub service_update(){
|
|||
atime => "now()",
|
||||
};
|
||||
my $rows = $dbt->update_record($dbh_operator,$update_op,$auth_op);
|
||||
#}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1972,7 +1972,7 @@ sub bikes_available(){
|
|||
$return->{$id}->{rental_description}->{reserve_timerange} = "15";
|
||||
$return->{$id}->{rental_description}->{reserve_timerange} = "30" if($record->{$id}->{int11} == 3);#sig timeout time
|
||||
$return->{$id}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"] if($record->{$id}->{int25});
|
||||
$return->{$id}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($auth->{c_id} && ($auth->{c_id} == 1842 || $auth->{c_id} == 1843 || $auth->{c_id} == 5781 || $auth->{c_id} == 11765 || $auth->{c_id} == 38883));
|
||||
#$return->{$id}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($auth->{c_id} && ($auth->{c_id} == 1842 || $auth->{c_id} == 1843 || $auth->{c_id} == 5781 || $auth->{c_id} == 11765 || $auth->{c_id} == 38883));
|
||||
|
||||
my $i = 0;
|
||||
foreach my $td (sort keys (%$td_template)){
|
||||
|
@ -2108,15 +2108,18 @@ sub stations_available(){
|
|||
my $auth = shift || "";
|
||||
my $record_pos = shift || {};
|
||||
|
||||
#2022-07-12, int12 changed to bike type_id
|
||||
my $station_group = "";
|
||||
$station_group = $record_pos->{int29} if(ref($record_pos) eq "HASH" && $record_pos->{int29});
|
||||
my $aa_station = "";
|
||||
#station_group and bike_group alias bike nodes.type_id
|
||||
#my $station_group = "";
|
||||
#$station_group = $record_pos->{int29} if(ref($record_pos) eq "HASH" && $record_pos->{int29});
|
||||
|
||||
#station_bike_node and bike_node alias bike nodes.main_id
|
||||
my $station_bike_node = "";
|
||||
$station_bike_node = $record_pos->{int21} if(ref($record_pos) eq "HASH" && $record_pos->{int21});
|
||||
|
||||
#take start station from pos
|
||||
my $aa_station = "";
|
||||
$aa_station = $record_pos->{int06} if(ref($record_pos) eq "HASH" && $record_pos->{int06} && $record_pos->{int42});
|
||||
|
||||
#$bw->log("stations_available by station_group: $station_group",$record_pos,"");
|
||||
|
||||
my $authed = 0;
|
||||
$authed = 1 if(ref($auth) eq "HASH" && $auth->{c_id});
|
||||
my ($bike_group,$bike_node,$tariff_content,$user_tour) = $self->fetch_tariff($varenv->{dbname},$auth,$q->param('authcookie'));
|
||||
|
@ -2133,24 +2136,24 @@ sub stations_available(){
|
|||
#group_id must have 6 numbers like 300103
|
||||
my $pref_sql = "";
|
||||
$pref_sql .= " and (";
|
||||
foreach(@{$bike_group}){
|
||||
foreach(@{$bike_node}){
|
||||
#on rental end select only stations which are defined
|
||||
#A-A rental
|
||||
if($station_group && $_ =~ /(\d+)/ && $aa_station){
|
||||
my $group_id = $1;
|
||||
if($group_id == $station_group){
|
||||
if($station_bike_node && $_ =~ /(\d+)/ && $aa_station){
|
||||
my $node_id = $1;
|
||||
if($node_id == $station_bike_node){
|
||||
$pref_sql .= " ct.int04 = $aa_station OR";
|
||||
}
|
||||
#A-B rental
|
||||
}elsif($station_group && $_ =~ /(\d+)/){
|
||||
my $group_id = $1;
|
||||
if($group_id == $station_group){
|
||||
$pref_sql .= " ct.txt24 like '%$group_id%' OR";
|
||||
}elsif($station_bike_node && $_ =~ /(\d+)/){
|
||||
my $node_id = $1;
|
||||
if($node_id == $station_bike_node){
|
||||
$pref_sql .= " ct.txt24 like '%$node_id%' OR";
|
||||
}
|
||||
#without a rental
|
||||
}elsif($_ =~ /(\d+)/){
|
||||
my $group_id = $1;
|
||||
$pref_sql .= " ct.txt24 like '%$group_id%' OR";
|
||||
my $node_id = $1;
|
||||
$pref_sql .= " ct.txt24 like '%$node_id%' OR";
|
||||
}
|
||||
}
|
||||
$pref_sql =~ s/OR$//;
|
||||
|
@ -2158,7 +2161,7 @@ sub stations_available(){
|
|||
$pref_sql = "" if($pref_sql !~ /\d/);
|
||||
|
||||
my $record = {};
|
||||
$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_node) eq "ARRAY" && @{$bike_node}[0]);
|
||||
|
||||
my $op_return = {};
|
||||
foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){
|
||||
|
@ -2171,11 +2174,11 @@ sub stations_available(){
|
|||
#$return->{$id}->{description} = "$record->{$id}->{txt01}";
|
||||
$return->{$id}->{description} = Encode::encode('utf-8', Encode::decode('iso-8859-1', $record->{$id}->{txt01}));
|
||||
$return->{$id}->{state} = "$dbt->{copri_conf}->{bike_state}->{$record->{$id}->{int10}}";
|
||||
$return->{$id}->{gps_radius} = "$record->{$id}->{int06}";
|
||||
$return->{$id}->{station_group} = "";
|
||||
if($record->{$id}->{txt24}){
|
||||
$return->{$id}->{gps_radius} = "$record->{$id}->{int06}";
|
||||
$record->{$id}->{txt24} =~ s/(\d+)/$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$1/g;
|
||||
my @station_group = split(/\s/,$record->{$id}->{txt24});
|
||||
if($record->{$id}->{txt25}){
|
||||
$record->{$id}->{txt25} =~ s/(\d+)/$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$1/g;
|
||||
my @station_group = split(/\s/,$record->{$id}->{txt25});
|
||||
$return->{$id}->{station_group} = [@station_group];
|
||||
}
|
||||
|
||||
|
@ -2242,7 +2245,7 @@ sub stations_all(){
|
|||
|
||||
my $pref_sql = "";
|
||||
$pref_sql .= " and (";
|
||||
foreach(@{$bike_group}){
|
||||
foreach(@{$bike_node}){
|
||||
if($_ =~ /(\d+)/){
|
||||
$pref_sql .= " ct.txt24 like '%$1%' OR";
|
||||
}
|
||||
|
@ -2271,7 +2274,7 @@ sub stations_all(){
|
|||
}
|
||||
$pref_sql =~ s/OR$//;
|
||||
$pref_sql .= ")";
|
||||
$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
$record = $dbt->fetch_record($dbh,$pref,$pref_sql) if(ref($bike_node) eq "ARRAY" && @{$bike_node}[0]);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2319,10 +2322,10 @@ sub stations_all(){
|
|||
$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}){
|
||||
$return->{$id}->{gps_radius} = "$record->{$id}->{int06}";
|
||||
$record->{$id}->{txt24} =~ s/(\d+)/$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$1/g;
|
||||
my @station_group = split(/\s/,$record->{$id}->{txt24});
|
||||
$return->{$id}->{gps_radius} = "$record->{$id}->{int06}";
|
||||
if($record->{$id}->{txt25}){
|
||||
$record->{$id}->{txt25} =~ s/(\d+)/$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$1/g;
|
||||
my @station_group = split(/\s/,$record->{$id}->{txt25});
|
||||
$return->{$id}->{station_group} = [@station_group];
|
||||
}
|
||||
$op_return->{$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $id} = $return->{$id};
|
||||
|
|
|
@ -149,7 +149,8 @@ sub sig_available {
|
|||
$return2copri->{$station}->{int06} = $1 if($response_out->{$station}->{gps_radius} =~ /(\d+)/);
|
||||
$return2copri->{$station}->{txt01} = "$response_out->{$station}->{description}";
|
||||
$return2copri->{$station}->{txt06} = "$response_out->{$station}->{gps}->{latitude},$response_out->{$station}->{gps}->{longitude}";
|
||||
$return2copri->{$station}->{txt24} = "300101";#type_id
|
||||
$return2copri->{$station}->{txt24} = "300102";#node.main_id
|
||||
$return2copri->{$station}->{txt25} = "300101";#node_type_id
|
||||
while (my ($key, $value) = each %{ $dbt->{copri_conf}->{station_state} }) {
|
||||
if($response_out->{$station}->{state} eq $value){
|
||||
$return2copri->{$station}->{int10} = $key;
|
||||
|
@ -217,7 +218,7 @@ sub sig_available {
|
|||
$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!"];#TODO if($resp->{gps_tracker_id});
|
||||
$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($ctadr->{c_id} && ($ctadr->{c_id} == 1842 || $ctadr->{c_id} == 1843 || $ctadr->{c_id} == 5781 || $ctadr->{c_id} == 11765 || $ctadr->{c_id} == 38883));
|
||||
#$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AGB","Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt (als Demo sharee AGB)."] if($ctadr->{c_id} && ($ctadr->{c_id} == 1842 || $ctadr->{c_id} == 1843 || $ctadr->{c_id} == 5781 || $ctadr->{c_id} == 11765 || $ctadr->{c_id} == 38883));
|
||||
|
||||
my $i = 0;
|
||||
foreach my $td (sort keys (%$td_template)){
|
||||
|
|
|
@ -67,7 +67,6 @@ eval {
|
|||
#- int28=station_lock_state (station lock velofactur)
|
||||
#- int30=velofactur station ID
|
||||
#- int31=velofactur slot ID
|
||||
#- txt25=velofactur last station message (error or success)
|
||||
|
||||
my $jrout = $json->pretty->encode({ fakturjson => $response_in });
|
||||
print FILE "<=== JSON POST from velofactur:\n$jrout\n" if($debug);
|
||||
|
@ -105,7 +104,6 @@ eval {
|
|||
$update_cc->{int27} = $1 if($response_in->{Fahrzeug}->{Id} && $response_in->{Fahrzeug}->{Id} =~ /(\d+)/);
|
||||
$update_cc->{int30} = $1 if($response_in->{Station} && $response_in->{Station} =~ /(\d+)/);
|
||||
$update_cc->{int31} = $1 if($response_in->{Slot} && $response_in->{Slot} =~ /(\d+)/);
|
||||
$update_cc->{txt25} = $response_in->{Status} if($response_in->{Status});
|
||||
|
||||
#velofactur false|true boeelan
|
||||
#set bike_state to maintanance
|
||||
|
|
|
@ -172,6 +172,7 @@ sub save_contenttranspos {
|
|||
fetch => "one",
|
||||
template_id => "218",#Mietjournal tpl_id
|
||||
start_time => ">::$end_time",
|
||||
barcode => $ctpos->{barcode},
|
||||
"ct.close_time" => "is::null",
|
||||
};
|
||||
|
||||
|
|
|
@ -539,9 +539,32 @@ print ATTR "next: $next\n" if($debug);
|
|||
$valxx = $q->escapeHTML("@val");
|
||||
$u_rows += $db->updater("$table","c_id",$c_id,$_,$valxx,$users_dms->{u_id});
|
||||
}
|
||||
#txt24 bike_group/station_group multiple select
|
||||
#txt24 bike_node/station_group and txt25 bike_group multiple select
|
||||
elsif($tpl->{tpl_id} == 225 && $_ eq "txt24"){
|
||||
my @val = $q->param($_);
|
||||
my %station_filter_hash = ();
|
||||
my @_valxx_filter = ();
|
||||
my $node = { template_id => 205,#Leihrad_liste
|
||||
parent_id => 200013,#Waren
|
||||
fetch => "all",
|
||||
keyfield => "main_id",
|
||||
};
|
||||
my $bike_nodes = {};
|
||||
$bike_nodes = $dbt->fetch_rel4tpl4nd($dbh,$node);
|
||||
|
||||
foreach my $bike_node (@val){
|
||||
foreach my $rid ( keys (%$bike_nodes)){
|
||||
if($bike_node == $bike_nodes->{$rid}->{main_id} && $bike_nodes->{$rid}->{type_id}){
|
||||
$station_filter_hash{$bike_nodes->{$rid}->{type_id}} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $type_id (keys (%station_filter_hash)){
|
||||
push (@_valxx_filter, "$type_id");
|
||||
}
|
||||
|
||||
$db->updater("$table","c_id",$c_id,"txt25","@_valxx_filter",$users_dms->{u_id});
|
||||
$valxx = $q->escapeHTML("@val");
|
||||
$u_rows += $db->updater("$table","c_id",$c_id,$_,$valxx,$users_dms->{u_id});
|
||||
}
|
||||
|
|
|
@ -251,6 +251,7 @@ sub save_account(){
|
|||
#txt15=Bonus- oder Antragsnummer (falls vorhanden)=15
|
||||
#only check bonusnr and add operators dbname.
|
||||
#bonustarif will be set after operator insert
|
||||
#TODO, check bonusnr insert on sharee_kn Operator (Giese)
|
||||
elsif($_ eq "txt15"){
|
||||
#only done by App web iframe Anmelde-Registration formular
|
||||
print FILE "Bonusnr request $_: $valxx\n" if($debug);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue