* finish task #3761.
This commit is contained in:
@@ -25,6 +25,7 @@ $lang->action->undelete = '还原';
|
||||
$lang->action->hideOne = '隐藏';
|
||||
$lang->action->hideAll = '全部隐藏';
|
||||
$lang->action->editComment = '修改备注';
|
||||
$lang->action->create = '添加备注';
|
||||
$lang->action->comment = '备注';
|
||||
|
||||
$lang->action->trashTips = '提示:为了保证系统的完整性,禅道系统的删除都是标记删除。';
|
||||
|
||||
@@ -107,7 +107,7 @@ config.confirmRemoveBlock = '<?php echo $lang->block->confirmRemoveBlock; ?>';
|
||||
var module = '<?php echo $module?>';
|
||||
var useGuest = <?php echo $useGuest ? 'true' : 'false';?>;
|
||||
<?php if(!$useGuest):?>
|
||||
$('#subHeader #pageActions').append(<?php echo json_encode(html::a($this->createLink("block", "admin", "id=0&module=$module"), "<i class='icon icon-plus text-muted'></i> {$lang->block->createBlock}", '', "class='btn btn-default' data-toggle='modal' data-type='ajax' data-width='700' data-title='{$lang->block->createBlock}'"))?>);
|
||||
$('#subHeader #pageActions .btn-toolbar:last').append(<?php echo json_encode(html::a($this->createLink("block", "admin", "id=0&module=$module"), "<i class='icon icon-plus text-muted'></i> {$lang->block->createBlock}", '', "class='btn btn-default' data-toggle='modal' data-type='ajax' data-width='700' data-title='{$lang->block->createBlock}'"))?>);
|
||||
<?php endif;?>
|
||||
</script>
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<?php if(isset($project->delay)):?>
|
||||
<span class="project-status-delayed"><span class="label label-dot"></span> <?php echo $lang->project->delayed;?></span>
|
||||
<?php else:?>
|
||||
<span class="project-status-<?php echo $project->status?>"><span class="label label-dot"></span> <?php echo $lang->project->statusList[$project->status];?></span>
|
||||
<span class="project-status-<?php echo $project->status?>"><span class="label label-dot"></span> <?php echo zget($lang->project->statusList, $project->status, '');?></span>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td class="c-estimate"><?php echo $project->hours->totalEstimate;?></td>
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<?php js::set('module', $module);?>
|
||||
<?php js::set('method', $method);?>
|
||||
<?php js::set('extra', $extra);?>
|
||||
<input type='text' class='form-control' id='search' value='' placeholder='<?php echo $this->app->loadLang('search')->search->common;?>'/>
|
||||
<div id='searchResult'>
|
||||
<div id='defaultMenu' class='search-list'>
|
||||
<ul>
|
||||
<?php
|
||||
foreach($branches as $branchID => $branch)
|
||||
{
|
||||
echo "<li data-id='{$branchID}' data-key='{$branchesPinyin[$branch]}'>" . html::a(sprintf($link, $productID, $branchID), "<i class='icon-cube'></i> " . $branch, '', "class='text-important'"). "</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example">
|
||||
<input type="search" class="form-control search-input">
|
||||
<label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
|
||||
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<?php
|
||||
foreach($branches as $branchID => $branch)
|
||||
{
|
||||
echo html::a(sprintf($link, $productID, $branchID), "<i class='icon-cube'></i> " . $branch, '', "data-filter='{$branchesPinyin[$branch]}'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -555,11 +555,11 @@ $lang->icons['runCase'] = 'play';
|
||||
$lang->icons['batchRun'] = 'play-sign';
|
||||
$lang->icons['assign'] = 'hand-right';
|
||||
$lang->icons['assignTo'] = 'hand-right';
|
||||
$lang->icons['change'] = 'random';
|
||||
$lang->icons['change'] = 'fork';
|
||||
$lang->icons['link'] = 'link';
|
||||
$lang->icons['close'] = 'off';
|
||||
$lang->icons['activate'] = 'magic';
|
||||
$lang->icons['review'] = 'review';
|
||||
$lang->icons['review'] = 'glasses';
|
||||
$lang->icons['confirm'] = 'search';
|
||||
$lang->icons['confirmBug'] = 'search';
|
||||
$lang->icons['putoff'] = 'calendar';
|
||||
|
||||
@@ -190,7 +190,6 @@ $lang->score->menu = $lang->my->menu;
|
||||
$lang->product = new stdclass();
|
||||
$lang->product->menu = new stdclass();
|
||||
|
||||
$lang->product->menu->list = array('link' => '%s', 'fixed' => true);
|
||||
$lang->product->menu->story = array('link' => '需求|product|browse|productID=%s', 'alias' => 'batchedit', 'subModule' => 'story');
|
||||
$lang->product->menu->dynamic = '动态|product|dynamic|productID=%s';
|
||||
$lang->product->menu->plan = array('link' => '计划|productplan|browse|productID=%s', 'subModule' => 'productplan');
|
||||
@@ -201,9 +200,6 @@ $lang->product->menu->branch = '@branch@|branch|manage|productID=%s';
|
||||
$lang->product->menu->module = '模块|tree|browse|productID=%s&view=story';
|
||||
$lang->product->menu->view = array('link' => '概况|product|view|productID=%s', 'alias' => 'edit');
|
||||
$lang->product->menu->project = "{$lang->projectCommon}|product|project|status=all&productID=%s";
|
||||
$lang->product->menu->create = array('link' => "<i class='icon-plus'></i> 添加{$lang->productCommon}|product|create", 'float' => 'right');
|
||||
$lang->product->menu->all = array('link' => "<i class='icon-cubes'></i> 所有{$lang->productCommon}|product|all|productID=%s", 'float' => 'right');
|
||||
$lang->product->menu->index = array('link' => "<i class='icon-home'></i>{$lang->productCommon}主页|product|index|locate=no", 'float' => 'right');
|
||||
|
||||
$lang->story = new stdclass();
|
||||
$lang->productplan = new stdclass();
|
||||
@@ -555,11 +551,11 @@ $lang->icons['runCase'] = 'play';
|
||||
$lang->icons['batchRun'] = 'play-sign';
|
||||
$lang->icons['assign'] = 'hand-right';
|
||||
$lang->icons['assignTo'] = 'hand-right';
|
||||
$lang->icons['change'] = 'random';
|
||||
$lang->icons['change'] = 'fork';
|
||||
$lang->icons['link'] = 'link';
|
||||
$lang->icons['close'] = 'off';
|
||||
$lang->icons['activate'] = 'magic';
|
||||
$lang->icons['review'] = 'review';
|
||||
$lang->icons['review'] = 'glasses';
|
||||
$lang->icons['confirm'] = 'search';
|
||||
$lang->icons['confirmBug'] = 'search';
|
||||
$lang->icons['putoff'] = 'calendar';
|
||||
|
||||
+35
-1
@@ -672,7 +672,7 @@ class commonModel extends model
|
||||
global $lang;
|
||||
|
||||
if(!commonModel::hasPriv('action', 'comment', $object)) return false;
|
||||
echo html::a('#commentBox', '<i class="icon-comment-alt"></i>', '', "title='$lang->comment' onclick='setComment()' class='btn'");
|
||||
echo html::a('#commentBox', '<i class="icon icon-chat-line"></i> ' . $lang->action->create, '', "title='$lang->comment' onclick=\"toggleComment('#commentBox')\" class='btn btn-link pull-right'");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -833,6 +833,40 @@ class commonModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
static public function printBack($backLink)
|
||||
{
|
||||
global $lang, $app;
|
||||
if(isonlybody()) return false;
|
||||
|
||||
$title = $lang->goback . $lang->backShortcutKey;
|
||||
echo html::a($backLink, '<i class="icon-goback icon-level-up icon-large icon-rotate-270"></i>', '', "id='back' class='btn' title={$title}");
|
||||
}
|
||||
|
||||
public static function printPreAndNext($preAndNext = '', $linkTemplate = '')
|
||||
{
|
||||
global $lang, $app;
|
||||
if(isonlybody()) return false;
|
||||
|
||||
echo "<nav class='container'>";
|
||||
if(isset($preAndNext->pre) and $preAndNext->pre)
|
||||
{
|
||||
$id = (isset($_SESSION['testcaseOnlyCondition']) and !$_SESSION['testcaseOnlyCondition'] and $app->getModuleName() == 'testcase' and isset($preAndNext->pre->case)) ? 'case' : 'id';
|
||||
$title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name;
|
||||
$title = '#' . $preAndNext->pre->$id . ' ' . $title . ' ' . $lang->preShortcutKey;
|
||||
$link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->pre->$id) : inLink('view', "ID={$preAndNext->pre->$id}");
|
||||
echo html::a($link, '<i class="icon-pre icon-chevron-left"></i>', '', "id='prevPage' class='btn btn-info' title='{$title}'");
|
||||
}
|
||||
if(isset($preAndNext->next) and $preAndNext->next)
|
||||
{
|
||||
$id = (isset($_SESSION['testcaseOnlyCondition']) and !$_SESSION['testcaseOnlyCondition'] and $app->getModuleName() == 'testcase' and isset($preAndNext->next->case)) ? 'case' : 'id';
|
||||
$title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name;
|
||||
$title = '#' . $preAndNext->next->$id . ' ' . $title . ' ' . $lang->nextShortcutKey;
|
||||
$link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->next->$id) : inLink('view', "ID={$preAndNext->next->$id}");
|
||||
echo html::a($link, '<i class="icon-pre icon-chevron-right"></i>', '', "id='nextPage' class='btn btn-info' title='$title'");
|
||||
}
|
||||
echo '</nav>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create changes of one object.
|
||||
*
|
||||
|
||||
+178
-180
@@ -1,183 +1,181 @@
|
||||
<style>
|
||||
#actionbox a{font-weight:normal}
|
||||
.col-side fieldset#actionbox{padding-right:5px;}
|
||||
.col-side #actionbox #historyItem li span.item{white-space:nowrap}
|
||||
.changes blockquote{font-family: monospace, serif;}
|
||||
</style>
|
||||
<script language='Javascript'>
|
||||
var fold = '<?php echo $lang->fold;?>';
|
||||
var unfold = '<?php echo $lang->unfold;?>';
|
||||
function switchChange(historyID)
|
||||
{
|
||||
$swbtn = $('#switchButton' + historyID);
|
||||
$showTag = $swbtn.find('.change-show');
|
||||
if($showTag.length)
|
||||
{
|
||||
$swbtn.closest('li').addClass('show-changes');
|
||||
$showTag.removeClass('change-show').addClass('change-hide');
|
||||
$('#changeBox' + historyID).show();
|
||||
$('#changeBox' + historyID).prev('.changeDiff').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$swbtn.closest('li').removeClass('show-changes');
|
||||
$swbtn.find('.change-hide').removeClass('change-hide').addClass('change-show');
|
||||
$('#changeBox' + historyID).hide();
|
||||
$('#changeBox' + historyID).prev('.changeDiff').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleStripTags(obj)
|
||||
{
|
||||
var btn = $(obj);
|
||||
var diffTag = btn.find('.icon-file-code');
|
||||
if(diffTag.length)
|
||||
{
|
||||
diffTag.removeClass('icon-file-code').addClass('diff-short');
|
||||
btn.attr('title', '<?php echo $lang->action->textDiff?>');
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.find('.diff-short').removeClass('diff-short').addClass('icon-file-code');
|
||||
btn.attr('title', '<?php echo $lang->action->original?>');
|
||||
}
|
||||
var boxObj = $(obj).next();
|
||||
var oldDiff = '';
|
||||
var newDiff = '';
|
||||
$(boxObj).find('blockquote').each(function(){
|
||||
oldDiff = $(this).html();
|
||||
newDiff = $(this).next().html();
|
||||
$(this).html(newDiff);
|
||||
$(this).next().html(oldDiff);
|
||||
})
|
||||
}
|
||||
|
||||
function toggleShow(obj)
|
||||
{
|
||||
$showTag = $(obj).find('.change-show');
|
||||
if($showTag.length)
|
||||
{
|
||||
$showTag.removeClass('change-show').addClass('change-hide');
|
||||
$('#historyItem > li:not(.show-changes) .switch-btn').click();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).find('.change-hide').removeClass('change-hide').addClass('change-show');
|
||||
$('#historyItem > li.show-changes .switch-btn').click();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleOrder(obj)
|
||||
{
|
||||
var $orderTag = $(obj).find('.log-asc');
|
||||
if($orderTag.length)
|
||||
{
|
||||
$orderTag.attr('class', 'icon- log-desc');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).find('.log-desc').attr('class', 'icon- log-asc');
|
||||
}
|
||||
$("#historyItem li").reverseOrder();
|
||||
window.editor['lastComment'].remove();
|
||||
initKindeditor();
|
||||
}
|
||||
|
||||
function toggleComment(actionID)
|
||||
{
|
||||
$('.comment' + actionID).toggle();
|
||||
$('#lastCommentBox').toggle();
|
||||
$('.ke-container').css('width', '100%');
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
var diffButton = "<a href='javascript:;' onclick='toggleStripTags(this)' class='changeDiff btn-icon' style='display:none;' title='<?php echo $lang->action->original?>'><i class='icon- icon-file-code'></i></a>";
|
||||
var newBoxID = ''
|
||||
var oldBoxID = ''
|
||||
$('blockquote').each(function()
|
||||
{
|
||||
newBoxID = $(this).parent().attr('id');
|
||||
if(newBoxID != oldBoxID)
|
||||
{
|
||||
oldBoxID = newBoxID;
|
||||
if($(this).html() != $(this).next().html()) $(this).parent().before(diffButton);
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
<script src='<?php echo $jsRoot;?>jquery/reverseorder/raw.js' type='text/javascript'></script>
|
||||
|
||||
<?php if(!isset($actionTheme)) $actionTheme = 'fieldset';?>
|
||||
<?php if($actionTheme == 'fieldset'):?>
|
||||
<fieldset id='actionbox' class='actionbox'>
|
||||
<legend>
|
||||
<i class='icon-time'></i>
|
||||
<?php echo $lang->history?>
|
||||
<a class='btn-icon' href='javascript:;' onclick='toggleOrder(this)'> <?php echo "<span title='$lang->reverse' class='log-asc icon-'></span>";?></a>
|
||||
<a class='btn-icon' href='javascript:;' onclick='toggleShow(this);'><?php echo "<span title='$lang->switchDisplay' class='change-show icon-'></span>";?></a>
|
||||
</legend>
|
||||
<?php else:?>
|
||||
<div id='actionbox' class='actionbox panel panel-sm'>
|
||||
<div class='panel-heading'>
|
||||
<i class='icon-time'></i> <strong><?php echo $lang->history?></strong>
|
||||
<div class='panel-actions'>
|
||||
<a class='btn btn-mini' href='javascript:;' onclick='toggleOrder(this);' class='hand'> <?php echo "<span title='$lang->reverse' class='log-asc icon-'></span>";?></a>
|
||||
<a class='btn btn-mini' href='javascript:;' onclick='toggleShow(this);' class='hand'><?php echo "<span title='$lang->switchDisplay' class='change-show icon-'></span>";?></a>
|
||||
</div>
|
||||
<div class="detail histories" id='actionbox'>
|
||||
<style>
|
||||
#actionbox a{font-weight:normal}
|
||||
.col-side #actionbox{padding-right:5px;}
|
||||
.col-side #actionbox .histories-list li span.item{white-space:nowrap}
|
||||
#commentBox{margin-bottom:8px;}
|
||||
</style>
|
||||
<script language='Javascript'>
|
||||
var fold = '<?php echo $lang->fold;?>';
|
||||
var unfold = '<?php echo $lang->unfold;?>';
|
||||
function switchChange(historyID)
|
||||
{
|
||||
$swbtn = $('#switchButton' + historyID);
|
||||
$showTag = $swbtn.find('.change-show');
|
||||
if($showTag.length)
|
||||
{
|
||||
$swbtn.closest('li').addClass('show-changes');
|
||||
$showTag.removeClass('change-show').addClass('change-hide');
|
||||
$('#changeBox' + historyID).show();
|
||||
$swbtn.closest('li').find('.item .changeDiff').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$swbtn.closest('li').removeClass('show-changes');
|
||||
$swbtn.find('.change-hide').removeClass('change-hide').addClass('change-show');
|
||||
$('#changeBox' + historyID).hide();
|
||||
$swbtn.closest('li').find('.item .changeDiff').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleStripTags(obj)
|
||||
{
|
||||
var btn = $(obj);
|
||||
var diffTag = btn.find('.icon-code');
|
||||
if(diffTag.length)
|
||||
{
|
||||
diffTag.removeClass('icon-code').addClass('diff-short');
|
||||
btn.attr('title', '<?php echo $lang->action->textDiff?>');
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.find('.diff-short').removeClass('diff-short').addClass('icon-code');
|
||||
btn.attr('title', '<?php echo $lang->action->original?>');
|
||||
}
|
||||
var boxObj = $(obj).closest('li').find('.history-changes');
|
||||
var oldDiff = '';
|
||||
var newDiff = '';
|
||||
$(boxObj).find('blockquote').each(function(){
|
||||
oldDiff = $(this).html();
|
||||
newDiff = $(this).next().html();
|
||||
$(this).html(newDiff);
|
||||
$(this).next().html(oldDiff);
|
||||
})
|
||||
}
|
||||
|
||||
function toggleShow(obj)
|
||||
{
|
||||
$showTag = $(obj);
|
||||
if($showTag.hasClass('change-show'))
|
||||
{
|
||||
$showTag.removeClass('change-show').addClass('change-hide');
|
||||
$('.histories-list li.show-changes .item .switch-btn').click();
|
||||
}
|
||||
else
|
||||
{
|
||||
$showTag.removeClass('change-hide').addClass('change-show');
|
||||
$('.histories-list li:not(.show-changes) .item .switch-btn').click();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleOrder(obj)
|
||||
{
|
||||
var $orderTag = $(obj).find('.log-asc');
|
||||
if($orderTag.length)
|
||||
{
|
||||
$orderTag.attr('class', 'icon- log-desc');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(obj).find('.log-desc').attr('class', 'icon- log-asc');
|
||||
}
|
||||
$(".histories-list li").reverseOrder();
|
||||
window.editor['lastComment'].remove();
|
||||
initKindeditor();
|
||||
}
|
||||
|
||||
function toggleComment(actionID)
|
||||
{
|
||||
if(actionID == '#commentBox')
|
||||
{
|
||||
$(actionID).toggle();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.comment' + actionID).toggle();
|
||||
$('#lastCommentBox').toggle();
|
||||
$('.ke-container').css('width', '100%');
|
||||
}
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
var diffButton = "<button tye='button' onclick='toggleStripTags(this)' class='btn btn-mini changeDiff btn-icon' style='display:none;' title='<?php echo $lang->action->original?>'><i class='icon icon-sm icon-code'></i></button>";
|
||||
var newBoxID = ''
|
||||
var oldBoxID = ''
|
||||
$('blockquote').each(function()
|
||||
{
|
||||
newBoxID = $(this).parent().attr('id');
|
||||
if(newBoxID != oldBoxID)
|
||||
{
|
||||
oldBoxID = newBoxID;
|
||||
if($(this).html() != $(this).next().html()) $(this).closest('li').find('.item').append(diffButton);
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
<script src='<?php echo $jsRoot;?>jquery/reverseorder/raw.js' type='text/javascript'></script>
|
||||
<div class="detail-title">
|
||||
<?php echo $lang->history?>
|
||||
<button type="button" onclick='toggleOrder(this);' class="btn btn-mini btn-icon"><i class="icon icon-arrow-up icon-sm"></i></button>
|
||||
<button type="button" onclick='toggleShow(this);' class="btn btn-mini btn-icon"><i class="icon icon-plus icon-sm"></i></button>
|
||||
<?php if(isset($actionFormLink)) echo common::printCommentIcon($this->moduleName);?>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<?php endif;?>
|
||||
<ol id='historyItem'>
|
||||
<?php $i = 1; ?>
|
||||
<?php foreach($actions as $action):?>
|
||||
<?php $canEditComment = (end($actions) == $action and $action->comment and $this->methodName == 'view' and $action->actor == $this->app->user->account and common::hasPriv('action', 'editComment'));?>
|
||||
<li value='<?php echo $i ++;?>'>
|
||||
<?php
|
||||
if(isset($users[$action->actor])) $action->actor = $users[$action->actor];
|
||||
if($action->action == 'assigned' and isset($users[$action->extra]) ) $action->extra = $users[$action->extra];
|
||||
if(strpos($action->actor, ':') !== false) $action->actor = substr($action->actor, strpos($action->actor, ':') + 1);
|
||||
?>
|
||||
<span class='item'>
|
||||
<?php $this->action->printAction($action);?>
|
||||
<?php if(!empty($action->history)) echo "<a id='switchButton$i' class='switch-btn btn-icon' onclick='switchChange($i)' href='javascript:;'><i class='change-show icon-'></i></a>";?>
|
||||
</span>
|
||||
<?php if(!empty($action->comment) or !empty($action->history)):?>
|
||||
<?php if(!empty($action->comment)) echo "<div class='history'>";?>
|
||||
<div class='changes hide alert' id='changeBox<?php echo $i;?>'>
|
||||
<?php echo $this->action->printChanges($action->objectType, $action->history);?>
|
||||
</div>
|
||||
<?php if($canEditComment):?>
|
||||
<span class='pull-right comment<?php echo $action->id;?>'><?php echo html::a('javascript:toggleComment(' . $action->id . ')', '<i class="icon-pencil"></i>', '', "class='btn btn-mini' style='border:none'")?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
if($action->comment)
|
||||
{
|
||||
echo "<div class='article-content comment$action->id'>";
|
||||
echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment;
|
||||
echo "</div>";
|
||||
}
|
||||
<div class="detail-content">
|
||||
<?php if(isset($actionFormLink)):?>
|
||||
<div id='commentBox' class='hide'>
|
||||
<form method='post' action='<?php echo $actionFormLink;?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton() . html::commonButton($lang->goback, "onclick=\"toggleComment('#commentBox')\"");?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<ol class='histories-list'>
|
||||
<?php $i = 1; ?>
|
||||
<?php foreach($actions as $action):?>
|
||||
<?php $canEditComment = (end($actions) == $action and $action->comment and $this->methodName == 'view' and $action->actor == $this->app->user->account and common::hasPriv('action', 'editComment'));?>
|
||||
<li value='<?php echo $i ++;?>'>
|
||||
<?php
|
||||
if(isset($users[$action->actor])) $action->actor = $users[$action->actor];
|
||||
if($action->action == 'assigned' and isset($users[$action->extra]) ) $action->extra = $users[$action->extra];
|
||||
if(strpos($action->actor, ':') !== false) $action->actor = substr($action->actor, strpos($action->actor, ':') + 1);
|
||||
?>
|
||||
<?php if($canEditComment):?>
|
||||
<div class='hide' id='lastCommentBox'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'editComment', "actionID=$action->id")?>'>
|
||||
<table align='center' class='table table-form bd-0'>
|
||||
<tr><td style='padding-right: 0'><?php echo html::textarea('lastComment', htmlspecialchars($action->comment), "style='width:100%;height:100px'");?></td></tr>
|
||||
<tr><td><?php echo html::submitButton() . html::a("javascript:toggleComment($action->id)", $lang->goback, '', "class='btn'");?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<span class='item'>
|
||||
<?php $this->action->printAction($action);?>
|
||||
<?php if(!empty($action->history)) echo "<button id='switchButton$i' type='button' class='btn btn-mini switch-btn btn-icon' onclick='switchChange($i)'><i class='change-show icon icon-plus icon-sm'></i></button>";?>
|
||||
</span>
|
||||
<?php if(!empty($action->comment) or !empty($action->history)):?>
|
||||
<?php if(!empty($action->comment)) echo "<div class='history'>";?>
|
||||
<div class='history-changes hide alert' id='changeBox<?php echo $i;?>'>
|
||||
<?php echo $this->action->printChanges($action->objectType, $action->history);?>
|
||||
</div>
|
||||
<?php if($canEditComment):?>
|
||||
<span class='pull-right comment<?php echo $action->id;?>'><?php echo html::commonButton('<i class="icon icon-edit icon-sm"></i>', "onclick=\"toggleComment('{$action->id}')\" style='border:0;'", 'btn btn-mini')?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
if($action->comment)
|
||||
{
|
||||
echo "<div class='article-content comment$action->id'>";
|
||||
echo strip_tags($action->comment) == $action->comment ? nl2br($action->comment) : $action->comment;
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
<?php if($canEditComment):?>
|
||||
<div class='hide' id='lastCommentBox'>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'editComment', "actionID=$action->id")?>'>
|
||||
<table align='center' class='table table-form bd-0'>
|
||||
<tr><td style='padding-right: 0'><?php echo html::textarea('lastComment', htmlspecialchars($action->comment), "style='width:100%;height:100px'");?></td></tr>
|
||||
<tr><td><?php echo html::submitButton() . html::a("javascript:toggleComment($action->id)", $lang->goback, '', "class='btn'");?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!empty($action->comment)) echo "</div>";?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!empty($action->comment)) echo "</div>";?>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ol>
|
||||
|
||||
<?php if($actionTheme == 'fieldset'):?>
|
||||
</fieldset>
|
||||
<?php else:?>
|
||||
</div></div>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,9 +38,9 @@ if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
|
||||
</div>
|
||||
<div id='subHeader'>
|
||||
<div class='container'>
|
||||
<div id="pageNav"></div>
|
||||
<div id="pageNav" class='btn-toolbar'><?php if(isset($lang->modulePageNav)) echo $lang->modulePageNav;?></div>
|
||||
<nav id='subNavbar'><?php common::printModuleMenu($this->moduleName);?></nav>
|
||||
<div id="pageActions"></div>
|
||||
<div id="pageActions"><div class='btn-toolbar'><?php if(isset($lang->modulePageActions)) echo $lang->modulePageActions;?></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -2,95 +2,94 @@
|
||||
$sessionString = $config->requestType == 'PATH_INFO' ? '?' : '&';
|
||||
$sessionString .= session_name() . '=' . session_id();
|
||||
?>
|
||||
<style>
|
||||
.files-list {margin: 0;}
|
||||
.files-list > .list-group-item {padding: 0px; border:0px;}
|
||||
.files-list > .list-group-item a, .files-list > .list-group-item span{color: #666}
|
||||
.files-list > .list-group-item:hover a, .files-list > .list-group-item:hover span{color: #333}
|
||||
.files-list > .list-group-item > .right-icon {opacity: 0.01; transition: all 0.3s;}
|
||||
.files-list > .list-group-item:hover >
|
||||
.right-icon {opacity: 1}
|
||||
.files-list .btn-icon > i {font-size:15px}
|
||||
</style>
|
||||
<script language='Javascript'>
|
||||
$(function(){
|
||||
$(".edit").modalTrigger({width:350, type:'iframe'});
|
||||
})
|
||||
|
||||
/* Delete a file. */
|
||||
function deleteFile(fileID)
|
||||
{
|
||||
if(!fileID) return;
|
||||
hiddenwin.location.href =createLink('file', 'delete', 'fileID=' + fileID);
|
||||
}
|
||||
/* Download a file, append the mouse to the link. Thus we call decide to open the file in browser no download it. */
|
||||
function downloadFile(fileID, extension, imageWidth)
|
||||
{
|
||||
if(!fileID) return;
|
||||
var fileTypes = 'txt,jpg,jpeg,gif,png,bmp';
|
||||
var sessionString = '<?php echo $sessionString;?>';
|
||||
var windowWidth = $(window).width();
|
||||
var url = createLink('file', 'download', 'fileID=' + fileID + '&mouse=left') + sessionString;
|
||||
width = (windowWidth > imageWidth) ? ((imageWidth < windowWidth*0.5) ? windowWidth*0.5 : imageWidth) : windowWidth;
|
||||
if(fileTypes.indexOf(extension) >= 0)
|
||||
{
|
||||
$('<a>').modalTrigger({url: url, type: 'iframe', width: width}).trigger('click');
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<?php if($files):?>
|
||||
<?php if($fieldset == 'true'):?>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->file->common;?></legend>
|
||||
<?php endif;?>
|
||||
<div class='list-group files-list'>
|
||||
<?php
|
||||
foreach($files as $file)
|
||||
<div class="detail">
|
||||
<script language='Javascript'>
|
||||
$(function(){
|
||||
$(".edit").modalTrigger({width:350, type:'iframe'});
|
||||
})
|
||||
|
||||
/* Delete a file. */
|
||||
function deleteFile(fileID)
|
||||
{
|
||||
if(common::hasPriv('file', 'download'))
|
||||
{
|
||||
$uploadDate = $lang->file->uploadDate . substr($file->addedDate, 0, 10);
|
||||
$fileTitle = "<li title='{$uploadDate}' class='list-group-item'><i class='icon-file-text text-muted icon'></i> " . $file->title .'.' . $file->extension;
|
||||
$imageWidth = 0;
|
||||
if(stripos('jpg|jpeg|gif|png|bmp', $file->extension) !== false)
|
||||
{
|
||||
$imageSize = getimagesize($file->realPath);
|
||||
$imageWidth = $imageSize ? $imageSize[0] : 0;
|
||||
}
|
||||
echo html::a($this->createLink('file', 'download', "fileID=$file->id") . $sessionString, $fileTitle, '_blank', "onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth)\"");
|
||||
|
||||
/* Show size info. */
|
||||
if($file->size < 1024)
|
||||
{
|
||||
echo "<span>(" . $file->size . 'B' . ")</span>";
|
||||
}
|
||||
elseif($file->size < 1024 * 1024)
|
||||
{
|
||||
$file->size = round($file->size / 1024, 2);
|
||||
echo "<span>(" . $file->size . 'K' . ")</span>";
|
||||
}
|
||||
elseif($file->size < 1024 * 1024 * 1024)
|
||||
{
|
||||
$file->size = round($file->size / (1024 * 1024), 2);
|
||||
echo "<span>(" . $file->size . 'M' . ")</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$file->size = round($file->size / (1024 * 1024 * 1024), 2);
|
||||
echo "<span>(" . $file->size . 'G' . ")</span>";
|
||||
}
|
||||
|
||||
echo "<span class='right-icon'>";
|
||||
common::printLink('file', 'edit', "fileID=$file->id", "<i class='icon-pencil'></i>", '', "class='edit btn-icon' title='{$lang->file->edit}'");
|
||||
if(common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon-remove'></i>", '', "class='btn-icon' onclick='deleteFile($file->id)' title='$lang->delete'");
|
||||
echo '</span>';
|
||||
echo '</li>';
|
||||
}
|
||||
if(!fileID) return;
|
||||
hiddenwin.location.href =createLink('file', 'delete', 'fileID=' + fileID);
|
||||
}
|
||||
?>
|
||||
/* Download a file, append the mouse to the link. Thus we call decide to open the file in browser no download it. */
|
||||
function downloadFile(fileID, extension, imageWidth)
|
||||
{
|
||||
if(!fileID) return;
|
||||
var fileTypes = 'txt,jpg,jpeg,gif,png,bmp';
|
||||
var sessionString = '<?php echo $sessionString;?>';
|
||||
var windowWidth = $(window).width();
|
||||
var url = createLink('file', 'download', 'fileID=' + fileID + '&mouse=left') + sessionString;
|
||||
width = (windowWidth > imageWidth) ? ((imageWidth < windowWidth*0.5) ? windowWidth*0.5 : imageWidth) : windowWidth;
|
||||
if(fileTypes.indexOf(extension) >= 0)
|
||||
{
|
||||
$('<a>').modalTrigger({url: url, type: 'iframe', width: width}).trigger('click');
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<div class="detail-title"><?php echo $lang->file->common;?> <i class="icon icon-paper-clip icon-sm"></i></div>
|
||||
<div class="detail-content">
|
||||
<ul class="files-list">
|
||||
<?php
|
||||
foreach($files as $file)
|
||||
{
|
||||
if(common::hasPriv('file', 'download'))
|
||||
{
|
||||
$uploadDate = $lang->file->uploadDate . substr($file->addedDate, 0, 10);
|
||||
$fileTitle = "<li title='{$uploadDate}'><i class='icon icon-file-text'></i> " . $file->title .'.' . $file->extension;
|
||||
$imageWidth = 0;
|
||||
if(stripos('jpg|jpeg|gif|png|bmp', $file->extension) !== false)
|
||||
{
|
||||
$imageSize = getimagesize($file->realPath);
|
||||
$imageWidth = $imageSize ? $imageSize[0] : 0;
|
||||
}
|
||||
|
||||
$fileSize = 0;
|
||||
/* Show size info. */
|
||||
if($file->size < 1024)
|
||||
{
|
||||
$fileSize = $file->size . 'B';
|
||||
}
|
||||
elseif($file->size < 1024 * 1024)
|
||||
{
|
||||
$file->size = round($file->size / 1024, 2);
|
||||
$fileSize = $file->size . 'K';
|
||||
}
|
||||
elseif($file->size < 1024 * 1024 * 1024)
|
||||
{
|
||||
$file->size = round($file->size / (1024 * 1024), 2);
|
||||
$fileSize = $file->size . 'M';
|
||||
}
|
||||
else
|
||||
{
|
||||
$file->size = round($file->size / (1024 * 1024 * 1024), 2);
|
||||
$fileSize = $file->size . 'G';
|
||||
}
|
||||
echo html::a($this->createLink('file', 'download', "fileID=$file->id") . $sessionString, $fileTitle . " ({$fileSize})", '_blank', "onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth)\"");
|
||||
|
||||
|
||||
echo "<span class='right-icon'>";
|
||||
common::printLink('file', 'edit', "fileID=$file->id", "<i class='icon-pencil'></i>", '', "class='edit btn-icon' title='{$lang->file->edit}'");
|
||||
if(common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon-remove'></i>", '', "class='btn-icon' onclick='deleteFile($file->id)' title='$lang->delete'");
|
||||
echo '</span>';
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($fieldset == 'true') echo '</fieldset>';?>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
if($withSearch)
|
||||
{
|
||||
echo '<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example">';
|
||||
echo '<input id="userSearchBox" type="search" class="form-control search-input" placeholder="' . $lang->search .'">';
|
||||
echo '<input id="userSearchBox" type="search" class="form-control search-input" />';
|
||||
echo '<label for="userSearchBox" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>';
|
||||
echo '<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>';
|
||||
echo '</div>';
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<?php endforeach;?>
|
||||
<div class="input-control has-icon-right space">
|
||||
<?php echo html::input('date', $date,"class='form-control form-date' onchange='changeDate(this.value)' autocomplete='off'");?>
|
||||
<label for="inputPasswordExample1" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
<label for="date" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
@@ -123,7 +123,7 @@
|
||||
$actionLink = $this->createLink('todo', 'import2Today');
|
||||
echo "<div class='input-control has-icon-right space'>";
|
||||
echo html::input('date', date('Y-m-d'), "class='form-control form-date'");
|
||||
echo '<label for="inputPasswordExample1" class="input-control-icon-right"><i class="icon icon-delay"></i></label>';
|
||||
echo '<label for="date" class="input-control-icon-right"><i class="icon icon-delay"></i></label>';
|
||||
echo '</div>';
|
||||
echo html::commonButton($lang->todo->import, "onclick=\"setFormAction('$actionLink')\"");
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
$lang->product->common = $lang->productCommon . '视图';
|
||||
$lang->product->index = $lang->productCommon . "首页";
|
||||
$lang->product->index = $lang->productCommon . "主页";
|
||||
$lang->product->browse = "需求列表";
|
||||
$lang->product->dynamic = "动态";
|
||||
$lang->product->view = "{$lang->productCommon}概况";
|
||||
|
||||
@@ -50,9 +50,18 @@ class productModel extends model
|
||||
if($currentMethod == 'report') $currentMethod = 'browse';
|
||||
|
||||
$selectHtml = $this->select($products, $productID, $currentModule, $currentMethod, $extra, $branch, $module, $moduleType);
|
||||
|
||||
$productIndex = '<div class="btn-group angle-btn"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . $this->lang->product->index . ' <span class="caret"></span></button>';
|
||||
$productIndex .= '<ul class="dropdown-menu">';
|
||||
if(common::hasPriv('product', 'all')) $productIndex .= '<li>' . html::a(helper::createLink('product', 'all'), '<i class="icon icon-cards-view"></i> ' . $this->lang->product->all) . '</li>';
|
||||
if(common::hasPriv('product', 'create')) $productIndex .= '<li>' . html::a(helper::createLink('product', 'create'), '<i class="icon icon-plus"></i> ' . $this->lang->product->create) . '</li>';
|
||||
$productIndex .= '</ul></div></div>';
|
||||
$productIndex .= $selectHtml;
|
||||
|
||||
$this->lang->modulePageNav = $productIndex;
|
||||
foreach($this->lang->product->menu as $key => $menu)
|
||||
{
|
||||
$replace = $key == 'list' ? $selectHtml : $productID;
|
||||
$replace = $productID;
|
||||
common::setMenuVars($this->lang->product->menu, $key, $replace);
|
||||
}
|
||||
}
|
||||
@@ -81,7 +90,7 @@ class productModel extends model
|
||||
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot);
|
||||
$currentProduct = $this->getById($productID);
|
||||
$this->session->set('currentProductType', $currentProduct->type);
|
||||
$output = "<a id='currentItem' href=\"javascript:showSearchMenu('product', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$currentProduct->name} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
|
||||
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' onclick=\"javascript:showSearchMenu('product', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$currentProduct->name} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'><i class='icon icon-spin icon-spinner'></i></div></div>";
|
||||
if($isMobile) $output = "<a id='currentItem' href=\"javascript:showSearchMenu('product', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$currentProduct->name} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
|
||||
if($currentProduct->type == 'normal') unset($this->lang->product->menu->branch);
|
||||
if($currentProduct->type != 'normal')
|
||||
@@ -92,8 +101,7 @@ class productModel extends model
|
||||
$branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0];
|
||||
if(!$isMobile)
|
||||
{
|
||||
$output .= '</li><li>';
|
||||
$output .= "<a id='currentBranch' href=\"javascript:showSearchMenu('branch', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$branchName} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
|
||||
$output .= "<div class='btn-group'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn btn-limit' onclick=\"javascript:showSearchMenu('branch', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$branchName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'><i class='icon icon-spin icon-spinner'></i></div></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,14 +115,14 @@ class productModel extends model
|
||||
$moduleName = $module ? $module->name : $this->lang->tree->all;
|
||||
if(!$isMobile)
|
||||
{
|
||||
$output .= '</li><li>';
|
||||
$output .= "<a id='currentModule' href=\"javascript:showSearchMenu('tree', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$moduleName} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
|
||||
$output .= "<div class='btn-group'><button id='currentModule' data-toggle='dropdown' type='button' class='btn btn-limit' onclick=\"javascript:showSearchMenu('tree', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$moduleName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList'><i class='icon icon-spin icon-spinner'></i></div></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$output .= "<a id='currentModule' href=\"javascript:showSearchMenu('tree', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$moduleName} <span class='icon-caret-down'></span></a><div id='currentBranchDropMenu' class='hidden affix enter-from-bottom layer'></div>";
|
||||
}
|
||||
}
|
||||
if(!$isMobile) $output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -2,57 +2,45 @@
|
||||
<?php js::set('module', $module);?>
|
||||
<?php js::set('method', $method);?>
|
||||
<?php js::set('extra', $extra);?>
|
||||
<input type='text' class='form-control' id='search' value='' placeholder='<?php echo $this->app->loadLang('search')->search->common;?>'/>
|
||||
<div id='searchResult'>
|
||||
<div id='defaultMenu' class='search-list'>
|
||||
<ul>
|
||||
<?php
|
||||
$iCharges = 0;
|
||||
$others = 0;
|
||||
$closeds = 0;
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account) $iCharges++;
|
||||
if($product->status == 'normal' and !($product->PO == $this->app->user->account)) $others++;
|
||||
if($product->status == 'closed') $closeds++;
|
||||
}
|
||||
<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example">
|
||||
<input type="search" class="form-control search-input" />
|
||||
<label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
|
||||
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<?php
|
||||
$iCharges = 0;
|
||||
$others = 0;
|
||||
$closeds = 0;
|
||||
$productNames = array();
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account) $iCharges++;
|
||||
if($product->status == 'normal' and !($product->PO == $this->app->user->account)) $others++;
|
||||
if($product->status == 'closed') $closeds++;
|
||||
$productNames[] = $product->name;
|
||||
}
|
||||
$productsPinYin = common::convert2Pinyin($productNames);
|
||||
|
||||
if($iCharges and $others) echo "<li class='heading'>{$lang->product->mine}</li>";
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account)
|
||||
{
|
||||
echo "<li data-id='{$product->id}' data-tag=':{$product->status} @{$product->PO} @mine' data-key='{$product->key}'>" . html::a(sprintf($link, $product->id), "<i class='icon-cube'></i> " . $product->name, '', "class='mine text-important'"). "</li>";
|
||||
}
|
||||
}
|
||||
|
||||
if($iCharges and $others) echo "<li class='heading'>{$lang->product->other}</li>";
|
||||
$class = ($iCharges and $others) ? "class='other text-special'" : '';
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'normal' and !($product->PO == $this->app->user->account))
|
||||
{
|
||||
echo "<li data-id='{$product->id}' data-tag=':{$product->status} @{$product->PO}' data-key='{$product->key}'>" . html::a(sprintf($link, $product->id), "<i class='icon-cube'></i> " . $product->name, '', "$class"). "</li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'normal' and $product->PO == $this->app->user->account)
|
||||
{
|
||||
echo html::a(sprintf($link, $product->id), "<i class='icon-cube'></i> " . $product->name, '', "data-filter='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
<?php echo html::a($this->createLink('product', 'all', "productID=$productID"), "<i class='icon-cubes mgr-5px'></i> " . $lang->product->allProduct)?>
|
||||
<?php if($closeds):?>
|
||||
<div class='pull-right actions'><a id='more' href='javascript:switchMore()'><?php echo $lang->product->closed;?> <i class='icon-angle-right'></i></a></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='moreMenu'>
|
||||
<ul>
|
||||
<?php
|
||||
foreach($products as $product)
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'normal' and !($product->PO == $this->app->user->account))
|
||||
{
|
||||
if($product->status == 'closed') echo "<li data-id='{$product->id}' data-tag=':{$product->status} @{$product->PO}' data-key='{$product->key}'>" . html::a(sprintf($link, $product->id), "<i class='icon-cube'></i> " . $product->name, '', "class='closed'"). "</li>";
|
||||
echo html::a(sprintf($link, $product->id), "<i class='icon-cube'></i> " . $product->name, '', "data-filter='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
||||
foreach($products as $product)
|
||||
{
|
||||
if($product->status == 'closed') echo html::a(sprintf($link, $product->id), "<i class='icon-cube'></i> " . $product->name, '', "class='closed' data-filter='" . zget($productsPinYin, $product->name, '') . "'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
+341
-354
@@ -12,378 +12,365 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix'><?php echo html::icon($lang->icons['story']);?> <strong><?php echo $story->id;?></strong></span>
|
||||
<strong style='color: <?php echo $story->color; ?>'><?php echo $story->title;?></strong>
|
||||
<?php if($story->version > 1):?>
|
||||
<small class='dropdown'>
|
||||
<a href='#' data-toggle='dropdown' class='text-muted'><?php echo '#' . $version;?> <span class='caret'></span></a>
|
||||
<ul class='dropdown-menu'>
|
||||
<?php
|
||||
for($i = $story->version; $i >= 1; $i --)
|
||||
{
|
||||
$class = $i == $version ? " class='active'" : '';
|
||||
echo '<li' . $class .'>' . html::a(inlink('view', "storyID=$story->id&version=$i"), '#' . $i) . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class='actions'>
|
||||
<?php
|
||||
$browseLink = $app->session->storyList != false ? $app->session->storyList : $this->createLink('product', 'browse', "productID=$story->product&branch=$story->branch&moduleID=$story->module");
|
||||
$actionLinks = '';
|
||||
|
||||
if(!$story->deleted)
|
||||
{
|
||||
ob_start();
|
||||
|
||||
echo "<div class='btn-group'>";
|
||||
common::printIcon('story', 'change', "storyID=$story->id", $story);
|
||||
common::printIcon('story', 'review', "storyID=$story->id", $story);
|
||||
|
||||
if($story->status != 'closed' and !isonlybody())
|
||||
{
|
||||
$misc = "class='btn' data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('story', 'batchCreate')) echo html::a($link, "<i class='icon icon-branch'></i> " . $lang->story->subdivide, '', $misc);
|
||||
}
|
||||
|
||||
common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe text-danger', true);
|
||||
common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe text-success', true);
|
||||
|
||||
if($this->config->global->flow != 'onlyStory' and !isonlybody() and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate')))
|
||||
{
|
||||
$this->app->loadLang('testcase');
|
||||
echo "<div class='btn-group'>";
|
||||
echo "<button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown'>";
|
||||
echo "<i class='icon icon-sitemap'></i> " . $lang->testcase->common . " <span class='caret'></span>";
|
||||
echo "</button>";
|
||||
echo "<ul class='dropdown-menu' id='createCaseActionMenu'>";
|
||||
$misc = "data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=0&from=¶m=0&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('testcase', 'create', $story)) echo "<li>" . html::a($link, $lang->testcase->create, '', $misc) . "</li>";
|
||||
$misc = "data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=0&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('testcase', 'batchCreate')) echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
echo "</ul>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
if($from == 'project') common::printIcon('task', 'create', "project=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'smile');
|
||||
echo '</div>';
|
||||
|
||||
echo "<div class='btn-group'>";
|
||||
common::printIcon('story', 'edit', "storyID=$story->id", $story);
|
||||
common::printCommentIcon('story', $story);
|
||||
common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'button', 'copy');
|
||||
common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', '', 'hiddenwin');
|
||||
echo '</div>';
|
||||
|
||||
echo "<div class='btn-group'>";
|
||||
common::printRPN($browseLink, $preAndNext);
|
||||
echo '</div>';
|
||||
|
||||
$actionLinks = ob_get_contents();
|
||||
ob_end_clean();
|
||||
echo $actionLinks;
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printRPN($browseLink);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='row-table'>
|
||||
<div class='col-main'>
|
||||
<div class='main'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->story->legendSpec;?></legend>
|
||||
<div class='article-content'><?php echo $story->spec;?></div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->story->legendVerify;?></legend>
|
||||
<div class='article-content'><?php echo $story->verify;?></div>
|
||||
</fieldset>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<div class='actions'>
|
||||
<?php if(!$story->deleted) echo $actionLinks;?>
|
||||
</div>
|
||||
<fieldset id='commentBox' class='hide'>
|
||||
<legend><?php echo $lang->comment;?></legend>
|
||||
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=story&objectID=$story->id")?>' target='hiddenwin'>
|
||||
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
|
||||
<?php echo html::submitButton() . html::backButton();?>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-side'>
|
||||
<div class='main main-side'>
|
||||
<div class='tabs'>
|
||||
<ul class='nav nav-tabs'>
|
||||
<li class='active'><a href='#legendBasicInfo' data-toggle='tab'><?php echo $lang->story->legendBasicInfo;?></a></li>
|
||||
<li><a href='#legendLifeTime' data-toggle='tab'><?php echo $lang->story->legendLifeTime;?></a></li>
|
||||
</ul>
|
||||
<div class='tab-content'>
|
||||
<div class='tab-pane active' id='legendBasicInfo'>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<tr>
|
||||
<th class='w-70px'><?php echo $lang->story->product;?></th>
|
||||
<td><?php common::printLink('product', 'view', "productID=$story->product", $product->name);?></td>
|
||||
</tr>
|
||||
<?php if($product->type != 'normal'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->branch;?></th>
|
||||
<td><?php common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch", $branches[$story->branch]);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->module;?></th>
|
||||
<?php
|
||||
$moduleTitle = '';
|
||||
ob_start();
|
||||
if(empty($modulePath))
|
||||
{
|
||||
$moduleTitle .= '/';
|
||||
echo "/";
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($modulePath as $key => $module)
|
||||
{
|
||||
$moduleTitle .= $module->name;
|
||||
if(!common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if(isset($modulePath[$key + 1]))
|
||||
{
|
||||
$moduleTitle .= '/';
|
||||
echo $lang->arrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
$printModule = ob_get_contents();
|
||||
ob_end_clean();
|
||||
?>
|
||||
<td title='<?php echo $moduleTitle?>'><?php echo $printModule?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->plan;?></th>
|
||||
<td>
|
||||
<?php
|
||||
if(isset($story->planTitle))
|
||||
{
|
||||
foreach($story->planTitle as $planID => $planTitle)
|
||||
{
|
||||
if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle;
|
||||
echo '<br />';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->source;?></th>
|
||||
<td id='source'><?php echo $lang->story->sourceList[$story->source];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->sourceNote;?></th>
|
||||
<td><?php echo $story->sourceNote;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->status;?></th>
|
||||
<td class='story-<?php echo $story->status?>'><?php echo $lang->story->statusList[$story->status];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->stage;?></th>
|
||||
<td>
|
||||
<?php
|
||||
if($story->stages and $branches)
|
||||
{
|
||||
foreach($story->stages as $branch => $stage) if(isset($branches[$branch])) echo $branches[$branch] . ' : ' . $lang->story->stageList[$stage] . '<br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $lang->story->stageList[$story->stage];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->pri;?></th>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri)?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->estimate;?></th>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->keywords;?></th>
|
||||
<td><?php echo $story->keywords;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->legendMailto;?></th>
|
||||
<td><?php $mailto = explode(',', $story->mailto); foreach($mailto as $account) {if(empty($account)) continue; echo "<span>" . $users[trim($account)] . '</span> '; }?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class='tab-pane' id='legendLifeTime'>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<tr>
|
||||
<th class='w-70px'><?php echo $lang->story->openedBy;?></th>
|
||||
<td><?php echo $users[$story->openedBy] . $lang->at . $story->openedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->assignedTo;?></th>
|
||||
<td><?php if($story->assignedTo) echo $users[$story->assignedTo] . $lang->at . $story->assignedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedBy;?></th>
|
||||
<td><?php $reviewedBy = explode(',', $story->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->closedBy;?></th>
|
||||
<td><?php if($story->closedBy) echo $users[$story->closedBy] . $lang->at . $story->closedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->closedReason;?></th>
|
||||
<td>
|
||||
<?php
|
||||
if($story->closedReason) echo $lang->story->reasonList[$story->closedReason];
|
||||
if(isset($story->extraStories[$story->duplicateStory]))
|
||||
{
|
||||
echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->lastEditedBy;?></th>
|
||||
<td><?php if($story->lastEditedBy) echo $users[$story->lastEditedBy] . $lang->at . $story->lastEditedDate;?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class='tabs'>
|
||||
<ul class='nav nav-tabs'>
|
||||
<?php if($config->global->flow == 'onlyStory'):?>
|
||||
<li class='active'><a href='#legendRelated' data-toggle='tab'><?php echo $lang->story->legendRelated;?></a></li>
|
||||
<?php else:?>
|
||||
<li class='active'><a href='#legendProjectAndTask' data-toggle='tab'><?php echo $lang->story->legendProjectAndTask;?></a></li>
|
||||
<li><a href='#legendRelated' data-toggle='tab'><?php echo $lang->story->legendRelated;?></a></li>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
<div class='tab-content'>
|
||||
<?php if($config->global->flow != 'onlyStory'):?>
|
||||
<div class='tab-pane active' id='legendProjectAndTask'>
|
||||
<ul class='list-unstyled'>
|
||||
<main id="main">
|
||||
<div class="container">
|
||||
<?php $browseLink = $app->session->storyList != false ? $app->session->storyList : $this->createLink('product', 'browse', "productID=$story->product&branch=$story->branch&moduleID=$story->module");?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php echo html::a($browseLink, '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-link'");?>
|
||||
<div class="divider"></div>
|
||||
<div class="page-title">
|
||||
<span class="label label-id"><?php echo $story->id?></span>
|
||||
<span class="text" style='color: <?php echo $story->color; ?>'><?php echo $story->title;?></span>
|
||||
<?php if($story->version > 1):?>
|
||||
<small class='dropdown'>
|
||||
<a href='#' data-toggle='dropdown' class='text-muted'><?php echo '#' . $version;?> <span class='caret'></span></a>
|
||||
<ul class='dropdown-menu'>
|
||||
<?php
|
||||
foreach($story->tasks as $projectTasks)
|
||||
for($i = $story->version; $i >= 1; $i --)
|
||||
{
|
||||
foreach($projectTasks as $task)
|
||||
{
|
||||
if(!isset($projects[$task->project])) continue;
|
||||
$projectName = $projects[$task->project];
|
||||
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "#$task->id $task->name", '', "class='iframe' data-width='80%'");
|
||||
echo html::a($this->createLink('project', 'browse', "projectID=$task->project"), $projectName, '', "class='text-muted'") . '</li>';
|
||||
}
|
||||
}
|
||||
if(count($story->tasks) == 0)
|
||||
{
|
||||
foreach($story->projects as $project)
|
||||
{
|
||||
echo "<li title='$project->name'>" . $project->name . '</li>';
|
||||
}
|
||||
$class = $i == $version ? " class='active'" : '';
|
||||
echo '<li' . $class .'>' . html::a(inlink('view', "storyID=$story->id&version=$i"), '#' . $i) . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row">
|
||||
<div class="main-col col-8">
|
||||
<div class="cell">
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->story->legendSpec;?></div>
|
||||
<div class="detail-content article-content"><?php echo $story->spec;?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="tab-pane <?php if($config->global->flow == 'onlyStory') echo 'active';?>" id='legendRelated'>
|
||||
<table class='table table-data table-condensed table-borderless'>
|
||||
<?php if($config->global->flow != 'onlyStory'):?>
|
||||
<?php if(!empty($fromBug)):?>
|
||||
<tr class='text-top'>
|
||||
<th class='w-70px'><?php echo $lang->story->legendFromBug;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php echo "<li title='#$fromBug->id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id"), "#$fromBug->id $fromBug->title") . '</li>';?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='text-top'>
|
||||
<th class='w-70px'><?php echo $lang->story->legendBugs;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
echo "<li title='#$bug->id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id"), "#$bug->id $bug->title") . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='text-top'>
|
||||
<th><?php echo $lang->story->legendCases;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
foreach($cases as $case)
|
||||
{
|
||||
echo "<li title='#$case->id $case->title'>" . html::a($this->createLink('testcase', 'view', "caseID=$case->id"), "#$case->id $case->title") . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='text-top'>
|
||||
<th class='w-80px'><?php echo $lang->story->legendLinkStories;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<div class="detail">
|
||||
<div class="detail-title"><?php echo $lang->story->legendVerify;?></div>
|
||||
<div class="detail-content article-content"><?php echo $story->verify;?></div>
|
||||
</div>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'false'));?>
|
||||
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=story&objectID=$story->id");?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side-col col-4">
|
||||
<div class="cell">
|
||||
<details class="detail" open>
|
||||
<summary class="detail-title"><?php echo $lang->story->legendBasicInfo;?></summary>
|
||||
<div class="detail-content">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->product;?></th>
|
||||
<td><?php echo html::a($this->createLink('product', 'view', "productID=$story->product"), $product->name);?></td>
|
||||
</tr>
|
||||
<?php if($product->type != 'normal'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->branch;?></th>
|
||||
<td><?php common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch", $branches[$story->branch]);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->module;?></th>
|
||||
<?php
|
||||
$linkStories = explode(',', $story->linkStories) ;
|
||||
foreach($linkStories as $linkStoryID)
|
||||
$moduleTitle = '';
|
||||
ob_start();
|
||||
if(empty($modulePath))
|
||||
{
|
||||
if(isset($story->extraStories[$linkStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '</li>';
|
||||
$moduleTitle .= '/';
|
||||
echo "/";
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($modulePath as $key => $module)
|
||||
{
|
||||
$moduleTitle .= $module->name;
|
||||
if(!common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if(isset($modulePath[$key + 1]))
|
||||
{
|
||||
$moduleTitle .= '/';
|
||||
echo $lang->arrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
$printModule = ob_get_contents();
|
||||
ob_end_clean();
|
||||
?>
|
||||
<td title='<?php echo $moduleTitle?>'><?php echo $printModule?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->plan;?></th>
|
||||
<td>
|
||||
<?php
|
||||
if(isset($story->planTitle))
|
||||
{
|
||||
foreach($story->planTitle as $planID => $planTitle)
|
||||
{
|
||||
if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle;
|
||||
echo '<br />';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='text-top'>
|
||||
<th><?php echo $lang->story->legendChildStories;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->source;?></th>
|
||||
<td id='source'><?php echo $lang->story->sourceList[$story->source];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->sourceNote;?></th>
|
||||
<td><?php echo $story->sourceNote;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->status;?></th>
|
||||
<td><span class='story-<?php echo $story->status?>'><span class="label label-dot"></span> <?php echo $lang->story->statusList[$story->status];?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->stage;?></th>
|
||||
<td>
|
||||
<?php
|
||||
$childStories = explode(',', $story->childStories) ;
|
||||
foreach($childStories as $childStoryID)
|
||||
if($story->stages and $branches)
|
||||
{
|
||||
if(isset($story->extraStories[$childStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '</li>';
|
||||
foreach($story->stages as $branch => $stage) if(isset($branches[$branch])) echo $branches[$branch] . ' : ' . $lang->story->stageList[$stage] . '<br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $lang->story->stageList[$story->stage];
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->pri;?></th>
|
||||
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>'><?php echo zget($lang->story->priList, $story->pri)?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->estimate;?></th>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->keywords;?></th>
|
||||
<td><?php echo $story->keywords;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->legendMailto;?></th>
|
||||
<td><?php $mailto = explode(',', $story->mailto); foreach($mailto as $account) {if(empty($account)) continue; echo "<span>" . $users[trim($account)] . '</span> '; }?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<details class="detail" open>
|
||||
<summary class="detail-title"><?php echo $lang->story->legendProjectAndTask;?></summary>
|
||||
<div class="detail-content">
|
||||
<ul class="list-unstyled">
|
||||
<?php
|
||||
foreach($story->tasks as $projectTasks)
|
||||
{
|
||||
foreach($projectTasks as $task)
|
||||
{
|
||||
if(!isset($projects[$task->project])) continue;
|
||||
$projectName = $projects[$task->project];
|
||||
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "#$task->id $task->name", '', "class='iframe' data-width='80%'");
|
||||
echo html::a($this->createLink('project', 'browse', "projectID=$task->project"), $projectName, '', "class='text-muted'") . '</li>';
|
||||
}
|
||||
}
|
||||
if(count($story->tasks) == 0)
|
||||
{
|
||||
foreach($story->projects as $project)
|
||||
{
|
||||
echo "<li title='$project->name'>" . html::a($this->createLink('project', 'browse', "projectID=$project->id"), $project->name, '', "class='text-muted'") . '</li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<details class="detail" open>
|
||||
<summary class="detail-title"><?php echo $lang->story->legendRelated;?></summary>
|
||||
<div class="detail-content">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<?php if($config->global->flow != 'onlyStory'):?>
|
||||
<?php if(!empty($fromBug)):?>
|
||||
<tr class='text-top'>
|
||||
<th class='w-70px'><?php echo $lang->story->legendFromBug;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php echo "<li title='#$fromBug->id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id"), "#$fromBug->id $fromBug->title") . '</li>';?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='text-top'>
|
||||
<th class='w-70px'><?php echo $lang->story->legendBugs;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
echo "<li title='#$bug->id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id"), "#$bug->id $bug->title") . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='text-top'>
|
||||
<th><?php echo $lang->story->legendCases;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
foreach($cases as $case)
|
||||
{
|
||||
echo "<li title='#$case->id $case->title'>" . html::a($this->createLink('testcase', 'view', "caseID=$case->id"), "#$case->id $case->title") . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='text-top'>
|
||||
<th class='w-80px'><?php echo $lang->story->legendLinkStories;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
$linkStories = explode(',', $story->linkStories) ;
|
||||
foreach($linkStories as $linkStoryID)
|
||||
{
|
||||
if(isset($story->extraStories[$linkStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='text-top'>
|
||||
<th><?php echo $lang->story->legendChildStories;?></th>
|
||||
<td class='pd-0'>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
$childStories = explode(',', $story->childStories) ;
|
||||
foreach($childStories as $childStoryID)
|
||||
{
|
||||
if(isset($story->extraStories[$childStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<details class="detail" open>
|
||||
<summary class="detail-title"><?php echo $lang->story->legendLifeTime;?></summary>
|
||||
<div class="detail-content">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-70px'><?php echo $lang->story->openedBy;?></th>
|
||||
<td><?php echo $users[$story->openedBy] . $lang->at . $story->openedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->assignedTo;?></th>
|
||||
<td><?php if($story->assignedTo) echo $users[$story->assignedTo] . $lang->at . $story->assignedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedBy;?></th>
|
||||
<td><?php $reviewedBy = explode(',', $story->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->closedBy;?></th>
|
||||
<td><?php if($story->closedBy) echo $users[$story->closedBy] . $lang->at . $story->closedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->closedReason;?></th>
|
||||
<td>
|
||||
<?php
|
||||
if($story->closedReason) echo $lang->story->reasonList[$story->closedReason];
|
||||
if(isset($story->extraStories[$story->duplicateStory]))
|
||||
{
|
||||
echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->lastEditedBy;?></th>
|
||||
<td><?php if($story->lastEditedBy) echo $users[$story->lastEditedBy] . $lang->at . $story->lastEditedDate;?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mainActions">
|
||||
<?php common::printPreAndNext($preAndNext);?>
|
||||
<div class="btn-toolbar">
|
||||
<?php if(!$story->deleted):?>
|
||||
<?php
|
||||
common::printIcon('story', 'change', "storyID=$story->id", $story);
|
||||
common::printIcon('story', 'review', "storyID=$story->id", $story);
|
||||
if($story->status != 'closed' and !isonlybody())
|
||||
{
|
||||
$misc = "class='btn' data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('story', 'batchCreate')) echo html::a($link, "<i class='icon icon-sitemap'></i> " . $lang->story->subdivide, '', $misc);
|
||||
}
|
||||
|
||||
common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe', true);
|
||||
common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe', true);
|
||||
|
||||
if($this->config->global->flow != 'onlyStory' and !isonlybody() and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate')))
|
||||
{
|
||||
$this->app->loadLang('testcase');
|
||||
echo "<div class='btn-group dropup'>";
|
||||
echo "<button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown'><i class='icon icon-sitemap'></i> " . $lang->testcase->common . " <span class='caret'></span></button>";
|
||||
echo "<ul class='dropdown-menu' id='createCaseActionMenu'>";
|
||||
|
||||
$misc = "data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=0&from=¶m=0&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('testcase', 'create', $story)) echo "<li>" . html::a($link, $lang->testcase->create, '', $misc) . "</li>";
|
||||
|
||||
$misc = "data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=0&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('testcase', 'batchCreate')) echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
|
||||
echo "</ul>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
if($from == 'project') common::printIcon('task', 'create', "project=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'smile');
|
||||
|
||||
echo "<div class='divider'></div>";
|
||||
common::printIcon('story', 'edit', "storyID=$story->id", $story);
|
||||
common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'button', 'copy');
|
||||
common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', '', 'hiddenwin');
|
||||
|
||||
echo "<div class='divider'></div>";
|
||||
common::printBack($browseLink);
|
||||
?>
|
||||
<?php else:?>
|
||||
<?php common::printBack($browseLink);?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
js::set('canCreate', common::hasPriv('story', 'story'));
|
||||
js::set('createStory', $lang->story->create);
|
||||
|
||||
@@ -101,6 +101,7 @@ class todo extends control
|
||||
{
|
||||
$date= 'today';
|
||||
}
|
||||
if(isonlybody())die(js::reload('parent.parent'));
|
||||
die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent'));
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="col-sm-9">
|
||||
<div class='input-group has-icon-right'>
|
||||
<?php echo html::input('date', $todo->date, "class='form-control form-date'");?>
|
||||
<label for="inputPasswordExample1" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
<label for="date" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,7 +125,7 @@
|
||||
<div class="col-sm-2" style='padding-left:0px'>
|
||||
<?php echo html::select('end', $times, $todo->end, 'class="form-control chosen"');?>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="col-sm-4">
|
||||
<input type='checkbox' id='dateSwitcher' onclick='switchDateFeature(this);' <?php if($todo->begin == 2400) echo 'checked';?> >
|
||||
<label for='dateSwitcher'><?php echo $lang->todo->lblDisableDate;?></label>
|
||||
</div>
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
<?php js::set('module', $module);?>
|
||||
<?php js::set('method', $method);?>
|
||||
<?php js::set('extra', $extra);?>
|
||||
<input type='text' class='form-control' id='search' value='' placeholder='<?php echo $this->app->loadLang('search')->search->common;?>'/>
|
||||
<div id='searchResult'>
|
||||
<div id='defaultMenu' class='search-list'>
|
||||
<ul>
|
||||
<?php
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
echo "<li data-id='{$moduleID}' data-key='{$modulesPinyin[$module]}'>" . html::a(sprintf($link, $productID, $moduleID), $module, '', "class='text-important'") . "</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example">
|
||||
<input type="search" class="form-control search-input">
|
||||
<label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
|
||||
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<?php
|
||||
foreach($modules as $moduleID => $module)
|
||||
{
|
||||
echo html::a(sprintf($link, $productID, $moduleID), $module, '', "data-filter='{$modulesPinyin[$module]}'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
+4
-99
@@ -97,8 +97,8 @@ function shortcut()
|
||||
*/
|
||||
function showSearchMenu(objectType, objectID, module, method, extra)
|
||||
{
|
||||
var $toggle = $(objectType == 'branch' ? '#currentBranch' : (objectType == 'tree' ? '#currentModule' : '#currentItem')).closest('li').toggleClass('show');
|
||||
if(!$toggle.hasClass('show')) return;
|
||||
var $toggle = $(objectType == 'branch' ? '#currentBranch' : (objectType == 'tree' ? '#currentModule' : '#currentItem')).closest('.btn-group').toggleClass('open');
|
||||
if(!$toggle.hasClass('open')) return;
|
||||
var $menu = $toggle.find('#dropMenu');
|
||||
var uuid = $.zui.uuid();
|
||||
if(!$.cookie('ajax_quickJump'))
|
||||
@@ -106,109 +106,14 @@ function showSearchMenu(objectType, objectID, module, method, extra)
|
||||
$.cookie('ajax_quickJump', 'on', {expires: config.cookieLife, path: config.webRoot});
|
||||
$.get(createLink('score', 'ajax', "method=quickJump"));
|
||||
}
|
||||
|
||||
if(!$menu.data('initData'))
|
||||
{
|
||||
var remoteUrl = createLink(objectType, 'ajaxGetDropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra);
|
||||
$.get(remoteUrl, function(data)
|
||||
{
|
||||
var $search = $menu.html(data).find('#search').focus();
|
||||
var $items = $menu.find('#searchResult ul > li:not(.heading)');
|
||||
var items = [];
|
||||
$items.each(function()
|
||||
{
|
||||
var $item = $(this).removeClass('active');
|
||||
var item = $item.data();
|
||||
|
||||
item.uuid = 'searchItem-' + (uuid++);
|
||||
item.key = (item.key || '') + $item.text();
|
||||
item.tag = (item.tag || '') + '#' + item.id;
|
||||
$item.attr('id', item.uuid);
|
||||
items.push(item);
|
||||
});
|
||||
|
||||
var searchItems = function()
|
||||
{
|
||||
var searchText = $.trim($search.val());
|
||||
if(searchText !== null && searchText.length)
|
||||
{
|
||||
$items.removeClass('show-search');
|
||||
$menu.addClass('searching');
|
||||
var isTag = searchText.length > 1 && (searchText[0] === ':' || searchText[0] === '@' || searchText[0] === '#');
|
||||
$.each(items, function(idx, item)
|
||||
{
|
||||
if((isTag && item.tag.indexOf(searchText) > -1) || item.key.indexOf(searchText) > -1)
|
||||
{
|
||||
$('#' + item.uuid).addClass('show-search');
|
||||
}
|
||||
});
|
||||
var $resultItems = $items.filter('.show-search');
|
||||
if(!$resultItems.filter('.active').length)
|
||||
{
|
||||
$resultItems.first().addClass('active');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu.removeClass('searching');
|
||||
}
|
||||
};
|
||||
var searchCallTask = null;
|
||||
$search.on('change keyup paste input propertychange', function()
|
||||
{
|
||||
clearTimeout(searchCallTask);
|
||||
searchCallTask = setTimeout(searchItems, 200);
|
||||
}).on('keydown', function(e)
|
||||
{
|
||||
var code = e.which;
|
||||
var isSearching = $menu.hasClass('searching');
|
||||
var $resultItems = isSearching ? $items.filter('.show-search') : $items;
|
||||
var resultLength = $resultItems.length;
|
||||
if(!resultLength) return;
|
||||
var $this = $resultItems.filter('.active:first');
|
||||
var getIndex = function()
|
||||
{
|
||||
var thisIdx = -1;
|
||||
$resultItems.each(function(idx)
|
||||
{
|
||||
if($(this).is($this))
|
||||
{
|
||||
thisIdx = idx;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return thisIdx;
|
||||
};
|
||||
if(code === 38) // up
|
||||
{
|
||||
$items.removeClass('active');
|
||||
if($this.length) $resultItems.eq((getIndex() - 1)%resultLength).addClass('active');
|
||||
else $resultItems.last().addClass('active');
|
||||
}
|
||||
else if(code === 40) // down
|
||||
{
|
||||
$items.removeClass('active');
|
||||
if($this.length) $resultItems.eq((getIndex() + 1)%resultLength).addClass('active');
|
||||
else $resultItems.first().addClass('active');
|
||||
}
|
||||
else if(code === 13) // enter
|
||||
{
|
||||
if($this.length) window.location.href = $this.children('a').attr('href');
|
||||
}
|
||||
});
|
||||
$menu.on('mouseenter', ' ul > li:not(.heading)', function()
|
||||
{
|
||||
$items.filter('.active').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
});
|
||||
});
|
||||
$.get(remoteUrl, function(data){ $menu.html(data); });
|
||||
$menu.data('initData', true);
|
||||
$(document).on('click', function(){$toggle.removeClass('show');});
|
||||
$toggle.on('click', function(e){e.stopPropagation();});
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu.find('#search').focus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user