Skip to content

Instantly share code, notes, and snippets.

View fraktik's full-sized avatar

Tomáš Wünsch fraktik

  • Municipal Library Ústí nad Orlicí
  • Letohrad, Czech Republic
View GitHub Profile
if (!window.location.getParameter ) {
window.location.getParameter = function(key) {
function parseParams() {
var params = {},
e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1);
@fraktik
fraktik / gist:b6a3c661cc41d68491ba9958b5bbcdc6
Created August 27, 2019 05:22
IntranetUserJS - chocen - original
if (!window.location.getParameter ) {
window.location.getParameter = function(key) {
function parseParams() {
var params = {},
e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1);
@fraktik
fraktik / gist:6cd767108ce2febf66874b0b8bb6f69c
Created August 27, 2019 05:22
IntranetUserJS - Lanškroun - original
if (!window.location.getParameter ) {
window.location.getParameter = function(key) {
function parseParams() {
var params = {},
e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1);
@fraktik
fraktik / REKS-intranetuserJS
Created August 27, 2019 05:22
IntranetUserJS - REKS - original
/* chybí isnn v novější verzi obálek */
if (!window.location.getParameter ) {
window.location.getParameter = function(key) {
function parseParams() {
var params = {},
e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
@fraktik
fraktik / Statistiky návštěv a internetu
Created August 27, 2019 07:54
IntranetUserJS - jablonne navíc
/* Statistiky návštěv a internetu */
$(document).ready(function(){
var statUrl = "/cgi-bin/koha/svc/localstat";
var hideTime = 2000;
var anonymBorrower = 307;
var visitItem = 32056;
var statButtonsHtml = "<ul class='nav navbar-nav pull-right'><li><a href='' id='stat-visit'>Návštěva</a></li></ul>";
@fraktik
fraktik / brandys
Created August 27, 2019 07:55
intranetUserCSS-brandys+
/* odkaz na půjčování místo podrobnosti čtenáře v tabulce při vracení - start */
$("#checkedintable .ci-patron a").each(function() {
var patronDetailHref = $(this).attr("href");
patronDetailHref = patronDetailHref.replace("members/moremember","circ/circulation");
$(this).attr("href",patronDetailHref);
});
/* odkaz na půjčování místo podrobnosti čtenáře v tabulce při vracení - end */
@fraktik
fraktik / kraliky - schovat mazani
Created August 27, 2019 08:03
IntranetUserJS - Králiky + (navíc)
/* Skrýt dávkové mazání jednotek - start */
$(document).ready(function() {
var odkaz = $("a[href*='tools/batchMod.pl?del=1']");
odkaz.parent("dt").next().hide();
odkaz.hide();
});
/* Skrýt dávkové mazání jednotek - end */
/* Co jsem jeste necetl od autora? */
/* !!! reports=100 nahradit spravnou hodnotou !!! */
if (typeof borrowernumber != 'undefined') {
$('<li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=67&limit=500&phase=Run+this+report&sql_params=' + borrowernumber + '" onclick="window.location.href = this.href + \'&sql_params=\' + prompt(\'Autor [příjmení, jméno]:\'); return false;">Co ještě nečetl?</a></li>').insertAfter(".patroninfo+#menu li:nth-child(4)");
}
/* Co jsem jeste necetl od autora? */
$("#cat_addbiblio textarea, #cat_addbiblio input").blur(function() {
$(this).val($(this).val().replace(/[\u2010-\u2017]/g, "-"));
$(this).val($(this).val().replace(/[\u0080-\u009F\u00A0\u2000-\u200F\u2020-\u202F\u2060-\u206F]/g, ""));
Ano - ne - vrátit - prodloužit vše
Brandys == VMyto
1: brandys, lanskroun, kraliky, vmyto
3: REKS, zamberk, jablonne
5: Letohrad
14: Chocen
=Run+this+report&reports=1
@fraktik
fraktik / SQL - report
Created August 27, 2019 09:58
ýměnný soubor - SQL Report (třeba odkazovat v IntranetUserJS) - tisk sestavy v KOHA
SELECT "<script>window.print();</script><h4><i>Knihovna:</i></h4>"AS "Prirustkove cislo", CONCAT_WS("", "<h4>", b.branchname, "</h4>") AS "Signatura","<h4><i>Soubor:</i></h4>" AS "Autor", CONCAT_WS("", "<h4>", c.colTitle, "</h4>") AS "Nazev", "" AS "Cena"
FROM collections c
JOIN branches b ON c.colBranchcode = b.branchcode
JOIN (SELECT @IdSouboru:=<<Id souboru>>) var
WHERE c.colId = @IdSouboru
UNION
SELECT "", "", "", "<h4>Naučná pro dospělé:</h4>", ""
UNION
SELECT i.stocknumber AS "Prirustkove cislo", i.itemcallnumber AS "Signatura", b.author AS "Autor", b.title AS "Nazev", i.price AS "Cena"
FROM collections c