* [misc] code for sonar.
This commit is contained in:
@@ -197,7 +197,6 @@ class actionModel extends model
|
||||
$this->loadModel('workflow');
|
||||
foreach($actions as $actionID => $action)
|
||||
{
|
||||
$extra = $action->extra;
|
||||
$actionName = strtolower($action->action);
|
||||
if($this->config->edition != 'open' && !isset($flowList[$action->objectType])) $flowList[$action->objectType] = $this->workflow->getByModule($action->objectType);
|
||||
|
||||
@@ -1172,7 +1171,7 @@ class actionModel extends model
|
||||
|
||||
/* If idList include ',*,' Format ',*,' to '*'. */
|
||||
$projectIdList = array();
|
||||
foreach($projectGroups as $key => $idList)
|
||||
foreach($projectGroups as $idList)
|
||||
{
|
||||
$idList = explode(',', (string)$idList);
|
||||
foreach($idList as $id) $projectIdList[] = $id;
|
||||
|
||||
@@ -41,7 +41,7 @@ class bugModel extends model
|
||||
if(!empty($bug->assignedTo)) $this->action->create('bug', $bugID, 'Assigned', '', $bug->assignedTo);
|
||||
|
||||
/* Add score for create. */
|
||||
$files = $this->loadModel('file')->saveUpload('bug', $bugID);
|
||||
$this->loadModel('file')->saveUpload('bug', $bugID);
|
||||
if(!empty($bug->case))
|
||||
{
|
||||
$this->loadModel('score')->create('bug', 'createFormCase', $bug->case);
|
||||
|
||||
+3
-2
@@ -1163,7 +1163,7 @@ class bugZen extends bug
|
||||
if($product->type != 'normal') $branchTagOption = $this->getBranchOptions($product->id);
|
||||
if($this->config->edition == 'max') $this->view->injectionList = $this->view->identifyList = $this->loadModel('review')->getPairs($bug->project, $bug->product, true);
|
||||
|
||||
$this->assignVarsForEdit($bug);
|
||||
$this->assignVarsForEdit($bug, $product);
|
||||
|
||||
$this->view->title = $this->lang->bug->edit . "BUG #$bug->id $bug->title - " . $this->products[$bug->product];
|
||||
$this->view->bug = $bug;
|
||||
@@ -1181,10 +1181,11 @@ class bugZen extends bug
|
||||
* Assign variables for editing bug.
|
||||
*
|
||||
* @param object $bug
|
||||
* @param object $product
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function assignVarsForEdit(object $bug): void
|
||||
protected function assignVarsForEdit(object $bug, object $product): void
|
||||
{
|
||||
/* Add product related to the bug when it is not in the products. */
|
||||
if(!isset($this->products[$bug->product]))
|
||||
|
||||
@@ -245,8 +245,8 @@ class caselibZen extends caselib
|
||||
|
||||
if(empty($rows))
|
||||
{
|
||||
$row->typeValue = join("\n", $this->lang->testcase->typeList);
|
||||
$row->stageValue = join("\n", $this->lang->testcase->stageList);
|
||||
$row->typeValue = implode("\n", $this->lang->testcase->typeList);
|
||||
$row->stageValue = implode("\n", $this->lang->testcase->stageList);
|
||||
}
|
||||
|
||||
$rows[] = $row;
|
||||
@@ -444,7 +444,7 @@ class caselibZen extends caselib
|
||||
|
||||
$case->stage = array();
|
||||
foreach($stages as $stage) $case->stage[] = array_search($stage, $this->lang->testcase->stageList);
|
||||
$case->stage = join(',', $case->stage);
|
||||
$case->stage = implode(',', $case->stage);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -558,7 +558,6 @@ class caselibZen extends caselib
|
||||
{
|
||||
$users = $this->loadModel('user')->getPairs('noletter');
|
||||
$relatedModules = $this->loadModel('tree')->getModulePairs($libID, 'caselib');
|
||||
$relatedCases = $this->loadModel('testcase')->getRelatedCases($cases);
|
||||
$relatedSteps = $this->testcase->getRelatedSteps(array_keys($cases));
|
||||
$relatedFiles = $this->testcase->getRelatedFiles(array_keys($cases));
|
||||
|
||||
@@ -655,7 +654,7 @@ class caselibZen extends caselib
|
||||
{
|
||||
$case->stage = explode(',', $case->stage);
|
||||
foreach($case->stage as $key => $stage) $case->stage[$key] = isset($this->lang->testcase->stageList[$stage]) ? $this->lang->testcase->stageList[$stage] : $stage;
|
||||
$case->stage = join("\n", $case->stage);
|
||||
$case->stage = implode("\n", $case->stage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -697,6 +696,6 @@ class caselibZen extends caselib
|
||||
$linkCaseID = trim($linkCaseID);
|
||||
$tmpLinkCases[] = isset($relatedCases[$linkCaseID]) ? $relatedCases[$linkCaseID] . "(#$linkCaseID)" : $linkCaseID;
|
||||
}
|
||||
$case->linkCase = join("; \n", $tmpLinkCases);
|
||||
$case->linkCase = implode("; \n", $tmpLinkCases);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ class custom extends control
|
||||
$menus = json_decode($items);
|
||||
|
||||
$menuNames = array();
|
||||
foreach($menus as $key => $item) $menuNames[] = $item->name;
|
||||
foreach($menus as $item) $menuNames[] = $item->name;
|
||||
|
||||
foreach($oldMenus as $key => $item)
|
||||
{
|
||||
|
||||
@@ -3495,7 +3495,7 @@ class execution extends control
|
||||
$this->loadModel('task');
|
||||
|
||||
$result = array();
|
||||
foreach($array as $key => $object)
|
||||
foreach($array as $object)
|
||||
{
|
||||
$result[$object->id] = $object;
|
||||
$tasks = zget($object, 'tasks', array());
|
||||
|
||||
Reference in New Issue
Block a user