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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 16 Jun 2006 19:49:00 -0000


albertel		Fri Jun 16 15:49:00 2006 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
  Log:
  - unique period wasn't being displayed
  - valid xhtml
  
  
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.63 loncom/interface/slotrequest.pm:1.64
--- loncom/interface/slotrequest.pm:1.63	Tue May 30 08:46:09 2006
+++ loncom/interface/slotrequest.pm	Fri Jun 16 15:49:00 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.63 2006/05/30 12:46:09 www Exp $
+# $Id: slotrequest.pm,v 1.64 2006/06/16 19:49:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -385,13 +385,13 @@
 					 'no'  => 'No',);
     $r->print(<<"END_CONFIRM");
 <p> $msg </p>
-<form action="/adm/slotrequest" method="POST">
+<form action="/adm/slotrequest" method="post">
     <input type="hidden" name="command" value="release" />
     <input type="hidden" name="button" value="yes" />
     $hidden_input
     <input type="submit" value="$lt{'yes'}" />
 </form>
-<form action="/adm/slotrequest" method="POST">
+<form action="/adm/slotrequest" method="post">
     <input type="hidden" name="command" value="showslots" />
     <input type="submit" value="$lt{'no'}" />
 </form>
@@ -571,7 +571,7 @@
 	$r->print("<p>Already have a reservation: $description1</p>");
 	if ($slot_name ne $env{'form.slotname'}) {
 	    $r->print(<<STUFF);
-<form method="POST" action="/adm/slotrequest">
+<form method="post" action="/adm/slotrequest">
    <input type="hidden" name="symb" value="$env{'form.symb'}" />
    <input type="hidden" name="slotname" value="$env{'form.slotname'}" />
    <input type="hidden" name="releaseslot" value="$slot_name" />
@@ -616,7 +616,7 @@
     $r->print(<<STUFF);
 <p> <font color="red">Failed</font> to reserve a spot for $description. </p>
 <p>
-<form method="POST" action="/adm/slotrequest">
+<form method="post" action="/adm/slotrequest">
    <input type="submit" name="Try Again" value="$lt{'try'}" />
    <input type="hidden" name="symb" value="$env{'form.symb'}" />
    <input type="hidden" name="slotname" value="$env{'form.slotname'}" />
@@ -626,7 +626,7 @@
 </p>
 <p>
 or
-<form method="POST" action="/adm/slotrequest">
+<form method="post" action="/adm/slotrequest">
     <input type="hidden" name="symb" value="$env{'form.symb'}" />
     <input type="submit" name="requestattempt" value="$lt{'request'}" />
 </form>
@@ -767,7 +767,7 @@
 	    }
 	    my $escsymb=&escape($symb);
 	    $form=<<STUFF;
-   <form method="POST" action="/adm/slotrequest">
+   <form method="post" action="/adm/slotrequest">
      <input type="submit" name="Select" value="$text" />
      <input type="hidden" name="symb" value="$escsymb" />
      <input type="hidden" name="slotname" value="$slot" />
@@ -871,7 +871,7 @@
     $symb      = &escape($symb);
 
     return <<"END_LINK";
- <a href="/adm/slotrequest?command=remove_registration&slotname=$slotname&entry=$entry&uname=$uname&udom=$udom&symb=$symb"
+ <a href="/adm/slotrequest?command=remove_registration&amp;slotname=$slotname&amp;entry=$entry&amp;uname=$uname&amp;udom=$udom&amp;symb=$symb"
    >($remove)</a>
 END_LINK
 
@@ -888,11 +888,11 @@
     my $available;
     if ($mgr eq 'F') {
 	$r->print('<div>');
-	$r->print('<form method="POST" action="/adm/slotrequest">
+	$r->print('<form method="post" action="/adm/slotrequest">
 <input type="hidden" name="command" value="uploadstart" />
 <input type="submit" name="start" value="'.&mt('Upload Slot List').'" />
 </form>');
-	$r->print('<form method="POST" action="/adm/helper/newslot.helper">
+	$r->print('<form method="post" action="/adm/helper/newslot.helper">
 <input type="submit" name="newslot" value="'.&mt('Create a New Slot').'" />
 </form>');
 	$r->print('</div>');
@@ -979,13 +979,16 @@
     my $name_filter = {'type'  => $name_filter_type,
 		       'value' => $env{'form.name_filter_value'},};
 
+    
     #deleted slot filtering
+    #default to hide if no value
+    $env{'form.deleted'} ||= 'hide';
     my $hide_radio = 
 	&Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'hide');
     my $show_radio = 
 	&Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'show');
 	
-    $r->print('<form method="POST" action="/adm/slotrequest">
+    $r->print('<form method="post" action="/adm/slotrequest">
 <input type="hidden" name="command" value="showslots" />');
     $r->print('<div>');
     $r->print('<table class="inline">
@@ -1108,7 +1111,7 @@
 	
 	my $unique;
 	if (ref($slots{$slot}{'uniqueperiod'})) {
-	    $unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','.
+	    $unique=localtime($slots{$slot}{'uniqueperiod'}[0]).', '.
 		localtime($slots{$slot}{'uniqueperiod'}[1]);
 	}
 
@@ -1166,7 +1169,7 @@
 EDITLINK
 
 	my $delete=(<<"DELETELINK");
-<a href="/adm/slotrequest?command=delete&slotname=$slot">Delete</a>
+<a href="/adm/slotrequest?command=delete&amp;slotname=$slot">Delete</a>
 DELETELINK
 
         my $remove_all=&remove_link($slot,'remove all').'<br />';
@@ -1214,9 +1217,13 @@
 	if (exists($show{'allowedusers'})) {
 	    $colspan++;$r->print("<td>$allowedusers</td>\n");
 	}
+	if (exists($show{'uniqueperiod'})) {
+	    $colspan++;$r->print("<td>$unique</td>\n");
+	}
 	if (exists($show{'scheduled'})) {
-	    $colspan++;$r->print("<td>$remove_all $ids</td>\n</tr>\n");
+	    $colspan++;$r->print("<td>$remove_all $ids</td>\n");
 	}
+	$r->print("</tr>\n");
 	if (exists($show{'proctor'})) {
 	    $r->print(<<STUFF);
 <tr>
@@ -1225,7 +1232,7 @@
 STUFF
         }
     }
-    $r->print('</table>');
+    $r->print('</table></form>');
 }
 
 sub upload_start {