cga...@users.adullact.net
unread,Jun 17, 2024, 8:30:20 AM (9 days ago) Jun 17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openmairi...@googlegroups.com
Author: cgarcin
Date: 2024-06-17 14:30:18 +0200 (Mon, 17 Jun 2024)
New Revision: 17944
Modified:
branches/module_notif_auto/obj/instruction.class.php
Log:
fix : suivi des notifications de demandeurs visible sans notifications existantes
Modified: branches/module_notif_auto/obj/instruction.class.php
===================================================================
--- branches/module_notif_auto/obj/instruction.class.php 2024-06-17 12:22:47 UTC (rev 17943)
+++ branches/module_notif_auto/obj/instruction.class.php 2024-06-17 12:30:18 UTC (rev 17944)
@@ -11006,6 +11006,7 @@
*/
public function get_instruction_notification($id_instruction, $typeNotification = null, $nonLieTache = false) {
$whereTypeTache = '';
+ $whereTaskNull = '';
$sqlTaskNull = 'INNER';
// Défini si on veux que la requête récupère également les notifications qui n'ont pas
// de tâches associées. C'est le cas pour les notifications de demandeurs lorsque la
@@ -11013,17 +11014,20 @@
// paramétrage
if(is_bool($nonLieTache) && $nonLieTache === true) {
$sqlTaskNull = 'LEFT';
+ $whereTaskNull = 'task.task IS NULL OR';
}
if ($typeNotification != null) {
if (is_array($typeNotification)) {
$whereTypeTache = sprintf(
- 'AND (task.type IN (%1$s))',
- "'".implode("', '", $typeNotification)."'"
+ 'AND (%2$s task.type IN (%1$s))',
+ "'".implode("', '", $typeNotification)."'",
+ $whereTaskNull
);
} else {
$whereTypeTache = sprintf(
- 'AND (task.type = \'%1$s\')',
- $typeNotification
+ 'AND (%2$s task.type = \'%1$s\')',
+ $typeNotification,
+ $whereTaskNull
);
}
}
@@ -11036,9 +11040,9 @@
%1$sinstruction_notification
%4$s JOIN %1$stask
ON instruction_notification.instruction_notification::CHARACTER VARYING = task.object_id
- %3$s
WHERE
- instruction = %2$s',
+ instruction = %2$s
+ %3$s',
DB_PREFIXE,
intval($id_instruction),
$whereTypeTache,