Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into fixbug

This commit is contained in:
tanghucheng
2022-04-28 16:49:58 +08:00
27 changed files with 275 additions and 159 deletions
+20 -52
View File
@@ -14,12 +14,13 @@ class feedbacksEntry extends entry
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get()
{
if(strpos(strtolower($this->param('fields')), 'moduleandproduct') !== false) return $this->getModuleAndProduct();
$control = $this->loadController('feedback', 'admin');
$control->admin($this->param('status', 'unclosed'), 0, $this->param('orderBy', 'id_desc'), 0, $this->param('limit', 20), $this->param('page', 1));
$data = $this->getData();
@@ -48,80 +49,47 @@ class feedbacksEntry extends entry
/**
* POST method.
*
* @param int $projectID
* @access public
* @return void
*/
public function post($projectID = 0)
public function post()
{
$fields = 'project,code,name,begin,end,lifetime,desc,days';
$fields = 'module,product,type,title,public,desc,status,feedbackBy,notifyEmail,notify,uid';
$this->batchSetPost($fields);
$projectID = $this->param('project', $projectID);
$this->setPost('project', $projectID);
$this->setPost('acl', $this->request('acl', 'private'));
$this->setPost('PO', $this->request('PO', ''));
$this->setPost('PM', $this->request('PM', ''));
$this->setPost('QD', $this->request('QD', ''));
$this->setPost('RD', $this->request('RD', ''));
$this->setPost('whitelist', $this->request('whitelist', array()));
$this->setPost('products', $this->request('products', array()));
$this->setPost('plans', $this->request('plans', array()));
$control = $this->loadController('execution', 'create'); $this->requireFields('name,code,begin,end,days');
$control->create($projectID);
$control = $this->loadController('feedback', 'create');
$this->requireFields('title,product');
$control->create();
$data = $this->getData();
if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message);
$execution = $this->loadModel('execution')->getByID($data->id);
$feedback = $this->loadModel('feedback')->getById($data->id);
$this->send(201, $this->format($execution, 'openedBy:user,openedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,PM:user,PO:user,RD:user,QD:user,whitelist:userList,begin:date,end:date,realBegan:date,realEnd:date,deleted:bool'));
$this->send(201, $this->format($feedback, 'openedBy:user,openedDate:time,reviewedBy:user,reviewedDate:time,processedBy:user,processedDate:time,closedBy:user,closedDate:time,editedBy:user,editedDate:time,assignedTo:user,assignedDate:time,feedbackBy:user,mailto:userList,deleted:bool'));
}
/**
* Get drop menu.
* GET method.
*
* @access public
* @return void
*/
public function getDropMenu()
public function getModuleAndProduct()
{
$control = $this->loadController('execution', 'ajaxGetDropMenu');
$control->ajaxGetDropMenu($this->request('executionID', 0), $this->request('module', 'execution'), $this->request('method', 'task'), $this->request('extra', ''));
$control = $this->loadController('feedback', 'create');
$control->create();
$data = $this->getData();
if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message);
$account = $this->app->user->account;
$projects = $data->data->projects;
$dropMenu = array('involved' => array(), 'other' => array(), 'closed' => array());
foreach($data->data->executions as $projectID => $projectExecutions)
{
foreach($projectExecutions as $execution)
{
if(helper::diffDate(date('Y-m-d'), $execution->end) > 0) $execution->delay = true;
$teams = $execution->teams;
$execution = $this->filterFields($execution, 'id,project,model,type,name,code,status,PM,delay');
$modules = $data->data->modules;
$products = $data->data->products;
$projectName = zget($projects, $execution->project, '');
if($projectName) $execution->name = $projectName . '/' . $execution->name;
$data = array();
$data['modules'] = $modules;
$data['products'] = $products;
if($execution->status == 'closed')
{
$dropMenu['closed'][] = $execution;
}
elseif($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $account or isset($teams->$account)))
{
$dropMenu['involved'][] = $execution;
}
else
{
$dropMenu['other'][] = $execution;
}
}
}
$this->send(200, $dropMenu);
return $this->send(200, $data);
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ class taskAssignToEntry extends Entry
$control->assignTo($task->execution, $taskID);
$data = $this->getData();
if(!$data or !isset($data->status)) return $this->send400('error');
if(!$data) return $this->send400('error');
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
$task = $this->loadModel('task')->getByID($taskID);
+15
View File
@@ -2304,6 +2304,21 @@ class bug extends control
$this->display();
}
/**
* Ajax get product members.
*
* @param int $productID
* @param string $selectedUser
* @access public
* @return string
*/
public function ajaxGetProductMembers($productID, $selectedUser = '')
{
$productMembers = $this->bug->getProductMemberPairs($productID);
return print(html::select('assignedTo', $productMembers, $selectedUser, 'class="form-control"'));
}
/**
* Ajax get project team members.
*
+89 -1
View File
@@ -52,6 +52,68 @@ function loadAll(productID)
}
}
/**
* Load all users as assignedTo list.
*
* @access public
* @return void
*/
function loadAllUsers()
{
var link = createLink('bug', 'ajaxLoadAllUsers', 'selectedUser=' + $('#assignedTo').val());
$.get(link, function(data)
{
if(data)
{
var moduleID = $('#module').val();
var productID = $('#product').val();
setAssignedTo(moduleID, productID);
$('#assignedTo').replaceWith(data);
$('#assignedTo_chosen').remove();
$('#assignedTo').chosen();
}
});
}
/**
* Set the assignedTo field.
*
* @param int $moduleID
* @param int $productID
* @access public
* @return void
*/
function setAssignedTo(moduleID, productID)
{
if(typeof(productID) == 'undefined') productID = $('#product').val();
if(typeof(moduleID) == 'undefined') moduleID = $('#module').val();
var link = createLink('bug', 'ajaxGetModuleOwner', 'moduleID=' + moduleID + '&productID=' + productID);
$.get(link, function(owner)
{
owner = JSON.parse(owner);
var account = owner[0];
var realName = owner[1];
var isExist = false;
var count = $('#assignedTo').find('option').length;
for(var i=0; i < count; i++)
{
if($('#assignedTo').get(0).options[i].value == account)
{
isExist = true;
break;
}
}
if(!isExist && account)
{
option = "<option title='" + realName + "' value='" + account + "'>" + realName + "</option>";
$("#assignedTo").append(option);
}
$('#assignedTo').val(account);
$("#assignedTo").trigger("chosen:updated");
});
}
/**
* Load by branch.
*
@@ -352,7 +414,14 @@ function loadExecutionRelated(executionID)
$('#taskIdBox').innerHTML = '<select id="task"></select>'; // Reset the task.
loadProductStories(currentProductID);
loadTestTasks(currentProductID);
loadProjectTeamMembers(currentProjectID);
if(typeof(currentProjectID) == 'undefined')
{
loadProductMembers(currentProductID);
}
else
{
loadProjectTeamMembers(currentProjectID);
}
currentProjectID != 0 ? loadProjectBuilds(currentProjectID) : loadProductBuilds(currentProductID);
}
@@ -482,6 +551,25 @@ function loadExecutionBuilds(executionID, num)
}
}
/**
* Load product members.
*
* @param productID
* @access public
* @return void
*/
function loadProductMembers(productID)
{
link = createLink('bug', 'ajaxGetProductMembers', 'productID=' + productID + '&selectedUser=' + $('#assignedTo').val());
$.get(link, function(data)
{
if(!data) data = '<select id="assignedTo" name="assignedTo" class="form-control"></select>';
$('#assignedTo').replaceWith(data);
$('#assignedTo_chosen').remove();
$("#assignedTo").chosen();
});
}
/**
* Load project members.
*
-61
View File
@@ -1,26 +1,3 @@
/**
* Load all users as assignedTo list.
*
* @access public
* @return void
*/
function loadAllUsers()
{
var link = createLink('bug', 'ajaxLoadAllUsers', 'selectedUser=' + $('#assignedTo').val());
$.get(link, function(data)
{
if(data)
{
var moduleID = $('#module').val();
var productID = $('#product').val();
setAssignedTo(moduleID, productID);
$('#assignedTo').replaceWith(data);
$('#assignedTo_chosen').remove();
$('#assignedTo').chosen();
}
});
}
/**
* Load team members of the latest execution of a product as assignedTo list.
*
@@ -77,44 +54,6 @@ function setLane(regionID)
});
}
/**
* Set the assignedTo field.
*
* @param int $moduleID
* @param int $productID
* @access public
* @return void
*/
function setAssignedTo(moduleID, productID)
{
if(typeof(productID) == 'undefined') productID = $('#product').val();
if(typeof(moduleID) == 'undefined') moduleID = $('#module').val();
var link = createLink('bug', 'ajaxGetModuleOwner', 'moduleID=' + moduleID + '&productID=' + productID);
$.get(link, function(owner)
{
owner = JSON.parse(owner);
var account = owner[0];
var realName = owner[1];
var isExist = false;
var count = $('#assignedTo').find('option').length;
for(var i=0; i < count; i++)
{
if($('#assignedTo').get(0).options[i].value == account)
{
isExist = true;
break;
}
}
if(!isExist && account)
{
option = "<option title='" + realName + "' value='" + account + "'>" + realName + "</option>";
$("#assignedTo").append(option);
}
$('#assignedTo').val(account);
$("#assignedTo").trigger("chosen:updated");
});
}
$(function()
{
var productID = $('#product').val();
+9 -1
View File
@@ -1837,6 +1837,13 @@ class bugModel extends model
return $bugs;
}
/**
* get Product member pairs.
*
* @param int $productID
* @access public
* @return void
*/
public function getProductMemberPairs($productID)
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembersPairs();
@@ -1846,7 +1853,8 @@ class bugModel extends model
$users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1')
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account')
->where('t1.root')->in(array_keys($projects))
->andWhere('t1.type')->eq('project')
->beginIF($this->config->systemMode == 'new')->andWhere('t1.type')->eq('project')->fi()
->beginIF($this->config->systemMode == 'classic')->andWhere('t1.type')->eq('execution')->fi()
->andWhere('t2.deleted')->eq(0)
->fi()
->fetchAll('account');
+37
View File
@@ -2532,6 +2532,17 @@ EOD;
/* The ip is same as ip in white list. */
if($ip == $ipWhiteList) return true;
/* If the ip in white list is like 192.168.1.1,192.168.1.10. */
if(strpos($ipWhiteList, ',') !== false)
{
$ipArr = explode(',', $ipWhiteList);
foreach($ipArr as $ipRule)
{
if($this->checkIP($ipRule)) return true;
}
return false;
}
/* If the ip in white list is like 192.168.1.1-192.168.1.10. */
if(strpos($ipWhiteList, '-') !== false)
{
@@ -2543,6 +2554,32 @@ EOD;
return $ip >= $min and $ip <= $max;
}
/* If the ip in white list is like 192.168.1.*. */
if(strpos($ipWhiteList, '*') !== false)
{
$regCount = substr_count($ipWhiteList, '.');
if($regCount == 3)
{
$min = str_replace('*', '0', $ipWhiteList);
$max = str_replace('*', '255', $ipWhiteList);
}
elseif($regCount == 2)
{
$min = str_replace('*', '0.0', $ipWhiteList);
$max = str_replace('*', '255.255', $ipWhiteList);
}
elseif($regCount == 1)
{
$min = str_replace('*', '0.0.0', $ipWhiteList);
$max = str_replace('*', '255.255.255', $ipWhiteList);
}
$min = ip2long(trim($min));
$max = ip2long(trim($max));
$ip = ip2long(trim($ip));
return ($ip >= $min and $ip <= $max);
}
/* If the ip in white list is in IP/CIDR format eg 127.0.0.1/24. Thanks to zcat. */
if(strpos($ipWhiteList, '/') == false) $ipWhiteList .= '/32';
list($ipWhiteList, $netmask) = explode('/', $ipWhiteList, 2);
+1 -1
View File
@@ -95,7 +95,7 @@ $(function()
<h4 class="modal-title"><i class="icon-cog-outline"></i> <?php echo $lang->datatable->displaySetting;?></h4>
</div>
<div class="modal-body">
<form class='form-condensed' method='post' target='hiddenwin' action='<?php echo $this->createLink('datatable', 'ajaxSave')?>'>
<form class="form-condensed not-watch" method='post' target='hiddenwin' action='<?php echo $this->createLink('datatable', 'ajaxSave')?>'>
<table class='table table-form'>
<tr>
<td class='w-160px'><?php echo $lang->datatable->showModule;?></td>
+1 -1
View File
@@ -310,7 +310,7 @@ class design extends control
$repoID = $repoID ? $repoID : key($repos);
$repo = $this->loadModel('repo')->getRepoByID($repoID);
$revisions = $this->repo->getCommits($repo, '', 'HEAD', '', '', $begin, $end);
$revisions = $this->repo->getCommits($repo, '', 'HEAD', '', '', $begin, date('Y-m-d 23:59:59', strtotime($end)));
if($_POST)
{
+5 -2
View File
@@ -19,10 +19,13 @@
<a href='javascript:;' class='btn btn-link btn-limit' data-toggle='dropdown'><span class='text' title='<?php echo $viewName;?>'><?php echo $viewName;?></span> <span class='caret'></span></a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
echo "<li>" . html::a($this->createLink('project', 'execution', "status=$status&projectID=$projectID&orderby=$orderBy"), $lang->product->allProduct) . "</li>";
$class = '';
if($productID == 0) $class = 'class="active"';
echo "<li $class>" . html::a($this->createLink('project', 'execution', "status=$status&projectID=$projectID&orderby=$orderBy"), $lang->product->allProduct) . "</li>";
foreach($productList as $key => $product)
{
echo "<li>" . html::a($this->createLink('project', 'execution', "status=$status&projectID=$projectID&orderby=$orderBy&productID=$key"), $product) . "</li>";
$class = $productID == $key ? 'class="active"' : '';
echo "<li $class>" . html::a($this->createLink('project', 'execution', "status=$status&projectID=$projectID&orderby=$orderBy&productID=$key"), $product) . "</li>";
}
?>
</ul>
+1
View File
@@ -4,6 +4,7 @@ $config->group->create = new stdclass();
$config->group->edit = new stdclass();
$config->group->create->requiredFields = 'name';
$config->group->edit->requiredFields = 'name';
$config->group->maxToolBarCount = 13;
$config->group->acl = new stdclass();
$config->group->acl->objectTypes['programs'] = 'program';
+1
View File
@@ -38,6 +38,7 @@ $lang->group->noneProduct = "No {$lang->productCommon}";
$lang->group->noneExecution = "No {$lang->execution->common}";
$lang->group->project = 'Project';
$lang->group->group = 'Group';
$lang->group->more = 'More';
global $config;
if($config->systemMode == 'new') $lang->group->noneProject = 'No Project';
+1
View File
@@ -38,6 +38,7 @@ $lang->group->noneProduct = "暂时没有{$lang->productCommon}";
$lang->group->noneExecution = "暂时没有{$lang->execution->common}";
$lang->group->project = '项目';
$lang->group->group = '分组';
$lang->group->more = '更多';
global $config;
if($config->systemMode == 'new') $lang->group->noneProject = '暂时没有项目';
+14 -5
View File
@@ -53,11 +53,20 @@
<?php $active = empty($menu) ? 'btn-active-text' : '';?>
<?php echo html::a(inlink('managePriv', sprintf($params, '')), "<span class='text'>{$lang->group->all}</span>", '', "class='btn btn-link $active'")?>
<?php foreach($lang->mainNav as $module => $title):?>
<?php if(!is_string($title)) continue;?>
<?php $active = $menu == $module ? 'btn-active-text' : '';?>
<?php echo html::a(inlink('managePriv', sprintf($params, $module)), "<span class='text'>" . strip_tags(substr($title, 0, strpos($title, '|'))) . '</span>', '', "class='btn btn-link $active'")?>
<?php endforeach;?>
<?php
$i = 0;
foreach($lang->mainNav as $module => $title)
{
if(!is_string($title)) continue;
$i++;
if($i == $config->group->maxToolBarCount) echo '<div class="btn-group"><a href="javascript:;" data-toggle="dropdown" class="btn btn-link">' . $lang->group->more . '<span class="caret"></span></a><ul class="dropdown-menu">';
$active = $menu == $module ? 'btn-active-text' : '';
if($i >= $config->group->maxToolBarCount) echo '<li>';
echo html::a(inlink('managePriv', sprintf($params, $module)), "<span class='text'>" . strip_tags(substr($title, 0, strpos($title, '|'))) . '</span>', '', "class='btn btn-link $active'");
if($i >= $config->group->maxToolBarCount) echo '</li>';
if($i == count($lang->mainNav->menuOrder) and $i >= $config->group->maxToolBarCount) echo '</ul></div>';
}
?>
<?php $active = $menu == 'other' ? 'btn-active-text' : '';?>
<?php echo html::a(inlink('managePriv', sprintf($params, 'other')), "<span class='text'>{$lang->group->other}</span>", '', "class='btn btn-link $active'");?>
+5 -3
View File
@@ -1058,8 +1058,10 @@ class productModel extends model
$projects = $this->dao->select('t2.id,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.type')->eq('project')
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->beginIF($this->config->systemMode == 'new')->andWhere('t2.type')->eq('project')->fi()
->beginIF($this->config->systemMode == 'classic')->andWhere('t2.type')->eq('sprint')->fi()
->beginIF(!$this->app->user->admin and $this->config->systemMode == 'new')->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->beginIF(!$this->app->user->admin and $this->config->systemMode == 'classic')->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
->beginIF($product->type != 'normal' and $branch !== '')->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t2.deleted')->eq('0')
->orderBy('order_asc')
@@ -1089,7 +1091,7 @@ class productModel extends model
->beginIF($this->config->systemMode == 'classic')->andWhere('t2.type')->eq('sprint')->fi()
->beginIF($browseType != 'all')->andWhere('t2.status')->eq($browseType)->fi()
->beginIF(!$this->app->user->admin and $this->config->systemMode == 'new')->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->beginIF(!$this->app->user->admin and $this->config->systemMode != 'new')->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
->beginIF(!$this->app->user->admin and $this->config->systemMode == 'classic')->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
->beginIF($this->cookie->involved or $involved)
->andWhere('t2.openedBy', true)->eq($this->app->user->account)
->orWhere('t2.PM')->eq($this->app->user->account)
-1
View File
@@ -1,4 +1,3 @@
.project-type-label.label-outline {width: 50px; min-width: 50px;}
.project-type-label.label {overflow: unset !important; text-overflow: unset !important; white-space: unset !important;}
[lang^='en'] .project-name > .label-warning {width: 55px !important;}
#projectTableList > tr > td.c-name.text-left > div > a {color: #0c60e1;}
Regular → Executable
+2 -2
View File
@@ -216,7 +216,7 @@ class programplanModel extends model
if(empty($selectCustom)) $selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module={$module}&section={$section}&key={$object}");
$tasks = array();
if(strpos($selectCustom, 'task') !== false) $tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('execution')->in($planIdList)->fetchAll('id');
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('execution')->in($planIdList)->fetchAll('id');
if($baselineID)
{
@@ -265,7 +265,7 @@ class programplanModel extends model
if($data->start_date) $data->start_date = date('d-m-Y', strtotime($data->start_date));
if($data->start_date == '' or $data->endDate == '') $data->duration = 0;
$datas['data'][] = $data;
if(strpos($selectCustom, 'task') !== false) $datas['data'][] = $data;
foreach($stageIndex as $index => $stage)
{
if($stage['planID'] == $task->execution)
+1 -1
View File
@@ -1708,7 +1708,7 @@ class projectModel extends model
if(isset($project->delay)) $suffix = "<span class='label label-danger label-badge'>{$this->lang->project->statusList['delay']}</span>";
if(!empty($suffix) || !empty($prefix)) echo '<div class="project-name' . (empty($prefix) ? '' : ' has-prefix') . (empty($suffix) ? '' : ' has-suffix') . '">';
if(!empty($prefix)) echo $prefix;
echo html::a($projectLink, $project->name, '', "class='text-ellipsis'");
echo html::a($projectLink, $project->name, '', "class='text-ellipsis text-primary'");
if(!empty($suffix)) echo $suffix;
if(!empty($suffix) || !empty($prefix)) echo '</div>';
break;
+1 -1
View File
@@ -376,7 +376,7 @@ class repoModel extends model
foreach($repos as $repo)
{
$repo->acl = json_decode($repo->acl);
$scm = $repo->SCM == 'Subversion' ? 'svn' : 'git';
$scm = $repo->SCM == 'Subversion' ? 'svn' : strtolower($repo->SCM);
if($this->checkPriv($repo))
{
if(($type == 'project' or $type == 'execution') and $projectID)
+23 -1
View File
@@ -15,7 +15,7 @@ $pathInfo = '&root=' . $this->repo->encodePath(empty($path) ? '/' : $path);
if(isset($entry)) $pathInfo .= '&type=file';
?>
<?php js::set('paramsBase', "repoID=$repoID&path=" . $this->repo->encodePath($path) . "&objectID=$objectID&type=$logType");?>
<form id='logForm' class='main-table' data-ride='table' method='post'>
<form id='logForm' class='main-table' data-ride='table' method='post' onsubmit='logsubmit()'>
<table class='table table-fixed'>
<thead>
<tr>
@@ -69,6 +69,11 @@ if(isset($entry)) $pathInfo .= '&type=file';
</div>
</form>
<script>
if($.cookie('sideRepoSelected'))
{
var sideRepoSelectedAry = $.cookie('sideRepoSelected').split(',');
for(i in sideRepoSelectedAry) $("input:checkbox[value='" + sideRepoSelectedAry[i] + "']").attr('checked', 'checked');
}
if($("input:checkbox[name='revision[]']:checked").length < 2)
{
$("input:checkbox[name='revision[]']:lt(2)").attr('checked', 'checked');
@@ -87,6 +92,23 @@ $("input:checkbox[name='revision[]']").click(function(){
}
});
/**
* Method before submit
*
* @access public
* @return void
*/
function logsubmit()
{
$("input:checkbox[name='revision[]']:checked").each(function()
{
var sideRepoSelected = $.cookie('sideRepoSelected') ? $.cookie('sideRepoSelected').split(',') : [];
sideRepoSelected.unshift($(this).val());
sideRepoSelected = sideRepoSelected.slice(0, 2);
$.cookie('sideRepoSelected', sideRepoSelected.join(','), {expires:config.cookieLife, path:config.webRoot});
});
}
$(function()
{
var myPager = $('#repoPageSize').data('zui.pager');
+3 -3
View File
@@ -114,7 +114,7 @@ class report extends control
$this->view->begin = $begin;
$this->view->end = $end;
$this->view->bugs = $this->report->getBugs($begin, $end, $product, $execution);
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed');
$this->view->executions = array('' => '') + $this->report->getProjectExecutions();
$this->view->products = array('' => '') + $this->loadModel('product')->getPairs();
$this->view->execution = $execution;
@@ -137,7 +137,7 @@ class report extends control
$this->view->position[] = $this->lang->report->bugAssign;
$this->view->submenu = 'test';
$this->view->assigns = $this->report->getBugAssign();
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed');
$this->display();
}
@@ -195,7 +195,7 @@ class report extends control
$this->view->position[] = $this->lang->report->workload;
$this->view->workload = $this->report->getWorkload($dept, $assign);
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted');
$this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed');
$this->view->depts = $this->loadModel('dept')->getOptionMenu();
$this->view->begin = $begin;
$this->view->end = date('Y-m-d', strtotime($end) - 24 * 3600);
+34 -16
View File
@@ -309,11 +309,6 @@ class task extends control
}
$execution = $this->execution->getById($executionID);
if($this->config->systemMode == 'new')
{
$project = $this->project->getByID($execution->project);
if($project->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline';
}
if($this->app->tab == 'my')
{
@@ -364,16 +359,6 @@ class task extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $taskLink));
}
/* Set Custom*/
foreach(explode(',', $this->config->task->customBatchCreateFields) as $field)
{
if($execution->type == 'stage' and strpos('estStarted,deadline', $field) !== false) continue;
$customFields[$field] = $this->lang->task->$field;
}
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->batchCreateFields;
$story = $this->story->getByID($storyID);
if($story)
{
@@ -389,6 +374,21 @@ class task extends control
$showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
$modules = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : '');
/* Set Custom*/
if($this->config->systemMode == 'new')
{
$project = $this->project->getByID($execution->project);
if($project->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline';
}
foreach(explode(',', $this->config->task->customBatchCreateFields) as $field)
{
if($execution->type == 'stage' and strpos('estStarted,deadline', $field) !== false) continue;
$customFields[$field] = $this->lang->task->$field;
}
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->batchCreateFields;
if($execution->type == 'kanban')
{
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
@@ -663,7 +663,25 @@ class task extends control
if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars);
/* Set Custom*/
foreach(explode(',', $this->config->task->customBatchEditFields) as $field) $customFields[$field] = $this->lang->task->$field;
if(isset($execution))
{
if($this->config->systemMode == 'new')
{
$project = $this->project->getByID($execution->project);
if($project->model == 'waterfall') $this->config->task->edit->requiredFields .= ',estStarted,deadline';
}
foreach(explode(',', $this->config->task->customBatchEditFields) as $field)
{
if($execution->type == 'stage' and strpos('estStarted,deadline', $field) !== false) continue;
$customFields[$field] = $this->lang->task->$field;
}
}
else
{
foreach(explode(',', $this->config->task->customBatchEditFields) as $field) $customFields[$field] = $this->lang->task->$field;
}
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->batchEditFields;
+6 -1
View File
@@ -105,7 +105,7 @@ class taskModel extends model
/* Check duplicate task. */
if($task->type != 'affair' and $task->name)
{
$result = $this->loadModel('common')->removeDuplicate('task', $task, "execution={$executionID} and story=" . (int)$task->story);
$result = $this->loadModel('common')->removeDuplicate('task', $task, "execution={$executionID} and story=" . (int)$task->story . (isset($task->feedback) ? " and feedback=" . (int)$task->feedback : ''));
if($result['stop'])
{
$taskIdList[$assignedTo] = array('status' => 'exists', 'id' => $result['duplicate']);
@@ -1311,6 +1311,11 @@ class taskModel extends model
return false;
}
if($this->config->systemMode == 'new')
{
$project = $this->loadModel('project')->getByID($oldTask->project);
if($project->model == 'waterfall') $this->config->task->edit->requiredFields .= ',estStarted,deadline';
}
foreach(explode(',', $this->config->task->edit->requiredFields) as $field)
{
$field = trim($field);
+2 -2
View File
@@ -1,7 +1,7 @@
/**
* Confirm batch delete cases.
*
* @param string $actionLink
*
* @param string $actionLink
* @access public
* @return void
*/
+1 -1
View File
@@ -70,7 +70,7 @@ $lang->upgrade->to15Desc = <<<EOD
<p>You can try the online demo before you decide to enable new features: <a class='text-info' href='http://zentaomax.demo.zentao.net' target='_blank'>New Features Online Demo</a></p>
<p>You can also download an introduction PPT to help you understand it:<a class='text-info' href='' target='_blank'> New Features Introduction PPT</a></p>
<video src="https://dl.cnezsoft.com/vedio/zentaoconcepteng0716.mp4" width="100%" controls ="controls"></video>
<p style="text-align:center"><small>ZenTao Version 15.0 Introduction</small></p>
<p style="text-align:center"><small>ZenTao Version 15 Introduction</small></p>
<br/>
<p><strong>How do you like to use ZenTao?</strong></p>
EOD;
+1 -1
View File
@@ -73,7 +73,7 @@ $lang->upgrade->to15Desc = <<<EOD
<p>您可以在线体验最新版本的功能,以决定是否启用新的模式:<a class='text-info' href='http://zentaomax.demo.zentao.net' target='_blank'>最新版演示demo</a></p>
<p>您还可以下载新版本功能介绍PPT:<a class='text-info' href='https://dl.cnezsoft.com/zentao/zentaoconcept.pdf' target='_blank'>最新版功能介绍PPT</a></p>
<video src="https://dl.cnezsoft.com/vedio/program0716.mp4" width="100%" controls ="controls"></video>
<p style="text-align:center"><small>禅道15.0版本介绍</small></p>
<p style="text-align:center"><small>禅道15版本介绍</small></p>
<br/>
<p><strong>请问您计划如何使用禅道的新版本呢?</strong></p>
EOD;
+1 -1
View File
@@ -73,7 +73,7 @@ $lang->upgrade->to15Desc = <<<EOD
<p>您可以在綫體驗最新版本的功能,以決定是否啟用新的模式:<a class='text-info' href='http://zentaomax.demo.zentao.net' target='_blank'>最新版演示demo</a></p>
<p>您還可以下載新版本功能介紹PPT:<a class='text-info' href='https://dl.cnezsoft.com/zentao/zentaoconcept.pdf' target='_blank'>最新版功能介紹PPT</a></p>
<video src="https://dl.cnezsoft.com/vedio/program0716.mp4" width="100%" controls ="controls"></video>
<p style="text-align:center"><small>禪道15.0版本介紹</small></p>
<p style="text-align:center"><small>禪道15版本介紹</small></p>
<br/>
<p><strong>請問您計劃如何使用禪道的新版本呢?</strong></p>
EOD;