Last active
October 13, 2017 10:37
-
-
Save xmorave2/cf6dbfcd65cfce215366644343bdd1d7 to your computer and use it in GitHub Desktop.
Dílovky VuFind
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? // Pro VuFind 2.x, 3.x ?> | |
| <? $serie = $this->driver->getSerie();?> | |
| <? if (!empty($serie)): ?> | |
| <tr> | |
| <th><?=$this->transEsc('Serie')?>: </th> | |
| <td> | |
| <? foreach($serie as $s): ?> | |
| <a href="<?=$this->record($this->driver)->getLink('series787', $s["title"])?>"><?=$s["title"]?></a><? echo ", " . $this->translate("part") . " " . $s["part"] ?><br/> | |
| <? endforeach; ?> | |
| </td> | |
| </tr> | |
| <? endif; ?> | |
| <? // Pro VuFind 4.x upravte následující sekci, aby vypadala takto: ?> | |
| <?/* Display Main Details */?> | |
| <? | |
| $formatter = $this->recordDataFormatter(); | |
| $specs = $formatter->getDefaults('core'); | |
| $specs["Serie"] = [ | |
| "dataMethod" => "getSerie", | |
| "pos" => 50, | |
| "renderType" => "RecordDriverTemplate", | |
| "template" => "data-series787.phtml", | |
| ]; | |
| $coreFields = $formatter->getData($driver, $specs); | |
| ?> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| part = "část" | |
| Serie = "Série" | |
| series_number = "Pořadí v sérii" | |
| Serie Name = "Název série" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| themes/<your_theme>/templates/RecordDriver/SolrMarc/data-series787.phtml | |
| */ | |
| ?> | |
| <? foreach($data as $field): ?> | |
| <a href="<?=$this->record($this->driver)->getLink('series787', $field["title"])?>"><?=$this->escapeHtml($field["title"])?></a>, | |
| <?=$this->translate("part")?> <?=$field["part"]?><br/> | |
| <? endforeach; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| themes/<your_theme>/templates/RecordDriver/SolrMarc/link-series787.phtml | |
| */ | |
| ?> | |
| <?=$this->url('search-results')?>?lookfor=%22<?=urlencode($this->lookfor)?>%22&type=Series787 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Vufind 2.x a 3.x | |
| series787 = 787t | |
| series787_sort = 787g, first | |
| # VuFind 4.x - přesněji | |
| series787 = 787t?($i == "Z cyklu:") | |
| series787_sort = 787g?($i == "Z cyklu:"), first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? $serie = $this->driver->getSerie();?> | |
| <? if (!empty($serie)): ?> | |
| <? foreach($serie as $s): ?> | |
| <br/><?=$this->transEsc('Serie')?>: <a href="<?=$this->record($this->driver)->getLink('series787', $s["title"])?>"><?=$s["title"]?></a><? echo ", " . $this->translate("part") . " " . $s["part"] ?> | |
| <? endforeach; ?> | |
| <? endif; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <types> | |
| ... | |
| <fieldType name="integer" class="solr.TrieIntField" precisionStep="0"/> | |
| ... | |
| </types> | |
| <fields> | |
| ... | |
| <!-- Série - dílovky --> | |
| <field name="series787" type="text" indexed="true" stored="true" multiValued="true"/> | |
| <field name="series787_sort" type="integer" indexed="true" stored="true"/> | |
| ... | |
| </fields> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Basic_Searches] | |
| ... | |
| Series787 = "Serie Name" | |
| [Sorting] | |
| ... | |
| series787_sort = series_number | |
| [DefaultSortingByType] | |
| ... | |
| Series787 = series787_sort | |
| [Autocomplete_Types] | |
| ... | |
| Series787 = "Solr:Series787:series787" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Series787: | |
| DismaxFields: | |
| - series787 | |
| QueryFields: | |
| series787: | |
| - [onephrase, 50] | |
| - [and, 50] | |
| - [or, ~] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function getSerie() | |
| { | |
| $ret = []; | |
| $fields = $this->getMarcRecord()->getFields('787'); | |
| foreach ($fields as $field) { | |
| if ($subfield_i = $field->getSubfield('i')) { | |
| if (strpos($subfield_i->getData(), 'Z cyklu') !== false) { | |
| $subfield_g = $field->getSubfield('g'); | |
| $subfield_t = $field->getSubfield('t'); | |
| $ret[] = [ | |
| "title" => $subfield_t ? $subfield_t->getData() : false, | |
| "part" => $subfield_g ? $subfield_g->getData() : false, | |
| ]; | |
| } | |
| } | |
| } | |
| return $ret; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment