From 5ebfd8088bfa702056d9b46a966cce81d0cfca7a Mon Sep 17 00:00:00 2001
From: Melvin-Isaac <119775059+Melvin-Isaac@users.noreply.github.com>
Date: Tue, 16 Jul 2024 15:24:15 +0530
Subject: [PATCH] Fix - Task status is not updating properly in the activity
 tab and calendar module

---
 modules/Calendar/actions/SaveAjax.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/Calendar/actions/SaveAjax.php b/modules/Calendar/actions/SaveAjax.php
index 5893c853d..deb5e3cfa 100644
--- a/modules/Calendar/actions/SaveAjax.php
+++ b/modules/Calendar/actions/SaveAjax.php
@@ -183,7 +183,8 @@ class Calendar_SaveAjax_Action extends Vtiger_SaveAjax_Action {
 
 		$activityType = $request->get('activitytype');
 		$visibility = $request->get('visibility');
-		if(empty($activityType)) {
+		// set activity type as "Task" when creating or inline editing Task.
+		if(empty($activityType) || empty($recordModel->get('activitytype'))) {
 			$recordModel->set('activitytype', 'Task');
 			$visibility = 'Private';
 			$recordModel->set('visibility', $visibility);
-- 
GitLab