feat: Implement email task import functionality
- Added `import_tasks_from_email` method in `Cron` class to handle task imports from email. - Created `MailToTaskImporter` class for processing emails and creating tasks based on their content. - Updated configuration to include IMAP settings for email import. - Enhanced `Tasks` class with a method to change the client associated with a task. - Modified task details view to include a dropdown for selecting clients. - Improved task timer functionality with separate start and stop functions. - Added logic to handle task work duration validation. - Updated JavaScript to manage task timers and client changes more effectively.
This commit is contained in:
@@ -317,6 +317,20 @@ class Tasks
|
||||
exit;
|
||||
}
|
||||
|
||||
static public function task_change_client() {
|
||||
global $mdb;
|
||||
|
||||
$client_id = (int)\S::get( 'client_id' );
|
||||
$client_value = $client_id > 0 ? $client_id : null;
|
||||
|
||||
if ( $mdb -> update( 'tasks', [ 'client_id' => $client_value ], [ 'id' => \S::get( 'task_id' ) ] ) ) {
|
||||
echo json_encode( [ 'status' => 'success' ] );
|
||||
} else {
|
||||
echo json_encode( [ 'status' => 'error' ] );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
static public function task_change_priority() {
|
||||
global $mdb;
|
||||
|
||||
@@ -424,6 +438,7 @@ class Tasks
|
||||
'task' => \factory\Tasks::task_details( \S::get( 'task_id' ), $user['id'] ),
|
||||
'task_works' => \factory\Tasks::task_works( \S::get( 'task_id' ) ),
|
||||
'task_attachments' => $attachments_repository -> listByTaskId( \S::get( 'task_id' ) ),
|
||||
'clients' => \factory\Crm::get_client_list(),
|
||||
'user' => $user,
|
||||
'statuses' => \factory\Tasks::get_statuses(),
|
||||
'projects' => \factory\Projects::user_projects( $user['id'] )
|
||||
|
||||
Reference in New Issue
Block a user