miniquest count

This commit is contained in:
ragu 2022-07-15 19:03:07 +02:00
parent f02158998f
commit fd6ddfef8c
2 changed files with 28 additions and 17 deletions

View file

@ -570,23 +570,23 @@ sub service_update(){
$dbt->update_record($dbh_operator,$update_pos,$post_record) if($post_record->{c_id});
#user_miniquest_count on operator
my $adref = {
table => "contentadr",
fetch => "one",
template_id => "202",
c_id => "$auth->{c_id}",
};
my $auth_op = $dbt->fetch_record($dbh_operator,$adref);
#my $adref = {
# table => "contentadr",
# fetch => "one",
# template_id => "202",
# c_id => "$auth->{c_id}",
# };
#my $auth_op = $dbt->fetch_record($dbh_operator,$adref);
my $user_miniquest_count = $auth_op->{int23} || 0;
my $user_miniquest_count = $auth->{int23} || 0;
if($user_miniquest_count <= 3){
$user_miniquest_count++;
my $update_op = {
my $update23 = {
table => "contentadr",
int23 => $user_miniquest_count,
atime => "now()",
};
my $rows = $dbt->update_record($dbh_operator,$update_op,$auth_op);
my $rows = $dbt->update_record($dbh,$update23,$auth);
}
}
}
@ -1584,22 +1584,33 @@ sub booking_update(){
#keep in mind, it works on operator dependency
#only for project=Bayern and developer enabled
#redundant code in APIfunc sub rentals for sig user_miniquery
if($booking->{int10} == 1 && $dbt->{operator}->{$varenv{dbname}}->{project} eq "Bayern" && $auth->{int23} < 4){
#TODO $auth int23 seems primary
my $dbh_primary = $dbt->dbconnect_extern("sharee_primary");
#user_miniquest_count on operator
my $adref = {
table => "contentadr",
fetch => "one",
template_id => "202",
c_id => "$auth->{c_id}",
};
my $auth_prim = $dbt->fetch_record($dbh_primary,$adref);
if($booking->{int10} == 1 && $dbt->{operator}->{$varenv{dbname}}->{project} eq "Bayern" && $auth_prim->{int23} < 4){
$bw->log("user_miniquery via $varenv{dbname} user ID $auth->{c_id} exist count:",$auth->{int23},"");
$bw->log("user_miniquery user ID $auth_prim->{c_id} exist count:",$auth_prim->{int23},"");
$booking_values->{user_miniquery} = $dbt->evaluationsfragen($dbh);
#user_miniquest_count
my $user_miniquest_count = $auth->{int23} || 0;
my $user_miniquest_count = $auth_prim->{int23} || 0;
if($user_miniquest_count <= 3){
$user_miniquest_count++;
my $update_op = {
my $update23 = {
table => "contentadr",
int23 => $user_miniquest_count,
atime => "now()",
};
$rows = $dbt->update_record($dbh,$update_op,$auth);
$rows = $dbt->update_record($dbh,$update23,$auth_prim);
}
}#end mini_quest

View file

@ -42,11 +42,11 @@ sub tpl(){
if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $dbt->{copri_conf}->{stage} eq "test" || $users_sharee->{txt08} eq "sigo\@sharee.bike")){
my $coo = $q->cookie('domcookie') || $q->param('sessionid') || "";
my $api_test = "sharee_fr01"; my $bike="FR1538";
# my $api_test = "sharee_fr01"; my $bike="FR1538";
#my $api_test = "sharee_fr01"; my $bike="FR4781";#Tracking and BVB test
#my $api_test = "sharee_kn"; my $bike="KN205";
#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";