Skip to content
Snippets Groups Projects
Commit 85581613 authored by Patrick Barroca's avatar Patrick Barroca Committed by Patrick Barroca
Browse files

rel #21425: new critic box pref

parent 9cb4fd5e
Branches
Tags
4 merge requests!896Master,!893Master,!885Dev#21425 user comments by domains,!871Dev#21425 user comments by domains
<?php
Class_ScriptLoader::getInstance()
->addJQueryReady('
function toggleHierarchical() {
if ($("#hierarchical").is(":checked")) {
$(".non-hierarchical").hide();
$("#only_img").parents("tr").hide();
$("#id_panier").parents("tr").hide();
return;
}
$(".non-hierarchical").show();
$("#only_img").parents("tr").show();
$("#id_panier").parents("tr").show();
}
$("#hierarchical").change(toggleHierarchical);
toggleHierarchical();
');
?>
<center>
<h1>Propriétés du module : Dernières critiques</h1><br>
<h1>Propriétés du module : Critiques</h1><br>
<div class="formTable">
<form method="post" action="<?php echo $this->url ?>">
<form method="post" action="<?php echo $this->url; ?>">
<fieldset>
<legend>Affichage</legend>
<table cellspacing="2">
<tr>
<td class="droite">Titre du bloc&nbsp;</td>
<td class="gauche"><input type="text" name="titre" size="50" maxlength="60" value="<?php print($this->preferences["titre"]); ?>"></td>
</tr>
<tr>
<td class="droite">Style de boite&nbsp;</td>
<td class="gauche"><?php echo $this->combo_templates ?></td>
</tr>
</table>
<legend>Affichage</legend>
<table cellspacing="2">
<tr>
<td class="droite">Titre du bloc&nbsp;</td>
<td class="gauche"><input type="text" name="titre" size="50" maxlength="60" value="<?php print($this->preferences['titre']); ?>"></td>
</tr>
<tr>
<td class="droite">Style de boite&nbsp;</td>
<td class="gauche"><?php echo $this->combo_templates; ?></td>
</tr>
<tr>
<td class="droite">Proposer un fil Rss&nbsp;</td>
<td class="gauche">
<?php echo $this->formCheckbox('rss_avis',
$this->preferences['rss_avis'],
null,
['1', '0']); ?>
</td>
</tr>
</table>
</fieldset>
<br>
<fieldset>
<legend>Critiques</legend>
<table cellspacing="2">
<tr>
<td class="droite">Origine des critiques&nbsp;</td>
<td class="gauche">
<?php echo $this->formSelect("abon_ou_bib",$this->preferences["abon_ou_bib"],"",array("1" => "Bibliothécaire","0"=>"Abonné ou utilisateur du site","all" => "Tout le monde")) ?>
</td>
</tr>
<tr>
<td class="droite">Nombre à afficher&nbsp;</td>
<td class="gauche"><input type="text" name="nb_aff_avis" size="2" maxlength="2" value="<?php print($this->preferences["nb_aff_avis"]); ?>"></td>
</tr>
<tr>
<td class="droite">Ordre d'affichage&nbsp;</td>
<td class="gauche">
<?php
echo $this->formRadioButtons("display_order",
$this->preferences["display_order"],
array(
"CreationDesc" => "Par date de création (plus récent en premier)",
"Random" => "Aléatoire"));
?>
</td>
</tr>
<legend>Critiques</legend>
<table cellspacing="2">
<tr>
<td class="droite">Origine des critiques&nbsp;</td>
<td class="gauche">
<?php echo $this->formSelect('abon_ou_bib',
$this->preferences['abon_ou_bib'],
'',
['1' => 'Bibliothécaire',
'0' => 'Abonné ou utilisateur du site',
'all' => 'Tout le monde']); ?>
</td>
</tr>
<tr>
<td class="droite">Couper les critiques à&nbsp;</td>
<td class="gauche"><input type="text" name="nb_words" size="3" maxlength="3" value="<?php print($this->preferences["nb_words"]); ?>">mots</td>
</tr>
<tr>
<td class="droite">Proposer un fil Rss&nbsp;</td>
<td class="gauche">
<?php echo $this->formCheckbox('rss_avis',
$this->preferences['rss_avis'],
null,
array('1', '0')) ?>
</td>
</tr>
</table>
<tr>
<td class="droite">Navigation hiérarchique&nbsp;</td>
<td class="gauche">
<?php echo $this->formCheckbox('hierarchical',
$this->preferences['hierarchical'],
null,
['1', '0']); ?>
</td>
</tr>
<tr class="non-hierarchical">
<td class="droite">Nombre à afficher&nbsp;</td>
<td class="gauche"><input type="text" name="nb_aff_avis" size="2" maxlength="2" value="<?php print($this->preferences['nb_aff_avis']); ?>"></td>
</tr>
<tr class="non-hierarchical">
<td class="droite">Ordre d'affichage&nbsp;</td>
<td class="gauche">
<?php
echo $this->formRadioButtons('display_order',
$this->preferences['display_order'],
['CreationDesc' => 'Par date de création (plus récent en premier)',
'Random' => 'Aléatoire']);
?>
</td>
</tr>
<tr class="non-hierarchical">
<td class="droite">Couper les critiques à&nbsp;</td>
<td class="gauche"><input type="text" name="nb_words" size="3" maxlength="3" value="<?php print($this->preferences['nb_words']); ?>">mots</td>
</tr>
</table>
</fieldset>
<?php
echo $this->partial("accueil/_options_catalogue_panier.phtml",
array('preferences' => $this->preferences,
'catalogues' => $this->catalogues,
'paniers' => $this->paniers));
<?php
echo $this->partial('accueil/_options_catalogue_panier.phtml',
['preferences' => $this->preferences,
'catalogues' => $this->catalogues,
'paniers' => $this->paniers]);
?>
<?php echo $this->formSubmit("Valider","Valider",array("class" => "bouton")) ?>
</form>
</div>
<?php echo $this->formSubmit('Valider', 'Valider', ['class' => 'bouton']); ?>
</form>
</div>
</center>
......@@ -16,12 +16,12 @@
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesAccueil_Critiques extends Class_Systeme_ModulesAccueil_Null{
/** @var string */
protected $_group = Class_Systeme_ModulesAccueil::GROUP_INFO;
/** @var string */
protected $_libelle = 'Critiques';
......@@ -38,17 +38,17 @@ class Class_Systeme_ModulesAccueil_Critiques extends Class_Systeme_ModulesAccuei
protected $_isPhone = true;
/** @var array */
protected $_defaultValues = array(
'titre' => "Dernières critiques", // Titre du bloc critiques
'nb_aff_avis' => 2, // Nombre de critiques à afficher
'nb_words' => 30, // Couper les critiques à X mots
'display_order' => "Random", // Affichage par ordre aléatoire
'rss_avis' => "1", // Proposer le flux RSS
'only_img' => '1',
'id_panier' => 0,
'id_catalogue' => 0,
'abon_ou_bib' => 0,
'tri' => 0 //tri par titre
);
protected $_defaultValues = ['titre' => "Dernières critiques", // Titre du bloc critiques
'nb_aff_avis' => 2, // Nombre de critiques à afficher
'nb_words' => 30, // Couper les critiques à X mots
'display_order' => "Random", // Affichage par ordre aléatoire
'rss_avis' => "1", // Proposer le flux RSS
'only_img' => '1',
'id_panier' => 0,
'id_catalogue' => 0,
'abon_ou_bib' => 0,
'tri' => 0, //tri par titre
'hierarchical' => 0,
];
}
?>
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2014, 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_AccueilControllerCritiquesTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->onLoaderOfModel('Class_PanierNotice')
->whenCalled('findAllBelongsToAdmin')
->answers([]);
$this->dispatch('admin/accueil/critiques?config=accueil&id_profil=1&id_module=1&type_module=CRITIQUES',
true);
}
/** @test */
public function titleShouldBePresent() {
$this->assertXPathContentContains('//h1', 'Critiques');
}
/** @test */
public function boxTitleShouldBePresent() {
$this->assertXPath('//input[@name="titre"]');
}
/** @test */
public function styleShouldBePresent() {
$this->assertXPath('//select[@name="boite"]');
}
/** @test */
public function rssChoiceShouldBePresent() {
$this->assertXPath('//input[@type="checkbox"][@name="rss_avis"]');
}
/** @test */
public function originShouldBePresent() {
$this->assertXPath('//select[@name="abon_ou_bib"]');
}
/** @test */
public function hierarchicalChoiceShouldBePresent() {
$this->assertXPath('//input[@type="checkbox"][@name="hierarchical"]');
}
/** @test */
public function displayCountShouldBePresent() {
$this->assertXPath('//input[@name="nb_aff_avis"]');
}
/** @test */
public function displayOrderShouldBePresent() {
$this->assertXPath('//input[@type="radio"][@name="display_order"]');
}
/** @test */
public function contentCutShouldBePresent() {
$this->assertXPath('//input[@name="nb_words"]');
}
/** @test */
public function thumbsChoiceShouldBePresent() {
$this->assertXPath('//select[@name="only_img"]');
}
/** @test */
public function domainsShouldBePresent() {
$this->assertXPath('//select[@name="id_catalogue"]');
}
/** @test */
public function basketsShouldBePresent() {
$this->assertXPath('//select[@name="id_panier"]');
}
/** @test */
public function submitShouldBePresent() {
$this->assertXPath('//input[@type="submit"][@name="Valider"]');
}
}
\ No newline at end of file
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