Browse Source

merging 2.2 branch with head. Sorry for not making it before, many many commits done here

3.0.x
tipaul 18 years ago
parent
commit
93ff09d081
  1. 2
      C4/Acquisition.pm
  2. 36
      C4/AuthoritiesMarc.pm
  3. 89
      C4/Biblio.pm
  4. 75
      C4/Bull.pm
  5. 2
      C4/Circulation/Circ2.pm
  6. 1
      C4/Context.pm
  7. 39
      C4/Search.pm
  8. 41
      C4/SearchMarc.pm
  9. 27
      ISBDdetail.pl
  10. 34
      MARCdetail.pl
  11. 1
      about.pl
  12. 10
      acqui.simple/addbiblio.pl
  13. 3
      acqui/addorder.pl
  14. 2
      admin/auth_subfields_structure.pl
  15. 5
      admin/auth_tag_structure.pl
  16. 6
      admin/marc_subfields_structure.pl
  17. 23
      admin/marctagstructure.pl
  18. 16
      authorities/auth_finder.pl
  19. 2
      authorities/authorities-home.pl
  20. 3
      bull-home.pl
  21. 2
      bull/statecollection.pl
  22. 11
      bull/subscription-detail.pl
  23. 2
      circ/circulation.pl
  24. 124
      detail.pl
  25. 42
      koha-tmpl/intranet-tmpl/default/en/about.tmpl
  26. 20
      koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl
  27. 10
      koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl
  28. 8
      koha-tmpl/intranet-tmpl/default/en/acqui/histsearch.tmpl
  29. 35
      koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl
  30. 16
      koha-tmpl/intranet-tmpl/default/en/acqui/supplier.tmpl
  31. 22
      koha-tmpl/intranet-tmpl/default/en/authorities/auth_finder.tmpl
  32. 22
      koha-tmpl/intranet-tmpl/default/en/authorities/authorities-home.tmpl
  33. 22
      koha-tmpl/intranet-tmpl/default/en/authorities/searchresultlist-auth.tmpl
  34. 2
      koha-tmpl/intranet-tmpl/default/en/bull/bull-home.tmpl
  35. 14
      koha-tmpl/intranet-tmpl/default/en/bull/result.tmpl
  36. 3
      koha-tmpl/intranet-tmpl/default/en/bull/subscription-detail.tmpl
  37. 9
      koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl
  38. 74
      koha-tmpl/intranet-tmpl/default/en/catalogue/detail.tmpl
  39. 15
      koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl
  40. 26
      koha-tmpl/intranet-tmpl/default/en/export/marc.tmpl
  41. 3
      koha-tmpl/intranet-tmpl/default/en/help/search.marc/search.tmpl
  42. 5
      koha-tmpl/intranet-tmpl/default/en/members/member.tmpl
  43. 5
      koha-tmpl/intranet-tmpl/default/en/members/memberentry.tmpl
  44. 7
      koha-tmpl/intranet-tmpl/default/en/members/members-home.tmpl
  45. 61
      koha-tmpl/intranet-tmpl/default/en/members/moremember-print.tmpl
  46. 42
      koha-tmpl/intranet-tmpl/default/en/members/moremember-receipt.tmpl
  47. 98
      koha-tmpl/intranet-tmpl/default/en/members/moremember.tmpl
  48. 9
      koha-tmpl/intranet-tmpl/default/en/members/readingrec.tmpl
  49. 1
      koha-tmpl/intranet-tmpl/default/en/parameters/auth_tag_structure.tmpl
  50. 4
      koha-tmpl/intranet-tmpl/default/en/parameters/categorie.tmpl
  51. 4
      koha-tmpl/intranet-tmpl/default/en/parameters/issuingrules.tmpl
  52. 16
      koha-tmpl/intranet-tmpl/default/en/parameters/itemtypes.tmpl
  53. 2
      koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl
  54. 6
      koha-tmpl/intranet-tmpl/default/en/search.marc/result.tmpl
  55. 2
      koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_100.tmpl
  56. 8
      koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_116.tmpl
  57. 24
      koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_126a.tmpl
  58. 48
      koha-tmpl/intranet-tmpl/default/fr/about.tmpl
  59. 2
      koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbiblio-nomarc.tmpl
  60. 22
      koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbiblio.tmpl
  61. 2
      koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbooks.tmpl
  62. 4
      koha-tmpl/intranet-tmpl/default/fr/acqui.simple/additem.tmpl
  63. 8
      koha-tmpl/intranet-tmpl/default/fr/acqui.simple/isbnsearch.tmpl
  64. 2
      koha-tmpl/intranet-tmpl/default/fr/acqui/acqui-home.tmpl
  65. 2
      koha-tmpl/intranet-tmpl/default/fr/acqui/acquire.tmpl
  66. 8
      koha-tmpl/intranet-tmpl/default/fr/acqui/histsearch.tmpl
  67. 2
      koha-tmpl/intranet-tmpl/default/fr/acqui/newbasket2.tmpl
  68. 2
      koha-tmpl/intranet-tmpl/default/fr/acqui/newbiblio.tmpl
  69. 4
      koha-tmpl/intranet-tmpl/default/fr/authorities/authorities.tmpl
  70. 2
      koha-tmpl/intranet-tmpl/default/fr/barcodes/barcodes-top.inc
  71. 359
      koha-tmpl/intranet-tmpl/default/fr/barcodes/barcodes.tmpl
  72. 2
      koha-tmpl/intranet-tmpl/default/fr/bull/bull-home.tmpl
  73. 14
      koha-tmpl/intranet-tmpl/default/fr/bull/result.tmpl
  74. 2
      koha-tmpl/intranet-tmpl/default/fr/bull/search.tmpl
  75. 2
      koha-tmpl/intranet-tmpl/default/fr/bull/subscription-add.tmpl
  76. 3
      koha-tmpl/intranet-tmpl/default/fr/bull/subscription-detail.tmpl
  77. 48
      koha-tmpl/intranet-tmpl/default/fr/catalogue/MARCdetail.tmpl
  78. 68
      koha-tmpl/intranet-tmpl/default/fr/catalogue/detail.tmpl
  79. 2
      koha-tmpl/intranet-tmpl/default/fr/catalogue/searchresults.tmpl
  80. 17
      koha-tmpl/intranet-tmpl/default/fr/circ/circulation.tmpl
  81. 2
      koha-tmpl/intranet-tmpl/default/fr/circ/selectbranchprinter.tmpl
  82. 15
      koha-tmpl/intranet-tmpl/default/fr/errors/400.tmpl
  83. 15
      koha-tmpl/intranet-tmpl/default/fr/errors/401.tmpl
  84. 15
      koha-tmpl/intranet-tmpl/default/fr/errors/402.tmpl
  85. 15
      koha-tmpl/intranet-tmpl/default/fr/errors/403.tmpl
  86. 15
      koha-tmpl/intranet-tmpl/default/fr/errors/404.tmpl
  87. 15
      koha-tmpl/intranet-tmpl/default/fr/errors/405.tmpl
  88. 17
      koha-tmpl/intranet-tmpl/default/fr/errors/500.tmpl
  89. 24
      koha-tmpl/intranet-tmpl/default/fr/export/marc.tmpl
  90. 8
      koha-tmpl/intranet-tmpl/default/fr/help/admin/aqbookfund.tmpl
  91. 4
      koha-tmpl/intranet-tmpl/default/fr/help/admin/biblio_framework.tmpl
  92. 16
      koha-tmpl/intranet-tmpl/default/fr/help/admin/categorie.tmpl
  93. 2
      koha-tmpl/intranet-tmpl/default/fr/help/admin/checkmarc.tmpl
  94. 2
      koha-tmpl/intranet-tmpl/default/fr/help/admin/currency.tmpl
  95. 2
      koha-tmpl/intranet-tmpl/default/fr/help/admin/issuingrules.tmpl
  96. 6
      koha-tmpl/intranet-tmpl/default/fr/help/admin/itemtypes.tmpl
  97. 6
      koha-tmpl/intranet-tmpl/default/fr/help/admin/koha2marclinks.tmpl
  98. 10
      koha-tmpl/intranet-tmpl/default/fr/help/admin/marc_subfields_structure.tmpl
  99. 10
      koha-tmpl/intranet-tmpl/default/fr/help/admin/marctagstructure.tmpl
  100. 31
      koha-tmpl/intranet-tmpl/default/fr/help/admin/systempreferences.tmpl

2
C4/Acquisition.pm

@ -599,7 +599,7 @@ sub ordersearch {
sub histsearch {
my ($title,$author,$name)=@_;
my $dbh= C4::Context->dbh;
my $query = "select biblio.title,aqorders.basketno,name,aqbasket.creationdate,aqorders.datereceived, aqorders.quantity
my $query = "select biblio.title,aqorders.basketno,name,aqbasket.creationdate,aqorders.datereceived, aqorders.quantity, aqorders.ecost
from aqorders,aqbasket,aqbooksellers,biblio
where aqorders.basketno=aqbasket.basketno and aqbasket.booksellerid=aqbooksellers.id and
biblio.biblionumber=aqorders.biblionumber";

36
C4/AuthoritiesMarc.pm

@ -61,7 +61,24 @@ sub authoritysearch {
# where m1.authid=m2.authid and
# (m1.subfieldvalue like "Des%" and m2.subfieldvalue like "27%")
# the marclist may contain "mainentry". In this case, search the tag_to_report, that depends on
# the authtypecode. Then, search on $a of this tag_to_report
for (my $i=0;$i<$#{$tags};$i++) {
if (@$tags[$i] eq "mainentry") {
my $sth = $dbh->prepare("select auth_tag_to_report from auth_types where authtypecode=?");
$sth->execute($authtypecode);
my ($tag_to_report) = $sth->fetchrow;
@$tags[$i] = $tag_to_report."a";
}
}
# "Normal" statements
# quote marc fields/subfields
for (my $i=0;$i<$#{$tags};$i++) {
if (@$tags[$i]) {
@$tags[$i] = $dbh->quote(@$tags[$i]);
}
}
my @normal_tags = ();
my @normal_and_or = ();
my @normal_operator = ();
@ -511,7 +528,11 @@ sub AUTHmodauthority {
# 2nd recreate it
&AUTHdelauthority($dbh,$authid,1);
&AUTHaddauthority($dbh,$record,$authid,AUTHfind_authtypecode($dbh,$authid));
# FIXME : modify the authority in biblio too.
# save the file in localfile/modified_authorities
my $filename = C4::Context->config("intranetdir")."/localfile/modified_authorities/$authid.authid";
open AUTH, "> $filename";
print AUTH $authid;
close AUTH;
}
sub AUTHdelauthority {
@ -837,6 +858,19 @@ Paul POULAIN paul.poulain@free.fr
# $Id$
# $Log$
# Revision 1.10 2005/03/01 13:40:48 tipaul
# merging 2.2 branch with head. Sorry for not making it before, many many commits done here
#
# Revision 1.9.2.2 2005/02/28 14:03:13 tipaul
# * adding search on "main entry" (ie $a subfield) on a given authority (the "search everywhere" field is still here).
# * adding a select box to requet "contain" or "begin with" search.
# * fixing some bug in authority search (related to "main entry" search)
#
# Revision 1.9.2.1 2005/02/24 13:12:13 tipaul
# saving authority modif in a text file. This will be used soon with another script (in crontab). The script in crontab will retrieve every authorityid in the directory localfile/authorities and modify every biblio using this authority. Those modifs may be long. So they can't be done through http, because we may encounter a webserver timeout, and kill the process before end of the job.
# So, it will be done through a cron job.
# (/me agree we need some doc for command line scripts)
#
# Revision 1.9 2004/12/23 09:48:11 tipaul
# Minor changes in summary "exploding" (the 3 digits AFTER the subfield were not on the right place).
#

89
C4/Biblio.pm

@ -66,6 +66,7 @@ $VERSION = 0.01;
&MARCkoha2marcItem &MARChtml2marc
&MARCgetbiblio &MARCgetitem
&MARCaddword &MARCdelword
&MARCdelsubfield
&char_decode
&FindDuplicate
@ -201,6 +202,7 @@ MARCfindsubfieldid find a subfieldid for a bibid/tag/tagorder/subfield/subfieldo
=item &MARCdelsubfield($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder);
MARCdelsubfield delete a subfield for a bibid/tag/tagorder/subfield/subfieldorder
If $subfieldorder is not set, delete all the $tag$subfield subfields
=item &MARCdelbiblio($dbh,$bibid);
@ -878,11 +880,26 @@ sub MARCdelsubfield {
# delete a subfield for $bibid / tag / tagorder / subfield / subfieldorder
my ( $dbh, $bibid, $tag, $tagorder, $subfield, $subfieldorder ) = @_;
$dbh->do( "delete from marc_subfield_table where bibid='$bibid' and
tag='$tag' and tagorder='$tagorder'
and subfieldcode='$subfield' and subfieldorder='$subfieldorder'
"
);
if ($subfieldorder) {
$dbh->do( "delete from marc_subfield_table where bibid='$bibid' and
tag='$tag' and tagorder='$tagorder'
and subfieldcode='$subfield' and subfieldorder='$subfieldorder'
"
);
$dbh->do( "delete from marc_word where bibid='$bibid' and
tagsubfield='$tag$subfield' and tagorder='$tagorder'
and subfieldorder='$subfieldorder'
"
);
} else {
$dbh->do( "delete from marc_subfield_table where bibid='$bibid' and
tag='$tag' and tagorder='$tagorder'
and subfieldcode='$subfield'"
);
$dbh->do( "delete from marc_word where bibid='$bibid' and
tagsubfield='$tag$subfield' and tagorder='$tagorder'"
);
}
}
sub MARCkoha2marcBiblio {
@ -956,7 +973,7 @@ sub MARCkoha2marcBiblio {
" SELECT subtitle FROM bibliosubtitle WHERE biblionumber=?");
$sth2->execute($biblionumber);
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "bibliosubtitle.title",
&MARCkoha2marcOnefield( $sth, $record, "bibliosubtitle.subtitle",
$row->{'subtitle'},'' );
}
return $record;
@ -1136,13 +1153,18 @@ sub MARCmarc2kohaOneField {
my $subfield;
( $tagfield, $subfield ) = MARCfind_marc_from_kohafield("",$kohatable.".".$kohafield,$frameworkcode);
foreach my $field ( $record->field($tagfield) ) {
if ( $field->subfield($subfield) ) {
if ( $result->{$kohafield} ) {
$result->{$kohafield} .= " | " . $field->subfield($subfield);
}
else {
$result->{$kohafield} = $field->subfield($subfield);
}
if ( $field->subfields ) {
my @subfields = $field->subfields();
foreach my $subfieldcount ( 0 .. $#subfields ) {
if ($subfields[$subfieldcount][0] eq $subfield) {
if ( $result->{$kohafield} ) {
$result->{$kohafield} .= " | " . $subfields[$subfieldcount][1];
}
else {
$result->{$kohafield} = $subfields[$subfieldcount][1];
}
}
}
}
}
# warn "OneField for $kohatable.$kohafield and $frameworkcode=> $tagfield, $subfield";
@ -1229,7 +1251,7 @@ sub NEWnewbiblio {
}
}
( $tagfield, $tagsubfield ) =
MARCfind_marc_from_kohafield( $dbh, "bibliosubtitle.title",$frameworkcode );
MARCfind_marc_from_kohafield( $dbh, "bibliosubtitle.subtitle",$frameworkcode );
my @subtitlefields = $record->field($tagfield);
foreach my $subtitlefield (@subtitlefields) {
my @subtitlesubfields = $subtitlefield->subfield($tagsubfield);
@ -1304,8 +1326,13 @@ sub NEWmodbiblio {
my @subtitlefields = $record->field($tagfield);
foreach my $subtitlefield (@subtitlefields) {
my @subtitlesubfields = $subtitlefield->subfield($tagsubfield);
# delete & create subtitle again because OLDmodsubtitle can't handle new subtitles
# between 2 modifs
$dbh->do("delete from bibliosubtitle where biblionumber=$oldbiblionumber");
foreach my $subfieldcount (0..$#subtitlesubfields) {
OLDmodsubtitle($dbh,$oldbiblionumber,$subtitlesubfields[$subfieldcount]);
foreach my $subtit(split /\||#/,$subtitlesubfields[$subfieldcount]) {
OLDnewsubtitle($dbh,$oldbiblionumber,$subtit);
}
}
}
($tagfield,$tagsubfield) = MARCfind_marc_from_kohafield($dbh,"bibliosubject.subject",$frameworkcode);
@ -1601,13 +1628,12 @@ sub OLDmodsubject {
sub OLDmodbibitem {
my ( $dbh, $biblioitem ) = @_;
# my $dbh = C4Connect;
my $query;
$biblioitem->{'itemtype'} = $dbh->quote( $biblioitem->{'itemtype'} );
$biblioitem->{'url'} = $dbh->quote( $biblioitem->{'url'} );
$biblioitem->{'isbn'} = $dbh->quote( $biblioitem->{'isbn'} );
$biblioitem->{'issn'} = $dbh->quote( $biblioitem->{'issn'} );
$biblioitem->{'publishercode'} =
$dbh->quote( $biblioitem->{'publishercode'} );
$biblioitem->{'publicationyear'} =
@ -1627,6 +1653,7 @@ sub OLDmodbibitem {
itemtype = $biblioitem->{'itemtype'},
url = $biblioitem->{'url'},
isbn = $biblioitem->{'isbn'},
issn = $biblioitem->{'issn'},
publishercode = $biblioitem->{'publishercode'},
publicationyear = $biblioitem->{'publicationyear'},
classification = $biblioitem->{'classification'},
@ -1644,8 +1671,6 @@ where biblioitemnumber = $biblioitem->{'biblioitemnumber'}";
if ( $dbh->errstr ) {
warn "$query";
}
# $dbh->disconnect;
} # sub modbibitem
sub OLDmodnote {
@ -1720,7 +1745,7 @@ sub OLDnewsubtitle {
my $sth =
$dbh->prepare(
"insert into bibliosubtitle set biblionumber = ?, subtitle = ?");
$sth->execute( $bibnum, $subtitle );
$sth->execute( $bibnum, $subtitle ) if $subtitle;
$sth->finish;
}
@ -1807,11 +1832,6 @@ sub OLDmoditem {
$item->{'itemcallnumber'}, $item->{'notforloan'},
$item->{'location'}, $item->{'itemnum'}
);
if ( $item->{'barcode'} eq '' ) {
$item->{'notforloan'} = 0 unless $item->{'notforloan'};
$query = "update items set notforloan=? where itemnumber=?";
@bind = ( $item->{'notforloan'}, $item->{'itemnum'} );
}
if ( $item->{'lost'} ne '' ) {
$query = "update items set biblioitemnumber=?,
barcode=?,
@ -2633,6 +2653,25 @@ Paul POULAIN paul.poulain@free.fr
# $Id$
# $Log$
# Revision 1.116 2005/03/01 13:40:48 tipaul
# merging 2.2 branch with head. Sorry for not making it before, many many commits done here
#
# Revision 1.115.2.5 2005/02/24 13:54:04 tipaul
# exporting MARCdelsubfield sub. It's used in authority merging.
# Modifying it too to enable deletion of all subfields from a given tag/subfield or just one.
#
# Revision 1.115.2.4 2005/02/17 12:44:25 tipaul
# bug in acquisition : the title was also stored as subtitle.
#
# Revision 1.115.2.3 2005/02/10 13:14:36 tipaul
# * multiple main authors are now correctly handled in simple (non-MARC) view
#
# Revision 1.115.2.2 2005/01/11 16:02:35 tipaul
# in catalogue, modifs were not stored properly the non-MARC item DB. Affect only libraries without barcodes.
#
# Revision 1.115.2.1 2005/01/11 14:45:37 tipaul
# bugfix : issn were not stored correctly in non-MARC DB on biblio modification
#
# Revision 1.115 2005/01/06 14:32:17 tipaul
# improvement of speed for bulkmarcimport.
# A sub had been forgotten to use the C4::Context->marcfromkohafield array, that caches DB datas.

75
C4/Bull.pm

@ -44,7 +44,8 @@ Give all XYZ functions
=cut
@ISA = qw(Exporter);
@EXPORT = qw(&newsubscription &modsubscription &getsubscriptions &getsubscription &getsubscriptionfrombiblionumber
@EXPORT = qw(&newsubscription &modsubscription &delsubscription &getsubscriptions &getsubscription
&getsubscriptionfrombiblionumber &get_subscription_list_from_biblionumber
&modsubscriptionhistory
&getserials &serialchangestatus
&Find_Next_Date, &Get_Next_Seq
@ -136,16 +137,6 @@ sub newsubscription {
my $serialseq = Get_Seq($val);
$sth = $dbh->prepare("insert into serial (serialseq,subscriptionid,biblionumber,status, planneddate) values (?,?,?,?,?)");
$sth->execute($serialseq, $subscriptionid, $val->{'biblionumber'}, 1, format_date_in_iso($startdate));
# next issue number
#my ($newserialseq,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3) = Get_Next_Seq($val);
# next date (calculated from actual date & frequency parameters)
#my $nextplanneddate = Get_Next_Date($startdate,$val);
# $sth = $dbh->prepare("update subscription set lastvalue1=?, lastvalue2=?,lastvalue3=?,
# innerloop1=?,innerloop2=?,innerloop3=?
# where subscriptionid = ?");
# $sth->execute($newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3,$subscriptionid);
# $sth->finish;
return $subscriptionid;
}
sub getsubscription {
@ -166,12 +157,32 @@ sub getsubscription {
sub getsubscriptionfrombiblionumber {
my ($biblionumber) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare('select subscriptionid from subscription where biblionumber=?');
my $sth = $dbh->prepare('select count(*) from subscription where biblionumber=?');
$sth->execute($biblionumber);
my $subscriptionid = $sth->fetchrow;
return $subscriptionid;
my $subscriptionsnumber = $sth->fetchrow;
return $subscriptionsnumber;
}
sub get_subscription_list_from_biblionumber {
my ($biblionumber) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare('select subscription.*,subscriptionhistory.*,aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
from subscription
left join subscriptionhistory on subscription.subscriptionid=subscriptionhistory.subscriptionid
left join aqbudget on subscription.aqbudgetid=aqbudget.aqbudgetid
left join aqbooksellers on subscription.aqbooksellerid=aqbooksellers.id
left join biblio on biblio.biblionumber=subscription.biblionumber
where subscription.biblionumber = ?');
$sth->execute($biblionumber);
my @res;
while (my $subs = $sth->fetchrow_hashref) {
$subs->{'startdate'} = format_date($subs->{'startdate'});
push @res,$subs;
}
return \@res;
}
sub modsubscription {
my ($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
$periodicity,$dow,$numberlength,$weeklength,$monthlength,
@ -196,14 +207,31 @@ sub modsubscription {
}
sub delsubscription {
my ($subscriptionid) = @_;
# check again there is only one issue (the subscription is new)
my ($totalissues) = getserials($subscriptionid);
if ($totalissues eq 1) {
my $dbh = C4::Context->dbh;
$subscriptionid=$dbh->quote($subscriptionid);
$dbh->do("delete from subscription where subscriptionid=$subscriptionid");
$dbh->do("delete from subscriptionhistory where subscriptionid=$subscriptionid");
$dbh->do("delete from serial where subscriptionid=$subscriptionid");
}
}
sub getsubscriptions {
my ($title,$ISSN) = @_;
return unless $title or $ISSN;
my ($title,$ISSN,$biblionumber) = @_;
return unless $title or $ISSN or $biblionumber;
my $dbh = C4::Context->dbh;
my $sth;
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )");
$sth->execute("%$title%",$ISSN);
my @results;
if ($biblionumber) {
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and biblio.biblionumber=?");
$sth->execute($biblionumber);
} else {
$sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )");
$sth->execute("%$title%",$ISSN);
}
my @results;
while (my $line = $sth->fetchrow_hashref) {
push @results, $line;
}
@ -216,7 +244,9 @@ sub modsubscriptionhistory {
my $sth = $dbh->prepare("update subscriptionhistory set histstartdate=?,enddate=?,recievedlist=?,missinglist=?,opacnote=?,librariannote=? where subscriptionid=?");
$sth->execute($histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote,$subscriptionid);
}
# get every serial not arrived for a given subscription.
# get every serial not arrived for a given subscription
# as well as the number of issues registered in the database (all types)
# this number is used to see if a subscription can be deleted (=it must have only 1 issue)
sub getserials {
my ($subscriptionid) = @_;
my $dbh = C4::Context->dbh;
@ -229,7 +259,10 @@ sub getserials {
$line->{"planneddate"} = format_date($line->{"planneddate"});
push @serials,$line;
}
return @serials;
$sth=$dbh->prepare("select count(*) from serial where subscriptionid=?");
$sth->execute($subscriptionid);
my ($totalissues) = $sth->fetchrow;
return ($totalissues,@serials);
}
sub serialchangestatus {

2
C4/Circulation/Circ2.pm

@ -721,7 +721,7 @@ sub canbookbeissued {
unless ($iteminformation->{barcode}) {
$issuingimpossible{UNKNOWN_BARCODE} = 1;
}
if ($iteminformation->{'notforloan'} == 1) {
if ($iteminformation->{'notforloan'} > 0) {
$issuingimpossible{NOT_FOR_LOAN} = 1;
}
if ($iteminformation->{'itemtype'} eq 'REF') {

1
C4/Context.pm

@ -226,6 +226,7 @@ sub new
# Load the desired config file.
$self->{"config"} = &read_config_file($conf_fname);
warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"});
return undef if !defined($self->{"config"});
$self->{"dbh"} = undef; # Database handle

39
C4/Search.pm

@ -1317,9 +1317,11 @@ sub ItemInfo {
my @results;
while (my $data=$sth->fetchrow_hashref){
my $datedue = '';
my $isth=$dbh->prepare("Select * from issues where itemnumber = ? and returndate is null");
my $isth=$dbh->prepare("Select issues.*,borrowers.cardnumber from issues,borrowers where itemnumber = ? and returndate is null and issues.borrowernumber=borrowers.borrowernumber");
$isth->execute($data->{'itemnumber'});
if (my $idata=$isth->fetchrow_hashref){
$data->{borrowernumber} = $idata->{borrowernumber};
$data->{cardnumber} = $idata->{cardnumber};
$datedue = format_date($idata->{'date_due'});
}
if ($data->{'itemlost'} eq '2'){
@ -1345,13 +1347,19 @@ sub ItemInfo {
if (my $bdata=$bsth->fetchrow_hashref){
$data->{'branchname'} = $bdata->{'branchname'};
}
# $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}";
# FIXME - If $data->{'datelastseen'} is NULL, perhaps it'd be prettier
# to leave it empty, rather than convert it to "//".
# Also ideally this should use the local format for displaying dates.
my $date=format_date($data->{'datelastseen'});
$data->{'datelastseen'}=$date;
$data->{'datedue'}=$datedue;
# get notforloan complete status if applicable
my $sthnflstatus = $dbh->prepare('select authorised_value from marc_subfield_structure where kohafield="items.notforloan"');
$sthnflstatus->execute;
my ($authorised_valuecode) = $sthnflstatus->fetchrow;
if ($authorised_valuecode) {
$sthnflstatus = $dbh->prepare("select lib from authorised_values where category=? and authorised_value=?");
$sthnflstatus->execute($authorised_valuecode,$data->{itemnotforloan});
my ($lib) = $sthnflstatus->fetchrow;
$data->{notforloan} = $lib;
}
$results[$i]=$data;
$i++;
}
@ -1480,12 +1488,24 @@ sub bibdata {
from biblio, biblioitems
left join bibliosubtitle on
biblio.biblionumber = bibliosubtitle.biblionumber
left join itemtypes on biblioitems.itemtype=itemtypes.itemtype
where biblio.biblionumber = ?
and biblioitems.biblionumber = biblio.biblionumber");
$sth->execute($bibnum);
my $data;
$data = $sth->fetchrow_hashref;
$sth->finish;
# handle management of repeated subtitle
$sth = $dbh->prepare("Select * from bibliosubtitle where biblionumber = ?");
$sth->execute($bibnum);
my @subtitles;
while (my $dat = $sth->fetchrow_hashref){
my %line;
$line{subtitle} = $dat->{subtitle};
push @subtitles, \%line;
} # while
$data->{subtitles} = \@subtitles;
$sth->finish;
$sth = $dbh->prepare("Select * from bibliosubject where biblionumber = ?");
$sth->execute($bibnum);
my @subjects;
@ -1781,14 +1801,14 @@ C<$count> is the number of elements in C<$borrowers>.
#used by member enquiries from the intranet
#called by member.pl
sub BornameSearch {
my ($env,$searchstring,$type)=@_;
my ($env,$searchstring,$orderby,$type)=@_;
my $dbh = C4::Context->dbh;
my $query = ""; my $count; my @data;
my @bind=();
if($type eq "simple") # simple search for one letter only
{
$query="Select * from borrowers where surname like ? order by surname,firstname";
$query="Select * from borrowers where surname like ? order by $orderby";
@bind=("$searchstring%");
}
else # advanced search looking in surname, firstname and othernames
@ -1809,13 +1829,14 @@ sub BornameSearch {
push(@bind,"$data[$i]%","% $data[$i]%","$data[$i]%","% $data[$i]%","$data[$i]%","% $data[$i]%");
# FIXME - .= <<EOT;
}
$query=$query.") or cardnumber = ?
order by surname,firstname";
$query=$query.") or cardnumber like ?
order by $orderby";
push(@bind,$searchstring);
# FIXME - .= <<EOT;
}
my $sth=$dbh->prepare($query);
warn "Q $orderby : $query";
$sth->execute(@bind);
my @results;
my $cnt=$sth->rows;

41
C4/SearchMarc.pm

@ -166,7 +166,6 @@ $marcflavour ("MARC21" or "UNIMARC") determines which tags are used for retrievi
sub catalogsearch {
my ($dbh, $tags, $and_or, $excluding, $operator, $value, $offset,$length,$orderby) = @_;
warn "@$tags[0], @$and_or[0], @$excluding[0], @$operator[0], @$value[0], $offset,$length,$orderby";
# build the sql request. She will look like :
# select m1.bibid
# from marc_subfield_table as m1, marc_subfield_table as m2
@ -196,7 +195,21 @@ sub catalogsearch {
# $_=~ s/\'/ /g;
# $_=~ s/\,/ /g;
# }
# the item.notforloan contains an integer. Every value <>0 means "book unavailable for loan".
# but each library can have it's own table of meaning for each value. Get them
# 1st search if there is a list of authorised values connected to items.notforloan
my $sth = $dbh->prepare('select authorised_value from marc_subfield_structure where kohafield="items.notforloan"');
$sth->execute;
my %notforloanstatus;
my ($authorised_valuecode) = $sth->fetchrow;
if ($authorised_valuecode) {
$sth = $dbh->prepare("select authorised_value,lib from authorised_values where category=?");
$sth->execute($authorised_valuecode);
while (my ($authorised_value,$lib) = $sth->fetchrow) {
$notforloanstatus{$authorised_value} = $lib?$lib:$authorised_value;
}
}
for(my $i = 0 ; $i <= $#{$value} ; $i++)
{
# replace * by %
@ -240,8 +253,6 @@ sub catalogsearch {
# warn "word : $word";
$word =~ s/%//g unless length($word)>4;
unless (C4::Context->stopwords->{uc($word)} or length($word)==1) { #it's NOT a stopword => use it. Otherwise, ignore
my $tag = substr(@$tags[$i],0,3);
my $subf = substr(@$tags[$i],3,1);
push @normal_tags, @$tags[$i];
push @normal_and_or, "and"; # assumes "foo" and "bar" if "foo bar" is entered
push @normal_operator, @$operator[$i];
@ -273,6 +284,7 @@ sub catalogsearch {
}
$sth->execute();
my @result = ();
my $subtitle; # Added by JF for Subtitles
# Processes the NOT if any and there are results
my ($not_sql_tables, $not_sql_where1, $not_sql_where2);
@ -328,6 +340,7 @@ sub catalogsearch {
LEFT JOIN biblioitems on biblio.biblionumber = biblioitems.biblionumber
LEFT JOIN itemtypes on itemtypes.itemtype=biblioitems.itemtype
WHERE biblio.biblionumber = marc_biblio.biblionumber AND bibid = ?");
my $sth_subtitle = $dbh->prepare("SELECT subtitle FROM bibliosubtitle WHERE biblionumber=?"); # Added BY JF for Subtitles
my @finalresult = ();
my @CNresults=();
my $totalitems=0;
@ -342,6 +355,16 @@ sub catalogsearch {
my $continue=1;
my $line = $sth->fetchrow_hashref;
my $biblionumber=$line->{bn};
# Return subtitles first ADDED BY JF
$sth_subtitle->execute($biblionumber);
my $subtitle_here.= $sth_subtitle->fetchrow." ";
chop $subtitle_here;
$subtitle = $subtitle_here;
# warn "Here's the Biblionumber ".$biblionumber;
# warn "and here's the subtitle: ".$subtitle_here;
# /ADDED BY JF
# $continue=0 unless $line->{bn};
# my $lastitemnumber;
$sth_itemCN->execute($biblionumber);
@ -365,6 +388,7 @@ sub catalogsearch {
$lineCN{itemcallnumber} = $item->{itemcallnumber};
$lineCN{location} = $item->{location};
$lineCN{date_due} = format_date($date_due);
$lineCN{notforloan} = $notforloanstatus{$item->{notforloan}} if ($item->{notforloan});
$notforloan=0 unless ($item->{notforloan} or $item->{wthdrawn} or $item->{itemlost});
push @CNresults,\%lineCN;
$totalitems++;
@ -373,10 +397,19 @@ sub catalogsearch {
my %newline;
%newline = %$line;
$newline{totitem} = $totalitems;
# if $totalitems == 0, check if it's being ordered.
if ($totalitems == 0) {
my $sth = $dbh->prepare("select count(*) from aqorders where biblionumber=?");
$sth->execute($biblionumber);
my ($ordered) = $sth->fetchrow;
$newline{onorder} = 1 if $ordered;
}
$newline{biblionumber} = $biblionumber;
$newline{norequests} = 0;
$newline{norequests} = 1 if ($line->{notforloan}); # itemtype not issuable
$newline{norequests} = 1 if (!$line->{notforloan} && $notforloan); # itemtype issuable but all items not issuable for instance
$newline{subtitle} = $subtitle; # put the subtitle in ADDED BY JF
my @CNresults2= @CNresults;
$newline{CN} = \@CNresults2;
$newline{'even'} = 1 if $#finalresult % 2 == 0;

27
ISBDdetail.pl

@ -99,7 +99,7 @@ my $res;
my @subf = $field->subfields;
for my $i (0..$#subf) {
my $subfieldcode = $subf[$i][0];
my $subfieldvalue = $subf[$i][1];
my $subfieldvalue = get_authorised_value_desc($tag, $subf[$i][0], $subf[$i][1], '', $dbh);;
my $tagsubf = $tag.$subfieldcode;
$calculated =~ s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue\{$1$tagsubf$2\}$2/g;
}
@ -130,3 +130,28 @@ $template->param(ISBD => $res,
output_html_with_http_headers $query, $cookie, $template->output;
sub get_authorised_value_desc ($$$$$) {
my($tag, $subfield, $value, $framework, $dbh) = @_;
#---- branch
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
return getbranchname($value);
}
#---- itemtypes
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
return ItemType($value);
}
#---- "true" authorized value
my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
if ($category ne "") {
my $sth = $dbh->prepare("select lib from authorised_values where category = ? and authorised_value = ?");
$sth->execute($category, $value);
my $data = $sth->fetchrow_hashref;
return $data->{'lib'};
} else {
return $value; # if nothing is found return the original value
}
}

34
MARCdetail.pl

@ -56,7 +56,7 @@ use C4::Search;
use MARC::Record;
use C4::Biblio;
use C4::Acquisition;
use C4::Bull; #uses getsubscriptionfrom biblionumber
use C4::Bull; #uses getsubscriptionsfrombiblionumber
use HTML::Template;
my $query=new CGI;
@ -121,7 +121,7 @@ for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
if ($tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{authtypecode}) {
$subfield_data{authority}=$fields[$x_i]->subfield(9);
}
$subfield_data{marc_value}=$subf[$i][1];
$subfield_data{marc_value}=get_authorised_value_desc($fields[$x_i]->tag(), $subf[$i][0], $subf[$i][1], '', $dbh);
}
$subfield_data{marc_subfield}=$subf[$i][0];
$subfield_data{marc_tag}=$fields[$x_i]->tag();
@ -158,6 +158,7 @@ foreach my $field (@fields) {
# loop through each subfield
for my $i (0..$#subf) {
next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne 10);
next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{hidden});
$witness{$subf[$i][0]} = $tagslib->{$field->tag()}->{$subf[$i][0]}->{lib};
$this_row{$subf[$i][0]} =$subf[$i][1];
}
@ -189,14 +190,39 @@ foreach my $subfield_code (keys(%witness)) {
push(@header_value_loop, \%header_value);
}
my $subscriptionid = getsubscriptionfrombiblionumber($biblionumber);
my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
$template->param(item_loop => \@item_value_loop,
item_header_loop => \@header_value_loop,
biblionumber => $biblionumber,
bibid => $bibid,
biblionumber => $biblionumber,
subscriptionid => $subscriptionid,
subscriptionsnumber => $subscriptionsnumber,
popup => $popup,
);
output_html_with_http_headers $query, $cookie, $template->output;
sub get_authorised_value_desc ($$$$$) {
my($tag, $subfield, $value, $framework, $dbh) = @_;
#---- branch
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
return getbranchname($value);
}
#---- itemtypes
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
return ItemType($value);
}
#---- "true" authorized value
my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
if ($category ne "") {
my $sth = $dbh->prepare("select lib from authorised_values where category = ? and authorised_value = ?");
$sth->execute($category, $value);
my $data = $sth->fetchrow_hashref;
return $data->{'lib'};
} else {
return $value; # if nothing is found return the original value
}
}

1
about.pl

@ -24,6 +24,7 @@ my $osVersion = `uname -a`;
my $perlVersion = $];
my $mysqlVersion = `mysql -V`;
my $apacheVersion = `httpd -v`;
$apacheVersion = `httpd2 -v` unless $apacheVersion;
$template->param(
kohaVersion => $kohaVersion,

10
acqui.simple/addbiblio.pl

@ -176,10 +176,16 @@ sub create_input () {
$subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth);
# it's a thesaurus / authority field
} elsif ($tagslib->{$tag}->{$subfield}->{authtypecode}) {
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"47\" maxlength=\"255\" DISABLE READONLY> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?category=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"47\" maxlength=\"255\" DISABLE READONLY> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
# it's a plugin field
} elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) {
my $plugin="../value_builder/".$tagslib->{$tag}->{$subfield}->{'value_builder'};
# opening plugin. Just check wether we are on a developper computer on a production one
# (the cgidir differs)
my $cgidir = C4::Context->intranetdir ."/cgi-bin/value_builder";
unless (opendir(DIR, "$cgidir")) {
$cgidir = C4::Context->intranetdir."/value_builder";
}
my $plugin=$cgidir."/".$tagslib->{$tag}->{$subfield}->{'value_builder'};
require $plugin;
my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
my ($function_name,$javascript) = plugin_javascript($dbh,$rec,$tagslib,$i,$tabloop);

3
acqui/addorder.pl

@ -97,9 +97,6 @@ if ($quantity ne '0'){
isbn => $isbn?$isbn:"",
publishercode => $publishercode?$publishercode:"",
});
if ($title) {
newsubtitle($bibnum,$title);
}
# change suggestion status if applicable
if ($suggestionid) {
changestatus($suggestionid,'ORDERED');

2
admin/auth_subfields_structure.pl

@ -199,7 +199,7 @@ if ($op eq 'add_form') {
for (my $i=0; $i<= $#tagsubfield ; $i++) {
my $tagfield =$input->param('tagfield');
my $tagsubfield =$tagsubfield[$i];
$tagsubfield="@" unless $tagsubfield;
$tagsubfield="@" unless $tagsubfield ne '';
my $liblibrarian =$liblibrarian[$i];
my $libopac =$libopac[$i];
my $repeatable =$input->param("repeatable$i")?1:0;

5
admin/auth_tag_structure.pl

@ -173,14 +173,15 @@ if ($op eq 'add_form') {
$sth->finish;
$template->param(liblibrarian => $data->{'liblibrarian'},
searchfield => $searchfield,
authtypecode => $authtypecode,
);
# END $OP eq DELETE_CONFIRM
################## DELETE_CONFIRMED ##################################
# called by delete_confirm, used to effectively confirm deletion of data in DB
} elsif ($op eq 'delete_confirmed') {
unless (C4::Context->config('demo') eq 1) {
$dbh->do("delete from auth_tag_structure where tagfield='$searchfield'");
$dbh->do("delete from auth_subfield_structure where tagfield='$searchfield'");
$dbh->do("delete from auth_tag_structure where tagfield='$searchfield' and authtypecode='$authtypecode'");
$dbh->do("delete from auth_subfield_structure where tagfield='$searchfield' and authtypecode='$authtypecode'");
}
# END $OP eq DELETE_CONFIRMED
################## ITEMTYPE_CREATE ##################################

6
admin/marc_subfields_structure.pl

@ -109,7 +109,7 @@ if ($op eq 'add_form') {
# other subfields
push @kohafields, "additionalauthors.author";
push @kohafields, "bibliosubject.subject";
push @kohafields, "bibliosubtitle.title";
push @kohafields, "bibliosubtitle.subtitle";
# build authorised value list
$sth2->finish;
$sth2 = $dbh->prepare("select distinct category from authorised_values");
@ -324,7 +324,7 @@ if ($op eq 'add_form') {
for (my $i=0; $i<= $#tagsubfield ; $i++) {
my $tagfield =$input->param('tagfield');
my $tagsubfield =$tagsubfield[$i];
$tagsubfield="@" unless $tagsubfield;
$tagsubfield="@" unless $tagsubfield ne '';
my $liblibrarian =$liblibrarian[$i];
my $libopac =$libopac[$i];
my $repeatable =$input->param("repeatable$i")?1:0;
@ -434,7 +434,7 @@ if ($op eq 'add_form') {
$template->param(loop => \@loop_data);
$template->param(edit_tagfield => $tagfield,
edit_frameworkcode => $frameworkcode);
if ($offset>0) {
my $prevpage = $offset-$pagesize;
$template->param(prev =>"<a href=\"$script_name?offset=$prevpage\">");

23
admin/marctagstructure.pl

@ -133,8 +133,8 @@ if ($op eq 'add_form') {
}
$template->param('use-heading-flags-p' => 1);
$template->param(liblibrarian => $data->{'liblibrarian'},
libopac => $data->{'libopac'},
repeatable => CGI::checkbox(-name=>'repeatable',
libopac => $data->{'libopac'},
repeatable => CGI::checkbox(-name=>'repeatable',
-checked=> $data->{'repeatable'}?'checked':'',
-value=> 1,
-label => '',
@ -144,9 +144,9 @@ if ($op eq 'add_form') {
-value => 1,
-label => '',
-id => 'mandatory'),
authorised_value => $authorised_value,
frameworkcode => $frameworkcode,
);
authorised_value => $authorised_value,
frameworkcode => $frameworkcode,
);
# END $OP eq ADD_FORM
################## ADD_VALIDATE ##################################
# called by add_form, used to insert/modify data in DB
@ -218,13 +218,13 @@ if ($op eq 'add_form') {
}
my $env;
my ($count,$results)=StringSearch($env,$searchfield,$frameworkcode);
my $toggle="white";
my $toggle=0;
my @loop_data = ();
for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
if ($toggle eq 'white'){
$toggle="#ffffcc";
if ($toggle eq 0){
$toggle=1;
} else {
$toggle="white";
$toggle=0;
}
my %row_data; # get a fresh hash for the row data
$row_data{tagfield} = $results->[$i]{'tagfield'};
@ -232,7 +232,10 @@ if ($op eq 'add_form') {
$row_data{repeatable} = $results->[$i]{'repeatable'};
$row_data{mandatory} = $results->[$i]{'mandatory'};
$row_data{authorised_value} = $results->[$i]{'authorised_value'};
$row_data{bgcolor} = $toggle;
$row_data{subfield_link} ="marc_subfields_structure.pl?tagfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
$row_data{edit} = "$script_name?op=add_form&amp;searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
$row_data{delete} = "$script_name?op=delete_confirm&amp;searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
$row_data{toggle} = $toggle;
push(@loop_data, \%row_data);
}
$template->param(loop => \@loop_data);

16
authorities/auth_finder.pl

@ -37,7 +37,7 @@ my $query=new CGI;
my $op = $query->param('op');
my $authtypecode = $query->param('authtypecode');
my $index = $query->param('index');
my $category = $query->param('category');
# my $category = $query->param('category');
my $resultstring = $query->param('result');
my $dbh = C4::Context->dbh;
@ -68,10 +68,7 @@ if ($op eq "do_search") {
$resultsperpage= $query->param('resultsperpage');
$resultsperpage = 19 if(!defined $resultsperpage);
# builds tag and subfield arrays
my @tags;
my ($results,$total) = authoritysearch($dbh, \@tags,\@and_or,
my ($results,$total) = authoritysearch($dbh, \@marclist,\@and_or,
\@excluding, \@operator, \@value,
$startfrom*$resultsperpage, $resultsperpage,$authtypecode);# $orderby);
@ -127,7 +124,7 @@ if ($op eq "do_search") {
$to = (($startfrom+1)*$resultsperpage);
}
$template->param(result => $results) if $results;
$template->param(index => $query->param('index'));
$template->param(index => $query->param('index')."");
$template->param(startfrom=> $startfrom,
displaynext=> $displaynext,
displayprev=> $displayprev,
@ -154,12 +151,13 @@ if ($op eq "do_search") {
});
$template->param(index => $index,
resultstring => $resultstring
resultstring => $resultstring,
);
}
$template->param(authtypesloop => \@authtypesloop);
$template->param(category => $category);
$template->param(authtypesloop => \@authtypesloop,
authtypecode => $authtypecode);
warn "CAT : $authtypecode";
# Print the page
output_html_with_http_headers $query, $cookie, $template->output;

2
authorities/authorities-home.pl

@ -65,7 +65,7 @@ if ($op eq "do_search") {
$resultsperpage= $query->param('resultsperpage');
$resultsperpage = 19 if(!defined $resultsperpage);
my @tags;
my ($results,$total) = authoritysearch($dbh, \@tags,\@and_or,
my ($results,$total) = authoritysearch($dbh, \@marclist,\@and_or,
\@excluding, \@operator, \@value,
$startfrom*$resultsperpage, $resultsperpage,$authtypecode);
($template, $loggedinuser, $cookie)

3
bull-home.pl

@ -12,7 +12,8 @@ use HTML::Template;
my $query = new CGI;
my $title = $query->param('title');
my $ISSN = $query->param('ISSN');
my @subscriptions = getsubscriptions($title,$ISSN);
my $biblionumber = $query->param('biblionumber');
my @subscriptions = getsubscriptions($title,$ISSN,$biblionumber);
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "bull/bull-home.tmpl",
query => $query,

2
bull/statecollection.pl

@ -39,7 +39,7 @@ if ($op eq 'serialchangestatus') {
}
}
my $subs = &getsubscription($subscriptionid);
my @serialslist = getserials($subscriptionid);
my ($totalissues,@serialslist) = getserials($subscriptionid);
my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
$sth->execute($subscriptionid);

11
bull/subscription-detail.pl

@ -69,8 +69,16 @@ if ($op eq 'modsubscription') {
$numberingmethod, $status, $biblionumber, $notes, $subscriptionid);
}
if ($op eq 'del') {
&delsubscription($subscriptionid);
print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=../bull-home.pl\"></html>";
exit;
}
my $subs = &getsubscription($subscriptionid);
my @serialslist = getserials($subscriptionid);
my ($totalissues,@serialslist) = getserials($subscriptionid);
$totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
# the subscription must be deletable if there is NO issues for a reason or another (should not happend, but...)
($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "bull/subscription-detail.tmpl",
@ -123,6 +131,7 @@ $template->param(
notes => $subs->{notes},
subscriptionid => $subs->{subscriptionid},
serialslist => \@serialslist,
totalissues => $totalissues,
);
$template->param(
"periodicity$subs->{periodicity}" => 1,

2
circ/circulation.pl

@ -104,7 +104,7 @@ my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", ($datearr[4]+1)).sprintf (
#
my $borrowerslist;
if ($findborrower) {
my ($count,$borrowers)=BornameSearch(\%env,$findborrower,'web');
my ($count,$borrowers)=BornameSearch(\%env,$findborrower,'cardnumber','web');
my @borrowers=@$borrowers;
if ($#borrowers == -1) {
$query->param('findborrower', '');

124
detail.pl

@ -1,112 +1,76 @@
#!/usr/bin/perl
# NOTE: Use standard 8-space tabs for this file (indents are 4 spaces)
# 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 HTML::Template;
use strict;
require Exporter;
use C4::Context;
use C4::Output; # contains gettemplate
use CGI;
use C4::Search;
use C4::Auth;
use C4::Bull; #uses getsubscriptionfrom biblionumber
use C4::Interface::CGI::Output;
use C4::Date;
use HTML::Template;
use C4::Biblio;
use C4::SearchMarc;
my $query=new CGI;
my $type=$query->param('type');
($type) || ($type='intra');
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "catalogue/detail.tmpl",
query => $query,
type => "intranet",
authnotrequired => 1,
flagsrequired => {borrow => 1},
});
my $biblionumber=$query->param('bib');
# change back when ive fixed request.pl
my @items = ItemInfo(undef, $biblionumber, $type);
my $norequests = 1;
foreach my $itm (@items) {
$norequests = 0 unless $itm->{'notforloan'};
}
$template->param(biblionumber => $biblionumber);
my $dat=bibdata($biblionumber);
my ($authorcount, $addauthor)= &addauthor($biblionumber);
# change back when ive fixed request.pl
my @items = &ItemInfo(undef, $biblionumber, 'intra');
my $dat = &bibdata($biblionumber);
my ($authorcount, $addauthor) = &addauthor($biblionumber);
my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
my ($websitecount, @websites) = &getwebsites($biblionumber);
my ($subjectcount, $subjects) = &subject($biblionumber);
my $subscriptionsnumber = getsubscriptionfrombiblionumber($biblionumber);
$dat->{'count'}=@items;
$dat->{'norequests'} = $norequests;
$dat->{'additional'}=$addauthor->[0]->{'author'};
for (my $i = 1; $i < $authorcount; $i++) {
$dat->{'additional'} .= " ; " . $addauthor->[$i]->{'author'};
$dat->{'additional'} .= " ; " . $addauthor->[$i]->{'author'};
} # for
$dat->{'subjects'}=$subjects->[0]->{'subject'};
for (my $i = 1; $i < $subjectcount; $i++) {
$dat->{'subjects'} .= ", " . $subjects->[$i]->{'subject'};
} # for
my $norequests = 1;
foreach my $itm (@items) {
$norequests = 0 unless $itm->{'notforloan'};
$itm->{$itm->{'publictype'}} = 1;
}
$template->param(norequests => $norequests);
my @results;
## get notes and subjects from MARC record
my $marc = C4::Context->preference("marc");
if ($marc eq "yes") {
my $dbh = C4::Context->dbh;
my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber);
my $marcflavour = C4::Context->preference("marcflavour");
my $marcnotesarray = &getMARCnotes($dbh,$bibid,$marcflavour);
my $marcsubjctsarray = &getMARCsubjects($dbh,$bibid,$marcflavour);
$results[0]=$dat;
$template->param(MARCNOTES => $marcnotesarray);
$template->param(MARCSUBJCTS => $marcsubjctsarray);
}
my @results = ($dat,);
my $resultsarray=\@results;
my $itemsarray=\@items;
my $webarray=\@webbiblioitems;
my $sitearray=\@websites;
my $startfrom=$query->param('startfrom');
($startfrom) || ($startfrom=0);
my ($template, $loggedinuser, $cookie) = get_template_and_user({
template_name => ($type eq 'opac'? 'catalogue/detail-opac.tmpl':
'catalogue/detail.tmpl'),
query => $query,
type => "intranet",
authnotrequired => ($type eq 'opac'),
flagsrequired => {catalogue => 1},
});
my $count=1;
# now to get the items into a hash we can use and whack that thru
my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
$template->param(startfrom => $startfrom+1,
endat => $startfrom+20,
numrecords => $count,
nextstartfrom => $nextstartfrom,
prevstartfrom => $prevstartfrom,
BIBLIO_RESULTS => $resultsarray,
ITEM_RESULTS => $itemsarray,
WEB_RESULTS => $webarray,
SITE_RESULTS => $sitearray,
loggedinuser => $loggedinuser,
biblionumber => $biblionumber,
);
$template->param(BIBLIO_RESULTS => $resultsarray,
ITEM_RESULTS => $itemsarray,
WEB_RESULTS => $webarray,
SITE_RESULTS => $sitearray,
subscriptionsnumber => $subscriptionsnumber,
);
output_html_with_http_headers $query, $cookie, $template->output;
# Local Variables:
# tab-width: 8
# End:

42
koha-tmpl/intranet-tmpl/default/en/about.tmpl

@ -12,43 +12,45 @@
<p><label class="label100">Apache version</label><!-- TMPL_VAR ESCAPE=HTML name="apacheVersion" --></p>
</div>
<div id="bloc25">
<h2>Special thanks to the following funders</h2>
<p><b>Horowhenua Library Trust</b> and Rosalie Blake, Head of Libraries, (Koha 1.0)</p>
<p>The <b>Nelsonville Public Library</b> (MARC support)</p>
<p><b>EMN (Ecole des Mines de Nantes)</b> (Suggestion, stats modules and improved ldap support)</p>
<p><b>ENSMP (Ecole Nationale Supérieure des Mines de Paris)</b> (biblio frameworks, MARC authorities, OPAC basket, Serials support)</p>
<h2>Special thanks to the following libraries</h2>
<p><b>Horowhenua Library Trust</b>, New Zealand, and Rosalie Blake, Head of Libraries, (Koha 1.0)</p>
<p>The <b>Nelsonville Public Library</b>, USA, Ohio (MARC support funding)</p>
<p><b>EMN (Ecole des Mines de Nantes)</b>, France (Suggestion, stats modules and improved ldap support funding)</p>
<p><b>ENSMP (Ecole Nationale Supérieure des Mines de Paris)</b>, France (biblio frameworks, MARC authorities, OPAC basket, Serials support funding)</p>
</div>
<div id="bloc25">
<h2>Core team for 2.2</h2>
<p><b>Rachel Hamilton-Williams</b>, Kaitiaki</p>
<p><b>Paul Poulain</b>, 2.2 release manager (MARC developper)</p>
<p>Stephen Hedges &amp; the <b>Nelsonville Public Library</b> (MARC features funders)</p>
<p>Nicholas Rosasco, (Documentation Compiler)</p>
<p>Mike Hansen</p>