Annotation of loncom/html/adm/helper/newslot.helper, revision 1.34
1.1 albertel 1: <helper title="Slot Creation" requiredpriv="mgq">
1.22 albertel 2: <state name="START" title="Specify Required Attributes"
3: help="Slot_RequiredAttributes">
1.13 albertel 4:
5: <nextstate>OPTIONAL</nextstate>
6:
1.5 albertel 7: <exec>
8: if (!exists($helper->{'VARS'}{'name'}) ||
9: $helper->{'VARS'}{'name'} !~ /\S/) {
10: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
11: if (exists($env{'form.name'}) ||
12: $env{'form.name'} =~ /\S/) {
13: $helper->{'VARS'}{'name'}=$env{'form.name'};
1.10 albertel 14: $helper->{VARS}{'origname'}=$env{'form.name'};
15: $helper->{DATA}{copy} = 1;
1.5 albertel 16: }
17: }
18: $helper->{DATA}{origslot} = sub {
19: my ($which,$default)=@_;
20: if (!exists($helper->{'VARS'}{'name'}) ||
21: $helper->{'VARS'}{'name'} !~ /\S/) {
22: return $default;
23: }
24: my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
25: my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
1.10 albertel 26: my $name=$helper->{VARS}{'origname'};
1.5 albertel 27: my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum);
28: if (!ref($slot{$name})) { return $default; }
1.34 ! raeburn 29: if (($which eq 'ipdeny') || ($which eq 'ipallow')) {
! 30: if (!exists($slot{$name}{'ip'})) { return $default; }
! 31: } else {
! 32: if (!exists($slot{$name}{$which})) { return $default; }
! 33: }
! 34: if (($which eq 'ipdeny') || ($which eq 'ipallow')) {
! 35: my @allows;
! 36: my @denies;
! 37: foreach my $item (split(',',$slot{$name}{'ip'})) {
! 38: $item =~ s/^\s*//;
! 39: $item =~ s/\s*$//;
! 40: if ($item =~ /^\!(.+)$/) {
! 41: push(@denies,$1);
! 42: } else {
! 43: push(@allows,$item);
! 44: }
! 45: }
! 46: if ($which eq 'ipdeny') {
! 47: return join(',',@denies);
! 48: }
! 49: if ($which eq 'ipallow') {
! 50: return join(',',@allows);
! 51: }
! 52: } else {
! 53: return $slot{$name}{$which};
! 54: }
1.5 albertel 55: }
56: </exec>
1.13 albertel 57: <message>
1.21 rezaferr 58: <br />Name: <br />
1.1 albertel 59: </message>
1.3 albertel 60: <string variable="name" size="30">
1.1 albertel 61: <validator>
62: if ($val=~/^\s*$/) { return 'Must specify a name'; }
1.9 albertel 63: if ($val=~/\s/) { return 'Must not contain spaces'; }
64: if ($val=~/\W/) { return 'Must contain only letters, numbers and _'; }
1.1 albertel 65: return undef;
66: </validator>
1.5 albertel 67: <defaultvalue>
68: return $helper->{'VARS'}{'name'};
69: </defaultvalue>
1.1 albertel 70: </string>
1.10 albertel 71: <condition>
72: <clause>$helper->{DATA}{copy}</clause>
1.13 albertel 73: <message>
1.10 albertel 74: <p>Changing the Name will create a new slot with the new name, and not rename the existing slot.</p>
75: </message>
76: </condition>
1.1 albertel 77: <message>
1.11 albertel 78: <br />Start time:<br />
1.1 albertel 79: </message>
1.5 albertel 80: <date variable="starttime" hoursminutes="1">
81: <defaultvalue>
82: return &{$helper->{DATA}{origslot}}('starttime');
83: </defaultvalue>
84: </date>
1.1 albertel 85: <message>
1.11 albertel 86: <br />End time:<br />
1.1 albertel 87: </message>
1.5 albertel 88: <date variable="endtime" hoursminutes="1">
89: <defaultvalue>
90: return &{$helper->{DATA}{origslot}}('endtime');
91: </defaultvalue>
1.15 albertel 92: <validator>
93: if ($val < $helper->{'VARS'}{'starttime'}) {
94: return 'End time must be later than the start time.';
95: }
96: return undef;
97: </validator>
1.5 albertel 98: </date>
1.1 albertel 99: <message>
1.11 albertel 100: <br />Type:
1.1 albertel 101: </message>
102: <choices variable="type">
1.26 bisitz 103: <choice computer='preassigned'>Instructor assignable.</choice>
1.5 albertel 104: <choice computer='schedulable_student'>Student selectable.</choice>
1.1 albertel 105: <defaultvalue>
1.5 albertel 106: return &{$helper->{DATA}{origslot}}('type','preassigned');
1.1 albertel 107: </defaultvalue>
108: </choices>
109: </state>
110:
1.13 albertel 111:
1.22 albertel 112: <state name="OPTIONAL" title="Specify Optional Attributes"
113: help="Slot_OptionalAttributes">
1.1 albertel 114: <message>
1.11 albertel 115: <p>Description:<br />
1.1 albertel 116: </message>
1.5 albertel 117: <string variable="description" size="60">
118: <defaultvalue>
119: return &{$helper->{DATA}{origslot}}('description');
120: </defaultvalue>
121: </string>
1.7 albertel 122: <condition>
123: <clause>$helper->{'VARS'}{'type'} eq 'schedulable_student'</clause>
124: <message>
1.11 albertel 125: </p><p>Time students can start reserving:<br />
1.7 albertel 126: </message>
127: <date variable="startreserve" hoursminutes="1" anytime="1">
128: <defaultvalue>
129: return &{$helper->{DATA}{origslot}}('startreserve','anytime');
130: </defaultvalue>
1.15 albertel 131: <validator>
132: if (defined($val) && $val > $helper->{'VARS'}{'starttime'}) {
133: return 'Reservation time must come before the slot has started.';
134: }
135: return undef;
136: </validator>
1.7 albertel 137: </date>
138: <message>
1.28 raeburn 139: </p><p>Time students can no longer reserve:<br />
140: </message>
141: <date variable="endreserve" hoursminutes="1" anytime="1">
142: <defaultvalue>
143: return &{$helper->{DATA}{origslot}}('endreserve','anytime');
144: </defaultvalue>
145: <validator>
146: if (defined($val) && $val > $helper->{'VARS'}{'starttime'}) {
147: return 'Reservation end time must come before the slot has started.';
148: }
149: return undef;
150: </validator>
151: </date>
152: <message>
1.24 raeburn 153: </p><p>Maximum number of students allowed in this slot:<br />
1.7 albertel 154: </message>
155: <string variable="maxspace" size="4">
156: <validator>
157: if ($val ne '' && $val=~/\D/) { return 'Must be numeric.'; }
158: return undef;
159: </validator>
160: <defaultvalue>
161: return &{$helper->{DATA}{origslot}}('maxspace');
162: </defaultvalue>
163: </string>
164: <message>
1.25 felicia 165: </p><p>Period of time when this slot can only be uniquely chosen:<br /> Start:
1.7 albertel 166: </message>
167: <date variable="startunique" hoursminutes="1" anytime="1">
168: <defaultvalue>
169: my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
170: if ($default eq 'anytime') { return 'anytime' };
171: if (ref($default)) { return $default->[0]; }
172: return 'anytime';
173: </defaultvalue>
174: </date>
1.11 albertel 175: <message><br /> End: </message>
1.7 albertel 176: <date variable="endunique" hoursminutes="1" anytime="1">
177: <defaultvalue>
178: my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
179: if ($default eq 'anytime') { return 'anytime' };
180: if (ref($default)) { return $default->[1]; }
181: return 'anytime';
182: </defaultvalue>
1.15 albertel 183: <validator>
184: if (defined($val) && $val < $helper->{'VARS'}{'startunique'}) {
185: return 'End time must be later than the start time.';
186: }
187: return undef;
188: </validator>
1.7 albertel 189: </date>
1.27 raeburn 190: <message>
191: </p><p>Message(s) triggered by reservation change by student
192: </message>
193: <choices variable="reservationmsg">
194: <choice computer='only_student'>Sent to student</choice>
195: <choice computer='student_and_user_notes_screen'>Sent to student and added to user notes</choice>
196: <choice computer='none'>None sent and no record in user notes</choice>
197: <defaultvalue>
198: my $default=&{$helper->{DATA}{origslot}}('reservationmsg');
199: if ($default eq 'only_student') { return $default; }
200: if ($default eq 'student_and_user_notes_screen') { return $default; }
201: return 'none';
202: </defaultvalue>
203: </choices>
1.7 albertel 204: </condition>
205: <condition>
206: <clause>$helper->{'VARS'}{'type'} eq 'preassigned'</clause>
207: <exec>
208: delete($helper->{'VARS'}{'startreserve'});
1.28 raeburn 209: delete($helper->{'VARS'}{'endreserve'});
1.7 albertel 210: delete($helper->{'VARS'}{'maxspace'});
211: delete($helper->{'VARS'}{'startunique'});
212: delete($helper->{'VARS'}{'endunique'});
213: </exec>
214: </condition>
1.20 albertel 215:
216: <message>
217: </p><p>Proctored access:
218: </message>
219: <choices variable="useproctor">
220: <choice computer='no'>No proctor checkin required for access.</choice>
221: <choice computer='yes'>Require proctored checkin for access.</choice>
222: <defaultvalue>
223: my $default=&{$helper->{DATA}{origslot}}('proctor');
224: if ($default) { return 'yes'; }
225: return 'no';
226: </defaultvalue>
227: </choices>
228:
1.1 albertel 229: <message>
1.11 albertel 230: </p><p>Secret word proctors use to checkin users:<br />
1.3 albertel 231: </message>
232: <string variable="secret" size="12">
233: <validator>
234: return undef;
235: </validator>
1.5 albertel 236: <defaultvalue>
237: return &{$helper->{DATA}{origslot}}('secret');
238: </defaultvalue>
1.3 albertel 239: </string>
240: <message>
1.11 albertel 241: </p><p>Slot is:
1.1 albertel 242: </message>
1.22 albertel 243: <helpicon file="Slot_ChoosingResources" />
1.21 rezaferr 244:
1.1 albertel 245: <choices variable="restricttosymb">
1.4 albertel 246: <choice nextstate="PROCTOR" computer='any'>usable for any resource.</choice>
1.32 raeburn 247: <choice nextstate="MAPSELECT" computer='map'>restricted to resources in specific folder(s)/composite page(s).</choice>
248: <choice nextstate="RESOURCESELECT" computer='resource'>restricted to specific resource(s).</choice>
1.5 albertel 249: <defaultvalue>
250: my $default=&{$helper->{DATA}{origslot}}('symb');
1.31 raeburn 251: if ($default) {
1.32 raeburn 252: my @symbs;
253: if ($default =~ /,/) {
254: @symbs = split(/\s*,\s*/,$default);
255: } else {
256: @symbs = ($default);
257: }
258: if (grep(/\.(page|sequence)$/,@symbs)) {
1.31 raeburn 259: return 'map';
260: } else {
261: return 'resource';
262: }
263: } else {
264: return 'any';
265: }
1.5 albertel 266: </defaultvalue>
1.1 albertel 267: </choices>
1.34 ! raeburn 268:
! 269: <message>
! 270: </p><p>IP restrictions -- allow from all except: <br />
! 271: </message>
! 272:
! 273: <string variable="ipdeny" size="30">
! 274: <validator>
! 275: return undef;
! 276: </validator>
! 277: <defaultvalue>
! 278: return &{$helper->{DATA}{origslot}}('ipdeny');
! 279: </defaultvalue>
! 280: </string>
1.21 rezaferr 281:
1.2 albertel 282: <message>
1.34 ! raeburn 283: </p><p>IP restrictions -- deny from all except: <br />
1.2 albertel 284: </message>
1.34 ! raeburn 285:
! 286: <string variable="ipallow" size="30">
1.2 albertel 287: <validator>
288: return undef;
289: </validator>
1.5 albertel 290: <defaultvalue>
1.34 ! raeburn 291: return &{$helper->{DATA}{origslot}}('ipallow');
1.5 albertel 292: </defaultvalue>
1.2 albertel 293: </string>
1.33 raeburn 294:
295: <message>
296: </p><p>Does each student need to use a unique IP address to access a resource with this slot?</p>
297: </message>
298: <choices variable="iptied">
299: <choice computer='no'>No. The student's IP address is not tied for later access to the same resource. </choice>
300: <choice computer='yes'>Yes. The IP address on a student's first access to a resource is tied for later access.</choice>
301: <choice computer='answer'>Yes. The IP address on a student's first access to a resource is tied for later access (including post-answer date).</choice>
302: <defaultvalue>
303: my $default=&{$helper->{DATA}{origslot}}('iptied');
304: if ($default eq 'yes') { return 'yes'; }
305: if ($default eq 'answer') { return 'answer'; }
306: return 'no';
307: </defaultvalue>
308: </choices>
1.11 albertel 309: <message> </p> </message>
1.1 albertel 310: </state>
1.13 albertel 311:
312:
1.1 albertel 313: <state name="RESOURCESELECT" title="Specify Optional Attributes">
1.13 albertel 314:
315: <nextstate>PROCTOR</nextstate>
316:
1.32 raeburn 317: <resource variable="symb" multichoice="1">
318: <filterfunc>return $res->is_map() || $res->is_problem()</filterfunc>
319: <choicefunc>return $res->is_problem()</choicefunc>
1.1 albertel 320: <valuefunc>return $res->symb()</valuefunc>
1.5 albertel 321: <defaultvalue>
1.32 raeburn 322: my @defaults;
323: my $default=&{$helper->{DATA}{origslot}}('symb');
324: if ($default) {
325: @defaults=(split(/\s*,\s*/,$default));
326: }
327: return @defaults;
1.5 albertel 328: </defaultvalue>
1.1 albertel 329: </resource>
330: </state>
1.13 albertel 331:
1.31 raeburn 332: <state name="MAPSELECT" title="Specify Optional Attributes">
333:
334: <nextstate>PROCTOR</nextstate>
335:
1.32 raeburn 336: <resource variable="symb" multichoice="1">
1.31 raeburn 337: <filterfunc>return $res->is_map()</filterfunc>
338: <valuefunc>return $res->symb()</valuefunc>
339: <defaultvalue>
1.32 raeburn 340: my @defaults;
341: my $default=&{$helper->{DATA}{origslot}}('symb');
342: if ($default) {
343: @defaults=(split(/\s*,\s*/,$default));
344: }
345: return @defaults;
1.31 raeburn 346: </defaultvalue>
347: </resource>
348: </state>
1.13 albertel 349:
1.22 albertel 350: <state name="PROCTOR" title="Specify Proctors"
351: help="Slot_SpecifyProctors">
1.13 albertel 352:
1.20 albertel 353: <skip>
354: <clause>$helper->{'VARS'}{'useproctor'} eq 'no'</clause>
355: <nextstate>RESTRICTUSER</nextstate>
356: </skip>
1.13 albertel 357:
1.20 albertel 358: <nextstate>RESTRICTUSER</nextstate>
1.18 albertel 359:
1.4 albertel 360: <student variable="proctor" multichoice="1" coursepersonnel="1"
1.23 albertel 361: activeonly="1" emptyallowed="0">
1.5 albertel 362: <defaultvalue>
363: my @defaults;
364: my $default=&{$helper->{DATA}{origslot}}('proctor');
365: if ($default) {
366: @defaults=(split(',',$default));
367: }
368: return @defaults;
369: </defaultvalue>
1.4 albertel 370: </student>
371: </state>
1.13 albertel 372:
373:
1.22 albertel 374: <state name="RESTRICTUSER" title="Restrict slot availability"
375: help="Slot_RestrictAvailibility">
1.20 albertel 376: <skip>
377: <clause>$helper->{'VARS'}{'type'} ne 'schedulable_student'</clause>
378: <nextstate>FINISH</nextstate>
379: </skip>
380:
1.13 albertel 381: <nextstate>FINISH</nextstate>
382: <message>
383: <p>Slots are by default available to all users in a course, if you would like this slot to be restricted to a subset of users you can specify restrictions.</p>
384: </message>
385:
386: <message>
1.32 raeburn 387: <h3>Select sections to limit slot availability to: </h3>
1.13 albertel 388: </message>
389: <section variable="allowedsections" multichoice="1" allowempty="1">
390: <defaultvalue>
1.32 raeburn 391: return join('|||',
1.13 albertel 392: split(',',&{$helper->{DATA}{origslot}}('allowedsections')));
393: </defaultvalue>
394: </section>
395: <message>
1.32 raeburn 396: <br /><h3>Select users to limit slot availability to: </h3>
1.13 albertel 397: </message>
398: <student variable="allowedusers" multichoice="1" coursepersonnel="1"
399: activeonly="1" emptyallowed="1">
400: <defaultvalue>
401: return split(',',&{$helper->{DATA}{origslot}}('allowedusers'));
402: </defaultvalue>
403: </student>
404: </state>
405:
406:
1.30 bisitz 407: <state name="FINISH" title="Creating/Modifying Slot">
1.11 albertel 408: <message> Created Slot </message>
1.3 albertel 409: <final>
410: <finalcode>
411: my $result;
412: if ($helper->{'STATE'} ne 'FINISH') { return; }
413: my %slot;
1.13 albertel 414:
1.3 albertel 415: foreach my $which ('type','starttime','endtime') {
416: $slot{$which} = $helper->{'VARS'}{$which};
417: }
1.13 albertel 418:
1.34 ! raeburn 419: foreach my $which ('description','maxspace','secret') {
1.3 albertel 420: if ( $helper->{'VARS'}{$which} =~/\S/ ) {
421: $slot{$which} = $helper->{'VARS'}{$which};
422: }
423: }
1.13 albertel 424:
1.34 ! raeburn 425: if ($helper->{'VARS'}{'ipdeny'} =~/\S/ ) {
! 426: foreach my $item (split(',',$helper->{'VARS'}{'ipdeny'})) {
! 427: $item =~ s/^\s*//;
! 428: $item =~ s/\s*$//;
! 429: $slot{'ip'} .= '!'.$item.',';
! 430: }
! 431: }
! 432:
! 433: if ($helper->{'VARS'}{'ipallow'} =~/\S/ ) {
! 434: foreach my $item (split(',',$helper->{'VARS'}{'ipallow'})) {
! 435: $item =~ s/^\s*//;
! 436: $item =~ s/\s*$//;
! 437: $slot{'ip'} .= $item.',';
! 438: }
! 439: }
! 440:
! 441: if ($slot{'ip'} ne '') {
! 442: $slot{'ip'} =~s /,$//;
! 443: }
! 444:
1.27 raeburn 445: if ($helper->{'VARS'}{'type'} eq 'schedulable_student') {
446: if (($helper->{'VARS'}{'reservationmsg'} eq 'only_student') ||
447: ($helper->{'VARS'}{'reservationmsg'} eq 'student_and_user_notes_screen')) {
448: $slot{'reservationmsg'} = $helper->{'VARS'}{'reservationmsg'};
449: } else {
450: $slot{'reservationmsg'} = 'none';
451: }
452: }
453:
1.32 raeburn 454: if (($helper->{'VARS'}{'restricttosymb'} =~ /^(map|resource)$/) &&
455: ($helper->{'VARS'}{'symb'} =~ /\S/)) {
456: my @symbs;
457: foreach my $symb (split(/\|\|\|/, $helper->{'VARS'}{'symb'})) {
458: push(@symbs,$symb);
459: }
460: # make sure the symbs are unique
461: my %symbs = map { ($_,1) } @symbs;
462: $slot{'symb'}=join(',',sort(keys(%symbs)));
463: }
464:
1.12 albertel 465: if ( $helper->{'VARS'}{'startreserve'} > 0) {
466: $slot{'startreserve'} = $helper->{'VARS'}{'startreserve'};
467: }
1.13 albertel 468:
1.28 raeburn 469: if ( $helper->{'VARS'}{'endreserve'} > 0) {
470: $slot{'endreserve'} = $helper->{'VARS'}{'endreserve'};
471: }
472:
1.3 albertel 473: if ( $helper->{'VARS'}{'startunique'} > 0 &&
474: $helper->{'VARS'}{'endunique'} > 0 ) {
475: $slot{'uniqueperiod'} = [$helper->{'VARS'}{'startunique'},
476: $helper->{'VARS'}{'endunique'}];
477: }
1.13 albertel 478:
1.33 raeburn 479: if ( $helper->{'VARS'}{'iptied'} =~ /^(yes|answer)$/ ) {
480: $slot{'iptied'} = lc($helper->{'VARS'}{'iptied'});
481: }
482:
1.19 albertel 483: if ( $helper->{'VARS'}{'useproctor'} eq 'yes'
484: && $helper->{'VARS'}{'proctor'} =~/\S/ ) {
1.4 albertel 485: my @names;
1.16 albertel 486: # just need the username/domain throw away the other data
487: # that <student> returns
1.4 albertel 488: foreach my $user (split(/\|\|\|/, $helper->{'VARS'}{'proctor'})) {
489: my ($uname,$udomain)=split(/:/,$user);
1.16 albertel 490: push(@names,"$uname:$udomain");
1.4 albertel 491: }
1.32 raeburn 492: # make sure the usernames are unique
1.8 albertel 493: my %proctors = map { ($_,1) } @names;
494: $slot{'proctor'}=join(',',sort(keys(%proctors)));
1.4 albertel 495: }
1.13 albertel 496:
1.14 albertel 497: if ( $helper->{'VARS'}{'allowedsections'} =~/\S/ ) {
498: $slot{'allowedsections'}=
499: join(',',sort(split(/\|\|\|/,
500: $helper->{'VARS'}{'allowedsections'})));
1.13 albertel 501: }
502:
1.14 albertel 503: if ( $helper->{'VARS'}{'allowedusers'} =~/\S/ ) {
1.13 albertel 504: my @names;
1.16 albertel 505: # just need the username/domain throw away the other data
506: # that <student> returns
1.14 albertel 507: foreach my $item (split(/\|\|\|/,
508: $helper->{'VARS'}{'allowedusers'})) {
1.13 albertel 509: my ($uname,$udomain)=split(/:/,$item);
510: push(@names,"$uname:$udomain");
511: }
512:
513: # make sure the choices are unique
1.14 albertel 514: my %users = map { ($_,1) } @names;
515: $slot{'allowedusers'}=join(',',sort(keys(%users)));
1.13 albertel 516: }
517:
1.3 albertel 518: my $cname = $env{'course.'.$env{'request.course.id'}.'.num'};
519: my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
520:
521: my $ret = &Apache::lonnet::cput('slots',
522: {$helper->{'VARS'}{'name'} => \%slot},
523: $cdom,$cname);
1.29 raeburn 524: if ($ret eq 'ok') {
525: &Apache::lonnet::devalidate_slots_cache($cname,$cdom);
526: }
1.5 albertel 527: $result.="\n ".'Name: '.&HTML::Entities::encode($helper->{'VARS'}{'name'}).'</li>'.
1.4 albertel 528: "\n".'<li> Starts: '.&Apache::lonlocal::locallocaltime($slot{'starttime'}).'</li>'.
529: "\n".'<li> Ends: '.&Apache::lonlocal::locallocaltime($slot{'endtime'}).'</li>'.
1.3 albertel 530: "\n".'<li> Type: '.$slot{'type'}.'</li>';
531: my %labels =
532: map {($_->[0],$_->[1])} &Apache::slotrequest::csvupload_fields();
1.32 raeburn 533: foreach my $which ('ip','description','maxspace','secret',
1.13 albertel 534: 'allowedsections','allowedusers') {
1.3 albertel 535: if (exists($slot{$which})) {
536: $result.="\n".'<li> '.$labels{$which}.': '.
537: &HTML::Entities::encode($slot{$which}).'</li>';
538: }
539: }
1.33 raeburn 540: if (exists($slot{'iptied'})) {
541: $result.="\n".'<li> '.$labels{'iptied'}.': ';
542: if ($slot{'iptied'} eq 'yes') {
543: $result.=&Apache::lonlocal::mt('yes');
544: } elsif ($slot{'iptied'} eq 'answer') {
545: $result.=&Apache::lonlocal::mt('yes, including post-answer date');
546: }
547: $result.='</li>';
548: }
1.32 raeburn 549: if (exists($slot{'symb'})) {
550: $result.="\n".'<li> '.$labels{'symb'}.': ';
551: if ($slot{'symb'} =~ /,/) {
552: $result.='<ul>';
553: foreach my $symb (split(/\s*,\s*/,$slot{'symb'})) {
554: $result.='<li>'.&HTML::Entities::encode($symb).'</li>';
555: }
556: $result.='</ul>';
557: } else {
558: $result.=&HTML::Entities::encode($slot{'symb'});
559: }
560: $result.='</li>';
561: }
1.12 albertel 562: if (exists($slot{'startreserve'})) {
563: $result.="\n".'<li> '.$labels{'startreserve'}.': '.
564: &Apache::lonlocal::locallocaltime($slot{'startreserve'}).'</li>';
565: }
1.27 raeburn 566:
1.28 raeburn 567: if (exists($slot{'endreserve'})) {
568: $result.="\n".'<li> '.$labels{'endreserve'}.': '.
569: &Apache::lonlocal::locallocaltime($slot{'endreserve'}).'</li>';
570: }
571:
1.27 raeburn 572: if (exists($slot{'reservationmsg'})) {
573: my %options = &Apache::slotrequest::slot_reservationmsg_options();
574: $result.="\n".'<li> '.$labels{'reservationmsg'}.': '.
575: $options{$slot{'reservationmsg'}}.'</li>';
576: }
577:
1.6 albertel 578: if (exists($slot{'proctor'})) {
579: my $proctors = $slot{'proctor'};
580: $proctors =~ s/,/, /g;
581: $result.="\n".'<li> '.$labels{'proctor'}.': '.
582: &HTML::Entities::encode($proctors).'</li>';
583: }
1.3 albertel 584: if (exists($slot{'uniqueperiod'})) {
585: $result.=
586: "\n".'<li> '.$labels{'uniqueperiod'}.': '.
587: &Apache::lonlocal::locallocaltime($slot{'uniqueperiod'}[0]).
588: ', '.
589: &Apache::lonlocal::locallocaltime($slot{'uniqueperiod'}[1]).
590: '</li>';
591: }
592: return $result;
593: </finalcode>
1.4 albertel 594: <exitpage>/adm/slotrequest?command=showslots</exitpage>
1.3 albertel 595: </final>
1.1 albertel 596: </state>
597: </helper>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>