Skip to content
Snippets Groups Projects
Commit a553ebb9 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

rel #17078: added redirect profile in kiosk settings

parent 90e98318
Branches
Tags
5 merge requests!545Master,!544Master,!543Master,!538Dev#17078 view record in specific profile,!532Dev#17078 view record in specific profile
<center>
<h1>Propriétés du Kiosque de notices</h1><br>
<h1><?php echo $this->_('Propriétés du Kiosque de notices');?></h1><br>
<div class="formTable">
<form class="domaines" method="post" action="<?php echo $this->url ?>">
<fieldset>
<legend>Affichage</legend>
<table cellspacing="2">
<tr>
<td class="droite">Style de boite&nbsp;</td>
<td class="gauche"><?php echo $this->combo_templates ?></td>
</tr>
<tr>
<td class="droite" valign="top">Style de représentation&nbsp;</td>
<td class="gauche"><?php echo $this->TagObjetsImgProperties($this->styles_liste,$this->preferences)?></td>
</tr>
<tr>
<td class="droite">Basculer automatiquement sur le profil:&nbsp;</td>
<td class="gauche">
<?php
$this->getHelper('ComboProfils')
->setTagId('profil_redirect')
->setTagName('profil_redirect')
->addEmptyOption();
echo $this->ComboProfils('ALL', 'ALL', $this->preferences['profil_redirect']);
?>
</td>
</tr>
<tr>
<td class="droite">Titre de la boite&nbsp;</td>
<td class="gauche"><input type="text" name="titre" size="50" value="<?php print($this->preferences["titre"]); ?>"></td>
......@@ -26,20 +39,20 @@
<tr>
<td class="droite">Proposer un fil Rss&nbsp;</td>
<td class="gauche">
<?php echo $this->formCheckbox('rss_avis',
$this->preferences['rss_avis'],
null,
<?php echo $this->formCheckbox('rss_avis',
$this->preferences['rss_avis'],
null,
array('1', '0')) ?>
</td>
</tr>
</table>
</fieldset>
<br>
<fieldset>
<legend>Type d'analyse</legend>
<table cellspacing="2">
<tr>
<td class="droite" width="40%">Tirage aléatoire&nbsp;</td>
<td class="gauche"><?php echo $this->formSelect("aleatoire",$this->preferences["aleatoire"],"",array("0" => "non","1"=>"oui")) ?></td>
......@@ -55,15 +68,15 @@
<?php echo $this->formSelect("tri",$this->preferences["tri"],"",array("0" => "par ordre alphabétique","1"=>"par date de nouveauté","2"=>"par nombre de visualisations", "3" => "par date de publication")) ?>
</td>
</tr>
<tr>
<td class="droite">Nombre à afficher&nbsp;</td>
<td class="gauche">
<input type="text" name="nb_notices" size="2" maxlength="2"
<input type="text" name="nb_notices" size="2" maxlength="2"
value="<?php print($this->preferences["nb_notices"]); ?>">
<span id="nb_analyse_option" style="display:none">
parmi les
<input type="text" name="nb_analyse" size="2" maxlength="3"
<input type="text" name="nb_analyse" size="2" maxlength="3"
value="<?php print($this->preferences["nb_analyse"]); ?>">
premières
</span>
......@@ -77,19 +90,18 @@
"",
["0" => "Afficher le titre dans une image",
"1" => "Afficher les notices avec vignettes uniquement"]) ?></td>
</tr>
</tr>
</table>
</fieldset>
<br />
<?php
echo $this->partial("/modules/_options_domaines_paniers.phtml",
['preferences' => $this->preferences]);
<?php
echo $this->partial('/modules/_options_domaines_paniers.phtml',
['preferences' => $this->preferences]);
?>
<?php echo $this->formSubmit("","Valider",array("class" => "bouton")) ?>
<?php echo $this->formSubmit('', $this->_('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 AFI-OPAC 2.0; 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_Kiosque extends Class_Systeme_ModulesAccueil_Null{
/** @var string */
protected $_group = Class_Systeme_ModulesAccueil::GROUP_RECH;
/** @var string */
protected $_libelle = 'Kiosque de notices';
......@@ -38,22 +38,23 @@ class Class_Systeme_ModulesAccueil_Kiosque extends Class_Systeme_ModulesAccueil_
protected $_isPhone = true;
/** @var array */
protected $_defaultValues = array(
'titre' => "Kiosque", // Titre de la boite
'style_liste' => "slide_show", // Style de representation (objets flash ou js)
'nb_notices' => 20, // Nombre de notices a afficher
'only_img' => 1, // Notices avec vignettes
'aleatoire' => 1, // 0=non,1=oui
'tri' => 1, // 0=alpha,1=par date de creation,2=les plus consultées
'nb_analyse' => 50, // nbre a analyser pour le mode aleatoire
'op_hauteur_img' => 0, // hauteur des vignettes
'op_transition' => '', //type de transition pour le diaporama
'op_largeur_img' => 0, //largeur des vignettes
'op_auto' => 0, // Animation (0 = aucune)
'op_scroll' => 1, // Défilement (1 = image par image)
'rss_avis' => 1, // afficher les RSS
'id_catalogue' => 0,
'id_panier' => 0
);
protected $_defaultValues =
['titre' => "Kiosque", // Titre de la boite
'style_liste' => "slide_show", // Style de representation (objets flash ou js)
'nb_notices' => 20, // Nombre de notices a afficher
'only_img' => 1, // Notices avec vignettes
'aleatoire' => 1, // 0=non,1=oui
'tri' => 1, // 0=alpha,1=par date de creation,2=les plus consultées
'nb_analyse' => 50, // nbre a analyser pour le mode aleatoire
'op_hauteur_img' => 0, // hauteur des vignettes
'op_transition' => '', //type de transition pour le diaporama
'op_largeur_img' => 0, //largeur des vignettes
'op_auto' => 0, // Animation (0 = aucune)
'op_scroll' => 1, // Défilement (1 = image par image)
'rss_avis' => 1, // afficher les RSS
'id_catalogue' => 0,
'id_panier' => 0,
'profil_redirect' => '', // affiche les notices dans ce profil
];
}
?>
\ No newline at end of file
......@@ -700,8 +700,13 @@ class AccueilControllerPostConfigBoiteKiosqueProfilLognesTestCase extends Admin_
'id_module' => 32,
'preferences' => []])
->setIdSite(3);
$this->postDispatch('/admin/accueil/kiosque?config=accueil&type_module=KIOSQUE&id_module=32',
['id_panier'=>'5','titre' => 'titre du /kiosque']);
['id_panier'=>'5',
'titre' => 'titre du /kiosque',
'profil_redirect' => '12']);
$this->preferences = Class_Profil::getCurrentProfil()->getModuleAccueilConfig(32, 'KIOSQUE')['preferences'];
}
/** @test **/
......@@ -709,9 +714,16 @@ class AccueilControllerPostConfigBoiteKiosqueProfilLognesTestCase extends Admin_
$this->assertXPath('//script');
}
/** @test */
public function titleShouldBeTitreDuKiosque() {
$this->assertEquals('titre du /kiosque', Class_Profil::getCurrentProfil()->getModuleAccueilConfig(32, 'KIOSQUE')['preferences']['titre']);
$this->assertEquals('titre du /kiosque', $this->preferences['titre']);
}
/** @test */
public function profilRedirectShouldBeTwelve() {
$this->assertEquals('12', $this->preferences['profil_redirect']);
}
}
......@@ -750,7 +762,7 @@ class AccueilControllerConfigBoiteKiosqueProfilLognesAsAdminPortailTest extends
}
/** @test **/
public function testConfigPageShouldDisableMultipleSelection() {
public function configPageShouldDisableMultipleSelection() {
$this->assertXPath('//script[contains(@src, "treeselect")]', $this->_response->getBody());
}
......@@ -793,6 +805,7 @@ class AccueilControllerConfigBoiteKiosqueProfilLognesAsAdminPortailTest extends
$this->assertXPathContentContains('//select[@name="style_liste"]//option[@value="mur"]', 'Mur');
}
/** @test */
public function selectStyleListeShouldContainsOptGroupObjetsHTMLChrono() {
$this->assertXPathContentContains('//select[@name="style_liste"]//option[@value="chrono"]', 'Frise');
......@@ -804,6 +817,18 @@ class AccueilControllerConfigBoiteKiosqueProfilLognesAsAdminPortailTest extends
$this->assertXPathContentContains('//select[@name="only_img"]/option[@value="1"][@selected="selected"]',
'Afficher les notices avec vignettes uniquement');
}
/** @test */
public function profilRedirectShouldBePresent() {
$this->assertXPath('//select[@name="profil_redirect"]');
}
/** @test */
public function noProfilRedirectShouldBeSelected() {
$this->assertNotXPath('//select[@name="profil_redirect"]//option[@selected]');
}
}
......
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