Koha unsung heroes – Part 15

The #koha irc channel

On irc.katipo.co.nz we have a #koha irc channel (have had since 2000). There have been literally thousands of times someone has been helped on there. Here are some of my favourites:

  • Thd helps audrey with understanding MARC21
  • si teaches kados about ssh-keychain
  • I help kados out with html::template
  • We help 2 people with Koha installs, and then discussion turns to cricket and rugby
  • Lots of talk about cricket
  • Even more talk about rugby

(I’ve only done the early years, and I leave it as an exercise for the reader to find other gems and link them in the comments)

DBIx::Class and Koha

I did some work today with DBIx::Class and Koha, and got opac-account.pl partially using it.

You can see the schema here and I had to make a few changes to C4::Context, and a few to opac-account.pl.

Here is what they were.

diff --cc C4/Context.pm
index 7ba57fb,4dab9a9..cafc0ca
--- a/C4/Context.pm
+++ b/C4/Context.pm
@@@ -18,6 -18,6 +18,8 @@@ package C4::Context
use strict;
use warnings;
++use Koha::Schema;
++
use vars qw($VERSION $AUTOLOAD $context @context_stack);
BEGIN {
@@@ -191,6 -191,6 +193,27 @@@ $context = undef;        # Initially, n
=cut
++sub schema {
++    my $self = shift;
++    my $db_driver;
++    if ($context->config("db_scheme")){
++        $db_driver=db_scheme2dbi($context->config("db_scheme"));
++    }
++    else {
++        $db_driver="mysql";
++    }
++
++    my $db_name   = $context->config("database");
++    my $db_host   = $context->config("hostname");
++    my $db_port   = $context->config("port") || '';
++    my $db_user   = $context->config("user");
++    my $db_passwd = $context->config("pass");
++    my $schema = Koha::Schema->connect( "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
++      $db_user, $db_passwd);
++    return $schema;
++}
++
++
sub KOHAVERSION {
my $cgidir = C4::Context->intranetdir;
diff --cc opac/opac-account.pl
index 43a1e0c,43a1e0c..376ae98
--- a/opac/opac-account.pl
+++ b/opac/opac-account.pl
@@@ -17,16 -17,16 +17,20 @@@
# wrriten 15/10/2002 by finlay@katipo.oc.nz
# script to display borrowers account details in the opac
++# Edited by chrisc@catalyst.net.nz
use strict;
use CGI;
use C4::Members;
++use C4::Context;
use C4::Circulation;
use C4::Auth;
use C4::Output;
use C4::Dates qw/format_date/;
++use DBIx::Class::ResultClass::HashRefInflator;
use warnings;
++
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
@@@ -40,9 -40,9 +44,16 @@@
);
# get borrower information ....
--my $borr = GetMemberDetails( $borrowernumber );
++# my $borr = GetMemberDetails( $borrowernumber );
++my $context = C4::Context->new;
++my $schema = $context->schema;
++my $rs = $schema->resultset('Borrowers')->search({ borrowernumber => $borrowernumber });
++$rs->result_class('DBIx::Class::ResultClass::HashRefInflator');
++my $borr = $rs->first;
++use Data::Dumper;
++warn Dumper $borr;
my @bordat;
--$bordat[0] = $borr;
++push @bordat,$borr;
$template->param( BORROWER_INFO => @bordat );

So not many changes at all, i’ll work on changing some more, but it looks like adding DBIx::Class can be done in a gradual way.

Unsung Koha Heroes – Part 14

Rob Weir

On the 13 of December 2002, Rob Weir posted the first link to his windows packages for Koha. This begun countless volunteer hours spent packaging and testing windows installs. Packages were created all the way up to version 2.2.9. There is a current perl module dependency that is uninstallable on windows, which is blocking the packages for 3.0.x. I’m sure as soon as that is fixed, Rob will be hard at work creating packages again.

Windows users around the world thank you Rob.

Unsung Koha Heroes – Part 13

Andrew Arensburger

Anyone who has ever looked at the Koha code will have noticed there is one module everything else uses, C4::Context. Back in September of 2002, this was not the case until Andrew wrote this neat module.

It has been poked at by a lot of people since then, but 269 lines of it are still the lines that Andrew wrote. It still retains the purpose it was written for to provide a single place to get things like config variables, system preferences and to implement database connection pooling.

With 163 commits to his name this was not all Andrew did, but it is probably the one that has had the longest lastest influence.

If you read this, stop by #koha on irc.katipo.co.nz and say hi sometime.

Koha in the Code4lib Journal

The article written by the wonderful Joann Ransom, with help from Rosalie Blake and I has been published in the latest edition of the code4lib journal.

In 2000 a small public library system in New Zealand developed and released Koha, the world’s first open source library management system. This is the story of how that came to pass and why, and of the lessons learnt in their first foray into developing in open source.

Have a read, and let us know what you think.

Unsung Koha Heroes – Part 12

Ed Summers

As well as chatting on irc and the mailing lists (mostly helping out with MARC encoding problems) Ed has done a huge amount of work on modules for dealing with MARC records in perl. Including MARC::Record, MARC::XML and MARC::Charset which Koha uses. Without these modules building MARC support into Koha would have been much much harder. So thanks Ed and also thanks CPAN 🙂

Koha Unsung Heroes – Part 11

Laurel Barr – My Wife

Laurel has had no direct input into Koha but a huge indirect input. For being understanding when the phone rings at 3am to tell me the koha.org site was down. For accepting I need to bring my laptop to bed sometimes, or wake up at 3am to attend a koha meeting on irc. For letting me skip out on the family to fly from Pittsburgh to Athens, Ohio to visit with Liblime (even before I did my year of work there). For not even blinking when I said I needed to fly to Texas for Kohacon while she was 32 weeks pregnant with our second son. And for every night she has had to repeat something three times because I was busy typing something up for Koha on my laptop and not listening properly.

So a huge Thank You Laurel, Without your support I would have packed it all in.