Skip to content

Commit 232644f

Browse files
committed
FIX an Uncaught TypeError: current() in \lib\results\resultsGeneral.php
on line 84
1 parent 0dcd146 commit 232644f

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

lib/results/resultsGeneral.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
$keywordsMetrics = $metricsMgr->getStatusTotalsByKeywordForRender($args->tplan_id,null, array('groupByPlatform' => 1) );
4343

4444
$gui->statistics->keywords = !is_null($keywordsMetrics) ? $keywordsMetrics->info : null;
45-
45+
4646
if( $gui->showPlatforms ) {
4747
$items2loop[] = 'platform';
4848
$platformMetrics = $metricsMgr->getStatusTotalsByPlatformForRender($args->tplan_id);
@@ -61,7 +61,7 @@
6161
foreach($items2loop as $item) {
6262
if( !is_null($gui->statistics->$item) ) {
6363
$gui->columnsDefinition->$item = array();
64-
64+
6565
// Get labels
6666
$dummy = current($gui->statistics->$item);
6767
if(isset($dummy['details'])) {
@@ -76,9 +76,9 @@
7676

7777
$doubleItemToLoop = array('priorities','keywords','testsuites');
7878
foreach( $doubleItemToLoop as $item ) {
79-
if( !is_null($gui->statistics->$item) ) {
79+
if( !empty($gui->statistics->$item) ) {
8080
$gui->columnsDefinition->$item = array();
81-
81+
8282
// Get labels
8383
// !!double current because main key is PLATFORM
8484
$dummy = current(current($gui->statistics->$item));
@@ -97,7 +97,7 @@
9797
$colDefinition = null;
9898
$results = null;
9999
if($gui->do_report['status_ok']) {
100-
100+
101101
$o = $metricsMgr->getOverallBuildStatusForRender($args->tplan_id);
102102
$gui->statistics->overallBuildStatus = $o->info;
103103
$gui->columnsDefinition->overallBuildStatus = $o->colDefinition;
@@ -118,7 +118,7 @@
118118
}
119119

120120

121-
121+
122122
/* MILESTONE & PRIORITY REPORT */
123123
// Need to be refactored ???
124124
$milestonesList = $tplan_mgr->get_milestones($args->tplan_id);
@@ -165,7 +165,7 @@ function init_args(&$dbHandler) {
165165
$cerbero->args = new stdClass();
166166
$cerbero->args->tproject_id = $args->tproject_id;
167167
$cerbero->args->tplan_id = $args->tplan_id;
168-
168+
169169
if(strlen($args->apikey) == 32) {
170170
$cerbero->args->getAccessAttr = true;
171171
$cerbero->method = 'checkRights';
@@ -193,7 +193,7 @@ function init_args(&$dbHandler) {
193193
tlog("Parameter 'format' is not defined", 'ERROR');
194194
exit();
195195
}
196-
196+
197197
$args->user = $_SESSION['currentUser'];
198198
$args->format = $args->sendByMail ? FORMAT_MAIL_HTML : $args->format;
199199

@@ -212,7 +212,7 @@ function buildMailCfg(&$guiObj) {
212212
$cfg->cc = '';
213213
$cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name .
214214
' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name;
215-
215+
216216
return $cfg;
217217
}
218218

@@ -340,7 +340,7 @@ function createSpreadsheet($gui,&$tplanMgr) {
340340
foreach( $dataHeaderMetrics as $val ) {
341341
$dataHeader[] = $val;
342342
}
343-
343+
344344
$startingRow++;
345345
$startingRow++;
346346
$cellArea = "A{$startingRow}:";
@@ -440,7 +440,7 @@ function createSpreadsheet($gui,&$tplanMgr) {
440440
foreach( $dataHeaderMetrics as $val ) {
441441
$dataHeader[] = $val;
442442
}
443-
443+
444444
$cellArea = "A{$startingRow}:";
445445
foreach($dataHeader as $zdx => $field) {
446446
$cellID = $cellRange[$zdx] . $startingRow;
@@ -462,12 +462,12 @@ function createSpreadsheet($gui,&$tplanMgr) {
462462

463463
foreach($infoSet as $itemID => $fieldSet) {
464464
$whatCell=0;
465-
465+
466466
if( $hasPlatforms ) {
467467
$cellID = $cellRange[$whatCell] . $startingRow;
468468
$field = $platName;
469469
$objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field);
470-
470+
471471
$whatCell++;
472472
}
473473

@@ -496,7 +496,7 @@ function createSpreadsheet($gui,&$tplanMgr) {
496496
$objPHPExcel->setActiveSheetIndex(0)
497497
->setCellValue($cellID,
498498
$fieldSet['percentage_completed']);
499-
499+
500500
$cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . "$startingRow";
501501

502502
$objPHPExcel->getActiveSheet()
@@ -521,7 +521,7 @@ function createSpreadsheet($gui,&$tplanMgr) {
521521
$xlsType = 'Excel5';
522522
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType);
523523
$objWriter->save($tmpfname);
524-
524+
525525
downloadXls($tmpfname,$xlsType,$gui,'TestLink_GTMP_');
526526
}
527527

0 commit comments

Comments
 (0)