[Koha-cvs] koha C4/Koha.pm koha-tmpl/intranet-tmpl/prog/en...
LAURIN arnaud
alaurin at ouestprovence.fr
Fri May 19 19:05:11 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch:
Changes by: LAURIN arnaud <alaurin at savannah.gnu.org> 06/05/19 17:05:11
Modified files:
C4 : Koha.pm
koha-tmpl/intranet-tmpl/prog/en/circ: branchtransfers.tmpl
circulation.tmpl
returns.tmpl
selectbranchprinter.tmpl
koha-tmpl/intranet-tmpl/prog/en/reserve: request.tmpl
reserve : modrequest.pl placerequest.pl request.pl
Log message:
improvement of reserves.pl with item - reservation
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Koha.pm.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/reserve/modrequest.pl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/reserve/placerequest.pl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/reserve/request.pl.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: koha/C4/Koha.pm
diff -u koha/C4/Koha.pm:1.32 koha/C4/Koha.pm:1.33
--- koha/C4/Koha.pm:1.32 Wed May 17 16:06:24 2006
+++ koha/C4/Koha.pm Fri May 19 17:05:11 2006
@@ -57,6 +57,7 @@
&getauthtypes &getauthtype
&getallthemes &getalllanguages
&getallbranches &getletters
+ &getbranchname
getnbpages
getitemtypeimagedir
getitemtypeimagesrc
@@ -149,6 +150,18 @@
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 @@
=cut
+
sub getallbranches {
# returns a reference to a hash of references to ALL branches...
my %branches;
Index: koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl:1.2 koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl:1.3
--- koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl:1.2 Wed Aug 31 15:56:38 2005
+++ koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl Fri May 19 17:05:11 2006
@@ -1,4 +1,6 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Circulation: Transfers<!-- TMPL_INCLUDE NAME="doc-head-circ-close.inc" -->
+<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
<h1>Circulation: Transfers</h1>
Index: koha/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl:1.3 koha/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl:1.4
--- koha/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl:1.3 Mon Apr 3 09:38:00 2006
+++ koha/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl Fri May 19 17:05:11 2006
@@ -5,6 +5,7 @@
<!-- /TMPL_IF -->
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
<h1>Circulation: Issues</h1>
Index: koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl:1.2 koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl:1.3
--- koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl:1.2 Mon Apr 3 09:38:00 2006
+++ koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl Fri May 19 17:05:11 2006
@@ -1,6 +1,7 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Circulation: Returns<!-- TMPL_IF Name="returned" -->: <!-- TMPL_VAR Name="itemtitle" --><!-- /TMPL_IF -->
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
<!-- TMPL_IF Name="found" -->
Index: koha/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl:1.1 koha/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl:1.2
--- koha/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl:1.1 Tue Jul 19 21:03:34 2005
+++ koha/koha-tmpl/intranet-tmpl/prog/en/circ/selectbranchprinter.tmpl Fri May 19 17:05:11 2006
@@ -1,4 +1,6 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Circulation: Select Your Home Branch<!-- TMPL_INCLUDE NAME="doc-head-circ-close.inc" -->
+<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
<h1>Circulation: Select Your Home Branch</h1>
Index: koha/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl:1.1 koha/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl:1.2
--- koha/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl:1.1 Wed May 17 16:06:23 2006
+++ koha/koha-tmpl/intranet-tmpl/prog/en/reserve/request.tmpl Fri May 19 17:05:11 2006
@@ -3,6 +3,55 @@
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<script language="JavaScript">
+function check() {
+ var msg = "";
+ var count_reserv = 0;
+ var alreadyreserved = 0;
+
+// check if we have checkitem form
+if (document.form.checkitem){
+ for (i=0;i<document.form.checkitem.length;i++){
+ if (document.form.checkitem[i].checked == true) {
+ count_reserv++ ;
+ }
+ }
+ // for only one item, check the checkitem without consider the loop checkitem
+ if (i==0){
+ if (document.form.checkitem.checked == true) {
+ count_reserv++;
+ }
+ }
+}
+
+if (document.form.request.checked == true){
+ count_reserv++ ;
+}
+
+if (document.form.alreadyreserved.value == "1"){
+ alreadyreserved++ ;
+}
+
+if (count_reserv == "0"){
+ msg += _("- Please select a document to reserve\n");
+}
+if (count_reserv >= "2"){
+ msg += _("- You can select only one type of document\n by item, or by the first item returned\n");
+}
+
+if (alreadyreserved > "0"){
+ msg += _("- This borrower had already reserved this document\n Please cancel the previous reserve first \n");
+}
+
+ if (msg == "") return(true);
+ else {
+ alert(msg);
+ return(false);
+ }
+}
+</script>
+
+
<h1>Request for reserve</h1>
<fieldset>
@@ -28,12 +77,14 @@
</table>
<div id="action">
+ <input type="hidden" name="bib" value="<!-- TMPL_VAR NAME="bib"-->">
<input type="submit" value="Search">
</div>
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="CGIselectborrower" -->
<div id="action">
+ <input type="hidden" name="bib" value="<!-- TMPL_VAR NAME="bib"-->">
<input type="submit" value="Select">
</div>
<!-- /TMPL_UNLESS -->
@@ -61,19 +112,19 @@
<!-- TMPL_IF NAME="diffbranch" -->
<p class="problem">
<label class="label100"><u>Localisation</u></label>
- Le lecteur n'est pas dans sa bibliothèque d'appartenance
+ The borrower isn't in is own library
</p>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="alreadyreserved" -->
<p class="problem">
- <label class="label100"><u>Opération impossible</u></label>
- Ce lecteur a déjà fait une demande de réservation pour ce document
+ <label class="label100"><u>Operation can be make</u></label>
+ This borrower had already make a reserv for this document
</p>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="messageborrower" -->
- <div class="problem">attention, il n'y a pas de lecteur à ce nom, veuillez en saisir un autre </div>
+ <div class="problem">Carrefull,there is no borrower with this name, Please, try an other </div>
<!-- /TMPL_IF -->
<!-- /TMPL_UNLESS -->
@@ -125,7 +176,7 @@
<tr>
<th>
- <label>Lieu de retrait</label>
+ <label>Place of retreat</label>
</th>
<td>
<!-- TMPL_VAR NAME="CGIbranch" -->
@@ -180,16 +231,16 @@
<!-- /TMPL_IF -->
<!-- TMPL_IF Name="message" -->
- Ne peut être sélectionné (Document perdu ou en grand retard)
+ Cant' be selected (lost or long overdue)
<!-- /TMPL_IF -->
<!-- TMPL_IF Name="notforloan" -->
- Ce document, n'est pas prêtable (<!-- TMPL_VAR NAME="notforloanvalue" -->)
+ This document is not for loan (<!-- TMPL_VAR NAME="notforloanvalue" -->)
<!-- /TMPL_IF -->
<!-- TMPL_IF Name="transfertwhen" -->
- Document en tranfert du site : <!-- TMPL_VAR NAME="transfertfrom" -->,
- vers : <!-- TMPL_VAR NAME="transfertto" -->, le : <!-- TMPL_VAR NAME="transfertwhen" -->
+ Document in transfer from the library : <!-- TMPL_VAR NAME="transfertfrom" -->,
+ to : <!-- TMPL_VAR NAME="transfertto" -->, the : <!-- TMPL_VAR NAME="transfertwhen" -->
<!-- /TMPL_IF -->
</td>
</tr>
@@ -236,10 +287,10 @@
<tr>
<td>
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
- <input type="hidden" name="biblio" value="<!-- TMPL_VAR NAME="biblionumber" -->">
+ <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
<select name="rank-request">
<!-- TMPL_IF Name="wait" -->
- <option value="W" selected>En attente</option>
+ <option value="W" selected>Waiting</option>
<!-- /TMPL_IF -->
<!-- TMPL_LOOP Name="optionloop" -->
@@ -247,17 +298,17 @@
<!-- TMPL_VAR NAME="num" -->
</option>
<!-- /TMPL_LOOP -->
- <option value="del">Sup</option>
+ <option value="del">del</option>
</select>
</td>
<td>
- <a href="/cgi-bin/koha/members/moremember.pl?bornum=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a>
+ <a href="/cgi-bin/koha/members/moremember.pl?bornum=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowernumber" --></a>
</td>
<td><!-- TMPL_VAR NAME="notes" --></td>
<td><!-- TMPL_VAR NAME="date" --></td>
<td>
<!-- TMPL_IF Name="wait" -->
- Exemplaire en attente à <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value=<!-- TMPL_VAR NAME="wbrcd" -->>
+ Document waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value=<!-- TMPL_VAR NAME="wbrcd" -->>
<!-- TMPL_ELSE -->
<select name="pickup">
<!-- TMPL_LOOP Name="branchloop" -->
@@ -279,20 +330,20 @@
</a>
<!-- TMPL_ELSE -->
<!-- TMPL_IF Name="constrainttypea" -->
- <i>Suivant Disponible</i>
+ <i>Next available</i>
<!-- TMPL_ELSE -->
<!-- TMPL_IF Name="constrainttypeo" -->
- Uniquement ce type :<b><!-- TMPL_VAR NAME="volumeddesc" --> <!-- TMPL_VAR NAME="itemtype" --></b>
+ only this type :<b><!-- TMPL_VAR NAME="volumeddesc" --> <!-- TMPL_VAR NAME="itemtype" --></b>
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</td>
</tr>
- <!-- /TMPL_LOOP --> <!-- reserveloop -->
+ <!-- /TMPL_LOOP --> <!-- existing reserveloop -->
<tr>
<td colspan="6" align="right">
- Supprimer une réservation en sélectionnant
- <input type="image" name="submit" value="Réservation" border="0" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/2rightarrow.png">
+ Cancel a reserve with select
+ <input type="image" name="submit" value="Reserv" border="0" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/2rightarrow.png">
</td>
</tr>
</table>
Index: koha/reserve/modrequest.pl
diff -u koha/reserve/modrequest.pl:1.1 koha/reserve/modrequest.pl:1.2
--- koha/reserve/modrequest.pl:1.1 Tue Jan 17 16:46:25 2006
+++ koha/reserve/modrequest.pl Fri May 19 17:05:11 2006
@@ -50,5 +50,5 @@
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]");
}
Index: koha/reserve/placerequest.pl
diff -u koha/reserve/placerequest.pl:1.1 koha/reserve/placerequest.pl:1.2
--- koha/reserve/placerequest.pl:1.1 Tue Jan 17 16:46:25 2006
+++ koha/reserve/placerequest.pl Fri May 19 17:05:11 2006
@@ -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 @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 $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 @@
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";
Index: koha/reserve/request.pl
diff -u koha/reserve/request.pl:1.1 koha/reserve/request.pl:1.2
--- koha/reserve/request.pl:1.1 Wed May 17 16:06:23 2006
+++ koha/reserve/request.pl Fri May 19 17:05:11 2006
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: request.pl,v 1.1 2006/05/17 16:06:23 plg Exp $
+# $Id: request.pl,v 1.2 2006/05/19 17:05:11 alaurin Exp $
#script to place reserves/requests
#writen 2/1/00 by chris at katipo.oc.nz
@@ -56,7 +56,6 @@
# get biblio information....
my $bib = $input->param('bib');
-warn '[Debub Pierrick] $bib: ', $bib;
my $dat = bibdata($bib);
# Select borrowers infos
@@ -263,6 +262,7 @@
if (defined $reservedate) {
$item->{backgroundcolor} = 'reserved';
+ $item->{reservedate} = format_date($reservedate);
}
# Management of the notforloan document
More information about the Koha-cvs
mailing list