Commit 473bb2e2 authored by Ghislain Loas's avatar Ghislain Loas

Merge branch...

Merge branch 'hotline#72242_impossible_d_inserer_un_kiosque_de_notices_dans_un_article_en_tant_qu_admin_bib' into 'hotline'

hotline #72242 : fix error on kiosk ckeditor form

See merge request afi/opacce!2531
parents 7f8719e3 62d5d3fc
RewriteEngine on
RewriteCond %{REQUEST_URI} !/(xhprof_html|ckeditor|exploit|\.well-known)
RewriteCond %{REQUEST_URI} !/^(xhprof_html|ckeditor|exploit|\.well-known)
RewriteCond %{REQUEST_FILENAME} !^.*/robots\.txt$ [NC]
RewriteRule !(userfiles|public|tmp|temp|skins)/.*\.(js|ico|txt|gif|jpg|jpeg|png|css|xml|swf|mov|pdf|doc|docx|woff|woff2|eot|svg|ttf|xls|wsdl|mp3|m4v|ogg|ogv|epub|html|xhtml|asmx|zip|sql|bro|flv|mp4|webm|tgz|json|geojson)$ index.php [NC,NE]
......
- ticket #72242 : Article: insertion d'un kiosque de notices rendu possible à partir du role Rédacteur bibliothèque.
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_CkeditorController extends ZendAfi_Controller_Action {
public function indexAction() {
return $this->_forward('index', 'index');
}
public function getFormAction() {
$module = Class_Systeme_ModulesAccueil::moduleByCode($this->_getParam('code'));
$form_class = $module->getForm();
$this->view->form = (new $form_class())->populate(array_merge(
$module->getDefaultValues(),
$this->_request->getPost()));
}
}
?>
\ No newline at end of file
......@@ -202,16 +202,6 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
}
public function getFormAction() {
$module = Class_Systeme_ModulesAccueil::moduleByCode($this->_getParam('code'));
$form_class = $module->getForm();
$this->view->form = (new $form_class())->populate(array_merge(
$module->getDefaultValues(),
$this->_request->getPost()));
}
protected function _readTemplates() {
$templates = file_get_contents(ROOT_PATH . 'public/opac/js/widget_templates/widget_templates.json');
return json_decode($templates, true);
......
......@@ -51,6 +51,7 @@ class ZendAfi_Acl_AdminControllerRoles extends Zend_Acl {
$this->add(new Zend_Acl_Resource('auth'));
$this->add(new Zend_Acl_Resource('cms'));
$this->add(new Zend_Acl_Resource('cms-category'));
$this->add(new Zend_Acl_Resource('ckeditor'));
$this->add(new Zend_Acl_Resource('data'));
$this->add(new Zend_Acl_Resource('error'));
$this->add(new Zend_Acl_Resource('modo'));
......@@ -108,6 +109,7 @@ class ZendAfi_Acl_AdminControllerRoles extends Zend_Acl {
$this->allow('invite','auth');
$this->allow('modo_bib','cms');
$this->allow('modo_bib','ckeditor');
$this->allow('modo_bib','cms-category');
$this->allow('modo_bib','ajax');
$this->allow('modo_bib','modo');
......
......@@ -107,7 +107,7 @@ class ZendAfi_View_Helper_CkEditor extends ZendAfi_View_Helper_BaseHelper
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']
]);
$config['kiosk_widget_url'] = Class_Url::assemble(['module' => 'admin',
'controller' => 'widget',
'controller' => 'ckeditor',
'action' => 'get-form',
'code' => Class_Systeme_ModulesAccueil_Kiosque::CODE,
'render' => 'popup']);
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class CkeditorControllerGetFormPostTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
protected function _loginHook($account) {
$account->ROLE = "modo_bib";
$account->ROLE_LEVEL = ZendAfi_Acl_AdminControllerRoles::MODO_BIB;
$account->LOGIN = "modo";
$account->PSEUDO = "modo";
}
public function setUp() {
parent::setUp();
$this->postDispatch('/admin/ckeditor/get-form/code/KIOSQUE', ['titre' => 'Boite%20kiosque',
'nb_notices' =>'12']);
}
/** @test */
public function formShouldHaveFieldsetAndTable() {
$this->assertXPath('//fieldset/table');
}
/** @test */
public function formShouldNotHaveSubmitButtons() {
$this->assertNotXPath('//button');
}
/** @test */
public function formShouldHaveDefaultValueButtons() {
$this->assertXPath('//input[@id="nb_notices"][@value="12"]', $this->_response->getBody());
}
}
class CkeditorControllerGetFormTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->dispatch('/admin/ckeditor/get-form/code/KIOSQUE', true);
}
/** @test */
public function formShouldHaveFieldsetAndTable() {
$this->assertXPath('//fieldset/table');
}
/** @test */
public function formShouldNotHaveSubmitButtons() {
$this->assertNotXPath('//button');
}
}
......@@ -2299,30 +2299,6 @@ class WidgetControllerWidgetAddWidgetFromTemplateTest extends WidgetControllerWi
class WidgetControllerGetFormTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->dispatch('/admin/widget/get-form/code/KIOSQUE', true);
}
/** @test */
public function formShouldHaveFieldsetAndTable() {
$this->assertXPath('//fieldset/table');
}
/** @test */
public function formShouldNotHaveSubmitButtons() {
$this->assertNotXPath('//button');
}
}
class WidgetControllerUpdateStyleTest extends Admin_AbstractControllerTestCase {
protected
$_storm_default_to_volatile = true,
......@@ -2388,34 +2364,3 @@ class WidgetControllerUpdateStyleTest extends Admin_AbstractControllerTestCase {
'value: 80');
}
}
class WidgetControllerGetFormPostTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->postDispatch('/admin/widget/get-form/code/KIOSQUE', ['titre' => 'Boite%20kiosque',
'nb_notices' =>'12']);
}
/** @test */
public function formShouldHaveFieldsetAndTable() {
$this->assertXPath('//fieldset/table');
}
/** @test */
public function formShouldNotHaveSubmitButtons() {
$this->assertNotXPath('//button');
}
/** @test */
public function formShouldHaveDefaultValueButtons() {
$this->assertXPath('//input[@id="nb_notices"][@value="12"]', $this->_response->getBody());
}
}
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