This commit is contained in:
wangyidong
2022-05-18 10:29:11 +08:00
35 changed files with 260 additions and 61 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ $lang->action->desc->hidden = '$date, hidden by <strong>$actor</st
$lang->action->desc->commented = '$date, added by <strong>$actor</strong>.' . "\n";
$lang->action->desc->activated = '$date, activated by <strong>$actor</strong> .' . "\n";
$lang->action->desc->blocked = '$date, blocked by <strong>$actor</strong> .' . "\n";
$lang->action->desc->moved = '$date, moved by <strong>$actor</strong> , which was "$extra".' . "\n";
$lang->action->desc->moved = '$date, moved by <strong>$actor</strong> .' . "\n";
$lang->action->desc->confirmed = '$date, <strong>$actor</strong> confirmed the story change. The latest build is <strong>#$extra</strong>.' . "\n";
$lang->action->desc->caseconfirmed = '$date, <strong>$actor</strong> confirmed the case change. The latest build is <strong>#$extra</strong>' . "\n";
$lang->action->desc->bugconfirmed = '$date, <strong>$actor</strong> confirmed Bug.' . "\n";
+1 -1
View File
@@ -162,7 +162,7 @@ $lang->action->desc->hidden = '$date, 由 <strong>$actor</strong>
$lang->action->desc->commented = '$date, 由 <strong>$actor</strong> 添加备注。' . "\n";
$lang->action->desc->activated = '$date, 由 <strong>$actor</strong> 激活。' . "\n";
$lang->action->desc->blocked = '$date, 由 <strong>$actor</strong> 阻塞。' . "\n";
$lang->action->desc->moved = '$date, 由 <strong>$actor</strong> 移动,之前为 "$extra"。' . "\n";
$lang->action->desc->moved = '$date, 由 <strong>$actor</strong> 移动。' . "\n";
$lang->action->desc->confirmed = '$date, 由 <strong>$actor</strong> 确认' . $lang->SRCommon . '变动,最新版本为<strong>#$extra</strong>。' . "\n";
$lang->action->desc->caseconfirmed = '$date, 由 <strong>$actor</strong> 确认用例变动,最新版本为<strong>#$extra</strong>。' . "\n";
$lang->action->desc->bugconfirmed = '$date, 由 <strong>$actor</strong> 确认Bug。' . "\n";
-1
View File
@@ -249,7 +249,6 @@ class caselib extends control
if(!empty($_POST))
{
$this->loadModel('testcase');
$this->config->testcase->create->requiredFields = $this->config->caselib->createcase->requiredFields;
setcookie('lastLibCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false);
$caseResult = $this->testcase->create($bugID = 0);
if(!$caseResult or dao::isError()) return print(js::error(dao::getError()));
+11 -12
View File
@@ -586,8 +586,7 @@ class caselibModel extends model
if(dao::isError())
{
echo js::error(dao::getError());
return print(js::reload('parent'));
return helper::end(js::error(dao::getError()));
}
$caseID = $this->dao->lastInsertID();
@@ -597,10 +596,10 @@ class caselibModel extends model
}
/**
* Build case lib menu.
*
* @param object $object
* @param string $type
* Build case lib menu.
*
* @param object $object
* @param string $type
* @access public
* @return string
*/
@@ -611,9 +610,9 @@ class caselibModel extends model
}
/**
* Build case lib view menu.
*
* @param object $lib
* Build case lib view menu.
*
* @param object $lib
* @access public
* @return string
*/
@@ -632,9 +631,9 @@ class caselibModel extends model
}
/**
* Build case lib browse menu.
*
* @param object $case
* Build case lib browse menu.
*
* @param object $case
* @access public
* @return string
*/
+1 -1
View File
@@ -25,7 +25,7 @@
<thead>
<tr class='text-center'>
<th class='c-id'><?php echo $lang->idAB;?></th>
<th class='c-module'><?php echo $lang->testcase->module;?></th>
<th class='c-module<?php echo strpos($config->testcase->create->requiredFields, 'module') ? ' required' : '';?>'><?php echo $lang->testcase->module;?></th>
<th class='required'><?php echo $lang->testcase->title;?></th>
<th class='c-status required'><?php echo $lang->testcase->type;?></th>
<th class='c-status'><?php echo $lang->testcase->pri;?></th>
+1 -1
View File
@@ -33,7 +33,7 @@
<?php echo html::select('lib', $libraries, $libID, "onchange='loadLibModules(this.value);' class='form-control chosen'");?>
</div>
</td>
<td style='padding-left:15px;'>
<td style='padding-left:15px;'<?php echo strpos($config->testcase->create->requiredFields, 'module') ? ' class="required"' : '';?>>
<div class='input-group' id='moduleIdBox'>
<span class="input-group-addon w-80px"><?php echo $lang->testcase->module?></span>
<?php
+2 -3
View File
@@ -600,14 +600,13 @@ function renderTaskItem(item, $item, col)
if(scaleSize <= 2)
{
var idHtml = scaleSize <= 1 ? ('<span class="info info-id text-muted">#' + item.id + '</span>') : '';
var priHtml = '<span class="info info-pri label-pri label-pri-' + item.pri + '" title="' + item.pri + '">' + item.pri + '</span>';
var hoursHtml = (item.estimate && scaleSize <= 1) ? ('<span class="info info-estimate text-muted">' + item.estimate + 'h</span>') : '';
var hoursHtml = scaleSize <= 1 && item.status != 'wait' ? ('<span class="info info-estimate text-muted">' + taskLang.leftAB + ' ' + item.left + 'h</span>') : ('<span class="info info-estimate text-muted">' + taskLang.estimateAB + ' ' + item.estimate + 'h</span>');
var avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id);
var $infos = $item.find('.infos');
if(!$infos.length) $infos = $('<div class="infos"></div>');
$infos.html([idHtml, priHtml, hoursHtml].join(''));
$infos.html([priHtml, hoursHtml].join(''));
if(item.deadline && scaleSize <= 1) $infos.append(renderDeadline(item.deadline));
$infos[scaleSize <= 1 ? 'append' : 'prepend'](avatarHtml);
+5 -5
View File
@@ -978,6 +978,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);
}
@@ -1392,11 +1395,8 @@ class kanban extends control
else
{
if($card->fromType == '') $this->kanban->delete(TABLE_KANBANCARD, $cardID);
if($card->fromType != '')
{
$this->dao->delete()->from(TABLE_KANBANCARD)->where('id')->eq($cardID)->exec();
$this->loadModel('action')->create('kanbancard', $cardID, 'Deleted', '', $cardID);
}
if($card->fromType != '') $this->dao->delete()->from(TABLE_KANBANCARD)->where('id')->eq($cardID)->exec();
if(isonlybody()) return print(js::reload('parent.parent'));
return print(js::reload('parent'));
+1
View File
@@ -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';
+1
View File
@@ -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 = '所属看板';
+36 -2
View File
@@ -1295,7 +1295,9 @@ class kanbanModel extends model
if($cell->type == 'task')
{
$cardData['name'] = $object->name;
$cardData['name'] = $object->name;
$cardData['status'] = $object->status;
$cardData['left'] = $object->left;
}
else
{
@@ -2940,7 +2942,7 @@ class kanbanModel extends model
$actions .= "<div class='btn-group'>";
$actions .= "<a href='javascript:fullScreen();' id='fullScreenBtn' $btnColor class='btn btn-link'><i class='icon icon-fullscreen'></i> {$this->lang->kanban->fullScreen}</a>";
$CRKanban = !($this->config->CRKanban === '0' and $kanban->status === 'closed');
$CRKanban = !(isset($this->config->CRKanban) and $this->config->CRKanban === '0' and $kanban->status === 'closed');
$printRegionBtn = ($CRKanban and (common::hasPriv('kanban', 'createRegion') or $printSetHeightBtn or common::hasPriv('kanban', 'performable') or common::hasPriv('kanban', 'enableArchived') or common::hasPriv('kanban', 'import') or common::hasPriv('kanban', 'setColumnWidth')));
$printKanbanBtn = (common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'delete'));
@@ -3574,6 +3576,38 @@ 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(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.
*
+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* The mail file of kanban module of ZenTaoPMS.
*
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Shujie Tian <tianshujie@easycorp.ltd>
* @package kanban
* @version $Id: sendmail.html.php 867 2022-05-17 13:50:58Z $
* @link https://www.zentao.net
*/
?>
<?php $mailTitle = 'CARD #' . $object->id . ' ' . $object->name;?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'>
<?php echo html::a($domain . helper::createLink('kanban', 'view', "kanbanID=$object->kanban", 'html'), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $this->lang->kanbancard->legendDesc;?></legend>
<div style='padding:5px;'><?php echo $object->desc;?></div>
</fieldset>
</td>
</tr>
<?php include $this->app->getModuleRoot() . 'common/view/mail.footer.html.php';?>
+1 -1
View File
@@ -21,7 +21,7 @@ $laneCount = 0;
foreach($regions as $region) $laneCount += $region->laneCount;
js::set('vision', $this->config->vision);
js::set('CRKanban', $this->config->CRKanban);
js::set('CRKanban', isset($this->config->CRKanban) ? $this->config->CRKanban : 1);
js::set('regions', $regions);
js::set('kanban', $kanban);
js::set('kanbanLang', $lang->kanban);
+3 -1
View File
@@ -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';
+14 -11
View File
@@ -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';
-2
View File
@@ -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;}
+3
View File
@@ -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';
+3
View File
@@ -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 = '移动';
+1
View File
@@ -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);
+23 -5
View File
@@ -393,6 +393,7 @@ EOF;
*/
public function task($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->loadModel('task');
/* Save session. */
if($this->app->viewType != 'json') $this->session->set('taskList', $this->app->getURI(true), 'execution');
@@ -405,7 +406,14 @@ EOF;
$sort = common::appendOrder($orderBy);
/* Get tasks. */
$tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $type, 0, $pager, $sort);
if($type == 'assignedBy')
{
$tasks = $this->my->getAssignedByMe($this->app->user->account, 0, $pager, $sort, 0, 'task');
}
else
{
$tasks = $this->task->getUserTasks($this->app->user->account, $type, 0, $pager, $sort);
}
$parents = array();
$executionIDList = array();
@@ -480,6 +488,7 @@ EOF;
public function bug($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. load Lang. */
$this->loadModel('bug');
if($this->app->viewType != 'json') $this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->app->loadLang('bug');
@@ -490,7 +499,15 @@ EOF;
/* Append id for secend sort. */
$sort = common::appendOrder($orderBy);
$bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $type, $sort, 0, $pager);
if($type == 'assignedBy')
{
$bugs = $this->loadModel('my')->getAssignedByMe($this->app->user->account, '', $pager, $orderBy, '', 'bug');
}
else
{
$bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $type, $sort, 0, $pager);
}
$bugs = $this->bug->checkDelayedBugs($bugs);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', false);
@@ -752,7 +769,7 @@ EOF;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->type = $type;
$this->view->issues = $this->loadModel('issue')->getUserIssues($type, $this->app->user->account, $orderBy, $pager);
$this->view->issues = $type == 'assignedBy' ? $this->loadModel('my')->getAssignedByMe($this->app->user->account, '', $pager, $orderBy, '', 'issue') : $this->loadModel('issue')->getUserIssues($type, $this->app->user->account, $orderBy, $pager);
$this->view->projectList = $this->loadModel('project')->getPairsByProgram();
@@ -773,6 +790,7 @@ EOF;
public function risk($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Set the pager. */
$this->loadModel('risk');
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
@@ -780,7 +798,7 @@ EOF;
$this->view->title = $this->lang->my->risk;
$this->view->position[] = $this->lang->my->risk;
$this->view->risks = $this->loadModel('risk')->getUserRisks($type, $this->app->user->account, $orderBy, $pager);
$this->view->risks = $type == 'assignedBy' ? $this->loadModel('my')->getAssignedByMe($this->app->user->account, '', $pager, $orderBy, '', 'risk') : $this->loadModel('risk')->getUserRisks($type, $this->app->user->account, $orderBy, $pager);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
@@ -857,7 +875,7 @@ EOF;
$this->app->loadClass('pager', $static = true);
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
$pager = pager::init($recTotal, $recPerPage, $pageID);
$ncList = $this->my->getNcList($browseType, $orderBy, $pager, 'active');
$ncList = $browseType == 'assignedBy' ? $this->loadModel('my')->getAssignedByMe($this->app->user->account, '', $pager, $orderBy, '', 'nc') : $this->my->getNcList($browseType, $orderBy, $pager, 'active');
foreach($ncList as $nc) $ncIdList[] = $nc->id;
$this->session->set('ncIdList', isset($ncIdList) ? $ncIdList : '');
+1 -1
View File
@@ -56,7 +56,7 @@ $lang->my->taskMenu->assignedToMe = 'AssignedToMe';
$lang->my->taskMenu->openedByMe = 'CreatedByMe';
$lang->my->taskMenu->finishedByMe = 'FinishedByMe';
$lang->my->taskMenu->closedByMe = 'ClosedByMe';
$lang->my->taskMenu->canceledByMe = 'CancelledByMe';
$lang->my->taskMenu->assignedByMe = 'AssignedByMe';
$lang->my->storyMenu = new stdclass();
$lang->my->storyMenu->assignedToMe = 'AssignedToMe';
+1
View File
@@ -66,6 +66,7 @@ $lang->my->taskMenu->openedByMe = 'CreatedByMe';
$lang->my->taskMenu->finishedByMe = 'FinishedByMe';
$lang->my->taskMenu->closedByMe = 'ClosedByMe';
$lang->my->taskMenu->canceledByMe = 'CancelledByMe';
$lang->my->taskMenu->assignedByMe = 'AssignedByMe';
$lang->my->storyMenu = new stdclass();
$lang->my->storyMenu->assignedToMe = 'AssignedToMe';
+1
View File
@@ -57,6 +57,7 @@ $lang->my->taskMenu->openedByMe = 'CreatedByMe';
$lang->my->taskMenu->finishedByMe = 'FinishedByMe';
$lang->my->taskMenu->closedByMe = 'ClosedByMe';
$lang->my->taskMenu->canceledByMe = 'CancelledByMe';
$lang->my->taskMenu->assignedByMe = 'AssignedByMe';
$lang->my->storyMenu = new stdclass();
$lang->my->storyMenu->assignedToMe = 'AssignedToMe';
+1
View File
@@ -66,6 +66,7 @@ $lang->my->taskMenu->openedByMe = '由我创建';
$lang->my->taskMenu->finishedByMe = '由我完成';
$lang->my->taskMenu->closedByMe = '由我关闭';
$lang->my->taskMenu->canceledByMe = '由我取消';
$lang->my->taskMenu->assignedByMe = '由我指派';
$lang->my->storyMenu = new stdclass();
$lang->my->storyMenu->assignedToMe = '指派给我';
+1
View File
@@ -65,6 +65,7 @@ $lang->my->taskMenu->openedByMe = '由我創建';
$lang->my->taskMenu->finishedByMe = '由我完成';
$lang->my->taskMenu->closedByMe = '由我關閉';
$lang->my->taskMenu->canceledByMe = '由我取消';
$lang->my->taskMenu->assignedByMe = '由我指派';
$lang->my->storyMenu = new stdclass();
$lang->my->storyMenu->assignedToMe = '指派給我';
+52
View File
@@ -309,4 +309,56 @@ class myModel extends model
return $actions;
}
/**
* Get assigned by me objects.
*
* @param string $account
* @param int $limit
* @param string $orderBy
* @param int $pager
* @param int $projectID
* @param string $objectType
* @access public
* @return array
*/
public function getAssignedByMe($account, $limit = 0, $pager = null, $orderBy = "id_desc", $projectID = 0, $objectType = '')
{
$this->loadModel($objectType);
$objectList = $this->dao->select('t1.*')
->from($this->config->objectTables[$objectType])->alias('t1')
->leftJoin(TABLE_ACTION)->alias('t2')->on("t1.id = t2.objectID and t2.objectType='{$objectType}'")
->where('t2.actor')->eq($account)
->andWhere('t2.action')->eq('assigned')
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager, 't1.id')
->fetchAll('id');
if($objectType == 'task')
{
$projectList = array();
foreach($objectList as $task) $projectList[$task->project] = $task->project;
$projectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectList)->fetchPairs('id');
foreach($objectList as $task) $task->projectName = zget($projectPairs, $task->project);
$executionList = array();
foreach($objectList as $task) $executionList[$task->execution] = $task->execution;
$executionPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($executionList)->fetchPairs('id');
foreach($objectList as $task) $task->executionName = zget($executionPairs, $task->execution);
if($objectList) return $this->loadModel('task')->processTasks($objectList);
return array();
}
if($objectType == 'bug')
{
$productList = array();
foreach($objectList as $bug) $productList[$bug->product] = $bug->product;
$productPairs = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($productList)->fetchPairs('id');
foreach($objectList as $bug) $bug->productName = zget($productPairs, $bug->product);
}
return $objectList;
}
}
+1
View File
@@ -23,6 +23,7 @@
echo html::a(inlink($app->rawMethod, "mode=$mode&type=openedBy"), "<span class='text'>{$lang->bug->openedByMe}</span>" . ($type == 'openedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'openedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=resolvedBy"), "<span class='text'>{$lang->bug->resolvedByMe}</span>" . ($type == 'resolvedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'resolvedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=closedBy"), "<span class='text'>{$lang->bug->closedByMe}</span>" . ($type == 'closedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'closedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=assignedBy"), "<span class='text'>{$lang->my->assignedByMe}</span>" . ($type == 'assignedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'assignedBy' ? ' btn-active-text' : '') . "'");
}
?>
</div>
+5 -4
View File
@@ -20,10 +20,11 @@
<?php $recTotalLabel = " <span class='label label-light label-badge'>{$pager->recTotal}</span>"; ?>
<?php if($app->rawMethod == 'contribute'):?>
<?php
echo html::a(inlink($app->rawMethod, "mode=$mode&type=openedBy"), "<span class='text'>{$lang->my->taskMenu->openedByMe}</span>" . ($type == 'openedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'openedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=finishedBy"), "<span class='text'>{$lang->my->taskMenu->finishedByMe}</span>" . ($type == 'finishedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'finishedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=closedBy"), "<span class='text'>{$lang->my->taskMenu->closedByMe}</span>" . ($type == 'closedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'closedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=canceledBy"), "<span class='text'>{$lang->my->taskMenu->canceledByMe}</span>" . ($type == 'canceledBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'canceledBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=openedBy"), "<span class='text'>{$lang->my->taskMenu->openedByMe}</span>" . ($type == 'openedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'openedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=finishedBy"), "<span class='text'>{$lang->my->taskMenu->finishedByMe}</span>" . ($type == 'finishedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'finishedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=closedBy"), "<span class='text'>{$lang->my->taskMenu->closedByMe}</span>" . ($type == 'closedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'closedBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=canceledBy"), "<span class='text'>{$lang->my->taskMenu->canceledByMe}</span>" . ($type == 'canceledBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'canceledBy' ? ' btn-active-text' : '') . "'");
echo html::a(inlink($app->rawMethod, "mode=$mode&type=assignedBy"), "<span class='text'>{$lang->my->taskMenu->assignedByMe}</span>" . ($type == 'assignedBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'assignedBy' ? ' btn-active-text' : '') . "'");
?>
<?php endif;?>
</div>
+5 -2
View File
@@ -191,9 +191,12 @@ $('#confirmButton').click(function()
if(memberCount < 2)
{
alert(teamMemberError);
return false;
}
else
if(totalLeft == 0 && (taskStatus == 'doing' || taskStatus == 'pause'))
{
$('.close').click();
alert(totalLeftError);
return false;
}
$('.close').click();
});
+3 -1
View File
@@ -18,10 +18,12 @@
<?php js::set('oldAssignedTo', $task->assignedTo);?>
<?php js::set('oldExecutionID', $task->execution);?>
<?php js::set('oldConsumed', $task->consumed);?>
<?php js::set('taskStatus', $task->status);?>
<?php js::set('confirmChangeExecution', $lang->task->confirmChangeExecution);?>
<?php js::set('changeExecutionConfirmed', false);?>
<?php js::set('newRowCount', count($task->team) < 6 ? 6 - count($task->team) : 1);?>
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
<?php js::set('totalLeftError', sprintf($this->lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?>
<div class='main-content' id='mainContent'>
<form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
<div class='main-header'>
@@ -252,7 +254,7 @@
<div class="modal fade modal-team" id="modalTeam" data-scroll-inside='false'>
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<button type="button" class="close hidden" data-dismiss="modal">
<i class="icon icon-close"></i>
</button>
<h4 class="modal-title"><?php echo $lang->task->team?></h4>
+4
View File
@@ -62,6 +62,8 @@ class testcaseModel extends model
$result = $this->loadModel('common')->removeDuplicate('case', $case, $param);
if($result and $result['stop']) return array('status' => 'exists', 'id' => $result['duplicate']);
if(empty($case->product)) $this->config->testcase->create->requiredFields = str_replace('story', '', $this->config->testcase->create->requiredFields);
/* Value of story may be showmore. */
$case->story = (int)$case->story;
$this->dao->insert(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->create->requiredFields, 'notempty')->checkFlow()->exec();
@@ -975,6 +977,8 @@ class testcaseModel extends model
unset($case);
}
if(empty($case->product)) $this->config->testcase->edit->requiredFields = str_replace('story', '', $this->config->testcase->edit->requiredFields);
/* Update cases. */
$this->loadModel('action');
foreach($cases as $caseID => $case)
+1 -1
View File
@@ -54,7 +54,7 @@
<?php if($branchProduct):?>
<th class='c-branch'><?php echo $lang->testcase->branch;?></th>
<?php endif;?>
<th class='c-module<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->testcase->module;?></th>
<th class='c-module<?php echo zget($visibleFields, 'module', ' hidden') . zget($requiredFields, 'module', '', ' required');?>'><?php echo $lang->testcase->module;?></th>
<th class='c-story<?php echo zget($visibleFields, 'story', ' hidden') . zget($requiredFields, 'story', '', ' required');?>'><?php echo $lang->testcase->story;?></th>
<th class='text-left c-title required'><?php echo $lang->testcase->title;?></th>
<th class='c-type required'><?php echo $lang->testcase->type;?></th>
+16
View File
@@ -1733,6 +1733,22 @@ class kanbanTest
return $count;
}
/**
* Get toList and ccList.
*
* @param object $card
* @access public
* @return array
*/
public function getToAndCcListTest($card)
{
$objects = $this->objectModel->getToAndCcList($card);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test check if user can execute an action.
*
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->getToAndCcList();
cid=1
pid=1
获取id=1的卡片发信人员 >> admin;admin
*/
$kanban = new kanbanTest();
$card = $kanban->getCardByIDTest('1');
r($kanban->getToAndCcListTest($card)) && p('0;1') && e('admin;admin'); // 获取id=1的卡片发信人员
@@ -1,9 +1,11 @@
<?php
$config->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'];