diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 19cabc24e4..8c61aa03e5 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -162,7 +162,7 @@ $lang->action->desc->hidden = '$date, hidden by $actoraction->desc->commented = '$date, added by $actor.' . "\n"; $lang->action->desc->activated = '$date, activated by $actor .' . "\n"; $lang->action->desc->blocked = '$date, blocked by $actor .' . "\n"; -$lang->action->desc->moved = '$date, moved by $actor , which was "$extra".' . "\n"; +$lang->action->desc->moved = '$date, moved by $actor .' . "\n"; $lang->action->desc->confirmed = '$date, $actor confirmed the story change. The latest build is #$extra.' . "\n"; $lang->action->desc->caseconfirmed = '$date, $actor confirmed the case change. The latest build is #$extra' . "\n"; $lang->action->desc->bugconfirmed = '$date, $actor confirmed Bug.' . "\n"; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index b70a9b69bd..d43c3604f3 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -162,7 +162,7 @@ $lang->action->desc->hidden = '$date, 由 $actor $lang->action->desc->commented = '$date, 由 $actor 添加备注。' . "\n"; $lang->action->desc->activated = '$date, 由 $actor 激活。' . "\n"; $lang->action->desc->blocked = '$date, 由 $actor 阻塞。' . "\n"; -$lang->action->desc->moved = '$date, 由 $actor 移动,之前为 "$extra"。' . "\n"; +$lang->action->desc->moved = '$date, 由 $actor 移动。' . "\n"; $lang->action->desc->confirmed = '$date, 由 $actor 确认' . $lang->SRCommon . '变动,最新版本为#$extra。' . "\n"; $lang->action->desc->caseconfirmed = '$date, 由 $actor 确认用例变动,最新版本为#$extra。' . "\n"; $lang->action->desc->bugconfirmed = '$date, 由 $actor 确认Bug。' . "\n"; diff --git a/module/kanban/control.php b/module/kanban/control.php index 72fc0b3a02..32d3943bcd 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -975,6 +975,9 @@ class kanban extends control { $this->kanban->moveCard($cardID, $fromColID, $toColID, $fromLaneID, $toLaneID, $kanbanID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $this->loadModel('action')->create('kanbanCard', $cardID, 'moved'); + $kanbanGroup = $this->kanban->getKanbanData($kanbanID); echo json_encode($kanbanGroup); } @@ -1388,11 +1391,15 @@ class kanban extends control } else { - if($card->fromType == '') $this->kanban->delete(TABLE_KANBANCARD, $cardID); + if($card->fromType == '') + { + $this->kanban->delete(TABLE_KANBANCARD, $cardID); + $this->loadModel('action')->create('kanbancard', $cardID, 'Deleted', '', $cardID); + } + if($card->fromType != '') { $this->dao->delete()->from(TABLE_KANBANCARD)->where('id')->eq($cardID)->exec(); - $this->loadModel('action')->create('kanbancard', $cardID, 'Deleted', '', $cardID); } if(isonlybody()) return print(js::reload('parent.parent')); diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index cce018447c..0da9f49c01 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -334,6 +334,7 @@ $lang->kanbancard->delete = 'Delete'; $lang->kanbancard->name = 'Card Name'; $lang->kanbancard->legendBasicInfo = 'Basic Info'; $lang->kanbancard->legendLifeTime = 'Card Life'; +$lang->kanbancard->legendDesc = 'Card Description'; $lang->kanbancard->space = 'Space'; $lang->kanbancard->region = 'Region'; $lang->kanbancard->kanban = 'Kanban'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 00a8305975..154fd13465 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -334,6 +334,7 @@ $lang->kanbancard->delete = '删除'; $lang->kanbancard->name = '卡片名称'; $lang->kanbancard->legendBasicInfo = '基本信息'; $lang->kanbancard->legendLifeTime = '卡片的一生'; +$lang->kanbancard->legendDesc = '卡片描述'; $lang->kanbancard->space = '所属空间'; $lang->kanbancard->region = '所属区域'; $lang->kanbancard->kanban = '所属看板'; diff --git a/module/kanban/model.php b/module/kanban/model.php index 68e3c05c69..c0639e484a 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3572,6 +3572,42 @@ class kanbanModel extends model return $menus; } + /** + * Get toList and ccList. + * + * @param object $card + * @access public + * @return bool|array + */ + public function getToAndCcList($card) + { + /* Set toList and ccList. */ + $toList = $card->createdBy; + $ccList = trim($card->assignedTo, ','); + if(strpos(",$ccList,", ",$card->createdBy,") === false) + { + $ccList .= ",$card->createdBy"; + } + + 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); + } + } + + return array($toList, $ccList); + } + /** * Check if user can execute an action. * diff --git a/module/kanban/view/sendmail.html.php b/module/kanban/view/sendmail.html.php new file mode 100644 index 0000000000..939287afb9 --- /dev/null +++ b/module/kanban/view/sendmail.html.php @@ -0,0 +1,34 @@ + + * @package kanban + * @version $Id: sendmail.html.php 867 2022-05-17 13:50:58Z $ + * @link https://www.zentao.net + */ +?> +id . ' ' . $object->name;?> +app->getModuleRoot() . 'common/view/mail.header.html.php';?> + + + + + + +
+ kanban", 'html'), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?> +
+ + + + +
+ lang->kanbancard->legendDesc;?> +
desc;?>
+
+ + +app->getModuleRoot() . 'common/view/mail.footer.html.php';?> diff --git a/module/mail/model.php b/module/mail/model.php index 370e9b2373..652894eecb 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -691,7 +691,7 @@ class mailModel extends model $action = $this->action->getById($actionID); $history = $this->action->getHistory($actionID); $objectType = $action->objectType; - $object = $this->loadModel($objectType)->getByID($objectID); + $object = $objectType == 'kanbancard' ? $this->loadModel('kanban')->getCardByID($objectID) : $this->loadModel($objectType)->getByID($objectID); $nameFields = $this->config->action->objectNameFields[$objectType]; $title = zget($object, $nameFields, ''); $subject = $this->getSubject($objectType, $object, $title, $action->action); @@ -726,6 +726,8 @@ class mailModel extends model if($objectType == 'review') $this->app->loadLang('baseline'); /* Get mail content. */ + if($objectType == 'kanbancard') $objectType = 'kanban'; + $modulePath = $this->app->getModulePath($appName = '', $objectType); $oldcwd = getcwd(); $viewFile = $modulePath . 'view/sendmail.html.php'; diff --git a/module/message/config.php b/module/message/config.php index d39fb726e9..c637cac386 100644 --- a/module/message/config.php +++ b/module/message/config.php @@ -10,22 +10,25 @@ $config->message->objectTypes['case'] = array('opened', 'edited', 'commen $config->message->objectTypes['testtask'] = array('opened', 'edited', 'started', 'blocked', 'closed', 'activated'); $config->message->objectTypes['todo'] = array('opened', 'edited'); $config->message->objectTypes['doc'] = array('created', 'edited'); +$config->message->objectTypes['kanbancard'] = array('created', 'edited', 'finished', 'activated', 'archived', 'restore', 'deleted', 'moved'); $config->message->available = array(); -$config->message->available['mail']['story'] = $config->message->objectTypes['story']; -$config->message->available['mail']['task'] = $config->message->objectTypes['task']; -$config->message->available['mail']['bug'] = $config->message->objectTypes['bug']; -$config->message->available['mail']['testtask'] = array('opened', 'edited', 'closed'); -$config->message->available['mail']['doc'] = $config->message->objectTypes['doc']; +$config->message->available['mail']['story'] = $config->message->objectTypes['story']; +$config->message->available['mail']['task'] = $config->message->objectTypes['task']; +$config->message->available['mail']['bug'] = $config->message->objectTypes['bug']; +$config->message->available['mail']['testtask'] = array('opened', 'edited', 'closed'); +$config->message->available['mail']['doc'] = $config->message->objectTypes['doc']; +$config->message->available['mail']['kanbancard'] = $config->message->objectTypes['kanbancard']; $config->message->available['webhook'] = $config->message->objectTypes; -$config->message->available['message']['bug'] = $config->message->objectTypes['bug']; -$config->message->available['message']['story'] = $config->message->objectTypes['story']; -$config->message->available['message']['task'] = $config->message->objectTypes['task']; -$config->message->available['message']['testtask'] = $config->message->objectTypes['testtask']; -$config->message->available['message']['todo'] = $config->message->objectTypes['todo']; -$config->message->available['message']['doc'] = $config->message->objectTypes['doc']; +$config->message->available['message']['bug'] = $config->message->objectTypes['bug']; +$config->message->available['message']['story'] = $config->message->objectTypes['story']; +$config->message->available['message']['task'] = $config->message->objectTypes['task']; +$config->message->available['message']['testtask'] = $config->message->objectTypes['testtask']; +$config->message->available['message']['todo'] = $config->message->objectTypes['todo']; +$config->message->available['message']['doc'] = $config->message->objectTypes['doc']; +$config->message->available['message']['kanbancard'] = $config->message->objectTypes['kanbancard']; $config->message->typeLink = array(); $config->message->typeLink['mail'] = 'mail|index'; diff --git a/module/message/css/setting.css b/module/message/css/setting.css index 0a26a1d7fe..86c0394948 100644 --- a/module/message/css/setting.css +++ b/module/message/css/setting.css @@ -2,5 +2,3 @@ .checkbox-primary {margin: 0px; width: 120px; float: left;} .checkbox-primary label {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} div.chosen-container + select + div.chosen-container > .chosen-choices {border-top: 0px;} - -.table-bordered thead .checkbox-primary {width: 200px;} diff --git a/module/message/lang/en.php b/module/message/lang/en.php index c584d5a185..1f2284ea19 100644 --- a/module/message/lang/en.php +++ b/module/message/lang/en.php @@ -44,3 +44,6 @@ $lang->message->label->blocked = 'block'; $lang->message->label->bugconfirmed = 'confirm'; $lang->message->label->compilepass = 'compile pass'; $lang->message->label->compilefail = 'compile fail'; +$lang->message->label->archived = 'archive'; +$lang->message->label->restore = 'restore'; +$lang->message->label->moved = 'move'; diff --git a/module/message/lang/zh-cn.php b/module/message/lang/zh-cn.php index 1e1610ab6b..34c7e2b051 100644 --- a/module/message/lang/zh-cn.php +++ b/module/message/lang/zh-cn.php @@ -44,3 +44,6 @@ $lang->message->label->blocked = '阻塞'; $lang->message->label->bugconfirmed = '确认'; $lang->message->label->compilepass = '构建通过'; $lang->message->label->compilefail = '构建失败'; +$lang->message->label->archived = '归档'; +$lang->message->label->restore = '还原'; +$lang->message->label->moved = '移动'; diff --git a/module/message/model.php b/module/message/model.php index 83a55e3ebb..98f547130c 100644 --- a/module/message/model.php +++ b/module/message/model.php @@ -64,6 +64,7 @@ class messageModel extends model */ public function send($objectType, $objectID, $actionType, $actionID, $actor = '') { + $objectType = strtolower($objectType); $messageSetting = $this->config->message->setting; if(is_string($messageSetting)) $messageSetting = json_decode($messageSetting, true); diff --git a/xuanxuan/extension/xuan/message/ext/config/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/config/xuanxuan.php index 2573bf051f..fa8db98fe0 100644 --- a/xuanxuan/extension/xuan/message/ext/config/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/config/xuanxuan.php @@ -1,9 +1,11 @@ message->objectTypes['mr'] = array('compilepass', 'compilefail'); -$config->message->available['xuanxuan']['story'] = $config->message->objectTypes['story']; -$config->message->available['xuanxuan']['task'] = $config->message->objectTypes['task']; -$config->message->available['xuanxuan']['bug'] = $config->message->objectTypes['bug']; -$config->message->available['xuanxuan']['todo'] = $config->message->objectTypes['todo']; -$config->message->available['xuanxuan']['mr'] = $config->message->objectTypes['mr']; +$config->message->available['xuanxuan']['story'] = $config->message->objectTypes['story']; +$config->message->available['xuanxuan']['task'] = $config->message->objectTypes['task']; +$config->message->available['xuanxuan']['bug'] = $config->message->objectTypes['bug']; +$config->message->available['xuanxuan']['todo'] = $config->message->objectTypes['todo']; +$config->message->available['xuanxuan']['mr'] = $config->message->objectTypes['mr']; +$config->message->available['xuanxuan']['kanbancard'] = $config->message->objectTypes['kanbancard']; + $config->message->setting['xuanxuan']['setting'] = $config->message->available['xuanxuan'];