* Adjust code.

This commit is contained in:
pengjiangxiu
2017-08-23 13:08:06 +08:00
parent 0ee04f80d1
commit 202d76db45
14 changed files with 94 additions and 95 deletions
+2 -2
View File
@@ -1506,7 +1506,7 @@ class bugModel extends model
{
foreach($openBuildIDList as $buildID)
{
if(isset($datas[$buildID]))
if(isset($datas[$buildID]))
{
$datas[$buildID]->value += $data->value;
}
@@ -1538,7 +1538,7 @@ class bugModel extends model
{
$datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('module')->orderBy('value DESC')->fetchAll('name');
if(!$datas) return array();
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas),true,true);
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas), true, true);
foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/';
return $datas;
}
+3 -3
View File
@@ -193,15 +193,15 @@ js::set('branch', $branch);
<?php
$class = "class='disabled'";
$actionLink = $this->createLink('bug', 'batchConfirm');
$misc = common::hasPriv('bug', 'batchConfirm') ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : $class;
$misc = common::hasPriv('bug', 'batchConfirm') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : $class;
if($misc) echo "<li>" . html::a('javascript:;', $lang->bug->confirmBug, '', $misc) . "</li>";
$actionLink = $this->createLink('bug', 'batchClose');
$misc = common::hasPriv('bug', 'batchClose') ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : $class;
$misc = common::hasPriv('bug', 'batchClose') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : $class;
if($misc) echo "<li>" . html::a('javascript:;', $lang->bug->close, '', $misc) . "</li>";
$actionLink = $this->createLink('bug', 'batchActivate');
$misc = common::hasPriv('bug', 'batchActivate') ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : $class;
$misc = common::hasPriv('bug', 'batchActivate') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : $class;
if($misc) echo "<li>" . html::a('javascript:;', $lang->bug->activate, '', $misc) . "</li>";
if(common::hasPriv('bug', 'batchChangeModule'))
+8 -8
View File
@@ -12,8 +12,8 @@
class custom extends control
{
/**
* Index
*
* Index
*
* @access public
* @return void
*/
@@ -23,11 +23,11 @@ class custom extends control
}
/**
* Custom
*
* @param string $module
* @param string $field
* @param string $lang
* Custom
*
* @param string $module
* @param string $field
* @param string $lang
* @access public
* @return void
*/
@@ -107,7 +107,7 @@ class custom extends control
/* Fix bug #942. */
if($field == 'priList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->priListKey));
if($module == 'bug' and $field == 'severityList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->severityListKey));
if($module == 'bug' and $field == 'resolutionList' and !empty($key) and !validater::checkCode($key)) die(js::alert($this->lang->custom->notice->resolutionList));
if(!empty($key) and !validater::checkCode($key)) die(js::alert($this->lang->custom->notice->keyList));
/* the length of role is 20, check it when save. */
if($module == 'user' and $field == 'roleList' and strlen($key) > 20) die(js::alert($this->lang->custom->notice->userRole));
+1 -1
View File
@@ -79,7 +79,7 @@ $lang->custom->notice->canNotAdd = 'This item will be processed, so c
$lang->custom->notice->forceReview = 'Review is required for %s submitted by certain assignee.';
$lang->custom->notice->longlife = 'List "Undone" bugs that are older than hold days from "Longlife" bugs.';
$lang->custom->notice->priListKey = 'Priority list key should be numbers!';
$lang->custom->notice->resolutionList = 'Solution list key should be English or digital!';
$lang->custom->notice->keyList = 'key should be English or digital!';
$lang->custom->notice->severityListKey = 'Bug severity list key should be numbers.';
$lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Homepage. Do you want to enter Product Homepage?";
$lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Homepage. Do you want to enter Project Homepage?";
+1 -1
View File
@@ -79,7 +79,7 @@ $lang->custom->notice->canNotAdd = '该项参与运算,不提供自
$lang->custom->notice->forceReview = "指定人提交的%s必须评审。";
$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。';
$lang->custom->notice->priListKey = '优先级的键应当为数字!';
$lang->custom->notice->resolutionList = '解决方案的键值应当为英文或数字';
$lang->custom->notice->keyList = '键值应当为英文或数字';
$lang->custom->notice->severityListKey = 'Bug严重程度的键应当为数字!';
$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?";
$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?";
+1 -1
View File
@@ -79,7 +79,7 @@ $lang->custom->notice->canNotAdd = '該項參與運算,不提供自
$lang->custom->notice->forceReview = "指定人提交的%s必須評審。";
$lang->custom->notice->longlife = 'Bug列表頁面的久未處理標籤中,列出設置天數之前未處理的Bug。';
$lang->custom->notice->priListKey = '優先順序的鍵應當為數字!';
$lang->custom->notice->resolutionList = '解決方案的鍵值應當為英文或數字';
$lang->custom->notice->keyList = '鍵值應當為英文或數字';
$lang->custom->notice->severityListKey = 'Bug嚴重程度的鍵應當為數字!';
$lang->custom->notice->indexPage['product'] = "從8.2版本起增加了產品主頁視圖,是否預設進入產品主頁?";
$lang->custom->notice->indexPage['project'] = "從8.2版本起增加了項目主頁視圖,是否預設進入項目主頁?";
-2
View File
@@ -655,8 +655,6 @@ class doc extends control
$this->view->viewType = $viewType;
$this->view->orderBy = $orderBy;
$this->view->objectID = $objectID;
$this->view->recTotal = $recTotal;
$this->view->recPerPage = $recPerPage;
$this->display();
}
+40 -44
View File
@@ -47,52 +47,48 @@
</div>
<?php if($viewType == 'list'):?>
<form method='post' id='ajaxForm'>
<table class='table table-hover table-striped tablesorter table-fixed' id='orderList'>
<thead>
<?php $vars = "type=$type&objectID=$objectID&viewType=list&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage";?>
<tr class='text-center'>
<th class='w-80px'> <?php common::printOrderLink('t1.id', $orderBy, $vars, $lang->doc->id);?> </th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->fileTitle);?> </th>
<th> <?php common::printOrderLink('pathname', $orderBy, $vars, $lang->doc->filePath);?> </th>
<th class='w-60px'> <?php common::printOrderLink('extension', $orderBy, $vars, $lang->doc->extension);?> </th>
<th class='w-80px'> <?php common::printOrderLink('size', $orderBy, $vars, $lang->doc->size);?> </th>
<th class='w-100px'> <?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?> </th>
<th class='w-160px'> <?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?> </th>
<th class='w-80px'> <?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($files as $file):?>
<?php if(empty($file->pathname)) continue;?>
<tr class='text-center text-middle'>
<td><?php echo $file->id;?></td>
<td class='text-left'>
<a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>'><?php echo $file->title . '.' . $file->extension . ' [' . strtoupper($file->objectType) . ' #' . $file->objectID . ']';?></a>
</td>
<td class='text-left'> <?php echo $file->pathname;?> </td>
<td><?php echo $file->extension;?></td>
<td><?php echo number_format($file->size / 1024 , 1) . 'K';?></td>
<td><?php echo isset($file->addedBy) ? $file->addedBy : '';?></td>
<td><?php echo isset($file->addedDate) ? substr($file->addedDate, 0, 10) : '';?></td>
<td class='text-center'>
<?php
common::printLink('file', 'download', "fileID=$file->id", $lang->doc->download, "data-toggle='modal'");
common::printLink('file', 'delete', "fileID=$file->id", $lang->delete, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='8'>
<?php $pager->show();?>
<table class='table table-hover table-striped tablesorter table-fixed' id='orderList'>
<thead>
<?php $vars = "type=$type&objectID=$objectID&viewType=list&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage";?>
<tr class='text-center'>
<th class='w-80px'> <?php common::printOrderLink('t1.id', $orderBy, $vars, $lang->doc->id);?> </th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->fileTitle);?> </th>
<th> <?php common::printOrderLink('pathname', $orderBy, $vars, $lang->doc->filePath);?> </th>
<th class='w-60px'> <?php common::printOrderLink('extension', $orderBy, $vars, $lang->doc->extension);?> </th>
<th class='w-80px'> <?php common::printOrderLink('size', $orderBy, $vars, $lang->doc->size);?> </th>
<th class='w-100px'> <?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?> </th>
<th class='w-160px'> <?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?> </th>
<th class='w-80px'> <?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($files as $file):?>
<?php if(empty($file->pathname)) continue;?>
<tr class='text-center text-middle'>
<td><?php echo $file->id;?></td>
<td class='text-left'>
<a href='<?php echo $this->createLink($file->objectType, 'view', "objectID=$file->objectID");?>'><?php echo $file->title . '.' . $file->extension . ' [' . strtoupper($file->objectType) . ' #' . $file->objectID . ']';?></a>
</td>
<td class='text-left'> <?php echo $file->pathname;?> </td>
<td><?php echo $file->extension;?></td>
<td><?php echo number_format($file->size / 1024 , 1) . 'K';?></td>
<td><?php echo isset($file->addedBy) ? $file->addedBy : '';?></td>
<td><?php echo isset($file->addedDate) ? substr($file->addedDate, 0, 10) : '';?></td>
<td class='text-center'>
<?php
common::printLink('file', 'download', "fileID=$file->id", $lang->doc->download, "data-toggle='modal'");
common::printLink('file', 'delete', "fileID=$file->id", $lang->delete, 'hiddenwin');
?>
</td>
</tr>
</tfoot>
</table>
</form>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='8'> <?php $pager->show();?> </td>
</tr>
</tfoot>
</table>
<?php else:?>
<div class='lib-files cards'>
<?php foreach($files as $file):?>
-1
View File
@@ -138,7 +138,6 @@ class product extends control
$moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0));
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
if($browseType == 'unclosed') $moduleID = 0;
/* Set menu. */
$this->product->setMenu($this->products, $productID, $branch);
+7 -3
View File
@@ -22,7 +22,6 @@ class sso extends control
{
$referer = empty($_GET['referer']) ? '' : $this->get->referer;
$locate = empty($referer) ? getWebRoot() : base64_decode($referer);
if($this->loadModel('user')->isLogon()) die($this->locate($locate));
$this->app->loadConfig('sso');
if(!$this->config->sso->turnon) die($this->locate($locate));
@@ -40,9 +39,9 @@ class sso extends control
if(strpos($location, '&') !== false)
{
$location = rtrim($location, '&') . "&token=$token&auth=$auth&userIP=$userIP&callback=$callback&referer=$referer";
}
}
else
{
{
$location = rtrim($location, '?') . "?token=$token&auth=$auth&userIP=$userIP&callback=$callback&referer=$referer";
}
$this->locate($location);
@@ -63,6 +62,11 @@ class sso extends control
$this->locate($this->createLink('sso', 'bind', "referer=" . helper::safe64Encode($locate)));
}
if($this->loadModel('user')->isLogon())
{
if($this->session->user && $this->session->user->account == $user->account) die($this->locate($locate));
}
$this->user->cleanLocked($user->account);
/* Authorize him and save to session. */
$user->rights = $this->user->authorize($user->account);
+1 -2
View File
@@ -1996,10 +1996,9 @@ class storyModel extends model
foreach($datas as $key => $project)
{
if(!$project->branch) continue;
$branchIDList[] = $project->branch;
$branchIDList[$project->branch] = $project->branch;
}
$branchIDList = array_unique($branchIDList);
$branchs = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->andWhere('deleted')->eq(0)->fetchALL('id');
$modules = $this->loadModel('tree')->getModulesName(array_keys($datas));
+3
View File
@@ -1,2 +1,5 @@
.col-side .chosen-container .chosen-drop {width: 216px!important}
.col-side .chosen-container {width: 218px!important}
#finishedDate.form-control.form-date {width: 218px!important}
#canceledDate.form-control.form-date {width: 218px!important}
#closedDate.form-control.form-date {width: 218px!important}
+13 -13
View File
@@ -80,7 +80,7 @@
<tr>
<th><?php echo $lang->task->assignedTo;?></th>
<td><span id="assignedToIdBox"><?php echo html::select('assignedTo', $members, $task->assignedTo, "class='form-control chosen'");?></span></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->type;?></th>
<td><?php echo html::select('type', $lang->task->typeList, $task->type, 'class=form-control');?></td>
@@ -88,7 +88,7 @@
<tr>
<th><?php echo $lang->task->status;?></th>
<td><?php echo html::select('status', (array)$lang->task->statusList, $task->status, 'class=form-control');?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->pri;?></th>
<td><?php echo html::select('pri', $lang->task->priList, $task->pri, 'class=form-control');?> </td>
@@ -101,27 +101,27 @@
</fieldset>
<fieldset>
<legend><?php echo $lang->task->legendEffort;?></legend>
<table class='table table-form'>
<table class='table table-form'>
<tr>
<th class='w-70px'><?php echo $lang->task->estStarted;?></th>
<td><?php echo html::input('estStarted', $task->estStarted, "class='form-control form-date'");?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->realStarted;?></th>
<td><?php echo html::input('realStarted', $task->realStarted, "class='form-control form-date'");?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->deadline;?></th>
<td><?php echo html::input('deadline', $task->deadline, "class='form-control form-date'");?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->estimate;?></th>
<td><?php echo html::input('estimate', $task->estimate, "class='form-control' autocomplete='off'");?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->consumed;?></th>
<td><?php echo $task->consumed . ' '; common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', '', '', 'iframe', true);?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->task->left;?></th>
<td><?php echo html::input('left', $task->left, "class='form-control' autocomplete='off'");?></td>
@@ -130,14 +130,14 @@
</fieldset>
<fieldset>
<legend><?php echo $lang->task->legendLife;?></legend>
<table class='table table-form'>
<table class='table table-form'>
<tr>
<th class='w-70px'><?php echo $lang->task->openedBy;?></th>
<td><?php echo $users[$task->openedBy];?></td>
</tr>
<tr>
<th><?php echo $lang->task->finishedBy;?></th>
<td><?php echo html::select('finishedBy', $members, $task->finishedBy, "class='form-control'");?></td>
<td><?php echo html::select('finishedBy', $members, $task->finishedBy, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->task->finishedDate;?></th>
@@ -145,7 +145,7 @@
</tr>
<tr>
<th><?php echo $lang->task->canceledBy;?></th>
<td><?php echo html::select('canceledBy', $users, $task->canceledBy, 'class="form-control"');?></td>
<td><?php echo html::select('canceledBy', $users, $task->canceledBy, 'class="form-control chosen"');?></td>
</tr>
<tr>
<th><?php echo $lang->task->canceledDate;?></th>
@@ -153,11 +153,11 @@
</tr>
<tr>
<th><?php echo $lang->task->closedBy;?></th>
<td><?php echo html::select('closedBy', $users, $task->closedBy, 'class="form-control"');?></td>
<td><?php echo html::select('closedBy', $users, $task->closedBy, 'class="form-control chosen"');?></td>
</tr>
<tr>
<th><?php echo $lang->task->closedReason;?></th>
<td><?php echo html::select('closedReason', $lang->task->reasonList, $task->closedReason, 'class="form-control"');?></td>
<td><?php echo html::select('closedReason', $lang->task->reasonList, $task->closedReason, 'class="form-control chosen"');?></td>
</tr>
<tr>
<th><?php echo $lang->task->closedDate;?></th>
+14 -14
View File
@@ -295,16 +295,16 @@ class treeModel extends model
else
{
$treeMenu[$module->parent] = $moduleName;
}
}
}
}
/**
* Get the tree menu in html.
*
* @param int $rootID
* @param string $type
* @param int $startModule
*
* @param int $rootID
* @param string $type
* @param int $startModule
* @param string $userFunc the function used to create link
* @param string $extra extra params
* @access public
@@ -342,6 +342,7 @@ class treeModel extends model
{
$linkHtml = ($type == 'case' and !empty($extra)) ? $branch : $this->createBranchLink($type, $rootID, $branchID, $branch);
$linkHtml = $manage ? html::a(inlink('browse', "root=$rootID&viewType=$type&currentModuleID=0&branch=$branchID"), $branch) : $linkHtml;
if($type == 'story' || $type == 'bug') $linkHtml = $branch;
if($firstBranch and $product->type != 'normal')
{
$linkHtml = $this->lang->product->branchName[$product->type] . '<ul><li>' . $linkHtml;
@@ -357,17 +358,17 @@ class treeModel extends model
if(!$firstBranch) $lastMenu .= '</li></ul>';
$lastMenu = "<ul class='tree tree-lines'>$lastMenu</ul>\n";
return $lastMenu;
return $lastMenu;
}
/**
* Get the tree menu of task in html.
*
* @param int $rootID
* @param int $productID
* @param int $startModule
* @param int $userFunc
* @param string $extra
*
* @param int $rootID
* @param int $productID
* @param int $startModule
* @param int $userFunc
* @param string $extra
* @access public
* @return void
*/
@@ -1126,12 +1127,11 @@ class treeModel extends model
foreach($paths as $path) $moduleName .= '/' . $allModules[$path];
$modulePairs[$module->id] = $moduleName;
if($module->branch) $branchIDList[] = $module->branch;
if($module->branch) $branchIDList[$module->branch] = $module->branch;
}
if(!$branchPath) return $modulePairs;
$branchIDList = array_unique($branchIDList);
$branchs = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($branchIDList)->andWhere('deleted')->eq(0)->fetchALL('id');
foreach($modules as $module)
{