From d50c281ec5c8ac5d81dda75eb97ef9f1478a3cb0 Mon Sep 17 00:00:00 2001 From: churchtools Date: Wed, 1 Jul 2015 08:32:43 +0200 Subject: [PATCH] (CS) Fix absence displaying on start page --- system/churchservice/churchservice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/churchservice/churchservice.php b/system/churchservice/churchservice.php index 07da80c1..e73d5605 100644 --- a/system/churchservice/churchservice.php +++ b/system/churchservice/churchservice.php @@ -458,7 +458,7 @@ function churchservice_getAbsents($year = null) { FROM {cdb_person} p, {cs_absent} a, {cs_absent_reason} ar WHERE a.absent_reason_id=ar.id AND p.id=a.person_id AND p.id in (" . db_implode($allPersonIds) . ") "; - if ($year == null) $sql .= "AND DATEDIFF(a.enddate,NOW())>=-1 AND DATEDIFF(a.enddate,NOW())<=31"; + if ($year == null) $sql .= "AND DATEDIFF(a.startdate,NOW())>=-1 AND DATEDIFF(a.startdate,NOW())<=31"; else $sql .= "AND (DATE_FORMAT(a.startdate, '%Y')=$year OR DATE_FORMAT(a.enddate, '%Y')=$year)"; $sql .= " ORDER BY a.startdate";