* Adjust code.

This commit is contained in:
leiyong
2020-11-27 16:59:27 +08:00
parent d587642cb1
commit 175443edaf
8 changed files with 54 additions and 26 deletions
-1
View File
@@ -549,7 +549,6 @@ $lang->menugroup->branch = 'product';
$lang->menugroup->productplan = 'product';
$lang->menugroup->task = 'project';
$lang->menugroup->build = 'project';
$lang->menugroup->product = 'projectstory';
$lang->menugroup->convert = 'admin';
$lang->menugroup->upgrade = 'admin';
$lang->menugroup->user = 'company';
+1 -1
View File
@@ -363,7 +363,7 @@ class issue extends control
$this->loadModel('task');
$this->loadModel('tree');
$this->loadModel('project')->getLimitedExecution();
$projects = $this->project->getExecutionPairs($this->session->PRJ);
$projects = $this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true);
$projectID = $this->session->project;
$projectID = isset($projects[$projectID]) ? $projectID : key($projects);
+33 -11
View File
@@ -1,9 +1,10 @@
function setProgramType(type)
{
$.cookie('programType', type, {expires:config.cookieLife, path:config.webRoot});
location.href = location.href;
}
/**
* Access rights are equal to private, and the white list settings are displayed.
*
* @param string acl
* @access public
* @return void
*/
function setWhite(acl)
{
acl != 'open' ? $('#whitelistBox').removeClass('hidden') : $('#whitelistBox').addClass('hidden');
@@ -12,7 +13,7 @@ function setWhite(acl)
/**
* Convert a date string like 2011-11-11 to date object in js.
*
* @param string $date
* @param string dateString
* @access public
* @return date
*/
@@ -25,8 +26,8 @@ function convertStringToDate(dateString)
/**
* Compute delta of two days.
*
* @param string $date1
* @param string $date1
* @param string date1
* @param string date2
* @access public
* @return int
*/
@@ -50,6 +51,7 @@ function computeDaysDelta(date1, date2)
/**
* Compute work days.
*
* @param string currentID
* @access public
* @return void
*/
@@ -124,12 +126,15 @@ function computeEndDate(delta)
/**
* Load branches.
*
* @param int $product
* @param object product
* @access public
* @return void
*/
function loadBranches(product)
{
/* When selecting a product, delete a plan that is empty by default. */
$("#planDefault").remove();
$('#productsBox select').each(function()
{
var $product = $(product);
@@ -196,7 +201,12 @@ function loadPlans(product, branchID)
}
}
/**
* Adjust the layout of product selection.
*
* @access public
* @return void
*/
function adjustProductBoxMargin()
{
var productRows = Math.ceil($('#productsBox > .row > .col-sm-4').length / 3);
@@ -209,6 +219,12 @@ function adjustProductBoxMargin()
}
}
/**
* Adjust the layout of the plan selection.
*
* @access public
* @return void
*/
function adjustPlanBoxMargin()
{
var planRows = Math.ceil($('#plansBox > .row > .col-sm-4').length / 3);
@@ -221,6 +237,12 @@ function adjustPlanBoxMargin()
}
}
/**
* Initialization operation.
*
* @access public
* @return void
*/
$(function()
{
$('#privList > tbody > tr > th input[type=checkbox]').change(function()
+5 -4
View File
@@ -63,7 +63,7 @@
</div>
<?php $i++;?>
<?php endforeach;?>
<div class='col-sm-4 <?php if($programID) echo 'required';?>'>
<div class='col-sm-4 <?php if($programID) echo 'required';?>'>
<div class='input-group'>
<?php echo html::select("products[$i]", $allProducts, '', "class='form-control chosen' onchange='loadBranches(this)'");?>
<span class='input-group-addon fix-border'></span>
@@ -78,10 +78,11 @@
<div class='row'>
<?php $i = 0;?>
<?php foreach($linkedProducts as $product):?>
<?php $plans = zget($productPlans, $product->id, array(0 => ''));?>
<div class="col-sm-4" id="plan<?php echo $i;?>"><?php echo html::select("plans[" . $product->id . "]", $plans, $product->plan, "class='form-control chosen'");?></div>
<?php $i++;?>
<?php $plans = zget($productPlans, $product->id, array(0 => ''));?>
<div class="col-sm-4" id="plan<?php echo $i;?>"><?php echo html::select("plans[" . $product->id . "]", $plans, $product->plan, "class='form-control chosen'");?></div>
<?php $i++;?>
<?php endforeach;?>
<div class="col-sm-4" id="planDefault"><?php echo html::select("plans[0]", array(), 0, "class='form-control chosen'");?></div>
</div>
</td>
</tr>
-2
View File
@@ -1,2 +0,0 @@
<?php
+10 -3
View File
@@ -46,12 +46,15 @@ class projectStory extends control
$this->session->set('storyList', $this->app->getURI(true));
if(empty($productID)) $productID = key($this->products);
$this->lang->menugroup->product = 'projectstory';
$this->lang->projectstory->menu->requirement['subModule'] = 'product';
$this->projectstory->setMenu($this->products, $productID, $branch);
$this->lang->story->title = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->title);
$this->lang->story->createRequirement = str_replace($this->lang->productURCommon, $this->lang->projectURCommon, $this->lang->story->createRequirement);
$this->lang->story->createStory = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->createStory);
$this->lang->story->noStory = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->noStory);
$this->lang->projectstory->menu->requirement['subModule'] = 'product';
$this->projectstory->setMenu($this->products, $productID, $branch);
echo $this->fetch('product', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&storyType=$storyType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
}
@@ -71,12 +74,14 @@ class projectStory extends control
*/
public function story($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->session->set('storyList', $this->app->getURI(true));
$this->session->set('storyList',$this->app->getURI(true));
if(empty($productID)) $productID = key($this->products);
$this->lang->menugroup->product = 'projectstory';
$this->lang->projectstory->menu->story['subModule'] = 'product';
$this->projectstory->setMenu($this->products, $productID, $branch);
$this->lang->story->title = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->title);
$this->lang->story->createRequirement = str_replace($this->lang->productURCommon, $this->lang->projectURCommon, $this->lang->story->createRequirement);
$this->lang->story->createStory = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->createStory);
$this->lang->story->noStory = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->noStory);
@@ -98,11 +103,13 @@ class projectStory extends control
public function track($productID = 0, $branch = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
if(empty($productID)) $productID = key($this->products);
$this->lang->menugroup->story = 'projectstory';
$this->lang->projectstory->menu->track['subModule'] = 'story';
$this->projectstory->setMenu($this->products, $productID, $branch);
$this->lang->story->requirement = str_replace($this->lang->productURCommon, $this->lang->projectURCommon, $this->lang->story->requirement);
$this->lang->story->story = str_replace($this->lang->productSRCommon, $this->lang->projectSRCommon, $this->lang->story->story);
echo $this->fetch('story', 'track', "productID=$productID&branch=$branch&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
<?php
$lang->projectstory->common = '项目需求';
$lang->projectstory->common = '项目列表';
$lang->projectstory->index = '需求主页';
$lang->projectstory->requirement = '用户需求';
$lang->projectstory->story = '软件需求';
$lang->projectstory->requirement = $lang->generalUR;
$lang->projectstory->story = $lang->generalSR;
$lang->projectstory->track = '跟踪矩阵';
+2 -1
View File
@@ -722,7 +722,8 @@ class story extends control
$changes = $this->story->change($storyID);
if(dao::isError()) die(js::error(dao::getError()));
$version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version');
$files = $this->loadModel('file')->saveUpload('story', $storyID, $version);
$files = $this->loadModel('file')->saveUpload('story', $storyID, $version);
if($this->post->comment != '' or !empty($changes) or !empty($files))
{
$action = (!empty($changes) or !empty($files)) ? 'Changed' : 'Commented';