getFilterDatesInterval((string) $filters['dates'], $local = true, $sql = false); if ($fromDt && $toDt) { $fromYmd = date('Y-m-01', strtotime($fromDt)); $toYmd = date('Y-m-t', strtotime($toDt)); } } // build the pool of month tasks $monthTasks = []; if ($areaIds) { // save current filters in the user state JFactory::getApplication()->setUserState('vbo.tm.filters', $filters); // load tasks according to filters, by always forcing/injecting the area IDs and the dates foreach (VBOTaskModelTask::getInstance()->filterItems(array_merge($filters, ['id_areas' => $areaIds, 'dates' => $fromYmd . ':' . $toYmd]), 0, 0) as $taskRecord) { // wrap task record into a registry $task = VBOTaskTaskregistry::getInstance((array) $taskRecord); // get task due date in Y-m-d format $due_date_key = $task->getDueDate($local = true, $format = 'Y-m-d'); if ($due_date_key) { // start a container for this date $monthTasks[$due_date_key] = $monthTasks[$due_date_key] ?? []; // push task registry for this day $monthTasks[$due_date_key][] = $task; } } } // obtain the current month information $monthDate = getdate(strtotime($fromYmd)); $monthIter = $monthDate; // get navigation dates $todayYmd = date('Y-m-d'); $monthBack = date('Y-m-01', strtotime('-1 month', $monthDate[0])); $monthNext = date('Y-m-01', strtotime('+1 month', $monthDate[0])); $monthToday = date('Y-m-01'); // build week-day indexes $firstwday = (int) VikBooking::getFirstWeekDay(); $days_indexes = []; $wday_labels = [ JText::translate('VBSUN'), JText::translate('VBMON'), JText::translate('VBTUE'), JText::translate('VBWED'), JText::translate('VBTHU'), JText::translate('VBFRI'), JText::translate('VBSAT'), ]; for ($d = 0; $d < 7; $d++) { $days_indexes[$d] = (6-($firstwday-$d)+1)%7; } ?>
6) { // week is over, reset counter and start a new row $d_count = 0; echo '
' . "\n" . '
' . "\n"; } // build date key $date_key = date('Y-m-d', $monthIter[0]); ?>
$task) { // get task status $statusColor = ''; $statusName = ''; if ($taskManager->statusTypeExists($task->getStatus())) { $status = $taskManager->getStatusTypeInstance($task->getStatus()); $statusColor = $status->getColor(); $statusName = $status->getName(); } // get task due time $dueTime = $task->getDueDate($local = true, $format = 'H:i:s'); // get task assignee details $assignees = $task->getAssigneeDetails(); ?>
getTitle(); ?> get('hasUnreadMessages', false)): ?>
<?php echo JHtml::fetch('esc_attr', $operator['initials']); ?>
1 && $exceeding = (count($monthTasks[$date_key]) - ++$taskIndex)) { // we display at most 3 tasks per day ?>
1 ? JText::translate('VBO_TASKS') : JText::translate('VBO_TASK'))); ?>