Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into tsj_fixbug
This commit is contained in:
+1
-20
@@ -36,32 +36,13 @@ class bugsEntry extends entry
|
||||
$this->loadModel('product');
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
$status = array('code' => $bug->status, 'name' => $this->lang->bug->statusList[$bug->status]);
|
||||
if($bug->status == 'active' and $bug->confirmed) $status = array('code' => 'confirmed', 'name' => $this->lang->bug->labelConfirmed);
|
||||
if($bug->resolution == 'postponed') $status = array('code' => 'postponed', 'name' => $this->lang->bug->labelPostponed);
|
||||
if(!empty($bug->delay)) $status = array('code' => 'delay', 'name' => $this->lang->bug->overdueBugs);
|
||||
$bug->status = $status['code'];
|
||||
$bug->statusName = $status['name'];
|
||||
|
||||
$product = $this->product->getById($bug->product);
|
||||
$bug->statusName = $this->lang->bug->statusList[$bug->status];
|
||||
$bug->productStatus = $product->status;
|
||||
|
||||
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,mailto:userList,resolvedBy:user,resolvedDate:time,closedBy:user,closedDate:time,lastEditedBy:user,lastEditedDate:time,deadline:date,deleted:bool');
|
||||
}
|
||||
|
||||
$storyChangeds = $this->dao->select('t1.id')->from(TABLE_BUG)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
|
||||
->where('t1.id')->in(array_keys($result))
|
||||
->andWhere('t1.story')->ne('0')
|
||||
->andWhere('t1.storyVersion != t2.version')
|
||||
->fetchPairs('id', 'id');
|
||||
foreach($storyChangeds as $bugID)
|
||||
{
|
||||
$status = array('code' => 'storyChanged', 'name' => $this->lang->bug->changed);
|
||||
$result[$bugID]->status = $status['code'];
|
||||
$result[$bugID]->statusName = $status['name'];
|
||||
}
|
||||
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => array_values($result)));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,8 @@ class testcasesEntry extends entry
|
||||
if(empty($productID)) $productID = $this->param('product', 0);
|
||||
if(empty($productID)) return $this->sendError(400, 'Need product id.');
|
||||
|
||||
$this->app->cookie->caseModule = 0;
|
||||
$this->app->cookie->caseSuite = 0;
|
||||
|
||||
$type = $this->param('status', 'all');
|
||||
$branch = $this->param('branch', '');
|
||||
$param = 0;
|
||||
$moduleID = $this->param('module', 0);
|
||||
if($moduleID)
|
||||
@@ -35,8 +33,12 @@ class testcasesEntry extends entry
|
||||
$param = $moduleID;
|
||||
}
|
||||
|
||||
$this->app->cookie->caseModule = 0;
|
||||
$this->app->cookie->caseSuite = 0;
|
||||
$this->app->cookie->preBranch = $branch;
|
||||
|
||||
$control = $this->loadController('testcase', 'browse');
|
||||
$control->browse($productID, $this->param('branch', ''), $type, $param, $this->param('order', 'id_desc'), 0, $this->param('limit', 20), $this->param('page', 1));
|
||||
$control->browse($productID, $this->param('branch', ''), $type, $param, $this->param('caseType', ''), $this->param('order', 'id_desc'), 0, $this->param('limit', 20), $this->param('page', 1));
|
||||
|
||||
$data = $this->getData();
|
||||
|
||||
|
||||
@@ -2084,13 +2084,17 @@ class block extends control
|
||||
$pager = new pager(0, 6, 1);
|
||||
|
||||
$docList = $this->loadModel('doc')->getDocsByBrowseType('byediteddate', 0, 0, 'editedDate_desc', $pager);
|
||||
$libList = array();
|
||||
foreach($docList as $doc)
|
||||
{
|
||||
$doc->editedDate = substr($doc->editedDate, 0, 10);
|
||||
$doc->editInterval = helper::getDateInterval($doc->editedDate);
|
||||
|
||||
$libList[] = $doc->lib;
|
||||
}
|
||||
|
||||
$this->view->docList = $docList;
|
||||
$this->view->pricDocs = $this->doc->getPrivDocs($libList);
|
||||
$this->view->docList = $docList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,21 +11,24 @@
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
.block-docrecentupdate .panel-body {padding: 0px 20px;}
|
||||
.block-docrecentupdate .doc-list {display: flex; flex-wrap: wrap; padding: 0 4px 4px 4px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item {flex: 1 1 26%; padding: 8px 10px; border: 1px solid #EDEEF2; border-radius: 4px; margin-right: 10px; margin-bottom: 16px; width: 0px; cursor: pointer;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .date-interval {float: right; padding: 8px 0px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .file-icon {float: left; padding: 8px 4px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item > .plug-title {height: 16px; overflow: hidden;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .edit-date {overflow: hidden; height: 16px;}
|
||||
|
||||
.block-docrecentupdate.block-sm .doc-list > .doc-item {flex: 1 1 100%;}
|
||||
.block-docrecentupdate .panel-body {padding: 0px 10px 20px;}
|
||||
.block-docrecentupdate .doc-list {display: flex; flex-wrap: wrap; padding: 0 4px 0 0;}
|
||||
.block-docrecentupdate .doc-list > .doc-box {border: unset; flex: 0 1 33%; padding: 8px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box > button.btn {padding: 5px 10px; height: 100%; width: 100%; cursor: pointer; white-space: unset; text-align: unset; border: 1px solid rgba(227, 228, 233, 0.6)}
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn:hover {background: unset;}
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn.no-priv {cursor: not-allowed; pointer-events: unset;}
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .date-interval {float: right; padding: 8px 0px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box > .btn > h4 {padding-right: 5px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .file-icon {margin-right: 2px;}
|
||||
.block-docrecentupdate .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;}
|
||||
</style>
|
||||
<?php $canView = common::hasPriv('doc', 'view');?>
|
||||
<div class="panel-body">
|
||||
<div class="plug">
|
||||
<div class="doc-list">
|
||||
<?php foreach($docList as $doc):?>
|
||||
<a class="doc-item shadow-primary-hover" href='<?php echo $this->createLink("doc", "view", "docID=$doc->id");?>'>
|
||||
<div class="doc-list">
|
||||
<?php foreach($docList as $doc):?>
|
||||
<div class="doc-box">
|
||||
<button class="btn shadow-primary-hover <?php if(!$canView or !in_array($doc->id, $pricDocs)) echo 'no-priv';?>" data-link='<?php echo $this->createLink("doc", "view", "docID=$doc->id");?>'>
|
||||
<span class='date-interval text-muted'>
|
||||
<?php
|
||||
$interval = $doc->editInterval;
|
||||
@@ -45,14 +48,27 @@
|
||||
echo $editTip;
|
||||
?>
|
||||
</span>
|
||||
<?php
|
||||
$docType = $doc->type == 'text' ? 'wiki-file' : $doc->type;
|
||||
echo html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
?>
|
||||
<h4 class="plug-title" title="<?php echo $doc->title;?>"><?php echo $doc->title;?></h4>
|
||||
<h4 class="plug-title">
|
||||
<?php
|
||||
$docType = $doc->type == 'text' ? 'wiki-file' : $doc->type;
|
||||
echo html::image("static/svg/{$docType}.svg", "class='file-icon'");
|
||||
?>
|
||||
<?php echo $doc->title;?>
|
||||
</h4>
|
||||
<p class='edit-date text-muted'><?php echo $lang->doc->editedDate . (common::checkNotCN() ? ': ' : ':') . $doc->editedDate;?></p>
|
||||
</a>
|
||||
<?php endforeach;?>
|
||||
</button>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('.doc-box .btn').on('click', function()
|
||||
{
|
||||
if($(this).hasClass('no-priv')) return;
|
||||
|
||||
location.href = $(this).data('link');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -17,18 +17,12 @@
|
||||
.block-docstatistic .created {flex: 0 1 48%;}
|
||||
.block-docstatistic .edited {flex: 0 1 16%; padding-left: 20px;}
|
||||
.block-docstatistic .divider {border-right: 1px solid #eee; padding-right: 12%;}
|
||||
.block-docstatistic .title-line {height: 32px;}
|
||||
.block-docstatistic .panel-title {display: none;}
|
||||
.block-docstatistic .panel-body {margin-top: -32px; padding: 30px;}
|
||||
.block-docstatistic .tile-title {white-space: nowrap;}
|
||||
.block-docstatistic .panel-body {padding-top: 0;}
|
||||
|
||||
.block-docstatistic.block-sm .flex {justify-content: start;}
|
||||
.block-docstatistic.block-sm .panel-body.flex {flex-direction: column;}
|
||||
.block-docstatistic.block-sm .divider {border-right: none;}
|
||||
.block-docstatistic.block-sm .panel-title {display: block;}
|
||||
.block-docstatistic.block-sm .statistic .title-line {display: none;}
|
||||
.block-docstatistic.block-sm .statistic .flex {margin-top: -28px;}
|
||||
.block-docstatistic.block-sm .title-line {height: 0; padding-top: 10px;}
|
||||
.block-docstatistic.block-sm .tile {padding: 10px 32px 20px;}
|
||||
.block-docstatistic.block-sm .panel-body {margin-top: 0px; padding: 10px;}
|
||||
.block-docstatistic.block-sm .flex-column .flex .tile:nth-child(1) {padding-left: 0;}
|
||||
@@ -39,7 +33,6 @@
|
||||
<div class='panel-move-handler'></div>
|
||||
<div class="panel-body flex">
|
||||
<div class='flex flex-column statistic'>
|
||||
<h4 class="title-line"><?php echo $lang->doc->docStatistic;?></h4>
|
||||
<div class='flex'>
|
||||
<div class="tile">
|
||||
<div class="tile-amount"><?php echo (int)$statistic->totalDocs;?></div>
|
||||
@@ -52,7 +45,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='flex flex-column created'>
|
||||
<h4 class="title-line"><?php echo $lang->doc->openedByMe;?></h4>
|
||||
<div class='flex'>
|
||||
<?php if(common::hasPriv('doc', 'mySpace')):?>
|
||||
<a class="tile" href="<?php echo $this->createLink('doc', 'mySpace', 'type=createdBy');?>">
|
||||
@@ -77,7 +69,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='flex flex-column edited'>
|
||||
<h4 class="title-line"><?php echo $lang->doc->editedByMe;?></h4>
|
||||
<div class='flex'>
|
||||
<div class="tile">
|
||||
<div class="tile-amount"><?php echo (int)$statistic->myEditedDocs;?></div>
|
||||
|
||||
@@ -1142,7 +1142,7 @@ class doc extends control
|
||||
public function view($docID = 0, $version = 0, $appendLib = 0)
|
||||
{
|
||||
$doc = $this->doc->getById($docID);
|
||||
if(!$doc)
|
||||
if(!$doc or !isset($doc->id))
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
|
||||
return print(js::error($this->lang->notFound) . js::locate($this->inlink('index')));
|
||||
@@ -1151,7 +1151,6 @@ class doc extends control
|
||||
$lib = $this->doc->getLibById($doc->lib);
|
||||
if(!empty($lib) and $lib->deleted == '1') $appendLib = $doc->id;
|
||||
|
||||
|
||||
$objectType = isset($lib->type) ? $lib->type : 'custom';
|
||||
$type = $objectType == 'execution' && $this->app->tab != 'execution' ? 'project' : $objectType;
|
||||
$objectID = zget($doc, $type, 0);
|
||||
@@ -1162,9 +1161,6 @@ class doc extends control
|
||||
/* Get doc. */
|
||||
if($docID)
|
||||
{
|
||||
$doc = $this->doc->getById($docID, $version, true);
|
||||
if(!$doc) return print(js::error($this->lang->notFound));
|
||||
|
||||
$this->doc->createAction($docID, 'view');
|
||||
$this->doc->removeEditing($doc);
|
||||
if($doc->keywords)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
.article-content .info .keywords .label {padding-right:8px; padding-left:8px; color:#18A6FD; border-color:rgba(24, 166, 253, 0.25); height:22px; line-height:14px; margin-right:4px;}
|
||||
|
||||
.article-content {width: 100%; display: inline-block;}
|
||||
/* .outline-toggle i.icon-angle-right, i.icon-angle-left {width: 18px; height: 18px; border-radius: 50%; position: absolute; padding-left: 2px; padding-top: 1px;} */
|
||||
.outline-toggle {position: absolute; right: 20px; top: 50px;}
|
||||
.outline-toggle i.icon-angle-right:before {content: "\e314"; cursor: pointer;}
|
||||
.outline-toggle i.icon-angle-left:before {content: "\e315"; cursor: pointer;}
|
||||
@@ -65,8 +64,9 @@
|
||||
.info .version, .info .crumbs {float: left;}
|
||||
.crumbs img {margin-right: 3px; margin-bottom: 4px;}
|
||||
.crumbs {float: left; display: flex;height: 32px; width: 670px; align-items: center; overflow: hidden;}
|
||||
.crumbs a {padding: 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
|
||||
.crumbs .separator {flex: 0 0 15px; display: flex; justify-content: center; align-items: center;}
|
||||
.crumbs :last-child {flex: none;}
|
||||
|
||||
.crumbs .crumb-item {padding: 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; display: flex;}
|
||||
.crumb-item .separator {flex: 0 0 15px; display: flex; justify-content: center; align-items: center;}
|
||||
.crumb-item a {flex: none}
|
||||
.main-col {position: relative;}
|
||||
#autoBox {display: flex; overflow: hidden; text-overflow: ellipsis; padding-right: 15px; position: relative;}
|
||||
#autoBox > .ellipsis {position: absolute; top: 3px; right: 0; width: 10px; background: #F4F5F7; height: 100%;}
|
||||
|
||||
+12
-9
@@ -402,20 +402,23 @@ function submit(object)
|
||||
function updateCrumbs()
|
||||
{
|
||||
var $crumbs = $('#crumbs');
|
||||
var $crumbItems = $('#crumbs > a');
|
||||
var $crumbItems = $('#crumbs > .crumb-item');
|
||||
var crumbMaxWidth = 660;
|
||||
if($crumbs.width < crumbMaxWidth || $crumbItems.length == 1) return;
|
||||
|
||||
/* last crumbItem width major */
|
||||
var $lastChild = $($crumbItems[$crumbItems.length -1]);
|
||||
var $separator = "<div class='separator'> > </div>"
|
||||
var $ellipsis = "<div class='ellipsis'> ... </div>"
|
||||
if($lastChild.width() > $crumbs.width())
|
||||
var widthSum = 0 + $lastChild.width();
|
||||
for(var i = 0; i < $crumbItems.length - 1; i++)
|
||||
{
|
||||
var $appendChild = $lastChild[0];
|
||||
$crumbs.empty();
|
||||
$crumbs.append($appendChild);
|
||||
$crumbs.prepend($separator);
|
||||
$crumbs.prepend($ellipsis);
|
||||
var crumbItem = $crumbItems[i];
|
||||
var widthSum = widthSum + $(crumbItem).width();
|
||||
if(widthSum >= crumbMaxWidth)
|
||||
{
|
||||
$(crumbItem).addClass('in-auto-box');
|
||||
}
|
||||
}
|
||||
var $autoCrumbItems = $('#crumbs > .in-auto-box');
|
||||
$lastChild.before('<div id="autoBox" class="flex-auto"><div class="ellipsis">...<div></div>');
|
||||
$('#autoBox').prepend($autoCrumbItems);
|
||||
}
|
||||
|
||||
@@ -766,7 +766,7 @@ class docModel extends model
|
||||
echo(js::alert($this->lang->doc->accessDenied));
|
||||
$loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login";
|
||||
if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate(inlink('index')));
|
||||
return print(js::locate('back'));
|
||||
helper::end(print(js::locate('back')));
|
||||
}
|
||||
|
||||
$docs = $this->processCollector(array($doc->id => $doc));
|
||||
@@ -1322,6 +1322,8 @@ class docModel extends model
|
||||
*/
|
||||
public function checkPrivDoc($object)
|
||||
{
|
||||
if(!isset($object->lib)) return false;
|
||||
|
||||
$lib = $this->getLibById($object->lib);
|
||||
if($this->app->user->admin and !empty($lib) and $lib->type != 'mine') return true;
|
||||
|
||||
@@ -2802,7 +2804,7 @@ class docModel extends model
|
||||
public function checkAutoloadPage($doc)
|
||||
{
|
||||
$autoloadPage = true;
|
||||
if(!empty($doc) and $doc->type == 'url')
|
||||
if(isset($doc->type) and $doc->type == 'url')
|
||||
{
|
||||
if(empty($doc->content)) return false;
|
||||
|
||||
@@ -2985,6 +2987,7 @@ class docModel extends model
|
||||
$docIDList = $this->getPrivDocs($lib->id);
|
||||
$docs = $this->dao->select('*, title as name')->from(TABLE_DOC)
|
||||
->where('id')->in($docIDList)
|
||||
->andWhere("(status = 'normal' or (status = 'draft' and addedBy='{$this->app->user->account}'))")
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('module')->eq(0)
|
||||
->fetchAll('id');
|
||||
@@ -3143,7 +3146,7 @@ class docModel extends model
|
||||
*/
|
||||
public function printCreateBtn($lib, $type, $objectID, $moduleID, $from = '')
|
||||
{
|
||||
if(!common::hasPriv('doc', 'create')) return null;
|
||||
if(!common::hasPriv('doc', 'create') or !isset($lib->id)) return null;
|
||||
|
||||
$class = $from == 'list' ? 'btn-info' : 'btn-primary';
|
||||
$html = "<div class='dropdown btn-group createDropdown'>";
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
echo html::a(helper::createLink('doc', 'createLib', "type=mine"), '<i class="icon icon-plus"></i> ' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
}
|
||||
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, 'mine', 0, 0);
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, 'mine', 0, $moduleID);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,12 @@
|
||||
<?php echo html::backButton("<i class='icon icon-back icon-sm'></i> " . $lang->goback, "id='backBtn'", 'btn btn-link')?>
|
||||
</div>
|
||||
<div id="crumbs" class="crumbs">
|
||||
<?php echo implode('<div class="separator"> > </div>', $crumbs);?>
|
||||
<?php foreach($crumbs as $crumbKey => $crumb):?>
|
||||
<div class="crumb-item">
|
||||
<?php if($crumbKey != 0) echo '<div class="separator"> > </div>'?>
|
||||
<?php echo $crumb;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php
|
||||
|
||||
@@ -52,7 +52,7 @@ class settingModel extends model
|
||||
$item = $this->parseItemPath($path);
|
||||
if(empty($item)) return false;
|
||||
|
||||
$item->value = $value;
|
||||
$item->value = strval($value);
|
||||
$this->dao->replace(TABLE_CONFIG)->data($item)->exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -373,6 +373,7 @@ class userModel extends model
|
||||
$data = new stdclass();
|
||||
$data->account = $this->post->account;
|
||||
$data->group = $groupID;
|
||||
$data->project = '';
|
||||
$this->dao->insert(TABLE_USERGROUP)->data($data)->exec();
|
||||
}
|
||||
}
|
||||
@@ -515,6 +516,7 @@ class userModel extends model
|
||||
$groups = new stdClass();
|
||||
$groups->account = $user->account;
|
||||
$groups->group = $group;
|
||||
$groups->project = '';
|
||||
$this->dao->insert(TABLE_USERGROUP)->data($groups)->exec();
|
||||
}
|
||||
}
|
||||
@@ -641,6 +643,7 @@ class userModel extends model
|
||||
$data = new stdclass();
|
||||
$data->account = $this->post->account;
|
||||
$data->group = $groupID;
|
||||
$data->project = '';
|
||||
$this->dao->replace(TABLE_USERGROUP)->data($data)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user