This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### a snippet from code added to opac/opac-search.pl | |
use vars qw($cache $MRXorig); | |
# This is not intended to be a long-term cache, but one that persists for | |
# only the duration one might expect to page around some search results. | |
# The max_size may need to be increased for very busy sites. | |
$cache = CHI->new(driver => 'Memory', global => 1, max_size => 3_000_000, expires_in => 120); | |
$MRXorig = \&MARC::Record::new_from_xml; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub _koha_marc_update_bib_ids { | |
my ($record, $frameworkcode, $biblionumber, $biblioitemnumber) = @_; | |
my @isbns = $record->subfield('999','e'); # Account for 999$e field | |
my $new_field = MARC::Field->new( | |
'999' , '', '', | |
'c' => $biblionumber, | |
'd' => $biblioitemnumber, | |
map { ('e' => $_) } @isbns | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Plack::Middleware::Debug::CatchStderr; | |
use parent qw(Plack::Middleware::Debug::Base); | |
use strict; | |
use warnings; | |
our $VERSION = '0.001'; | |
sub TIEHANDLE { | |
my ($class, $fh) = @_; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub reserve_GET : Args(1) { | |
my ($self, $c, @args) = @_; | |
try { | |
my $reserve = Koha::Model::Reserve->new(reservenumber => $args[0])->load; | |
$self->status_ok($c, entity=>as_tree($reserve)); | |
} | |
catch { | |
if (/^No such Koha::/) { | |
HTTP::Exception::404->throw; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
sub return_void { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.014; | |
my @table=(1,2,3,8,5,8,0,4); | |
my $max = pop [sort @table]; | |
my @places; | |
while (my ($index, $value) = (each @table)) { | |
push @places, $index if $value == $max; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict ; | |
use warnings; | |
use locale ; | |
my @table=(1,2,3,8,5,8,0,4) ; | |
my @places ; | |
# Max value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Koha; | |
use C4::Context; | |
use C4::Reserves; | |
use C4::Circulation; | |
use C4::Items; | |
my $dbh = C4::Context->dbh; | |
my $itemnumbers = $dbh->selectcol_arrayref( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<schema name="VuFind Bibliographic Index" version="1.2"> | |
<types> | |
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/> | |
<fieldType name="textFacet" class="solr.TextField" sortMissingLast="true" omitNorms="true"> | |
<analyzer> | |
<tokenizer class="solr.KeywordTokenizerFactory"/> | |
<!-- strip trailing punctuation from facets: --> | |
<filter class="solr.PatternReplaceFilterFactory" pattern="(?<!\b[A-Z])[.\s]*$" replacement="" replace="first"/> | |
</analyzer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP request headers indicate API version and representation format: | |
Accept: application/vnd.koha.liblime.com+json; version=0.01 | |
Accept: application/vnd.koha.liblime.com+xml; version=0.01 | |
Defaults to JSON and most recent API version. | |
POST /catsearch?query=asdf #Generates catalog search result set and returns HTTP 201 with Location set to search ID | |
GET /catsearch/12345 #Returns the result set, defaults e.g. start=0, count=20 |
OlderNewer