Skip to content

Instantly share code, notes, and snippets.

View xmorave2's full-sized avatar

Josef Moravec xmorave2

View GitHub Profile
@xmorave2
xmorave2 / plack-error.log
Created March 12, 2018 14:53
Error log když se nepodaří přes svc api prodloužit výpůjčku
Can't call method "contains" on unblessed reference at /usr/share/koha/lib/Koha/Calendar.pm line 243.
at /usr/share/koha/intranet/cgi-bin/circ/returns.pl line 34.
CGI::Compile::ROOT::usr_share_koha_intranet_cgi_2dbin_circ_returns_2epl::__ANON__("Can't call method \"contains\" on unblessed reference at /usr/s"...) called at /usr/share/koha/lib/Koha/Calendar.pm line 243
Koha::Calendar::is_holiday(Koha::Calendar=HASH(0xe53d5d0), DateTime=HASH(0xe3eb370)) called at /usr/share/koha/lib/Koha/Calendar.pm line 217
Koha::Calendar::addDays(Koha::Calendar=HASH(0xe53d5d0), DateTime=HASH(0xe44d298), DateTime::Duration=HASH(0xe521fe8)) called at /usr/share/koha/lib/Koha/Calendar.pm line 155
Koha::Calendar::addDate(Koha::Calendar=HASH(0xe53d5d0), DateTime=HASH(0xe44d298), DateTime::Duration=HASH(0xe521fe8), "days") called at /usr/share/koha/lib/C4/Circulation.pm line 3592
C4::Circulation::CalcDateDue(DateTime=HASH(0xe6cf488), "KN", "DOSP", HASH(0xcfc9fe0), "is a renewal", "", DateTime=HASH(0xe40daf0)) called at /usr/s
@xmorave2
xmorave2 / autority.sh
Created March 23, 2018 07:13
autority.sh
#!/bin/bash
export KOHA_CONF=/etc/koha/sites/usti/koha-conf.xml
export PERL5LIB=/usr/share/koha/lib
#for bn in $(echo 'SELECT biblionumber FROM biblio ORDER BY biblionumber LIMIT 10000, 10000;' | koha-mysql usti)
for bn in $(echo 'SELECT biblionumber FROM virtualshelfcontents where shelfnumber = 7;' | koha-mysql usti)
do
if [ "$bn" != "biblionumber" ]; then
/usr/share/koha/bin/link_bibs_to_authorities.pl -v --bib-limit="biblionumber = $bn";
koha-rebuild-zebra usti
@xmorave2
xmorave2 / cron.daily
Created April 27, 2018 06:31
Upomínky
koha-foreach --enabled /usr/share/koha/bin/cronjobs/fines.pl
koha-shell chocen -c '/usr/share/koha/bin/cronjobs/finesChocen.pl -c'
@xmorave2
xmorave2 / zakony-pro-lidi-indexer.sh
Created January 9, 2019 10:07
Zákony pro lidi
#!/bin/bash
#
# dependencies: xml-twig-tools, wget
apikey=test
collection=cs
export VUFIND_HOME="/usr/local/vufind"
export VUFIND_LOCAL_DIR="/usr/local/vufind/local"
cd /usr/local/vufind/local/harvest
@xmorave2
xmorave2 / issueslip.tt
Created February 11, 2019 14:08
issueslip.tt
[% USE KohaDates %]
[% BLOCK detail %]
<p style="font-size: 1.1em; border-bottom: 1px dotted black;">
[% IF checkout.item.biblio.author %]<i>[% checkout.item.biblio.author | remove(',$') %]</i>:[% END %]
<strong>[% checkout.item.biblio.title | remove(' \/$') | remove(' :$') %]</strong>
[%- IF checkout.item.enumchron %], [% checkout.item.enumchron %][% END %]
<br />
Půjčeno od: [% checkout.issuedate | $KohaDates %]<br />
Vrátit do: <b>[% checkout.date_due | $KohaDates %]</b><br />
[% branch.branchname %]
@xmorave2
xmorave2 / hold_slip.tt
Created February 11, 2019 14:09
hold_slip.tt
[% USE KohaDates %]
<p><small>Tisk: [% today | $KohaDates with_hours => 1 %]</small></p>
<h2 style="border-bottom: 1px solid black; margin-bottom: 1em;">[% branch.branchname %]</h2>
<div style="font-size: 1.2em; font-weight: bold;"><i>[% biblio.author %]</i>:<br />[% biblio.title %]</div>
<ul>
<li>Č. kód: [% item.barcode %]</li>
<li>Čeká do: <strong>[% hold.expirationdate | $KohaDates%]</strong></li>
</ul>
@xmorave2
xmorave2 / auth-val.txt
Created May 29, 2019 07:33
MVS výstupy
ověřená hodnota v kategorii WITHDRAWN:
11 = Zrušená MVS
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 / 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;
}
@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