Commit 38acf2b2 authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

Merge branch...

Merge branch 'hotline#70693_articles_permission_par_defaut_impossible_d_enregistrer_les_modifications' into 'stable'

hotline #70693 remove useless popup

See merge request afi/opacce!2481
parents f716a6cd 2634cbf9
- ticket #70693 : Administration : suppression de la popup de confirmation lorsqu'on sauvegarde les permissions par défaut des articles.
......@@ -319,28 +319,22 @@ class Admin_BibController extends ZendAfi_Controller_Action {
public function permissionsAction() {
if (!Class_Users::getIdentity()->isRoleMoreThanModoPortail()
|| (!$model = ('0' === $this->_getParam('id'))
? Class_Bib::getPortail() : Class_Bib::find((int)$this->_getParam('id', 0)))) {
$this->_redirect($this->view->url(['module' => 'admin',
? Class_Bib::getPortail() : Class_Bib::find((int)$this->_getParam('id', 0))))
return $this->_redirect($this->view->url(['module' => 'admin',
'controller' => 'bib'],
null, true),
['prependBase' => false]);
return;
}
if ($this->_request->isPost()) {
$this->_helper->groupPermissions($model, $this->_getParam('perms', []));
$this->_helper->notify('Permissions sauvegardées');
$this->_redirect('admin/cms');
$this->_redirectToReferer();
return;
}
$this->view->titre = $this->view->_('Permissions par défaut de la bibliothèque: %s',
$model->getLibelle());
Class_ScriptLoader::getInstance()
->addAdminScript('controle_maj')
->addJQueryReady('$("form input").change(function(){setFlagMaj(true)})');
$this->view->permissions = $this->view
->groupsPermissions($model,
Class_Permission::getCmsPermissions(),
......@@ -351,6 +345,7 @@ class Admin_BibController extends ZendAfi_Controller_Action {
null, true));
}
protected function checkForm() {
$this->view->erreurs=[];
if(!$this->_getParam("libelle"))
......
......@@ -1646,6 +1646,12 @@ class BibControllerPermissionsPortalActionTest extends BibControllerPermissionsT
$this->assertXPath($this->checkboxPath(Class_Permission::createArticle(),
'[@checked="checked"]'));
}
/** @test */
public function shouldNotContainsSetFlagMaj() {
$this->assertNotXPathContentContains('//script', 'setFlagMaj');
}
}
......@@ -1676,6 +1682,12 @@ class BibControllerPermissionsPortalPostActionTest
$this->group,
Class_Bib::getPortail()));
}
/** @test */
public function shouldRedirect() {
$this->assertRedirect();
}
}
......
Markdown is supported
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