* Revert method.

This commit is contained in:
caoyanyi
2023-06-01 13:39:31 +08:00
parent 786d7b29f3
commit c4bd3541f2
+43
View File
@@ -2635,6 +2635,49 @@ class taskModel extends model
echo !common::hasPriv('task', 'assignTo', $task) ? "<span style='padding-left: 21px' class='{$btnTextClass}'>{$assignedToText}</span>" : $assignToHtml;
}
/**
* 获取指派用户和抄送给用户列表。
* Get toList and ccList.
*
* @param object $task
* @access public
* @return array|false
*/
public function getToAndCcList(object $task): array|false
{
/* Set toList and ccList. */
$toList = $task->assignedTo;
$ccList = trim($task->mailto, ',');
$toTeamTaskList = '';
if($task->mode == 'multi')
{
$toTeamTaskList = $this->getTeamMembers($task->id);
$toTeamTaskList = implode(',', $toTeamTaskList);
$toList = $toTeamTaskList;
}
if(empty($toList))
{
if(empty($ccList)) return false;
if(strpos($ccList, ',') === false)
{
$toList = $ccList;
$ccList = '';
}
else
{
$commaPos = strpos($ccList, ',');
$toList = substr($ccList, 0, $commaPos);
$ccList = substr($ccList, $commaPos + 1);
}
}
elseif(strtolower($toList) == 'closed')
{
$toList = $task->finishedBy;
}
return array($toList, $ccList);
}
/**
* Get task's team member pairs.