Kaynağa Gözat

fixed tasks cache in Notify and turn on Notify

Piotr Labudda 10 yıl önce
ebeveyn
işleme
4fe66def53
2 değiştirilmiş dosya ile 6 ekleme ve 5 silme
  1. 2 2
      SE/se-lib/Route/Cron.php
  2. 4 3
      SE/se-lib/Route/Notify.php

+ 2 - 2
SE/se-lib/Route/Cron.php

@@ -139,8 +139,8 @@ class Route_Cron extends RouteBase {
 
 			foreach ($todoReminders as $who => $userReminders) {
 				echo "<p>Sending to {$who} reminders {" . json_encode($userReminders) . "}</p>" . "\n";
-				$notify->sendUserReminders($who, $userReminders, $forceMail = 'plabudda@biall-net.pl');// TEST
-				//$notify->sendUserReminders($who, $userReminders);
+				//$notify->sendUserReminders($who, $userReminders, $forceMail = 'plabudda@biall-net.pl');// TEST
+				$notify->sendUserReminders($who, $userReminders);
 				foreach ($userReminders as $when => $listWhat) {
 					if (!empty($listWhat)) {
 						// $reminders = array_keys($listWhat);

+ 4 - 3
SE/se-lib/Route/Notify.php

@@ -561,7 +561,8 @@ function refreshPreview() {
 
 	public function getPrzypomnijTasks($usrLogin) {
 		static $_tasks = array();
-		if (empty($_tasks)) {
+		if (empty($_tasks[$usrLogin])) {
+			$_tasks[$usrLogin] = array();
 			$przypomnij = new Przypomnij();
 			$przypomnij->setRecurseLimit(3);
 			$przypomnij->fetchData($usrLogin);
@@ -591,10 +592,10 @@ function refreshPreview() {
 				$task->_l_app_class = $przypomnij->getTaskDateFltrType($task->_l_app_date);
 				$task->_idZasobTable = $przypomnij->getZasobIdByType($task->_task_type);
 
-				$_tasks[] = (array)$task;
+				$_tasks[$usrLogin][] = (array)$task;
 			}
 		}
-		return $_tasks;
+		return $_tasks[$usrLogin];
 	}
 
 	public function removeUserTableReminder($args) {