Cleanup namepaces, variables uses

This commit is contained in:
Romain Neutron
2012-09-28 16:06:28 +02:00
parent 372861deb4
commit 1700565862
232 changed files with 593 additions and 1446 deletions

View File

@@ -394,7 +394,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{
$dstatus = databox_status::getDisplayStatus($this->app);
$sbas_id = $this->get_sbas_id();
$appbox = $this->app['phraseanet.appbox'];
$user = $this->app['phraseanet.user'];
$status = '';
@@ -1351,7 +1350,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$story = new self($app, $databox->get_sbas_id(), $story_id);
try {
$appbox = $app['phraseanet.appbox'];
$log_id = $app['phraseanet.logger']($databox)->get_id();
$sql = 'INSERT INTO log_docs (id, log_id, date, record_id, action, final, comment)
@@ -1405,7 +1403,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$record = new self($app, $databox->get_sbas_id(), $record_id);
try {
$appbox = $app['phraseanet.appbox'];
$log_id = $app['phraseanet.logger']($databox)->get_id();
$sql = 'INSERT INTO log_docs (id, log_id, date, record_id, action, final, comment)
@@ -1574,9 +1571,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{
$connbas = $this->get_databox()->get_connection();
$sbas_id = $this->get_databox()->get_sbas_id();
$appbox = $this->app['phraseanet.appbox'];
$registry = $this->app['phraseanet.registry'];
$conn = $appbox->get_connection();
$conn = $this->app['phraseanet.appbox']->get_connection();
$ftodel = array();
foreach ($this->get_subdefs() as $subdef) {
@@ -1611,7 +1606,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$stmt->closeCursor();
try {
$sphinx_rt = sphinxrt::get_instance($registry);
$sphinx_rt = sphinxrt::get_instance($this->app['phraseanet.registry']);
$sbas_params = phrasea::sbas_params($this->app);
@@ -2050,8 +2045,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
*/
public function get_grouping_parents()
{
$appbox = $this->app['phraseanet.appbox'];
$sql = 'SELECT r.record_id
FROM regroup g
INNER JOIN (record r

View File

@@ -10,7 +10,6 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Configuration;
/**
*
@@ -79,15 +78,13 @@ class record_exportElement extends record_adapter
$this->downloadable = $downloadable = array();
$this->orderable = $orderable = array();
$appbox = $this->app['phraseanet.appbox'];
$sd = $this->get_subdefs();
$sbas_id = phrasea::sbasFromBas($this->app, $this->base_id);
$user = $this->app['phraseanet.user'];
$subdefgroups = $appbox->get_databox($sbas_id)->get_subdef_structure();
$subdefgroups = $this->app['phraseanet.appbox']->get_databox($sbas_id)->get_subdef_structure();
$subdefs = array();

View File

@@ -10,7 +10,6 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Configuration;
/**
*

View File

@@ -316,8 +316,6 @@ class record_preview extends record_adapter
$tab = array();
$appbox = $this->app['phraseanet.appbox'];
$registry = $this->app['phraseanet.registry'];
$user = $this->app['phraseanet.user'];
$report = $user->ACL()->has_right_on_base($this->get_base_id(), 'canreport');
@@ -333,7 +331,7 @@ class record_preview extends record_adapter
if ( ! $report) {
$sql .= ' AND ((l.usrid = :usr_id AND l.site= :site) OR action="add")';
$params[':usr_id'] = $user->get_id();
$params[':site'] = $registry->get('GV_sit');
$params[':site'] = $this->app['phraseanet.registry']->get('GV_sit');
}
$sql .= 'ORDER BY d.date, usrid DESC';
@@ -403,14 +401,11 @@ class record_preview extends record_adapter
return $this->view_popularity;
}
$appbox = $this->app['phraseanet.appbox'];
$user = $this->app['phraseanet.user'];
$report = $user->ACL()->has_right_on_base(
$this->get_base_id(), 'canreport');
$registry = $this->app['phraseanet.registry'];
if ( ! $report && ! $registry->get('GV_google_api')) {
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
$this->view_popularity = false;
return $this->view_popularity;
@@ -442,7 +437,7 @@ class record_preview extends record_adapter
$stmt->execute(
array(
':record_id' => $this->get_record_id(),
':site' => $registry->get('GV_sit')
':site' => $this->app['phraseanet.registry']->get('GV_sit')
)
);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -496,14 +491,11 @@ class record_preview extends record_adapter
return $this->refferer_popularity;
}
$appbox = $this->app['phraseanet.appbox'];
$user = $this->app['phraseanet.user'];
$report = $user->ACL()->has_right_on_base(
$this->get_base_id(), 'canreport');
$registry = $this->app['phraseanet.registry'];
if ( ! $report && ! $registry->get('GV_google_api')) {
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
$this->refferer_popularity = false;
return $this->refferer_popularity;
@@ -527,22 +519,22 @@ class record_preview extends record_adapter
foreach ($rs as $row) {
if ($row['referrer'] == 'NO REFERRER')
$row['referrer'] = _('report::acces direct');
if ($row['referrer'] == $registry->get('GV_ServerName') . 'prod/')
if ($row['referrer'] == $this->app['phraseanet.registry']->get('GV_ServerName') . 'prod/')
$row['referrer'] = _('admin::monitor: module production');
if ($row['referrer'] == $registry->get('GV_ServerName') . 'client/')
if ($row['referrer'] == $this->app['phraseanet.registry']->get('GV_ServerName') . 'client/')
$row['referrer'] = _('admin::monitor: module client');
if (strpos($row['referrer'], $registry->get('GV_ServerName') . 'login/') !== false)
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'login/') !== false)
$row['referrer'] = _('report:: page d\'accueil');
if (strpos($row['referrer'], 'http://apps.cooliris.com/') !== false)
$row['referrer'] = _('report:: visualiseur cooliris');
if (strpos($row['referrer'], $registry->get('GV_ServerName') . 'document/') !== false) {
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'document/') !== false) {
if (strpos($row['referrer'], '/view/') !== false)
$row['referrer'] = _('report::presentation page preview');
else
$row['referrer'] = _('report::acces direct');
}
if (strpos($row['referrer'], $registry->get('GV_ServerName') . 'permalink/') !== false) {
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'permalink/') !== false) {
if (strpos($row['referrer'], '/view/') !== false)
$row['referrer'] = _('report::presentation page preview');
else
@@ -579,15 +571,12 @@ class record_preview extends record_adapter
return $this->download_popularity;
}
$appbox = $this->app['phraseanet.appbox'];
$user = $this->app['phraseanet.user'];
$registry = $this->app['phraseanet.registry'];
$report = $user->ACL()->has_right_on_base(
$this->get_base_id(), 'canreport');
$ret = false;
if ( ! $report && ! $registry->get('GV_google_api')) {
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
$this->download_popularity = false;
return $this->download_popularity;
@@ -621,7 +610,7 @@ class record_preview extends record_adapter
$stmt->execute(
array(
':record_id' => $this->get_record_id(),
':site' => $registry->get('GV_sit')
':site' => $this->app['phraseanet.registry']->get('GV_sit')
)
);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);