Skip to content
Snippets Groups Projects
Commit 4e6820e8 authored by Matthias Meusburger's avatar Matthias Meusburger
Browse files

hotline#20350_show_price : Add price to record's details (based on unimarc field 010$d).

parent a00c347f
Branches
Tags
4 merge requests!715Master,!664report fix from stable to wip,!663Stable,!658Hotline#20350 show price
- ticket : #20350
- Ajout du prix dans les détails d'une notice en se basant sur le champ unimarc 010$d
\ No newline at end of file
......@@ -38,7 +38,7 @@
* N: année
* O: notes
* P: pcdm4
* Q:
* Q: prix
* R: résumé
* S: section
* T: type de doc
......@@ -54,7 +54,7 @@
class Class_Codification {
use Trait_Singleton, Trait_Translator;
const
CHAMPS = 'JAKEFCNMDGHPILOR8',
CHAMPS = 'JAKEFCNMDGHPILOR8Q',
CODE_COLLECTION = 'C',
CODE_EDITEUR = 'E',
CODE_IDENTIFIANT = 'I',
......@@ -62,6 +62,7 @@ class Class_Codification {
CODE_COLLATION = 'K',
CODE_ANNEE = 'N',
CODE_NOTES = 'O',
CODE_PRIX = 'Q',
CODE_RESUME = 'R',
CODE_URL = '8',
CODE_NOUVEAUTE = '9',
......@@ -178,7 +179,8 @@ class Class_Codification {
Class_CodifTags::CODE_FACETTE => [ $this->_("Tag"), $this->_("Tag(s)")],
Class_Codification::CODE_URL => [ $this->_("Lien internet"), $this->_("Liens internet")],
Class_Codification::CODE_AVAILABILITY => [ $this->_("En rayon"), $this->_("En rayon")],
Class_Codification::CODE_NOUVEAUTE => [ $this->_("Nouveauté"), $this->_("Nouveauté")]];
Class_Codification::CODE_NOUVEAUTE => [ $this->_("Nouveauté"), $this->_("Nouveauté")],
Class_Codification::CODE_PRIX => [ $this->_("Prix"), $this->_("Prix")]];
$this->addThesauriToNomChamps();
$this->setFacetDisplayNames();
......
......@@ -621,6 +621,7 @@ class Class_Notice extends Storm_Model_Abstract {
case Class_Codification::CODE_RESUME: return $this->getResume();
case Class_Codification::CODE_URL: return $this->getUrls();
case Class_Codification::CODE_ANNEE: return $this->getAnnee();
case Class_Codification::CODE_PRIX: return $this->getPrix();
case Class_Codification::CODE_IDENTIFIANT: return (new Class_Isbn($this->getIsbnOrEan()))->getAll()['isbn10'];
case Class_Codification::CODE_NOUVEAUTE: return $this->isNouveaute() ? $this->_('Oui'): $this->_('Non');
}
......@@ -633,7 +634,9 @@ class Class_Notice extends Storm_Model_Abstract {
return (new Class_Notice_Urls($this))->asArray();
}
public function getPrix() {
return $this->get_subfield("010", "d");
}
public function hasTome() {
if ($data = $this->get_subfield("461", "t")
......
......@@ -121,6 +121,10 @@ class NoticeAjaxControllerNoticeWithCustomLinks extends AbstractControllerTestCa
$this->dispatch('/opac/noticeajax/detail/id_notice/999', true);
}
/** @test */
public function detailsShouldContainPrice() {
$this->assertXPathContentContains('//dt[contains(@class, "prix")]/following-sibling::dd', '18,80');
}
/** @test */
public function linkToPageDesLibrairesFrShouldBePresent() {
......
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