Commit 71992615 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'origin-hotline' into origin-master

Conflicts:
	tests/application/modules/admin/controllers/WidgetControllerTest.php
parents db082003 b4d7390b
- ticket #74708 : Boite menu vertical : correction de la prise en charge du paramètre de pliage du menu.
\ No newline at end of file
- ticket #75198 : Administration : correction du composant de sélection de domaines ou de paniers dans les écrans de configuration.
\ No newline at end of file
......@@ -243,15 +243,8 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action {
public function domainesPaniersJsonAction() {
$this->_helper->viewRenderer->setNoRender();
$data = [];
$data[] = $this->_user->getPaniersJson();
$data[] = (new Class_Catalogue())->getDomainesJson();
$data[] = (new Class_PanierNotice())->getPaniersAdminsNotInCatalogueJson();
$JSON = json_encode($data);
$this->getResponse()->setHeader('Content-Type', 'application/json; charset=utf-8');
$this->getResponse()->setBody($JSON);
$this->_helper->json([$this->_user->getPaniersJson(),
(new Class_Catalogue())->getDomainesJson(),
(new Class_PanierNotice())->getPaniersAdminsNotInCatalogueJson()]);
}
}
\ No newline at end of file
- ticket #74838 : Correction de l'affichage des carrousels de documents.
\ No newline at end of file
......@@ -24,13 +24,24 @@ class Class_CompareUrl {
protected static $_request;
public static function isInRequestUrl($url) {
if(!$url)
return false;
if(!is_string($url))
return false;
if (!$request_path = static::getRequestPath())
return false;
if ('/' == $request_path)
return false;
return strpos($url, $request_path) !== false;
$pos = strpos($url, $request_path);
if(null === $pos)
return false;
return false !== $pos;
}
......
......@@ -24,7 +24,7 @@ class ZendAfi_Form_Element_DomainePanier extends ZendAfi_Form_Element_TreeSelect
public function __construct($spec, $options = null) {
$options = array_merge(['UrlDataSource' => Class_Url::assemble(['module' => 'admin',
'controller' => 'catalogue',
'action' => 'domaines-paniers']).'.json',
'action' => 'domaines-paniers-json']),
'MultipleSelection' => false,
'InputIdCategoriesName' => 'id_catalogue',
'InputIdItemsName' => 'id_panier',
......
......@@ -28,9 +28,6 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
/** @var Class_Systeme_ModulesMenu */
private $_cls_menu;
/** @var string */
private $_li_style;
private $path_ico;
......@@ -45,7 +42,6 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
public function getHtml() {
extract($this->preferences);
$menu = $this->preferences['menu'];
$menu_deplie = $this->preferences['menu_deplie'];
$afficher_titre = $this->preferences['afficher_titre'];
list($id_profil, $menu) = (false !== strpos($menu, Class_Systeme_ModulesMenu::MENU_CONFIG_PROFIL_SEPARATOR))
......@@ -60,9 +56,6 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
$this->_loadToggleMenuJsAndCss($toggle_menu);
$this->_cls_menu = new Class_Systeme_ModulesMenu();
$this->_li_style = sprintf('margin-left:20px;%s',
$menu_deplie ? '' : 'display:none;');
$id_profil = $profil->getId();
$menus = Class_Systeme_Widget_Menu::findAllAsArray($id_profil);
......@@ -82,7 +75,7 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
$contenu = $this->preferences['new_html']
? $this->_getContentHtml($config['menus'])
: $this->_getContentAsOldHtml($config);
: $this->_getContentAsOldHtml($config['menus']);
$this->titre = $titre;
$this->contenu = $contenu;
......@@ -419,22 +412,33 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
}
protected function _getContentAsOldHtml($config) {
$contenu = '<div class="menuGauche"><ul class="menuGauche">';
foreach ($config['menus'] as $key => $entree) {
$entree['id_module'] = $key;
$contenu .= $this->_getLigne($entree);
if (array_isset('sous_menus', $entree)) {
$sub_content = '';
foreach ($entree["sous_menus"] as $sub_key => $sous_menu) {
$sous_menu['id_module'] = $sub_key;
$sub_content .= $this->_getLigne($sous_menu);
}
$contenu .= $this->_subMenuLi($sub_content);
}
}
return $contenu .= '</ul></div>';
protected function _getContentAsOldHtml($entries) {
$content = [];
foreach($entries as $id => $entry)
$content [] = $this->_getEntryContent($id, $entry);
return $this->_tag('div',
$this->_tag('ul',
implode($content),
['class' => 'menuGauche']),
['class' => 'menuGauche']);
}
protected function _getEntryContent($id, $entry) {
$entry['id_module'] = $id;
$content = [$this->_getLigne($entry)];
if(!array_isset('sous_menus', $entry))
return implode($content);
$sub_content = [];
foreach($entry['sous_menus'] as $sub_id => $sub_entry)
$sub_content [] = $this->_getEntryContent($sub_id, $sub_entry);
$content [] = $this->_subMenuLi(implode($sub_content));
return implode(array_filter($content));
}
......@@ -466,8 +470,26 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
protected function _subMenuLi($sub_content) {
return $this->_tag('li',
$this->_tag('ul', $sub_content),
['class' => 'menuGauche', 'style' => $this->_li_style]);
if(!$sub_content)
return '';
$css = ['margin-left: 20px;'];
$css [] = $this->_isCollapsedMenu() ? 'display: none' : '';
return $sub_content
? $this->_tag('li',
$this->_tag('ul', $sub_content),
['class' => 'menuGauche',
'style' => implode($css)])
: '';
}
protected function _isCollapsedMenu() {
if(!isset($this->preferences['menu_deplie']))
return true;
return false == (boolean) $this->preferences['menu_deplie'];
}
}
......@@ -64,10 +64,6 @@ li.selected {font-weight: bold;}
.menu li img {margin: 0px 5px -2px 0px;}
.menu a {text-decoration:none}
/* Eléments qui sont redimensionnés en fonction de leur conteneur */
.auto_resize img, .auto_resize object, .auto_resize embed {
display:none;
}
/* Form */
......
......@@ -250,13 +250,6 @@ li.selected {
.menu a {
text-decoration: none}
/* Eléments qui sont redimensionnés en fonction de leur conteneur */
.auto_resize img,
.auto_resize object,
.auto_resize embed {
display: none;
}
/* Form */
.form {
background-color: #F0F0F0;
......
......@@ -9,12 +9,18 @@
vertical-align: top;
}
.ui-treeselect-items-tree,
.ui-treeselect-items-tree {
overflow-y: scroll;
}
.ui-treeselect-selected-items {
max-height: 300px;
overflow-y: auto;
overflow-y: scroll;
}
.ui-treeselect-items-tree ,
.ui-treeselect-selected-items {
max-height: 400px;
}
.ui-treeselect-items-tree {
width: 65%;
......@@ -64,7 +70,6 @@
}
.ui-treeselect li {
padding: 2px 0px 2px 0px;
list-style-type: none;
}
......@@ -73,12 +78,16 @@
}
.ui-treeselect-selected-items .hint {
float: right;
position: absolute;
margin-top: -5px;
margin-left: 50px;
padding: 10px;
width: 200px;
z-index: 1;
top: 28px;
left: -1px;
padding: 1ex 0.5em;
max-width: 200px;
overflow: hidden;
border: 1px solid !important;
border-radius: 5px;
background-color: #EEE;
}
.ui-treeselect-selected-items .hint li {
......@@ -96,14 +105,34 @@
.ui-treeselect-selected-items li {
padding: 0px;
display: block;
width: 100%;
}
.ui-treeselect-selected-items ul > li {
padding: 0.5ex 0.3em;
margin-bottom: 0.5ex;
border: 1px solid;
position: relative;
}
.ui-treeselect-selected-items li a {
padding: 5px 20px 5 px 5px;
margin-left: auto;
margin-right: auto;
display: block;
display: inline-block;
width: 85%;
background: none !important;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
border: none !important;
padding: 0;
white-space: nowrap;
}
.ui-treeselect-selected-items ul > li:last-child {
margin-bottom: 80px;
}
.ui-treeselect-selected-items li a img {
margin-right: 0.3em;
vertical-align: top;
}
......@@ -114,11 +143,10 @@
.remove_button {
background: url('remove.gif') no-repeat center center;
display: block;
width: 20px;
height: 20px;
float: right;
margin: -25px 5px 0px 0px;
display: inline-block;
width: 16px;
height: 16px;
vertical-align: top;
}
......
This diff is collapsed.
......@@ -26,8 +26,6 @@ a:visited{color:#0058A5; text-decoration:none;}
#site_web_content {float:left; width: 100%}
#right_col_color {float:left; width: 100%}
/* Eléments qui sont redimensionnés en fonction de leur conteneur */
.auto_resize img, .auto_resize object, .auto_resize embed {display:none;}
/* Footer */
.footer{width:1000px; min-height:40px; padding-top:5px}
......
......@@ -128,9 +128,7 @@ class WidgetControllerKiosqueTest extends WidgetControllerDispatchWidgetConfigur
/** @test */
public function domainesPaniersJsonUrlShouldResetActionParameters() {
$this->assertXPathContentContains('//script',
'getJSON("/admin/catalogue/domaines-paniers.json",',
$this->_response->getBody());
$this->assertXPathContentContains('//script', 'getJSON("/admin/catalogue/domaines-paniers-json",');
}
......
<?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 CompareUrlIsInRequestUrlTest extends ModelTestCase {
/** @test */
public function withWrongParamShouldReturnFalse() {
$this->assertFalse(Class_CompareUrl::isInRequestUrl([]));
}
}
\ No newline at end of file
......@@ -159,7 +159,7 @@ abstract class MenuVerticalWithManyItemsTestCase extends MenuVerticalTestCase {
/** @test */
function parentItemShouldHaveDisplayNone() {
$this->assertXPath($this->_html, '//ul/li[contains(@style, "display:none")]');
$this->assertXPath($this->_html, '//ul/li[contains(@style, "display: none")]');
}
......@@ -228,7 +228,7 @@ class MenuVerticalRssWithManyItemsTest extends MenuVerticalWithManyItemsTestCase
function withMenuDeplieOnShouldNotHaveDisplayNone() {
$this->helper->setPreference('menu_deplie', 1);
$this->_html = $this->helper->getBoite();
$this->assertNotXPath($this->_html, '//ul/li[contains(@style, "display:none")]');
$this->assertNotXPath($this->_html, '//ul/li[contains(@style, "display: none")]');
}
/** @test */
......
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