This commit is contained in:
daitingting
2016-05-23 09:59:09 +08:00
18 changed files with 110 additions and 51 deletions
+3 -9
View File
@@ -33,11 +33,13 @@ if(isset($pageCSS)) css::internal($pageCSS);
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right'>
<li><a href='javascript:;' class='refresh-panel'><i class='icon-repeat'></i> <?php echo $lang->block->refresh ?></a></li>
<?php if($this->app->user->account != 'guest'):?>
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module"); ?>" class='edit-block' data-title='<?php echo $block->title; ?>' data-icon='icon-pencil'><i class='icon-pencil'></i> <?php echo $lang->edit; ?></a></li>
<?php if(!$block->source and $block->block == 'html'):?>
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><i class='icon-eye-close'></i><?php echo $lang->block->hidden; ?></a></li>
<?php endif;?>
<li><a href='javascript:;' class='remove-panel'><i class='icon-remove'></i> <?php echo $lang->delete; ?></a></li>
<?php endif;?>
</ul>
</div>
</div>
@@ -56,12 +58,4 @@ config.confirmRemoveBlock = '<?php echo $lang->block->confirmRemoveBlock; ?>';
var module = '<?php echo $module?>';
</script>
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<?php
if(isset($pageJS)) js::execute($pageJS);
/* Load hook files for current page. */
$extPath = dirname(dirname(dirname(realpath($viewFile)))) . '/common/ext/view/';
$extHookRule = $extPath . 'footer.*.hook.php';
$extHookFiles = glob($extHookRule);
if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
?>
<?php if(isset($pageJS)) js::execute($pageJS);?>
+4 -4
View File
@@ -66,9 +66,9 @@ class bug extends control
/* Set productID, moduleID, queryID and branch. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch == '') ? $this->cookie->preBranch : $branch;
$branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
{
@@ -230,7 +230,7 @@ class bug extends control
/* Get product, then set menu. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = $this->cookie->preBranch;
if($branch === '') $branch = (int)$this->cookie->preBranch;
$branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID);
$this->bug->setMenu($this->products, $productID, $branch);
@@ -367,7 +367,7 @@ class bug extends control
/* Get product, then set menu. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = $this->cookie->preBranch;
if($branch === '') $branch = (int)$this->cookie->preBranch;
$this->bug->setMenu($this->products, $productID, $branch);
/* If projectID is setted, get builds and stories of this project. */
+24 -4
View File
@@ -126,8 +126,18 @@ js::set('refresh', $lang->refresh);
<div class='input-group'>
<?php if($showSeverity):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->bug->severity;?></span>
<?php $isAllNumberSeverity = is_numeric(join($lang->bug->severityList));?>
<?php if(!$isAllNumberSeverity):?>
<?php
$hasCustomSeverity = false;
foreach($lang->bug->severityList as $severityKey => $severityValue)
{
if($severityKey != $severityValue)
{
$hasCustomSeverity = true;
break;
}
}
?>
<?php if($hasCustomSeverity):?>
<?php echo html::select('severity', (array)$lang->bug->severityList, $severity, "class='form-control minw-80px'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris' data-prefix='severity'>
@@ -141,8 +151,18 @@ js::set('refresh', $lang->refresh);
<?php endif;?>
<?php if($showPri):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->bug->pri;?></span>
<?php $isAllNumberPri = is_numeric(join($lang->bug->priList));?>
<?php if(!$isAllNumberPri):?>
<?php
$hasCustomPri = false;
foreach($lang->bug->priList as $priKey => $priValue)
{
if($priKey != $priValue)
{
$hasCustomPri = true;
break;
}
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->bug->priList, '', "class='form-control minw-80px'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris'>
+2 -1
View File
@@ -169,13 +169,14 @@ class commonModel extends model
if($module == 'sso' and $method == 'bind') return true;
if($module == 'sso' and $method == 'gettodolist') return true;
if($module == 'product' and $method == 'showerrornone') return true;
if($module == 'block') return true;
if($module == 'block' and $method == 'printblock') return true;
if($this->loadModel('user')->isLogon())
{
if(stripos($method, 'ajax') !== false) return true;
if(stripos($method, 'downnotify') !== false) return true;
if($module == 'tutorial') return true;
if($module == 'block') return true;
}
if(stripos($method, 'ajaxgetdropmenu') !== false) return true;
+8 -3
View File
@@ -98,8 +98,7 @@
$(function()
{
var data = $.parseJSON('<?php echo json_encode($tree);?>');
var $tree = $('#deptTree').tree(
{
var options = {
name: 'deptTree',
initialState: 'preserve',
data: data,
@@ -164,7 +163,13 @@ $(function()
});
}
}
});
};
if(<?php echo common::hasPriv('dept', 'updateorder') ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo common::hasPriv('dept', 'edit') ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo common::hasPriv('dept', 'delete') ? 'false' : 'true' ?>) options.actions["delete"] = false;
var $tree = $('#deptTree').tree(options);
var tree = $tree.data('zui.tree');
if(!tree.store.time) tree.expand($tree.find('li:not(.tree-action-item)').first());
+3 -3
View File
@@ -64,7 +64,7 @@ class product extends control
unset($this->lang->product->menu->index);
$productID = $this->product->saveState($productID, $this->products);
$branch = $this->cookie->preBranch;
$branch = (int)$this->cookie->preBranch;
$this->product->setMenu($this->products, $productID, $branch);
$this->view->title = $this->lang->product->index;
@@ -121,9 +121,9 @@ class product extends control
/* Set product, module and query. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
{
+1 -1
View File
@@ -37,7 +37,7 @@
<?php $canOrder = (common::hasPriv('product', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form method='post' action='<?php echo inLink('batchEdit', "productID=$productID");?>' id='productsForm'>
<table class='table table-condensed table-hover table-striped tablesorter' id='productList'>
<?php $vars = "locate=no&productID=$productID&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $vars = "productID=$productID&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='w-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
+1 -1
View File
@@ -29,7 +29,7 @@
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form id='projectsForm' class='form-condensed' method='post' action='<?php echo inLink('batchEdit', "projectID=$projectID");?>'>
<table class='table table-fixed tablesorter' id='projectList'>
<?php $vars = "locate=no&status=$status&projectID=$projectID&orderBy=%s&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $vars = "status=$status&projectID=$projectID&orderBy=%s&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='w-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
+1 -1
View File
@@ -36,7 +36,7 @@ class qa extends control
unset($this->lang->qa->menu->index);
$productID = $this->product->saveState($productID, $this->products);
$branch = $this->cookie->preBranch;
$branch = (int)$this->cookie->preBranch;
$this->qa->setMenu($this->products, $productID, $branch);
$this->view->title = $this->lang->qa->index;
+12 -2
View File
@@ -105,8 +105,18 @@
<div class="input-group">
<?php if(!$hiddenPri):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->story->pri;?></span>
<?php $isAllNumberPri = is_numeric(join('', $lang->story->priList)); ?>
<?php if(!$isAllNumberPri):?>
<?php
$hasCustomPri = false;
foreach($lang->story->priList as $priKey => $priValue)
{
if($priKey != $priValue)
{
$hasCustomPri = true;
break;
}
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->story->priList, $pri, "class='form-control minw-80px'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris' data-set='0,1,2,3,4'>
+17 -7
View File
@@ -74,8 +74,18 @@
<div class="input-group">
<?php if(!$hiddenPri):?>
<span class='input-group-addon fix-border br-0'><?php echo $lang->task->pri;?></span>
<?php $isAllNumberPri = is_numeric(join($lang->task->priList));?>
<?php if(!$isAllNumberPri):?>
<?php
$hasCustomPri = false;
foreach($lang->task->priList as $priKey => $priValue)
{
if($priKey != $priValue)
{
$hasCustomPri = true;
break;
}
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', $lang->task->priList, '', "class='form-control minw-80px'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris'>
@@ -101,11 +111,11 @@
<th><?php echo $lang->task->desc;?></th>
<td colspan='3'><?php echo html::textarea('desc', $task->desc, "rows='10' class='form-control'");?></td>
</tr>
<?php
$hiddenEstStarted = strpos(",$showFields,", ',estStarted,') === false;
$hiddenDeadline = strpos(",$showFields,", ',deadline,') === false;
$hiddenMailto = strpos(",$showFields,", ',mailto,') === false;
?>
<?php
$hiddenEstStarted = strpos(",$showFields,", ',estStarted,') === false;
$hiddenDeadline = strpos(",$showFields,", ',deadline,') === false;
$hiddenMailto = strpos(",$showFields,", ',mailto,') === false;
?>
<?php if(!$hiddenEstStarted or !$hiddenDeadline or !$hiddenMailto):?>
<tr>
<th><?php echo ($hiddenEstStarted and $hiddenDeadline) ? $lang->task->mailto : $lang->task->datePlan;?></th>
+6 -6
View File
@@ -62,9 +62,9 @@ class testcase extends control
/* Set browseType, productID, moduleID and queryID. */
$productID = $this->product->saveState($productID, $this->products);
$branch = ($branch === '') ? $this->cookie->preBranch : $branch;
$branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch;
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot);
setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch)
{
@@ -147,7 +147,7 @@ class testcase extends control
{
$groupBy = empty($groupBy) ? 'stroy' : $groupBy;
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = $this->cookie->preBranch;
if($branch === '') $branch = (int)$this->cookie->preBranch;
$this->app->loadLang('testtask');
@@ -228,7 +228,7 @@ class testcase extends control
/* Set productID and currentModuleID. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = $this->cookie->preBranch;
if($branch === '') $branch = (int)$this->cookie->preBranch;
if($storyID and empty($moduleID))
{
$story = $this->loadModel('story')->getByID($storyID);
@@ -351,7 +351,7 @@ class testcase extends control
/* Set productID and currentModuleID. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = $this->cookie->preBranch;
if($branch === '') $branch = (int)$this->cookie->preBranch;
if($storyID and empty($moduleID))
{
$story = $this->loadModel('story')->getByID($storyID);
@@ -1091,7 +1091,7 @@ class testcase extends control
{
if($_POST)
{
$this->testcase->createFromImport($productID, $branch);
$this->testcase->createFromImport($productID, (int)$branch);
die(js::locate(inlink('browse', "productID=$productID"), 'parent'));
}
+3 -2
View File
@@ -736,8 +736,9 @@ class testcaseModel extends model
$this->loadModel('action');
$this->loadModel('story');
$this->loadModel('file');
$now = helper::now();
$data = fixer::input('post')->get();
$now = helper::now();
$branch = (int)$branch;
$data = fixer::input('post')->get();
if(!empty($_POST['id']))
{
+12 -2
View File
@@ -94,8 +94,18 @@
<div class='col-table'>
<div class='input-group'>
<span class='input-group-addon fix-border br-0'><?php echo $lang->testcase->pri;?></span>
<?php $isAllNumberPri = is_numeric(join($lang->testcase->priList));?>
<?php if(!$isAllNumberPri):?>
<?php
$hasCustomPri = false;
foreach($lang->testcase->priList as $priKey => $priValue)
{
if($priKey != $priValue)
{
$hasCustomPri = true;
break;
}
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->testcase->priList, $pri, "class='form-control minw-80px'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris'>
+1 -1
View File
@@ -57,7 +57,7 @@ class testtask extends control
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
if($branch === '') $branch = $this->cookie->preBranch;
if($branch === '') $branch = (int)$this->cookie->preBranch;
$this->testtask->setMenu($this->products, $productID, $branch);
/* Load pager. */
+2 -1
View File
@@ -1419,10 +1419,11 @@ class treeModel extends model
public function checkUnique($rootID, $viewType, $parentModuleID, $modules = array(), $branches = array())
{
if(empty($branches)) $branches = $this->post->branch;
$branches = array_unique($branches);
if($this->isMergeModule($rootID, $viewType)) $viewType .= ',story';
$existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->fetchAll();
$existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->andWhere('branch')->in($branches)->fetchAll();
$repeatName = '';
foreach($modules as $id => $name)
{
+2
View File
@@ -185,6 +185,8 @@ $(function()
};
if(<?php echo common::hasPriv('tree', 'updateorder') ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo common::hasPriv('tree', 'edit') ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo common::hasPriv('tree', 'delete') ? 'false' : 'true' ?>) options.actions["delete"] = false;
var $tree = $('#modulesTree').tree(options);
+8 -3
View File
@@ -102,8 +102,7 @@
$(function()
{
var data = $.parseJSON('<?php echo json_encode($tree);?>');
var $tree = $('#modulesTree').tree(
{
var options = {
name: 'tree-project-edit',
initialState: 'preserve',
data: data,
@@ -180,7 +179,13 @@ $(function()
});
}
}
});
};
if(<?php echo common::hasPriv('tree', 'updateorder') ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo common::hasPriv('tree', 'edit') ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo common::hasPriv('tree', 'delete') ? 'false' : 'true' ?>) options.actions["delete"] = false;
var $tree = $('#modulesTree').tree(options);
var tree = $tree.data('zui.tree');
if(!tree.store.time) tree.expand($tree.find('li:not(.tree-action-item)').first());