The Todo System uses two different date management systems:
DateTime::Format::ISO8601: This is used for handling dates in the ISO 8601 format, which is an international standard for date and time representations. We use this for the day and future calendar functionalities.
DateTime::Format::Strptime: This provides more flexibility in terms of the date and time formats it can handle. We use this for calculating the time spent on projects in the logs.
Calendar Functionality
The Calendar functionality provides a visual representation of the tasks in the Todo System. It includes three views: day, week, and month. Each view displays the tasks scheduled for the respective time period.
Day View
The day view shows all tasks scheduled for a specific day. Each task is represented as an event on the calendar. The start and end times of the task correspond to the start and end times of the event on the calendar.
Week and Month Views
The week and month views show an overview of the tasks scheduled for the respective time period. Each day in these views contains a summary of the tasks scheduled for that day.
Adapting the Day View
The day view is adapted to work in the week and month views by summarizing the tasks for each day. Instead of showing each task as an individual event, the day view in the week and month views shows a summary of the tasks for that day. This summary includes the number of tasks and the total time scheduled for those tasks.
Adding a Log: Step-by-Step
Click button. It will pass the todo record id and sitename to the log_form.
log_form will use the record id to find the table and fill in the following:
The todo record id will go into todo_record id.
sitename will go into sitename.
subject will go into abstract.
description will go into details.
start_date will go into start_date.
due_date will go into due_date.
start_time puts the time the form is open into the start time field.
end_time is selected by user.
admin is filled in from session role of the user.
priority is pulled from the todo record.
status is selected in with value todo record the word open.
Controller
The Comserv::Controller::Todo module handles the routing and logic for todo-related actions:
Index: Fetches all todo records and stores them in the stash.
Todo: Fetches todos for the site, ordered by priority and start date, excluding status 3.
Details: Fetches a specific todo by record ID and calculates accumulative time.
Add Todo: Prepares data for adding a new todo, including fetching projects and sub-projects.
Modify: Updates a todo record with new data, calculates total log time, and updates accumulative time.
Create: Creates a new todo record with form data, handles project code, and validates user ID.
Day: Fetches todos for a specific day, excluding status 3, and calculates previous and next dates.
Week: Fetches todos for a specific week, excluding status 3, and calculates start and end of the week.
Model
The Comserv::Model::Todo module provides methods for interacting with the todo data:
Get Top Todos: Retrieves the top 10 todos for a site, ordered by priority and start date, excluding status 3.
Get Todos for Date: Retrieves todos for a specific date, ordered by priority and start date, excluding status 3.
Fetch Todo Record: Retrieves a specific todo record by ID.