* change group, company translation
This commit is contained in:
reneteng
2018-07-04 14:28:27 +08:00
33 changed files with 264 additions and 66 deletions
+6 -4
View File
@@ -97,9 +97,11 @@ $filter->bug->default->cookie['preProductID'] = 'int';
$filter->bug->create->cookie['preBranch'] = 'int';
$filter->bug->export->cookie['checkedItem'] = 'reg::checked';
$filter->doc->browse->cookie['browseType'] = 'reg::browseType';
$filter->doc->default->cookie['from'] = 'code';
$filter->doc->default->cookie['product'] = 'int';
$filter->doc->browse->cookie['browseType'] = 'reg::browseType';
$filter->doc->alllibs->cookie['browseType'] = 'reg::browseType';
$filter->doc->objectlibs->cookie['browseType'] = 'reg::browseType';
$filter->doc->default->cookie['from'] = 'code';
$filter->doc->default->cookie['product'] = 'int';
$filter->doc->showfiles->cookie['docFilesViewType'] = 'code';
$filter->file->download->cookie[$config->sessionVar] = 'code';
@@ -153,7 +155,7 @@ $filter->testsuite->library->cookie['libCaseModule'] = 'int';
$filter->testsuite->library->cookie['preCaseLibID'] = 'int';
$filter->testtask->browse->cookie['preBranch'] = 'int';
$filter->testtask->cases->cookie['preProductID'] = 'int';
$filter->testtask->cases->cookie['preTaskID'] = 'int';
$filter->testtask->cases->cookie['taskCaseModule'] = 'int';
$filter->testtask->default->cookie['lastProduct'] = 'int';
$filter->testtask->default->cookie['preProductID'] = 'int';
+1
View File
@@ -1 +1,2 @@
ALTER TABLE `zt_storyspec` CHANGE `title` `title` varchar(255) NOT NULL;
update `zt_todo` set assignedTo = 'closed', assignedDate = closedDate where status = 'closed';
+3 -3
View File
@@ -254,7 +254,7 @@ class bug extends control
$this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted');
$this->app->loadLang('release');
if(!empty($_POST) and !isset($_POST['stepIDList']))
if(!empty($_POST))
{
$response['result'] = 'success';
$response['message'] = '';
@@ -332,8 +332,8 @@ class bug extends control
$extras = str_replace(array(',', ' '), array('&', ''), $extras);
parse_str($extras);
if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID));// If set runID and resultID, get the result info by resultID as template.
if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version));// If not set runID but set caseID, get the result info by resultID and case info.
if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID, 0, 0, isset($stepIdList) ? $stepIdList : ''));// If set runID and resultID, get the result info by resultID as template.
if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version, isset($stepIdList) ? $stepIdList : ''));// If not set runID but set caseID, get the result info by resultID and case info.
/* If bugID setted, use this bug as template. */
if(isset($bugID))
+17 -8
View File
@@ -1610,11 +1610,11 @@ class bugModel extends model
* @access public
* @return array
*/
public function getBugInfoFromResult($resultID, $caseID = 0, $version = 0)
public function getBugInfoFromResult($resultID, $caseID = 0, $version = 0, $stepIdList = '')
{
$title = '';
$bugSteps = '';
$steps = zget($_POST, 'stepIDList', array());
$steps = explode('_', trim($stepIdList, '_'));
$result = $this->dao->findById($resultID)->from(TABLE_TESTRESULT)->fetch();
if($caseID > 0)
@@ -1635,38 +1635,47 @@ class bugModel extends model
$bugSteps = "<p>[" . $this->lang->testcase->precondition . "]</p>" . "\n" . $run->case->precondition;
}
$bugSteps .= $this->lang->bug->tplStep;
if(!empty($stepResults))
{
$i = 1;
$bugStep = '';
foreach($steps as $stepId)
{
if(!isset($caseSteps[$stepId])) continue;
$step = $caseSteps[$stepId];
$bugSteps .= $i . '. ' . $step->desc . "<br />";
$bugStep .= $i . '. ' . $step->desc . "<br />";
$i++;
}
$bugSteps .= $bugStep ? str_replace('<br/>', '', $this->lang->bug->tplStep) . $bugStep : $this->lang->bug->tplStep;
$bugSteps .= $this->lang->bug->tplResult;
$i = 1;
$bugResult = '';
foreach($steps as $stepId)
{
if(!isset($stepResults[$stepId]) or empty($stepResults[$stepId]['real'])) continue;
$bugSteps .= $i . '. ' . $stepResults[$stepId]['real'] . "<br />";
$bugResult .= $i . '. ' . $stepResults[$stepId]['real'] . "<br />";
$i++;
}
$bugSteps .= $bugResult ? str_replace('<br/>', '', $this->lang->bug->tplResult) . $bugResult : $this->lang->bug->tplResult;
$bugSteps .= $this->lang->bug->tplExpect;
$i = 1;
$bugExpect = '';
foreach($steps as $stepId)
{
if(!isset($caseSteps[$stepId])) continue;
$step = $caseSteps[$stepId];
if($step->expect) $bugSteps .= $i . '. ' . $step->expect . "<br />";
if($step->expect) $bugExpect .= $i . '. ' . $step->expect . "<br />";
$i++;
}
$bugSteps .= $bugExpect ? str_replace('<br/>', '', $this->lang->bug->tplExpect) . $bugExpect : $this->lang->bug->tplExpect;
}
else
{
$bugSteps .= $this->lang->bug->tplStep;
$bugSteps .= $this->lang->bug->tplResult;
$bugSteps .= $this->lang->bug->tplExpect;
}
return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version);
+6 -2
View File
@@ -619,7 +619,11 @@ class doc extends control
$libs = $this->doc->getAllLibsByType($type, $pager, $product);
$subLibs = array();
if($type == 'product' or $type == 'project') $subLibs = $this->doc->getSubLibGroups($type, array_keys($libs));
if($type == 'product' or $type == 'project')
{
$subLibs = $this->doc->getSubLibGroups($type, array_keys($libs));
if($this->cookie->browseType == 'bylist') $this->view->users = $this->loadModel('user')->getPairs('noletter');
}
if($type == 'custom') $this->view->itemCounts = $this->doc->statLibCounts(array_keys($libs));
$this->view->type = $type;
@@ -739,7 +743,7 @@ class doc extends control
public function objectLibs($type, $objectID, $from = 'doc')
{
$this->from = $from;
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot);
setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot);
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
$object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch();
-3
View File
@@ -26,9 +26,6 @@
.col-md-size .table .c-datetime {display: none;}
.table-files .btn {padding:0 6px;}
.table-files .c-actions .btn > .icon {opacity: 0;}
.table-files .c-actions .btn > .icon.text-yellow,
.table-files tr:hover .c-actions .btn > .icon {opacity: 1;}
#docsTree li > a > .icon {opacity: .65;}
-6
View File
@@ -17,12 +17,6 @@ function browseBySearch()
$('#queryBox').addClass('show');
}
function setBrowseType(type)
{
$.cookie('browseType', type, {expires:config.cookieLife, path:config.webRoot});
location.href = location.href;
}
$(function(){
$('#' + browseType + 'Tab').addClass('active');
if(browseType == "bysearch")
+6
View File
@@ -16,6 +16,12 @@ function toggleAcl(acl)
}
}
function setBrowseType(type)
{
$.cookie('browseType', type, {expires:config.cookieLife, path:config.webRoot});
location.href = location.href;
}
$(document).ready(function()
{
$('.libs-group.sort').sortable(
+1
View File
@@ -44,6 +44,7 @@ $lang->doc->acl = 'Right';
$lang->doc->groups = 'Groups';
$lang->doc->users = 'Users';
$lang->doc->item = ' Item';
$lang->doc->num = 'Docs';
$lang->doc->searchResult = 'Search Result';
$lang->doc->moduleDoc = 'By Module';
+1
View File
@@ -44,6 +44,7 @@ $lang->doc->acl = '权限';
$lang->doc->groups = '分组';
$lang->doc->users = '用户';
$lang->doc->item = '项';
$lang->doc->num = '文档数量';
$lang->doc->searchResult = '搜索结果';
$lang->doc->moduleDoc = '按模块浏览';
+2 -1
View File
@@ -562,12 +562,12 @@ class docModel extends model
->add('version', 1)
->setDefault('product,project,module', 0)
->stripTags($this->config->doc->editor->create['id'], $this->config->allowedTags)
->stripTags($this->config->doc->markdown->create['id'], $this->config->allowedTags)
->cleanInt('product,project,module')
->join('groups', ',')
->join('users', ',')
->remove('files,labels,uid')
->get();
$doc->contentMarkdown = strip_tags($this->post->contentMarkdown, $this->config->allowedTags);
if($doc->acl == 'private') $doc->users = $this->app->user->account;
$condition = "lib = '$doc->lib' AND module = $doc->module";
@@ -638,6 +638,7 @@ class docModel extends model
->join('users', ',')
->remove('comment,files,labels,uid')
->get();
if($doc->contentType == 'markdown') $doc->content = strip_tags($this->post->content, $this->config->allowedTags);
if($doc->acl == 'private') $doc->users = $oldDoc->addedBy;
$oldDocContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch();
+15 -3
View File
@@ -11,11 +11,14 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php $spliter = (empty($this->app->user->feedback) && !$this->cookie->feedbackView && $this->from == 'doc') ? true : false;?>
<?php $spliter = (empty($this->app->user->feedback) && !$this->cookie->feedbackView) ? true : false;?>
<div class="main-row <?php if($spliter) echo 'split-row';?>" id="mainRow">
<?php if($spliter):?>
<?php include './side.html.php';?>
<?php endif;?>
<?php if($this->cookie->browseType == 'bylist'):?>
<?php include dirname(__FILE__) . '/alllibsbylist.html.php';?>
<?php else:?>
<div class="main-col" data-min-width="400">
<div class="panel block-files block-sm no-margin">
<div class="panel-heading">
@@ -25,6 +28,12 @@
<?php if($type == 'project') $panelTitle = $lang->projectCommon;?>
<i class="icon icon-folder-open-o text-muted"></i> <?php echo $panelTitle;?>
</div>
<nav class="panel-actions btn-toolbar">
<div class="btn-group">
<?php echo html::a('javascript:setBrowseType("bylist")', "<i class='icon icon-bars'></i>", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon'");?>
<?php echo html::a('javascript:setBrowseType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon text-primary'");?>
</div>
</nav>
</div>
<div class="panel-body">
<div class="row row-grid files-grid" data-size="300">
@@ -36,7 +45,7 @@
<div class="col">
<a class="file" href="<?php echo $link;?>">
<i class="file-icon icon <?php echo $icon;?>"></i>
<div class="file-name"><?php echo $lib->name;?></div>
<div class="file-name"><?php echo ($type == 'custom' && strpos($lib->collector, $this->app->user->account) !== false ? "<i class='icon icon-star text-yellow'></i> " : '') . $lib->name;?></div>
<?php if($type == 'custom'):?>
<div class="text-primary file-info"><?php echo $itemCounts[$lib->id] . $lang->doc->item;?></div>
<?php else:?>
@@ -45,7 +54,9 @@
</a>
<?php if($type == 'custom'):?>
<div class="actions">
<?php common::printLink('doc', 'collect', "objectID=$lib->id&objectType=lib", "<i class='icon icon-star-empty'></i>", 'hiddenwin', "title='{$lang->doc->collect}' class='btn btn-link'")?>
<?php $star = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?>
<?php $collectTitle = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<a data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$lib->id&objectType=doclib");?>" title="<?php echo $collectTitle;?>" class='btn btn-link ajaxCollect'><i class='icon <?php echo $star;?>'></i></a>
<?php common::printLink('doc', 'editLib', "libID=$lib->id", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn btn-link iframe'")?>
<?php common::printLink('doc', 'deleteLib', "libID=$lib->id", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?>
<?php common::printLink('tree', 'browse', "rootID=$lib->id&type=doc", "<i class='icon icon-cog'></i>", '', "title='{$lang->tree->manage}' class='btn btn-link'")?>
@@ -58,5 +69,6 @@
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
</div>
</div>
<?php endif;?>
</div>
<?php include '../../common/view/footer.html.php';?>
+68
View File
@@ -0,0 +1,68 @@
<div class="main-col" data-min-width="400">
<div class="panel block-files block-sm no-margin">
<div class="panel-heading">
<div class="panel-title font-normal">
<?php $panelTitle = '';?>
<?php if($type == 'custom') $panelTitle = $lang->doc->custom;?>
<?php if($type == 'product') $panelTitle = $lang->productCommon;?>
<?php if($type == 'project') $panelTitle = $lang->projectCommon;?>
<i class="icon icon-folder-open-o text-muted"></i> <?php echo $panelTitle;?>
</div>
<nav class="panel-actions btn-toolbar">
<div class="btn-group">
<?php echo html::a('javascript:setBrowseType("bylist")', "<i class='icon icon-bars'></i>", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon text-primary'");?>
<?php echo html::a('javascript:setBrowseType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon'");?>
</div>
</nav>
</div>
<div class="panel-body has-table">
<table class="table table-borderless table-hover table-files">
<thead>
<tr>
<?php $name = '';?>
<?php if($type == 'product') $name = $lang->product->name;?>
<?php if($type == 'project') $name = $lang->project->name;?>
<?php if($type == 'custom') $name = $lang->doc->libName;?>
<th class="c-name"><?php echo $name;?></th>
<th class="c-num"><?php echo $lang->doc->num;?></th>
<?php if($type != 'custom'):?>
<th class="c-user"><?php echo $lang->doc->addedBy;?></th>
<th class="c-datetime"><?php echo $lang->doc->addedDate;?></th>
<?php else:?>
<th class="c-actions-4"><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
</thead>
<tbody>
<?php foreach($libs as $lib):?>
<?php $link = $type != 'custom' ? $this->createLink('doc', 'objectLibs', "type=$type&objectID=$lib->id") : $this->createLink('doc', 'browse', "libID=$lib->id");?>
<tr>
<td class="c-name"><?php echo html::a($link, $lib->name);?></td>
<td class="c-num">
<?php if($type == 'custom'):?>
<?php echo $itemCounts[$lib->id] . $lang->doc->item;?>
<?php else:?>
<?php echo count($subLibs[$lib->id]) . $lang->doc->item;?>
<?php endif;?>
</td>
<?php if($type != 'custom'):?>
<td class="c-user"><?php if($lib->createdBy) echo zget($users, $lib->createdBy);?></td>
<td class="c-datetime"><?php if($lib->createdDate != '00-00-00 00:00:00') echo formatTime($lib->createdDate, 'm-d h:i');?></td>
<?php else:?>
<td class="c-actions">
<?php $star = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?>
<?php $collectTitle = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<a data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$lib->id&objectType=doclib");?>" title="<?php echo $collectTitle;?>" class='btn btn-link ajaxCollect'><i class='icon <?php echo $star;?>'></i></a>
<?php common::printLink('doc', 'editLib', "libID=$lib->id", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn btn-link iframe'")?>
<?php common::printLink('doc', 'deleteLib', "libID=$lib->id", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?>
<?php common::printLink('tree', 'browse', "rootID=$lib->id&type=doc", "<i class='icon icon-cog'></i>", '', "title='{$lang->tree->manage}' class='btn btn-link'")?>
</td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
</div>
</div>
+8
View File
@@ -15,6 +15,9 @@
<?php if($this->from == 'doc'):?>
<?php include './side.html.php';?>
<?php endif;?>
<?php if($this->cookie->browseType == 'bylist'):?>
<?php include dirname(__FILE__) . '/objectlibsbylist.html.php';?>
<?php else:?>
<div class="main-col" data-min-width="400">
<div class="panel block-files block-sm no-margin">
<div class="panel-heading">
@@ -22,6 +25,10 @@
<i class="icon icon-folder-open-o text-muted"></i> <?php echo $object->name;?>
</div>
<nav class="panel-actions btn-toolbar">
<div class="btn-group">
<?php echo html::a('javascript:setBrowseType("bylist")', "<i class='icon icon-bars'></i>", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon'");?>
<?php echo html::a('javascript:setBrowseType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon text-primary'");?>
</div>
<div class="dropdown">
<button type="button" title="<?php echo $lang->customConfig;?>" class="btn btn-icon" data-toggle="dropdown"><i class="icon icon-cog"></i></button>
<div class="dropdown-menu pull-right col-lg" id="pageSetting">
@@ -83,6 +90,7 @@
</div>
</div>
</div>
<?php endif;?>
</div>
<?php js::set('type', 'doc');?>
<?php include '../../common/view/footer.html.php';?>
+74
View File
@@ -0,0 +1,74 @@
<div class="main-col" data-min-width="400">
<div class="panel block-files block-sm no-margin">
<div class="panel-heading">
<div class="panel-title font-normal">
<i class="icon icon-folder-open-o text-muted"></i> <?php echo $object->name;?>
</div>
<nav class="panel-actions btn-toolbar">
<div class="btn-group">
<?php echo html::a('javascript:setBrowseType("bylist")', "<i class='icon icon-bars'></i>", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon text-primary'");?>
<?php echo html::a('javascript:setBrowseType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon'");?>
</div>
<div class="dropdown">
<button type="button" title="<?php echo $lang->customConfig;?>" class="btn btn-icon" data-toggle="dropdown"><i class="icon icon-cog"></i></button>
<div class="dropdown-menu pull-right col-lg" id="pageSetting">
<form class='with-padding load-indicator' id='pageSettingForm' method='post' target='hiddenwin' action='<?php echo $this->createLink('custom', 'ajaxSaveCustomFields', 'module=doc&section=custom&key=objectLibs');?>'>
<div><?php echo $lang->customConfig;?></div>
<div class="row row-grid with-padding">
<?php foreach($customObjectLibs as $libType => $libTypeName):?>
<div class="col-xs-12">
<?php $checked = (strpos(",$showLibs,", ",$libType,") !== false) ? " checked ='checked'" : "";?>
<div class="checkbox-primary">
<input type="checkbox" name="fields[]" value="<?php echo $libType;?>" <?php echo $checked;?> id="fields<?php echo $libType;?>">
<label for="fields<?php echo $libType;?>"><?php echo $libTypeName;?></label>
</div>
</div>
<?php endforeach;?>
</div>
<div>
<?php echo html::submitButton($lang->save);?> &nbsp;
<?php echo html::commonButton($lang->cancel, '', "btn close-dropdown");?>
</div>
</form>
</div>
</div>
</nav>
</div>
<div class='panel-body has-table'>
<table class="table table-borderless table-hover table-files">
<thead>
<tr>
<th class="c-name"><?php echo $lang->doc->libName;?></th>
<th class="c-num"><?php echo $lang->doc->num;?></th>
<th class="c-actions-4"><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($libs as $libID => $lib):?>
<?php if($libID == 'project' and $from != 'doc') continue;?>
<?php if(strpos($config->doc->custom->objectLibs, 'files') === false && $libID == 'files') continue;?>
<?php if(strpos($config->doc->custom->objectLibs, 'customFiles') === false && isset($lib->main) && !$lib->main) continue;?>
<?php $libLink = inlink('browse', "libID=$libID&browseType=all&param=0&orderBy=id_desc&from=$from");?>
<?php if($libID == 'project') $libLink = inlink('allLibs', "type=project&product=$object->id");?>
<?php if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id");?>
<tr>
<td class="c-name"><?php echo html::a($libLink, $lib->name);?></td>
<td class="c-num"><?php echo $lib->allCount . $lang->doc->item;?></td>
<td class="c-actions">
<?php if($libID != 'project' and $libID != 'files'):?>
<?php $star = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?>
<?php $collectTitle = strpos($lib->collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
<a data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$libID&objectType=doclib");?>" title="<?php echo $collectTitle;?>" class='btn btn-link ajaxCollect'><i class='icon <?php echo $star;?>'></i></a>
<?php common::printLink('doc', 'editLib', "libID=$libID", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn btn-link iframe'")?>
<?php if(empty($lib->main)) common::printLink('doc', 'deleteLib', "libID=$libID", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?>
<?php common::printLink('tree', 'browse', "rootID=$libID&type=doc", "<i class='icon icon-cog'></i>", '', "title='{$lang->doc->manageType}' class='btn btn-link'")?>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>
+1
View File
@@ -214,6 +214,7 @@ class product extends control
}
$rootID = key($this->products);
if($this->session->product) $rootID = $this->session->product;
$this->product->setMenu($this->products, $rootID);
$this->view->title = $this->lang->product->create;
+5 -5
View File
@@ -352,11 +352,11 @@ class productModel extends model
public function create()
{
$product = fixer::input('post')
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('status', 'normal')
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::now())
->setDefault('createdVersion', $this->config->version)
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('status', 'normal')
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::now())
->setDefault('createdVersion', $this->config->version)
->join('whitelist', ',')
->stripTags($this->config->product->editor->create['id'], $this->config->allowedTags)
->remove('uid')
+1 -1
View File
@@ -2301,7 +2301,7 @@ class project extends control
public function importPlanStories($projectID, $planID)
{
$planStories = $planProducts = array();
$planStory = $this->loadModel('story')->getPlanStories($planID);
$planStory = $this->loadModel('story')->getPlanStories($planID, 'changed,active,reviewing');
if(!empty($planStory))
{
$planStories = array_keys($planStory);
+7 -10
View File
@@ -46,16 +46,13 @@
else
{
echo "<div class='btn-group dropdown-hover' id='createActionMenu'>";
if(common::hasPriv('project', 'importPlanStories'))
{
echo "<button type='button' class='btn btn-link dropdown-toggle btn-icon'>";
echo "<i class='icon-link muted'></i> {$lang->project->linkStory} <span class='caret'></span>";
echo '</button>';
echo "<ul class='dropdown-menu pull-right'>";
echo "<li>" . html::a($this->createLink('project', 'linkStory', "project=$project->id"), $lang->project->linkStory). "</li>";
echo "<li>" . html::a('#linkStoryByPlan', $lang->project->linkStoryByPlan, '', 'data-toggle="modal"') . "</li>";
echo '</ul>';
}
echo "<button type='button' class='btn btn-link dropdown-toggle btn-icon'>";
echo "<i class='icon-link muted'></i> {$lang->project->linkStory} <span class='caret'></span>";
echo '</button>';
echo "<ul class='dropdown-menu pull-right'>";
if(common::hasPriv('project', 'linkStory')) echo "<li>" . html::a($this->createLink('project', 'linkStory', "project=$project->id"), $lang->project->linkStory). "</li>";
if(common::hasPriv('project', 'importPlanStories')) echo "<li>" . html::a('#linkStoryByPlan', $lang->project->linkStoryByPlan, '', 'data-toggle="modal"') . "</li>";
echo '</ul>';
echo '</div>';
}
+5
View File
@@ -822,6 +822,11 @@ class taskModel extends model
->setDefault('assignedDate', $now)
->remove('comment,showModule')
->get();
if($oldTask->status != 'done' and $oldTask->status != 'closed' and $task->left == 0)
{
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->task->left);
return false;
}
if(!empty($oldTask->team))
{
+2
View File
@@ -39,10 +39,12 @@
<th class='w-80px'><?php echo empty($task->team) ? $lang->task->assign : $lang->task->transferTo;?></th>
<td class='w-p25-f'><?php echo html::select('assignedTo', $members, empty($task->team) ? $task->assignedTo : $task->nextUser, "class='form-control chosen'");?></td><td></td>
</tr>
<?php if($task->status != 'done' and $task->status != 'closed'):?>
<tr>
<th><?php echo $lang->task->left;?></th>
<td><div class='input-group'><?php echo html::input('left', $task->left, "class='form-control' autocomplete='off'");?> <span class='input-group-addon'><?php echo $lang->task->hour;?></span></div></td><td></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->comment;?></th>
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='form-control w-p98'");?></td>
+1 -1
View File
@@ -321,7 +321,7 @@ class testreportModel extends model
*/
public function getTaskCases($tasks, $idList = '')
{
return $this->dao->select('t2.*,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status')->from(TABLE_TESTRUN)->alias('t1')
return $this->dao->select('t2.*,t1.task,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id')
->where('t1.task')->in(array_keys($tasks))
->beginIF($idList)->andWhere('t2.id')->in($idList)->fi()
+1 -1
View File
@@ -19,7 +19,7 @@
<tr>
<td><?php echo sprintf('%03d', $case->id) . html::hidden('cases[]', $case->id)?></td>
<td><span class='label-pri label-pri-<?php echo $case->pri?>' title='<?php echo zget($lang->testcase->priList, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri);?></span></td>
<td class='text-left' title='<?php echo $case->title?>'><?php echo html::a($sysURL . $this->createLink('testcase', 'view', "caseID=$case->id", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
<td class='text-left' title='<?php echo $case->title?>'><?php echo html::a($sysURL . $this->createLink('testcase', 'view', "caseID=$case->id&version=$case->version&from=testtask&taskID=$case->task", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?></td>
<td><?php echo zget($lang->testcase->typeList, $case->type);?></td>
<td><?php echo zget($users, $case->assignedTo);?></td>
<td><?php echo zget($users, $case->lastRunner);?></td>
+2 -2
View File
@@ -260,9 +260,9 @@ class testtask extends control
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID, $task->branch, $taskID);
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preProductID != $productID)
if($this->cookie->preTaskID != $taskID)
{
$_COOKIE['taskCaseModule'] = 0;
setcookie('taskCaseModule', 0, $this->config->cookieLife, $this->config->webRoot);
+16
View File
@@ -28,3 +28,19 @@ function adjustPriBoxWidth()
var addonWidth = $('#ownerAndPriBox .input-group-addon').outerWidth();
$('#pri,#pri_chosen .chosen-single').css('width', boxWidth - beginWidth -addonWidth);
}
function createBug(obj)
{
var $form = $(obj).closest('form');
var params = $form.data('params');
var stepIdList = '';
$form.find('.step .step-id :checkbox').each(function()
{
if($(this).prop('checked')) stepIdList += $(this).val() + '_';
});
var onlybody = config.onlybody;
config.onlybody = 'no';
window.open(createLink('bug', 'create', params + ',stepIdList=' + stepIdList), '_blank');
config.onlybody = onlybody;
}
+3 -3
View File
@@ -49,7 +49,7 @@
<?php $params = isset($testtask) ? ",testtask=$testtask->id,projectID=$testtask->project,buildID=$testtask->build" : '';?>
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
<td colspan='7' class='pd-0'>
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'>
<form data-params='<?php echo "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params?>' method='post'>
<table class='table table-condensed resultSteps'>
<thead>
<tr>
@@ -82,7 +82,7 @@
<tr class='step <?php echo $stepClass?>'>
<td class='step-id'>
<?php if($result->caseResult == 'fail'):?>
<?php $inputName = $stepResult['type'] != 'group' ? 'stepIDList[]' : '';?>
<?php $inputName = $stepResult['type'] != 'group' ? 'stepIdList[]' : '';?>
<div class='checkbox-primary'>
<input type='checkbox' id='<?php echo $inputName;?>' name='<?php echo $inputName;?>' value='<?php echo $key;?>'/>
<label><?php echo $stepId;?></label>
@@ -113,7 +113,7 @@
<?php if($result->caseResult == 'fail'):?>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td>
<td><?php echo html::submitButton($lang->testcase->createBug);?></td>
<td><?php echo html::commonButton($lang->testcase->createBug, "onclick='createBug(this)'", "btn btn-primary createBtn");?></td>
</tr>
<?php endif;?>
</tbody>
+4 -1
View File
@@ -530,10 +530,13 @@ class todoModel extends model
*/
public function close($todoID)
{
$now = helper::now();
$this->dao->update(TABLE_TODO)
->set('status')->eq('closed')
->set('closedBy')->eq($this->app->user->account)
->set('closedDate')->eq(helper::now())
->set('closedDate')->eq($now)
->set('assignedTo')->eq('closed')
->set('assignedDate')->eq($now)
->where('id')->eq((int)$todoID)
->exec();
$this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed');
+3 -8
View File
@@ -1,13 +1,5 @@
.adbox{margin-top:20px;}
.card.ad{margin-bottom:0px;}
.card.ad > .img-wrapper {
background-position: center;
background-repeat: no-repeat;
height: 115px;
width: 100%;
}
.card {
position: relative;
display: block;
@@ -61,6 +53,9 @@
height: 115px;
width: 100%;
}
.card.ad.ad-ranzhi > .img-wrapper {background-size: 100%;}
.card.ad > .img-wrapper > img{display: none;}
.card.ad > .card-heading {text-align: center;}
.card.ad > .card-reveal > .card-heading { padding: 12px 10px 10px 15px;}
-1
View File
@@ -1 +0,0 @@
$(function(){$.ajustModalPosition('fit', $('.modal-dialog'))});
+1
View File
@@ -337,6 +337,7 @@ class upgradeModel extends model
case '9_8_3': $confirmContent .= file_get_contents($this->getUpgradeFile('9.8.3'));
case '10_0_alpha': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.alpha'));
case '10_0_beta': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.beta'));
case '10_0': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0'));
}
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
}
+1 -1
View File
@@ -25,7 +25,7 @@
<div class='panel-body row'>
<?php foreach($lang->install->product as $product):?>
<div class='col-md-<?php echo ceil(12 / count($lang->install->product));?>'>
<a class="card ad" href="<?php echo $lang->install->{$product}->url;?>" target="_blank">
<a class="card ad ad-<?php echo $product;?>" href="<?php echo $lang->install->{$product}->url;?>" target="_blank">
<div class="img-wrapper" style="background-image:url(<?php echo $defaultTheme . $lang->install->{$product}->logo;?>)"><img src="<?php echo $defaultTheme . $lang->install->{$product}->logo;?>" alt=""></div>
<div class="card-reveal">
<h5 class="card-heading"><?php echo $lang->install->{$product}->name?></h5>
+2 -2
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -9,3 +9,4 @@
* @link http://www.zentao.net
*/
.divider + .divider{display:none;}
.body-modal .main-header > h2{width: 100%; overflow:hidden; text-overflow: ellipsis; white-space: nowrap;}