Skip to content

Instantly share code, notes, and snippets.

View xmorave2's full-sized avatar

Josef Moravec xmorave2

View GitHub Profile
@xmorave2
xmorave2 / Authority-relink-by-list.sh
Created December 9, 2019 09:50
Authority relink podle seznamu
SELECT b.title,
ExtractValue(bm.metadata, '//datafield[@tag="787"]/subfield[@code="t"]') AS 787t,
ExtractValue(bm.metadata, '//datafield[@tag="787"]/subfield[@code="g"]') AS 787g,
CONCAT_WS("", "<a class='btn btn-default btn-xs' href='/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=", b.biblionumber, "'><i class='fa fa-pencil'></i> Upravit záznam</a>") as Upravit
FROM biblio b
JOIN biblio_metadata bm ON b.biblionumber = bm.biblionumber
WHERE ExtractValue(bm.metadata, '//datafield[@tag="787"]/subfield[@code="t"]') != ''
AND ExtractValue(bm.metadata, '//datafield[@tag="787"]/subfield[@code="g"]') NOT REGEXP '^[[:digit:] ]+$'
ORDER BY 787g DESC
[% USE ItemTypes %]
[% BLOCK detail %]
<p style="font-size: 1.1em; border-bottom: 1px solid black;">
[% IF checkout.item.biblio.author %]<i>[% checkout.item.biblio.author | $Remove_MARC_punctuation %]</i>:[% END %]
<strong>[% checkout.item.biblio.title | $Remove_MARC_punctuation %]</strong>
[% record = checkout.item.biblio.metadata.record %]
[% field787 = record.field('787') %]
[% IF field787 %].
[% field787.subfield('t') %] [% field787.subfield('g') %].
[% END %]
@xmorave2
xmorave2 / blocked-bots.conf
Last active April 4, 2024 11:53
Block bots
BrowserMatchNoCase "360Spider" bots
BrowserMatchNoCase "80legs" bots
BrowserMatchNoCase "Abonti" bots
BrowserMatchNoCase "Aboundex" bots
BrowserMatchNoCase "AcoonBot" bots
BrowserMatchNoCase "Acunetix" bots
BrowserMatchNoCase "adbeat_bot" bots
BrowserMatchNoCase "AddThis.com" bots
BrowserMatchNoCase "adidxbot" bots
BrowserMatchNoCase "ADmantX" bots
@xmorave2
xmorave2 / 100a.sql
Created January 24, 2022 09:57
Chybně datum v $a v autoritách
SELECT
CONCAT('<a href=\"/cgi-bin/koha/authorities/detail.pl?authid=', authid, '\">', authid, '</a>' ) AS authid, ExtractValue(marcxml,'//datafield[@tag="100"]/subfield[@code="a"]') as podpoleA
FROM auth_header
HAVING podpoleA REGEXP '[0-9]'
@xmorave2
xmorave2 / Koha-Cs-Lang-update-from-server.sh
Last active May 5, 2022 07:43
Update koha language from translate.koha-community.org into current installation
#!/bin/bash
cd /usr/share/koha/misc/translator/po
rm cs-CZ*
wget http://translate.koha-community.org/download/cs/316/cs-CZ-i-opac-t-prog-v-3006000.po
wget http://translate.koha-community.org/download/cs/316/cs-CZ-i-staff-t-prog-v-3006000.po
wget http://translate.koha-community.org/download/cs/316/cs-CZ-opac-ccsr.po
wget http://translate.koha-community.org/download/cs/316/cs-CZ-opac-bootstrap.po
wget http://translate.koha-community.org/download/cs/316/cs-CZ-staff-help.po
wget http://translate.koha-community.org/download/cs/316/cs-CZ-pref.po
koha-translate -u cs-CZ