mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
Replace app['phraseanet.appbox']->get_databox using trait
This commit is contained in:
@@ -836,7 +836,7 @@ class module_report
|
||||
return $this->report;
|
||||
}
|
||||
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->sbas_id);
|
||||
$databox = $this->app->findDataboxById($this->sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
@@ -887,7 +887,7 @@ class module_report
|
||||
{
|
||||
$tab = [];
|
||||
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbasid);
|
||||
$databox = $app->findDataboxById((int) $sbasid);
|
||||
|
||||
foreach ($databox->get_meta_structure() as $databox_field) {
|
||||
/* @var $databox_field \databox_field */
|
||||
|
@@ -557,7 +557,7 @@ class module_report_activity extends module_report
|
||||
// ========================== ???????????????? ===========================
|
||||
public static function topTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$result['top_ten_doc'] = [];
|
||||
@@ -652,7 +652,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activity(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$res = [];
|
||||
$datefilter =
|
||||
@@ -708,7 +708,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activityDay(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = array();
|
||||
$res = array();
|
||||
@@ -761,7 +761,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activityQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
@@ -814,7 +814,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteTopQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
@@ -870,7 +870,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteTopTenSiteView(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
@@ -928,7 +928,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteAddedDocument(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
@@ -977,7 +977,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteEditedDocument(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
@@ -1026,7 +1026,7 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteAddedTopTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
|
@@ -136,7 +136,7 @@ class module_report_connexion extends module_report
|
||||
|
||||
public static function getNbConn(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
@@ -177,7 +177,7 @@ class module_report_download extends module_report
|
||||
|
||||
public static function getNbDl(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
@@ -223,7 +223,7 @@ class module_report_download extends module_report
|
||||
|
||||
public static function getTopDl(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
$databox = $app->findDataboxById((int) $sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
|
@@ -416,7 +416,7 @@ class module_report_nav extends module_report
|
||||
|
||||
if ($on) {
|
||||
if ( ! empty($req)) {
|
||||
$stmt = $this->app['phraseanet.appbox']->get_databox($this->sbas_id)->get_connection()->prepare($req);
|
||||
$stmt = $this->app->findDataboxById($this->sbas_id)->get_connection()->prepare($req);
|
||||
$stmt->execute($params);
|
||||
$rsu = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
@@ -531,7 +531,7 @@ class module_report_nav extends module_report
|
||||
|
||||
public function buildTabInfoNav($tab = false, $navigator)
|
||||
{
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->sbas_id);
|
||||
$databox = $this->app->findDataboxById($this->sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$this->title = $this->app->trans('report:: Information sur le navigateur %name%', ['%name%' => $navigator]);
|
||||
$sqlBuilder = new module_report_sql($this->app, $this);
|
||||
|
@@ -40,7 +40,7 @@ class module_report_sql
|
||||
public function __construct(Application $app, module_report $report)
|
||||
{
|
||||
$this->conn = $app['phraseanet.appbox']->get_connection();
|
||||
$this->connbas = $app['phraseanet.appbox']->get_databox($report->getSbasId())->get_connection();
|
||||
$this->connbas = $app->findDataboxById($report->getSbasId())->get_connection();
|
||||
$this->filter = new module_report_sqlfilter($app, $report);
|
||||
$this->sql = '';
|
||||
$this->params = [];
|
||||
|
@@ -22,7 +22,7 @@ class module_report_sqlfilter
|
||||
public function __construct(Application $app, module_report $report)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->conn = $app['phraseanet.appbox']->get_databox($report->getSbasId())->get_connection();
|
||||
$this->conn = $app->findDataboxById($report->getSbasId())->get_connection();
|
||||
|
||||
if (is_array($report->getTransQueryString()))
|
||||
$this->cor_query = $report->getTransQueryString();
|
||||
|
Reference in New Issue
Block a user