[Koha-cvs] koha koha-tmpl/intranet-tmpl/ccfls/en/members/m... [dev_week]

Kyle Hall kyle.m.hall at gmail.com
Thu Aug 30 14:10:30 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/08/30 12:10:30

Modified files:
	koha-tmpl/intranet-tmpl/ccfls/en/members: moremember.tmpl 
Added files:
	.              : returnscript.pl 

Log message:
	Modified the CCFLS moremember script to make it cleaner. Got rid of 'renew all' button. Added a check/uncheck all feature, added a 'return checked items' button beside the 'renew checked items' button. This new button calls the new script returnscript.pl

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/returnscript.pl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/ccfls/en/members/moremember.tmpl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.1.2.19&r2=1.1.2.1.2.20

Patches:
Index: koha-tmpl/intranet-tmpl/ccfls/en/members/moremember.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/ccfls/en/members/Attic/moremember.tmpl,v
retrieving revision 1.1.2.1.2.19
retrieving revision 1.1.2.1.2.20
diff -u -b -r1.1.2.1.2.19 -r1.1.2.1.2.20
--- koha-tmpl/intranet-tmpl/ccfls/en/members/moremember.tmpl	21 Aug 2007 12:53:07 -0000	1.1.2.1.2.19
+++ koha-tmpl/intranet-tmpl/ccfls/en/members/moremember.tmpl	30 Aug 2007 12:10:29 -0000	1.1.2.1.2.20
@@ -208,7 +208,7 @@
 <!-- /TMPL_UNLESS -->
 </div>
 
-<form class="inline" action="/cgi-bin/koha/renewscript.pl" method="post">
+<form id="itemsOnLoanForm" name="itemsOnLoanForm" class="inline" action="/cgi-bin/koha/renewscript.pl" method="post">
 	<input type="hidden" name="bornum" value="<!-- TMPL_VAR name="bornum" -->" />
 <table>
 	<caption>Items On Loan</caption>
@@ -220,8 +220,8 @@
 		<th>Itemtype</th>
 		<!-- Hide from NPL --><th>Charge</th><!-- /Hide from NPL -->
 		<th>Price</th>
-		<!-- TMPL_UNLESS NAME="unvalidlibrarian"--><th>Renew</th><!-- /TMPL_UNLESS -->
-		<th>Return</th>
+		<!-- TMPL_UNLESS NAME="unvalidlibrarian"--><th><input style="border:inset 1px;" name="allbox" type="checkbox" value="Check All" onclick="CheckAll(document.itemsOnLoanForm);" /></th><!-- /TMPL_UNLESS -->
+<!-- HIDE FOR CCFLS ( NO LONGER NEEDED ) <th>Return</th> -->
 		<!-- TMPL_IF NAME="failedRenewals"--><th>Renew Attempt</th><!-- /TMPL_IF -->
 	</tr>
 	</thead>
@@ -251,15 +251,37 @@
 			<input type="checkbox" name="renew_item_<!-- TMPL_VAR name="itemnumber" -->" value="y"<!-- TMPL_IF name="red" -->checked="checked"<!-- /TMPL_IF --> />
 		<!-- /TMPL_IF -->
 		</td><!-- /TMPL_UNLESS -->
-		<td><a href="/cgi-bin/koha/circ/returns.pl?barcode=<!-- TMPL_VAR name="barcode" -->">Return</a></td>
+<!-- HIDE FOR CCFLS ( NO LONGER NEEDED ) <td><a href="/cgi-bin/koha/circ/returns.pl?barcode=<!-- TMPL_VAR name="barcode" -->">Return</a></td> -->
 		<td><!-- TMPL_IF name="failedrenewal" --><font color="red">Renewal Failed</font><!-- /TMPL_IF --></td>
 	</tr>
 	<!-- /TMPL_LOOP --><!-- TMPL_ELSE --><tr><td colspan="7">Patron has no Checkouts.</td></tr><!-- /TMPL_IF -->
 	</tbody>
-	</table><!-- TMPL_UNLESS NAME="unvalidlibrarian"--><p><input type="submit" class="submit" value="Renew Checked Items" /></p><!-- /TMPL_UNLESS -->
+	</table>
+
+  <!-- TMPL_UNLESS NAME="unvalidlibrarian"-->
+    <p>
+      <input type="submit" class="submit" value="Renew Checked Items"  onclick="document.itemsOnLoanForm.action='/cgi-bin/koha/renewscript.pl';"/>
+    </p>
+    <p>
+      <input type="submit" class="submit" value="Return Checked Items" onclick="document.itemsOnLoanForm.action='/cgi-bin/koha/returnscript.pl';"/>
+    </p>
+  <!-- /TMPL_UNLESS -->
 </form>
 
-<!-- TMPL_UNLESS NAME="unvalidlibrarian"--><form class="inline" action="/cgi-bin/koha/renewscript.pl" method="post"><input type="hidden" name="bornum" value="<!-- TMPL_VAR name="bornum" -->" /><!-- TMPL_LOOP NAME="issueloop" --><!-- TMPL_UNLESS NAME="norenew" --><input type="hidden" name="renew_item_<!-- TMPL_VAR name="itemnumber" -->" value="y" /><!-- /TMPL_UNLESS --><!-- /TMPL_LOOP --><input type="submit" class="submit" value="Renew All" /></form><!-- /TMPL_UNLESS -->
+<!-- HIDE FOR CCFLS
+<!-- TMPL_UNLESS NAME="unvalidlibrarian"-->
+  <form class="inline" action="/cgi-bin/koha/renewscript.pl" method="post">
+    <input type="hidden" name="bornum" value="<!-- TMPL_VAR name="bornum" -->" />
+    <!-- TMPL_LOOP NAME="issueloop" -->
+      <!-- TMPL_UNLESS NAME="norenew" -->
+        <input type="hidden" name="renew_item_<!-- TMPL_VAR name="itemnumber" -->" value="y" />
+      <!-- /TMPL_UNLESS -->
+    <!-- /TMPL_LOOP -->
+
+    <input type="submit" class="submit" value="Renew All" />
+  </form>
+<!-- /TMPL_UNLESS -->
+END HIDE FOR CCFLS -->
 
 
 
@@ -311,6 +333,43 @@
 }
 </script>
 
+<script language="JavaScript" type="text/javascript">
+//==========================================
+// Check All boxes
+//==========================================
+function CheckAll(fmobj) {
+  for (var i=0;i<fmobj.elements.length;i++) {
+    var e = fmobj.elements[i];
+    if ( (e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled) ) {
+      e.checked = fmobj.allbox.checked;
+    }
+  }
+}
+
+//==========================================
+// Check all or uncheck all?
+//==========================================
+function CheckCheckAll(fmobj) {
+  var TotalBoxes = 0;
+  var TotalOn = 0;
+  for (var i=0;i<fmobj.elements.length;i++) {
+    var e = fmobj.elements[i];
+    if ((e.name != 'allbox') && (e.type=='checkbox')) {
+      TotalBoxes++;
+      if (e.checked) {
+       TotalOn++;
+      }
+    }
+  }
+  if (TotalBoxes==TotalOn) {
+    fmobj.allbox.checked=true;
+  }
+  else {
+   fmobj.allbox.checked=false;
+  }
+}
+</script>
+
 </dd>
 </dl>
 </body>

Index: returnscript.pl
===================================================================
RCS file: returnscript.pl
diff -N returnscript.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ returnscript.pl	30 Aug 2007 12:10:29 -0000	1.1.2.1
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+
+#returnscript.pl 2007/08/30 by kyle.m.hall at gmail.com
+
+#based on renewscript.pl written 18/1/2000 by chris at katipo.co.nz
+
+#script to return muliple items
+
+# 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 CGI;
+# use C4::Circulation::Renewals2;
+use C4::Circulation::Circ2;
+#get input
+my $input = new CGI;
+#print $input->header;
+
+#print $input->dump;
+
+my @names=$input->param();
+my $count=@names;
+my %data;
+
+for (my $i=0;$i<$count;$i++){
+  if ($names[$i] =~ /renew/){
+    my $temp=$names[$i];
+    $temp=~ s/renew_item_//;
+    $data{$temp}=$input->param($names[$i]);
+  }
+}
+my %env;
+my $destination = $input->param("destination");
+my $cardnumber = $input->param("cardnumber");
+my $bornum=$input->param("bornum");
+
+$env{'branchcode'} = $input->cookie('branch');
+my $branchCode = $input->cookie('branch');
+
+while ( my ($itemno, $value) = each %data) {
+   if ($value eq 'y'){
+     #means we want to return this item
+
+       my $iteminformation = getiteminformation( \%env, $itemno );
+       my $itemBarcode = $iteminformation->{'barcode'};
+
+## FOR CCFLS ONLY, MOVED TO Circ2::RenewBook
+system "php /usr/local/koha/intranet/htdocs/ccflsFines/createFine.php $itemBarcode $itemno";
+
+       returnbook($itemBarcode, $branchCode);
+
+   }
+}
+
+if($destination eq "circ"){
+	my $redirectString = "/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber";
+	print $input->redirect( $redirectString );
+} else {
+	my $redirectString = "/cgi-bin/koha/members/moremember.pl?bornum=$bornum";
+	print $input->redirect( $redirectString );
+}
\ No newline at end of file





More information about the Koha-cvs mailing list