fix #487 noms des utilisateurs manquants dans un tableau

This commit is contained in:
Nicolas Le Goff
2012-03-01 16:19:25 +01:00
parent c6552f1e9f
commit 73f4a5438d
2 changed files with 20 additions and 7 deletions

View File

@@ -558,7 +558,7 @@ class Session_Handler
$browser = Browser::getInstance(); $browser = Browser::getInstance();
if($this->is_authenticated()) if($this->is_authenticated())
$user = User_Adapter::getInstance ($this->get_usr_id (), appbox::get_instance ()); $user = User_Adapter::getInstance ($this->get_usr_id (), appbox::get_instance (\bootstrap::getCore()));
return Session_Logger::create($databox, $browser, $this, $user); return Session_Logger::create($databox, $browser, $this, $user);
} }

View File

@@ -453,7 +453,6 @@ class module_report_activity extends module_report
$this->result[$i]['total'] += 1; $this->result[$i]['total'] += 1;
$total['tot_dl'] += 1; $total['tot_dl'] += 1;
} }
$nb_row = $i + 1; $nb_row = $i + 1;
@@ -638,8 +637,23 @@ class module_report_activity extends module_report
foreach ($rs as $row) foreach ($rs as $row)
{ {
$user = $row[$on]; $user = $row[$on];
if (($save_user != $user) && !is_null($user)) if (($save_user != $user) && !is_null($user) && !empty($user))
{ {
if ($i >= 0)
{
if (($this->result[$i]['nbprev'] + $this->result[$i]['nbdoc']) == 0 || ($this->result[$i]['poiddoc'] + $this->result[$i]['poidprev']) == 0)
{
unset($this->result[$i]);
}
if (isset($this->result[$i]['poiddoc']) && isset($this->result[$i]['poidprev']))
{
$this->result[$i]['poiddoc'] = p4string::format_octets($this->result[$i]['poiddoc']);
$this->result[$i]['poidprev'] = p4string::format_octets($this->result[$i]['poidprev']);
}
}
$i++; $i++;
$this->result[$i]['nbprev'] = 0; $this->result[$i]['nbprev'] = 0;
@@ -675,12 +689,11 @@ class module_report_activity extends module_report
$total['poidprev'] += (!is_null($row['poid']) ? $row['poid'] : 0); $total['poidprev'] += (!is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['usrid'] = $row['usrid']; $this->result[$i]['usrid'] = $row['usrid'];
} }
$save_user = $user; $save_user = $user;
} }
$this->result[$i]['poiddoc'] = p4string::format_octets($this->result[$i]['poiddoc']); unset($this->result[$i]);
$this->result[$i]['poidprev'] = p4string::format_octets($this->result[$i]['poidprev']);
$nb_row = $i + 1; $nb_row = $i + 1;
$this->total = $nb_row; $this->total = $nb_row;