mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00

Create entries in log_colls table Fix SQL issue Fix SQL issues Update version Add patch Remove debug output Fix CS Fic CS Add table schema Fix Cs Update patch Update patch Update patch Update patch Update patch delete all coll_list call Fix logger issue Fix log_colls table structure definition Rename patch Fix SQL Issues Fix patch Fix test Fix tests
97 lines
2.3 KiB
PHP
97 lines
2.3 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2013 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
/**
|
|
*
|
|
* @package module_report
|
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
* @link www.phraseanet.com
|
|
*/
|
|
class module_report_dashboard_group implements module_report_dashboard_componentInterface
|
|
{
|
|
public $group_dash;
|
|
public $dashboard = array();
|
|
private $valid = false;
|
|
|
|
/**
|
|
* @desc group the dashboard
|
|
*/
|
|
public function __construct(module_report_dashboard $report)
|
|
{
|
|
if ($report->isValid()) {
|
|
$this->valid = true;
|
|
$this->dashboard = $report->getDash();
|
|
}
|
|
$this->process();
|
|
}
|
|
|
|
/**
|
|
* @desc GROUP the dashboard
|
|
* @return <void>
|
|
*/
|
|
public function process()
|
|
{
|
|
if ($this->valid) {
|
|
if (is_null($this->group_dash))
|
|
$this->group_dash = array();
|
|
foreach ($this->dashboard as $key => $dash) {
|
|
if (is_object($dash) &&
|
|
$dash instanceof module_report_dashboard_feed &&
|
|
$dash->isValid()) {
|
|
$onedash = $dash->getDash();
|
|
foreach ($onedash as $typeofreport => $value) {
|
|
if (is_array($value) && sizeof($value) == 0)
|
|
continue;
|
|
else {
|
|
$this->group_dash[$typeofreport][] = $value;
|
|
}
|
|
}
|
|
} else {
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* @desc check if the grouped dash is valid
|
|
* @return <bool>
|
|
*/
|
|
public function isValid()
|
|
{
|
|
if (isset($this->group_dash) && sizeof($this->group_dash) > 0) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @desc return the results
|
|
* @return <array>
|
|
*/
|
|
public function getDash()
|
|
{
|
|
return $this->group_dash;
|
|
}
|
|
|
|
/**
|
|
* @desc Tri de grouped dash
|
|
* @return dashboard_merge
|
|
*/
|
|
public function tri()
|
|
{
|
|
return new module_report_dashboard_merge($this);
|
|
}
|
|
}
|