Skip to content

Instantly share code, notes, and snippets.

View jsicot's full-sized avatar

Julien Sicot jsicot

View GitHub Profile
@jsicot
jsicot / addOptionsInSelectLangs.js
Created February 4, 2014 12:17
Ajouters des langues dans la recherche avancée de l'opac Koha
jQuery(document).ready(function() {
if (jQuery('body#advsearch').size() > 0) {
addOptionsInSelectLangs();
jQuery('#subtypes_unimarc fieldset:first-child').hide();
}
});
function addOptionsInSelectLangs(){
<?php
$openurl = http_build_query($_GET, null, '&');
$url = 'http://airway.lib.hokudai.ac.jp/airway/openURL?'.$openurl ;
$airway = file_get_contents($url);
$airway = str_replace(array("\n", "\r", "\t", "jnl:"), '', $airway);
$airway = trim(str_replace('"', "'", $airway ));
$airway = simplexml_load_string($airway);
header('Content-Type: text/javascript; charset=utf8');
<?php
$openurl = http_build_query($_GET, null, '&');
$ou = new openURLParser();
$ou->convertOpenURL($openurl);
$ou->parseData();
/* var_dump($ou->query); */
function resolveBasesearch(openurl){
var url = "http://catalogue.bu.univ-rennes2.fr/opac-tmpl/rennes2/svc/getBasesearch.php"+openurl;
console.log(url);
jQuery.ajax({
url : url,
dataType: 'jsonp',
success : function(data) {
if (data['response']['numFound'] !== '0') {
jQuery(".details").after("<div id='OA' class='details row span10'></div>");
@jsicot
jsicot / NbreNoticesCcodes2013.sql
Last active August 29, 2015 13:59
NbreNoticesCcodes2013
SELECT
i.ccode AS ccode,
count(DISTINCT(b.biblionumber)) as total
FROM
(SELECT biblionumber,barcode,ccode,dateaccessioned,itemlost,wthdrawn,timestamp FROM items) i
LEFT JOIN biblio as b ON b.biblionumber=i.biblionumber
WHERE (YEAR(b.datecreated) = '2013')
AND i.barcode IS NOT NULL
GROUP BY i.ccode
ORDER BY total DESC
@jsicot
jsicot / gist:40d8c4fde65e229e2d82
Created February 28, 2015 00:11
Install problem for ezpaarse v2.1.0 on Ubuntu Trusty
From bd031a7763c488cb89f59177639c9d85c961c849 Mon Sep 17 00:00:00 2001
From: jsicot <julien.sicot@gmail.com>
Date: Sat, 28 Feb 2015 01:06:46 +0100
Subject: [PATCH 1/1] Fix v2.1.0 install problem on Ubuntu Trusty
---
views/main.ejs | 75 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 39 insertions(+), 36 deletions(-)
diff --git a/views/main.ejs b/views/main.ejs
@jsicot
jsicot / 360.php
Created June 8, 2015 16:27
360.php
<?php
//Config
$proxy_server = '';
$proxy_port = '';
$linkResolver = ''; // example : http://xxxxxxxxxx.openurl.xml.serialssolutions.com
$id = $_GET['id']; //Identifier
$request = $_GET['request'];//ISBN OR ISSN
function parseLinks($xmlstr)
{
@jsicot
jsicot / 360.js
Created June 8, 2015 16:32
360.js
function get360link() {
if (!kioskMod && (jQuery("div.ISSN").size() > 0 || jQuery("div.ISBN").size() > 0)) {
if (jQuery("div.ISSN").size() > 0) {
var ISSN = jQuery("div.ISSN").text();
var url = jsHost+OPAC_SVC+'360.php?request=issn&id='+ISSN;
}
else {
if (jQuery("div.ISBN").size() > 0) {
var ISBN = jQuery("div.ISBN").eq(index).text();
var url =jsHost+OPAC_SVC+'360.php?request=isbn&id='+ISBN;
@jsicot
jsicot / 360.xsl
Created June 8, 2015 16:35
360.xsl
<xsl:template name="tag_010">
<xsl:param name="tag"/>
<xsl:param name="label"/>
<xsl:if test="marc:datafield[@tag=$tag]/marc:subfield[@code='a']">
<tr valign="top">
<th><xsl:value-of select="$label"/> : </th><td>
<xsl:for-each select="marc:datafield[@tag=$tag]">
<xsl:call-template name="addClassRtl"/>
<xsl:for-each select="marc:subfield[@code='a']">
@jsicot
jsicot / OaiPmhRepository_square_thumbnail
Created November 16, 2012 13:04
Omeka OaiPmhRepository - Relation : add square_thumbnail for item
From 2b5c55774c7f0f1107bbbb814cd7070c4f797da7 Mon Sep 17 00:00:00 2001
From: jsicot <julien.sicot@gmail.com>
Date: Fri, 16 Nov 2012 14:01:30 +0100
Subject: [PATCH] OaiPmhRepository - Relation : add square_thumbnail for item
---
metadata/OaiDc.php | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/metadata/OaiDc.php b/metadata/OaiDc.php