ToDo Logging: This system logs daily activities related to todos. Each log entry is linked to a todo and a project, tracking actions, start and end times, and the total time spent. The system calculates accumulative time for todos.
Debug Logging: Used for debugging purposes, with detailed log messages indicating the location and status of operations within the code.
Controller
The Comserv::Controller::Log module handles the routing and logic for log-related actions:
Index: Fetches logs based on status, defaults to excluding status 3 (DONE).
Details: Fetches a log entry by record ID, sets the end_time to the current local time, and passes data to the template.
Update: Updates a log entry with new values from form data, calculates time difference, and redirects to log details.
Log Form: Displays a form for log entry, pre-filling data from a todo record.
Create Log: Creates a new log entry with form data, calculates time difference, and handles default values.
Model
The Comserv::Model::Log module provides methods for interacting with the log data:
Get Logs: Retrieves logs based on status, with options for all, open, or specific status.
Modify: Updates a log record with new values.
Calculate Accumulative Time: Calculates total time from log entries for a specific todo.
Priority and Status Fields
The log details form has been updated to include the `priority` and `status` fields. These fields are now populated from the controller and displayed as drop-down lists in the form. The `priority` and `status` values are fetched from the database and passed to the template, ensuring that the form displays the correct options for these fields.