Skip to content
Snippets Groups Projects

Master

Merged Laurent requested to merge master into dev#7832_profils_url_rewriting
Compare and
+ 2136
1084
Preferences
Compare changes
Files
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AccueilController extends Zend_Controller_Action {
private $id_profil; // Profil a modifier
@@ -46,10 +46,10 @@ class Admin_AccueilController extends Zend_Controller_Action {
$this->id_profil = $this->profil->getId();
}
$this->type_module = $this->_getParam('type_module');
$this->type_module = $this->_getParam('type_module');
$user = Class_Users::getIdentity();
if ((!$user->isAdminBib() && !$user->hasRightConfigFront())
|| ($user->isAdminBib() && ($user->getIdSite() !== $this->profil->getIdSite()))) {
$this->_redirect('admin/index');
@@ -57,13 +57,13 @@ class Admin_AccueilController extends Zend_Controller_Action {
}
$this->preferences = ($this->config == 'admin') ?
$this->_extractProperties() :
$this->_extractProperties() :
$this->profil->getOrCreateConfigAccueil($this->id_module, $this->type_module);
$boite = isset($this->preferences["boite"]) ? $this->preferences["boite"] : '';
$this->view->preferences = $this->preferences;
$this->view->url = $this->_request->getRequestUri();
$this->view->combo_templates = ZendAfi_View_Helper_Accueil_Base::getComboTemplates($boite, $this->profil);
$this->view->id_profil = $this->profil->getId();
$this->view->id_bib = $this->profil->getIdSite();
@@ -175,7 +175,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
public function panierAction() {
$this->_simpleAction('PANIER');
}
public function bibliothequeNumeriqueAction() {
if (1 == $this->_getParam('styles_reload')) {
@@ -280,15 +280,15 @@ class Admin_AccueilController extends Zend_Controller_Action {
}
}
protected function _setTypeDAnalyse(&$enreg) {
$enreg = isset($enreg['nb_notices']) ? $enreg : array_merge($enreg,['nb_notices' => 1]) ;
$enreg = isset($enreg['nb_notices']) ? $enreg : array_merge($enreg,['nb_notices' => 1]) ;
$enreg['nb_notices'] = (1 < (int)$enreg['nb_notices']) ?
(int)$enreg["nb_notices"]
: 1;
$enreg = isset($enreg['nb_analyse']) ? $enreg : array_merge($enreg,['nb_analyse' => 10]) ;
$enreg = isset($enreg['nb_analyse']) ? $enreg : array_merge($enreg,['nb_analyse' => 10]) ;
$enreg['nb_analyse'] = (int)$enreg['nb_analyse'];
if ($enreg['nb_analyse'] < $enreg['nb_notices'])
@@ -319,7 +319,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
$module_config = $this->profil
->getModuleAccueilConfig($this->id_module, 'KIOSQUE');
$selected_elementId = explode('-', $this->_request->getPost('domaine_panier'));
if($selected_elementId[0] == 'p') {
$module_config['preferences']['id_catalogue'] = 0;
$module_config['preferences']['id_panier'] = $selected_elementId[1];
@@ -330,7 +330,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
$module_config['preferences']['id_catalogue'] = 0;
$module_config['preferences']['id_panier'] = 0;
}
$this->profil
->updateModuleConfigAccueil($this->id_module, $module_config)
->save();
@@ -363,7 +363,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
private function _simpleAction($type) {
// pour combo des annexes
$this->view->ya_annexes = fetchAll("select count(*) from codif_annexe where invisible=0 order by libelle");
if ($this->_request->isPost())
if ($this->_request->isPost())
$this->_updateEtRetour($this->_request->getPost(), $type);
}
@@ -406,7 +406,6 @@ class Admin_AccueilController extends Zend_Controller_Action {
*/
protected function _updateEtRetour($data, $type) {
$enreg = [];
foreach ($data as $clef => $valeur)
$enreg[$clef] = addslashes($valeur);
@@ -415,7 +414,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
$this->view->properties = $this->_compactProperties($enreg);
} else {
$module_config = $this->profil->getModuleAccueilConfig($this->id_module, $type);
$module_config['preferences'] = $enreg;
$module_config['preferences'] = array_merge($module_config['preferences'], $enreg);
$this->profil
->updateModuleConfigAccueil($this->id_module, $module_config)