Skip to content
Snippets Groups Projects
Commit c2ee4a67 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge remote-tracking branch 'refs/remotes/afi/stable' into afi-hotline-master

# Conflicts:
#	VERSIONS
#	library/startup.php
parents 7223ae87 59b47b16
3 merge requests!1553Master,!1502Master,!1501Stable
- ticket #34181 : Optimisation de la vérification des permissions de catégories d'article
03/12/2015 - v7.3.33
- ticket #33948 : Koha/Pikoloco : Correction du calcul de la disponibilité des exemplaires
......
......@@ -24,14 +24,23 @@ class PermissionLoader extends Storm_Model_Loader {
const DYNAMIC_PREFIX = 'DYNAMIC_';
const WORKFLOW_TYPE = 'Nouveaux statuts autorisés';
protected
$_article,
$_article_category,
$_cms;
public function getCmsPermissions() {
if ($this->_cms)
return $this->_cms;
$params = ['module' => static::MODULE_ARTICLE,
'order' => ['type', 'sorting']];
if (!Class_AdminVar::isWorkflowEnabled())
$params['type not'] = static::WORKFLOW_TYPE;
return Class_Permission::findAllBy($params);
return $this->_cms = Class_Permission::findAllBy($params);
}
......@@ -64,8 +73,10 @@ class PermissionLoader extends Storm_Model_Loader {
public function createArticle() {
return Class_Permission::findFirstBy(['module' => static::MODULE_ARTICLE,
'code' => 'ARTICLE']);
if (!$this->_article)
$this->_article = Class_Permission::findFirstBy(['module' => static::MODULE_ARTICLE,
'code' => 'ARTICLE']);
return $this->_article;
}
......@@ -76,8 +87,10 @@ class PermissionLoader extends Storm_Model_Loader {
public function createArticleCategory() {
return Class_Permission::findFirstBy(['module' => static::MODULE_ARTICLE,
'code' => 'CATEGORY']);
if (!$this->_article_category)
$this->_article_category = Class_Permission::findFirstBy(['module' => static::MODULE_ARTICLE,
'code' => 'CATEGORY']);
return $this->_article_category;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment