operator data fix

This commit is contained in:
ragu 2024-10-10 19:13:06 +02:00
parent b9b63c63e5
commit 148d4bbd48
3 changed files with 17 additions and 11 deletions

View file

@ -1062,7 +1062,9 @@ sub booking_request {
$response_state = "Failure 4260, reserv timerange";
$response_text = "Abbruch, die Mietzeit liegt in der Vergangenheit";
}
}else{
}
#on adhock check if bike available
elsif($ct_bike->{int10} == 1){
my $adjust_freedtime = 0;
my $further_freedtime_available = 1;
my ($cttpos,$operator_hash) = $self->user_rentals_history($q,$auth,1,0);
@ -2531,7 +2533,7 @@ sub stations_available {
fetch => "all",
keyfield => "barcode",
template_id => "205",
int10 => "1",
#int10 => "1",
};
my $record_bikes = {};
$record_bikes = $dbt->fetch_record($dbh,$bpref,"");
@ -2566,7 +2568,7 @@ sub stations_available {
foreach my $b_id (keys (%$record_bikes)){
if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){
push @bike_ids,$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $record_bikes->{$b_id}->{barcode};
$bike_count++;
$bike_count++ if($record->{$id}->{int10} == 1 && !$record->{$id}->{archive});
if($record_bikes->{$b_id}->{fleed_phone} && $record_bikes->{$b_id}->{fleed_email}){
$fleed = {
name => "$record_bikes->{$b_id}->{fleed_name}",
@ -2607,7 +2609,7 @@ sub stations_available {
my $bike_count2 = 0;
foreach my $b_id (keys (%$record_bikes)){
if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){
$bike_count2++ if($_ == $record_bikes->{$b_id}->{type_id});
$bike_count2++ if($_ == $record_bikes->{$b_id}->{type_id} && $record_bikes->{$b_id}->{int10} == 1 && !$record_bikes->{$b_id}->{archive});
}
}
$return->{$id}->{station_type}->{$dbt->{copri_conf}->{type_id}->{$_}}->{bike_count} = "$bike_count2";
@ -3194,6 +3196,7 @@ sub auth_verify {
open(FILE,">>$varenv{logdir}/authcookie.log") if($debug);
print FILE "\n*-->$now_dt $netloc | $varenv{dbname} | $cgi_authcookie\n" if($debug);
my $auth_primary = { c_id => 0 };
if($cgi_authcookie && length($cgi_authcookie) > 30){
my $authref = {
table => "contentadr",
@ -3201,7 +3204,6 @@ sub auth_verify {
template_id => "202",
txt05 => "like::" . "%" . $q->escapeHTML($cgi_authcookie) . "%",
};
my $auth_primary = { c_id => 0 };
my $auth_operator = { c_id => 0 };
$auth_operator = $dbt->fetch_record($dbh,$authref);
$record = $auth_operator;
@ -3383,8 +3385,8 @@ sub auth_verify {
$return->{agb_checked} = "0";
$return->{agb_checked} = "1" if($record->{int14});#sharee AGB global
my $last_used_operator = $record->{txt19};#check if this is primary and/or useable
#$bw->log("last_used_operator selected by txt19:",$last_used_operator,"");
my $last_used_operator = $auth_primary->{txt19} || "";
$bw->log("last_used_operator selected by txt19:",$last_used_operator,"");
if($last_used_operator){
my $dbh_operator = $dbt->dbconnect_extern("$last_used_operator","");
my $hotline_hash = {
@ -3393,7 +3395,8 @@ sub auth_verify {
template_id => 197,
c_id => "1",
};
my $hotline_data = $dbt->fetch_record($dbh_operator,$hotline_hash);
my $hotline_data = {};
$hotline_data = $dbt->fetch_record($dbh_operator,$hotline_hash);
$return->{last_used_operator} = {
"operator_name" => "",