Commit 02d566e4 authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

version 7.11.19

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

Conflicts:
	VERSIONS
	library/startup.php
parents 64cf2d6f ca9b41f5
30/01/2018 - v7.11.19
- ticket #56107 : Articles : ajout d'un plugin à l'éditeur des articles pour insérer un kiosque de notices
- ticket #69403 : Administration : correction du formulaire de création d'un album en popup.
- ticket #70402 : Administration : correction du renommage des fichiers et dossiers dans l'explorateur de fichier.
- ticket #66006 : Articles : correction de l'affichage public d'articles en brouillon.
- ticket #70693 : Administration : suppression de la popup de confirmation lorsqu'on sauvegarde les permissions par défaut des articles.
- ticket #69594 : Articles : correction de l'affichage des listes d'articles.
24/01/2018 - v7.11.18
- ticket #70308 : Administration : correction de l'enregistrement des boîtes.
......
- ticket #69403 : Administration : correction du formulaire de création d'un album en popup.
\ No newline at end of file
- ticket #70402 : Administration : correction du renommage des fichiers et dossiers dans l'explorateur de fichier.
\ No newline at end of file
- ticket #56107 : ajout d'un plugin à l'éditeur des articles pour insérer un kiosque de notices
......@@ -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"))
......
......@@ -95,12 +95,8 @@ class CmsController extends ZendAfi_Controller_Action {
public function articleviewAction() {
if (null === ($article = Class_Article::find((int)$this->_getParam('id')))) {
throw new Zend_Controller_Action_Exception($this->view->_('Désolé, cette page n\'existe pas'), 404);
return;
}
if ($article->isArchived() && !Class_Users::isCurrentUserCanAccesBackend()) {
if ((!$article = Class_Article::find((int)$this->_getParam('id')))
|| (!$article->isFrontVisible())) {
throw new Zend_Controller_Action_Exception($this->view->_('Désolé, cette page n\'existe pas'), 404);
return;
}
......
......@@ -472,6 +472,9 @@ class ArticleLoader extends Storm_Model_Loader {
public function filterByDay($day, $articles) {
if(!$day)
return $articles;
$day_num = date("w", $day);
return array_filter($articles,
function($event) use ($day_num)
......@@ -1442,5 +1445,15 @@ class Class_Article extends Storm_Model_Abstract {
return $result;
}
}
?>
\ No newline at end of file
public function isFrontVisible() {
if(Class_Users::isCurrentUserCanAccesBackend())
return true;
if($this->isArchived())
return false;
return !$this->isStatusDraft();
}
}
\ No newline at end of file
......@@ -82,7 +82,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.11');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.18');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.19');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -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();
}
}
......
......@@ -1233,6 +1233,7 @@ class CmsControllerArticleViewArticleArchivedWithWorkflowTest extends CmsControl
class CmsControllerArticleViewArticleArchivedWithWorkflowAsModoBibTest extends CmsControllerWithFeteDeLaFriteTestCase {
protected function _loginHook($account) {
$account->ROLE_LEVEL = ZendAfi_Acl_AdminControllerRoles::MODO_BIB;
......@@ -1355,6 +1356,52 @@ class CmsControllerArticleViewWithModoTest extends CmsControllerWithFeteDeLaFrit
class CmsControllerArticleViewDraftTest extends CmsControllerWithFeteDeLaFriteTestCase {
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
Class_AdminVar::newInstanceWithId('WORKFLOW', ['valeur' => '1']);
Class_Article::find(224)->beDraft()->assertSave();
$this->dispatch('/cms/articleview/id/224');
}
/** @test */
public function responseShouldBeA404NotFound() {
$this->assertResponseCode(404);
}
/** @test */
public function pageShouldContainsH1WithNotFound() {
$this->assertXPathContentContains('//h1', 'Désolé, cette page n\'existe pas');
}
}
class CmsControllerUnknownArticleTest extends CmsControllerWithFeteDeLaFriteTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/cms/articleview/id/456789456224');
}
/** @test */
public function responseShouldBeA404NotFound() {
$this->assertResponseCode(404);
}
/** @test */
public function pageShouldContainsH1WithNotFound() {
$this->assertXPathContentContains('//h1', 'Désolé, cette page n\'existe pas');
}
}
class CmsControllerArticleReadTest extends CmsControllerWithFeteDeLaFriteTestCase {
public function setUp() {
......@@ -1551,6 +1598,7 @@ class CmsControllerArticleViewSelectionFromHorizontalMenuBoxTest extends Abstrac
class CmsControllerArticleViewPreferencesBySelectionTest extends CmsControllerListTestCase {
protected function _dispatchHook() {
Class_Article::find(224)->setPickDay('5')->save();
$this->dispatch('/cms/articleviewpreferences?id_items=1-3&display_order=Selection');
}
......
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