Skip to content

Instantly share code, notes, and snippets.

View xmorave2's full-sized avatar

Josef Moravec xmorave2

View GitHub Profile
@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
@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 / 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
[% 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 %]
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
@xmorave2
xmorave2 / Authority-relink-by-list.sh
Created December 9, 2019 09:50
Authority relink podle seznamu
@xmorave2
xmorave2 / notifies.sql
Created November 19, 2019 06:32
Notifies on holds from another partrons
INSERT INTO borrower_message_preferences (borrowernumber, message_attribute_id, days_in_advance) SELECT borrowernumber, 7 AS message_attribute_id, NULL AS days_in_advance FROM borrowers;
INSERT INTO borrower_message_transport_preferences (borrower_message_preference_id, message_transport_type) SELECT borrower_message_preference_id, "email" AS message_transport_type FROM borrower_message_preferences WHERE message_attribute_id = 7 AND borrowernumber IS NOT NULL
@xmorave2
xmorave2 / obalkyknih.css
Created October 10, 2019 09:21
Obálky knih intranet Koha
#cover_obalkyknih, #catalogue_detail_biblio {
float:left;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
@xmorave2
xmorave2 / auth-val.txt
Created May 29, 2019 07:33
MVS výstupy
ověřená hodnota v kategorii WITHDRAWN:
11 = Zrušená MVS