* code for bug #22095.

This commit is contained in:
wangyidong
2022-04-28 17:46:41 +08:00
parent 65a94a2afd
commit 1d9f9c0e75
3 changed files with 18 additions and 4 deletions
+9 -3
View File
@@ -912,11 +912,17 @@ class baseControl
$data[$key] = str_replace('%22', '"', urlencode($value));
}
print(urldecode(json_encode($data)));
$response = helper::removeUTF8Bom(ob_get_clean());
if(defined('RUN_MODE') and RUN_MODE == 'api')
{
print(urldecode(json_encode($data)));
$response = helper::removeUTF8Bom(ob_get_clean());
return print($response);
}
if(defined('RUN_MODE') and RUN_MODE == 'api') return print($response);
$obLevel = ob_get_level();
for($i = 0; $i < $obLevel; $i++) ob_end_clean();
$response = helper::removeUTF8Bom(urldecode(json_encode($data)));
die($response);
}
+5 -1
View File
@@ -627,7 +627,11 @@ class mrModel extends model
public function apiGetMRList($gitlabID, $projectID)
{
$url = sprintf($this->gitlab->getApiRoot($gitlabID), "/projects/$projectID/merge_requests");
return json_decode(commonModel::http($url));
$response = json_decode(commonModel::http($url));
if(empty($response)) $response = array();
return $response;
}
/**
@@ -49,7 +49,9 @@
<thead>
<tr class='colhead'>
<th class='c-id'><?php echo $lang->report->id;?></th>
<?php if($this->config->systemMode == 'new'):?>
<th><?php echo $lang->report->project;?></th>
<?php endif;?>
<th><?php echo $lang->report->execution;?></th>
<th class="c-hours"><?php echo $lang->report->estimate;?></th>
<th class="c-hours"><?php echo $lang->report->consumed;?></th>
@@ -61,7 +63,9 @@
<?php foreach($executions as $id =>$execution):?>
<tr class="text-center">
<td><?php echo $id;?></td>
<?php if($this->config->systemMode == 'new'):?>
<td class="text-left" title="<?php echo $execution->projectName;?>"><?php echo $execution->projectName;?></td>
<?php endif;?>
<td class="text-left" title="<?php echo $execution->name;?>"><?php echo html::a($this->createLink('execution', 'view', "executionID=$id"), $execution->name);?></td>
<td><?php echo round($execution->estimate, 2);?></td>
<td><?php echo round($execution->consumed, 2);?></td>