mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Cleanup namepaces, variables uses
This commit is contained in:
@@ -292,8 +292,7 @@ class module_report_activity extends module_report
|
||||
$filter = $s->getFilters();
|
||||
$conn = $s->getConnBas();
|
||||
|
||||
$appbox = $this->app['phraseanet.appbox'];
|
||||
$databox = $appbox->get_databox($this->sbas_id);
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->sbas_id);
|
||||
|
||||
$params = array();
|
||||
$date_filter = $filter->getDateFilter();
|
||||
@@ -363,7 +362,6 @@ class module_report_activity extends module_report
|
||||
{
|
||||
$this->title = _('report:: telechargements par jour');
|
||||
|
||||
$registry = $this->app['phraseanet.registry'];
|
||||
|
||||
$s = new module_report_sql($this->app, $this);
|
||||
$filter = $s->getFilters();
|
||||
@@ -756,14 +754,13 @@ class module_report_activity extends module_report
|
||||
public static function topTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
$result = array();
|
||||
$result['top_ten_doc'] = array();
|
||||
$result['top_ten_prev'] = array();
|
||||
$result['top_ten_poiddoc'] = array();
|
||||
$result['top_ten_poidprev'] = array();
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
@@ -837,14 +834,13 @@ class module_report_activity extends module_report
|
||||
public static function activity(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
$res = array();
|
||||
$datefilter =
|
||||
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
$sql = "
|
||||
@@ -877,7 +873,6 @@ class module_report_activity extends module_report
|
||||
public static function activityDay(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
$result = array();
|
||||
$res = array();
|
||||
$datefilter =
|
||||
@@ -885,7 +880,7 @@ class module_report_activity extends module_report
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
$sql = "
|
||||
@@ -919,14 +914,13 @@ class module_report_activity extends module_report
|
||||
public static function activityQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
$result = array();
|
||||
$datefilter =
|
||||
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
$sql = "
|
||||
@@ -957,14 +951,13 @@ class module_report_activity extends module_report
|
||||
public static function activiteTopQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
$result = array();
|
||||
$datefilter =
|
||||
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
$sql = "
|
||||
|
@@ -151,12 +151,11 @@ class module_report_connexion extends module_report
|
||||
public static function getNbConn(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
$finalfilter = $datefilter['sql'] . ' AND ';
|
||||
|
@@ -74,18 +74,17 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
*/
|
||||
public static function getInstance(Application $app, $sbasid, $sbas_coll, $dmin, $dmax)
|
||||
{
|
||||
$appbox = $app['phraseanet.appbox'];
|
||||
$cache_id = 'feed_' . md5($sbasid . '_' . $sbas_coll . '_' . $dmin . '_' . $dmax);
|
||||
|
||||
try {
|
||||
return $appbox->get_data_from_cache($cache_id);
|
||||
return $app['phraseanet.appbox']->get_data_from_cache($cache_id);
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
$tmp = new self($app, $sbasid, $sbas_coll, $dmin, $dmax);
|
||||
|
||||
$appbox->set_data_to_cache($tmp, $cache_id);
|
||||
$app['phraseanet.appbox']->set_data_to_cache($tmp, $cache_id);
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
@@ -144,8 +143,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$this->report['nb_conn'] = module_report_connexion::getNbConn(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
);
|
||||
$registry = $this->app['phraseanet.registry'];
|
||||
if ($registry->get('GV_anonymousReport') == false) {
|
||||
if ($this->app['phraseanet.registry']->get('GV_anonymousReport') == false) {
|
||||
/**
|
||||
* get Top ten user of
|
||||
* number of dl doc, prev
|
||||
@@ -180,7 +178,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$this->report['top_dl_preview'] = $topdl['preview'];
|
||||
$this->report['top_dl_document'] = $topdl['document'];
|
||||
|
||||
if ($registry->get('GV_anonymousReport') == false) {
|
||||
if ($this->app['phraseanet.registry']->get('GV_anonymousReport') == false) {
|
||||
// get users that ask the most questions
|
||||
$this->report['ask'] = module_report_activity::activityQuestion(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
@@ -204,7 +202,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$this->report['activity_edited'] = module_report_activity::activiteEditedDocument(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
);
|
||||
if ($registry->get('GV_anonymousReport') == false) {
|
||||
if ($this->app['phraseanet.registry']->get('GV_anonymousReport') == false) {
|
||||
//get users that add the most documents
|
||||
$this->report['top_ten_added'] = module_report_activity::activiteAddedTopTenUser(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
|
@@ -174,9 +174,8 @@ class module_report_download extends module_report
|
||||
public static function getNbDl(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$registry = $app['phraseanet.registry'];
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
@@ -210,13 +209,10 @@ class module_report_download extends module_report
|
||||
|
||||
public static function getTopDl(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$appbox = $app['phraseanet.appbox'];
|
||||
$databox = $appbox->get_databox((int) $sbas_id);
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
$registry = $app['phraseanet.registry'];
|
||||
|
||||
$params = array(':site_id' => $registry->get('GV_sit'));
|
||||
$params = array(':site_id' => $app['phraseanet.registry']->get('GV_sit'));
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
@@ -63,9 +63,8 @@ class module_report_sqlfilter
|
||||
public function getReportFilter()
|
||||
{
|
||||
$finalfilter = '';
|
||||
$registry = $this->app['phraseanet.registry'];
|
||||
|
||||
$params = array(':log_site' => $registry->get('GV_sit'));
|
||||
$params = array(':log_site' => $this->app['phraseanet.registry']->get('GV_sit'));
|
||||
|
||||
if ($this->filter['date']) {
|
||||
$finalfilter .= $this->filter['date']['sql'] . ' AND ';
|
||||
@@ -86,13 +85,12 @@ class module_report_sqlfilter
|
||||
|
||||
public function getGvSitFilter()
|
||||
{
|
||||
$registry = $this->app['phraseanet.registry'];
|
||||
$params = array();
|
||||
$sql = '';
|
||||
|
||||
if ($registry->is_set('GV_sit')) {
|
||||
if ($this->app['phraseanet.registry']->is_set('GV_sit')) {
|
||||
$sql = 'log.site = :log_site_gv_filter';
|
||||
$params[':log_site_gv_filter'] = $registry->get('GV_sit');
|
||||
$params[':log_site_gv_filter'] = $this->app['phraseanet.registry']->get('GV_sit');
|
||||
}
|
||||
|
||||
return array('sql' => $sql, 'params' => $params);
|
||||
|
Reference in New Issue
Block a user