Skip to content

Instantly share code, notes, and snippets.

View xmorave2's full-sized avatar

Josef Moravec xmorave2

View GitHub Profile
@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"/>
/* 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 / 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): ?>
@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 / 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 / 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 / format.bsh
Last active July 19, 2017 07:26
format.bsh
/**
* Get and normalize EAN code (from ISBN)
*
* @param Record record
* @return String EAN code
*/
private String getEAN(Record record) {
DataField isbn = (DataField) record.getVariableField("020");
if(isbn != null) {
@xmorave2
xmorave2 / SolrMarc.php
Last active October 13, 2017 10:37
Dílovky VuFind
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');
#!/usr/bin/perl
# Copyright 2010 BibLibre SARL
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
@xmorave2
xmorave2 / finesClavius.pl
Created October 23, 2017 15:35
Cronjob pro výpočet upomínek alá Clavius
#!/usr/bin/perl
use Modern::Perl;
use DateTime;
use Getopt::Long;
use Koha::Database;
use Koha::DateUtils;