From 899156b3ec4299a6b9d8409a084252e869aaedbe Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Thu, 14 Jan 2010 15:01:43 +0100 Subject: [PATCH] MT2636 : Send a different notification whether an hold has been made from OPAC or from the Intranet --- C4/Reserves.pm | 7 ++++--- C4/SIP/ILS/Transaction/Hold.pm | 2 +- installer/data/mysql/updatedatabase30.pl | 9 +++++++++ kohaversion.pl | 2 +- reserve/placerequest.pl | 6 +++--- serials/routing-preview.pl | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index a867a86910..75ea16da03 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -122,7 +122,7 @@ BEGIN { =item AddReserve - AddReserve($branch,$borrowernumber,$biblionumber,$constraint,$bibitems,$priority,$notes,$title,$checkitem,$found) + AddReserve($branch,$borrowernumber,$biblionumber,$constraint,$bibitems,$priority,$notes,$title,$checkitem,$found, $from) =cut @@ -130,7 +130,7 @@ sub AddReserve { my ( $branch, $borrowernumber, $biblionumber, $constraint, $bibitems, $priority, $notes, - $title, $checkitem, $found + $title, $checkitem, $found, $from ) = @_; my $fee = GetReserveFee($borrowernumber, $biblionumber, $constraint, @@ -182,7 +182,8 @@ sub AddReserve { if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){ my $borrower = GetMemberDetails($borrowernumber); my $biblio = GetBiblioData($biblionumber); - my $letter = C4::Letters::getletter( 'reserves', 'HOLDPLACED'); + my $lettertype = ($from eq "intranet") ? "STAFFHOLDPLACED" : "HOLDPLACED"; + my $letter = C4::Letters::getletter( 'reserves', $lettertype); my $admin_email_address = C4::Context->preference('KohaAdminEmailAddress'); my %keys = (%$borrower, %$biblio); diff --git a/C4/SIP/ILS/Transaction/Hold.pm b/C4/SIP/ILS/Transaction/Hold.pm index 69657539a4..5781fdc8fb 100644 --- a/C4/SIP/ILS/Transaction/Hold.pm +++ b/C4/SIP/ILS/Transaction/Hold.pm @@ -69,7 +69,7 @@ sub do_hold { } my $bibno = $bib->{biblionumber}; AddReserve($branch, $borrower->{borrowernumber}, - $bibno, 'a', GetBiblioItemByBiblioNumber($bibno)) ; + $bibno, 'a', GetBiblioItemByBiblioNumber($bibno), "opac") ; # unfortunately no meaningful return value $self->ok(1); return $self; diff --git a/installer/data/mysql/updatedatabase30.pl b/installer/data/mysql/updatedatabase30.pl index e7800618e9..9c5a9e6aba 100644 --- a/installer/data/mysql/updatedatabase30.pl +++ b/installer/data/mysql/updatedatabase30.pl @@ -729,6 +729,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.00.06.006'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(" + INSERT INTO `letter` (module, code, name, title, content) VALUES('reserves', 'STAFFHOLDPLACED', 'Hold Placed on Item (from staff)', 'Hold Placed on Item (from staff)','An hold has been placed on the following item from the intranet : <> (<<biblionumber>>) for the user <<firstname>> <<surname>> (<<cardnumber>>).'); + "); + print "Upgrade to $DBversion done (Added notice for hold from staff)\n"; + SetVersion ($DBversion); +} + diff --git a/kohaversion.pl b/kohaversion.pl index 55919dcf24..5dd8831fcb 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.06.005'; + our $VERSION = '3.00.06.006'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index 96fdb7cf63..6868ab2030 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -77,13 +77,13 @@ if ($type eq 'str8' && $borrowernumber ne ''){ my $const; if ($input->param('request') eq 'any'){ # place a request on 1st available - AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$notes,$title,$checkitem,$found); + AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$notes,$title,$checkitem,$found, "intranet"); } elsif ($reqbib[0] ne ''){ # FIXME : elsif probably never reached, (see top of the script) # place a request on a given item - AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$notes,$title,$checkitem, $found); + AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$notes,$title,$checkitem, $found, "intranet"); } else { - AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$notes,$title,$checkitem, $found); + AddReserve($branch,$borrowernumber->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$notes,$title,$checkitem, $found, "intranet"); } print $input->redirect("request.pl?biblionumber=$biblionumber"); diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 8ef8ee8ce7..ed17cb9251 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -74,7 +74,7 @@ if($ok){ if($routinglist[$i]->{'borrowernumber'} == $data->{'borrowernumber'}){ ModReserve($routinglist[$i]->{'ranking'},$biblio,$routinglist[$i]->{'borrowernumber'},$branch); } else { - AddReserve($branch,$routinglist[$i]->{'borrowernumber'},$biblio,$const,\@bibitems,$routinglist[$i]->{'ranking'},$notes,$title); + AddReserve($branch,$routinglist[$i]->{'borrowernumber'},$biblio,$const,\@bibitems,$routinglist[$i]->{'ranking'},$notes,$title, "intranet"); } } -- 2.20.1