- Introduced a new `TasksController` to handle work time logic, moving it from the factory layer to the domain layer. - Created `WorkTimeRepository` to encapsulate data access for work time tasks, including methods to retrieve clients with unsettled tasks and calculate task times. - Updated the work time view to display a consolidated billing summary with improved UI elements and AJAX functionality for closing tasks. - Added new styles for the billing summary section in `style.scss`. - Implemented tests for the `TasksController` and `WorkTimeRepository` to ensure functionality and correctness. - Established a refactoring plan for future improvements and migrations within the CRM system.
26 lines
567 B
PHP
26 lines
567 B
PHP
<?php
|
|
namespace Controllers;
|
|
|
|
class TasksController
|
|
{
|
|
public static function workTime()
|
|
{
|
|
$work_time_repository = new \Domain\Tasks\WorkTimeRepository();
|
|
|
|
$view_model = self::workTimeViewModel(
|
|
$work_time_repository -> getClientsWithUnsettledTasks(),
|
|
\factory\Crm::settings()
|
|
);
|
|
|
|
return \Tpl::view( 'tasks/work-time', $view_model );
|
|
}
|
|
|
|
public static function workTimeViewModel( array $work_time_clients, array $settings )
|
|
{
|
|
return [
|
|
'work_time_clients' => $work_time_clients,
|
|
'settings' => $settings
|
|
];
|
|
}
|
|
}
|