mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-23 04:06:27 +01:00
sig feedback counter select fix
This commit is contained in:
parent
8bcc46416c
commit
39e3a0568e
3 changed files with 20 additions and 25 deletions
|
@ -565,7 +565,7 @@ sub service_update(){
|
||||||
my $update_pos = {
|
my $update_pos = {
|
||||||
table => "contenttranspos",
|
table => "contenttranspos",
|
||||||
mtime => "now()",
|
mtime => "now()",
|
||||||
int28 => "null",
|
int28 => "1",
|
||||||
};
|
};
|
||||||
$dbt->update_record($dbh,$update_pos,$ctpos);
|
$dbt->update_record($dbh,$update_pos,$ctpos);
|
||||||
|
|
||||||
|
@ -1572,7 +1572,7 @@ sub booking_update(){
|
||||||
|
|
||||||
#user_miniquest_count
|
#user_miniquest_count
|
||||||
my $user_miniquest_count = $auth->{int23} || 0;
|
my $user_miniquest_count = $auth->{int23} || 0;
|
||||||
if($user_miniquest_count <= 4){
|
if($user_miniquest_count <= 3){
|
||||||
$user_miniquest_count++;
|
$user_miniquest_count++;
|
||||||
my $update_op = {
|
my $update_op = {
|
||||||
table => "contentadr",
|
table => "contentadr",
|
||||||
|
@ -1731,7 +1731,7 @@ sub user_bikes_occupied(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $q = shift;
|
my $q = shift;
|
||||||
my $auth = shift;
|
my $auth = shift;
|
||||||
#my $station_lock_state = shift || "";
|
my $show_dialog = shift || "";
|
||||||
|
|
||||||
my $pref = {
|
my $pref = {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
|
@ -1745,10 +1745,9 @@ sub user_bikes_occupied(){
|
||||||
"ct.close_time" => "is::null",
|
"ct.close_time" => "is::null",
|
||||||
};
|
};
|
||||||
|
|
||||||
#station_lock_stat enables a OR condition to view available as requested/occupied
|
##selects also int28 > 0 bikes to view once miniquery
|
||||||
##selects also station_lock_state=locking bikes to view once miniquery
|
#it will only defined on booking_request, because there must be available
|
||||||
#true if not defined! it will only defined on booking_request, because there must be available
|
$pref->{show_dialog} = "1" if($show_dialog);
|
||||||
#$pref->{station_lock_state} = "3" if(!$station_lock_state);
|
|
||||||
my $record = $dbt->collect_post($dbh,$pref);
|
my $record = $dbt->collect_post($dbh,$pref);
|
||||||
return $record;
|
return $record;
|
||||||
}#end user_bikes_occupied
|
}#end user_bikes_occupied
|
||||||
|
@ -1794,7 +1793,7 @@ sub rentals(){
|
||||||
|
|
||||||
if($record->{$id}->{int28}){
|
if($record->{$id}->{int28}){
|
||||||
|
|
||||||
$return->{$id}->{state} = "returned";
|
#$return->{$id}->{state} = "returned";
|
||||||
#only for project=Bayern and developer enabled
|
#only for project=Bayern and developer enabled
|
||||||
if($dbt->{operator}->{$varenv{dbname}}->{project} eq "Bayern" && $auth->{int23} < 4){
|
if($dbt->{operator}->{$varenv{dbname}}->{project} eq "Bayern" && $auth->{int23} < 4){
|
||||||
|
|
||||||
|
|
|
@ -209,9 +209,7 @@ elsif($q->param('request') eq "booking_request"){
|
||||||
$bike_id = $1 if($bike_id =~ /(\d+)/);
|
$bike_id = $1 if($bike_id =~ /(\d+)/);
|
||||||
|
|
||||||
#check count of occcupied/requested bikes
|
#check count of occcupied/requested bikes
|
||||||
#"station_lock_state" disables a OR condition to view available as requested/occupied
|
my $record = $apif->user_bikes_occupied($q,$authraw,"");
|
||||||
#my $record = $apif->user_bikes_occupied($q,$authraw,"station_lock_state");
|
|
||||||
my $record = $apif->user_bikes_occupied($q,$authraw);
|
|
||||||
my $count=0;
|
my $count=0;
|
||||||
my $still_requested = 0;
|
my $still_requested = 0;
|
||||||
foreach my $id (keys(%$record)){
|
foreach my $id (keys(%$record)){
|
||||||
|
@ -308,9 +306,7 @@ elsif($q->param('request') eq "booking_request"){
|
||||||
}
|
}
|
||||||
|
|
||||||
#return list of occupied/requested bikes
|
#return list of occupied/requested bikes
|
||||||
#"station_lock_state" disables a OR condition to view available as requested/occupied
|
$record = $apif->user_bikes_occupied($q,$authraw,"");
|
||||||
#$record = $apif->user_bikes_occupied($q,$authraw,"station_lock_state");
|
|
||||||
$record = $apif->user_bikes_occupied($q,$authraw);
|
|
||||||
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");#returns JSON rental values
|
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");#returns JSON rental values
|
||||||
|
|
||||||
}#end still_requested
|
}#end still_requested
|
||||||
|
@ -390,16 +386,19 @@ elsif($q->param('request') eq "booking_cancel" || $q->param('request') eq "booki
|
||||||
($rows, $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner,$sig_book);
|
($rows, $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner,$sig_book);
|
||||||
$response = {%$response, %$booking_values};
|
$response = {%$response, %$booking_values};
|
||||||
|
|
||||||
|
my $record = $apif->user_bikes_occupied($q,$authraw,"show_dialog");
|
||||||
|
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");
|
||||||
|
|
||||||
#update on Ilockit
|
#update on Ilockit
|
||||||
}else{
|
}else{
|
||||||
($rows, $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner,$sig_book);
|
($rows, $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner,$sig_book);
|
||||||
$response = {%$response, %$booking_values};
|
$response = {%$response, %$booking_values};
|
||||||
|
|
||||||
|
my $record = $apif->user_bikes_occupied($q,$authraw,"");
|
||||||
|
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");
|
||||||
}
|
}
|
||||||
}#end occupied|available
|
}#end occupied|available
|
||||||
|
|
||||||
my $record = $apif->user_bikes_occupied($q,$authraw);
|
|
||||||
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$response->{response_state} = "Failure: no bike defined";
|
$response->{response_state} = "Failure: no bike defined";
|
||||||
$response->{response_text} = "Abbruch, es wurde keine Fahrrad Nummer angegeben";
|
$response->{response_text} = "Abbruch, es wurde keine Fahrrad Nummer angegeben";
|
||||||
|
@ -431,7 +430,7 @@ elsif($q->param('request') eq "user_bikes_occupied"){
|
||||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||||
if(ref($auth) eq "HASH" && $auth->{authcookie}){
|
if(ref($auth) eq "HASH" && $auth->{authcookie}){
|
||||||
$response = { %$response, %$auth };
|
$response = { %$response, %$auth };
|
||||||
my $record = $apif->user_bikes_occupied($q,$authraw);
|
my $record = $apif->user_bikes_occupied($q,$authraw,"show_dialog");
|
||||||
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");
|
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");
|
||||||
}else{
|
}else{
|
||||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||||
|
|
|
@ -625,13 +625,10 @@ sub collect_post(){
|
||||||
}elsif($key =~ /^(c_id|ca_id|ct_id|owner|barcode|int\d+)$/ && $value){
|
}elsif($key =~ /^(c_id|ca_id|ct_id|owner|barcode|int\d+)$/ && $value){
|
||||||
$cp_where .= " and cp.$key $op $value";
|
$cp_where .= " and cp.$key $op $value";
|
||||||
}
|
}
|
||||||
#}elsif($key eq "int10" && $value eq "('3','2')" && $fetch->{station_lock_state}){
|
}
|
||||||
#$cp_where .= " and (cp.$key $op $value OR cp.int28 = 3)";
|
#selects also push event=RENTAL_END station_lock_state bikes to view feedback and miniquery
|
||||||
}elsif($key eq "int10" && $value eq "('3','2')"){
|
elsif($key eq "int10" && $value eq "('3','2')" && $fetch->{show_dialog}){
|
||||||
#selects also push event=RENTAL_END station_lock_state bikes to view miniquery
|
$cp_where .= " and (cp.$key $op $value OR cp.int28 = 3)";#select only if no dialog saved
|
||||||
#that means in bikes_occupied context, that also rentals with int28>0
|
|
||||||
#keep in mind: OR!!!-)
|
|
||||||
$cp_where .= " and (cp.$key $op $value OR cp.int28 > 0)";
|
|
||||||
}elsif($key =~ /^(c_id|ca_id|ct_id|owner|barcode|int\d+)$/ && $value){
|
}elsif($key =~ /^(c_id|ca_id|ct_id|owner|barcode|int\d+)$/ && $value){
|
||||||
$cp_where .= " and cp.$key $op $value";
|
$cp_where .= " and cp.$key $op $value";
|
||||||
}elsif($fetch->{catch} && $key eq "template_id" && $value){
|
}elsif($fetch->{catch} && $key eq "template_id" && $value){
|
||||||
|
|
Loading…
Add table
Reference in a new issue