Merge branch '15.0.beta3' of http://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3

This commit is contained in:
holan20180123
2021-04-02 14:19:32 +08:00
19 changed files with 114 additions and 40 deletions
+4 -4
View File
@@ -37,10 +37,10 @@ $config->themes['default'] = 'default';
$config->langs['zh-cn'] = '简体';
$config->langs['zh-tw'] = '繁體';
$config->langs['en'] = 'English';
$config->langs['de'] = 'Deutsch';
$config->langs['fr'] = 'Français';
$config->langs['vi'] = 'Tiếng Việt';
$config->langs['ja'] = '日本語';
//$config->langs['de'] = 'Deutsch';
//$config->langs['fr'] = 'Français';
//$config->langs['vi'] = 'Tiếng Việt';
//$config->langs['ja'] = '日本語';
/* 设备类型视图文件前缀。The prefix for view file for different device. */
$config->devicePrefix['mhtml'] = '';
+2
View File
@@ -6,10 +6,12 @@
<div class="tile-title"><?php echo $lang->block->createdTodos;?></div>
<div class="tile-amount"><?php echo empty($data['createdTodos']) ? 0 : html::a($this->createLink('my', 'todo', 'type=all'), (int)$data['createdTodos']);?></div>
</div>
<?php if($config->URAndSR):?>
<div class="col-xs-4 tile">
<div class="tile-title"><?php echo $lang->block->createdRequirements;?></div>
<div class="tile-amount"><?php echo empty($data['createdRequirements']) ? 0 : (int)$data['createdRequirements'];?></div>
</div>
<?php endif;?>
<div class="col-xs-4 tile">
<div class="tile-title"><?php echo $lang->block->createdStories;?></div>
<div class="tile-amount"><?php echo empty($data['createdStories']) ? 0 : (int)$data['createdStories'];?></div>
+1 -1
View File
@@ -58,7 +58,7 @@ class bugModel extends model
$bug = fixer::input('post')
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', $now)
->setDefault('execution,story,task', 0)
->setDefault('project,execution,story,task', 0)
->setDefault('openedBuild', '')
->setDefault('deadline', '0000-00-00')
->setIF($this->config->systemMode == 'new' && $this->lang->navGroup->bug != 'qa', 'project', $this->session->project)
+1 -1
View File
@@ -540,7 +540,7 @@ class custom extends control
$mode = zget($this->config->global, 'mode', 'classic');
if($mode == 'new')
{
if(isset($this->config->global->upgradeStep) and $this->config->global->upgradeStep == 'mergeProgram') $this->locate($this->createLink('upgrade', 'mergeProgram'));
if(isset($this->config->global->upgradeStep) and $this->config->global->upgradeStep == 'mergeProgram') $this->locate($this->createLink('upgrade', 'mergeProgram'), 'parent');
unset($_SESSION['upgrading']);
$this->locate(inlink('index'));
+2 -1
View File
@@ -328,7 +328,8 @@ class customModel extends model
if(empty($module)) $module = 'main';
global $app, $lang, $config;
if($module == 'main') $allMenu = $lang->menu;
$allMenu = new stdclass();
if($module == 'main' and !empty($lang->menu)) $allMenu = $lang->menu;
if($module != 'main' and isset($lang->menu->$module) and isset($lang->menu->{$module}['subMenu'])) $allMenu = $lang->menu->{$module}['subMenu'];
if($module == 'product' and isset($allMenu->branch)) $allMenu->branch = str_replace('@branch@', $lang->custom->branch, $allMenu->branch);
$flowModule = $config->global->flow . '_' . $module;
+22 -2
View File
@@ -88,6 +88,11 @@ class datatableModel extends model
$set->title = $fieldList[$id]['title'];
$set->sort = isset($fieldList[$id]['sort']) ? $fieldList[$id]['sort'] : 'yes';
$set->name = isset($fieldList[$id]['name']) ? $fieldList[$id]['name'] : '';
if(isset($fieldList[$id]['minWidth'])) $set->minWidth = $fieldList[$id]['minWidth'];
if(isset($fieldList[$id]['maxWidth'])) $set->maxWidth = $fieldList[$id]['maxWidth'];
if(isset($fieldList[$id]['pri'])) $set->pri = $fieldList[$id]['pri'];
$setting[$key] = $set;
}
}
@@ -152,10 +157,25 @@ class datatableModel extends model
$title = isset($col->title) ? "title='$col->title'" : '';
$title = (isset($col->name) and $col->name) ? "title='$col->name'" : $title;
if($id == 'id' and (int)$width < 90) $width = '90px';
$width = "data-width='$width' style='width:$width'";
$align = $id == 'actions' ? 'text-center' : '';
echo "<th data-flex='$fixed' $width class='c-$id $align' $title>";
$style = '';
$data = '';
$data .= "data-width='$width'";
$style .= "width:$width;";
if(isset($col->minWidth))
{
$data .= "data-minWidth='{$col->minWidth}px'";
$style .= "min-width:{$col->minWidth}px;";
}
if(isset($col->maxWidth))
{
$data .= "data-maxWidth='{$col->maxWidth}px'";
$style .= "max-width:{$col->maxWidth}px;";
}
if(isset($col->pri)) $data .= "data-pri='{$col->pri}'";
echo "<th data-flex='$fixed' $data style='$style' class='c-$id $align' $title>";
if($id == 'actions')
{
echo $this->lang->actions;
+2 -2
View File
@@ -1204,7 +1204,7 @@ class execution extends control
}
elseif($this->app->openApp == 'execution')
{
$executionID = key($this->executions);
if($this->config->systemMode == 'new') $executionID = key($this->executions);
$this->execution->setMenu($executionID);
}
@@ -1298,7 +1298,7 @@ class execution extends control
}
}
$this->view->title = $this->lang->execution->create;
$this->view->title = (($this->app->openApp == 'execution') and ($this->config->systemMode == 'new')) ? $this->lang->execution->createExec : $this->lang->execution->create;
$this->view->position[] = $this->view->title;
$this->view->executions = array('' => '') + $this->execution->getList();
$this->view->groups = $this->loadModel('group')->getPairs();
+2 -2
View File
@@ -351,7 +351,7 @@ class executionModel extends model
$this->file->updateObjectID($this->post->uid, $executionID, 'execution');
/* Update the path. */
$this->setTreePath($executionID);
if($this->config->systemMode == 'new') $this->setTreePath($executionID);
/* Copy team of execution. */
if($copyExecutionID != '')
@@ -383,7 +383,7 @@ class executionModel extends model
$member->hours = $this->config->execution->defaultWorkhours;
$this->dao->insert(TABLE_TEAM)->data($member)->exec();
$this->addProjectMembers($sprint->project, array($member));
if($this->config->systemMode == 'new') $this->addProjectMembers($sprint->project, array($member));
}
/* Create doc lib. */
+2 -2
View File
@@ -42,7 +42,7 @@
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=$from", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
<?php if(common::hasPriv('execution', 'create')) echo html::a($this->createLink('execution', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'></i> " . ($from == 'execution' ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary' data-app='$from'");?>
<?php if(common::hasPriv('execution', 'create')) echo html::a($this->createLink('execution', 'create', "projectID=$projectID"), "<i class='icon icon-sm icon-plus'></i> " . ((($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->createExec : $lang->execution->create), '', "class='btn btn-primary' data-app='$from'");?>
</div>
</div>
<div id='mainContent' class="main-row fade">
@@ -66,7 +66,7 @@
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $from == 'execution' ? $lang->execution->execName : $lang->execution->name);?></th>
<th><?php common::printOrderLink('name', $orderBy, $vars, (($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->execName : $lang->execution->name);?></th>
<th class='thWidth'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->execution->owner);?></th>
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->execution->end);?></th>
<th class='w-100px'><?php common::printOrderLink('status', $orderBy, $vars, $from == 'execution' ? $lang->execution->execStatus : $lang->execution->status);?></th>
+6 -6
View File
@@ -38,9 +38,9 @@
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $from == 'execution' ? $lang->execution->createExec : $lang->execution->create;?></h2>
<h2><?php echo (($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->createExec : $lang->execution->create;?></h2>
<div class="pull-right btn-toolbar">
<button type='button' class='btn btn-link' data-toggle='modal' data-target='#copyProjectModal'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . ($from == 'execution' ? $lang->execution->copyExec : $lang->execution->copy);?></button>
<button type='button' class='btn btn-link' data-toggle='modal' data-target='#copyProjectModal'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . ((($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->copyExec : $lang->execution->copy);?></button>
</div>
</div>
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
@@ -53,12 +53,12 @@
</tr>
<?php endif;?>
<tr>
<th class='w-120px'><?php echo $from == 'execution' ? $lang->execution->execName : $lang->execution->name;?></th>
<th class='w-120px'><?php echo (($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->execName : $lang->execution->name;?></th>
<td class="col-main"><?php echo html::input('name', $name, "class='form-control' required");?></td>
<td></td><td></td>
</tr>
<tr>
<th><?php echo $from == 'execution' ? $lang->execution->execCode : $lang->execution->code;?></th>
<th><?php echo (($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->execCode : $lang->execution->code;?></th>
<td><?php echo html::input('code', $code, "class='form-control' required");?></td><td></td><td></td>
</tr>
<tr>
@@ -86,7 +86,7 @@
<td><?php echo html::input('team', $team, "class='form-control'");?></td><td></td><td></td>
</tr>
<tr>
<th><?php echo $from == 'execution' ? $lang->execution->execType : $lang->execution->type;?></th>
<th><?php echo (($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->execType : $lang->execution->type;?></th>
<td><?php echo html::select('lifetime', $lang->execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); ?></td>
<td class='muted' colspan='2'><div id='lifeTimeTips'><?php echo $lang->execution->typeDesc;?></div></td>
</tr>
@@ -144,7 +144,7 @@
</td>
</tr>
<tr>
<th><?php echo $from == 'execution' ? $lang->execution->execDesc : $lang->execution->desc;?></th>
<th><?php echo (($from == 'execution') and ($config->systemMode == 'new')) ? $lang->execution->execDesc : $lang->execution->desc;?></th>
<td colspan='3'>
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=execution&link=desc');?>
<?php echo html::textarea('desc', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?>
+1 -1
View File
@@ -1013,7 +1013,7 @@ $lang->resource->doc = new stdclass();
$lang->resource->doc->index = 'index';
$lang->resource->doc->browse = 'browse';
$lang->resource->doc->createlib = 'createlib';
$lang->resource->doc->editlib = 'editlib';
$lang->resource->doc->editlib = 'editLib';
$lang->resource->doc->deleteLib = 'deleteLib';
$lang->resource->doc->create = 'create';
$lang->resource->doc->view = 'view';
+20 -5
View File
@@ -33,65 +33,80 @@ $config->project->datatable->fieldList['id']['title'] = 'ID';
$config->project->datatable->fieldList['id']['fixed'] = 'left';
$config->project->datatable->fieldList['id']['width'] = '60';
$config->project->datatable->fieldList['id']['required'] = 'yes';
$config->project->datatable->fieldList['id']['pri'] = '1';
$config->project->datatable->fieldList['name']['title'] = 'name';
$config->project->datatable->fieldList['name']['fixed'] = 'left';
$config->project->datatable->fieldList['name']['width'] = '180';
$config->project->datatable->fieldList['name']['width'] = 'auto';
$config->project->datatable->fieldList['name']['minWidth'] = '180';
$config->project->datatable->fieldList['name']['required'] = 'yes';
$config->project->datatable->fieldList['name']['sort'] = 'no';
$config->project->datatable->fieldList['name']['pri'] = '1';
$config->project->datatable->fieldList['PM']['title'] = 'PM';
$config->project->datatable->fieldList['PM']['fixed'] = 'no';
$config->project->datatable->fieldList['PM']['width'] = '80';
$config->project->datatable->fieldList['PM']['required'] = 'yes';
$config->project->datatable->fieldList['PM']['sort'] = 'no';
$config->project->datatable->fieldList['PM']['pri'] = '2';
$config->project->datatable->fieldList['status']['title'] = 'status';
$config->project->datatable->fieldList['status']['fixed'] = 'left';
$config->project->datatable->fieldList['status']['width'] = '80';
$config->project->datatable->fieldList['status']['required'] = 'no';
$config->project->datatable->fieldList['status']['sort'] = 'yes';
$config->project->datatable->fieldList['status']['pri'] = '2';
$config->project->datatable->fieldList['begin']['title'] = 'begin';
$config->project->datatable->fieldList['begin']['fixed'] = 'no';
$config->project->datatable->fieldList['begin']['width'] = '100';
$config->project->datatable->fieldList['begin']['width'] = '90';
$config->project->datatable->fieldList['begin']['required'] = 'no';
$config->project->datatable->fieldList['begin']['pri'] = '9';
$config->project->datatable->fieldList['end']['title'] = 'end';
$config->project->datatable->fieldList['end']['fixed'] = 'no';
$config->project->datatable->fieldList['end']['width'] = '100';
$config->project->datatable->fieldList['end']['width'] = '90';
$config->project->datatable->fieldList['end']['required'] = 'no';
$config->project->datatable->fieldList['end']['pri'] = '3';
$config->project->datatable->fieldList['budget']['title'] = 'budget';
$config->project->datatable->fieldList['budget']['fixed'] = 'no';
$config->project->datatable->fieldList['budget']['width'] = '80';
$config->project->datatable->fieldList['budget']['required'] = 'yes';
$config->project->datatable->fieldList['budget']['pri'] = '3';
$config->project->datatable->fieldList['teamCount']['title'] = 'teamCount';
$config->project->datatable->fieldList['teamCount']['fixed'] = 'no';
$config->project->datatable->fieldList['teamCount']['width'] = '70';
$config->project->datatable->fieldList['teamCount']['required'] = 'no';
$config->project->datatable->fieldList['teamCount']['sort'] = 'no';
$config->project->datatable->fieldList['teamCount']['pri'] = '8';
$config->project->datatable->fieldList['estimate']['title'] = 'estimate';
$config->project->datatable->fieldList['estimate']['fixed'] = 'no';
$config->project->datatable->fieldList['estimate']['width'] = '50';
$config->project->datatable->fieldList['estimate']['width'] = '70';
$config->project->datatable->fieldList['estimate']['maxWidth'] = '80';
$config->project->datatable->fieldList['estimate']['required'] = 'no';
$config->project->datatable->fieldList['estimate']['sort'] = 'no';
$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'] = '50';
$config->project->datatable->fieldList['consume']['width'] = '70';
$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']['width'] = '60';
$config->project->datatable->fieldList['progress']['required'] = 'no';
$config->project->datatable->fieldList['progress']['sort'] = 'no';
$config->project->datatable->fieldList['progress']['pri'] = '6';
$config->project->datatable->fieldList['actions']['title'] = 'actions';
$config->project->datatable->fieldList['actions']['fixed'] = 'right';
$config->project->datatable->fieldList['actions']['width'] = '180';
$config->project->datatable->fieldList['actions']['required'] = 'yes';
$config->project->datatable->fieldList['actions']['pri'] = '1';
+1
View File
@@ -2,5 +2,6 @@
.side-col {padding-right: 20px; width: 18%;}
#sidebar>.cell {width: 100%;}
th.c-budget,{text-align:right;}
td.c-actions {overflow: visible;}
.c-actions .btn {overflow: visible;}
+11 -1
View File
@@ -778,6 +778,16 @@ class projectModel extends model
$this->loadModel('personnel')->updateWhitelist($whitelist, 'project', $projectID);
if($project->acl != 'open') $this->loadModel('user')->updateUserView($projectID, 'project');
/* Create doc lib. */
$this->app->loadLang('doc');
$lib = new stdclass();
$lib->project = $projectID;
$lib->name = $this->lang->doclib->main['project'];
$lib->type = 'project';
$lib->main = '1';
$lib->acl = 'default';
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
$this->updateProducts($projectID);
if(isset($_POST['newProduct']) || (!$project->parent && empty($linkedProductsCount)))
@@ -1315,7 +1325,7 @@ class projectModel extends model
if($col->show)
{
$title = '';
$class = "c-$id" . (in_array($id, ['budget', 'teamCount']) ? ' c-number' : ' c-name');
$class = "c-$id" . (in_array($id, array('budget', 'teamCount', 'estimate', 'consume')) ? ' c-number' : '');
if($id == 'id') $class .= ' cell-id';
+6 -5
View File
@@ -85,11 +85,12 @@ js::set('browseType', $browseType);
<thead>
<tr>
<?php
foreach($setting as $value)
{
if($value->id == 'status' and $browseType !== 'all') $value->show = false;
if($value->show) $this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
}
foreach($setting as $value)
{
if($value->id == 'status' and $browseType !== 'all') $value->show = false;
if($value->id == 'teamCount' and $browseType == 'all') $value->show = false;
if($value->show) $this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
}
?>
</tr>
</thead>
+3 -3
View File
@@ -348,17 +348,17 @@ class story extends control
if($executionID)
{
$this->execution->setMenu($executionID);
$execution = $this->dao->findById((int)$executionID)->from(TABLE_EXECUTION)->fetch();
if($execution->type == 'project')
{
$this->project->setMenu($executionID);
$this->app->rawModule = 'projectstory';
$this->lang->navGroup->story = 'project';
$this->lang->product->menu = $this->lang->menu->{$execution->model};
$this->lang->product->menu = $this->lang->{$execution->model}->menu;
}
else
{
$this->execution->setMenu($executionID);
$this->app->rawModule = 'execution';
$this->lang->navGroup->story = 'execution';
}
+3 -3
View File
@@ -30,12 +30,12 @@ class tree extends control
if($this->app->openApp == 'product')
{
$this->product->setMenu($rootID);;
$this->product->setMenu($rootID, 0, 0, '', $viewType);;
}
else if($this->app->openApp == 'qa')
{
$products = $this->product->getPairs('noclosed');
$this->loadModel('qa')->setMenu($products, $rootID);;
$this->loadModel('qa')->setMenu($products, $rootID, 0, $viewType);;
}
else if($this->app->openApp == 'project')
{
@@ -83,7 +83,7 @@ class tree extends control
/* Set menu.*/
$products = $this->product->getPairs();
$this->product->saveState($rootID, $products);
$this->product->setMenu($rootID);
$this->product->setMenu($rootID, 0, 0, '', $viewType);
unset($products[$rootID]);
$currentProduct = key($products);
+24
View File
@@ -4054,6 +4054,20 @@ class upgradeModel extends model
$this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec();
}
$stmt = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('createlib')->query();
while($grouppriv = $stmt->fetch())
{
$grouppriv->method = 'createLib';
$this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec();
}
$stmt = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('editlib')->query();
while($grouppriv = $stmt->fetch())
{
$grouppriv->method = 'editLib';
$this->dao->replace(TABLE_GROUPPRIV)->data($grouppriv)->exec();
}
return true;
}
@@ -4204,6 +4218,16 @@ class upgradeModel extends model
->where('id')->eq($projectID)
->exec();
/* Create doc lib. */
$this->app->loadLang('doc');
$lib = new stdclass();
$lib->project = $projectID;
$lib->name = $this->lang->doclib->main['project'];
$lib->type = 'project';
$lib->main = '1';
$lib->acl = 'default';
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
$this->loadModel('action')->create('project', $projectID, 'openedbysystem');
if($data->projectStatus == 'closed') $this->loadModel('action')->create('project', $projectID, 'closedbysystem');
}
+1 -1
View File
@@ -2291,7 +2291,7 @@ class userModel extends model
}
/* Judge sprint auth. */
if(($project->type == 'sprint' || $project->type == 'stage') && $project->acl == 'private')
if(($project->type == 'sprint' || $project->type == 'stage') && $project->acl == 'private' && $this->config->systemMode == 'new')
{
$parent = $this->dao->select('openedBy,PM')->from(TABLE_PROJECT)->where('id')->eq($project->project)->fetch();
$users[$parent->openedBy] = $parent->openedBy;