Merge branch '15.2'
This commit is contained in:
@@ -11,7 +11,7 @@ $config->project->editor->activate = array('id' => 'comment', 'tools' => 'simple
|
||||
$config->project->editor->view = array('id' => 'lastComment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->project->list = new stdclass();
|
||||
$config->project->list->exportFields = 'id,name,code,template,product,status,begin,end,budget,PM,end,desc';
|
||||
$config->project->list->exportFields = 'id,parent,name,linkedProducts,status,begin,end,budget,PM,end,desc';
|
||||
|
||||
$config->project->create = new stdclass();
|
||||
$config->project->edit = new stdclass();
|
||||
@@ -92,14 +92,14 @@ $config->project->datatable->fieldList['estimate']['pri'] = '8';
|
||||
|
||||
$config->project->datatable->fieldList['consume']['title'] = 'consume';
|
||||
$config->project->datatable->fieldList['consume']['fixed'] = 'no';
|
||||
$config->project->datatable->fieldList['consume']['width'] = '70';
|
||||
$config->project->datatable->fieldList['consume']['width'] = '80';
|
||||
$config->project->datatable->fieldList['consume']['maxWidth'] = '80';
|
||||
$config->project->datatable->fieldList['consume']['required'] = 'no';
|
||||
$config->project->datatable->fieldList['consume']['sort'] = 'no';
|
||||
$config->project->datatable->fieldList['consume']['pri'] = '7';
|
||||
|
||||
$config->project->datatable->fieldList['progress']['title'] = 'progress';
|
||||
$config->project->datatable->fieldList['progress']['fixed'] = 'right';
|
||||
$config->project->datatable->fieldList['progress']['fixed'] = 'no';
|
||||
$config->project->datatable->fieldList['progress']['width'] = '60';
|
||||
$config->project->datatable->fieldList['progress']['required'] = 'no';
|
||||
$config->project->datatable->fieldList['progress']['sort'] = 'no';
|
||||
|
||||
@@ -68,7 +68,7 @@ class project extends control
|
||||
unset($fields[$key]);
|
||||
}
|
||||
|
||||
$projects = $this->project->getList($status, $orderBy, null);
|
||||
$projects = $this->project->getInfoList($status, 30, $orderBy, null);
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
foreach($projects as $i => $project)
|
||||
{
|
||||
@@ -77,6 +77,10 @@ class project extends control
|
||||
$project->model = zget($projectLang->modelList, $project->model);
|
||||
$project->product = zget($projectLang->productList, $project->product);
|
||||
$project->budget = $project->budget . zget($projectLang->unitList, $project->budgetUnit);
|
||||
$project->parent = $project->parentName;
|
||||
|
||||
$linkedProducts = $this->project->getProducts($project->id, false);
|
||||
$project->linkedProducts = implode(',', $linkedProducts);
|
||||
|
||||
if($this->post->exportType == 'selected')
|
||||
{
|
||||
@@ -419,12 +423,7 @@ class project extends control
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$oldPlans = $this->dao->select('plan')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs('plan');
|
||||
$oldPlanStories = $this->dao->select('t1.story')->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.project=t2.project')
|
||||
->where('t1.project')->eq($projectID)
|
||||
->andWhere('t2.plan')->in(array_keys($oldPlans))
|
||||
->fetchAll('story');
|
||||
$oldPlans = $this->dao->select('plan')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->andWhere('plan')->ne(0)->fetchPairs('plan');
|
||||
|
||||
$changes = $this->project->update($projectID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
@@ -439,7 +438,7 @@ class project extends control
|
||||
$diffResult = array_diff($oldPlans, $_POST['plans']);
|
||||
if(!empty($_POST['plans']) and !empty($diffResult))
|
||||
{
|
||||
$this->loadModel('productplan')->linkProject($projectID, $_POST['plans'], $oldPlanStories);
|
||||
$this->loadModel('productplan')->linkProject($projectID, $_POST['plans']);
|
||||
}
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
@@ -1623,7 +1622,7 @@ class project extends control
|
||||
$response = array();
|
||||
$response['result'] = true;
|
||||
$response['message'] = $this->lang->project->changeProgramTip;
|
||||
|
||||
|
||||
/* Get new program products. */
|
||||
$newProducts = $this->program->getProductPairs($programID, 'assign', 'noclosed');
|
||||
$response['newProducts'] = html::select("newProducts", array('0' => '') + $newProducts, '', "class='form-control chosen' onchange='loadBranches(this)'");
|
||||
|
||||
@@ -47,7 +47,7 @@ $lang->project->errorNoProducts = '最少关联一个产品';
|
||||
$lang->project->copyNoProject = '没有可用的项目来复制';
|
||||
$lang->project->searchByName = '输入项目名称进行检索';
|
||||
$lang->project->deleted = '已删除';
|
||||
$lang->project->linkedProducts = '已关联';
|
||||
$lang->project->linkedProducts = '已关联产品';
|
||||
$lang->project->unlinkedProducts = '未关联';
|
||||
$lang->project->testreport = '测试报告';
|
||||
$lang->project->selectProgram = '项目集筛选';
|
||||
@@ -55,7 +55,9 @@ $lang->project->teamMember = '团队成员';
|
||||
|
||||
/* Fields. */
|
||||
$lang->project->common = '项目';
|
||||
$lang->project->id = '项目编号';
|
||||
$lang->project->stage = '阶段';
|
||||
$lang->project->model = '项目管理方式';
|
||||
$lang->project->PM = '负责人';
|
||||
$lang->project->name = '项目名称';
|
||||
$lang->project->category = '项目类型';
|
||||
@@ -65,7 +67,19 @@ $lang->project->copy = '复制项目';
|
||||
$lang->project->begin = '计划开始';
|
||||
$lang->project->end = '计划完成';
|
||||
$lang->project->status = '状态';
|
||||
$lang->project->subStatus = '子状态';
|
||||
$lang->project->type = '项目类型';
|
||||
$lang->project->pri = '优先级';
|
||||
$lang->project->openedBy = '由谁创建';
|
||||
$lang->project->openedDate = '创建日期';
|
||||
$lang->project->closedBy = '由谁关闭';
|
||||
$lang->project->closedDate = '关闭日期';
|
||||
$lang->project->canceledBy = '由谁取消';
|
||||
$lang->project->canceledDate = '取消日期';
|
||||
$lang->project->team = '团队';
|
||||
$lang->project->order = '排序';
|
||||
$lang->project->budget = '预算';
|
||||
$lang->project->budgetUnit = '预算单位';
|
||||
$lang->project->template = '项目模板';
|
||||
$lang->project->estimate = '预计';
|
||||
$lang->project->consume = '消耗';
|
||||
|
||||
@@ -780,7 +780,6 @@ class projectModel extends model
|
||||
|
||||
$whitelist = explode(',', $project->whitelist);
|
||||
$this->loadModel('personnel')->updateWhitelist($whitelist, 'project', $projectID);
|
||||
if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project');
|
||||
|
||||
/* Create doc lib. */
|
||||
$this->app->loadLang('doc');
|
||||
@@ -962,7 +961,13 @@ class projectModel extends model
|
||||
|
||||
$whitelist = explode(',', $project->whitelist);
|
||||
$this->loadModel('personnel')->updateWhitelist($whitelist, 'project', $projectID);
|
||||
if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project');
|
||||
if($project->acl != 'open')
|
||||
{
|
||||
$this->loadModel('user')->updateUserView($projectID, 'project');
|
||||
|
||||
$executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->fetchPairs('id', 'id');
|
||||
if($executions) $this->user->updateUserView($executions, 'sprint');
|
||||
}
|
||||
|
||||
if($project->acl == 'private')
|
||||
{
|
||||
@@ -1356,7 +1361,7 @@ class projectModel extends model
|
||||
|
||||
if($id == 'budget')
|
||||
{
|
||||
$projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);
|
||||
$projectBudget = in_array($this->app->getClientLang(), array('zh-cn','zh-tw')) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);
|
||||
$budgetTitle = $project->budget != 0 ? zget($this->lang->project->currencySymbol, $project->budgetUnit) . ' ' . $projectBudget : $this->lang->project->future;
|
||||
|
||||
$title = "title='$budgetTitle'";
|
||||
@@ -1367,6 +1372,7 @@ class projectModel extends model
|
||||
if($id == 'surplus') $title = "title='{$project->hours->totalLeft} {$this->lang->execution->workHour}'";
|
||||
|
||||
echo "<td class='$class' $title>";
|
||||
if(isset($this->config->bizVersion)) $this->loadModel('flow')->printFlowCell('project', $project, $id);
|
||||
switch($id)
|
||||
{
|
||||
case 'id':
|
||||
@@ -1517,6 +1523,23 @@ class projectModel extends model
|
||||
if($needUpdate) $this->user->updateUserView($needUpdate, 'product', $members);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update userview for involved product and execution.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param array $users
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateInvolvedUserView($projectID, $users = array())
|
||||
{
|
||||
$products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs('product', 'product');
|
||||
$this->loadModel('user')->updateUserView($products, 'product', $stakeholder);
|
||||
|
||||
$executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->fetchPairs('id', 'id');
|
||||
if($executions) $this->user->updateUserView($executions, 'sprint', $stakeholder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get team members.
|
||||
*
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datatable.fix.html.php';?>
|
||||
<?php
|
||||
js::set('orderBy', $orderBy);
|
||||
js::set('programID', $programID);
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<?php echo html::a('#',"<i class='icon-list'></i> ", '', "class='btn btn-icon' title='{$lang->project->bylist}' id='switchButton' data-type='bylist'");?>
|
||||
<?php echo html::a('#',"<i class='icon-cards-view'></i> ", '', "class='btn btn-icon text-primary' title='{$lang->project->bycard}' id='switchButton' data-type='bycard'");?>
|
||||
</div>
|
||||
<?php common::printLink('project', 'export', "status=$browseType&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
|
||||
<?php if(isset($this->config->maxVersion)):?>
|
||||
<?php common::printLink('project', 'createGuide', "programID=$programID", '<i class="icon icon-plus"></i> ' . $lang->project->create, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?>
|
||||
<?php elseif($this->config->systemMode == 'new'):?>
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<?php echo html::a('#',"<i class='icon-list'></i> ", '', "class='btn btn-icon text-primary' title='{$lang->project->bylist}' id='switchButton' data-type='bylist'");?>
|
||||
<?php echo html::a('#',"<i class='icon-cards-view'></i> ", '', "class='btn btn-icon' title='{$lang->project->bycard}' id='switchButton' data-type='bycard'");?>
|
||||
</div>
|
||||
<?php common::printLink('project', 'export', "status=$browseType&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
|
||||
<?php if(isset($this->config->maxVersion)):?>
|
||||
<?php common::printLink('project', 'createGuide', "programID=$programID", '<i class="icon icon-plus"></i> ' . $lang->project->create, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?>
|
||||
<?php elseif($this->config->systemMode == 'new'):?>
|
||||
@@ -78,10 +79,16 @@
|
||||
<nav class="btn-toolbar pull-right"></nav>
|
||||
</div>
|
||||
<?php
|
||||
$vars = "programID=$programID&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
|
||||
$setting = $this->datatable->getSetting('project');
|
||||
$vars = "programID=$programID&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
|
||||
$datatableId = $this->moduleName . ucfirst($this->methodName);
|
||||
$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
|
||||
$setting = $this->datatable->getSetting('project');
|
||||
$widths = $this->datatable->setFixedFieldWidth($setting);
|
||||
|
||||
if($useDatatable) include '../../common/view/datatable.html.php';
|
||||
?>
|
||||
<table class='table has-sort-head'>
|
||||
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
|
||||
<table class='table has-sort-head <?php if($useDatatable) echo 'datatable';?>' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
|
||||
<?php $canBatchEdit = $this->config->systemMode == 'new' ? common::hasPriv('project', 'batchEdit') : common::hasPriv('project', 'batchEdit');?>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -104,6 +111,7 @@
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if(!$useDatatable) echo '</div>';?>
|
||||
<div class='table-footer'>
|
||||
<?php if($canBatchEdit):?>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
|
||||
@@ -136,13 +136,13 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $this->printExtendFields('', 'table');?>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->desc;?></th>
|
||||
<td colspan='3'>
|
||||
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'" . (strpos($requiredFields, 'desc') !== false ? ' required' : ''));?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $this->printExtendFields('', 'table', 'columns=3');?>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->acl;?></th>
|
||||
<td colspan='3' class='aclBox'><?php echo nl2br(html::radio('acl', $lang->project->aclList, $acl, "onclick='setWhite(this.value);'", 'block'));?></td>
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
<?php echo html::textarea('desc', $project->desc, "rows='6' class='form-control kindeditor' hidefocus='true'" . (strpos($requiredFields, 'desc') !== false ? ' required' : ''));?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $this->printExtendFields('', 'table', 'columns=3');?>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->acl;?></th>
|
||||
<td colspan='3' class='aclBox'><?php echo nl2br(html::radio('acl', $aclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?></td>
|
||||
|
||||
Reference in New Issue
Block a user