From c0a44fe1151c38ee58514f418d8b127729849a94 Mon Sep 17 00:00:00 2001 From: alaurin Date: Fri, 19 May 2006 17:05:11 +0000 Subject: [PATCH] improvement of reserves.pl with item - reservation --- C4/Koha.pm | 14 +++ .../prog/en/circ/branchtransfers.tmpl | 2 + .../prog/en/circ/circulation.tmpl | 1 + .../intranet-tmpl/prog/en/circ/returns.tmpl | 1 + .../prog/en/circ/selectbranchprinter.tmpl | 2 + .../prog/en/reserve/request.tmpl | 89 +++++++++++++++---- reserve/modrequest.pl | 2 +- reserve/placerequest.pl | 32 +++++-- reserve/request.pl | 2 +- 9 files changed, 119 insertions(+), 26 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 12d9415393..f08794f56a 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -57,6 +57,7 @@ Koha.pm provides many functions for Koha scripts. &getauthtypes &getauthtype &getallthemes &getalllanguages &getallbranches &getletters + &getbranchname getnbpages getitemtypeimagedir getitemtypeimagesrc @@ -149,6 +150,18 @@ sub getbranches { return (\%branches); } +sub getbranchname { + my ($branchcode)=@_; + my $dbh = C4::Context->dbh; + my $sth; + $sth = $dbh->prepare("Select branchname from branches where branchcode=?"); + $sth->execute($branchcode); + my $branchname = $sth->fetchrow_array; + $sth->finish; + + return($branchname); +} + =head2 getallbranches $branches = &getallbranches(); @@ -180,6 +193,7 @@ foreach my $thisbranch (keys %$branches) { =cut + sub getallbranches { # returns a reference to a hash of references to ALL branches... my %branches; diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl index fd1460787e..28cbad662f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl @@ -1,4 +1,6 @@ Circulation: Transfers + +

Circulation: Transfers

diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl index 1572d536c9..939483d027 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl @@ -5,6 +5,7 @@ +

Circulation: Issues

diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl index a7c7675782..e488d6b0e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl @@ -1,6 +1,7 @@ Koha -- Circulation: Returns: + diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl index 3e514e651c..3bc80427bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl @@ -1,4 +1,6 @@ Circulation: Select Your Home Branch + +

Circulation: Select Your Home Branch

diff --git a/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl index 14e0c02601..b334d7f450 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl @@ -3,6 +3,55 @@ Koha -- Circulation + + +

Request for reserve

@@ -28,12 +77,14 @@ Koha -- Circulation
+ ">
+ ">
@@ -61,19 +112,19 @@ Koha -- Circulation

- Le lecteur n'est pas dans sa bibliothèque d'appartenance + The borrower isn't in is own library

- - Ce lecteur a déjà fait une demande de réservation pour ce document + + This borrower had already make a reserv for this document

-
attention, il n'y a pas de lecteur à ce nom, veuillez en saisir un autre
+
Carrefull,there is no borrower with this name, Please, try an other
@@ -125,7 +176,7 @@ Koha -- Circulation - + @@ -180,16 +231,16 @@ Koha -- Circulation - Ne peut être sélectionné (Document perdu ou en grand retard) + Cant' be selected (lost or long overdue) - Ce document, n'est pas prêtable () + This document is not for loan () - Document en tranfert du site : , - vers : , le : + Document in transfer from the library : , + to : , the : @@ -236,10 +287,10 @@ Koha -- Circulation "> - "> + "> - "> + "> - Exemplaire en attente à > + Document waiting at > //images/2rightarrow.png"> + Cancel a reserve with select + //images/2rightarrow.png"> diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index 36ef7a66b7..a319214ca1 100755 --- a/reserve/modrequest.pl +++ b/reserve/modrequest.pl @@ -50,5 +50,5 @@ my $from=$input->param('from'); if ($from eq 'borrower'){ print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$borrower[0]"); } else { - print $input->redirect("/cgi-bin/koha/request.pl?biblionumber=$biblionumber[0]"); + print $input->redirect("/cgi-bin/koha/reserve/request.pl?bib=$biblionumber[0]"); } diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index c6ea752235..00474b9e07 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -23,10 +23,12 @@ use strict; #use DBI; +use C4::Search; use C4::Biblio; use CGI; use C4::Output; use C4::Reserves2; +use C4::Circulation::Circ2; use C4::Members; my $input = new CGI; @@ -34,7 +36,7 @@ my $input = new CGI; my @bibitems=$input->param('biblioitem'); my @reqbib=$input->param('reqbib'); -my $biblionumber=$input->param('biblionumber'); +my $biblio=$input->param('biblio'); my $borrower=$input->param('member'); my $notes=$input->param('notes'); my $branch=$input->param('pickup'); @@ -42,6 +44,26 @@ my @rank=$input->param('rank-request'); my $type=$input->param('type'); my $title=$input->param('title'); my $bornum=borrdata($borrower,''); +# Nouveau developpement +my $checkitem=$input->param('checkitem'); +# my $priority; +my $found; + +#new op : if we have an item selectionned, and the pickup branch is the same as the holdingbranch of the document, we force the value $rank and $found . +if ($checkitem ne ''){ + $rank[0] = '0'; + my %env; + my $item = $checkitem; + $item = getiteminformation(\%env,$item); + if ( $item->{'holdingbranch'} eq $branch ){ + $found = 'W'; + } + + +} + +# END of new op . + if ($type eq 'str8' && $bornum ne ''){ my $count=@bibitems; @bibitems=sort @bibitems; @@ -59,15 +81,15 @@ if ($type eq 'str8' && $bornum ne ''){ my $const; if ($input->param('request') eq 'any'){ $const='a'; - CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblionumber,$const,\@realbi,$rank[0],$notes,$title); + CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@realbi,$rank[0],$notes,$title,$checkitem,$found); } elsif ($reqbib[0] ne ''){ $const='o'; - CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblionumber,$const,\@reqbib,$rank[0],$notes,$title); + CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@reqbib,$rank[0],$notes,$title,$checkitem, $found); } else { - CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$notes,$title); + CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,'a',\@realbi,$rank[0],$notes,$title,$checkitem, $found); } - print $input->redirect("request.pl?biblionumber=$biblionumber"); +print $input->redirect("request.pl?bib=$biblio"); } elsif ($bornum eq ''){ print $input->header(); print "Invalid card number please try again"; diff --git a/reserve/request.pl b/reserve/request.pl index 6a7ec0e810..19dbda0c93 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -56,7 +56,6 @@ my ($template, $borrowernumber, $cookie) # get biblio information.... my $bib = $input->param('bib'); -warn '[Debub Pierrick] $bib: ', $bib; my $dat = bibdata($bib); # Select borrowers infos @@ -263,6 +262,7 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { if (defined $reservedate) { $item->{backgroundcolor} = 'reserved'; + $item->{reservedate} = format_date($reservedate); } # Management of the notforloan document -- 2.39.5