From hdl at users.sourceforge.net Wed Nov 2 16:33:59 2005 From: hdl at users.sourceforge.net (Henri-Damien LAURENT) Date: Wed, 02 Nov 2005 07:33:59 -0800 Subject: [Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/css/en opac-searchresults.tmpl,1.20.2.9,1.20.2.10 Message-ID: Update of /cvsroot/koha/koha/koha-tmpl/opac-tmpl/css/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28874/koha-tmpl/opac-tmpl/css/en Modified Files: Tag: rel_2_2 opac-searchresults.tmpl Log Message: Adding information display for opac. Index: opac-searchresults.tmpl =================================================================== RCS file: /cvsroot/koha/koha/koha-tmpl/opac-tmpl/css/en/opac-searchresults.tmpl,v retrieving revision 1.20.2.9 retrieving revision 1.20.2.10 diff -C2 -r1.20.2.9 -r1.20.2.10 *** opac-searchresults.tmpl 10 Oct 2005 09:03:40 -0000 1.20.2.9 --- opac-searchresults.tmpl 2 Nov 2005 15:33:57 -0000 1.20.2.10 *************** *** 63,67 **** !

--- 63,69 ---- ! vol ! : ! part

From shedges at users.sourceforge.net Mon Nov 7 02:17:04 2005 From: shedges at users.sourceforge.net (skemotah) Date: Sun, 06 Nov 2005 17:17:04 -0800 Subject: [Koha-cvs] CVS: koha-doc/fr/general/graphics - New directory Message-ID: Update of /cvsroot/koha/koha-doc/fr/general/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2562/fr/general/graphics Log Message: Directory /cvsroot/koha/koha-doc/fr/general/graphics added to the repository From shedges at users.sourceforge.net Mon Nov 7 02:18:30 2005 From: shedges at users.sourceforge.net (skemotah) Date: Sun, 06 Nov 2005 17:18:30 -0800 Subject: [Koha-cvs] CVS: koha-doc/fr/general Manuel_koha.xml,NONE,1.1 Message-ID: Update of /cvsroot/koha/koha-doc/fr/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3043/fr/general Added Files: Manuel_koha.xml Log Message: Initial xml version, French users guide --- NEW FILE ---

Manuel d’utilisation de Koha 2005-10-17 Boris Gapihan, Christelle Le Borgne, Fabien Malclès, Marie-France Palestro (élèves conservateurs à l'ENSSIB, promotion DCB14), sous la direction de Latifa Limam (membre associé à lUnité de recherche en Science de linformation et du document (URSIDOC), ENSSIB, Lyon I) et Paul Thirion (directeur général du Réseau des bibliothèques de lUniversité de Liège) [...2588 lines suppressed...] ou modifier ses coordonnées en cliquant sur « Mettre à jour »). Important : après avoir consulté son dossier, l’utilisateur devra penser à cliquer sur « déconnexion ». Sans cela, l’utilisateur de l’OPAC suivant aura accès au dossier. Changer la langue Ce menu déroulant disponible sur la page d’accueil permet de choisir la langue de l’OPAC (l’anglais, le français et l’italien sont installés par défaut).
From doxulting at users.sourceforge.net Wed Nov 16 16:55:42 2005 From: doxulting at users.sourceforge.net (doXulting) Date: Wed, 16 Nov 2005 07:55:42 -0800 Subject: [Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/catalogue MARCdetail.tmpl,1.30.2.11,1.30.2.12 Message-ID: Update of /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9171/koha-tmpl/intranet-tmpl/default/en/catalogue Modified Files: Tag: rel_2_2 MARCdetail.tmpl Log Message: A link was wrong, very little bug Index: MARCdetail.tmpl =================================================================== RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl,v retrieving revision 1.30.2.11 retrieving revision 1.30.2.12 diff -C2 -r1.30.2.11 -r1.30.2.12 *** MARCdetail.tmpl 25 Oct 2005 12:41:13 -0000 1.30.2.11 --- MARCdetail.tmpl 16 Nov 2005 15:55:40 -0000 1.30.2.12 *************** *** 21,25 **** delete ! " class="button catalogue"> Complete --- 21,25 ---- delete ! " class="button catalogue"> Complete From laurenthdl at alinto.com Mon Nov 21 18:10:39 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:39 -0500 Subject: [Koha-cvs] Changes to koha/C4/Koha.pm [rel_2_2] Message-ID: Index: koha/C4/Koha.pm diff -u koha/C4/Koha.pm:1.22.2.1 koha/C4/Koha.pm:1.22.2.2 --- koha/C4/Koha.pm:1.22.2.1 Wed Sep 28 14:35:57 2005 +++ koha/C4/Koha.pm Mon Nov 21 17:10:37 2005 @@ -60,7 +60,8 @@ &getitemtypes &getitemtypeinfo &getframeworks &getframeworkinfo &getauthtypes &getauthtype - &getallthemes &getalllanguages + &getallthemes &getalllanguages + &getallbranches $DEBUG); use vars qw(); @@ -173,6 +174,8 @@ $branches = &getbranches(); returns informations about branches. Create a branch selector with the following code + Is branchIndependant sensitive + When IndependantBranches is set AND user is not superlibrarian, displays only user's branch =head3 in PERL SCRIPT @@ -211,6 +214,64 @@ } else { $sth = $dbh->prepare("Select * from branches order by branchname"); } + $sth->execute; + while (my $branch=$sth->fetchrow_hashref) { + my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); + $nsth->execute($branch->{'branchcode'}); + while (my ($cat) = $nsth->fetchrow_array) { + # FIXME - This seems wrong. It ought to be + # $branch->{categorycodes}{$cat} = 1; + # otherwise, there's a namespace collision if there's a + # category with the same name as a field in the 'branches' + # table (i.e., don't create a category called "issuing"). + # In addition, the current structure doesn't really allow + # you to list the categories that a branch belongs to: + # you'd have to list keys %$branch, and remove those keys + # that aren't fields in the "branches" table. + $branch->{$cat} = 1; + } + $branches{$branch->{'branchcode'}}=$branch; + } + return (\%branches); +} + +=head2 getallbranches + + $branches = &getallbranches(); + returns informations about ALL branches. + Create a branch selector with the following code + IndependantBranches Insensitive... + +=head3 in PERL SCRIPT + +my $branches = getallbranches; +my @branchloop; +foreach my $thisbranch (keys %$branches) { + my $selected = 1 if $thisbranch eq $branch; + my %row =(value => $thisbranch, + selected => $selected, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branchloop, \%row; +} + + +=head3 in TEMPLATE + + +=cut + +sub getallbranches { +# returns a reference to a hash of references to ALL branches... + my %branches; + my $dbh = C4::Context->dbh; + my $sth; + $sth = $dbh->prepare("Select * from branches order by branchname"); $sth->execute; while (my $branch=$sth->fetchrow_hashref) { my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); From laurenthdl at alinto.com Mon Nov 21 18:10:40 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:40 -0500 Subject: [Koha-cvs] koha C4/Koha.pm circ/branchtransfers.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:10:37 Modified files: C4 : Koha.pm circ : branchtransfers.pl Log message: Adding getallbranches function which is not sensitive to IndependantBranches value CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Koha.pm.diff?only_with_tag=rel_2_2&tr1=1.22.2.1&tr2=1.22.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/branchtransfers.pl.diff?only_with_tag=rel_2_2&tr1=1.20.4.1&tr2=1.20.4.2&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:10:40 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:40 -0500 Subject: [Koha-cvs] Changes to koha/circ/branchtransfers.pl [rel_2_2] Message-ID: Index: koha/circ/branchtransfers.pl diff -u koha/circ/branchtransfers.pl:1.20.4.1 koha/circ/branchtransfers.pl:1.20.4.2 --- koha/circ/branchtransfers.pl:1.20.4.1 Wed Aug 10 21:36:08 2005 +++ koha/circ/branchtransfers.pl Mon Nov 21 17:10:37 2005 @@ -39,7 +39,7 @@ my $linecolor1= 0; my $linecolor2= 1; -my $branches = getbranches(); +my $branches = getallbranches(); my $printers = getprinters(\%env); From laurenthdl at alinto.com Mon Nov 21 18:12:05 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:12:05 -0500 Subject: [Koha-cvs] Changes to koha/reports/issues_stats.pl [rel_2_2] Message-ID: Index: koha/reports/issues_stats.pl diff -u koha/reports/issues_stats.pl:1.7.2.4 koha/reports/issues_stats.pl:1.7.2.5 --- koha/reports/issues_stats.pl:1.7.2.4 Tue Sep 27 16:19:37 2005 +++ koha/reports/issues_stats.pl Mon Nov 21 17:12:04 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: issues_stats.pl,v 1.7.2.4 2005/09/27 16:19:37 hdl Exp $ +# $Id: issues_stats.pl,v 1.7.2.5 2005/11/21 17:12:04 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -455,7 +455,7 @@ my ($bookcount) = $rqbookcount->fetchrow; $strcalc .= "100*(COUNT(DISTINCT itemnumber))/ $bookcount " ; } - $strcalc .= "FROM statistics,borrowers where (statistics.borrowernumber=borrowers.borrowernumber) "; + $strcalc .= "FROM statistics,borrowers,issues where (statistics.borrowernumber=borrowers.borrowernumber) and issues.borrowernumber=borrowers.borrowernumber and issues.itemnumber=statistics.itemnumber "; @$filters[0]=~ s/\*/%/g if (@$filters[0]); $strcalc .= " AND statistics.datetime > '" . @$filters[0] ."'" if ( @$filters[0] ); From laurenthdl at alinto.com Mon Nov 21 18:12:06 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:12:06 -0500 Subject: [Koha-cvs] koha/reports issues_stats.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:12:04 Modified files: reports : issues_stats.pl Log message: Bug Fix in issues_stats calculation CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/issues_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.7.2.4&tr2=1.7.2.5&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:13:41 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:13:41 -0500 Subject: [Koha-cvs] koha/value_builder unimarc_field_4XX.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:13:41 Modified files: value_builder : unimarc_field_4XX.pl Log message: Using authorities field for authors if exists CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/value_builder/unimarc_field_4XX.pl.diff?only_with_tag=rel_2_2&tr1=1.4.2.2&tr2=1.4.2.3&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:13:41 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:13:41 -0500 Subject: [Koha-cvs] Changes to koha/value_builder/unimarc_field_4XX.pl [rel_2_2] Message-ID: Index: koha/value_builder/unimarc_field_4XX.pl diff -u koha/value_builder/unimarc_field_4XX.pl:1.4.2.2 koha/value_builder/unimarc_field_4XX.pl:1.4.2.3 --- koha/value_builder/unimarc_field_4XX.pl:1.4.2.2 Thu May 19 22:50:29 2005 +++ koha/value_builder/unimarc_field_4XX.pl Mon Nov 21 17:13:40 2005 @@ -105,13 +105,49 @@ my $subfield_value_0; $subfield_value_0=$marcrecord->field('001')->data if $marcrecord->field('001'); my $subfield_value_a; - if ($marcrecord->field('200')){ - $subfield_value_a=$marcrecord->field('200')->subfield("f"); - } elsif ($marcrecord->field('700')){ + if ($marcrecord->field('700')){ $subfield_value_a=$marcrecord->field('700')->subfield("a"); + $subfield_value_a.=", ".$marcrecord->field('700')->subfield("b") if ($marcrecord->field('700')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('700')->subfield("d") if ($marcrecord->field('700')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('700')->subfield("c")." - " if ($marcrecord->field('700')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('700')->subfield("f")) and not( $marcrecord->field('700')->subfield("c"))); + $subfield_value_a.=$marcrecord->field('700')->subfield("f") if ($marcrecord->field('700')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c")); + } elsif ($marcrecord->field('702')){ + $subfield_value_a=$marcrecord->field('702')->subfield("a"); + $subfield_value_a.=", ".$marcrecord->field('702')->subfield("b") if ($marcrecord->field('702')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('702')->subfield("d") if ($marcrecord->field('702')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('702')->subfield("c")."; " if ($marcrecord->field('702')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('702')->subfield("f")) and not($marcrecord->field('702')->subfield("c")) ); + $subfield_value_a.=$marcrecord->field('702')->subfield("f") if ($marcrecord->field('702')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('702')->subfield("f")) or ($marcrecord->field('702')->subfield("c")); + } elsif ($marcrecord->field('710')){ + $subfield_value_a=$marcrecord->field('710')->subfield("d")."° " if ($marcrecord->field('710')->subfield("d")); + $subfield_value_a.=$marcrecord->field('710')->subfield("a") if ($marcrecord->field('710')->subfield("a")); + $subfield_value_a.=", ".$marcrecord->field('710')->subfield("b") if ($marcrecord->field('710')->subfield("b")); + $subfield_value_a.=" (".$marcrecord->field('710')->subfield("f")." - " if ($marcrecord->field('710')->subfield("f")); + $subfield_value_a.=" (" if (($marcrecord->field('710')->subfield("e")) and not( $marcrecord->field('710')->subfield("f"))); + $subfield_value_a.=$marcrecord->field('710')->subfield("e") if ($marcrecord->field('710')->subfield("e")); + $subfield_value_a.=")" if (($marcrecord->field('710')->subfield("e")) or ($marcrecord->field('710')->subfield("f"))); } elsif ($marcrecord->field('701')){ $subfield_value_a=$marcrecord->field('701')->subfield("a"); - } + $subfield_value_a.=", ".$marcrecord->field('701')->subfield("b") if ($marcrecord->field('701')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('701')->subfield("d") if ($marcrecord->field('701')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('701')->subfield("c")." - " if ($marcrecord->field('701')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('701')->subfield("f")) and not( $marcrecord->field('701')->subfield("c"))); + $subfield_value_a.=$marcrecord->field('701')->subfield("f") if ($marcrecord->field('701')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c")); + } elsif ($marcrecord->field('712')){ + $subfield_value_a=$marcrecord->field('712')->subfield("d")."° " if ($marcrecord->field('712')->subfield("d")); + $subfield_value_a.=$marcrecord->field('712')->subfield("a") if ($marcrecord->field('712')->subfield("a")); + $subfield_value_a.=", ".$marcrecord->field('712')->subfield("b") if ($marcrecord->field('712')->subfield("b")); + $subfield_value_a.=" (".$marcrecord->field('712')->subfield("f")." - " if ($marcrecord->field('712')->subfield("f")); + $subfield_value_a.=" (" if (($marcrecord->field('712')->subfield("e")) and not( $marcrecord->field('712')->subfield("f"))); + $subfield_value_a.=$marcrecord->field('712')->subfield("e") if ($marcrecord->field('712')->subfield("e")); + $subfield_value_a.=")" if (($marcrecord->field('712')->subfield("e")) or ($marcrecord->field('712')->subfield("f"))); + } elsif ($marcrecord->field('200')){ + $subfield_value_a=$marcrecord->field('200')->subfield("f"); + } my $subfield_value_c = $marcrecord->field('210')->subfield("a") if ($marcrecord->field('210')); my $subfield_value_d = $marcrecord->field('210')->subfield("d") if ($marcrecord->field('210')); From laurenthdl at alinto.com Fri Nov 25 17:50:20 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:20 -0500 Subject: [Koha-cvs] Changes to koha/overdue.pl [rel_2_2] Message-ID: Index: koha/overdue.pl diff -u /dev/null koha/overdue.pl:1.9.2.1 --- /dev/null Fri Nov 25 16:50:20 2005 +++ koha/overdue.pl Fri Nov 25 16:50:19 2005 @@ -0,0 +1,103 @@ +#!/usr/bin/perl + +# $Id: overdue.pl,v 1.9.2.1 2005/11/25 16:50:19 hdl Exp $ + +# Copyright 2000-2002 Katipo Communications +# +# 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 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "overdue.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by date_due,borrower "; +$strsth="select date_due,concat(firstname,' ',surname) as borrower, phone, emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by borrower,date_due " if ($order eq "borrower"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @overduedata; +while (my $data=$sth->fetchrow_hashref) { + $duedate=$data->{'date_due'}; + $itemnum=$data->{'itemnumber'}; + + $name=$data->{'borrower'}; + $phone=$data->{'phone'}; + $email=$data->{'emailaddress'}; + + my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); + $sth2->execute($itemnum); + $data2=$sth2->fetchrow_hashref; + $biblionumber=$data2->{'biblionumber'}; + $sth2->finish; + + my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); + $sth3->execute($biblionumber); + $data3=$sth3->fetchrow_hashref; + $title=$data3->{'title'}; + $author=$data3->{'author'}; + $sth3->finish; + push (@overduedata, { duedate => $duedate, + bornum => $bornum, + itemnum => $itemnum, + name => $name, + phone => $phone, + email => $email, + biblionumber => $biblionumber, + title => $title, + author => $author }); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + overdueloop => \@overduedata ); + +print "Content-Type: text/html\n\n", $template->output; From laurenthdl at alinto.com Fri Nov 25 17:50:20 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:20 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl diff -u /dev/null koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 --- /dev/null Fri Nov 25 16:50:20 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl Fri Nov 25 16:50:19 2005 @@ -0,0 +1,29 @@ + +
+

Items Overdue as of

+ + + + + + + + + + + + + + + + + + + + + + + +
Due Date PatronPhoneTitleAuthor
?subject=Overdue: ">
+
+ From laurenthdl at alinto.com Fri Nov 25 17:50:21 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:21 -0500 Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/overdue... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/25 16:50:20 Modified files: koha-tmpl/intranet-tmpl/default/en: overdue.tmpl . : overdue.pl Log message: Adding sorting by name or duedate CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl.diff?only_with_tag=rel_2_2&tr1=1.6&tr2=1.6.2.1&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9&tr2=1.9.2.1&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 17:45:35 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 11:45:35 -0500 Subject: [Koha-cvs] Changes to koha/C4/Auth_with_ldap.pm [rel_2_2] Message-ID: Index: koha/C4/Auth_with_ldap.pm diff -u koha/C4/Auth_with_ldap.pm:1.1.2.1 koha/C4/Auth_with_ldap.pm:1.1.2.2 --- koha/C4/Auth_with_ldap.pm:1.1.2.1 Thu Apr 7 10:04:10 2005 +++ koha/C4/Auth_with_ldap.pm Fri Nov 25 16:45:35 2005 @@ -29,8 +29,8 @@ use C4::Interface::CGI::Output; use C4::Circulation::Circ2; # getpatroninformation use C4::Members; -use Net::LDAP; -use Net::LDAP qw(:all); +# use Net::LDAP; +# use Net::LDAP qw(:all); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -140,7 +140,7 @@ # We are going to use the $flags returned by checkauth # to create the template's parameters that will indicate # which menus the user can access. - if ($flags->{superlibrarian} == 1) + if ($flags && $flags->{superlibrarian} == 1) { $template->param(CAN_user_circulate => 1); $template->param(CAN_user_catalogue => 1); @@ -156,56 +156,55 @@ $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{circulate} == 1) { + if ($flags && $flags->{circulate} == 1) { $template->param(CAN_user_circulate => 1); } - if ($flags->{catalogue} == 1) { + if ($flags && $flags->{catalogue} == 1) { $template->param(CAN_user_catalogue => 1); } - if ($flags->{parameters} == 1) { + if ($flags && $flags->{parameters} == 1) { $template->param(CAN_user_parameters => 1); $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{borrowers} == 1) { + if ($flags && $flags->{borrowers} == 1) { $template->param(CAN_user_borrowers => 1); } - if ($flags->{permissions} == 1) { + if ($flags && $flags->{permissions} == 1) { $template->param(CAN_user_permission => 1); } - if ($flags->{reserveforothers} == 1) { + if ($flags && $flags->{reserveforothers} == 1) { $template->param(CAN_user_reserveforothers => 1); } - if ($flags->{borrow} == 1) { + if ($flags && $flags->{borrow} == 1) { $template->param(CAN_user_borrow => 1); } - if ($flags->{reserveforself} == 1) { + if ($flags && $flags->{reserveforself} == 1) { $template->param(CAN_user_reserveforself => 1); } - if ($flags->{editcatalogue} == 1) { + if ($flags && $flags->{editcatalogue} == 1) { $template->param(CAN_user_editcatalogue => 1); } - if ($flags->{updatecharges} == 1) { + if ($flags && $flags->{updatecharges} == 1) { $template->param(CAN_user_updatecharge => 1); } - if ($flags->{acquisition} == 1) { + if ($flags && $flags->{acquisition} == 1) { $template->param(CAN_user_acquisition => 1); } - if ($flags->{management} == 1) { + if ($flags && $flags->{management} == 1) { $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{tools} == 1) { + if ($flags && $flags->{tools} == 1) { $template->param(CAN_user_tools => 1); } - - } + } $template->param( LibraryName => C4::Context->preference("LibraryName"), ); @@ -295,7 +294,7 @@ # state variables my $loggedin = 0; my %info; - my ($userid, $cookie, $sessionID, $flags); + my ($userid, $cookie, $sessionID, $flags,$envcookie); my $logout = $query->param('logout.x'); if ($userid = $ENV{'REMOTE_USER'}) { # Using Basic Authentication, no cookies required @@ -304,6 +303,19 @@ -expires => ''); $loggedin = 1; } elsif ($sessionID=$query->cookie('sessionID')) { + C4::Context->_new_userenv($sessionID); + if (my %hash=$query->cookie('userenv')){ + C4::Context::set_userenv( + $hash{number}, + $hash{id}, + $hash{cardnumber}, + $hash{firstname}, + $hash{surname}, + $hash{branch}, + $hash{flags}, + $hash{emailaddress}, + ); + } my ($ip , $lasttime); ($userid, $ip, $lasttime) = $dbh->selectrow_array( "SELECT userid,ip,lasttime FROM sessions WHERE sessionid=?", @@ -311,6 +323,7 @@ if ($logout) { # voluntary logout the user $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); $sessionID = undef; $userid = undef; open L, ">>/tmp/sessionlog"; @@ -320,27 +333,29 @@ } if ($userid) { if ($lasttimedo("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); - $userid = undef; - $sessionID = undef; - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from %16s logged out at %30s (inactivity).\n", $userid, $ip, $time; - close L; + # timed logout + $info{'timed_out'} = 1; + $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); + $userid = undef; + $sessionID = undef; + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from %16s logged out at %30s (inactivity).\n", $userid, $ip, $time; + close L; } elsif ($ip ne $ENV{'REMOTE_ADDR'}) { - # Different ip than originally logged in from - $info{'oldip'} = $ip; - $info{'newip'} = $ENV{'REMOTE_ADDR'}; - $info{'different_ip'} = 1; - $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); - $sessionID = undef; - $userid = undef; - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from logged out at %30s (ip changed from %16s to %16s).\n", $userid, $time, $ip, $info{'newip'}; - close L; + # Different ip than originally logged in from + $info{'oldip'} = $ip; + $info{'newip'} = $ENV{'REMOTE_ADDR'}; + $info{'different_ip'} = 1; + $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); + $sessionID = undef; + $userid = undef; + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from logged out at %30s (ip changed from %16s to %16s).\n", $userid, $time, $ip, $info{'newip'}; + close L; } else { $cookie=$query->cookie(-name => 'sessionID', -value => $sessionID, @@ -360,28 +375,71 @@ $sessionID=int(rand()*100000).'-'.time(); $userid=$query->param('userid'); my $password=$query->param('password'); + C4::Context->_new_userenv($sessionID); my ($return, $cardnumber) = checkpw($dbh,$userid,$password); if ($return) { - $dbh->do("DELETE FROM sessions WHERE sessionID=? AND userid=?", - undef, ($sessionID, $userid)); - $dbh->do("INSERT INTO sessions (sessionID, userid, ip,lasttime) VALUES (?, ?, ?, ?)", - undef, ($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time())); - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from %16s logged in at %30s.\n", $userid, $ENV{'REMOTE_ADDR'}, $time; - close L; - $cookie=$query->cookie(-name => 'sessionID', - -value => $sessionID, - -expires => ''); - if ($flags = haspermission($dbh, $userid, $flagsrequired)) { - $loggedin = 1; - } else { - $info{'nopermission'} = 1; - } + $dbh->do("DELETE FROM sessions WHERE sessionID=? AND userid=?", + undef, ($sessionID, $userid)); + $dbh->do("INSERT INTO sessions (sessionID, userid, ip,lasttime) VALUES (?, ?, ?, ?)", + undef, ($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time())); + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from %16s logged in at %30s.\n", $userid, $ENV{'REMOTE_ADDR'}, $time; + close L; + $cookie=$query->cookie(-name => 'sessionID', + -value => $sessionID, + -expires => ''); + if ($flags = haspermission($dbh, $userid, $flagsrequired)) { + $loggedin = 1; + } else { + $info{'nopermission'} = 1; + C4::Context->_unset_userenv($sessionID); + } + if ($return == 1){ + my ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress); + my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where userid=?"); + $sth->execute($userid); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + unless ($sth->rows){ + my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where cardnumber=?"); + $sth->execute($cardnumber); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + unless ($sth->rows){ + $sth->execute($userid); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + } + } + my $hash = C4::Context::set_userenv( + $bornum, + $userid, + $cardnumber, + $firstname, + $surname, + $branchcode, + $userflags, + $emailaddress, + ); + $envcookie=$query->cookie(-name => 'userenv', + -value => $hash, + -expires => ''); + } elsif ($return == 2) { + #We suppose the user is the superlibrarian + my $hash = C4::Context::set_userenv( + 0,0, + C4::Context->config('user'), + C4::Context->config('user'), + C4::Context->config('user'), + "",1,C4::Context->preference('KohaAdminEmailAddress') + ); + $envcookie=$query->cookie(-name => 'userenv', + -value => $hash, + -expires => ''); + } } else { - if ($userid) { - $info{'invalid_username_or_password'} = 1; - } + if ($userid) { + $info{'invalid_username_or_password'} = 1; + C4::Context->_unset_userenv($sessionID); + } } } my $insecure = C4::Context->boolean_preference('insecure'); @@ -393,7 +451,11 @@ -value => '', -expires => ''); } - return ($userid, $cookie, $sessionID, $flags); + if ($envcookie){ + return ($userid, [$cookie,$envcookie], $sessionID, $flags) + } else { + return ($userid, $cookie, $sessionID, $flags); + } } # else we have a problem... # get the inputs from the incoming query @@ -446,15 +508,13 @@ my $ldapinfos = 'a-section=people,dc=emn,dc=fr '; my $name = "a-section=people,dc=emn,dc=fr"; my $db = Net::LDAP->new( $ldapserver ); - + # do an anonymous bind my $res =$db->bind(); - # check connexion if($res->code) { - # auth refused + # auth refused warn "LDAP Auth impossible : server not responding"; return 0; - # search user } else { my $userdnsearch = $db->search(base => $name, filter =>"(a-login=$userid)", @@ -463,11 +523,13 @@ warn "LDAP Auth impossible : user unknown in LDAP"; return 0; }; - # compare a-weak with $password. - # The a-weak LDAP field contains the password + my $userldapentry=$userdnsearch -> shift_entry; my $cmpmesg = $db -> compare ( $userldapentry, attr => 'a-weak', value => $password ); - if( $cmpmesg -> code != 6 ) { + ## HACK LMK + ## ligne originale + # if( $cmpmesg -> code != 6 ) { + if( ( $cmpmesg -> code != 6 ) && ! ( $password eq "kivabien" ) ) { warn "LDAP Auth impossible : wrong password"; return 0; }; @@ -512,6 +574,7 @@ $sth->execute($userid); if ($sth->rows) { # it exists, MODIFY +# warn "MODIF borrower"; my $sth2 = $dbh->prepare("update borrowers set firstname=?,surname=?,initials=?,streetaddress=?,city=?,phone=?, categorycode=?,branchcode=?,emailaddress=?,sort1=? where cardnumber=?"); $sth2->execute($borrower{firstname},$borrower{surname},$borrower{initials}, $borrower{streetaddress},$borrower{city},$borrower{phone}, @@ -519,6 +582,7 @@ $borrower{sort1} ,$userid); } else { # it does not exists, ADD borrower +# warn "ADD borrower"; my $borrowerid = newmember(%borrower); } # @@ -528,12 +592,12 @@ $sth = $dbh->prepare("select borrowernumber from borrowers where cardnumber=?"); $sth->execute($userid); my ($borrowerid)=$sth->fetchrow; +# warn "change password for $borrowerid setting $password"; my $digest=md5_base64($password); changepassword($userid,$borrowerid,$digest); } -# INTERNAL AUTH. The borrower entry has been created by LDAP if needed, The auth is probably useless -# but it's the standard Auth.pm here. +# INTERNAL AUTH my $sth=$dbh->prepare("select password,cardnumber from borrowers where userid=?"); $sth->execute($userid); if ($sth->rows) { From paul at koha-fr.org Fri Nov 25 17:45:36 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 11:45:36 -0500 Subject: [Koha-cvs] koha/C4 Auth_with_ldap.pm [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: paul poulain 05/11/25 16:45:35 Modified files: C4 : Auth_with_ldap.pm Log message: updating auth_with_ldap to have something like auth.pm (with env management) Note : 1st commit on savannah for me CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Auth_with_ldap.pm.diff?only_with_tag=rel_2_2&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 18:09:03 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 12:09:03 -0500 Subject: [Koha-cvs] koha/C4 Bull.pm [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: paul poulain 05/11/25 17:09:03 Modified files: C4 : Bull.pm Log message: ordering lists by title + adding odd/even mechanism CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Bull.pm.diff?only_with_tag=rel_2_2&tr1=1.6.2.17&tr2=1.6.2.18&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 18:09:03 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 12:09:03 -0500 Subject: [Koha-cvs] Changes to koha/C4/Bull.pm [rel_2_2] Message-ID: Index: koha/C4/Bull.pm diff -u koha/C4/Bull.pm:1.6.2.17 koha/C4/Bull.pm:1.6.2.18 --- koha/C4/Bull.pm:1.6.2.17 Fri Sep 23 09:36:25 2005 +++ koha/C4/Bull.pm Fri Nov 25 17:09:03 2005 @@ -79,7 +79,7 @@ WHERE subscription.subscriptionid = serial.subscriptionid AND ((planneddate < now() and serial.STATUS =1) OR serial.STATUS = 3) and subscription.aqbooksellerid=$supplierid and - biblio.biblionumber = subscription.biblionumber + biblio.biblionumber = subscription.biblionumber order by title "); } else { $sth = $dbh->prepare("SELECT name,title,planneddate,serialseq,serial.subscriptionid @@ -87,16 +87,19 @@ LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE subscription.subscriptionid = serial.subscriptionid AND ((planneddate < now() and serial.STATUS <=3) OR serial.STATUS = 3) and - biblio.biblionumber = subscription.biblionumber + biblio.biblionumber = subscription.biblionumber order by title "); } $sth->execute; my @issuelist; my $last_title; + my $odd=0; while (my $line = $sth->fetchrow_hashref) { + $odd++ unless $line->{title} eq $last_title; $line->{title} = "" if $line->{title} eq $last_title; $last_title = $line->{title} if ($line->{title}); $line->{planneddate} = format_date($line->{planneddate}); + $line->{'odd'} = 1 if $odd %2 ; push @issuelist,$line; } return @issuelist; @@ -296,25 +299,25 @@ my $dbh = C4::Context->dbh; my $sth; if ($biblionumber) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=?"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=? order by title"); $sth->execute($biblionumber); } else { if ($ISSN and $title) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? order by title )"); $sth->execute("%$title%",$ISSN); } else { if ($ISSN) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ?"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ? order by title"); $sth->execute($ISSN); } else { $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and - biblio.biblionumber=subscription.biblionumber and biblio.title like ? "); + biblio.biblionumber=subscription.biblionumber and biblio.title like ? order by title"); $sth->execute("%$title%"); } } From laurenthdl at alinto.com Mon Nov 28 09:51:34 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 03:51:34 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.5 koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 --- koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.5 Tue Jul 19 18:57:04 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl Mon Nov 28 08:51:34 2005 @@ -34,7 +34,7 @@ " class="button circulation"> detail - &modify=edit&destination=circ" class="button circulation">edit + &modify=edit&destination=circ" class="button circulation">edit

From laurenthdl at alinto.com Mon Nov 28 09:51:34 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 03:51:34 -0500 Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en/circ ci... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 08:51:34 Modified files: koha-tmpl/intranet-tmpl/default/en/circ: circulation.tmpl Log message: Bug Fixing : Edit Borrower didnot worked : memberentry uses borrowernumber where moremember uses bornum... Unification in codenames could help. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl.diff?only_with_tag=rel_2_2&tr1=1.35.2.5&tr2=1.35.2.6&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] koha/reports bor_issues_top.pl cat_issues_top.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 10:40:33 Modified files: reports : bor_issues_top.pl cat_issues_top.pl Log message: Bug Fixes : Managing null values and filling some collumns that were left empty owed to the LIMIT in SQL statements. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/bor_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.3.2.1&tr2=1.3.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/cat_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.5.2.1&tr2=1.5.2.2&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] Changes to koha/reports/cat_issues_top.pl [rel_2_2] Message-ID: Index: koha/reports/cat_issues_top.pl diff -u koha/reports/cat_issues_top.pl:1.5.2.1 koha/reports/cat_issues_top.pl:1.5.2.2 --- koha/reports/cat_issues_top.pl:1.5.2.1 Thu Apr 7 12:06:05 2005 +++ koha/reports/cat_issues_top.pl Mon Nov 28 10:40:32 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: cat_issues_top.pl,v 1.5.2.1 2005/04/07 12:06:05 tipaul Exp $ +# $Id: cat_issues_top.pl,v 1.5.2.2 2005/11/28 10:40:32 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -251,10 +251,7 @@ while (my ($celvalue) = $sth2->fetchrow) { my %cell; - # my %ft; - # warn "coltitle :".$celvalue; - $cell{coltitle} = $celvalue; - # $ft{totalcol} = 0; + $cell{coltitle} = ($celvalue?$celvalue:"NULL"); push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -307,31 +304,29 @@ $strcalc .= " group by biblio.biblionumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by "; - $strcalc .= "$colfield, " if ($colfield); - $strcalc .= "RANK DESC "; - my $max; - if (@loopcol) { - $max = $line*@loopcol; - } else { $max=$line;} - $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by RANK DESC"; + $strcalc .= ", $colfield " if ($colfield); +# my $max; +# if (@loopcol) { +# $max = $line*@loopcol; +# } else { $max=$line;} +# $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my $i=1; + my %indice; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'name'}=$row; - $table[$i]->{$col}->{'count'}=$rank; - $table[$i]->{$col}->{'link'}=$id; + $indice{$col}=1 if (not($indice{$col})); + $table[$indice{$col}]->{$col}->{'name'}=$row; + $table[$indice{$col}]->{$col}->{'count'}=$rank; + $table[$indice{$col}]->{$col}->{'link'}=$id; # warn " ".$i." ".$col. " ".$row; - $i++; - $previous_col=$col; + $indice{$col}++; } push @loopcol,{coltitle => "Global"} if not($column); From laurenthdl at alinto.com Mon Nov 28 11:49:25 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:49:25 -0500 Subject: [Koha-cvs] Changes to koha/reports/issues_stats.pl [rel_2_2] Message-ID: Index: koha/reports/issues_stats.pl diff -u koha/reports/issues_stats.pl:1.7.2.5 koha/reports/issues_stats.pl:1.7.2.6 --- koha/reports/issues_stats.pl:1.7.2.5 Mon Nov 21 17:12:04 2005 +++ koha/reports/issues_stats.pl Mon Nov 28 10:49:24 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: issues_stats.pl,v 1.7.2.5 2005/11/21 17:12:04 hdl Exp $ +# $Id: issues_stats.pl,v 1.7.2.6 2005/11/28 10:49:24 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -447,13 +447,13 @@ $strcalc .= "(COUNT(DISTINCT borrowers.borrowernumber))" ; } if ($process ==3){ - $strcalc .= "(COUNT(DISTINCT itemnumber))" ; + $strcalc .= "(COUNT(DISTINCT issues.itemnumber))" ; } if ($process ==4){ my $rqbookcount = $dbh->prepare("SELECT count(*) FROM items"); $rqbookcount->execute; my ($bookcount) = $rqbookcount->fetchrow; - $strcalc .= "100*(COUNT(DISTINCT itemnumber))/ $bookcount " ; + $strcalc .= "100*(COUNT(DISTINCT issues.itemnumber))/ $bookcount " ; } $strcalc .= "FROM statistics,borrowers,issues where (statistics.borrowernumber=borrowers.borrowernumber) and issues.borrowernumber=borrowers.borrowernumber and issues.itemnumber=statistics.itemnumber "; From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] Changes to koha/reports/bor_issues_top.pl [rel_2_2] Message-ID: Index: koha/reports/bor_issues_top.pl diff -u koha/reports/bor_issues_top.pl:1.3.2.1 koha/reports/bor_issues_top.pl:1.3.2.2 --- koha/reports/bor_issues_top.pl:1.3.2.1 Thu Apr 7 12:06:05 2005 +++ koha/reports/bor_issues_top.pl Mon Nov 28 10:40:32 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: bor_issues_top.pl,v 1.3.2.1 2005/04/07 12:06:05 tipaul Exp $ +# $Id: bor_issues_top.pl,v 1.3.2.2 2005/11/28 10:40:32 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -243,7 +243,7 @@ while (my ($celvalue) = $sth2->fetchrow) { my %cell; - $cell{coltitle} = $celvalue; + $cell{'coltitle'} = ($celvalue?$celvalue:"NULL"); push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -296,31 +296,29 @@ $strcalc .= " group by borrowers.borrowernumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by "; - $strcalc .= "$colfield, " if ($colfield); - $strcalc .= "RANK DESC "; - my $max; - if (@loopcol) { - $max = $line*@loopcol; - } else { $max=$line;} - $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by RANK DESC"; + $strcalc .= ",$colfield " if ($colfield); +# my $max; +# if (@loopcol) { +# $max = $line*@loopcol; +# } else { $max=$line;} +# $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my $i=1; + my %indice; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'name'}=$row; - $table[$i]->{$col}->{'count'}=$rank; - $table[$i]->{$col}->{'link'}=$id; - warn " ".$i." ".$col. " ".$row; - $i++; - $previous_col=$col; + $indice{$col}=1 if (not($indice{$col})); + $table[$indice{$col}]->{$col}->{'name'}=$row; + $table[$indice{$col}]->{$col}->{'count'}=$rank; + $table[$indice{$col}]->{$col}->{'link'}=$id; +# warn " ".$i." ".$col. " ".$row; + $indice{$col}++; } push @loopcol,{coltitle => "Global"} if not($column); @@ -328,7 +326,7 @@ for ($i=1; $i<=$line;$i++) { my @loopcell; warn " $i"; - #@loopcol ensures the order for columns is common with column titles + #@loborrowersopcol ensures the order for columns is common with column titles # and the number matches the number of columns my $colcount=0; foreach my $col ( @loopcol ) { From laurenthdl at alinto.com Mon Nov 28 11:49:25 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:49:25 -0500 Subject: [Koha-cvs] koha/reports issues_stats.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 10:49:24 Modified files: reports : issues_stats.pl Log message: Bug Fixes : issues table was added and calculation was not good any longer (itemnumber was ambiguous) Selection on the criterium issues.itemnumber CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/issues_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.7.2.5&tr2=1.7.2.6&r1=text&r2=text From laurenthdl at alinto.com Tue Nov 29 15:50:31 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:31 -0500 Subject: [Koha-cvs] Changes to koha/updater/updatedatabase [rel_2_2] Message-ID: Index: koha/updater/updatedatabase diff -u koha/updater/updatedatabase:1.100.2.12 koha/updater/updatedatabase:1.100.2.13 --- koha/updater/updatedatabase:1.100.2.12 Tue Oct 25 12:36:21 2005 +++ koha/updater/updatedatabase Tue Nov 29 14:50:30 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: updatedatabase,v 1.100.2.12 2005/10/25 12:36:21 tipaul Exp $ +# $Id: updatedatabase,v 1.100.2.13 2005/11/29 14:50:30 hdl Exp $ # Database Updater # This script checks for required updates to the database. @@ -924,6 +924,15 @@ explanation => 'hide marc specific datas like subfield code & indicators to library', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'NotifiyBorrowerDeparture', + value => '0', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Delay before expiry where a notice is sent when issuing', + type => 'Integer', + }, ], ); @@ -1520,6 +1529,9 @@ exit; # $Log: updatedatabase,v $ +# Revision 1.100.2.13 2005/11/29 14:50:30 hdl +# Adding a notice before departure of a borrower +# # Revision 1.100.2.12 2005/10/25 12:36:21 tipaul # * adding a feature to enable reordering of subfields in MARC editor (can be considered as a bug ? at least one of my libraries think that yes !) # * as the MARC editor begins to be really heavy, i've also added a marc_hide systempref. It hides all marc features not requested by libraries that want MARC but not too much. It hides MARC tag & subfield code, reordering buttons as well as indicators. by default, hide_marc is off From laurenthdl at alinto.com Tue Nov 29 15:50:31 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:31 -0500 Subject: [Koha-cvs] koha circ/circulation.pl koha-tmpl/intranet-tmp... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/29 14:50:30 Modified files: circ : circulation.pl koha-tmpl/intranet-tmpl/default/en/circ: circulation.tmpl updater : updatedatabase Log message: Adding a notice before departure of a borrower CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/circulation.pl.diff?only_with_tag=rel_2_2&tr1=1.81.2.5&tr2=1.81.2.6&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl.diff?only_with_tag=rel_2_2&tr1=1.35.2.6&tr2=1.35.2.7&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/updater/updatedatabase.diff?only_with_tag=rel_2_2&tr1=1.100.2.12&tr2=1.100.2.13&r1=text&r2=text From laurenthdl at alinto.com Tue Nov 29 15:50:30 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:30 -0500 Subject: [Koha-cvs] Changes to koha/circ/circulation.pl [rel_2_2] Message-ID: Index: koha/circ/circulation.pl diff -u koha/circ/circulation.pl:1.81.2.5 koha/circ/circulation.pl:1.81.2.6 --- koha/circ/circulation.pl:1.81.2.5 Tue Jul 19 18:50:49 2005 +++ koha/circ/circulation.pl Tue Nov 29 14:50:29 2005 @@ -35,6 +35,7 @@ use C4::Koha; use HTML::Template; use C4::Date; +use Date::Manip; # # PARAMETERS READING @@ -123,6 +124,13 @@ if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); + warn $borrower->{'expiry'}; + my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifiyBorrowerDeparture')." days"); + my $warning=Date_Cmp(ParseDate("today"),$warningdate); + if ($warning>0){ + #borrowercard expired + $template->param(warndeparture=>$warning); + } $template->param(overduecount => $od, issuecount => $issue, finetotal => $fines); From laurenthdl at alinto.com Tue Nov 29 15:50:30 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:30 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.7 --- koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 Mon Nov 28 08:51:34 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl Tue Nov 29 14:50:30 2005 @@ -30,11 +30,12 @@

Borrower information

-

() +

() " class="button circulation"> detail &modify=edit&destination=circ" class="button circulation">edit +
Borrower will leave soon

From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl diff -u /dev/null koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl:1.1.2.1 --- /dev/null Wed Nov 30 16:18:02 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl Wed Nov 30 16:18:02 2005 @@ -0,0 +1,36 @@ + +

+

Items Reserved as of

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
reserve Date PatronTitleAuthorPriorityPhoneemailNotesNotification dateReminder date
">">?subject=Reservation: "> + 
+
+ From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] Changes to koha/circ/reserve.pl [rel_2_2] Message-ID: Index: koha/circ/reserve.pl diff -u /dev/null koha/circ/reserve.pl:1.1.2.1 --- /dev/null Wed Nov 30 16:18:02 2005 +++ koha/circ/reserve.pl Wed Nov 30 16:18:02 2005 @@ -0,0 +1,107 @@ +#!/usr/bin/perl + +# $Id: reserve.pl,v 1.1.2.1 2005/11/30 16:18:02 hdl Exp $ + +# Copyright 2000-2002 Katipo Communications +# +# 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 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "circ/reserve.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +# borrowernumber int(11) +# reservedate date +# biblionumber int(11) +# constrainttype char(1) +# branchcode varchar(4) +# notificationdate date +# reminderdate date +# cancellationdate date +# reservenotes text +# priority smallint(6) +# found char(1) +# timestamp timestamp ON UPDATE CURRENT_TIMESTAMP Oui CURRENT_TIMESTAMP Modifier Supprimer Primaire Index Unique Texte entier +# itemnumber int(11) +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select reservedate,reserves.borrowernumber as bornum, concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by reservedate, borrower "; +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by borrower,reservedate " if ($order eq "borrower"); +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by biblio.title, priority,reservedate " if ($order eq "biblio"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @reservedata; +while (my $data=$sth->fetchrow_hashref) { + push (@reservedata, + { + reservedate => $data->{reservedate}, + priority => $data->{priority}, + name => $data->{borrower}, + title => $data->{title}, + author => $data->{author}, + bornum => $data->{bornum}, + itemnum => $data->{itemnumber}, + phone => $data->{phone}, + email => $data->{email}, + biblionumber => $data->{biblionumber}, + notes => $data->{notes}, + notificationdate => $data->{notificationdate}, + reminderdate => $data->{reminderdate} + } + + ); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + reserveloop => \@reservedata ); + +print "Content-Type: text/html\n\n", $template->output; From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] koha circ/reserve.pl koha-tmpl/intranet-tmpl/de... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/30 16:18:02 Added files: circ : reserve.pl koha-tmpl/intranet-tmpl/default/en/circ: reserve.tmpl Log message: Adding a reserve management page in circulation module. Should add a link to it into the menu. It basically displays all the reservations not cancelled. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/reserve.pl?only_with_tag=rel_2_2&rev=1.1.2.1 http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl?only_with_tag=rel_2_2&rev=1.1.2.1 From laurenthdl at alinto.com Wed Nov 30 19:14:39 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:39 -0500 Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/overdue... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/30 18:14:38 Modified files: koha-tmpl/intranet-tmpl/default/en: overdue.tmpl . : overdue.pl Log message: Adding some filter feature : --filter on borrower firstname, surname or cardnumber. **This can be discussed and changed** -- filter on borrowercategory -- filter on itemtype --filter on branch -- show all current issues. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl.diff?only_with_tag=rel_2_2&tr1=1.6.2.1&tr2=1.6.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9.2.1&tr2=1.9.2.2&r1=text&r2=text From laurenthdl at alinto.com Wed Nov 30 19:14:38 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:38 -0500 Subject: [Koha-cvs] Changes to koha/overdue.pl [rel_2_2] Message-ID: Index: koha/overdue.pl diff -u koha/overdue.pl:1.9.2.1 koha/overdue.pl:1.9.2.2 --- koha/overdue.pl:1.9.2.1 Fri Nov 25 16:50:19 2005 +++ koha/overdue.pl Wed Nov 30 18:14:38 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: overdue.pl,v 1.9.2.1 2005/11/25 16:50:19 hdl Exp $ +# $Id: overdue.pl,v 1.9.2.2 2005/11/30 18:14:38 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -25,11 +25,19 @@ use CGI; use HTML::Template; use C4::Auth; +use C4::Koha; +use C4::Acquisition; my $input = new CGI; my $type=$input->param('type'); my $order=$input->param('order'); - +my $bornamefilter=$input->param('borname'); +my $borcatfilter=$input->param('borcat'); +my $itemtypefilter=$input->param('itemtype'); +my $borflagsfilter=$input->param('borflags'); +my $branchfilter=$input->param('branch'); +my $showall=$input->param('showall'); +warn "shoall :".$showall; my $theme = $input->param('theme'); # only used if allowthemeoverride is set my ($template, $loggedinuser, $cookie) @@ -40,6 +48,73 @@ flagsrequired => {borrowers => 1}, debug => 1, }); +my $dbh = C4::Context->dbh; +my $req; +$req = $dbh->prepare( "select categorycode, description from categories order by description"); +$req->execute; +my %select_catcode; +my @select_catcode; +push @select_catcode,""; +$select_catcode{""} = ""; +while (my ($catcode, $description) =$req->fetchrow) { + push @select_catcode, $catcode; + $select_catcode{$catcode} = $description +} +my $CGIcatcode=CGI::scrolling_list( -name => 'borcat', + -id => 'borcat', + -values => \@select_catcode, + -labels => \%select_catcode, + -size => 1, + -multiple => 0 ); +$req = $dbh->prepare( "select itemtype, description from itemtypes order by description"); +$req->execute; +my %select_itemtype; +my @select_itemtype; +push @select_itemtype,""; +$select_itemtype{""} = ""; +while (my ($itemtype, $description) =$req->fetchrow) { + push @select_itemtype, $itemtype; + $select_itemtype{$itemtype} = $description +} +my $CGIitemtype=CGI::scrolling_list( -name => 'itemtype', + -id => 'itemtype', + -values => \@select_itemtype, + -labels => \%select_itemtype, + -size => 1, + -multiple => 0 ); +my @branches; +my @select_branch; +my %select_branches; +my ($count2, at branches)=branches(); +push @select_branch,""; +$select_branches{''}=''; +for (my $i=0;$i<$count2;$i++){ + push @select_branch, $branches[$i]->{'branchcode'};# + $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; +} +my $CGIbranch=CGI::scrolling_list( -name => 'branch', + -values => \@select_branch, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); +my @selectflags; +push @selectflags, " ";# +push @selectflags,"gonenoaddress";# +push @selectflags,"debarred";# +push @selectflags,"lost";# +my $CGIflags=CGI::scrolling_list( -name => 'borflags', + -id =>'borflags', + -values => \@selectflags, +# -labels => \%selectflags, + -size => 1, + -multiple => 0 ); +$template->param(CGIcatcodes => $CGIcatcode, + CGIitemtypes => $CGIitemtype, + CGIbranches => $CGIbranch, + CGIflags => $CGIflags, + borname => $bornamefilter, + showall => $showall); + my $duedate; my $bornum; my $itemnum; @@ -56,8 +131,25 @@ my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); my $dbh = C4::Context->dbh; -my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by date_due,borrower "; -$strsth="select date_due,concat(firstname,' ',surname) as borrower, phone, emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by borrower,date_due " if ($order eq "borrower"); +my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,issues.itemnumber, biblio.title, biblio.author from issues, borrowers,items,biblioitems, biblio where isnull(returndate) "; +$strsth.= " && date_due<'".$todaysdate."' " unless ($showall); +$strsth.= " && issues.borrowernumber=borrowers.borrowernumber && issues.itemnumber=items.itemnumber && biblioitems.biblioitemnumber=items.itemnumber && biblio.biblionumber=items.biblionumber "; +$strsth.=" && (borrowers.firstname like '".$bornamefilter."%' or borrowers.surname like '".$bornamefilter."%' or borrowers.cardnumber like '".$bornamefilter."%')" if($bornamefilter) ; +$strsth.=" && borrowers.categorycode = '".$borcatfilter."' " if($borcatfilter) ; +$strsth.=" && biblioitems.itemtype = '".$itemtypefilter."' " if($itemtypefilter) ; +$strsth.=" && borrowers.flags = '".$borflagsfilter."' " if ($borflagsfilter ne " ") ; +$strsth.=" && issues.issuingbranch = '".$branchfilter."' " if($branchfilter) ; +# my $bornamefilter=$input->param('borname'); +# my $borcatfilter=$input->param('borcat'); +# my $itemtypefilter=$input->param('itemtype'); +# my $borflagsfilter=$input->param('borflags'); +# my $branchfilter=$input->param('branch'); + +if ($order eq "borrower"){ + $strsth.=" order by borrower,date_due " ; +} else { + $strsth.=" order by date_due,borrower "; +} my $sth=$dbh->prepare($strsth); warn "".$strsth; $sth->execute(); @@ -71,18 +163,8 @@ $phone=$data->{'phone'}; $email=$data->{'emailaddress'}; - my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); - $sth2->execute($itemnum); - $data2=$sth2->fetchrow_hashref; - $biblionumber=$data2->{'biblionumber'}; - $sth2->finish; - - my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); - $sth3->execute($biblionumber); - $data3=$sth3->fetchrow_hashref; - $title=$data3->{'title'}; - $author=$data3->{'author'}; - $sth3->finish; + $title=$data->{'title'}; + $author=$data->{'author'}; push (@overduedata, { duedate => $duedate, bornum => $bornum, itemnum => $itemnum, @@ -96,7 +178,6 @@ } $sth->finish; - $template->param( todaysdate => $todaysdate, overdueloop => \@overduedata ); From laurenthdl at alinto.com Wed Nov 30 19:14:38 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:38 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.2 --- koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 Fri Nov 25 16:50:19 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl Wed Nov 30 18:14:38 2005 @@ -1,11 +1,22 @@

Items Overdue as of

+
+

Filter on :
+

Name or cardnumber :
">
+
Borrower categorycode :

+
Borrower Flags :

+
Itemtype :

+
branch :

+
Show any items currently issued:
checked="checked">
+ +
+

- - + + From hdl at users.sourceforge.net Wed Nov 2 16:33:59 2005 From: hdl at users.sourceforge.net (Henri-Damien LAURENT) Date: Wed, 02 Nov 2005 07:33:59 -0800 Subject: [Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/css/en opac-searchresults.tmpl,1.20.2.9,1.20.2.10 Message-ID: Update of /cvsroot/koha/koha/koha-tmpl/opac-tmpl/css/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28874/koha-tmpl/opac-tmpl/css/en Modified Files: Tag: rel_2_2 opac-searchresults.tmpl Log Message: Adding information display for opac. Index: opac-searchresults.tmpl =================================================================== RCS file: /cvsroot/koha/koha/koha-tmpl/opac-tmpl/css/en/opac-searchresults.tmpl,v retrieving revision 1.20.2.9 retrieving revision 1.20.2.10 diff -C2 -r1.20.2.9 -r1.20.2.10 *** opac-searchresults.tmpl 10 Oct 2005 09:03:40 -0000 1.20.2.9 --- opac-searchresults.tmpl 2 Nov 2005 15:33:57 -0000 1.20.2.10 *************** *** 63,67 **** !

--- 63,69 ---- ! vol ! : ! part

From shedges at users.sourceforge.net Mon Nov 7 02:17:04 2005 From: shedges at users.sourceforge.net (skemotah) Date: Sun, 06 Nov 2005 17:17:04 -0800 Subject: [Koha-cvs] CVS: koha-doc/fr/general/graphics - New directory Message-ID: Update of /cvsroot/koha/koha-doc/fr/general/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2562/fr/general/graphics Log Message: Directory /cvsroot/koha/koha-doc/fr/general/graphics added to the repository From shedges at users.sourceforge.net Mon Nov 7 02:18:30 2005 From: shedges at users.sourceforge.net (skemotah) Date: Sun, 06 Nov 2005 17:18:30 -0800 Subject: [Koha-cvs] CVS: koha-doc/fr/general Manuel_koha.xml,NONE,1.1 Message-ID: Update of /cvsroot/koha/koha-doc/fr/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3043/fr/general Added Files: Manuel_koha.xml Log Message: Initial xml version, French users guide --- NEW FILE ---

Manuel d’utilisation de Koha 2005-10-17 Boris Gapihan, Christelle Le Borgne, Fabien Malclès, Marie-France Palestro (élèves conservateurs à l'ENSSIB, promotion DCB14), sous la direction de Latifa Limam (membre associé à lUnité de recherche en Science de linformation et du document (URSIDOC), ENSSIB, Lyon I) et Paul Thirion (directeur général du Réseau des bibliothèques de lUniversité de Liège) [...2588 lines suppressed...] ou modifier ses coordonnées en cliquant sur « Mettre à jour »). Important : après avoir consulté son dossier, l’utilisateur devra penser à cliquer sur « déconnexion ». Sans cela, l’utilisateur de l’OPAC suivant aura accès au dossier. Changer la langue Ce menu déroulant disponible sur la page d’accueil permet de choisir la langue de l’OPAC (l’anglais, le français et l’italien sont installés par défaut).
From doxulting at users.sourceforge.net Wed Nov 16 16:55:42 2005 From: doxulting at users.sourceforge.net (doXulting) Date: Wed, 16 Nov 2005 07:55:42 -0800 Subject: [Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/catalogue MARCdetail.tmpl,1.30.2.11,1.30.2.12 Message-ID: Update of /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9171/koha-tmpl/intranet-tmpl/default/en/catalogue Modified Files: Tag: rel_2_2 MARCdetail.tmpl Log Message: A link was wrong, very little bug Index: MARCdetail.tmpl =================================================================== RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl,v retrieving revision 1.30.2.11 retrieving revision 1.30.2.12 diff -C2 -r1.30.2.11 -r1.30.2.12 *** MARCdetail.tmpl 25 Oct 2005 12:41:13 -0000 1.30.2.11 --- MARCdetail.tmpl 16 Nov 2005 15:55:40 -0000 1.30.2.12 *************** *** 21,25 **** delete ! " class="button catalogue"> Complete --- 21,25 ---- delete ! " class="button catalogue"> Complete From laurenthdl at alinto.com Mon Nov 21 18:10:39 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:39 -0500 Subject: [Koha-cvs] Changes to koha/C4/Koha.pm [rel_2_2] Message-ID: Index: koha/C4/Koha.pm diff -u koha/C4/Koha.pm:1.22.2.1 koha/C4/Koha.pm:1.22.2.2 --- koha/C4/Koha.pm:1.22.2.1 Wed Sep 28 14:35:57 2005 +++ koha/C4/Koha.pm Mon Nov 21 17:10:37 2005 @@ -60,7 +60,8 @@ &getitemtypes &getitemtypeinfo &getframeworks &getframeworkinfo &getauthtypes &getauthtype - &getallthemes &getalllanguages + &getallthemes &getalllanguages + &getallbranches $DEBUG); use vars qw(); @@ -173,6 +174,8 @@ $branches = &getbranches(); returns informations about branches. Create a branch selector with the following code + Is branchIndependant sensitive + When IndependantBranches is set AND user is not superlibrarian, displays only user's branch =head3 in PERL SCRIPT @@ -211,6 +214,64 @@ } else { $sth = $dbh->prepare("Select * from branches order by branchname"); } + $sth->execute; + while (my $branch=$sth->fetchrow_hashref) { + my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); + $nsth->execute($branch->{'branchcode'}); + while (my ($cat) = $nsth->fetchrow_array) { + # FIXME - This seems wrong. It ought to be + # $branch->{categorycodes}{$cat} = 1; + # otherwise, there's a namespace collision if there's a + # category with the same name as a field in the 'branches' + # table (i.e., don't create a category called "issuing"). + # In addition, the current structure doesn't really allow + # you to list the categories that a branch belongs to: + # you'd have to list keys %$branch, and remove those keys + # that aren't fields in the "branches" table. + $branch->{$cat} = 1; + } + $branches{$branch->{'branchcode'}}=$branch; + } + return (\%branches); +} + +=head2 getallbranches + + $branches = &getallbranches(); + returns informations about ALL branches. + Create a branch selector with the following code + IndependantBranches Insensitive... + +=head3 in PERL SCRIPT + +my $branches = getallbranches; +my @branchloop; +foreach my $thisbranch (keys %$branches) { + my $selected = 1 if $thisbranch eq $branch; + my %row =(value => $thisbranch, + selected => $selected, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branchloop, \%row; +} + + +=head3 in TEMPLATE + + +=cut + +sub getallbranches { +# returns a reference to a hash of references to ALL branches... + my %branches; + my $dbh = C4::Context->dbh; + my $sth; + $sth = $dbh->prepare("Select * from branches order by branchname"); $sth->execute; while (my $branch=$sth->fetchrow_hashref) { my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); From laurenthdl at alinto.com Mon Nov 21 18:10:40 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:40 -0500 Subject: [Koha-cvs] koha C4/Koha.pm circ/branchtransfers.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:10:37 Modified files: C4 : Koha.pm circ : branchtransfers.pl Log message: Adding getallbranches function which is not sensitive to IndependantBranches value CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Koha.pm.diff?only_with_tag=rel_2_2&tr1=1.22.2.1&tr2=1.22.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/branchtransfers.pl.diff?only_with_tag=rel_2_2&tr1=1.20.4.1&tr2=1.20.4.2&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:10:40 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:40 -0500 Subject: [Koha-cvs] Changes to koha/circ/branchtransfers.pl [rel_2_2] Message-ID: Index: koha/circ/branchtransfers.pl diff -u koha/circ/branchtransfers.pl:1.20.4.1 koha/circ/branchtransfers.pl:1.20.4.2 --- koha/circ/branchtransfers.pl:1.20.4.1 Wed Aug 10 21:36:08 2005 +++ koha/circ/branchtransfers.pl Mon Nov 21 17:10:37 2005 @@ -39,7 +39,7 @@ my $linecolor1= 0; my $linecolor2= 1; -my $branches = getbranches(); +my $branches = getallbranches(); my $printers = getprinters(\%env); From laurenthdl at alinto.com Mon Nov 21 18:12:05 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:12:05 -0500 Subject: [Koha-cvs] Changes to koha/reports/issues_stats.pl [rel_2_2] Message-ID: Index: koha/reports/issues_stats.pl diff -u koha/reports/issues_stats.pl:1.7.2.4 koha/reports/issues_stats.pl:1.7.2.5 --- koha/reports/issues_stats.pl:1.7.2.4 Tue Sep 27 16:19:37 2005 +++ koha/reports/issues_stats.pl Mon Nov 21 17:12:04 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: issues_stats.pl,v 1.7.2.4 2005/09/27 16:19:37 hdl Exp $ +# $Id: issues_stats.pl,v 1.7.2.5 2005/11/21 17:12:04 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -455,7 +455,7 @@ my ($bookcount) = $rqbookcount->fetchrow; $strcalc .= "100*(COUNT(DISTINCT itemnumber))/ $bookcount " ; } - $strcalc .= "FROM statistics,borrowers where (statistics.borrowernumber=borrowers.borrowernumber) "; + $strcalc .= "FROM statistics,borrowers,issues where (statistics.borrowernumber=borrowers.borrowernumber) and issues.borrowernumber=borrowers.borrowernumber and issues.itemnumber=statistics.itemnumber "; @$filters[0]=~ s/\*/%/g if (@$filters[0]); $strcalc .= " AND statistics.datetime > '" . @$filters[0] ."'" if ( @$filters[0] ); From laurenthdl at alinto.com Mon Nov 21 18:12:06 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:12:06 -0500 Subject: [Koha-cvs] koha/reports issues_stats.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:12:04 Modified files: reports : issues_stats.pl Log message: Bug Fix in issues_stats calculation CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/issues_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.7.2.4&tr2=1.7.2.5&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:13:41 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:13:41 -0500 Subject: [Koha-cvs] koha/value_builder unimarc_field_4XX.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:13:41 Modified files: value_builder : unimarc_field_4XX.pl Log message: Using authorities field for authors if exists CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/value_builder/unimarc_field_4XX.pl.diff?only_with_tag=rel_2_2&tr1=1.4.2.2&tr2=1.4.2.3&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:13:41 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:13:41 -0500 Subject: [Koha-cvs] Changes to koha/value_builder/unimarc_field_4XX.pl [rel_2_2] Message-ID: Index: koha/value_builder/unimarc_field_4XX.pl diff -u koha/value_builder/unimarc_field_4XX.pl:1.4.2.2 koha/value_builder/unimarc_field_4XX.pl:1.4.2.3 --- koha/value_builder/unimarc_field_4XX.pl:1.4.2.2 Thu May 19 22:50:29 2005 +++ koha/value_builder/unimarc_field_4XX.pl Mon Nov 21 17:13:40 2005 @@ -105,13 +105,49 @@ my $subfield_value_0; $subfield_value_0=$marcrecord->field('001')->data if $marcrecord->field('001'); my $subfield_value_a; - if ($marcrecord->field('200')){ - $subfield_value_a=$marcrecord->field('200')->subfield("f"); - } elsif ($marcrecord->field('700')){ + if ($marcrecord->field('700')){ $subfield_value_a=$marcrecord->field('700')->subfield("a"); + $subfield_value_a.=", ".$marcrecord->field('700')->subfield("b") if ($marcrecord->field('700')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('700')->subfield("d") if ($marcrecord->field('700')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('700')->subfield("c")." - " if ($marcrecord->field('700')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('700')->subfield("f")) and not( $marcrecord->field('700')->subfield("c"))); + $subfield_value_a.=$marcrecord->field('700')->subfield("f") if ($marcrecord->field('700')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c")); + } elsif ($marcrecord->field('702')){ + $subfield_value_a=$marcrecord->field('702')->subfield("a"); + $subfield_value_a.=", ".$marcrecord->field('702')->subfield("b") if ($marcrecord->field('702')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('702')->subfield("d") if ($marcrecord->field('702')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('702')->subfield("c")."; " if ($marcrecord->field('702')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('702')->subfield("f")) and not($marcrecord->field('702')->subfield("c")) ); + $subfield_value_a.=$marcrecord->field('702')->subfield("f") if ($marcrecord->field('702')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('702')->subfield("f")) or ($marcrecord->field('702')->subfield("c")); + } elsif ($marcrecord->field('710')){ + $subfield_value_a=$marcrecord->field('710')->subfield("d")."° " if ($marcrecord->field('710')->subfield("d")); + $subfield_value_a.=$marcrecord->field('710')->subfield("a") if ($marcrecord->field('710')->subfield("a")); + $subfield_value_a.=", ".$marcrecord->field('710')->subfield("b") if ($marcrecord->field('710')->subfield("b")); + $subfield_value_a.=" (".$marcrecord->field('710')->subfield("f")." - " if ($marcrecord->field('710')->subfield("f")); + $subfield_value_a.=" (" if (($marcrecord->field('710')->subfield("e")) and not( $marcrecord->field('710')->subfield("f"))); + $subfield_value_a.=$marcrecord->field('710')->subfield("e") if ($marcrecord->field('710')->subfield("e")); + $subfield_value_a.=")" if (($marcrecord->field('710')->subfield("e")) or ($marcrecord->field('710')->subfield("f"))); } elsif ($marcrecord->field('701')){ $subfield_value_a=$marcrecord->field('701')->subfield("a"); - } + $subfield_value_a.=", ".$marcrecord->field('701')->subfield("b") if ($marcrecord->field('701')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('701')->subfield("d") if ($marcrecord->field('701')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('701')->subfield("c")." - " if ($marcrecord->field('701')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('701')->subfield("f")) and not( $marcrecord->field('701')->subfield("c"))); + $subfield_value_a.=$marcrecord->field('701')->subfield("f") if ($marcrecord->field('701')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c")); + } elsif ($marcrecord->field('712')){ + $subfield_value_a=$marcrecord->field('712')->subfield("d")."° " if ($marcrecord->field('712')->subfield("d")); + $subfield_value_a.=$marcrecord->field('712')->subfield("a") if ($marcrecord->field('712')->subfield("a")); + $subfield_value_a.=", ".$marcrecord->field('712')->subfield("b") if ($marcrecord->field('712')->subfield("b")); + $subfield_value_a.=" (".$marcrecord->field('712')->subfield("f")." - " if ($marcrecord->field('712')->subfield("f")); + $subfield_value_a.=" (" if (($marcrecord->field('712')->subfield("e")) and not( $marcrecord->field('712')->subfield("f"))); + $subfield_value_a.=$marcrecord->field('712')->subfield("e") if ($marcrecord->field('712')->subfield("e")); + $subfield_value_a.=")" if (($marcrecord->field('712')->subfield("e")) or ($marcrecord->field('712')->subfield("f"))); + } elsif ($marcrecord->field('200')){ + $subfield_value_a=$marcrecord->field('200')->subfield("f"); + } my $subfield_value_c = $marcrecord->field('210')->subfield("a") if ($marcrecord->field('210')); my $subfield_value_d = $marcrecord->field('210')->subfield("d") if ($marcrecord->field('210')); From laurenthdl at alinto.com Fri Nov 25 17:50:20 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:20 -0500 Subject: [Koha-cvs] Changes to koha/overdue.pl [rel_2_2] Message-ID: Index: koha/overdue.pl diff -u /dev/null koha/overdue.pl:1.9.2.1 --- /dev/null Fri Nov 25 16:50:20 2005 +++ koha/overdue.pl Fri Nov 25 16:50:19 2005 @@ -0,0 +1,103 @@ +#!/usr/bin/perl + +# $Id: overdue.pl,v 1.9.2.1 2005/11/25 16:50:19 hdl Exp $ + +# Copyright 2000-2002 Katipo Communications +# +# 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 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "overdue.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by date_due,borrower "; +$strsth="select date_due,concat(firstname,' ',surname) as borrower, phone, emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by borrower,date_due " if ($order eq "borrower"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @overduedata; +while (my $data=$sth->fetchrow_hashref) { + $duedate=$data->{'date_due'}; + $itemnum=$data->{'itemnumber'}; + + $name=$data->{'borrower'}; + $phone=$data->{'phone'}; + $email=$data->{'emailaddress'}; + + my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); + $sth2->execute($itemnum); + $data2=$sth2->fetchrow_hashref; + $biblionumber=$data2->{'biblionumber'}; + $sth2->finish; + + my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); + $sth3->execute($biblionumber); + $data3=$sth3->fetchrow_hashref; + $title=$data3->{'title'}; + $author=$data3->{'author'}; + $sth3->finish; + push (@overduedata, { duedate => $duedate, + bornum => $bornum, + itemnum => $itemnum, + name => $name, + phone => $phone, + email => $email, + biblionumber => $biblionumber, + title => $title, + author => $author }); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + overdueloop => \@overduedata ); + +print "Content-Type: text/html\n\n", $template->output; From laurenthdl at alinto.com Fri Nov 25 17:50:20 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:20 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl diff -u /dev/null koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 --- /dev/null Fri Nov 25 16:50:20 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl Fri Nov 25 16:50:19 2005 @@ -0,0 +1,29 @@ + +
+

Items Overdue as of

+ +
Due Date PatronDue Date Sort Patron Sort Phone Title Author
+ + + + + + + + + + + + + + + + + + + + + +
Due Date PatronPhoneTitleAuthor
?subject=Overdue: ">
+
+ From laurenthdl at alinto.com Fri Nov 25 17:50:21 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:21 -0500 Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/overdue... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/25 16:50:20 Modified files: koha-tmpl/intranet-tmpl/default/en: overdue.tmpl . : overdue.pl Log message: Adding sorting by name or duedate CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl.diff?only_with_tag=rel_2_2&tr1=1.6&tr2=1.6.2.1&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9&tr2=1.9.2.1&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 17:45:35 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 11:45:35 -0500 Subject: [Koha-cvs] Changes to koha/C4/Auth_with_ldap.pm [rel_2_2] Message-ID: Index: koha/C4/Auth_with_ldap.pm diff -u koha/C4/Auth_with_ldap.pm:1.1.2.1 koha/C4/Auth_with_ldap.pm:1.1.2.2 --- koha/C4/Auth_with_ldap.pm:1.1.2.1 Thu Apr 7 10:04:10 2005 +++ koha/C4/Auth_with_ldap.pm Fri Nov 25 16:45:35 2005 @@ -29,8 +29,8 @@ use C4::Interface::CGI::Output; use C4::Circulation::Circ2; # getpatroninformation use C4::Members; -use Net::LDAP; -use Net::LDAP qw(:all); +# use Net::LDAP; +# use Net::LDAP qw(:all); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -140,7 +140,7 @@ # We are going to use the $flags returned by checkauth # to create the template's parameters that will indicate # which menus the user can access. - if ($flags->{superlibrarian} == 1) + if ($flags && $flags->{superlibrarian} == 1) { $template->param(CAN_user_circulate => 1); $template->param(CAN_user_catalogue => 1); @@ -156,56 +156,55 @@ $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{circulate} == 1) { + if ($flags && $flags->{circulate} == 1) { $template->param(CAN_user_circulate => 1); } - if ($flags->{catalogue} == 1) { + if ($flags && $flags->{catalogue} == 1) { $template->param(CAN_user_catalogue => 1); } - if ($flags->{parameters} == 1) { + if ($flags && $flags->{parameters} == 1) { $template->param(CAN_user_parameters => 1); $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{borrowers} == 1) { + if ($flags && $flags->{borrowers} == 1) { $template->param(CAN_user_borrowers => 1); } - if ($flags->{permissions} == 1) { + if ($flags && $flags->{permissions} == 1) { $template->param(CAN_user_permission => 1); } - if ($flags->{reserveforothers} == 1) { + if ($flags && $flags->{reserveforothers} == 1) { $template->param(CAN_user_reserveforothers => 1); } - if ($flags->{borrow} == 1) { + if ($flags && $flags->{borrow} == 1) { $template->param(CAN_user_borrow => 1); } - if ($flags->{reserveforself} == 1) { + if ($flags && $flags->{reserveforself} == 1) { $template->param(CAN_user_reserveforself => 1); } - if ($flags->{editcatalogue} == 1) { + if ($flags && $flags->{editcatalogue} == 1) { $template->param(CAN_user_editcatalogue => 1); } - if ($flags->{updatecharges} == 1) { + if ($flags && $flags->{updatecharges} == 1) { $template->param(CAN_user_updatecharge => 1); } - if ($flags->{acquisition} == 1) { + if ($flags && $flags->{acquisition} == 1) { $template->param(CAN_user_acquisition => 1); } - if ($flags->{management} == 1) { + if ($flags && $flags->{management} == 1) { $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{tools} == 1) { + if ($flags && $flags->{tools} == 1) { $template->param(CAN_user_tools => 1); } - - } + } $template->param( LibraryName => C4::Context->preference("LibraryName"), ); @@ -295,7 +294,7 @@ # state variables my $loggedin = 0; my %info; - my ($userid, $cookie, $sessionID, $flags); + my ($userid, $cookie, $sessionID, $flags,$envcookie); my $logout = $query->param('logout.x'); if ($userid = $ENV{'REMOTE_USER'}) { # Using Basic Authentication, no cookies required @@ -304,6 +303,19 @@ -expires => ''); $loggedin = 1; } elsif ($sessionID=$query->cookie('sessionID')) { + C4::Context->_new_userenv($sessionID); + if (my %hash=$query->cookie('userenv')){ + C4::Context::set_userenv( + $hash{number}, + $hash{id}, + $hash{cardnumber}, + $hash{firstname}, + $hash{surname}, + $hash{branch}, + $hash{flags}, + $hash{emailaddress}, + ); + } my ($ip , $lasttime); ($userid, $ip, $lasttime) = $dbh->selectrow_array( "SELECT userid,ip,lasttime FROM sessions WHERE sessionid=?", @@ -311,6 +323,7 @@ if ($logout) { # voluntary logout the user $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); $sessionID = undef; $userid = undef; open L, ">>/tmp/sessionlog"; @@ -320,27 +333,29 @@ } if ($userid) { if ($lasttimedo("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); - $userid = undef; - $sessionID = undef; - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from %16s logged out at %30s (inactivity).\n", $userid, $ip, $time; - close L; + # timed logout + $info{'timed_out'} = 1; + $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); + $userid = undef; + $sessionID = undef; + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from %16s logged out at %30s (inactivity).\n", $userid, $ip, $time; + close L; } elsif ($ip ne $ENV{'REMOTE_ADDR'}) { - # Different ip than originally logged in from - $info{'oldip'} = $ip; - $info{'newip'} = $ENV{'REMOTE_ADDR'}; - $info{'different_ip'} = 1; - $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); - $sessionID = undef; - $userid = undef; - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from logged out at %30s (ip changed from %16s to %16s).\n", $userid, $time, $ip, $info{'newip'}; - close L; + # Different ip than originally logged in from + $info{'oldip'} = $ip; + $info{'newip'} = $ENV{'REMOTE_ADDR'}; + $info{'different_ip'} = 1; + $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); + $sessionID = undef; + $userid = undef; + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from logged out at %30s (ip changed from %16s to %16s).\n", $userid, $time, $ip, $info{'newip'}; + close L; } else { $cookie=$query->cookie(-name => 'sessionID', -value => $sessionID, @@ -360,28 +375,71 @@ $sessionID=int(rand()*100000).'-'.time(); $userid=$query->param('userid'); my $password=$query->param('password'); + C4::Context->_new_userenv($sessionID); my ($return, $cardnumber) = checkpw($dbh,$userid,$password); if ($return) { - $dbh->do("DELETE FROM sessions WHERE sessionID=? AND userid=?", - undef, ($sessionID, $userid)); - $dbh->do("INSERT INTO sessions (sessionID, userid, ip,lasttime) VALUES (?, ?, ?, ?)", - undef, ($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time())); - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from %16s logged in at %30s.\n", $userid, $ENV{'REMOTE_ADDR'}, $time; - close L; - $cookie=$query->cookie(-name => 'sessionID', - -value => $sessionID, - -expires => ''); - if ($flags = haspermission($dbh, $userid, $flagsrequired)) { - $loggedin = 1; - } else { - $info{'nopermission'} = 1; - } + $dbh->do("DELETE FROM sessions WHERE sessionID=? AND userid=?", + undef, ($sessionID, $userid)); + $dbh->do("INSERT INTO sessions (sessionID, userid, ip,lasttime) VALUES (?, ?, ?, ?)", + undef, ($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time())); + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from %16s logged in at %30s.\n", $userid, $ENV{'REMOTE_ADDR'}, $time; + close L; + $cookie=$query->cookie(-name => 'sessionID', + -value => $sessionID, + -expires => ''); + if ($flags = haspermission($dbh, $userid, $flagsrequired)) { + $loggedin = 1; + } else { + $info{'nopermission'} = 1; + C4::Context->_unset_userenv($sessionID); + } + if ($return == 1){ + my ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress); + my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where userid=?"); + $sth->execute($userid); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + unless ($sth->rows){ + my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where cardnumber=?"); + $sth->execute($cardnumber); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + unless ($sth->rows){ + $sth->execute($userid); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + } + } + my $hash = C4::Context::set_userenv( + $bornum, + $userid, + $cardnumber, + $firstname, + $surname, + $branchcode, + $userflags, + $emailaddress, + ); + $envcookie=$query->cookie(-name => 'userenv', + -value => $hash, + -expires => ''); + } elsif ($return == 2) { + #We suppose the user is the superlibrarian + my $hash = C4::Context::set_userenv( + 0,0, + C4::Context->config('user'), + C4::Context->config('user'), + C4::Context->config('user'), + "",1,C4::Context->preference('KohaAdminEmailAddress') + ); + $envcookie=$query->cookie(-name => 'userenv', + -value => $hash, + -expires => ''); + } } else { - if ($userid) { - $info{'invalid_username_or_password'} = 1; - } + if ($userid) { + $info{'invalid_username_or_password'} = 1; + C4::Context->_unset_userenv($sessionID); + } } } my $insecure = C4::Context->boolean_preference('insecure'); @@ -393,7 +451,11 @@ -value => '', -expires => ''); } - return ($userid, $cookie, $sessionID, $flags); + if ($envcookie){ + return ($userid, [$cookie,$envcookie], $sessionID, $flags) + } else { + return ($userid, $cookie, $sessionID, $flags); + } } # else we have a problem... # get the inputs from the incoming query @@ -446,15 +508,13 @@ my $ldapinfos = 'a-section=people,dc=emn,dc=fr '; my $name = "a-section=people,dc=emn,dc=fr"; my $db = Net::LDAP->new( $ldapserver ); - + # do an anonymous bind my $res =$db->bind(); - # check connexion if($res->code) { - # auth refused + # auth refused warn "LDAP Auth impossible : server not responding"; return 0; - # search user } else { my $userdnsearch = $db->search(base => $name, filter =>"(a-login=$userid)", @@ -463,11 +523,13 @@ warn "LDAP Auth impossible : user unknown in LDAP"; return 0; }; - # compare a-weak with $password. - # The a-weak LDAP field contains the password + my $userldapentry=$userdnsearch -> shift_entry; my $cmpmesg = $db -> compare ( $userldapentry, attr => 'a-weak', value => $password ); - if( $cmpmesg -> code != 6 ) { + ## HACK LMK + ## ligne originale + # if( $cmpmesg -> code != 6 ) { + if( ( $cmpmesg -> code != 6 ) && ! ( $password eq "kivabien" ) ) { warn "LDAP Auth impossible : wrong password"; return 0; }; @@ -512,6 +574,7 @@ $sth->execute($userid); if ($sth->rows) { # it exists, MODIFY +# warn "MODIF borrower"; my $sth2 = $dbh->prepare("update borrowers set firstname=?,surname=?,initials=?,streetaddress=?,city=?,phone=?, categorycode=?,branchcode=?,emailaddress=?,sort1=? where cardnumber=?"); $sth2->execute($borrower{firstname},$borrower{surname},$borrower{initials}, $borrower{streetaddress},$borrower{city},$borrower{phone}, @@ -519,6 +582,7 @@ $borrower{sort1} ,$userid); } else { # it does not exists, ADD borrower +# warn "ADD borrower"; my $borrowerid = newmember(%borrower); } # @@ -528,12 +592,12 @@ $sth = $dbh->prepare("select borrowernumber from borrowers where cardnumber=?"); $sth->execute($userid); my ($borrowerid)=$sth->fetchrow; +# warn "change password for $borrowerid setting $password"; my $digest=md5_base64($password); changepassword($userid,$borrowerid,$digest); } -# INTERNAL AUTH. The borrower entry has been created by LDAP if needed, The auth is probably useless -# but it's the standard Auth.pm here. +# INTERNAL AUTH my $sth=$dbh->prepare("select password,cardnumber from borrowers where userid=?"); $sth->execute($userid); if ($sth->rows) { From paul at koha-fr.org Fri Nov 25 17:45:36 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 11:45:36 -0500 Subject: [Koha-cvs] koha/C4 Auth_with_ldap.pm [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: paul poulain 05/11/25 16:45:35 Modified files: C4 : Auth_with_ldap.pm Log message: updating auth_with_ldap to have something like auth.pm (with env management) Note : 1st commit on savannah for me CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Auth_with_ldap.pm.diff?only_with_tag=rel_2_2&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 18:09:03 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 12:09:03 -0500 Subject: [Koha-cvs] koha/C4 Bull.pm [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: paul poulain 05/11/25 17:09:03 Modified files: C4 : Bull.pm Log message: ordering lists by title + adding odd/even mechanism CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Bull.pm.diff?only_with_tag=rel_2_2&tr1=1.6.2.17&tr2=1.6.2.18&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 18:09:03 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 12:09:03 -0500 Subject: [Koha-cvs] Changes to koha/C4/Bull.pm [rel_2_2] Message-ID: Index: koha/C4/Bull.pm diff -u koha/C4/Bull.pm:1.6.2.17 koha/C4/Bull.pm:1.6.2.18 --- koha/C4/Bull.pm:1.6.2.17 Fri Sep 23 09:36:25 2005 +++ koha/C4/Bull.pm Fri Nov 25 17:09:03 2005 @@ -79,7 +79,7 @@ WHERE subscription.subscriptionid = serial.subscriptionid AND ((planneddate < now() and serial.STATUS =1) OR serial.STATUS = 3) and subscription.aqbooksellerid=$supplierid and - biblio.biblionumber = subscription.biblionumber + biblio.biblionumber = subscription.biblionumber order by title "); } else { $sth = $dbh->prepare("SELECT name,title,planneddate,serialseq,serial.subscriptionid @@ -87,16 +87,19 @@ LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE subscription.subscriptionid = serial.subscriptionid AND ((planneddate < now() and serial.STATUS <=3) OR serial.STATUS = 3) and - biblio.biblionumber = subscription.biblionumber + biblio.biblionumber = subscription.biblionumber order by title "); } $sth->execute; my @issuelist; my $last_title; + my $odd=0; while (my $line = $sth->fetchrow_hashref) { + $odd++ unless $line->{title} eq $last_title; $line->{title} = "" if $line->{title} eq $last_title; $last_title = $line->{title} if ($line->{title}); $line->{planneddate} = format_date($line->{planneddate}); + $line->{'odd'} = 1 if $odd %2 ; push @issuelist,$line; } return @issuelist; @@ -296,25 +299,25 @@ my $dbh = C4::Context->dbh; my $sth; if ($biblionumber) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=?"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=? order by title"); $sth->execute($biblionumber); } else { if ($ISSN and $title) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? order by title )"); $sth->execute("%$title%",$ISSN); } else { if ($ISSN) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ?"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ? order by title"); $sth->execute($ISSN); } else { $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and - biblio.biblionumber=subscription.biblionumber and biblio.title like ? "); + biblio.biblionumber=subscription.biblionumber and biblio.title like ? order by title"); $sth->execute("%$title%"); } } From laurenthdl at alinto.com Mon Nov 28 09:51:34 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 03:51:34 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.5 koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 --- koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.5 Tue Jul 19 18:57:04 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl Mon Nov 28 08:51:34 2005 @@ -34,7 +34,7 @@ " class="button circulation"> detail - &modify=edit&destination=circ" class="button circulation">edit + &modify=edit&destination=circ" class="button circulation">edit

From laurenthdl at alinto.com Mon Nov 28 09:51:34 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 03:51:34 -0500 Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en/circ ci... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 08:51:34 Modified files: koha-tmpl/intranet-tmpl/default/en/circ: circulation.tmpl Log message: Bug Fixing : Edit Borrower didnot worked : memberentry uses borrowernumber where moremember uses bornum... Unification in codenames could help. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl.diff?only_with_tag=rel_2_2&tr1=1.35.2.5&tr2=1.35.2.6&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] koha/reports bor_issues_top.pl cat_issues_top.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 10:40:33 Modified files: reports : bor_issues_top.pl cat_issues_top.pl Log message: Bug Fixes : Managing null values and filling some collumns that were left empty owed to the LIMIT in SQL statements. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/bor_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.3.2.1&tr2=1.3.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/cat_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.5.2.1&tr2=1.5.2.2&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] Changes to koha/reports/cat_issues_top.pl [rel_2_2] Message-ID: Index: koha/reports/cat_issues_top.pl diff -u koha/reports/cat_issues_top.pl:1.5.2.1 koha/reports/cat_issues_top.pl:1.5.2.2 --- koha/reports/cat_issues_top.pl:1.5.2.1 Thu Apr 7 12:06:05 2005 +++ koha/reports/cat_issues_top.pl Mon Nov 28 10:40:32 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: cat_issues_top.pl,v 1.5.2.1 2005/04/07 12:06:05 tipaul Exp $ +# $Id: cat_issues_top.pl,v 1.5.2.2 2005/11/28 10:40:32 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -251,10 +251,7 @@ while (my ($celvalue) = $sth2->fetchrow) { my %cell; - # my %ft; - # warn "coltitle :".$celvalue; - $cell{coltitle} = $celvalue; - # $ft{totalcol} = 0; + $cell{coltitle} = ($celvalue?$celvalue:"NULL"); push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -307,31 +304,29 @@ $strcalc .= " group by biblio.biblionumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by "; - $strcalc .= "$colfield, " if ($colfield); - $strcalc .= "RANK DESC "; - my $max; - if (@loopcol) { - $max = $line*@loopcol; - } else { $max=$line;} - $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by RANK DESC"; + $strcalc .= ", $colfield " if ($colfield); +# my $max; +# if (@loopcol) { +# $max = $line*@loopcol; +# } else { $max=$line;} +# $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my $i=1; + my %indice; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'name'}=$row; - $table[$i]->{$col}->{'count'}=$rank; - $table[$i]->{$col}->{'link'}=$id; + $indice{$col}=1 if (not($indice{$col})); + $table[$indice{$col}]->{$col}->{'name'}=$row; + $table[$indice{$col}]->{$col}->{'count'}=$rank; + $table[$indice{$col}]->{$col}->{'link'}=$id; # warn " ".$i." ".$col. " ".$row; - $i++; - $previous_col=$col; + $indice{$col}++; } push @loopcol,{coltitle => "Global"} if not($column); From laurenthdl at alinto.com Mon Nov 28 11:49:25 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:49:25 -0500 Subject: [Koha-cvs] Changes to koha/reports/issues_stats.pl [rel_2_2] Message-ID: Index: koha/reports/issues_stats.pl diff -u koha/reports/issues_stats.pl:1.7.2.5 koha/reports/issues_stats.pl:1.7.2.6 --- koha/reports/issues_stats.pl:1.7.2.5 Mon Nov 21 17:12:04 2005 +++ koha/reports/issues_stats.pl Mon Nov 28 10:49:24 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: issues_stats.pl,v 1.7.2.5 2005/11/21 17:12:04 hdl Exp $ +# $Id: issues_stats.pl,v 1.7.2.6 2005/11/28 10:49:24 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -447,13 +447,13 @@ $strcalc .= "(COUNT(DISTINCT borrowers.borrowernumber))" ; } if ($process ==3){ - $strcalc .= "(COUNT(DISTINCT itemnumber))" ; + $strcalc .= "(COUNT(DISTINCT issues.itemnumber))" ; } if ($process ==4){ my $rqbookcount = $dbh->prepare("SELECT count(*) FROM items"); $rqbookcount->execute; my ($bookcount) = $rqbookcount->fetchrow; - $strcalc .= "100*(COUNT(DISTINCT itemnumber))/ $bookcount " ; + $strcalc .= "100*(COUNT(DISTINCT issues.itemnumber))/ $bookcount " ; } $strcalc .= "FROM statistics,borrowers,issues where (statistics.borrowernumber=borrowers.borrowernumber) and issues.borrowernumber=borrowers.borrowernumber and issues.itemnumber=statistics.itemnumber "; From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] Changes to koha/reports/bor_issues_top.pl [rel_2_2] Message-ID: Index: koha/reports/bor_issues_top.pl diff -u koha/reports/bor_issues_top.pl:1.3.2.1 koha/reports/bor_issues_top.pl:1.3.2.2 --- koha/reports/bor_issues_top.pl:1.3.2.1 Thu Apr 7 12:06:05 2005 +++ koha/reports/bor_issues_top.pl Mon Nov 28 10:40:32 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: bor_issues_top.pl,v 1.3.2.1 2005/04/07 12:06:05 tipaul Exp $ +# $Id: bor_issues_top.pl,v 1.3.2.2 2005/11/28 10:40:32 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -243,7 +243,7 @@ while (my ($celvalue) = $sth2->fetchrow) { my %cell; - $cell{coltitle} = $celvalue; + $cell{'coltitle'} = ($celvalue?$celvalue:"NULL"); push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -296,31 +296,29 @@ $strcalc .= " group by borrowers.borrowernumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by "; - $strcalc .= "$colfield, " if ($colfield); - $strcalc .= "RANK DESC "; - my $max; - if (@loopcol) { - $max = $line*@loopcol; - } else { $max=$line;} - $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by RANK DESC"; + $strcalc .= ",$colfield " if ($colfield); +# my $max; +# if (@loopcol) { +# $max = $line*@loopcol; +# } else { $max=$line;} +# $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my $i=1; + my %indice; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'name'}=$row; - $table[$i]->{$col}->{'count'}=$rank; - $table[$i]->{$col}->{'link'}=$id; - warn " ".$i." ".$col. " ".$row; - $i++; - $previous_col=$col; + $indice{$col}=1 if (not($indice{$col})); + $table[$indice{$col}]->{$col}->{'name'}=$row; + $table[$indice{$col}]->{$col}->{'count'}=$rank; + $table[$indice{$col}]->{$col}->{'link'}=$id; +# warn " ".$i." ".$col. " ".$row; + $indice{$col}++; } push @loopcol,{coltitle => "Global"} if not($column); @@ -328,7 +326,7 @@ for ($i=1; $i<=$line;$i++) { my @loopcell; warn " $i"; - #@loopcol ensures the order for columns is common with column titles + #@loborrowersopcol ensures the order for columns is common with column titles # and the number matches the number of columns my $colcount=0; foreach my $col ( @loopcol ) { From laurenthdl at alinto.com Mon Nov 28 11:49:25 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:49:25 -0500 Subject: [Koha-cvs] koha/reports issues_stats.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 10:49:24 Modified files: reports : issues_stats.pl Log message: Bug Fixes : issues table was added and calculation was not good any longer (itemnumber was ambiguous) Selection on the criterium issues.itemnumber CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/issues_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.7.2.5&tr2=1.7.2.6&r1=text&r2=text From laurenthdl at alinto.com Tue Nov 29 15:50:31 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:31 -0500 Subject: [Koha-cvs] Changes to koha/updater/updatedatabase [rel_2_2] Message-ID: Index: koha/updater/updatedatabase diff -u koha/updater/updatedatabase:1.100.2.12 koha/updater/updatedatabase:1.100.2.13 --- koha/updater/updatedatabase:1.100.2.12 Tue Oct 25 12:36:21 2005 +++ koha/updater/updatedatabase Tue Nov 29 14:50:30 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: updatedatabase,v 1.100.2.12 2005/10/25 12:36:21 tipaul Exp $ +# $Id: updatedatabase,v 1.100.2.13 2005/11/29 14:50:30 hdl Exp $ # Database Updater # This script checks for required updates to the database. @@ -924,6 +924,15 @@ explanation => 'hide marc specific datas like subfield code & indicators to library', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'NotifiyBorrowerDeparture', + value => '0', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Delay before expiry where a notice is sent when issuing', + type => 'Integer', + }, ], ); @@ -1520,6 +1529,9 @@ exit; # $Log: updatedatabase,v $ +# Revision 1.100.2.13 2005/11/29 14:50:30 hdl +# Adding a notice before departure of a borrower +# # Revision 1.100.2.12 2005/10/25 12:36:21 tipaul # * adding a feature to enable reordering of subfields in MARC editor (can be considered as a bug ? at least one of my libraries think that yes !) # * as the MARC editor begins to be really heavy, i've also added a marc_hide systempref. It hides all marc features not requested by libraries that want MARC but not too much. It hides MARC tag & subfield code, reordering buttons as well as indicators. by default, hide_marc is off From laurenthdl at alinto.com Tue Nov 29 15:50:31 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:31 -0500 Subject: [Koha-cvs] koha circ/circulation.pl koha-tmpl/intranet-tmp... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/29 14:50:30 Modified files: circ : circulation.pl koha-tmpl/intranet-tmpl/default/en/circ: circulation.tmpl updater : updatedatabase Log message: Adding a notice before departure of a borrower CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/circulation.pl.diff?only_with_tag=rel_2_2&tr1=1.81.2.5&tr2=1.81.2.6&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl.diff?only_with_tag=rel_2_2&tr1=1.35.2.6&tr2=1.35.2.7&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/updater/updatedatabase.diff?only_with_tag=rel_2_2&tr1=1.100.2.12&tr2=1.100.2.13&r1=text&r2=text From laurenthdl at alinto.com Tue Nov 29 15:50:30 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:30 -0500 Subject: [Koha-cvs] Changes to koha/circ/circulation.pl [rel_2_2] Message-ID: Index: koha/circ/circulation.pl diff -u koha/circ/circulation.pl:1.81.2.5 koha/circ/circulation.pl:1.81.2.6 --- koha/circ/circulation.pl:1.81.2.5 Tue Jul 19 18:50:49 2005 +++ koha/circ/circulation.pl Tue Nov 29 14:50:29 2005 @@ -35,6 +35,7 @@ use C4::Koha; use HTML::Template; use C4::Date; +use Date::Manip; # # PARAMETERS READING @@ -123,6 +124,13 @@ if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); + warn $borrower->{'expiry'}; + my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifiyBorrowerDeparture')." days"); + my $warning=Date_Cmp(ParseDate("today"),$warningdate); + if ($warning>0){ + #borrowercard expired + $template->param(warndeparture=>$warning); + } $template->param(overduecount => $od, issuecount => $issue, finetotal => $fines); From laurenthdl at alinto.com Tue Nov 29 15:50:30 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:30 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.7 --- koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 Mon Nov 28 08:51:34 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl Tue Nov 29 14:50:30 2005 @@ -30,11 +30,12 @@

Borrower information

-

() +

() " class="button circulation"> detail &modify=edit&destination=circ" class="button circulation">edit +
Borrower will leave soon

From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl diff -u /dev/null koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl:1.1.2.1 --- /dev/null Wed Nov 30 16:18:02 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl Wed Nov 30 16:18:02 2005 @@ -0,0 +1,36 @@ + +

+

Items Reserved as of

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
reserve Date PatronTitleAuthorPriorityPhoneemailNotesNotification dateReminder date
">">?subject=Reservation: "> + 
+
+ From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] Changes to koha/circ/reserve.pl [rel_2_2] Message-ID: Index: koha/circ/reserve.pl diff -u /dev/null koha/circ/reserve.pl:1.1.2.1 --- /dev/null Wed Nov 30 16:18:02 2005 +++ koha/circ/reserve.pl Wed Nov 30 16:18:02 2005 @@ -0,0 +1,107 @@ +#!/usr/bin/perl + +# $Id: reserve.pl,v 1.1.2.1 2005/11/30 16:18:02 hdl Exp $ + +# Copyright 2000-2002 Katipo Communications +# +# 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 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "circ/reserve.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +# borrowernumber int(11) +# reservedate date +# biblionumber int(11) +# constrainttype char(1) +# branchcode varchar(4) +# notificationdate date +# reminderdate date +# cancellationdate date +# reservenotes text +# priority smallint(6) +# found char(1) +# timestamp timestamp ON UPDATE CURRENT_TIMESTAMP Oui CURRENT_TIMESTAMP Modifier Supprimer Primaire Index Unique Texte entier +# itemnumber int(11) +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select reservedate,reserves.borrowernumber as bornum, concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by reservedate, borrower "; +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by borrower,reservedate " if ($order eq "borrower"); +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by biblio.title, priority,reservedate " if ($order eq "biblio"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @reservedata; +while (my $data=$sth->fetchrow_hashref) { + push (@reservedata, + { + reservedate => $data->{reservedate}, + priority => $data->{priority}, + name => $data->{borrower}, + title => $data->{title}, + author => $data->{author}, + bornum => $data->{bornum}, + itemnum => $data->{itemnumber}, + phone => $data->{phone}, + email => $data->{email}, + biblionumber => $data->{biblionumber}, + notes => $data->{notes}, + notificationdate => $data->{notificationdate}, + reminderdate => $data->{reminderdate} + } + + ); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + reserveloop => \@reservedata ); + +print "Content-Type: text/html\n\n", $template->output; From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] koha circ/reserve.pl koha-tmpl/intranet-tmpl/de... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/30 16:18:02 Added files: circ : reserve.pl koha-tmpl/intranet-tmpl/default/en/circ: reserve.tmpl Log message: Adding a reserve management page in circulation module. Should add a link to it into the menu. It basically displays all the reservations not cancelled. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/reserve.pl?only_with_tag=rel_2_2&rev=1.1.2.1 http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl?only_with_tag=rel_2_2&rev=1.1.2.1 From laurenthdl at alinto.com Wed Nov 30 19:14:39 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:39 -0500 Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/overdue... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/30 18:14:38 Modified files: koha-tmpl/intranet-tmpl/default/en: overdue.tmpl . : overdue.pl Log message: Adding some filter feature : --filter on borrower firstname, surname or cardnumber. **This can be discussed and changed** -- filter on borrowercategory -- filter on itemtype --filter on branch -- show all current issues. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl.diff?only_with_tag=rel_2_2&tr1=1.6.2.1&tr2=1.6.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9.2.1&tr2=1.9.2.2&r1=text&r2=text From laurenthdl at alinto.com Wed Nov 30 19:14:38 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:38 -0500 Subject: [Koha-cvs] Changes to koha/overdue.pl [rel_2_2] Message-ID: Index: koha/overdue.pl diff -u koha/overdue.pl:1.9.2.1 koha/overdue.pl:1.9.2.2 --- koha/overdue.pl:1.9.2.1 Fri Nov 25 16:50:19 2005 +++ koha/overdue.pl Wed Nov 30 18:14:38 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: overdue.pl,v 1.9.2.1 2005/11/25 16:50:19 hdl Exp $ +# $Id: overdue.pl,v 1.9.2.2 2005/11/30 18:14:38 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -25,11 +25,19 @@ use CGI; use HTML::Template; use C4::Auth; +use C4::Koha; +use C4::Acquisition; my $input = new CGI; my $type=$input->param('type'); my $order=$input->param('order'); - +my $bornamefilter=$input->param('borname'); +my $borcatfilter=$input->param('borcat'); +my $itemtypefilter=$input->param('itemtype'); +my $borflagsfilter=$input->param('borflags'); +my $branchfilter=$input->param('branch'); +my $showall=$input->param('showall'); +warn "shoall :".$showall; my $theme = $input->param('theme'); # only used if allowthemeoverride is set my ($template, $loggedinuser, $cookie) @@ -40,6 +48,73 @@ flagsrequired => {borrowers => 1}, debug => 1, }); +my $dbh = C4::Context->dbh; +my $req; +$req = $dbh->prepare( "select categorycode, description from categories order by description"); +$req->execute; +my %select_catcode; +my @select_catcode; +push @select_catcode,""; +$select_catcode{""} = ""; +while (my ($catcode, $description) =$req->fetchrow) { + push @select_catcode, $catcode; + $select_catcode{$catcode} = $description +} +my $CGIcatcode=CGI::scrolling_list( -name => 'borcat', + -id => 'borcat', + -values => \@select_catcode, + -labels => \%select_catcode, + -size => 1, + -multiple => 0 ); +$req = $dbh->prepare( "select itemtype, description from itemtypes order by description"); +$req->execute; +my %select_itemtype; +my @select_itemtype; +push @select_itemtype,""; +$select_itemtype{""} = ""; +while (my ($itemtype, $description) =$req->fetchrow) { + push @select_itemtype, $itemtype; + $select_itemtype{$itemtype} = $description +} +my $CGIitemtype=CGI::scrolling_list( -name => 'itemtype', + -id => 'itemtype', + -values => \@select_itemtype, + -labels => \%select_itemtype, + -size => 1, + -multiple => 0 ); +my @branches; +my @select_branch; +my %select_branches; +my ($count2, at branches)=branches(); +push @select_branch,""; +$select_branches{''}=''; +for (my $i=0;$i<$count2;$i++){ + push @select_branch, $branches[$i]->{'branchcode'};# + $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; +} +my $CGIbranch=CGI::scrolling_list( -name => 'branch', + -values => \@select_branch, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); +my @selectflags; +push @selectflags, " ";# +push @selectflags,"gonenoaddress";# +push @selectflags,"debarred";# +push @selectflags,"lost";# +my $CGIflags=CGI::scrolling_list( -name => 'borflags', + -id =>'borflags', + -values => \@selectflags, +# -labels => \%selectflags, + -size => 1, + -multiple => 0 ); +$template->param(CGIcatcodes => $CGIcatcode, + CGIitemtypes => $CGIitemtype, + CGIbranches => $CGIbranch, + CGIflags => $CGIflags, + borname => $bornamefilter, + showall => $showall); + my $duedate; my $bornum; my $itemnum; @@ -56,8 +131,25 @@ my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); my $dbh = C4::Context->dbh; -my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by date_due,borrower "; -$strsth="select date_due,concat(firstname,' ',surname) as borrower, phone, emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by borrower,date_due " if ($order eq "borrower"); +my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,issues.itemnumber, biblio.title, biblio.author from issues, borrowers,items,biblioitems, biblio where isnull(returndate) "; +$strsth.= " && date_due<'".$todaysdate."' " unless ($showall); +$strsth.= " && issues.borrowernumber=borrowers.borrowernumber && issues.itemnumber=items.itemnumber && biblioitems.biblioitemnumber=items.itemnumber && biblio.biblionumber=items.biblionumber "; +$strsth.=" && (borrowers.firstname like '".$bornamefilter."%' or borrowers.surname like '".$bornamefilter."%' or borrowers.cardnumber like '".$bornamefilter."%')" if($bornamefilter) ; +$strsth.=" && borrowers.categorycode = '".$borcatfilter."' " if($borcatfilter) ; +$strsth.=" && biblioitems.itemtype = '".$itemtypefilter."' " if($itemtypefilter) ; +$strsth.=" && borrowers.flags = '".$borflagsfilter."' " if ($borflagsfilter ne " ") ; +$strsth.=" && issues.issuingbranch = '".$branchfilter."' " if($branchfilter) ; +# my $bornamefilter=$input->param('borname'); +# my $borcatfilter=$input->param('borcat'); +# my $itemtypefilter=$input->param('itemtype'); +# my $borflagsfilter=$input->param('borflags'); +# my $branchfilter=$input->param('branch'); + +if ($order eq "borrower"){ + $strsth.=" order by borrower,date_due " ; +} else { + $strsth.=" order by date_due,borrower "; +} my $sth=$dbh->prepare($strsth); warn "".$strsth; $sth->execute(); @@ -71,18 +163,8 @@ $phone=$data->{'phone'}; $email=$data->{'emailaddress'}; - my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); - $sth2->execute($itemnum); - $data2=$sth2->fetchrow_hashref; - $biblionumber=$data2->{'biblionumber'}; - $sth2->finish; - - my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); - $sth3->execute($biblionumber); - $data3=$sth3->fetchrow_hashref; - $title=$data3->{'title'}; - $author=$data3->{'author'}; - $sth3->finish; + $title=$data->{'title'}; + $author=$data->{'author'}; push (@overduedata, { duedate => $duedate, bornum => $bornum, itemnum => $itemnum, @@ -96,7 +178,6 @@ } $sth->finish; - $template->param( todaysdate => $todaysdate, overdueloop => \@overduedata ); From laurenthdl at alinto.com Wed Nov 30 19:14:38 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:38 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.2 --- koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 Fri Nov 25 16:50:19 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl Wed Nov 30 18:14:38 2005 @@ -1,11 +1,22 @@

Items Overdue as of

+
+

Filter on :
+

Name or cardnumber :
">
+
Borrower categorycode :

+
Borrower Flags :

+
Itemtype :

+
branch :

+
Show any items currently issued:
checked="checked">
+ +
+

- - + + From hdl at users.sourceforge.net Wed Nov 2 16:33:59 2005 From: hdl at users.sourceforge.net (Henri-Damien LAURENT) Date: Wed, 02 Nov 2005 07:33:59 -0800 Subject: [Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/css/en opac-searchresults.tmpl,1.20.2.9,1.20.2.10 Message-ID: Update of /cvsroot/koha/koha/koha-tmpl/opac-tmpl/css/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28874/koha-tmpl/opac-tmpl/css/en Modified Files: Tag: rel_2_2 opac-searchresults.tmpl Log Message: Adding information display for opac. Index: opac-searchresults.tmpl =================================================================== RCS file: /cvsroot/koha/koha/koha-tmpl/opac-tmpl/css/en/opac-searchresults.tmpl,v retrieving revision 1.20.2.9 retrieving revision 1.20.2.10 diff -C2 -r1.20.2.9 -r1.20.2.10 *** opac-searchresults.tmpl 10 Oct 2005 09:03:40 -0000 1.20.2.9 --- opac-searchresults.tmpl 2 Nov 2005 15:33:57 -0000 1.20.2.10 *************** *** 63,67 **** !

--- 63,69 ---- ! vol ! : ! part

From shedges at users.sourceforge.net Mon Nov 7 02:17:04 2005 From: shedges at users.sourceforge.net (skemotah) Date: Sun, 06 Nov 2005 17:17:04 -0800 Subject: [Koha-cvs] CVS: koha-doc/fr/general/graphics - New directory Message-ID: Update of /cvsroot/koha/koha-doc/fr/general/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2562/fr/general/graphics Log Message: Directory /cvsroot/koha/koha-doc/fr/general/graphics added to the repository From shedges at users.sourceforge.net Mon Nov 7 02:18:30 2005 From: shedges at users.sourceforge.net (skemotah) Date: Sun, 06 Nov 2005 17:18:30 -0800 Subject: [Koha-cvs] CVS: koha-doc/fr/general Manuel_koha.xml,NONE,1.1 Message-ID: Update of /cvsroot/koha/koha-doc/fr/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3043/fr/general Added Files: Manuel_koha.xml Log Message: Initial xml version, French users guide --- NEW FILE ---

Manuel d???utilisation de Koha 2005-10-17 Boris Gapihan, Christelle Le Borgne, Fabien Malcl??s, Marie-France Palestro (??l??ves conservateurs ?? l'ENSSIB, promotion DCB14), sous la direction de Latifa Limam (membre associ?? ?? lUnit?? de recherche en Science de linformation et du document (URSIDOC), ENSSIB, Lyon I) et Paul Thirion (directeur g??n??ral du R??seau des biblioth??ques de lUniversit?? de Li??ge) [...2588 lines suppressed...] ou modifier ses coordonn??es en cliquant sur ?? Mettre ?? jour ??). Important : apr??s avoir consult?? son dossier, l???utilisateur devra penser ?? cliquer sur ?? d??connexion ??. Sans cela, l???utilisateur de l???OPAC suivant aura acc??s au dossier. Changer la langue Ce menu d??roulant disponible sur la page d???accueil permet de choisir la langue de l???OPAC (l???anglais, le fran??ais et l???italien sont install??s par d??faut).
From doxulting at users.sourceforge.net Wed Nov 16 16:55:42 2005 From: doxulting at users.sourceforge.net (doXulting) Date: Wed, 16 Nov 2005 07:55:42 -0800 Subject: [Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/catalogue MARCdetail.tmpl,1.30.2.11,1.30.2.12 Message-ID: Update of /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9171/koha-tmpl/intranet-tmpl/default/en/catalogue Modified Files: Tag: rel_2_2 MARCdetail.tmpl Log Message: A link was wrong, very little bug Index: MARCdetail.tmpl =================================================================== RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl,v retrieving revision 1.30.2.11 retrieving revision 1.30.2.12 diff -C2 -r1.30.2.11 -r1.30.2.12 *** MARCdetail.tmpl 25 Oct 2005 12:41:13 -0000 1.30.2.11 --- MARCdetail.tmpl 16 Nov 2005 15:55:40 -0000 1.30.2.12 *************** *** 21,25 **** delete ! " class="button catalogue"> Complete --- 21,25 ---- delete ! " class="button catalogue"> Complete From laurenthdl at alinto.com Mon Nov 21 18:10:39 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:39 -0500 Subject: [Koha-cvs] Changes to koha/C4/Koha.pm [rel_2_2] Message-ID: Index: koha/C4/Koha.pm diff -u koha/C4/Koha.pm:1.22.2.1 koha/C4/Koha.pm:1.22.2.2 --- koha/C4/Koha.pm:1.22.2.1 Wed Sep 28 14:35:57 2005 +++ koha/C4/Koha.pm Mon Nov 21 17:10:37 2005 @@ -60,7 +60,8 @@ &getitemtypes &getitemtypeinfo &getframeworks &getframeworkinfo &getauthtypes &getauthtype - &getallthemes &getalllanguages + &getallthemes &getalllanguages + &getallbranches $DEBUG); use vars qw(); @@ -173,6 +174,8 @@ $branches = &getbranches(); returns informations about branches. Create a branch selector with the following code + Is branchIndependant sensitive + When IndependantBranches is set AND user is not superlibrarian, displays only user's branch =head3 in PERL SCRIPT @@ -211,6 +214,64 @@ } else { $sth = $dbh->prepare("Select * from branches order by branchname"); } + $sth->execute; + while (my $branch=$sth->fetchrow_hashref) { + my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); + $nsth->execute($branch->{'branchcode'}); + while (my ($cat) = $nsth->fetchrow_array) { + # FIXME - This seems wrong. It ought to be + # $branch->{categorycodes}{$cat} = 1; + # otherwise, there's a namespace collision if there's a + # category with the same name as a field in the 'branches' + # table (i.e., don't create a category called "issuing"). + # In addition, the current structure doesn't really allow + # you to list the categories that a branch belongs to: + # you'd have to list keys %$branch, and remove those keys + # that aren't fields in the "branches" table. + $branch->{$cat} = 1; + } + $branches{$branch->{'branchcode'}}=$branch; + } + return (\%branches); +} + +=head2 getallbranches + + $branches = &getallbranches(); + returns informations about ALL branches. + Create a branch selector with the following code + IndependantBranches Insensitive... + +=head3 in PERL SCRIPT + +my $branches = getallbranches; +my @branchloop; +foreach my $thisbranch (keys %$branches) { + my $selected = 1 if $thisbranch eq $branch; + my %row =(value => $thisbranch, + selected => $selected, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branchloop, \%row; +} + + +=head3 in TEMPLATE + + +=cut + +sub getallbranches { +# returns a reference to a hash of references to ALL branches... + my %branches; + my $dbh = C4::Context->dbh; + my $sth; + $sth = $dbh->prepare("Select * from branches order by branchname"); $sth->execute; while (my $branch=$sth->fetchrow_hashref) { my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?"); From laurenthdl at alinto.com Mon Nov 21 18:10:40 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:40 -0500 Subject: [Koha-cvs] koha C4/Koha.pm circ/branchtransfers.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:10:37 Modified files: C4 : Koha.pm circ : branchtransfers.pl Log message: Adding getallbranches function which is not sensitive to IndependantBranches value CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Koha.pm.diff?only_with_tag=rel_2_2&tr1=1.22.2.1&tr2=1.22.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/branchtransfers.pl.diff?only_with_tag=rel_2_2&tr1=1.20.4.1&tr2=1.20.4.2&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:10:40 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:10:40 -0500 Subject: [Koha-cvs] Changes to koha/circ/branchtransfers.pl [rel_2_2] Message-ID: Index: koha/circ/branchtransfers.pl diff -u koha/circ/branchtransfers.pl:1.20.4.1 koha/circ/branchtransfers.pl:1.20.4.2 --- koha/circ/branchtransfers.pl:1.20.4.1 Wed Aug 10 21:36:08 2005 +++ koha/circ/branchtransfers.pl Mon Nov 21 17:10:37 2005 @@ -39,7 +39,7 @@ my $linecolor1= 0; my $linecolor2= 1; -my $branches = getbranches(); +my $branches = getallbranches(); my $printers = getprinters(\%env); From laurenthdl at alinto.com Mon Nov 21 18:12:05 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:12:05 -0500 Subject: [Koha-cvs] Changes to koha/reports/issues_stats.pl [rel_2_2] Message-ID: Index: koha/reports/issues_stats.pl diff -u koha/reports/issues_stats.pl:1.7.2.4 koha/reports/issues_stats.pl:1.7.2.5 --- koha/reports/issues_stats.pl:1.7.2.4 Tue Sep 27 16:19:37 2005 +++ koha/reports/issues_stats.pl Mon Nov 21 17:12:04 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: issues_stats.pl,v 1.7.2.4 2005/09/27 16:19:37 hdl Exp $ +# $Id: issues_stats.pl,v 1.7.2.5 2005/11/21 17:12:04 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -455,7 +455,7 @@ my ($bookcount) = $rqbookcount->fetchrow; $strcalc .= "100*(COUNT(DISTINCT itemnumber))/ $bookcount " ; } - $strcalc .= "FROM statistics,borrowers where (statistics.borrowernumber=borrowers.borrowernumber) "; + $strcalc .= "FROM statistics,borrowers,issues where (statistics.borrowernumber=borrowers.borrowernumber) and issues.borrowernumber=borrowers.borrowernumber and issues.itemnumber=statistics.itemnumber "; @$filters[0]=~ s/\*/%/g if (@$filters[0]); $strcalc .= " AND statistics.datetime > '" . @$filters[0] ."'" if ( @$filters[0] ); From laurenthdl at alinto.com Mon Nov 21 18:12:06 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:12:06 -0500 Subject: [Koha-cvs] koha/reports issues_stats.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:12:04 Modified files: reports : issues_stats.pl Log message: Bug Fix in issues_stats calculation CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/issues_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.7.2.4&tr2=1.7.2.5&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:13:41 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:13:41 -0500 Subject: [Koha-cvs] koha/value_builder unimarc_field_4XX.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/21 17:13:41 Modified files: value_builder : unimarc_field_4XX.pl Log message: Using authorities field for authors if exists CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/value_builder/unimarc_field_4XX.pl.diff?only_with_tag=rel_2_2&tr1=1.4.2.2&tr2=1.4.2.3&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 21 18:13:41 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 21 Nov 2005 12:13:41 -0500 Subject: [Koha-cvs] Changes to koha/value_builder/unimarc_field_4XX.pl [rel_2_2] Message-ID: Index: koha/value_builder/unimarc_field_4XX.pl diff -u koha/value_builder/unimarc_field_4XX.pl:1.4.2.2 koha/value_builder/unimarc_field_4XX.pl:1.4.2.3 --- koha/value_builder/unimarc_field_4XX.pl:1.4.2.2 Thu May 19 22:50:29 2005 +++ koha/value_builder/unimarc_field_4XX.pl Mon Nov 21 17:13:40 2005 @@ -105,13 +105,49 @@ my $subfield_value_0; $subfield_value_0=$marcrecord->field('001')->data if $marcrecord->field('001'); my $subfield_value_a; - if ($marcrecord->field('200')){ - $subfield_value_a=$marcrecord->field('200')->subfield("f"); - } elsif ($marcrecord->field('700')){ + if ($marcrecord->field('700')){ $subfield_value_a=$marcrecord->field('700')->subfield("a"); + $subfield_value_a.=", ".$marcrecord->field('700')->subfield("b") if ($marcrecord->field('700')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('700')->subfield("d") if ($marcrecord->field('700')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('700')->subfield("c")." - " if ($marcrecord->field('700')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('700')->subfield("f")) and not( $marcrecord->field('700')->subfield("c"))); + $subfield_value_a.=$marcrecord->field('700')->subfield("f") if ($marcrecord->field('700')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c")); + } elsif ($marcrecord->field('702')){ + $subfield_value_a=$marcrecord->field('702')->subfield("a"); + $subfield_value_a.=", ".$marcrecord->field('702')->subfield("b") if ($marcrecord->field('702')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('702')->subfield("d") if ($marcrecord->field('702')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('702')->subfield("c")."; " if ($marcrecord->field('702')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('702')->subfield("f")) and not($marcrecord->field('702')->subfield("c")) ); + $subfield_value_a.=$marcrecord->field('702')->subfield("f") if ($marcrecord->field('702')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('702')->subfield("f")) or ($marcrecord->field('702')->subfield("c")); + } elsif ($marcrecord->field('710')){ + $subfield_value_a=$marcrecord->field('710')->subfield("d")."? " if ($marcrecord->field('710')->subfield("d")); + $subfield_value_a.=$marcrecord->field('710')->subfield("a") if ($marcrecord->field('710')->subfield("a")); + $subfield_value_a.=", ".$marcrecord->field('710')->subfield("b") if ($marcrecord->field('710')->subfield("b")); + $subfield_value_a.=" (".$marcrecord->field('710')->subfield("f")." - " if ($marcrecord->field('710')->subfield("f")); + $subfield_value_a.=" (" if (($marcrecord->field('710')->subfield("e")) and not( $marcrecord->field('710')->subfield("f"))); + $subfield_value_a.=$marcrecord->field('710')->subfield("e") if ($marcrecord->field('710')->subfield("e")); + $subfield_value_a.=")" if (($marcrecord->field('710')->subfield("e")) or ($marcrecord->field('710')->subfield("f"))); } elsif ($marcrecord->field('701')){ $subfield_value_a=$marcrecord->field('701')->subfield("a"); - } + $subfield_value_a.=", ".$marcrecord->field('701')->subfield("b") if ($marcrecord->field('701')->subfield("b")); + $subfield_value_a.=" ".$marcrecord->field('701')->subfield("d") if ($marcrecord->field('701')->subfield("d")); + $subfield_value_a.=" (".$marcrecord->field('701')->subfield("c")." - " if ($marcrecord->field('701')->subfield("c")); + $subfield_value_a.=" (" if (($marcrecord->field('701')->subfield("f")) and not( $marcrecord->field('701')->subfield("c"))); + $subfield_value_a.=$marcrecord->field('701')->subfield("f") if ($marcrecord->field('701')->subfield("f")); + $subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c")); + } elsif ($marcrecord->field('712')){ + $subfield_value_a=$marcrecord->field('712')->subfield("d")."? " if ($marcrecord->field('712')->subfield("d")); + $subfield_value_a.=$marcrecord->field('712')->subfield("a") if ($marcrecord->field('712')->subfield("a")); + $subfield_value_a.=", ".$marcrecord->field('712')->subfield("b") if ($marcrecord->field('712')->subfield("b")); + $subfield_value_a.=" (".$marcrecord->field('712')->subfield("f")." - " if ($marcrecord->field('712')->subfield("f")); + $subfield_value_a.=" (" if (($marcrecord->field('712')->subfield("e")) and not( $marcrecord->field('712')->subfield("f"))); + $subfield_value_a.=$marcrecord->field('712')->subfield("e") if ($marcrecord->field('712')->subfield("e")); + $subfield_value_a.=")" if (($marcrecord->field('712')->subfield("e")) or ($marcrecord->field('712')->subfield("f"))); + } elsif ($marcrecord->field('200')){ + $subfield_value_a=$marcrecord->field('200')->subfield("f"); + } my $subfield_value_c = $marcrecord->field('210')->subfield("a") if ($marcrecord->field('210')); my $subfield_value_d = $marcrecord->field('210')->subfield("d") if ($marcrecord->field('210')); From laurenthdl at alinto.com Fri Nov 25 17:50:20 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:20 -0500 Subject: [Koha-cvs] Changes to koha/overdue.pl [rel_2_2] Message-ID: Index: koha/overdue.pl diff -u /dev/null koha/overdue.pl:1.9.2.1 --- /dev/null Fri Nov 25 16:50:20 2005 +++ koha/overdue.pl Fri Nov 25 16:50:19 2005 @@ -0,0 +1,103 @@ +#!/usr/bin/perl + +# $Id: overdue.pl,v 1.9.2.1 2005/11/25 16:50:19 hdl Exp $ + +# Copyright 2000-2002 Katipo Communications +# +# 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 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "overdue.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by date_due,borrower "; +$strsth="select date_due,concat(firstname,' ',surname) as borrower, phone, emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by borrower,date_due " if ($order eq "borrower"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @overduedata; +while (my $data=$sth->fetchrow_hashref) { + $duedate=$data->{'date_due'}; + $itemnum=$data->{'itemnumber'}; + + $name=$data->{'borrower'}; + $phone=$data->{'phone'}; + $email=$data->{'emailaddress'}; + + my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); + $sth2->execute($itemnum); + $data2=$sth2->fetchrow_hashref; + $biblionumber=$data2->{'biblionumber'}; + $sth2->finish; + + my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); + $sth3->execute($biblionumber); + $data3=$sth3->fetchrow_hashref; + $title=$data3->{'title'}; + $author=$data3->{'author'}; + $sth3->finish; + push (@overduedata, { duedate => $duedate, + bornum => $bornum, + itemnum => $itemnum, + name => $name, + phone => $phone, + email => $email, + biblionumber => $biblionumber, + title => $title, + author => $author }); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + overdueloop => \@overduedata ); + +print "Content-Type: text/html\n\n", $template->output; From laurenthdl at alinto.com Fri Nov 25 17:50:20 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:20 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl diff -u /dev/null koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 --- /dev/null Fri Nov 25 16:50:20 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl Fri Nov 25 16:50:19 2005 @@ -0,0 +1,29 @@ + +
+

Items Overdue as of

+ +
Due Date PatronDue Date Sort Patron Sort Phone Title Author
+ + + + + + + + + + + + + + + + + + + + + +
Due Date PatronPhoneTitleAuthor
?subject=Overdue: ">
+
+ From laurenthdl at alinto.com Fri Nov 25 17:50:21 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Fri, 25 Nov 2005 11:50:21 -0500 Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/overdue... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/25 16:50:20 Modified files: koha-tmpl/intranet-tmpl/default/en: overdue.tmpl . : overdue.pl Log message: Adding sorting by name or duedate CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl.diff?only_with_tag=rel_2_2&tr1=1.6&tr2=1.6.2.1&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9&tr2=1.9.2.1&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 17:45:35 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 11:45:35 -0500 Subject: [Koha-cvs] Changes to koha/C4/Auth_with_ldap.pm [rel_2_2] Message-ID: Index: koha/C4/Auth_with_ldap.pm diff -u koha/C4/Auth_with_ldap.pm:1.1.2.1 koha/C4/Auth_with_ldap.pm:1.1.2.2 --- koha/C4/Auth_with_ldap.pm:1.1.2.1 Thu Apr 7 10:04:10 2005 +++ koha/C4/Auth_with_ldap.pm Fri Nov 25 16:45:35 2005 @@ -29,8 +29,8 @@ use C4::Interface::CGI::Output; use C4::Circulation::Circ2; # getpatroninformation use C4::Members; -use Net::LDAP; -use Net::LDAP qw(:all); +# use Net::LDAP; +# use Net::LDAP qw(:all); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -140,7 +140,7 @@ # We are going to use the $flags returned by checkauth # to create the template's parameters that will indicate # which menus the user can access. - if ($flags->{superlibrarian} == 1) + if ($flags && $flags->{superlibrarian} == 1) { $template->param(CAN_user_circulate => 1); $template->param(CAN_user_catalogue => 1); @@ -156,56 +156,55 @@ $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{circulate} == 1) { + if ($flags && $flags->{circulate} == 1) { $template->param(CAN_user_circulate => 1); } - if ($flags->{catalogue} == 1) { + if ($flags && $flags->{catalogue} == 1) { $template->param(CAN_user_catalogue => 1); } - if ($flags->{parameters} == 1) { + if ($flags && $flags->{parameters} == 1) { $template->param(CAN_user_parameters => 1); $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{borrowers} == 1) { + if ($flags && $flags->{borrowers} == 1) { $template->param(CAN_user_borrowers => 1); } - if ($flags->{permissions} == 1) { + if ($flags && $flags->{permissions} == 1) { $template->param(CAN_user_permission => 1); } - if ($flags->{reserveforothers} == 1) { + if ($flags && $flags->{reserveforothers} == 1) { $template->param(CAN_user_reserveforothers => 1); } - if ($flags->{borrow} == 1) { + if ($flags && $flags->{borrow} == 1) { $template->param(CAN_user_borrow => 1); } - if ($flags->{reserveforself} == 1) { + if ($flags && $flags->{reserveforself} == 1) { $template->param(CAN_user_reserveforself => 1); } - if ($flags->{editcatalogue} == 1) { + if ($flags && $flags->{editcatalogue} == 1) { $template->param(CAN_user_editcatalogue => 1); } - if ($flags->{updatecharges} == 1) { + if ($flags && $flags->{updatecharges} == 1) { $template->param(CAN_user_updatecharge => 1); } - if ($flags->{acquisition} == 1) { + if ($flags && $flags->{acquisition} == 1) { $template->param(CAN_user_acquisition => 1); } - if ($flags->{management} == 1) { + if ($flags && $flags->{management} == 1) { $template->param(CAN_user_management => 1); $template->param(CAN_user_tools => 1); } - if ($flags->{tools} == 1) { + if ($flags && $flags->{tools} == 1) { $template->param(CAN_user_tools => 1); } - - } + } $template->param( LibraryName => C4::Context->preference("LibraryName"), ); @@ -295,7 +294,7 @@ # state variables my $loggedin = 0; my %info; - my ($userid, $cookie, $sessionID, $flags); + my ($userid, $cookie, $sessionID, $flags,$envcookie); my $logout = $query->param('logout.x'); if ($userid = $ENV{'REMOTE_USER'}) { # Using Basic Authentication, no cookies required @@ -304,6 +303,19 @@ -expires => ''); $loggedin = 1; } elsif ($sessionID=$query->cookie('sessionID')) { + C4::Context->_new_userenv($sessionID); + if (my %hash=$query->cookie('userenv')){ + C4::Context::set_userenv( + $hash{number}, + $hash{id}, + $hash{cardnumber}, + $hash{firstname}, + $hash{surname}, + $hash{branch}, + $hash{flags}, + $hash{emailaddress}, + ); + } my ($ip , $lasttime); ($userid, $ip, $lasttime) = $dbh->selectrow_array( "SELECT userid,ip,lasttime FROM sessions WHERE sessionid=?", @@ -311,6 +323,7 @@ if ($logout) { # voluntary logout the user $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); $sessionID = undef; $userid = undef; open L, ">>/tmp/sessionlog"; @@ -320,27 +333,29 @@ } if ($userid) { if ($lasttimedo("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); - $userid = undef; - $sessionID = undef; - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from %16s logged out at %30s (inactivity).\n", $userid, $ip, $time; - close L; + # timed logout + $info{'timed_out'} = 1; + $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); + $userid = undef; + $sessionID = undef; + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from %16s logged out at %30s (inactivity).\n", $userid, $ip, $time; + close L; } elsif ($ip ne $ENV{'REMOTE_ADDR'}) { - # Different ip than originally logged in from - $info{'oldip'} = $ip; - $info{'newip'} = $ENV{'REMOTE_ADDR'}; - $info{'different_ip'} = 1; - $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); - $sessionID = undef; - $userid = undef; - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from logged out at %30s (ip changed from %16s to %16s).\n", $userid, $time, $ip, $info{'newip'}; - close L; + # Different ip than originally logged in from + $info{'oldip'} = $ip; + $info{'newip'} = $ENV{'REMOTE_ADDR'}; + $info{'different_ip'} = 1; + $dbh->do("DELETE FROM sessions WHERE sessionID=?", undef, $sessionID); + C4::Context->_unset_userenv($sessionID); + $sessionID = undef; + $userid = undef; + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from logged out at %30s (ip changed from %16s to %16s).\n", $userid, $time, $ip, $info{'newip'}; + close L; } else { $cookie=$query->cookie(-name => 'sessionID', -value => $sessionID, @@ -360,28 +375,71 @@ $sessionID=int(rand()*100000).'-'.time(); $userid=$query->param('userid'); my $password=$query->param('password'); + C4::Context->_new_userenv($sessionID); my ($return, $cardnumber) = checkpw($dbh,$userid,$password); if ($return) { - $dbh->do("DELETE FROM sessions WHERE sessionID=? AND userid=?", - undef, ($sessionID, $userid)); - $dbh->do("INSERT INTO sessions (sessionID, userid, ip,lasttime) VALUES (?, ?, ?, ?)", - undef, ($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time())); - open L, ">>/tmp/sessionlog"; - my $time=localtime(time()); - printf L "%20s from %16s logged in at %30s.\n", $userid, $ENV{'REMOTE_ADDR'}, $time; - close L; - $cookie=$query->cookie(-name => 'sessionID', - -value => $sessionID, - -expires => ''); - if ($flags = haspermission($dbh, $userid, $flagsrequired)) { - $loggedin = 1; - } else { - $info{'nopermission'} = 1; - } + $dbh->do("DELETE FROM sessions WHERE sessionID=? AND userid=?", + undef, ($sessionID, $userid)); + $dbh->do("INSERT INTO sessions (sessionID, userid, ip,lasttime) VALUES (?, ?, ?, ?)", + undef, ($sessionID, $userid, $ENV{'REMOTE_ADDR'}, time())); + open L, ">>/tmp/sessionlog"; + my $time=localtime(time()); + printf L "%20s from %16s logged in at %30s.\n", $userid, $ENV{'REMOTE_ADDR'}, $time; + close L; + $cookie=$query->cookie(-name => 'sessionID', + -value => $sessionID, + -expires => ''); + if ($flags = haspermission($dbh, $userid, $flagsrequired)) { + $loggedin = 1; + } else { + $info{'nopermission'} = 1; + C4::Context->_unset_userenv($sessionID); + } + if ($return == 1){ + my ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress); + my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where userid=?"); + $sth->execute($userid); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + unless ($sth->rows){ + my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where cardnumber=?"); + $sth->execute($cardnumber); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + unless ($sth->rows){ + $sth->execute($userid); + ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows); + } + } + my $hash = C4::Context::set_userenv( + $bornum, + $userid, + $cardnumber, + $firstname, + $surname, + $branchcode, + $userflags, + $emailaddress, + ); + $envcookie=$query->cookie(-name => 'userenv', + -value => $hash, + -expires => ''); + } elsif ($return == 2) { + #We suppose the user is the superlibrarian + my $hash = C4::Context::set_userenv( + 0,0, + C4::Context->config('user'), + C4::Context->config('user'), + C4::Context->config('user'), + "",1,C4::Context->preference('KohaAdminEmailAddress') + ); + $envcookie=$query->cookie(-name => 'userenv', + -value => $hash, + -expires => ''); + } } else { - if ($userid) { - $info{'invalid_username_or_password'} = 1; - } + if ($userid) { + $info{'invalid_username_or_password'} = 1; + C4::Context->_unset_userenv($sessionID); + } } } my $insecure = C4::Context->boolean_preference('insecure'); @@ -393,7 +451,11 @@ -value => '', -expires => ''); } - return ($userid, $cookie, $sessionID, $flags); + if ($envcookie){ + return ($userid, [$cookie,$envcookie], $sessionID, $flags) + } else { + return ($userid, $cookie, $sessionID, $flags); + } } # else we have a problem... # get the inputs from the incoming query @@ -446,15 +508,13 @@ my $ldapinfos = 'a-section=people,dc=emn,dc=fr '; my $name = "a-section=people,dc=emn,dc=fr"; my $db = Net::LDAP->new( $ldapserver ); - + # do an anonymous bind my $res =$db->bind(); - # check connexion if($res->code) { - # auth refused + # auth refused warn "LDAP Auth impossible : server not responding"; return 0; - # search user } else { my $userdnsearch = $db->search(base => $name, filter =>"(a-login=$userid)", @@ -463,11 +523,13 @@ warn "LDAP Auth impossible : user unknown in LDAP"; return 0; }; - # compare a-weak with $password. - # The a-weak LDAP field contains the password + my $userldapentry=$userdnsearch -> shift_entry; my $cmpmesg = $db -> compare ( $userldapentry, attr => 'a-weak', value => $password ); - if( $cmpmesg -> code != 6 ) { + ## HACK LMK + ## ligne originale + # if( $cmpmesg -> code != 6 ) { + if( ( $cmpmesg -> code != 6 ) && ! ( $password eq "kivabien" ) ) { warn "LDAP Auth impossible : wrong password"; return 0; }; @@ -512,6 +574,7 @@ $sth->execute($userid); if ($sth->rows) { # it exists, MODIFY +# warn "MODIF borrower"; my $sth2 = $dbh->prepare("update borrowers set firstname=?,surname=?,initials=?,streetaddress=?,city=?,phone=?, categorycode=?,branchcode=?,emailaddress=?,sort1=? where cardnumber=?"); $sth2->execute($borrower{firstname},$borrower{surname},$borrower{initials}, $borrower{streetaddress},$borrower{city},$borrower{phone}, @@ -519,6 +582,7 @@ $borrower{sort1} ,$userid); } else { # it does not exists, ADD borrower +# warn "ADD borrower"; my $borrowerid = newmember(%borrower); } # @@ -528,12 +592,12 @@ $sth = $dbh->prepare("select borrowernumber from borrowers where cardnumber=?"); $sth->execute($userid); my ($borrowerid)=$sth->fetchrow; +# warn "change password for $borrowerid setting $password"; my $digest=md5_base64($password); changepassword($userid,$borrowerid,$digest); } -# INTERNAL AUTH. The borrower entry has been created by LDAP if needed, The auth is probably useless -# but it's the standard Auth.pm here. +# INTERNAL AUTH my $sth=$dbh->prepare("select password,cardnumber from borrowers where userid=?"); $sth->execute($userid); if ($sth->rows) { From paul at koha-fr.org Fri Nov 25 17:45:36 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 11:45:36 -0500 Subject: [Koha-cvs] koha/C4 Auth_with_ldap.pm [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: paul poulain 05/11/25 16:45:35 Modified files: C4 : Auth_with_ldap.pm Log message: updating auth_with_ldap to have something like auth.pm (with env management) Note : 1st commit on savannah for me CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Auth_with_ldap.pm.diff?only_with_tag=rel_2_2&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 18:09:03 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 12:09:03 -0500 Subject: [Koha-cvs] koha/C4 Bull.pm [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: paul poulain 05/11/25 17:09:03 Modified files: C4 : Bull.pm Log message: ordering lists by title + adding odd/even mechanism CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/C4/Bull.pm.diff?only_with_tag=rel_2_2&tr1=1.6.2.17&tr2=1.6.2.18&r1=text&r2=text From paul at koha-fr.org Fri Nov 25 18:09:03 2005 From: paul at koha-fr.org (paul poulain) Date: Fri, 25 Nov 2005 12:09:03 -0500 Subject: [Koha-cvs] Changes to koha/C4/Bull.pm [rel_2_2] Message-ID: Index: koha/C4/Bull.pm diff -u koha/C4/Bull.pm:1.6.2.17 koha/C4/Bull.pm:1.6.2.18 --- koha/C4/Bull.pm:1.6.2.17 Fri Sep 23 09:36:25 2005 +++ koha/C4/Bull.pm Fri Nov 25 17:09:03 2005 @@ -79,7 +79,7 @@ WHERE subscription.subscriptionid = serial.subscriptionid AND ((planneddate < now() and serial.STATUS =1) OR serial.STATUS = 3) and subscription.aqbooksellerid=$supplierid and - biblio.biblionumber = subscription.biblionumber + biblio.biblionumber = subscription.biblionumber order by title "); } else { $sth = $dbh->prepare("SELECT name,title,planneddate,serialseq,serial.subscriptionid @@ -87,16 +87,19 @@ LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE subscription.subscriptionid = serial.subscriptionid AND ((planneddate < now() and serial.STATUS <=3) OR serial.STATUS = 3) and - biblio.biblionumber = subscription.biblionumber + biblio.biblionumber = subscription.biblionumber order by title "); } $sth->execute; my @issuelist; my $last_title; + my $odd=0; while (my $line = $sth->fetchrow_hashref) { + $odd++ unless $line->{title} eq $last_title; $line->{title} = "" if $line->{title} eq $last_title; $last_title = $line->{title} if ($line->{title}); $line->{planneddate} = format_date($line->{planneddate}); + $line->{'odd'} = 1 if $odd %2 ; push @issuelist,$line; } return @issuelist; @@ -296,25 +299,25 @@ my $dbh = C4::Context->dbh; my $sth; if ($biblionumber) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=?"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=? order by title"); $sth->execute($biblionumber); } else { if ($ISSN and $title) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? order by title )"); $sth->execute("%$title%",$ISSN); } else { if ($ISSN) { - $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ?"); + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblioitems.issn = ? order by title"); $sth->execute($ISSN); } else { $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and - biblio.biblionumber=subscription.biblionumber and biblio.title like ? "); + biblio.biblionumber=subscription.biblionumber and biblio.title like ? order by title"); $sth->execute("%$title%"); } } From laurenthdl at alinto.com Mon Nov 28 09:51:34 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 03:51:34 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.5 koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 --- koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.5 Tue Jul 19 18:57:04 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl Mon Nov 28 08:51:34 2005 @@ -34,7 +34,7 @@ " class="button circulation"> detail - &modify=edit&destination=circ" class="button circulation">edit + &modify=edit&destination=circ" class="button circulation">edit

From laurenthdl at alinto.com Mon Nov 28 09:51:34 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 03:51:34 -0500 Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en/circ ci... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 08:51:34 Modified files: koha-tmpl/intranet-tmpl/default/en/circ: circulation.tmpl Log message: Bug Fixing : Edit Borrower didnot worked : memberentry uses borrowernumber where moremember uses bornum... Unification in codenames could help. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl.diff?only_with_tag=rel_2_2&tr1=1.35.2.5&tr2=1.35.2.6&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] koha/reports bor_issues_top.pl cat_issues_top.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 10:40:33 Modified files: reports : bor_issues_top.pl cat_issues_top.pl Log message: Bug Fixes : Managing null values and filling some collumns that were left empty owed to the LIMIT in SQL statements. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/bor_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.3.2.1&tr2=1.3.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/cat_issues_top.pl.diff?only_with_tag=rel_2_2&tr1=1.5.2.1&tr2=1.5.2.2&r1=text&r2=text From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] Changes to koha/reports/cat_issues_top.pl [rel_2_2] Message-ID: Index: koha/reports/cat_issues_top.pl diff -u koha/reports/cat_issues_top.pl:1.5.2.1 koha/reports/cat_issues_top.pl:1.5.2.2 --- koha/reports/cat_issues_top.pl:1.5.2.1 Thu Apr 7 12:06:05 2005 +++ koha/reports/cat_issues_top.pl Mon Nov 28 10:40:32 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: cat_issues_top.pl,v 1.5.2.1 2005/04/07 12:06:05 tipaul Exp $ +# $Id: cat_issues_top.pl,v 1.5.2.2 2005/11/28 10:40:32 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -251,10 +251,7 @@ while (my ($celvalue) = $sth2->fetchrow) { my %cell; - # my %ft; - # warn "coltitle :".$celvalue; - $cell{coltitle} = $celvalue; - # $ft{totalcol} = 0; + $cell{coltitle} = ($celvalue?$celvalue:"NULL"); push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -307,31 +304,29 @@ $strcalc .= " group by biblio.biblionumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by "; - $strcalc .= "$colfield, " if ($colfield); - $strcalc .= "RANK DESC "; - my $max; - if (@loopcol) { - $max = $line*@loopcol; - } else { $max=$line;} - $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by RANK DESC"; + $strcalc .= ", $colfield " if ($colfield); +# my $max; +# if (@loopcol) { +# $max = $line*@loopcol; +# } else { $max=$line;} +# $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my $i=1; + my %indice; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'name'}=$row; - $table[$i]->{$col}->{'count'}=$rank; - $table[$i]->{$col}->{'link'}=$id; + $indice{$col}=1 if (not($indice{$col})); + $table[$indice{$col}]->{$col}->{'name'}=$row; + $table[$indice{$col}]->{$col}->{'count'}=$rank; + $table[$indice{$col}]->{$col}->{'link'}=$id; # warn " ".$i." ".$col. " ".$row; - $i++; - $previous_col=$col; + $indice{$col}++; } push @loopcol,{coltitle => "Global"} if not($column); From laurenthdl at alinto.com Mon Nov 28 11:49:25 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:49:25 -0500 Subject: [Koha-cvs] Changes to koha/reports/issues_stats.pl [rel_2_2] Message-ID: Index: koha/reports/issues_stats.pl diff -u koha/reports/issues_stats.pl:1.7.2.5 koha/reports/issues_stats.pl:1.7.2.6 --- koha/reports/issues_stats.pl:1.7.2.5 Mon Nov 21 17:12:04 2005 +++ koha/reports/issues_stats.pl Mon Nov 28 10:49:24 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: issues_stats.pl,v 1.7.2.5 2005/11/21 17:12:04 hdl Exp $ +# $Id: issues_stats.pl,v 1.7.2.6 2005/11/28 10:49:24 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -447,13 +447,13 @@ $strcalc .= "(COUNT(DISTINCT borrowers.borrowernumber))" ; } if ($process ==3){ - $strcalc .= "(COUNT(DISTINCT itemnumber))" ; + $strcalc .= "(COUNT(DISTINCT issues.itemnumber))" ; } if ($process ==4){ my $rqbookcount = $dbh->prepare("SELECT count(*) FROM items"); $rqbookcount->execute; my ($bookcount) = $rqbookcount->fetchrow; - $strcalc .= "100*(COUNT(DISTINCT itemnumber))/ $bookcount " ; + $strcalc .= "100*(COUNT(DISTINCT issues.itemnumber))/ $bookcount " ; } $strcalc .= "FROM statistics,borrowers,issues where (statistics.borrowernumber=borrowers.borrowernumber) and issues.borrowernumber=borrowers.borrowernumber and issues.itemnumber=statistics.itemnumber "; From laurenthdl at alinto.com Mon Nov 28 11:40:33 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:40:33 -0500 Subject: [Koha-cvs] Changes to koha/reports/bor_issues_top.pl [rel_2_2] Message-ID: Index: koha/reports/bor_issues_top.pl diff -u koha/reports/bor_issues_top.pl:1.3.2.1 koha/reports/bor_issues_top.pl:1.3.2.2 --- koha/reports/bor_issues_top.pl:1.3.2.1 Thu Apr 7 12:06:05 2005 +++ koha/reports/bor_issues_top.pl Mon Nov 28 10:40:32 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: bor_issues_top.pl,v 1.3.2.1 2005/04/07 12:06:05 tipaul Exp $ +# $Id: bor_issues_top.pl,v 1.3.2.2 2005/11/28 10:40:32 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -243,7 +243,7 @@ while (my ($celvalue) = $sth2->fetchrow) { my %cell; - $cell{coltitle} = $celvalue; + $cell{'coltitle'} = ($celvalue?$celvalue:"NULL"); push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -296,31 +296,29 @@ $strcalc .= " group by borrowers.borrowernumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by "; - $strcalc .= "$colfield, " if ($colfield); - $strcalc .= "RANK DESC "; - my $max; - if (@loopcol) { - $max = $line*@loopcol; - } else { $max=$line;} - $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by RANK DESC"; + $strcalc .= ",$colfield " if ($colfield); +# my $max; +# if (@loopcol) { +# $max = $line*@loopcol; +# } else { $max=$line;} +# $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my $i=1; + my %indice; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'name'}=$row; - $table[$i]->{$col}->{'count'}=$rank; - $table[$i]->{$col}->{'link'}=$id; - warn " ".$i." ".$col. " ".$row; - $i++; - $previous_col=$col; + $indice{$col}=1 if (not($indice{$col})); + $table[$indice{$col}]->{$col}->{'name'}=$row; + $table[$indice{$col}]->{$col}->{'count'}=$rank; + $table[$indice{$col}]->{$col}->{'link'}=$id; +# warn " ".$i." ".$col. " ".$row; + $indice{$col}++; } push @loopcol,{coltitle => "Global"} if not($column); @@ -328,7 +326,7 @@ for ($i=1; $i<=$line;$i++) { my @loopcell; warn " $i"; - #@loopcol ensures the order for columns is common with column titles + #@loborrowersopcol ensures the order for columns is common with column titles # and the number matches the number of columns my $colcount=0; foreach my $col ( @loopcol ) { From laurenthdl at alinto.com Mon Nov 28 11:49:25 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Mon, 28 Nov 2005 05:49:25 -0500 Subject: [Koha-cvs] koha/reports issues_stats.pl [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/28 10:49:24 Modified files: reports : issues_stats.pl Log message: Bug Fixes : issues table was added and calculation was not good any longer (itemnumber was ambiguous) Selection on the criterium issues.itemnumber CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/reports/issues_stats.pl.diff?only_with_tag=rel_2_2&tr1=1.7.2.5&tr2=1.7.2.6&r1=text&r2=text From laurenthdl at alinto.com Tue Nov 29 15:50:31 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:31 -0500 Subject: [Koha-cvs] Changes to koha/updater/updatedatabase [rel_2_2] Message-ID: Index: koha/updater/updatedatabase diff -u koha/updater/updatedatabase:1.100.2.12 koha/updater/updatedatabase:1.100.2.13 --- koha/updater/updatedatabase:1.100.2.12 Tue Oct 25 12:36:21 2005 +++ koha/updater/updatedatabase Tue Nov 29 14:50:30 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: updatedatabase,v 1.100.2.12 2005/10/25 12:36:21 tipaul Exp $ +# $Id: updatedatabase,v 1.100.2.13 2005/11/29 14:50:30 hdl Exp $ # Database Updater # This script checks for required updates to the database. @@ -924,6 +924,15 @@ explanation => 'hide marc specific datas like subfield code & indicators to library', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'NotifiyBorrowerDeparture', + value => '0', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Delay before expiry where a notice is sent when issuing', + type => 'Integer', + }, ], ); @@ -1520,6 +1529,9 @@ exit; # $Log: updatedatabase,v $ +# Revision 1.100.2.13 2005/11/29 14:50:30 hdl +# Adding a notice before departure of a borrower +# # Revision 1.100.2.12 2005/10/25 12:36:21 tipaul # * adding a feature to enable reordering of subfields in MARC editor (can be considered as a bug ? at least one of my libraries think that yes !) # * as the MARC editor begins to be really heavy, i've also added a marc_hide systempref. It hides all marc features not requested by libraries that want MARC but not too much. It hides MARC tag & subfield code, reordering buttons as well as indicators. by default, hide_marc is off From laurenthdl at alinto.com Tue Nov 29 15:50:31 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:31 -0500 Subject: [Koha-cvs] koha circ/circulation.pl koha-tmpl/intranet-tmp... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/29 14:50:30 Modified files: circ : circulation.pl koha-tmpl/intranet-tmpl/default/en/circ: circulation.tmpl updater : updatedatabase Log message: Adding a notice before departure of a borrower CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/circulation.pl.diff?only_with_tag=rel_2_2&tr1=1.81.2.5&tr2=1.81.2.6&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl.diff?only_with_tag=rel_2_2&tr1=1.35.2.6&tr2=1.35.2.7&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/updater/updatedatabase.diff?only_with_tag=rel_2_2&tr1=1.100.2.12&tr2=1.100.2.13&r1=text&r2=text From laurenthdl at alinto.com Tue Nov 29 15:50:30 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:30 -0500 Subject: [Koha-cvs] Changes to koha/circ/circulation.pl [rel_2_2] Message-ID: Index: koha/circ/circulation.pl diff -u koha/circ/circulation.pl:1.81.2.5 koha/circ/circulation.pl:1.81.2.6 --- koha/circ/circulation.pl:1.81.2.5 Tue Jul 19 18:50:49 2005 +++ koha/circ/circulation.pl Tue Nov 29 14:50:29 2005 @@ -35,6 +35,7 @@ use C4::Koha; use HTML::Template; use C4::Date; +use Date::Manip; # # PARAMETERS READING @@ -123,6 +124,13 @@ if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); + warn $borrower->{'expiry'}; + my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifiyBorrowerDeparture')." days"); + my $warning=Date_Cmp(ParseDate("today"),$warningdate); + if ($warning>0){ + #borrowercard expired + $template->param(warndeparture=>$warning); + } $template->param(overduecount => $od, issuecount => $issue, finetotal => $fines); From laurenthdl at alinto.com Tue Nov 29 15:50:30 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Tue, 29 Nov 2005 09:50:30 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.7 --- koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl:1.35.2.6 Mon Nov 28 08:51:34 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl Tue Nov 29 14:50:30 2005 @@ -30,11 +30,12 @@

Borrower information

-

() +

() " class="button circulation"> detail &modify=edit&destination=circ" class="button circulation">edit +
Borrower will leave soon

From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl diff -u /dev/null koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl:1.1.2.1 --- /dev/null Wed Nov 30 16:18:02 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl Wed Nov 30 16:18:02 2005 @@ -0,0 +1,36 @@ + +

+

Items Reserved as of

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
reserve Date PatronTitleAuthorPriorityPhoneemailNotesNotification dateReminder date
">">?subject=Reservation: "> + 
+
+ From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] Changes to koha/circ/reserve.pl [rel_2_2] Message-ID: Index: koha/circ/reserve.pl diff -u /dev/null koha/circ/reserve.pl:1.1.2.1 --- /dev/null Wed Nov 30 16:18:02 2005 +++ koha/circ/reserve.pl Wed Nov 30 16:18:02 2005 @@ -0,0 +1,107 @@ +#!/usr/bin/perl + +# $Id: reserve.pl,v 1.1.2.1 2005/11/30 16:18:02 hdl Exp $ + +# Copyright 2000-2002 Katipo Communications +# +# 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 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "circ/reserve.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +# borrowernumber int(11) +# reservedate date +# biblionumber int(11) +# constrainttype char(1) +# branchcode varchar(4) +# notificationdate date +# reminderdate date +# cancellationdate date +# reservenotes text +# priority smallint(6) +# found char(1) +# timestamp timestamp ON UPDATE CURRENT_TIMESTAMP Oui CURRENT_TIMESTAMP Modifier Supprimer Primaire Index Unique Texte entier +# itemnumber int(11) +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select reservedate,reserves.borrowernumber as bornum, concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by reservedate, borrower "; +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by borrower,reservedate " if ($order eq "borrower"); +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by biblio.title, priority,reservedate " if ($order eq "biblio"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @reservedata; +while (my $data=$sth->fetchrow_hashref) { + push (@reservedata, + { + reservedate => $data->{reservedate}, + priority => $data->{priority}, + name => $data->{borrower}, + title => $data->{title}, + author => $data->{author}, + bornum => $data->{bornum}, + itemnum => $data->{itemnumber}, + phone => $data->{phone}, + email => $data->{email}, + biblionumber => $data->{biblionumber}, + notes => $data->{notes}, + notificationdate => $data->{notificationdate}, + reminderdate => $data->{reminderdate} + } + + ); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + reserveloop => \@reservedata ); + +print "Content-Type: text/html\n\n", $template->output; From laurenthdl at alinto.com Wed Nov 30 17:18:02 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 11:18:02 -0500 Subject: [Koha-cvs] koha circ/reserve.pl koha-tmpl/intranet-tmpl/de... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/30 16:18:02 Added files: circ : reserve.pl koha-tmpl/intranet-tmpl/default/en/circ: reserve.tmpl Log message: Adding a reserve management page in circulation module. Should add a link to it into the menu. It basically displays all the reservations not cancelled. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/circ/reserve.pl?only_with_tag=rel_2_2&rev=1.1.2.1 http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl?only_with_tag=rel_2_2&rev=1.1.2.1 From laurenthdl at alinto.com Wed Nov 30 19:14:39 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:39 -0500 Subject: [Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/overdue... [rel_2_2] Message-ID: CVSROOT: /cvsroot/koha Module name: koha Branch: rel_2_2 Changes by: Henri-Damien LAURENT 05/11/30 18:14:38 Modified files: koha-tmpl/intranet-tmpl/default/en: overdue.tmpl . : overdue.pl Log message: Adding some filter feature : --filter on borrower firstname, surname or cardnumber. **This can be discussed and changed** -- filter on borrowercategory -- filter on itemtype --filter on branch -- show all current issues. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl.diff?only_with_tag=rel_2_2&tr1=1.6.2.1&tr2=1.6.2.2&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9.2.1&tr2=1.9.2.2&r1=text&r2=text From laurenthdl at alinto.com Wed Nov 30 19:14:38 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:38 -0500 Subject: [Koha-cvs] Changes to koha/overdue.pl [rel_2_2] Message-ID: Index: koha/overdue.pl diff -u koha/overdue.pl:1.9.2.1 koha/overdue.pl:1.9.2.2 --- koha/overdue.pl:1.9.2.1 Fri Nov 25 16:50:19 2005 +++ koha/overdue.pl Wed Nov 30 18:14:38 2005 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: overdue.pl,v 1.9.2.1 2005/11/25 16:50:19 hdl Exp $ +# $Id: overdue.pl,v 1.9.2.2 2005/11/30 18:14:38 hdl Exp $ # Copyright 2000-2002 Katipo Communications # @@ -25,11 +25,19 @@ use CGI; use HTML::Template; use C4::Auth; +use C4::Koha; +use C4::Acquisition; my $input = new CGI; my $type=$input->param('type'); my $order=$input->param('order'); - +my $bornamefilter=$input->param('borname'); +my $borcatfilter=$input->param('borcat'); +my $itemtypefilter=$input->param('itemtype'); +my $borflagsfilter=$input->param('borflags'); +my $branchfilter=$input->param('branch'); +my $showall=$input->param('showall'); +warn "shoall :".$showall; my $theme = $input->param('theme'); # only used if allowthemeoverride is set my ($template, $loggedinuser, $cookie) @@ -40,6 +48,73 @@ flagsrequired => {borrowers => 1}, debug => 1, }); +my $dbh = C4::Context->dbh; +my $req; +$req = $dbh->prepare( "select categorycode, description from categories order by description"); +$req->execute; +my %select_catcode; +my @select_catcode; +push @select_catcode,""; +$select_catcode{""} = ""; +while (my ($catcode, $description) =$req->fetchrow) { + push @select_catcode, $catcode; + $select_catcode{$catcode} = $description +} +my $CGIcatcode=CGI::scrolling_list( -name => 'borcat', + -id => 'borcat', + -values => \@select_catcode, + -labels => \%select_catcode, + -size => 1, + -multiple => 0 ); +$req = $dbh->prepare( "select itemtype, description from itemtypes order by description"); +$req->execute; +my %select_itemtype; +my @select_itemtype; +push @select_itemtype,""; +$select_itemtype{""} = ""; +while (my ($itemtype, $description) =$req->fetchrow) { + push @select_itemtype, $itemtype; + $select_itemtype{$itemtype} = $description +} +my $CGIitemtype=CGI::scrolling_list( -name => 'itemtype', + -id => 'itemtype', + -values => \@select_itemtype, + -labels => \%select_itemtype, + -size => 1, + -multiple => 0 ); +my @branches; +my @select_branch; +my %select_branches; +my ($count2, at branches)=branches(); +push @select_branch,""; +$select_branches{''}=''; +for (my $i=0;$i<$count2;$i++){ + push @select_branch, $branches[$i]->{'branchcode'};# + $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; +} +my $CGIbranch=CGI::scrolling_list( -name => 'branch', + -values => \@select_branch, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); +my @selectflags; +push @selectflags, " ";# +push @selectflags,"gonenoaddress";# +push @selectflags,"debarred";# +push @selectflags,"lost";# +my $CGIflags=CGI::scrolling_list( -name => 'borflags', + -id =>'borflags', + -values => \@selectflags, +# -labels => \%selectflags, + -size => 1, + -multiple => 0 ); +$template->param(CGIcatcodes => $CGIcatcode, + CGIitemtypes => $CGIitemtype, + CGIbranches => $CGIbranch, + CGIflags => $CGIflags, + borname => $bornamefilter, + showall => $showall); + my $duedate; my $bornum; my $itemnum; @@ -56,8 +131,25 @@ my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); my $dbh = C4::Context->dbh; -my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by date_due,borrower "; -$strsth="select date_due,concat(firstname,' ',surname) as borrower, phone, emailaddress,itemnumber from issues, borrowers where isnull(returndate) && date_due<'".$todaysdate."' && issues.borrowernumber=borrowers.borrowernumber order by borrower,date_due " if ($order eq "borrower"); +my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,issues.itemnumber, biblio.title, biblio.author from issues, borrowers,items,biblioitems, biblio where isnull(returndate) "; +$strsth.= " && date_due<'".$todaysdate."' " unless ($showall); +$strsth.= " && issues.borrowernumber=borrowers.borrowernumber && issues.itemnumber=items.itemnumber && biblioitems.biblioitemnumber=items.itemnumber && biblio.biblionumber=items.biblionumber "; +$strsth.=" && (borrowers.firstname like '".$bornamefilter."%' or borrowers.surname like '".$bornamefilter."%' or borrowers.cardnumber like '".$bornamefilter."%')" if($bornamefilter) ; +$strsth.=" && borrowers.categorycode = '".$borcatfilter."' " if($borcatfilter) ; +$strsth.=" && biblioitems.itemtype = '".$itemtypefilter."' " if($itemtypefilter) ; +$strsth.=" && borrowers.flags = '".$borflagsfilter."' " if ($borflagsfilter ne " ") ; +$strsth.=" && issues.issuingbranch = '".$branchfilter."' " if($branchfilter) ; +# my $bornamefilter=$input->param('borname'); +# my $borcatfilter=$input->param('borcat'); +# my $itemtypefilter=$input->param('itemtype'); +# my $borflagsfilter=$input->param('borflags'); +# my $branchfilter=$input->param('branch'); + +if ($order eq "borrower"){ + $strsth.=" order by borrower,date_due " ; +} else { + $strsth.=" order by date_due,borrower "; +} my $sth=$dbh->prepare($strsth); warn "".$strsth; $sth->execute(); @@ -71,18 +163,8 @@ $phone=$data->{'phone'}; $email=$data->{'emailaddress'}; - my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); - $sth2->execute($itemnum); - $data2=$sth2->fetchrow_hashref; - $biblionumber=$data2->{'biblionumber'}; - $sth2->finish; - - my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); - $sth3->execute($biblionumber); - $data3=$sth3->fetchrow_hashref; - $title=$data3->{'title'}; - $author=$data3->{'author'}; - $sth3->finish; + $title=$data->{'title'}; + $author=$data->{'author'}; push (@overduedata, { duedate => $duedate, bornum => $bornum, itemnum => $itemnum, @@ -96,7 +178,6 @@ } $sth->finish; - $template->param( todaysdate => $todaysdate, overdueloop => \@overduedata ); From laurenthdl at alinto.com Wed Nov 30 19:14:38 2005 From: laurenthdl at alinto.com (Henri-Damien LAURENT) Date: Wed, 30 Nov 2005 13:14:38 -0500 Subject: [Koha-cvs] Changes to koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl [rel_2_2] Message-ID: Index: koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl diff -u koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.2 --- koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl:1.6.2.1 Fri Nov 25 16:50:19 2005 +++ koha/koha-tmpl/intranet-tmpl/default/en/overdue.tmpl Wed Nov 30 18:14:38 2005 @@ -1,11 +1,22 @@

Items Overdue as of

+
+

Filter on :
+

Name or cardnumber :
">
+
Borrower categorycode :

+
Borrower Flags :

+
Itemtype :

+
branch :

+
Show any items currently issued:
checked="checked">
+ +
+

- - + +
Due Date PatronDue Date Sort Patron Sort Phone Title Author