Welcome Guest to Computer System Consulting!

0

Todo System Documentation

File: /home/shanta/PycharmProjects/comserv2/Comserv/root/Documentation/features/todo_system.tt

Date: January 20, 2025

Author: System Documentation

Status: Current

Overview

The Todo System is a comprehensive task management module within the Comserv application that allows administrators to create, manage, and track tasks with advanced filtering, time tracking, and project integration capabilities.

System Architecture

Controller: Comserv::Controller::Todo

Location: /home/shanta/PycharmProjects/comserv2/Comserv/lib/Comserv/Controller/Todo.pm

The Todo controller handles all HTTP requests related to todo management and implements the following key features:

Model: Comserv::Model::Todo

Location: /home/shanta/PycharmProjects/comserv2/Comserv/lib/Comserv/Model/Todo.pm

The Todo model provides business logic for:

Database Schema: Comserv::Model::Schema::Ency::Result::Todo

Location: /home/shanta/PycharmProjects/comserv2/Comserv/lib/Comserv/Model/Schema/Ency/Result/Todo.pm

Database Structure

The todo table contains the following fields:

Field Type Description
record_idinteger (PK, auto_increment)Unique identifier
sitenamevarchar(255)Site association
start_datedateWhen the todo should start
parent_todovarcharParent todo reference
due_datedateWhen the todo is due
subjectvarchar(255)Todo title/subject
descriptiontextDetailed description
estimated_man_hoursintegerEstimated time to complete
commentstext (nullable)Additional comments
accumulative_timetimeTotal time spent
reportervarchar(50, nullable)Who reported the todo
company_codevarchar(30, nullable)Company association
ownervarchar(30, nullable)Todo owner
project_codevarchar(255)Project code reference
developervarchar(50, nullable)Assigned developer
username_of_postervarchar(30, nullable)Who created the todo
statusvarchar(255)Current status
priorityintegerPriority level
shareintegerSharing flag
last_mod_byvarchar(255)Last modifier
last_mod_datedateLast modification date
group_of_postervarchar(255)Group of creator
user_idintegerUser association
project_idintegerProject association
date_time_postedvarchar(30, nullable)Creation timestamp

Relationships

Available Routes and Actions

Main Todo Management

/todo - Main Todo List

Query Parameters:

/todo/details - Todo Details View

/todo/addtodo - Add New Todo Form

/todo/edit/{record_id} - Edit Todo Form

/todo/modify/{record_id} - Update Todo

/todo/create - Create New Todo

Time-Based Views

/todo/day/{date} - Daily Todo View

/todo/week/{date} - Weekly Todo View

/todo/month/{date} - Monthly Todo View

Utility Routes

/todo/debug - Debug Information

Status Values

The system uses the following status values:

Status 3 (Completed) todos are excluded from most views by default unless explicitly requested.

Priority System

Todos are sorted by priority (ascending) where lower numbers indicate higher priority.

Integration Features

Project Integration

User Management Integration

Time Tracking Integration

Logging Integration

Security Features

Access Control

Data Validation

Error Handling

The system implements comprehensive error handling:

Templates and UI

The system expects the following template files:

CSS Styling

Configuration

Session Requirements

Default Values

Performance Considerations

Database Optimization

Caching

Maintenance and Monitoring

Logging

All todo operations are logged with detailed information including:

Debugging

Authentication Migration Status

Current Status: The Todo controller uses legacy authentication patterns and needs migration to the centralized AdminAuth system.

Required Migration Steps

  1. Add AdminAuth Import: use Comserv::Util::AdminAuth;
  2. Add admin_auth Method:
    sub admin_auth {
        my ($self) = @_;
        return Comserv::Util::AdminAuth->new();
    }
  3. Replace begin Method: Replace custom authentication logic with:
    sub begin :Private {
        my ($self, $c) = @_;
        return unless $self->admin_auth->require_admin_access($c, 'todo_access');
    }
  4. Update auto Method: Simplify authentication checks using centralized utility
  5. Remove Custom Logic: Remove manual role checking and session validation code

Benefits of Migration

Future Enhancements

Potential areas for system enhancement:

  1. Authentication Migration: Migrate to centralized AdminAuth system (Priority 1)
  2. Notification System: Email/SMS notifications for due dates
  3. Attachment Support: File attachments to todos
  4. Subtask Management: Hierarchical todo relationships
  5. Reporting Dashboard: Analytics and reporting features
  6. API Integration: REST API for external integrations
  7. Mobile Optimization: Enhanced mobile interface
  8. Collaboration Features: Comments and collaboration tools
  9. Workflow Management: Custom workflow states and transitions

Troubleshooting

Common Issues

  1. Access Denied: Ensure user has admin role in session
  2. Session Expired: Check session validity and re-login
  3. Missing Todos: Verify site name in session matches todo records
  4. Date Format Errors: Ensure dates are in ISO8601 format (YYYY-MM-DD)
  5. Project Integration: Verify project controller availability

Debug Mode

Enable debug mode in session to see:

Related Documentation


This documentation reflects the current state of the Todo system as of January 20, 2025. For the most up-to-date information, refer to the source code and changelog.