[Koha-cvs] koha/koha-tmpl/intranet-tmpl/npl/en includes/co... [rel_2_2]

Ryan Higgins rch at liblime.com
Wed May 2 15:59:53 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Ryan Higgins <rych>	07/05/02 13:59:53

Modified files:
	koha-tmpl/intranet-tmpl/npl/en/includes: common.js.inc 
	                                         doc-head-close-calendar.inc 
	koha-tmpl/intranet-tmpl/npl/en/bull: statecollection.tmpl 

Log message:
	adding js test for expected dates on add/mod serial

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/includes/common.js.inc?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/includes/doc-head-close-calendar.inc?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.6&r2=1.1.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/bull/statecollection.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.2.2.14&r2=1.2.2.15

Patches:
Index: includes/common.js.inc
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/includes/Attic/common.js.inc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- includes/common.js.inc	8 Mar 2006 23:07:05 -0000	1.1.2.1
+++ includes/common.js.inc	2 May 2007 13:59:52 -0000	1.1.2.2
@@ -49,4 +49,26 @@
 			document.forms['mainform'].elements[0].focus();
 		}
 	}
+function checkExpectedSerial(cnt) {
+	var success=true;
+	for (var i = 1; i<=cnt ; i++) {
+		var plan= document.getElementById('planneddate'+cnt);
+		var stat= document.getElementById('status'+cnt);
+		var defstat=0;
+		for ( var k=0 ; k < stat.options.length ; k++) {
+			if(stat.options[k].defaultSelected) {
+				defstat=stat.options[k].value;
+			}
+		}
+		if ((stat.value != defstat)&&(plan.value == '')&&(stat.value != 6)) {
+			plan.style.backgroundColor = 'red';
+			success = false;
+		}
+	}
+	if ( ! success) { 
+		alert("A serial issue is missing the expected date.  Please supply a value."); 
+	}
+	return success;
+}
+
 </script>
\ No newline at end of file

Index: includes/doc-head-close-calendar.inc
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/includes/Attic/doc-head-close-calendar.inc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -b -r1.1.2.6 -r1.1.2.7
--- includes/doc-head-close-calendar.inc	5 Apr 2006 14:52:52 -0000	1.1.2.6
+++ includes/doc-head-close-calendar.inc	2 May 2007 13:59:52 -0000	1.1.2.7
@@ -12,41 +12,9 @@
 <!-- Additions to enable Calendar system -->
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME='themelang' -->/includes/calendar/calendar-system.css">
 <!-- End of additions -->
-<script language="JavaScript" type="text/javascript">
-<!-- Hide from old browsers
-function Help() {
-	newin=window.open("/cgi-bin/koha/help.pl","Koha Help",'width=600,height=600,toolbar=false,scrollbars=yes');
-}
-
-function openWindow(targeturl, windowname) {
-	newwin =
-	window.open(targeturl,windowname,"height=480,width=640,scrollbars,resizable")
-}
- 
- 	var newwin;
-	
-	// Open the popup window if it doesn't already exist and give it focus.
-	function PopWin(targeturl, windowname) {
-	
-		if (!newwin || newwin.closed) newwin = window.open(targeturl,windowname, "height=300,width=400,scrollbars=yes,resizable=yes");
-	  newwin.focus();
-	}
-	
-  // Set the value of the form field to the passed value and optionally shift
-	// focus and close the popup.
-	function FillForm(val,formname,formfield) {
-	
-		document.forms[formname].elements[formfield].value = val;
-
-		// Uncomment below to shift focus after clicking link in popup.
-		document.forms[formname].elements[formfield].focus();
-		
-		// Uncomment below to close popup after clicking link.
-		newwin.close();
-	}
- 
-// end hiding -->
+<!-- TMPL_INCLUDE NAME="common.js.inc" -->
 </script>
+
 <!-- Additions to enable Calendar system -->
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar.js"></script>
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/includes/calendar/calendar-en.js"></script>

Index: bull/statecollection.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/bull/Attic/statecollection.tmpl,v
retrieving revision 1.2.2.14
retrieving revision 1.2.2.15
diff -u -b -r1.2.2.14 -r1.2.2.15
--- bull/statecollection.tmpl	4 Dec 2006 05:32:10 -0000	1.2.2.14
+++ bull/statecollection.tmpl	2 May 2007 13:59:53 -0000	1.2.2.15
@@ -1,4 +1,4 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Subscription Details for <!-- TMPL_VAR name="bibliotitle" --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Subscription Details for <!-- TMPL_VAR name="bibliotitle" --><!-- TMPL_INCLUDE NAME="doc-head-close-calendar.inc" -->
 <!-- TMPL_INCLUDE NAME="masthead.inc" -->
 <!-- TMPL_INCLUDE NAME="serials-topmenu.inc" -->
 <!-- TMPL_INCLUDE NAME="intranet-nav.inc" -->
@@ -33,13 +33,14 @@
 <input class="submit" type="submit" title="Routing list" value="Routing List" /></form>
 <!-- /TMPL_IF -->
 
-	<form method="post" name="f" action="statecollection.pl">
+	<form method="post" name="f" action="statecollection.pl" onsubmit="return checkExpectedSerial(this.count.value)">
 		<input type="hidden" name="op" value="serialchangestatus" />
 		<input type="hidden" name="serial" value="<!-- TMPL_VAR name="serial" -->" />
 		<input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->" />
 		<input type="hidden" name="user" value="<!-- TMPL_VAR name="user" -->" />
+		<input type="hidden" name="count" value="<!-- TMPL_VAR name="count" -->" />
 	
-	<h2>Awaited or Late Subscription Issues</h2>
+	<h2>Expected or Late Subscription Issues</h2>
 
 	<!-- TMPL_LOOP name="serialslist" -->	<table>
 	<caption><!-- TMPL_VAR name="serialseq" --></caption>
@@ -48,17 +49,38 @@
 		 <input type="text" id="serialseq" name="serialseq" value="<!-- TMPL_VAR name="serialseq" -->" size="30" maxlength="100" />
 			</td></tr>
 	<tr>
-		<th scope="row"><label for="publisheddate">Published On: </label></th><td><input type="text" name="publisheddate" id="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
+		<th scope="row"><label for="publisheddate<!-- TMPL_VAR NAME="num" -->">Published On: </label></th><td><input type="text" name="publisheddate" id="publisheddate<!-- TMPL_VAR NAME="num" -->" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
+	 <img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" id="CalendarPubDate<!-- TMPL_VAR NAME="num" -->" style="cursor: pointer;" valign="top" />
+                                                                <script language="JavaScript" type="text/javascript">
+                                                                        Calendar.setup(
+                                                                                {
+                                                                                       inputField : "publisheddate<!-- TMPL_VAR NAME="num" -->",
+                                                                                        ifFormat : "%m/%d/%Y",
+                                                                                        button : "CalendarPubDate<!-- TMPL_VAR NAME="num" -->",
+                                                                                }
+                                                                        );
+                                                                </script>
 			</td>
 	</tr>
+
+
 			<tr>
-		<th scope="row"><label for="planneddate">Expected On:</label> </th><td>
-				<input type="text" id="planneddate" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
+		<th scope="row"><label for="planneddate<!-- TMPL_VAR NAME="num" -->">Expected On: </label></th><td><input type="text" name="planneddate" id="planneddate<!-- TMPL_VAR NAME="num" -->" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
+	 <img src="<!-- TMPL_VAR Name="themelang" -->/includes/calendar/cal.gif" border="0" id="CalendarPlanDate<!-- TMPL_VAR NAME="num" -->" style="cursor: pointer;" valign="top" />
+                                                                <script language="JavaScript" type="text/javascript">
+                                                                        Calendar.setup(
+                                                                                {
+                                                                                       inputField : "planneddate<!-- TMPL_VAR NAME="num" -->",
+                                                                                        ifFormat : "%m/%d/%Y",
+                                                                                        button : "CalendarPlanDate<!-- TMPL_VAR NAME="num" -->",
+                                                                                }
+                                                                        );
+                                                                </script>
 			</td></tr>
 			<tr>
 		<th scope="row"><label for="status">Status:</label> </th><td>
 				<input type="hidden" name="serialid" value="<!-- TMPL_VAR name="serialid" -->" />
-				<select id="status" name="status" size="1">
+				<select id="status<!-- TMPL_VAR NAME="num" -->" name="status" size="1">
 					<!--TMPL_IF name="status1" -->
 						<option value="1" selected>Waiting</option>
 					<!-- /TMPL_IF -->
@@ -146,7 +168,7 @@
 			</td>
 			</tr>
 	<tr>
-		<th scope="row"><label for="publisheddate2">Published On: </label></th><td><input type="text" name="publisheddate" id="publisheddate2" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
+		<th scope="row"><label for="publisheddate">Published On: </label></th><td><input type="text" name="publisheddate" id="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
 			</td>
 	</tr>
 			<tr><th scope="row"><label for="manual-planneddate">Expected On: </label></th>





More information about the Koha-cvs mailing list