changed the unknown author handling in the code controller
This commit is contained in:
parent
8188f104c1
commit
ee8190d27d
@ -647,21 +647,18 @@ class Code extends Controller
|
|||||||
$history = $file['history'];
|
$history = $file['history'];
|
||||||
$history_count = count($history);
|
$history_count = count($history);
|
||||||
|
|
||||||
|
|
||||||
if ($type == 'commit-share-by-users')
|
if ($type == 'commit-share-by-users')
|
||||||
{
|
{
|
||||||
$stats = array();
|
$stats = array();
|
||||||
for ($i = 0; $i < $history_count; $i++)
|
for ($i = 0; $i < $history_count; $i++)
|
||||||
{
|
{
|
||||||
$h = $history[$i];
|
$h = $history[$i];
|
||||||
if (array_key_exists ('author', $h))
|
$author = (array_key_exists ('author', $h))? $h['author']: '?';
|
||||||
{
|
|
||||||
$author = $h['author'];
|
if (array_key_exists ($author, $stats))
|
||||||
if (array_key_exists ($author, $stats))
|
$stats[$author]++;
|
||||||
$stats[$author]++;
|
else
|
||||||
else
|
$stats[$author] = 1;
|
||||||
$stats[$author] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->load->library ('PHPGraphLibPie', array ('width' => 400, 'height' => 300), 'graph');
|
$this->load->library ('PHPGraphLibPie', array ('width' => 400, 'height' => 300), 'graph');
|
||||||
@ -677,14 +674,12 @@ class Code extends Controller
|
|||||||
for ($i = 0; $i < $history_count; $i++)
|
for ($i = 0; $i < $history_count; $i++)
|
||||||
{
|
{
|
||||||
$h = $history[$i];
|
$h = $history[$i];
|
||||||
if (array_key_exists ('author', $h))
|
$author = (array_key_exists ('author', $h))? $h['author']: '?';
|
||||||
{
|
|
||||||
$author = $h['author'];
|
if (array_key_exists ($author, $stats))
|
||||||
if (array_key_exists ($author, $stats))
|
$stats[$author]++;
|
||||||
$stats[$author]++;
|
else
|
||||||
else
|
$stats[$author] = 1;
|
||||||
$stats[$author] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->load->library ('PHPGraphLib', array ('width' => 400, 'height' => 300), 'graph');
|
$this->load->library ('PHPGraphLib', array ('width' => 400, 'height' => 300), 'graph');
|
||||||
@ -696,7 +691,6 @@ class Code extends Controller
|
|||||||
$this->graph->setBars(TRUE);
|
$this->graph->setBars(TRUE);
|
||||||
//$this->graph->setXValuesHorizontal(TRUE);
|
//$this->graph->setXValuesHorizontal(TRUE);
|
||||||
$this->graph->createGraph();
|
$this->graph->createGraph();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user