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

This commit is contained in:
zhaoke
2023-01-12 02:59:12 +00:00
135 changed files with 3343 additions and 1175 deletions
+1 -1
View File
@@ -385,7 +385,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
</form>
</div>
</div>
<?php js::set('bugModule', $lang->bug->module);?>
<?php if(empty($product->shadow)) js::set('bugModule', $lang->bug->module);?>
<?php js::set('bugExecution', $projectModel == 'kanban' ? $lang->bug->kanban : $lang->bug->execution);?>
<script>
$(function(){parent.$('body.hide-modal-close').removeClass('hide-modal-close');})
+1 -1
View File
@@ -300,7 +300,7 @@ class product extends control
}
/* Process the sql, get the conditon partion, save it to session. */
$this->loadModel('common')->saveQueryCondition($queryCondition, 'story', ($browseType != 'bysearch' and $browseType != 'reviewbyme' and !$isProjectStory));
$this->loadModel('common')->saveQueryCondition($queryCondition, 'story', (strpos('bysearch,reviewbyme,bymodule', $browseType) === false and !$isProjectStory));
if(!empty($stories)) $stories = $this->story->mergeReviewer($stories);
+8 -1
View File
@@ -758,7 +758,14 @@ class productplan extends control
$this->productplan->unlinkStory($storyID, $planID);
$this->loadModel('action')->create('productplan', $planID, 'unlinkstory', '', $storyID);
return print(js::locate($this->createLink('productplan', 'view', "planID=$planID&type=story"), 'parent'));
if($this->session->storyList)
{
return print(js::locate($this->session->storyList, 'parent'));
}
else
{
return print(js::locate($this->createLink('productplan', 'view', "planID=$planID&type=story"), 'parent'));
}
}
}
+1 -1
View File
@@ -16,7 +16,7 @@
#budgetUnit {border-left: 0px;}
#projectName {display: inline-block; width: 32%;}
.productsBox a {border-radius: 2px !important;}
.productsBox .required:after {right: -9.5px !important;}
.productsBox .required:after {right: -12px !important; top: 10px !important;}
.productsBox .addProduct {padding-left: 0px !important;}
.productsBox .addProduct.required:after {right: -1px !important;}
.productsBox .input-group-addon > div {display: inline-block !important;}
+4 -5
View File
@@ -253,6 +253,7 @@ class repoModel extends model
public function update($id)
{
$repo = $this->getRepoByID($id);
if($repo->client != $this->post->client and !$this->checkClient()) return false;
if(!$this->checkConnection()) return false;
$isPipelineServer = in_array(strtolower($this->post->SCM), $this->config->repo->gitServiceList) ? true : false;
@@ -289,9 +290,6 @@ class repoModel extends model
$data->prefix = '';
}
if($data->client != $repo->client and !$this->checkClient()) return false;
if(!$this->checkConnection()) return false;
if($data->encrypt == 'base64') $data->password = base64_encode($data->password);
$this->dao->update(TABLE_REPO)->data($data, $skip = 'serviceToken')
->batchCheck($this->config->repo->edit->requiredFields, 'notempty')
@@ -314,6 +312,7 @@ class repoModel extends model
$this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($id)->exec();
return false;
}
return true;
}
@@ -1391,10 +1390,10 @@ class repoModel extends model
if($clientVersionFile)
{
session_start();
$this->session->set('clientVersionFile', $clientVersionFile);
$this->session->set('clientVersionFile', '');
session_write_close();
if(file_exists($clientVersionFile)) unlink($clientVersionFile);
if(file_exists($clientVersionFile)) @unlink($clientVersionFile);
}
}
+3 -3
View File
@@ -1401,7 +1401,7 @@ class story extends control
}
elseif($from == 'project')
{
$projectID = (isset($story->projects[$this->session->project]) || empty($story->projects)) ? $this->session->project : key($story->projects);
$projectID = $param ? $param : $this->session->project;
$this->loadModel('project')->setMenu($projectID);
}
elseif($from == 'qa')
@@ -3069,8 +3069,8 @@ class story extends control
/**
* Ajax get story pairs.
*
* @param int $storyID
*
* @param int $storyID
* @access public
* @return void
*/
+13 -22
View File
@@ -47,30 +47,14 @@ class storyModel extends model
if($setImgSize) $story->spec = $this->file->setImgSize($story->spec);
if($setImgSize) $story->verify = $this->file->setImgSize($story->verify);
$projects = $this->dao->select('t1.project, t2.name, t2.status, t2.type, t2.multiple, t2.project AS parentProject')->from(TABLE_PROJECTSTORY)->alias('t1')
$story->executions = $this->dao->select('t1.project, t2.name, t2.status, t2.type, t2.multiple')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project = t2.id')
->where('t2.type')->in('sprint,stage,kanban,project')
->where('t2.type')->in('sprint,stage,kanban')
->beginIF($story->twins)->andWhere('t1.story')->in(ltrim($story->twins, ',') . $story->id)
->beginIF(!$story->twins)->andWhere('t1.story')->in($story->id)
->orderBy('t1.`order` DESC')
->fetchAll('project');
$story->projects = array();
$story->executions = array();
foreach($projects as $project)
{
if($project->type == 'project')
{
$story->projects[$project->project] = $project->project;
}
else
{
$story->executions[$project->project] = $project;
if(!$project->multiple) $story->projects[$project->parentProject] = $project->parentProject;
}
}
$story->tasks = $this->dao->select('id, name, assignedTo, execution, project, status, consumed, `left`,type')->from(TABLE_TASK)
->where('deleted')->eq(0)
->beginIF($story->twins)->andWhere('story')->in(ltrim($story->twins, ',') . $story->id)
@@ -4990,13 +4974,20 @@ class storyModel extends model
$tab = $this->app->tab;
$executionID = empty($execution) ? $this->session->execution : $execution->id;
$account = $this->app->user->account;
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param=0&storyType=$story->type");
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param=&storyType=$story->type");
$canView = common::hasPriv($story->type, 'view', null, "storyType=$story->type");
if($tab == 'project' and $this->session->multiple)
if($tab == 'project')
{
$storyLink = helper::createLink('projectstory', 'view', "storyID=$story->id&project={$this->session->project}");
$canView = common::hasPriv('projectstory', 'view');
if($this->session->multiple)
{
$storyLink = helper::createLink('projectstory', 'view', "storyID=$story->id&project={$this->session->project}");
$canView = common::hasPriv('projectstory', 'view');
}
else
{
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param={$this->session->project}&storyType=$story->type");
}
}
elseif($tab == 'execution')
{
+7 -4
View File
@@ -218,13 +218,13 @@
<?php if(!$product->shadow):?>
<tr>
<th class='w-90px'><?php echo $lang->story->product;?></th>
<td><?php echo html::a($this->createLink('product', 'view', "productID=$story->product"), $product->name);?></td>
<td><?php echo html::a($this->createLink('product', 'view', "productID=$story->product"), $product->name, '', "data-app='product'");?></td>
</tr>
<?php endif;?>
<?php if($product->type != 'normal'):?>
<tr>
<th class='w-90px'><?php echo $lang->product->branch;?></th>
<td><?php common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch", $branches[$story->branch]);?></td>
<td><?php common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch", $branches[$story->branch], '', "data-app='product'");?></td>
</tr>
<?php endif;?>
<tr>
@@ -476,7 +476,7 @@
{
if(!isset($executions[$task->execution])) continue;
$execution = isset($story->executions[$task->execution]) ? $story->executions[$task->execution] : '';
$executionLink = !empty($execution->multiple) ? $this->createLink('execution', 'view', "executionID=$task->execution") : $this->createLink('project', 'view', "executionID=$task->project");
$executionLink = !empty($execution->multiple) ? $this->createLink('execution', 'view', "executionID=$task->execution") : $this->createLink('project', 'view', "projectID=$task->project");
$executionName = $executions[$task->execution];
$taskInfo = $task->id . '&nbsp<span class="label label-success label-outline">' . $this->lang->task->statusList[$task->status] . '</span>&nbsp' . $task->name;
$class = isonlybody() ? 'showinonlybody' : 'iframe';
@@ -486,7 +486,10 @@
}
foreach($story->executions as $executionID => $execution)
{
if(!isset($executions[$executionID]) or isset($story->tasks[$executionID])) continue;
if(!$execution->multiple) continue;
if(!isset($executions[$executionID])) continue;
if(isset($story->tasks[$executionID])) continue;
$execName = ($execution->type == 'kanban' and isonlybody()) ? $executions[$executionID] : html::a($this->createLink('execution', 'view', "executionID=$executionID"), $executions[$executionID], '', "class='text-muted'");
echo "<li title='$execution->name'>" . $execName . '</li>';
}
+3 -1
View File
@@ -228,8 +228,10 @@ class task extends control
if($this->post->after == 'continueAdding')
{
$storyParam = $this->post->story ? $this->post->story : '';
$response['message'] = $this->lang->task->successSaved . $this->lang->task->afterChoices['continueAdding'];
$response['locate'] = $this->createLink('task', 'create', "executionID=$executionID&storyID={$this->post->story}&moduleID=$moduleID");
$response['locate'] = $this->createLink('task', 'create', "executionID=$executionID&storyID={$storyParam}&moduleID=$moduleID");
return $this->send($response);
}
elseif($this->post->after == 'toTaskList')
+3 -1
View File
@@ -3,8 +3,10 @@ body {margin-bottom: 25px;}
.w-170px {width: 170px;}
#createActionMenu .dropdown-menu {width: 100%;}
#caseForm table tbody tr td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
#caseForm table tbody tr td {overflow: hidden; white-space: nowrap;}
#caseForm .setting {height: 25px;}
#caseForm table tbody .c-name {overflow: hidden; padding-right: 65px;}
#caseForm table tbody .c-name a:first-child {overflow: hidden; display: inline-block; width: 100%;}
.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
.dropdown-menu > .menu-search .input-group {width: 100%;}
+1 -1
View File
@@ -276,7 +276,7 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field)
</div>
</div>
</div>
<?php js::set('caseModule', $lang->testcase->module)?>
<?php if(!$hiddenProduct) js::set('caseModule', $lang->testcase->module)?>
<script>
$(function()
{
+1 -1
View File
@@ -176,7 +176,7 @@
foreach($modulePath as $key => $module)
{
if($tab == 'qa' || $tab == 'ops' || $tab == 'product')
if($tab == 'qa' || $tab == 'ops')
{
if($isLibCase)
{
+3 -1
View File
@@ -509,6 +509,8 @@ class transferModel extends model
$modelData = $this->processDate($modelData);
if(isset($fields['id'])) unset($fields['id']);
$this->session->set($model . 'TemplateFields', implode(',', array_keys($fields)));
return $modelData;
}
@@ -600,7 +602,7 @@ class transferModel extends model
$values = $valuePairs;
if(reset($values))
{
if(current($values) or (current($values) == 0)) $values[0] = '';
if(current($values) or (current($values) == 0)) $values = [0 => ''] + $values;
}
}
+6 -6
View File
@@ -224,13 +224,13 @@ class tutorialModel extends model
$execution->leftTasks = '—';
$execution->teamMembers = array_keys($this->getTeamMembers());
$execution->teamCount = count($execution->teamMembers);
$execution->hasProduct = '';
$execution->hasProduct = '1';
$execution->multiple = '';
$execution->order = 1;
$execution->burns = array('');
$execution->type = 'sprint';
$execution->projectName = '';
$execution->projectModel = '';
$execution->burns = array('');
$execution->type = 'sprint';
$execution->projectName = '';
$execution->projectModel = '';
if($browseType and $browseType != 'all') $execution->name .= '-' . $browseType; // Fix bug #21096
@@ -354,7 +354,7 @@ class tutorialModel extends model
$execution->fluidBoard = 0;
$execution->hours = $hours;
$execution->burns = array(35, 35);
$execution->hasProduct = '';
$execution->hasProduct = '1';
$execution->multiple = '';
return $execution;
}
+1 -1
View File
@@ -584,7 +584,7 @@ class upgradeModel extends model
$this->execSQL($xuanxuanSql);
}
break;
case '18_0_beta2':
case '18_0_beta3':
$this->updateMyBlocks();
break;
}
+5 -1
View File
@@ -1957,7 +1957,11 @@ class userModel extends model
/* Get product and project relation. */
$projectProducts = array();
$productProjects = array();
$stmt = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->where('product')->in(array_keys($allProducts))->query();
$stmt = $this->dao->select('t1.project, t1.product')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->in(array_keys($allProducts))
->andWhere('t2.deleted')->eq('0')
->query();
while($projectProduct = $stmt->fetch())
{
$productProjects[$projectProduct->product][$projectProduct->project] = $projectProduct->project;