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

rel #12794 : added analytics fields parameters in record view configuration screen

parent 87976c59
Branches
Tags
4 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!93Master,!88Hotline 6.41,!85Hotline#12794 Display 464 Periodicals Title Authors
......@@ -248,6 +248,11 @@ class Admin_ModulesController extends ZendAfi_Controller_Action {
continue;
}
if ('analytics_' == substr($clef, 0, 10)) {
$enreg[$clef] = $valeur;
continue;
}
$type = substr($clef, 0, $pos);
$champ = substr($clef, $pos + 1);
......
......@@ -40,6 +40,24 @@ echo $this->tagSelectionChamps('libelles').NL;
</table>
</fieldset>
<fieldset>
<legend><?php echo $this->_('Dépouillements');?></legend>
<table cellspacing="2">
<tr>
<td class="droite" valign="top"><?php echo $this->_('Zone');?>&nbsp;</td>
<td class="gauche"><input type="text" name="analytics" value="<?php echo $this->preferences['analytics']; ?>"></td>
</tr>
<tr>
<td class="droite" valign="top"><?php echo $this->_('Sous-zone de titre');?>&nbsp;</td>
<td class="gauche"><input type="text" name="analytics_title" value="<?php echo $this->preferences['analytics_title']; ?>"></td>
</tr>
<tr>
<td class="droite" valign="top"><?php echo $this->_('Sous-zones d\'auteurs<br>(séparées par des ";")');?>&nbsp;</td>
<td class="gauche"><input type="text" name="analytics_authors" value="<?php echo $this->preferences['analytics_authors']; ?>"></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $this->_('Onglets et blocs');?></legend>
<table cellspacing="2">
......
......@@ -325,18 +325,25 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract {
$ret["cvs_msg_droit"] = "Merci de contacter la médiathèque pour obtenir un accès.";
$ret["suggestion_achat"] = 1; // Afficher le lien "Suggérer un achat"
$ret["zones_titre"] = '200$e;200$h;200$i'; // Liste des zones de titre à afficher dans le résultat: exemple: 200$e;400$t
break;
case "viewnotice":
$ret["barre_nav"] = "Notice"; // Barre de nav
$ret["entete"] = "ECN"; // Champs a afficher dans l'entete
$onglets = Class_Codification::getInstance()->getNomOnglet(""); // On prend tous les onglets dispo
case 'viewnotice':
$ret = ['barre_nav' => 'Notice', // Barre de nav
'entete' => 'ECN', // Champs a afficher dans l'entete
'analytics' => '',
'analytics_title' => '',
'analytics_authors' => ''];
$onglets = Class_Codification::getInstance()->getNomOnglet(''); // On prend tous les onglets dispo
$ordre = 0;
foreach ($onglets as $key => $valeur) {
$ret["onglets"][$key]["titre"] = ""; // Prend le nom de l'onglet par défaut
$ret["onglets"][$key]["aff"] = 2; // Mode d'affichage 0=aucun 1=bloc déplié 2=bloc fermé 3=dans 1 onglet
$ret["onglets"][$key]["ordre"] = ++$ordre; // Ordre d'affichage
$ret["onglets"][$key]["largeur"] = 0; // Largeur de l'onglet 0=répartition auto en pourcentage
$onglet = [
'titre' => '', // Prend le nom de l'onglet par défaut
'aff' => 2, // Mode d'affichage 0=aucun 1=bloc déplié 2=bloc fermé 3=dans 1 onglet
'ordre' => ++$ordre, // Ordre d'affichage
'largeur' => 0, // Largeur de l'onglet 0=répartition auto en pourcentage
];
$ret[$key] = $onglet;
}
break;
......
......@@ -51,6 +51,30 @@ class ModulesControllerRechercheTest extends Admin_AbstractControllerTestCase {
public function nouveauteShouldBePresent() {
$this->assertXPathContentContains('//td', 'Nouveauté');
}
/** @test */
public function shouldContainsAnalyticsFieldset() {
$this->assertXPathContentContains('//fieldset/legend', 'Dépouillements');
}
/** @test */
public function shouldContainsAnalyticsField() {
$this->assertXPath('//input[@name="analytics"]');
}
/** @test */
public function shouldContainsAnalyticsTitleField() {
$this->assertXPath('//input[@name="analytics_title"]');
}
/** @test */
public function shouldContainsAnalyticsAuthorsField() {
$this->assertXPath('//input[@name="analytics_authors"]');
}
}
......@@ -62,6 +86,9 @@ class ModulesControllerRecherchePostTest extends Admin_AbstractControllerTestCas
$this->postDispatch('/admin/modules/recherche?config=site&type_module=recherche&id_profil=2&action1=viewnotice&action2=1',
['boite' => 'testing_box_of_the_doom',
'champs_codes' => 'ECNA',
'analytics' => '464',
'analytics_title' => 'a',
'analytics_authors' => 'f',
'detail_aff' => '1',
'detail_ordre' => '1',
'detail_titre' => 'Notice détaillée',
......@@ -142,6 +169,24 @@ class ModulesControllerRecherchePostTest extends Admin_AbstractControllerTestCas
public function enteteShouldBeECNA() {
$this->assertEquals('ECNA', $this->viewnotice_pref['entete']);
}
/** @test */
public function analyticsShouldBe464() {
$this->assertEquals('464', $this->viewnotice_pref['analytics']);
}
/** @test */
public function analyticsTitleShouldBeA() {
$this->assertEquals('a', $this->viewnotice_pref['analytics_title']);
}
/** @test */
public function analyticsAuthorsShouldBeF() {
$this->assertEquals('f', $this->viewnotice_pref['analytics_authors']);
}
}
......@@ -157,8 +202,6 @@ class ModulesControllerVariousConfigTest extends Admin_AbstractControllerTestCas
public function modulesAuthBoiteLoginShouldNotFail() {
$this->assertAction('auth');
}
}
......
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