[LON-CAPA-cvs] cvs: loncom /html/adm/helper newslot.helper

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 02 Nov 2005 22:07:52 -0000


albertel		Wed Nov  2 17:07:52 2005 EDT

  Modified files:              
    /loncom/html/adm/helper	newslot.helper 
  Log:
  - fixing it so student scheduling options aren't displayed for an instructor assigned slot
  
  
Index: loncom/html/adm/helper/newslot.helper
diff -u loncom/html/adm/helper/newslot.helper:1.6 loncom/html/adm/helper/newslot.helper:1.7
--- loncom/html/adm/helper/newslot.helper:1.6	Wed Nov  2 16:58:14 2005
+++ loncom/html/adm/helper/newslot.helper	Wed Nov  2 17:07:52 2005
@@ -78,30 +78,64 @@
         return &{$helper->{DATA}{origslot}}('description');
       </defaultvalue>
     </string>
-    <message>
-      <message_text>
-          </p><p>Time students can start reserving:<br />&nbsp;&nbsp;&nbsp;
-      </message_text>
-    </message>
-    <date variable="startreserve" hoursminutes="1" anytime="1">
-      <defaultvalue>
-        return &{$helper->{DATA}{origslot}}('startreserve','anytime');
-      </defaultvalue>
-    </date>
-    <message>
-      <message_text>
-          </p><p>Maxium number of students allowed in this slot:<br />&nbsp;&nbsp;&nbsp;
-      </message_text>
-    </message>
-    <string variable="maxspace" size="4">
-      <validator>
-          if ($val ne '' && $val=~/\D/) { return 'Must be numeric.'; }
-          return undef;
-      </validator>
-      <defaultvalue>
-        return &{$helper->{DATA}{origslot}}('maxspace');
-      </defaultvalue>
-    </string>
+    <condition>
+      <clause>$helper->{'VARS'}{'type'} eq 'schedulable_student'</clause>
+      <message>
+        <message_text>
+            </p><p>Time students can start reserving:<br />&nbsp;&nbsp;&nbsp;
+        </message_text>
+      </message>
+      <date variable="startreserve" hoursminutes="1" anytime="1">
+        <defaultvalue>
+          return &{$helper->{DATA}{origslot}}('startreserve','anytime');
+        </defaultvalue>
+      </date>
+      <message>
+        <message_text>
+            </p><p>Maxium number of students allowed in this slot:<br />&nbsp;&nbsp;&nbsp;
+        </message_text>
+      </message>
+      <string variable="maxspace" size="4">
+        <validator>
+            if ($val ne '' && $val=~/\D/) { return 'Must be numeric.'; }
+            return undef;
+        </validator>
+        <defaultvalue>
+          return &{$helper->{DATA}{origslot}}('maxspace');
+        </defaultvalue>
+      </string>
+      <message>
+        <message_text>
+            </p><p>Period of time in which this slot is can only be uniquely chosen:<br />&nbsp;&nbsp;&nbsp;Start:
+        </message_text>
+      </message>
+      <date variable="startunique" hoursminutes="1" anytime="1">
+        <defaultvalue>
+          my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
+          if ($default eq 'anytime') { return 'anytime' };
+          if (ref($default)) { return $default->[0]; }
+          return 'anytime';
+        </defaultvalue>
+      </date>
+      <message><message_text><br />&nbsp;&nbsp;&nbsp;End: </message_text></message>
+      <date variable="endunique" hoursminutes="1" anytime="1">
+        <defaultvalue>
+          my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
+          if ($default eq 'anytime') { return 'anytime' };
+          if (ref($default)) { return $default->[1]; }
+          return 'anytime';
+        </defaultvalue>
+      </date>
+    </condition>
+    <condition>
+      <clause>$helper->{'VARS'}{'type'} eq 'preassigned'</clause>
+      <exec>
+        delete($helper->{'VARS'}{'startreserve'});
+        delete($helper->{'VARS'}{'maxspace'});
+        delete($helper->{'VARS'}{'startunique'});
+        delete($helper->{'VARS'}{'endunique'});
+      </exec>
+    </condition>
     <message>
       <message_text>
           </p><p>Secret word proctors use to checkin users:<br />&nbsp;&nbsp;&nbsp;
@@ -117,28 +151,6 @@
     </string>
     <message>
       <message_text>
-          </p><p>Period of time in which this slot is can only be uniquely chosen:<br />&nbsp;&nbsp;&nbsp;Start:
-      </message_text>
-    </message>
-    <date variable="startunique" hoursminutes="1" anytime="1">
-      <defaultvalue>
-        my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
-        if ($default eq 'anytime') { return 'anytime' };
-        if (ref($default)) { return $default->[0]; }
-        return 'anytime';
-      </defaultvalue>
-    </date>
-    <message><message_text><br />&nbsp;&nbsp;&nbsp;End: </message_text></message>
-    <date variable="endunique" hoursminutes="1" anytime="1">
-      <defaultvalue>
-        my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
-        if ($default eq 'anytime') { return 'anytime' };
-        if (ref($default)) { return $default->[1]; }
-        return 'anytime';
-      </defaultvalue>
-    </date>
-    <message>
-      <message_text>
           </p><p>Slot is:
       </message_text>
     </message>