fix #463 Erreur nombre de téléchargement dans Report

This commit is contained in:
Nicolas Le Goff
2012-02-28 15:31:53 +01:00
parent 241766ceb7
commit 0cd55b289f

View File

@@ -479,7 +479,7 @@ class module_report_activity extends module_report
* @param string $on choose the field on what you want the result
* @return array
*/
public function getConnexionBase($tab = false, $on= "")
public function getConnexionBase($tab = false, $on = "")
{
//default group on user column
if (empty($on))
@@ -577,7 +577,7 @@ class module_report_activity extends module_report
* @param array $tab config for the html table
* @return array
*/
public function getDetailDownload($tab = false, $on="")
public function getDetailDownload($tab = false, $on = "")
{
empty($on) ? $on = "user" : ""; //by default always report on user
@@ -639,18 +639,21 @@ class module_report_activity extends module_report
{
$user = $row[$on];
if (($save_user != $user) && !is_null($user))
{
$i++;
$this->result[$i]['nbprev'] = 0;
$this->result[$i]['poidprev'] = 0;
$this->result[$i]['nbdoc'] = 0;
$this->result[$i]['poiddoc'] = 0;
}
//doc info
if ($row['final'] == 'document' &&
!is_null($user) && !is_null($row['usrid']))
{
$this->result[$i]['nbdoc'] = (!is_null($row['nb']) ? $row['nb'] : 0);
$this->result[$i]['poiddoc'] = (!is_null($row['poid']) ?
p4string::format_octets($row['poid']) : 0);
if (!isset($this->result[$i]['nbprev']))
$this->result[$i]['nbprev'] = 0;
if (!isset($this->result[$i]['poidprev']))
$this->result[$i]['poidprev'] = 0;
$this->result[$i]['poiddoc'] = (!is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['user'] = empty($row[$on]) ?
"<i>" . _('report:: non-renseigne') . "</i>" : $row[$on];
$total['nbdoc'] += $this->result[$i]['nbdoc'];
@@ -658,26 +661,26 @@ class module_report_activity extends module_report
$this->result[$i]['usrid'] = $row['usrid'];
}
//preview info
if ($row['final'] == 'preview' &&
if (($row['final'] == 'preview' || $row['final'] == 'thumbnail') &&
!is_null($user) &&
!is_null($row['usrid']))
{
if (!isset($this->result[$i]['nbdoc']))
$this->result[$i]['nbdoc'] = 0;
if (!isset($this->result[$i]['poiddoc']))
$this->result[$i]['poiddoc'] = 0;
$this->result[$i]['nbprev'] = (!is_null($row['nb']) ? $row['nb'] : 0);
$this->result[$i]['poidprev'] = (!is_null($row['poid']) ?
p4string::format_octets($row['poid']) : 0);
$this->result[$i]['nbprev'] += (!is_null($row['nb']) ? $row['nb'] : 0);
$this->result[$i]['poidprev'] += (!is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['user'] = empty($row[$on]) ?
"<i>" . _('report:: non-renseigne') . "</i>" : $row[$on];
$total['nbprev'] += $this->result[$i]['nbprev'];
$total['nbprev'] += (!is_null($row['nb']) ? $row['nb'] : 0);
$total['poidprev'] += (!is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['usrid'] = $row['usrid'];
}
$save_user = $user;
}
$this->result[$i]['poiddoc'] = p4string::format_octets($this->result[$i]['poiddoc']);
$this->result[$i]['poidprev'] = p4string::format_octets($this->result[$i]['poidprev']);
$nb_row = $i + 1;
$this->total = $nb_row;
@@ -756,7 +759,7 @@ class module_report_activity extends module_report
}
catch (Exception $e)
{
}
}
elseif ($value == "size")