Merge branch 'sprint/tianshujie_22636' into 'master'

* Fix bug #22636.

See merge request easycorp/zentaopms!3494
This commit is contained in:
李玉春
2022-05-18 08:57:05 +00:00
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ class actionModel extends model
if($this->post->uid) $this->file->updateObjectID($this->post->uid, $objectID, $objectType);
/* Call the message notification function. */
$this->loadModel('message')->send($objectType, $objectID, $actionType, $actionID, $actor);
$this->loadModel('message')->send(strtolower($objectType), $objectID, $actionType, $actionID, $actor);
/* Add index for global search. */
$this->saveIndex($objectType, $objectID, $actionType);
+3 -1
View File
@@ -146,9 +146,11 @@ class messageModel extends model
if($isonlybody) unset($_GET['onlybody']);
$moduleName = $objectType == 'case' ? 'testcase' : $objectType;
$moduleName = $objectType == 'kanbancard' ? 'kanban' : $objectType;
$space = common::checkNotCN() ? ' ' : '';
$data = $user->realname . $space . $this->lang->action->label->$actionType . $space . $this->lang->action->objectTypes[$objectType];
$data .= ' ' . html::a($sysURL . helper::createLink($moduleName, 'view', "id=$objectID"), "[#{$objectID}::{$object->$field}]");
$dataID = $objectType == 'kanbancard' ? $object->kanban : $objectID;
$data .= ' ' . html::a($sysURL . helper::createLink($moduleName, 'view', "id=$dataID"), "[#{$objectID}::{$object->$field}]");
if($isonlybody) $_GET['onlybody'] = 'yes';
+1 -1
View File
@@ -417,7 +417,7 @@ class webhookModel extends model
$object = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch();
$field = $this->config->action->objectNameFields[$objectType];
$host = empty($webhook->domain) ? common::getSysURL() : $webhook->domain;
$viewLink = $this->getViewLink($objectType, $objectID);
$viewLink = $this->getViewLink($objectType == 'kanbancard' ? 'kanban' : $objectType, $objectType == 'kanbancard' ? $object->kanban : $objectID);
$objectTypeName = ($objectType == 'story' and $object->type == 'requirement') ? $this->lang->action->objectTypes['requirement'] : $this->lang->action->objectTypes[$objectType];
$title = $this->app->user->realname . $this->lang->action->label->$actionType . $objectTypeName;
$text = $title . ' ' . "[#{$objectID}::{$object->$field}](" . $host . $viewLink . ")";
@@ -48,12 +48,13 @@ class xuanxuanMessage extends messageModel
$server = $this->loadModel('im')->getServer('zentao');
$onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : '';
unset($_GET['onlybody']);
$url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'html');
$dataID = $objectType == 'kanbancard' ? $object->kanban : $objectID;
$url = $server . helper::createLink($objectType == 'kanbancard' ? 'kanban' : $objectType, 'view', "id=$dataID", 'html');
$target = '';
if(!empty($object->assignedTo)) $target .= $object->assignedTo;
if(!empty($object->mailto)) $target .= ",{$object->mailto}";
if($objectType == 'mr' && !empty($object->createdBy)) $target .= ",{$object->createdBy}";
if(($objectType == 'mr' or $objectType == 'kanbancard') and !empty($object->createdBy)) $target .= ",{$object->createdBy}";
$target = trim($target, ',');
$target = $this->dao->select('id')->from(TABLE_USER)
->where('account')->in($target)