Remove some deprecated methods calls

This commit is contained in:
Benoît Burnichon
2016-03-06 23:05:55 +01:00
parent ba4274eb28
commit 6cdc9d7a31
77 changed files with 322 additions and 307 deletions

View File

@@ -83,13 +83,13 @@ class record_exportElement extends record_adapter
$sd = $this->get_subdefs();
$sbas_id = phrasea::sbasFromBas($this->app, $this->get_base_id());
$sbas_id = phrasea::sbasFromBas($this->app, $this->getBaseId());
/** @var databox_subdef[] $subdefs */
$subdefs = [];
foreach ($this->app->findDataboxById($sbas_id)->get_subdef_structure() as $subdef_type => $subdefs_obj) {
if ($subdef_type == $this->get_type()) {
if ($subdef_type == $this->getType()) {
$subdefs = $subdefs_obj;
break;
}
@@ -101,10 +101,10 @@ class record_exportElement extends record_adapter
'thumbnail' => true
];
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($this->getBaseId(), 'candwnldhd')) {
$go_dl['document'] = true;
}
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'candwnldpreview')) {
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($this->getBaseId(), 'candwnldpreview')) {
$go_dl['preview'] = true;
}
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->has_hd_grant($this)) {
@@ -117,18 +117,18 @@ class record_exportElement extends record_adapter
$query = $this->app['phraseanet.user-query'];
$masters = $query->on_base_ids([$this->get_base_id()])
$masters = $query->on_base_ids([$this->getBaseId()])
->who_have_right(['order_master'])
->execute()->get_results();
$go_cmd = (count($masters) > 0 && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($this->get_base_id(), 'cancmd'));
$go_cmd = (count($masters) > 0 && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($this->getBaseId(), 'cancmd'));
$orderable['document'] = false;
$downloadable['document'] = false;
if (isset($sd['document']) && is_file($sd['document']->getRealPath())) {
if ($go_dl['document'] === true) {
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->is_restricted_download($this->get_base_id())) {
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->is_restricted_download($this->getBaseId())) {
$this->remain_hd --;
if ($this->remain_hd >= 0) {
$localizedLabel = $this->app->trans('document original');
@@ -182,7 +182,7 @@ class record_exportElement extends record_adapter
if (isset($sd[$name]) && $sd[$name]->is_physically_present()) {
if ($class == 'document') {
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->is_restricted_download($this->get_base_id())) {
if ($this->app->getAclForUser($this->app->getAuthenticatedUser())->is_restricted_download($this->getBaseId())) {
$this->remain_hd --;
if ($this->remain_hd >= 0)
$downloadable[$name] = [