[LON-CAPA-cvs] cvs: loncom /interface lonmanagekeys.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 02 May 2003 16:58:56 -0000


www		Fri May  2 12:58:56 2003 EDT

  Modified files:              
    /loncom/interface	lonmanagekeys.pm 
  Log:
  Copy to all fields in list for comments.
  
  
Index: loncom/interface/lonmanagekeys.pm
diff -u loncom/interface/lonmanagekeys.pm:1.9 loncom/interface/lonmanagekeys.pm:1.10
--- loncom/interface/lonmanagekeys.pm:1.9	Fri May  2 11:26:36 2003
+++ loncom/interface/lonmanagekeys.pm	Fri May  2 12:58:56 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to manage course access keys 
 #
-# $Id: lonmanagekeys.pm,v 1.9 2003/05/02 15:26:36 www Exp $
+# $Id: lonmanagekeys.pm,v 1.10 2003/05/02 16:58:56 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,7 +58,25 @@
     $comment=~s/\W/\./g;
     my %accesskeys=&Apache::lonnet::dump
 	('accesskeys',$cenv{'domain'},$cenv{'num'});
-    $r->print('<h3>List of Keys/Enter New Comments</h3><table border="2"><tr><th>Key</th><th>Checked Out</th><th>Comments/Remarks/Notes</th><th>Enter Additional Comments/Remarks/Notes</th></tr>');
+    $r->print(<<ENDTABLEHEADER);
+<script>
+    function copyallcom(tf) {
+	for (i=0; i<tf.elements.length; i++) {
+            if  (tf.elements[i].name.indexOf('com_')==0) {
+	      tf.elements[i].value+=tf.copyall.value;
+            }
+        }
+
+    }
+</script>
+<h3>List of Keys/Enter New Comments</h3>
+<table border="2"><tr><th>Key</th><th>Checked Out</th>
+<th>Comments/Remarks/Notes</th>
+<th>Enter Additional Comments/Remarks/Notes<br />
+<input type="text" size="40" name="copyall" />
+<input type="button" value="Copy to All" onClick="copyallcom(this.form);" />
+</th></tr>
+ENDTABLEHEADER
     foreach (keys %accesskeys) {
         if ($_=~/^error\:/) {
 	    $r->print('<tr><td>No keys have been generated yet.</td></tr>');
@@ -73,7 +91,7 @@
                      $checkout:'-').'</td><td>'.
                      join('<br />',split(/\s*\;\s*/,$com)).
 		     '</td><td><input type="text" size="40" name="com_'.$_.
-		     '" /></td></tr>');
+		     '" value="" /></td></tr>');
        }
     }
     $r->print('</table>');