* Code for my module details.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE `zt_risk` add `closedBy` char(30) AFTER `assignedTo`;
|
||||
ALTER TABLE `zt_risk` add `closedDate` date AFTER `closedBy`;
|
||||
ALTER TABLE `zt_issue` CHANGE `closeBy` `closedBy` char(30);
|
||||
+3
-1
@@ -554,7 +554,7 @@ CREATE TABLE IF NOT EXISTS `zt_issue` (
|
||||
`editedDate` datetime NOT NULL,
|
||||
`activateBy` varchar(30) NOT NULL,
|
||||
`activateDate` date NOT NULL,
|
||||
`closeBy` varchar(30) NOT NULL,
|
||||
`closedBy` varchar(30) NOT NULL,
|
||||
`closedDate` date NOT NULL,
|
||||
`assignedTo` varchar(30) NOT NULL,
|
||||
`assignedBy` varchar(30) NOT NULL,
|
||||
@@ -892,6 +892,8 @@ CREATE TABLE IF NOT EXISTS `zt_risk` (
|
||||
`activateBy` varchar(30) NOT NULL,
|
||||
`activateDate` date NOT NULL,
|
||||
`assignedTo` varchar(30) NOT NULL,
|
||||
`closedBy` varchar(30) NOT NULL,
|
||||
`closedDate` date NOT NULL,
|
||||
`cancelBy` varchar(30) NOT NULL,
|
||||
`cancelDate` date NOT NULL,
|
||||
`cancelReason` char(30) NOT NULL,
|
||||
|
||||
@@ -146,6 +146,27 @@ class issueModel extends model
|
||||
return $issueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user issues.
|
||||
*
|
||||
* @param string $browseType open|assignto|closed|suspended|canceled
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserIssues($type = 'assignedTo', $orderBy = 'id_desc', $pager)
|
||||
{
|
||||
$issueList = $this->dao->select('*')->from(TABLE_ISSUE)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere($type)->eq($this->app->user->account)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
return $issueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get activity list.
|
||||
*
|
||||
|
||||
+56
-4
@@ -62,11 +62,29 @@ class my extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* My calendar.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function calendar()
|
||||
{
|
||||
$this->locate($this->createLink('my', 'todo'));
|
||||
}
|
||||
|
||||
/**
|
||||
* My work view.
|
||||
*
|
||||
* @param string $mode
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function work($mode = 'task', $type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$moduleIndex = array_search('my', $this->lang->noMenuModule);
|
||||
@@ -75,6 +93,18 @@ class my extends control
|
||||
echo $this->fetch('my', $mode, "type=$type&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
|
||||
}
|
||||
|
||||
/**
|
||||
* My contribute view.
|
||||
*
|
||||
* @param string $mode
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function contribute($mode = 'task', $type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$moduleIndex = array_search('my', $this->lang->noMenuModule);
|
||||
@@ -476,9 +506,20 @@ class my extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function issue()
|
||||
public function issue($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->view->mode = 'issue';
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->my->issue;
|
||||
$this->view->position[] = $this->lang->my->issue;
|
||||
$this->view->mode = 'issue';
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->type = $type;
|
||||
$this->view->issues = $this->loadModel('issue')->getUserIssues($type, $orderBy, $pager);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -488,9 +529,20 @@ class my extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function risk()
|
||||
public function risk($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->view->mode = 'risk';
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->my->risk;
|
||||
$this->view->position[] = $this->lang->my->risk;
|
||||
$this->view->risks = $this->loadModel('risk')->getUserRisks($type, $orderBy, $pager);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->type = $type;
|
||||
$this->view->mode = 'risk';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
|
||||
.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
|
||||
.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
|
||||
.table td.has-child > a:not(.story-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
.table td.has-child > .story-toggle {color: #838a9d; position: relative; top: 1px;}
|
||||
.table td.has-child > .story-toggle:hover {color: #006af1; cursor: pointer;}
|
||||
.table td.has-child > .story-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform:rotate(-90deg); -moz-transform:rotate(-90deg); -o-transform:rotate(-90deg); -webkit-transform:rotate(-90deg); transform: rotate(-90deg);}
|
||||
.table td.has-child > .story-toggle > .icon:before {text-align: left;}
|
||||
.table td.has-child > .story-toggle.collapsed > .icon {-ms-transform:rotate(90deg); -moz-transform:rotate(90deg); -o-transform:rotate(90deg); -webkit-transform:rotate(90deg); transform: rotate(90deg);}
|
||||
.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
|
||||
@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;}}
|
||||
@@ -0,0 +1,20 @@
|
||||
$(function()
|
||||
{
|
||||
$('#storyList td.has-child .story-toggle').each(function()
|
||||
{
|
||||
var $td = $(this).closest('td');
|
||||
var labelWidth = 0;
|
||||
if($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
|
||||
$td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
|
||||
});
|
||||
|
||||
$(document).on('click', '.story-toggle', function(e)
|
||||
{
|
||||
var $toggle = $(this);
|
||||
var id = $(this).data('id');
|
||||
var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
|
||||
$toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
})
|
||||
@@ -14,6 +14,8 @@ $lang->my->requirement = "我的用户{$lang->productSRCommon}";
|
||||
$lang->my->createProgram = '添加项目';
|
||||
$lang->my->project = "我的项目";
|
||||
$lang->my->execution = "我的{$lang->execution->common}";
|
||||
$lang->my->issue = '我的问题';
|
||||
$lang->my->risk = '我的风险';
|
||||
$lang->my->profile = '我的档案';
|
||||
$lang->my->dynamic = '我的动态';
|
||||
$lang->my->editProfile = '修改档案';
|
||||
|
||||
@@ -12,4 +12,72 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('mode', $mode);?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
$recTotalLabel = " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
echo html::a(inlink($app->rawMethod, "mode=$mode&type=assignedTo"), "<span class='text'>{$lang->my->taskMenu->assignedToMe}</span>" . ($type == 'assignedTo' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'assignedTo' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink($app->rawMethod, "mode=$mode&type=createdBy"), "<span class='text'>{$lang->my->taskMenu->openedByMe}</span>" . ($type == 'createdBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'createdBy' ? ' 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' : '') . "'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent">
|
||||
<?php if(empty($issues)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->noData;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form id='myTaskForm' class="main-table table-issue" data-ride="table" method="post">
|
||||
<table class="table has-sort-head table-fixed" id='issuetable'>
|
||||
<?php $vars = "mode=$mode&type=$type&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"; ?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="c-id w-60px"><?php echo common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->type;?></th>
|
||||
<th style="width:auto"><?php echo $lang->issue->title;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->severity;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->pri;?></th>
|
||||
<th class="w-90px"><?php echo $lang->issue->assignedTo;?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->owner;?></th>
|
||||
<th class="w-100px"><?php echo $lang->issue->status;?></th>
|
||||
<th class="w-140px"><?php echo $lang->issue->createdDate;?></th>
|
||||
<th class="c-actions w-200px"><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($issues as $issue):?>
|
||||
<tr>
|
||||
<td class="c-id"><?php printf('%03d', $issue->id);?></td>
|
||||
<td title="<?php echo zget($lang->issue->typeList, $issue->type);?>"><?php echo zget($lang->issue->typeList, $issue->type);?></td>
|
||||
<td class="text-ellipsis" title="<?php echo $issue->title;?>"><?php common::printLink('issue', 'view', "id=$issue->id", $issue->title);?></td>
|
||||
<td title="<?php echo zget($lang->issue->severityList, $issue->severity);?>"><?php echo zget($lang->issue->severityList, $issue->severity);?></td>
|
||||
<td title="<?php echo $issue->pri;?>"><?php echo $issue->pri;?></td>
|
||||
<td title="<?php echo zget($users, $issue->assignedTo);?>"><?php echo zget($users, $issue->assignedTo);?></td>
|
||||
<td title="<?php echo zget($users, $issue->owner);?>"><?php echo zget($users, $issue->owner);?></td>
|
||||
<td title="<?php echo zget($lang->issue->statusList, $issue->status);?>"><?php echo zget($lang->issue->statusList, $issue->status);?></td>
|
||||
<td title="<?php echo $issue->createdDate;?>"><?php echo $issue->createdDate;?></td>
|
||||
<td class="c-actions">
|
||||
<?php
|
||||
$params = "issueID=$issue->id";
|
||||
echo common::printIcon('issue', 'resolve', $params, $issue, 'list', 'checked', '', 'iframe', 'yes', '', $lang->issue->resolve);
|
||||
echo common::printIcon('issue', 'assignTo', $params, $issue, 'list', 'hand-right', '', 'iframe', 'yes', '', $lang->issue->assignTo);
|
||||
echo common::printIcon('issue', 'close', $params, $issue, 'list', 'off', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'cancel', $params, $issue, 'list', 'ban-circle', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'activate', $params, $issue, 'list', 'magic', '', 'iframe', 'yes', '', $lang->issue->activate);
|
||||
echo common::printIcon('issue', 'edit', $params, $issue, 'list', 'edit');
|
||||
$deleteClass = common::hasPriv('issue', 'delete') ? 'btn' : 'btn disabled';
|
||||
echo html::a($this->createLink('issue', 'delete', $params), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->issue->delete}' class='$deleteClass'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-footer">
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -12,4 +12,70 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('mode', $mode);?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
$recTotalLabel = " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
|
||||
echo html::a(inlink($app->rawMethod, "mode=$mode&type=assignedTo"), "<span class='text'>{$lang->my->taskMenu->assignedToMe}</span>" . ($type == 'assignedTo' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'assignedTo' ? ' btn-active-text' : '') . "'");
|
||||
echo html::a(inlink($app->rawMethod, "mode=$mode&type=createdBy"), "<span class='text'>{$lang->my->taskMenu->openedByMe}</span>" . ($type == 'createdBy' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'createdBy' ? ' 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' : '') . "'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent">
|
||||
<?php if(empty($risks)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->noData;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form id='myTaskForm' class="main-table table-risk" data-ride="table" method="post">
|
||||
<table class="table has-sort-head table-fixed" id='risktable'>
|
||||
<?php $vars = "mode=$mode&type=$type&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"; ?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='text-left w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->risk->id);?></th>
|
||||
<th class='text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->risk->name);?></th>
|
||||
<th class='w-80px'><?php common::printOrderLink('strategy', $orderBy, $vars, $lang->risk->strategy);?></th>
|
||||
<th class='w-80px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->risk->status);?></th>
|
||||
<th class='w-120px'><?php common::printOrderLink('identifiedDate', $orderBy, $vars, $lang->risk->identifiedDate);?></th>
|
||||
<th class='w-80px'><?php common::printOrderLink('rate', $orderBy, $vars, $lang->risk->rate);?></th>
|
||||
<th class='w-80px'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->risk->pri);?></th>
|
||||
<th class='w-120px'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->risk->assignedTo);?></th>
|
||||
<th class='w-120px'><?php common::printOrderLink('category', $orderBy, $vars, $lang->risk->category);?></th>
|
||||
<th class='w-180px'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($risks as $risk):?>
|
||||
<tr>
|
||||
<td><?php echo $risk->id;?></td>
|
||||
<td><?php echo html::a($this->createLink('risk', 'view', "riskID=$risk->id"), $risk->name);?></td>
|
||||
<td><?php echo zget($lang->risk->strategyList, $risk->strategy);?></td>
|
||||
<td><?php echo zget($lang->risk->statusList, $risk->status);?></td>
|
||||
<td><?php echo $risk->identifiedDate == '0000-00-00' ? '' : $risk->identifiedDate;?></td>
|
||||
<td><?php echo $risk->rate;?></td>
|
||||
<td><?php echo zget($lang->risk->priList, $risk->pri)?></td>
|
||||
<td><?php echo $this->risk->printAssignedHtml($risk, $users);;?></td>
|
||||
<td><?php echo zget($lang->risk->categoryList, $risk->category);?></td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$params = "riskID=$risk->id";
|
||||
common::printIcon('risk', 'track', $params, $risk, "list", 'checked');
|
||||
common::printIcon('risk', 'close', $params, $risk, "list", '', '', 'iframe', true);
|
||||
common::printIcon('risk', 'cancel', $params, $risk, "list", '', '', 'iframe', true);
|
||||
common::printIcon('risk', 'hangup', $params, $risk, "list", 'arrow-up', '', 'iframe', true);
|
||||
common::printIcon('risk', 'activate', $params, $risk, "list", '', '', 'iframe', true);
|
||||
common::printIcon('risk', 'edit', $params, $risk, "list");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-footer">
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -133,7 +133,6 @@
|
||||
<?php echo '<span class="label label-badge label-light" title="' . $this->lang->story->children .'">' . $this->lang->story->childrenAB . '</span> ' . html::a($storyLink, $child->title, null, "style='color: $child->color'");?>
|
||||
</td>
|
||||
<td class='c-product'><?php echo $child->productTitle;?></td>
|
||||
<?php if($storyType == 'story'):?>
|
||||
<td class='c-plan'><?php echo $child->planTitle;?></td>
|
||||
<td class='c-user'><?php echo zget($users, $child->openedBy);?></td>
|
||||
<td class='c-hours'><?php echo $child->estimate;?></td>
|
||||
|
||||
@@ -232,6 +232,27 @@ class riskModel extends model
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user risks.
|
||||
*
|
||||
* @param string $browseType open|assignto|closed|suspended|canceled
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserRisks($type = 'assignedTo', $orderBy = 'id_desc', $pager)
|
||||
{
|
||||
$riskList = $this->dao->select('*')->from(TABLE_RISK)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere($type)->eq($this->app->user->account)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
return $riskList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print assignedTo html
|
||||
*
|
||||
@@ -325,6 +346,8 @@ class riskModel extends model
|
||||
->setDefault('status','closed')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', helper::today())
|
||||
->add('closedBy', $this->app->user->account)
|
||||
->add('closedDate', helper::today())
|
||||
->stripTags($this->config->risk->editor->close['id'], $this->config->allowedTags)
|
||||
->remove('uid,comment')
|
||||
->get();
|
||||
|
||||
Reference in New Issue
Block a user