Add constant for path to tasks files
[SonOfLokstallBot.git] / src / purjolok.php
index 94cc011..e66f830 100644 (file)
@@ -17,7 +17,7 @@ $message = getTelegram()->getWebHookUpdates()->get('message') ? getTelegram()->g
 
 if ($between = between(reveal($message ?? ''), '[taskid]')) {
     $monday = turnBackTime(new DateTimeImmutable);
-    $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum);
+    $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum, PATH_TO_TASKS_FILES);
     $completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : [];
     $tasksForTheWeek = getTasksForTheWeek(
         $monday->year,
@@ -233,7 +233,7 @@ getTelegram()->addCommand(
                 require 'taskMatrix.php'
             );
 
-            $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum);
+            $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum, PATH_TO_TASKS_FILES);
             $completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : [];
 
             if (!array_diff($tasksForTheWeek, $completedTasks)) {
@@ -267,7 +267,7 @@ getTelegram()->addCommand(
                 require 'taskMatrix.php'
             );
 
-            $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum);
+            $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum, PATH_TO_TASKS_FILES);
             $completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : [];
 
             if (!array_diff($tasksForTheWeek, $completedTasks)) {