Skip to content

Instantly share code, notes, and snippets.

View xmorave2's full-sized avatar

Josef Moravec xmorave2

View GitHub Profile
@xmorave2
xmorave2 / intranetusercss
Last active July 3, 2019 07:36
Obálky knih v intranetu Kohy
#cover_obalkyknih, #catalogue_detail_biblio {
float:left;
}
#cover_obalkyknih {
margin-right: 10px;
margin-top: 5px;
}
@xmorave2
xmorave2 / config.xml
Created July 17, 2017 10:43
Config pro shell oai harvester
<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns="http://github.com/wimmuskee/shell-harvester/">
<!-- default record save location -->
<recordpath>/root/shell-oaiharvester/harvested</recordpath>
<!-- temporary files are stored here -->
<temppath>/tmp/shell-oaiharvester</temppath>
<!-- location of log file -->
<logfile>/root/shell-oaiharvester/oaiharvester-log.csv</logfile>
<!-- type of logging:
"combined" putting all instance logs in one file (default), or
@xmorave2
xmorave2 / SolrMarc.php
Last active May 26, 2017 09:03
Série - 787 vufind:
public function getSerie()
{
$ret = [];
$fields = $this->getMarcRecord()->getFields('787');
foreach ($fields as $field) {
if (strpos($field->getSubfield('i')->getData(), 'Z cyklu') !== false) {
$subfield_g = $field->getSubfield('g');
$subfield_t = $field->getSubfield('t');
$ret[] = [
@xmorave2
xmorave2 / holdingsils.phtml
Created April 24, 2017 11:02
Výzva k přihlášení pro rezervaci
<?php // templates/RecordTab/holdingsils.phtml ?>
<? if (count($holdings)): ?>
<? if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings)) || $this->ils()->getTitleHoldsMode() == 'driver'): ?>
<? if ($account->loginEnabled() && $offlineMode != 'ils-offline'): ?>
<? if (!$user): ?>
<div class="alert alert-info">
<?=$this->translate("hold_profile_html2", array('%%url%%' => $this->currentPath() . '?catalogLogin=true'))?>
</div>
<? elseif (!$user->cat_username): ?>
/* predvyplneni formulare v editaci dosleho periodika */
/* set item type for newspaper */
$("#ser_serials-edit #serials_edit input[name='subscriptionid'][value='4'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='5'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='6'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='7'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='8'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='9']").parent().find("[id^='subfield'][id$='y'] select").first().val("NO");
/* set human readable date to text date field for newspaper */
today = new Date();
todayHuman = today.getDate() + '. ' + (today.getMonth() + 1) + '. ' + today.getFullYear();
$("#ser_serials-edit #serials_edit input[name='subscriptionid'][value='4'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='5'], #ser_serials-edit #serials_edit input[name='subscriptionid'][value='6'], #ser_serials-
@xmorave2
xmorave2 / schema.xml
Last active September 27, 2016 10:47
Stahování Zákony pro lidi
<!-- rozšíření schématu solru o specifické pole -
pro funkčnost není nutné, ale pokud se nepoužije, je třeba odpovídajícím
způsobem upravit šablonu
-->
<!-- Zakony pro lidi -->
<field name="law_doctype" type="string" indexed="true" stored="true" multiValued="true"/>
@xmorave2
xmorave2 / marc_local.properties
Created August 8, 2016 07:18
Skrytí odepsaných záznamů ve VuFindu
# /usr/local/vufind2/local/import/marc_local.properties
withdrawn_status = 9930
UPDATE biblio b JOIN biblioitems bi ON b.biblionumber = bi.biblionumber
SET b.copyrightdate = SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ExtractValue(bi.marcxml, '//datafield[@tag="264"]/subfield[@code="c"]'), "[", ""), "]", ""), "?", ""), "c", ""), "©", ""), "℗", ""), -4)
WHERE copyrightdate IS NULL AND frameworkcode = "KN";
SELECT b.frameworkcode, b.biblionumber, b.copyrightdate,
SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ExtractValue(bi.marcxml, '//datafield[@tag="264"]/subfield[@code="c"]'), "[", ""), "]", ""), "?", ""), "c", ""), "©", ""),"℗", ""), -4) as year
FROM biblio b JOIN biblioitems bi ON b.biblionumber = bi.biblionumber
WHERE copyrightdate IS NULL
LIMIT 10;
SELECT i.itype, i.ccode,
(SELECT COUNT(*) FROM items i2 WHERE i2.dateaccessioned < @From AND i2.homebranch = @Library AND i2.ccode = i.ccode) AS "Počátek",
COUNT(*) AS "Přírůstek",
(SELECT COUNT(*) FROM items i3 WHERE i3.withdrawn_on BETWEEN @From AND @To AND i3.homebranch = @Library AND i3.ccode = i.ccode) AS "Úbytek",
(SELECT COUNT(*) FROM items i4 WHERE i4.dateaccessioned <= @To AND i4.homebranch = @Library AND i4.ccode = i.ccode) AS Konec
FROM items i
JOIN (SELECT @Library:=<<Knihovna|branches>> COLLATE utf8_unicode_ci, @From:=<<Od|date>>, @To:=<<Do|date>>) as vars
WHERE i.homebranch = @Library
AND i.dateaccessioned BETWEEN @From AND @To
GROUP BY i.itype, i.ccode
@xmorave2
xmorave2 / openrefineCtenari.json
Last active October 30, 2019 12:24
Předpis pro undo/redo funkci openerefine pro vyladění čtenářských záznamů pro import do Kohy
[
{
"op": "core/column-split",
"description": "Split column rcislo by field lengths",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "rcislo",
"guessCellType": true,