Skip to content
Snippets Groups Projects
Commit 11d3aaf6 authored by Pegane Nestor's avatar Pegane Nestor
Browse files

FEAT #6256 check for user absence

parent 7c940c6b
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ while ($state <> 'END') {
$u=1;
while ($line2 = $stmt2->fetchObject()) {
//echo "_".$line2->group_id."\n";
$stmt3 = $db->query("select usergroup_content.user_id from usergroup_content,users WHERE group_id = '".$line2->group_id."' and users.status='OK' and usergroup_content.user_id=users.user_id");
$stmt3 = $db->query("select usergroup_content.user_id,users.status from usergroup_content,users WHERE group_id = '".$line2->group_id."' and usergroup_content.user_id=users.user_id");
$baskets_notif = array();
$logger->write("GROUP: " . $line2->group_id . " ... " . $stmt3->rowCount() . " user(s) to notify", 'INFO');
$z=1;
......@@ -73,7 +73,17 @@ while ($state <> 'END') {
);
$whereClause = $entities->process_where_clause(
$whereClause, $line3->user_id
);
);
$user_id =$line3->user_id;
if($line3->status == 'ABS'){
$query= "SELECT * FROM user_abs WHERE user_abs = ?";
$db2 = new Database();
$testStmt = $db2->query($query,array($line3->user_id));
$abs_user = $testStmt->fetchObject();
$user_id = $abs_user->new_user;
}
$stmt4 = $db->query("select * from res_view_letterbox ".$whereClause);
$logger->write($stmt4->rowCount() . " document(s) to process for ".$line3->user_id, 'INFO');
$i=1;
......@@ -85,7 +95,7 @@ while ($state <> 'END') {
# code...
}else{
$info = "Notification [".$line->basket_id."] pour ".$line3->user_id;
$stmt5 = $db->query("INSERT INTO notif_event_stack(table_name,notification_sid,record_id,user_id,event_info,event_date) VALUES('res_letterbox','500','".$line4->res_id."','".$line3->user_id."','".$info."',CURRENT_DATE)");
$stmt5 = $db->query("INSERT INTO notif_event_stack(table_name,notification_sid,record_id,user_id,event_info,event_date) VALUES('res_letterbox','500','".$line4->res_id."','".$user_id."','".$info."',CURRENT_DATE)");
preg_match_all( '#\[(\w+)]#', $info, $result );
$basket_id = $result[1];
if(!in_array($basket_id[0], $baskets_notif)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment