Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
88e81be
FOUR-23419: S1: FE - Implement new UI for new comments (Task Section)
henryjonathanquispe Mar 27, 2025
956a2c8
FOUR-23419: S1: FE - Implement new UI for new comments (Task Section)
henryjonathanquispe Mar 27, 2025
0b05cd5
FOUR-23419: S1: FE - Implement new UI for new comments (Task Section)
henryjonathanquispe Mar 31, 2025
fee94b9
Merge pull request #8156 from ProcessMaker/feature/FOUR-23419
pmPaulis Mar 31, 2025
12c2e54
Merge branch 'release-2025-spring' into epic/FOUR-22597
gproly Apr 8, 2025
44e4a1d
-23421 S1: BE - The comments needs to use in comment to Endpoint
gproly Apr 9, 2025
066a037
FOUR-23421 Remove unnecessary changes.
gproly Apr 9, 2025
9c37377
Merge pull request #8176 from ProcessMaker/feature/FOUR-23421
pmPaulis Apr 9, 2025
5cdee20
FOUR-23423 S2: BE - A list of users from the groups or users able to …
gproly Apr 16, 2025
bbbba01
FOUR-23423
gproly Apr 21, 2025
146caf8
Merge pull request #8194 from ProcessMaker/feature/FOUR-23423
pmPaulis Apr 21, 2025
ea9df54
FOUR-24106
pmPaulis May 19, 2025
49b194b
Merge pull request #8253 from ProcessMaker/bugfix/FOUR-24106
pmPaulis May 20, 2025
706797b
FOUR-23891: UI: The Assign button needs to block for avoid send the c…
henryjonathanquispe May 21, 2025
522cbbe
FOUR-23891: UI: The Assign button needs to block for avoid send the c…
henryjonathanquispe May 21, 2025
bfdf6f5
FOUR-23891: UI: The Assign button needs to block for avoid send the c…
henryjonathanquispe May 21, 2025
6842f29
Merge pull request #8258 from ProcessMaker/bugfix/FOUR-23891
pmPaulis May 23, 2025
09330e4
FOUR-24105:Cancel and Assignment buttons are not in the correct posit…
fagubla May 29, 2025
07a59f1
Merge pull request #8290 from ProcessMaker/bugfix/FOUR-24105
pmPaulis May 29, 2025
b04ee43
Merge branch 'develop' into epic/FOUR-22597
pmPaulis Jun 4, 2025
e177d81
Merge remote-tracking branch 'origin/develop' into epic/FOUR-22597
pmPaulis Jul 8, 2025
5e16efa
Merge remote-tracking branch 'origin/develop' into epic/FOUR-22597
pmPaulis Jul 23, 2025
b58c3a3
Merge remote-tracking branch 'origin/develop' into epic/FOUR-22597
pmPaulis Aug 4, 2025
a93810b
FOUR-24106: There is not placeholder in comment filed in Reassignment…
henryjonathanquispe Aug 4, 2025
52d1594
Merge pull request #8410 from ProcessMaker/bugfix/FOUR-24106-A
pmPaulis Aug 4, 2025
920d2a2
FOUR-25586
pmPaulis Aug 6, 2025
9d8da77
Merge remote-tracking branch 'origin/develop' into epic/FOUR-22597
pmPaulis Aug 8, 2025
ef81cef
Merge branch 'epic/FOUR-22597' of github.com:ProcessMaker/processmake…
pmPaulis Aug 8, 2025
c8e3696
FOUR-25586
pmPaulis Aug 8, 2025
96e2128
Merge pull request #8419 from ProcessMaker/bugfix/FOUR-25586
pmPaulis Aug 11, 2025
bd2014d
Merge remote-tracking branch 'origin/develop' into epic/FOUR-22597
pmPaulis Aug 19, 2025
c368786
FOUR-24108:Reassignment form is not hidden in tasks where the "Allow …
fagubla Sep 1, 2025
f39977e
Merge pull request #8496 from ProcessMaker/bugfix/FOUR-24108
pmPaulis Sep 2, 2025
c1c2164
Conflicts
pmPaulis Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ProcessMaker/Http/Controllers/Api/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ public function update(Request $request, ProcessRequestToken $task)
return new Resource($task->refresh());
} elseif (!empty($request->input('user_id'))) {
$userToAssign = $request->input('user_id');
$task->reassign($userToAssign, $request->user());
$comments = $request->input('comments');
$task->reassign($userToAssign, $request->user(), $comments);

$taskRefreshed = $task->refresh();

Expand Down Expand Up @@ -426,7 +427,7 @@ public function setPriority(Request $request, ProcessRequestToken $task)
}

/**
* Only send data for a screens fields
* Only send data for a screen's fields
*
* @param ProcessRequestToken $task
*
Expand Down
29 changes: 13 additions & 16 deletions ProcessMaker/Http/Controllers/Api/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ public function index(Request $request)
*/
public function getUsersTaskCount(Request $request)
{
$query = User::nonSystem();
$query->select('id', 'username', 'firstname', 'lastname');
$query = User::select('id', 'username', 'firstname', 'lastname');

$filter = $request->input('filter', '');
if (!empty($filter)) {
Expand All @@ -199,34 +198,32 @@ public function getUsersTaskCount(Request $request)
});
}

$query->where('status', 'ACTIVE');

$query->withCount('activeTasks');

$include_ids = [];
$include_ids_string = $request->input('include_ids', '');
if (!empty($include_ids_string)) {
$include_ids = explode(',', $include_ids_string);
} elseif ($request->has('assignable_for_task_id')) {
$task = ProcessRequestToken::findOrFail($request->input('assignable_for_task_id'));
$assignmentRule = $task->getAssignmentRule();
if ($assignmentRule === 'user_group') {
// Limit the list of users to those that can be assigned to the task
$include_ids = $task->process->getAssignableUsers($task->element_id);
$processRequestToken = ProcessRequestToken::findOrFail($request->input('assignable_for_task_id'));
$assignmentRule = $processRequestToken->getAssignmentRule();
if (config('app.reassign_restrict_to_assignable_users')) {
$include_ids = $processRequestToken->process->getAssignableUsersByAssignmentType($processRequestToken);
}
if ($assignmentRule === 'rule_expression' && $request->has('form_data')) {
$include_ids = $task->getAssigneesFromExpression($request->input('form_data'));
$include_ids = $processRequestToken->getAssigneesFromExpression($request->input('form_data'));
}
}

if (!empty($include_ids)) {
$query->whereIn('id', $include_ids);
}

$response = $query->orderBy(
$request->input('order_by', 'username'),
$request->input('order_direction', 'ASC')
)
$response = $query
->where('is_system', false)
->where('status', 'ACTIVE')
->withCount('activeTasks')
->orderBy(
$request->input('order_by', 'username'),
$request->input('order_direction', 'ASC'))
->paginate(50);

return new ApiCollection($response);
Expand Down
34 changes: 34 additions & 0 deletions ProcessMaker/Models/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,40 @@ public function getAssignableUsers($processTaskUuid)
return array_values($users);
}

/**
* This method is used to get the assignable users for a task based on the assignment rule.
* The assignment rule can be:
* - user_group: would assign it to those in the group or the Process Manager.
* - process_variable: would assign it to those in the group or the Process Manager.
* - rule_expression: would assign it to those in the group or the Process Manager.
* - previous_task_assignee: would assign it to the Process Manager.
* - requester: would assign it to the Process Manager.
* - process_manager: would assign it to the same Process Manager.
*
* @param ProcessRequestToken $processRequestToken
* @return array
*/
public function getAssignableUsersByAssignmentType(ProcessRequestToken $processRequestToken): array
{
$users = [];
switch ($processRequestToken->getAssignmentRule()) {
case 'user_group':
case 'process_variable':
case 'rule_expression':
$users = $this->getAssignableUsers($processRequestToken->element_id);
$users[] = $processRequestToken->process->properties["manager_id"];
break;
case 'previous_task_assignee':
case 'requester':
$users[] = $processRequestToken->process->properties["manager_id"];
break;
case 'process_manager':
$users[] = $processRequestToken->process->properties["manager_id"];
break;
}
return $users;
}

/**
* Get a consolidated list of users within groups.
*
Expand Down
5 changes: 4 additions & 1 deletion ProcessMaker/Models/ProcessRequestToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ public function sendActivityActivatedNotifications()
* @param User $requestingUser
* @return void
*/
public function reassign($toUserId, User $requestingUser)
public function reassign($toUserId, User $requestingUser, $comments = '')
{
$sendActivityActivatedNotifications = false;
$reassingAction = false;
Expand All @@ -1365,6 +1365,9 @@ public function reassign($toUserId, User $requestingUser)
$this->persistUserData($toUserId);
$reassingAction = true;
}
if ($comments != null && $comments !== '') {
$this->comments = $comments;
}
$this->save();

if ($sendActivityActivatedNotifications) {
Expand Down
1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@

'multitenancy' => env('MULTITENANCY', false),

'reassign_restrict_to_assignable_users' => env('REASSIGN_RESTRICT_TO_ASSIGNABLE_USERS', true),
'resources_core_path' => base_path('resources-core'),
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('process_request_tokens', function (Blueprint $table) {
$table->longText('comments')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('process_request_tokens', function (Blueprint $table) {
$table->dropColumn('comments');
});
}
};
43 changes: 38 additions & 5 deletions resources/js/tasks/api/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
import { api } from "../variables/index";
import { getApi } from "../variables/index";

export const updateCollection = async ({ collectionId, recordId, data }) => {
const response = await api.put(`collections/${collectionId}/records/${recordId}`, data);
export const getReassignUsers = async (filter = null, taskId = null, currentTaskUserId = null) => {
const api = getApi();
const response = await api.get("users_task_count", { params: { filter, assignable_for_task_id: taskId, include_current_user: true } });
const data = response.data;
if (currentTaskUserId && Array.isArray(data?.data)) {
data.data = data.data.filter((user) => user.id !== currentTaskUserId);
}
return data;
};

export const updateReassignUser = async (taskId, userId, comments = null) => {
const api = getApi();
const response = await api.put(`tasks/${taskId}`, { user_id: userId, comments });
return response.data;
};

export const updateComment = async ({
body,
subject,
commentableId,
commentableType,
parentId = 0,
type = "COMMENT",
}) => {
const api = getApi();
const response = await api.post("comments/comments", {
body,
subject,
commentable_id: commentableId,
commentable_type: commentableType,
type,
parent_id: parentId,
});
return response.data;
};

export default {
updateCollection,
export const updateCollection = async ({ collectionId, recordId, data }) => {
const api = getApi();
const response = await api.put(`collections/${collectionId}/records/${recordId}`, data);

return response.data;
};
1 change: 1 addition & 0 deletions resources/js/tasks/components/PreviewMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const PreviewMixin = {
}
this.prevTask = prevTask;
this.nextTask = nextTask;
this.showReassignment = false;
},
/**
* Expand Open task
Expand Down
Loading