Annotation of loncom/interface/lonrequestcourse.pm, revision 1.9
1.1 raeburn 1: # The LearningOnline Network
2: # Request a course
3: #
1.9 ! raeburn 4: # $Id: lonrequestcourse.pm,v 1.8 2009/08/11 01:39:34 raeburn Exp $
1.1 raeburn 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28: ###
29:
30: =head1 NAME
31:
32: Apache::lonrequestcourse.pm
33:
34: =head1 SYNOPSIS
35:
36: Allows users to request creation of new courses.
37:
38: This is part of the LearningOnline Network with CAPA project
39: described at http://www.lon-capa.org.
40:
41: =head1 SUBROUTINES
42:
43: =over
44:
45: =item handler()
46:
47: =back
48:
49: =cut
50:
51: package Apache::lonrequestcourse;
52:
53: use strict;
54: use Apache::Constants qw(:common :http);
55: use Apache::lonnet;
56: use Apache::loncommon;
57: use Apache::lonlocal;
1.8 raeburn 58: use Apache::loncoursequeueadmin;
1.4 raeburn 59: use LONCAPA qw(:DEFAULT :match);
1.1 raeburn 60:
61: sub handler {
62: my ($r) = @_;
63: if ($r->header_only) {
64: &Apache::loncommon::content_type($r,'text/html');
65: $r->send_http_header;
66: return OK;
67: }
68: &Apache::loncommon::content_type($r,'text/html');
69: $r->send_http_header;
70:
1.2 raeburn 71: &Apache::lonhtmlcommon::clear_breadcrumbs();
72: my $dom = &get_course_dom();
1.1 raeburn 73: my $action = $env{'form.action'};
74: my $state = $env{'form.state'};
1.2 raeburn 75:
76: my %stored;
77: my $jscript;
78: if ((defined($state)) && (defined($action))) {
79: my %elements = &form_elements($dom);
80: if (($action eq 'view') && ($state ne 'crstype')) {
81: if (defined($env{'form.request_id'})) {
82: %stored = &retrieve_settings($dom,$env{'form.request_id'});
83: }
84: }
85: my $elementsref = {};
86: if (ref($elements{$action}) eq 'HASH') {
87: if (ref($elements{$action}{$state}) eq 'HASH') {
88: $elementsref = $elements{$action}{$state};
89: }
90: }
91: $jscript = &Apache::lonhtmlcommon::set_form_elements($elementsref,\%stored);
92: }
93:
94: if ($state eq 'personnel') {
95: $jscript .= "\n".&Apache::loncommon::userbrowser_javascript();
96: }
97:
98: my $loaditems = &onload_action($action,$state);
99:
100: my %states;
101: $states{'view'} = ['pick_request','details','review','process'];
102: $states{'log'} = ['filter','display'];
103: $states{'new'} = ['courseinfo','enrollment','personnel','review','process'];
104: if (($action eq 'new') && ($env{'form.crstype'} eq 'official')) {
105: unless ($env{'form.state'} eq 'crstype') {
106: unshift (@{$states{'new'}},'codepick');
107: }
108: }
109:
110: foreach my $key (keys(%states)) {
111: if (ref($states{$key}) eq 'ARRAY') {
112: unshift (@{$states{$key}},'crstype');
113: }
114: }
115:
1.3 raeburn 116: my %trail = (
1.4 raeburn 117: crstype => 'Course Request Action',
118: codepick => 'Category',
1.5 raeburn 119: courseinfo => 'Description',
1.3 raeburn 120: enrollment => 'Enrollment',
121: personnel => 'Personnel',
122: review => 'Review',
123: process => 'Result',
124: );
125:
1.2 raeburn 126: my $page = 0;
1.3 raeburn 127: my $crumb;
1.2 raeburn 128: if (defined($action)) {
129: my $done = 0;
130: my $i=0;
131: if (ref($states{$action}) eq 'ARRAY') {
132: while ($i<@{$states{$action}} && !$done) {
133: if ($states{$action}[$i] eq $state) {
134: $page = $i;
135: $done = 1;
136: }
137: $i++;
138: }
139: }
1.3 raeburn 140: for (my $i=0; $i<@{$states{$action}}; $i++) {
141: if ($state eq $states{$action}[$i]) {
142: &Apache::lonhtmlcommon::add_breadcrumb(
143: {text=>"$trail{$state}"});
144: $crumb = &Apache::lonhtmlcommon::breadcrumbs('Course Requests','Course_Requests');
145: last;
146: } else {
147: if (($state eq 'process') && ($i > 0)) {
148: &Apache::lonhtmlcommon::add_breadcrumb(
149: {href=>"javascript:backPage(document.requestcrs,'$states{$action}[0]')",
150: text=>"$trail{$states{$action}[$i]}"});
151: } else {
152: &Apache::lonhtmlcommon::add_breadcrumb(
153: {href=>"javascript:backPage(document.requestcrs,'$states{$action}[$i]')",
154: text=>"$trail{$states{$action}[$i]}"});
155: }
156: }
157: }
158: } else {
159: &Apache::lonhtmlcommon::add_breadcrumb(
160: {text=>'Pick Action'});
161: $crumb = &Apache::lonhtmlcommon::breadcrumbs('Course Requests','Course_Requests');
1.2 raeburn 162: }
163:
1.1 raeburn 164: my %can_request;
165: my $canreq = &check_can_request($dom,\%can_request);
166: if ($action eq 'new') {
167: if ($canreq) {
168: if ($state eq 'crstype') {
1.3 raeburn 169: &print_main_menu($r,\%can_request,\%states,$dom,$jscript,$loaditems,
170: $crumb);
1.1 raeburn 171: } else {
1.2 raeburn 172: &request_administration($r,$action,$state,$page,\%states,$dom,$jscript,
1.3 raeburn 173: $loaditems,$crumb);
1.1 raeburn 174: }
175: } else {
1.3 raeburn 176: $r->print(&header('Course Requests').$crumb.
1.1 raeburn 177: '<div class="LC_warning">'.
178: &mt('You do not have privileges to request creation of courses.').
1.2 raeburn 179: '</div>'.&Apache::loncommon::end_page());
1.1 raeburn 180: }
181: } elsif ($action eq 'view') {
1.3 raeburn 182: &print_request_status($jscript,$loaditems,$crumb);
1.1 raeburn 183: } elsif ($action eq 'log') {
1.3 raeburn 184: &print_request_logs($jscript,$loaditems,$crumb);
1.1 raeburn 185: } else {
1.3 raeburn 186: &print_main_menu($r,\%can_request,\%states,$dom,$jscript,'',$crumb);
1.1 raeburn 187: }
188: return OK;
189: }
190:
1.2 raeburn 191: sub header {
192: my ($bodytitle,$jscript,$loaditems,$jsextra) = @_;
193: if ($jscript) {
1.6 raeburn 194: $jscript = '<script type="text/javascript">'."\n".
195: '// <![CDATA['."\n".
196: $jscript."\n".'// ]]>'."\n".'</script>'."\n";
1.2 raeburn 197: }
198: if ($loaditems) {
1.3 raeburn 199: $loaditems = {'add_entries' => $loaditems,};
200: return &Apache::loncommon::start_page($bodytitle,$jscript.$jsextra,$loaditems);
201: } else {
202: return &Apache::loncommon::start_page($bodytitle,$jscript.$jsextra);
203: }
1.2 raeburn 204: }
205:
206: sub form_elements {
207: my ($dom) = @_;
208: my %elements =
209: (
210: new => {
211: crstype => {
212: crstype => 'selectbox',
213: action => 'selectbox',
214: },
215: courseinfo => {
216: cdescr => 'text',
217: clonecourse => 'text',
218: clonedomain => 'selectbox',
219: datemode => 'radio',
220: dateshift => 'text',
221: },
222: enrollment => {
223: startaccess_month => 'selectbox',
224: startaccess_hour => 'selectbox',
225: endaccess_month => 'selectbox',
226: endaccess_hour => 'selectbox',
227: startaccess_day => 'text',
228: startaccess_year => 'text',
229: startaccess_minute => 'text',
230: startaccess_second => 'text',
231: endaccess_day => 'text',
232: endaccess_year => 'text',
233: endaccess_minute => 'text',
234: endaccess_second => 'text',
235: no_end_date => 'checkbox',
236: },
237: personnel => {
238: persontotal => 'hidden',
239: addperson => 'checkbox',
240: },
241: },
242: view => {
243: crstype => {
244: crstype => 'selectbox',
245: action => 'selectbox',
246: },
247: },
248: );
249: my (@codetitles,%cat_titles,%cat_order,@code_order,$lastitem);
250: &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
251: \%cat_order,\@code_order);
252: my $numtitles = scalar(@codetitles);
253: if ($numtitles) {
254: my %extras;
255: $lastitem = pop(@codetitles);
256: $extras{'instcode_'.$lastitem} = 'text';
257: foreach my $item (@codetitles) {
258: $extras{'instcode_'.$item} = 'selectbox';
259: }
260: $elements{'new'}{'codepick'} = \%extras;
261: }
262: if (&Apache::lonnet::auto_run('',$dom)) {
263: my %extras = (
264: sectotal => 'hidden',
265: startenroll_month => 'selectbox',
266: startenroll_hour => 'selectbox',
267: endenroll_month => 'selectbox',
268: endenroll_hour => 'selectbox',
269: startenroll_day => 'text',
270: startenroll_year => 'text',
271: startenroll_minute => 'text',
272: startenroll_second => 'text',
273: endenroll_day => 'text',
274: endenroll_year => 'text',
275: endenroll_minute => 'text',
276: endenroll_second => 'text',
277: crosslisttotal => 'hidden',
278: addcrosslist => 'checkbox',
279: autoadds => 'radio',
280: autodrops => 'radio',
281: );
282: if ($env{'form.sectotal'} > 0) {
283: for (my $i=0; $i<$env{'form.sectotal'}; $i++) {
284: $extras{'sec_'.$i} = 'checkbox',
285: $extras{'secnum_'.$i} = 'text',
286: $extras{'loncapasec_'.$i} = 'checkbox',
287: }
288: }
289: my $crosslisttotal = $env{'form.crosslisttotal'};
290: if (!defined($crosslisttotal)) {
291: $crosslisttotal = 1;
292: }
293: if ($crosslisttotal > 0) {
294: for (my $i=0; $i<$env{'form.crosslisttotal'}; $i++) {
295: if ($numtitles) {
296: $extras{'crosslist_'.$i.'_'.$lastitem} = 'text';
297: }
298: if (@codetitles > 0) {
299: foreach my $item (@codetitles) {
300: $extras{'crosslist_'.$i.'_'.$item} = 'selectbox';
301: }
302: }
303: $extras{'crosslist_'.$i} = 'checkbox';
304: $extras{'crosslist_'.$i.'_instsec'} = 'text',
305: $extras{'crosslist_'.$i.'_lcsec'} = 'text',
306: }
307: }
308: my %mergedhash = (%{$elements{'new'}{'enrollment'}},%extras);
309: %{$elements{'new'}{'enrollment'}} = %mergedhash;
310: }
311: my %people;
312: my $persontotal = $env{'form.persontotal'};
313: if (!defined($persontotal)) {
314: $persontotal = 1;
315: }
316: for (my $i=0; $i<$persontotal; $i++) {
317: $people{'person_'.$i.'_uname'} = 'text',
318: $people{'person_'.$i.'_dom'} = 'selectbox',
319: $people{'person_'.$i.'_hidedom'} = 'hidden',
320: $people{'person_'.$i.'_first'} = 'text',
321: $people{'person_'.$i.'_last'} = 'text',
322: $people{'person_'.$i.'_email'} = 'text',
323: $people{'person_'.$i.'_role'} = 'selectbox',
324: $people{'person_'.$i.'_sec'} = 'selectbox',
325: $people{'person_'.$i.'_newsec'} = 'text',
326: $people{'person_'.$i.'_sections'} = 'hidden',
327: }
328: my %personnelhash = (%{$elements{'new'}{'personnel'}},%people);
329: %{$elements{'new'}{'personnel'}} = %personnelhash;
330: return %elements;
331: }
332:
333: sub onload_action {
334: my ($action,$state) = @_;
335: my %loaditems;
336: if (($action eq 'new') || ($action eq 'view')) {
337: $loaditems{'onload'} = 'javascript:setFormElements(document.requestcrs)';
338: }
339: return \%loaditems;
340: }
341:
1.1 raeburn 342: sub check_can_request {
343: my ($dom,$can_request) = @_;
344: my $canreq = 0;
1.4 raeburn 345: my ($types,$typename) = &course_types();
346: if ((ref($can_request) eq 'HASH') && (ref($types) eq 'ARRAY')) {
347: foreach my $type (@{$types}) {
1.1 raeburn 348: if (&Apache::lonnet::usertools_access($env{'user.name'},
349: $env{'user.domain'},
350: $type,undef,'requestcourses')) {
351: $canreq ++;
352: if ($dom eq $env{'user.domain'}) {
353: $can_request->{$type} = 1;
354: }
355: }
356: if ($env{'environment.reqcrsotherdom.'.$type} ne '') {
357: my @curr = split(',',$env{'environment.reqcrsotherdom.'.$type});
358: if (@curr > 0) {
359: $canreq ++;
360: unless ($dom eq $env{'user.domain'}) {
361: if (grep(/^\Q$dom\E$/,@curr)) {
362: $can_request->{$type} = 1;
363: }
364: }
365: }
366: }
367: }
368: }
369: return $canreq;
370: }
371:
1.4 raeburn 372: sub course_types {
373: my @types = ('official','unofficial','community');
374: my %typename = (
375: official => 'Official course',
376: unofficial => 'Unofficial course',
377: community => 'Community',
378: );
379: return (\@types,\%typename);
380: }
381:
382:
1.1 raeburn 383: sub print_main_menu {
1.3 raeburn 384: my ($r,$can_request,$states,$dom,$jscript,$loaditems,$crumb) = @_;
1.4 raeburn 385: my ($types,$typename) = &course_types();
1.1 raeburn 386: my $onchange;
387: unless ($env{'form.interface'} eq 'textual') {
388: $onchange = 1;
389: }
390:
1.2 raeburn 391: my $nextstate_setter = "\n";
392: if (ref($states) eq 'HASH') {
393: foreach my $key (keys(%{$states})) {
394: if (ref($states->{$key}) eq 'ARRAY') {
395: $nextstate_setter .=
396: " if (actionchoice == '$key') {
397: nextstate = '".$states->{$key}[1]."';
398: }
399: ";
400: }
401: }
402: }
1.1 raeburn 403:
1.2 raeburn 404: my $js = <<"END";
1.1 raeburn 405:
1.2 raeburn 406: function nextPage(formname) {
407: var crschoice = document.requestcrs.crstype.value;
408: var actionchoice = document.requestcrs.action.value;
409: if (check_can_request(crschoice,actionchoice) == true) {
410: if ((actionchoice == 'new') && (crschoice == 'official')) {
411: nextstate = 'codepick';
412: } else {
413: $nextstate_setter
414: }
1.1 raeburn 415: formname.state.value= nextstate;
416: formname.submit();
417: }
418: return;
419: }
420:
1.2 raeburn 421: function check_can_request(crschoice,actionchoice) {
1.1 raeburn 422: var official = '';
423: var unofficial = '';
424: var community = '';
425: END
426:
427: foreach my $item (keys(%{$can_request})) {
428: $js .= "
429: $item = 1;
430: ";
431: }
432: my %lt = &Apache::lonlocal::texthash(
433: official => 'You are not permitted to request creation of an official course in this domain.',
434: unofficial => 'You are not permitted to request creation of an unofficial course in this domain.',
435: community => 'You are not permitted to request creation of a community this domain.',
436: all => 'You must choose a specific course type when making a new course request.\\nAll types is not allowed.',
437: );
438: $js .= <<END;
439: if (crschoice == 'official') {
440: if (official != 1) {
441: alert("$lt{'official'}");
442: return false;
443: }
444: } else {
445: if (crschoice == 'unofficial') {
446: if (unofficial != 1) {
447: alert("$lt{'unofficial'}");
448: return false;
449: }
450: } else {
451: if (crschoice == 'community') {
452: if (community != 1) {
453: alert("$lt{'community'}");
454: return false;
455: }
456: } else {
457: if (actionchoice == 'new') {
458: alert("$lt{'all'}");
459: return false;
460: }
461: }
462: }
463: }
464: return true;
465: }
466:
467: END
468:
1.3 raeburn 469: $r->print(&header('Course Requests',$js.$jscript,$loaditems).$crumb.
470: '<div>'.
1.1 raeburn 471: '<form name="domforcourse" method="post" action="/adm/requestcourse">'.
472: &Apache::lonhtmlcommon::start_pick_box().
1.8 raeburn 473: &Apache::lonhtmlcommon::row_title('Course Domain').
1.1 raeburn 474: &Apache::loncommon::select_dom_form($dom,'showdom','',1,$onchange));
475: if (!$onchange) {
476: $r->print(' <input type="submit" name="godom" value="'.
477: &mt('Change').'" />');
478: }
479: $r->print(&Apache::lonhtmlcommon::row_closure(1).
480: &Apache::lonhtmlcommon::end_pick_box().'</form></div>');
481:
1.2 raeburn 482: my $formname = 'requestcrs';
1.1 raeburn 483: my $nexttext = &mt('Next');
484: $r->print('<div><form name="'.$formname.'" method="post" action="/adm/requestcourse">'.
485: &Apache::lonhtmlcommon::start_pick_box().
486: &Apache::lonhtmlcommon::row_title('Action').'
487: <input type="hidden" name="showdom" value="'.$dom.'" />
488: <select size="1" name="action" >
1.2 raeburn 489: <option value="new">'.&mt('New request').'</option>
1.1 raeburn 490: <option value="view">'.&mt('View/Modify/Cancel pending requests').'</option>
491: <option value="log">'.&mt('View request history').'</option>
492: </select>'.
493: &Apache::lonhtmlcommon::row_closure().
494: &Apache::lonhtmlcommon::row_title('Course Type').'
495: <select size="1" name="crstype">
1.4 raeburn 496: <option value="any">'.&mt('All types').'</option>');
497: if ((ref($types) eq 'ARRAY') && (ref($typename) eq 'HASH')) {
498: foreach my $type (@{$types}) {
499: my $selected = '';
500: if ($type eq 'official') {
501: $selected = ' selected="selected"';
502: }
503: $r->print('<option value="'.$type.'"'.$selected.'>'.$typename->{$type}.
504: '</option>'."\n");
505: }
506: }
507: $r->print('</select>
1.1 raeburn 508: <input type="hidden" name="state" value="crstype" />'.
509: &Apache::lonhtmlcommon::row_closure(1).
510: &Apache::lonhtmlcommon::end_pick_box().'<br />
1.2 raeburn 511: <input type="button" name="next" value="'.$nexttext.'" onclick="javascript:nextPage(document.'.$formname.')" />
1.1 raeburn 512: </form></div>');
513: $r->print(&Apache::loncommon::end_page());
514: return;
515: }
516:
517: sub request_administration {
1.3 raeburn 518: my ($r,$action,$state,$page,$states,$dom,$jscript,$loaditems,$crumb) = @_;
1.2 raeburn 519: my $js;
520: if (($action eq 'new') || ($action eq 'view')) {
521: $js = <<END;
1.1 raeburn 522:
523: function nextPage(formname,nextstate) {
524: formname.state.value= nextstate;
525: formname.submit();
526: }
527: function backPage(formname,prevstate) {
528: formname.state.value = prevstate;
529: formname.submit();
530: }
531:
532: END
1.2 raeburn 533: }
534: if ($action eq 'new') {
535: my $jsextra;
1.1 raeburn 536: unless (($state eq 'review') || ($state eq 'process')) {
1.2 raeburn 537: $jsextra = "\n".&Apache::loncommon::coursebrowser_javascript($dom);
1.1 raeburn 538: }
1.3 raeburn 539: $r->print(&header('Request a course',$js.$jscript,$loaditems,$jsextra).$crumb);
1.8 raeburn 540: &print_request_form($r,$action,$state,$page,$states,$dom);
1.2 raeburn 541: } elsif ($action eq 'view') {
1.3 raeburn 542: $r->print(&header('Manage course requests',$js.$jscript,$loaditems).$crumb);
1.1 raeburn 543: } elsif ($action eq 'log') {
1.3 raeburn 544: $r->print(&coursereq_log('View request log',$jscript,$loaditems).$crumb);
1.1 raeburn 545: }
1.2 raeburn 546: $r->print(&Apache::loncommon::end_page());
1.1 raeburn 547: return;
548: }
549:
550: sub print_request_form {
1.2 raeburn 551: my ($r,$action,$state,$page,$states,$dom) = @_;
1.1 raeburn 552: my $formname = 'requestcrs';
1.2 raeburn 553: my ($next,$prev,$message,$output,$codepicker,$crstype);
554: $prev = $states->{$action}[$page-1];
555: $next = $states->{$action}[$page+1];
1.4 raeburn 556: my %navtxt = &Apache::lonlocal::texthash (
557: prev => 'Previous',
558: next => 'Next',
559: );
1.2 raeburn 560: $crstype = $env{'form.crstype'};
1.1 raeburn 561: $r->print('<form name="'.$formname.'" method="post" action="/adm/requestcourse">');
1.2 raeburn 562: my (@codetitles,%cat_titles,%cat_order,@code_order,$instcode,$code_chk);
1.1 raeburn 563: if ($crstype eq 'official') {
1.2 raeburn 564: if ($env{'form.instcode'} ne '') {
565: $instcode = $env{'form.instcode'};
566: }
567: }
568: if ($prev eq 'codepick') {
1.4 raeburn 569: if ($crstype eq 'official') {
570: &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
571: \%cat_order,\@code_order);
572: }
1.2 raeburn 573: if (@code_order > 0) {
574: my $message;
575: if ($instcode eq '') {
1.1 raeburn 576: foreach my $item (@code_order) {
1.2 raeburn 577: $instcode .= $env{'form.instcode_'.$item};
1.1 raeburn 578: }
1.2 raeburn 579: $r->print('<input type="hidden" name="instcode" value="'.$instcode.'" />'."\n");
1.1 raeburn 580: }
581: if ($instcode ne '') {
1.2 raeburn 582: $code_chk = &Apache::lonnet::auto_validate_instcode('',$dom,$instcode);
1.1 raeburn 583: if ($code_chk eq 'ok') {
584: $message = '<div class="LC_info">'.
585: &mt('The chosen course category [_1] is valid.','<b>'.
1.2 raeburn 586: $instcode.'</b>').'</div>';
1.1 raeburn 587: } else {
588: $message = '<div class="LC_warning">'.
589: &mt('No course was found matching your choice of institutional course category.');
590: if ($code_chk ne '') {
591: $message .= '<br />'.$code_chk;
592: }
593: $message .= '</div>';
594: }
1.2 raeburn 595: } else {
596: $message = '<div class="LC_warning">'.
597: &mt('No course was found matching your choice of institutional course category.');
1.1 raeburn 598: }
1.2 raeburn 599: unless ($code_chk eq 'ok') {
600: $prev = 'crstype';
601: }
602: $r->print($message);
1.1 raeburn 603: }
1.2 raeburn 604: }
605: if ($prev eq 'crstype') {
1.4 raeburn 606: if ($crstype eq 'official') {
607: &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
608: \%cat_order,\@code_order);
609: }
1.2 raeburn 610: if (@code_order > 0) {
1.1 raeburn 611: $codepicker = &coursecode_form($dom,'instcode',\@codetitles,
612: \%cat_titles,\%cat_order);
1.2 raeburn 613: if ($codepicker) {
614: $r->print('<div>'.&Apache::lonhtmlcommon::start_pick_box().$codepicker.
615: &Apache::lonhtmlcommon::end_pick_box().'</div>');
616: } else {
617: $r->print(&courseinfo_form($dom,$formname,$crstype));
618: }
619: } else {
620: $r->print(&courseinfo_form($dom,$formname,$crstype));
1.1 raeburn 621: }
1.2 raeburn 622: } elsif ($prev eq 'codepick') {
623: $r->print(&courseinfo_form($dom,$formname,$crstype));
624: } elsif ($state eq 'enrollment') {
1.4 raeburn 625: if ($crstype eq 'official') {
626: &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
627: \%cat_order,\@code_order);
628: }
1.2 raeburn 629: $r->print(&print_enrollment_menu($formname,$instcode,$dom,\@codetitles,
630: \%cat_titles,\%cat_order,\@code_order));
631: } elsif ($state eq 'personnel') {
1.8 raeburn 632: $r->print(&print_personnel_menu($dom,$formname,$crstype));
1.4 raeburn 633: } elsif ($state eq 'review') {
634: &Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
635: \%cat_order,\@code_order);
636: $r->print(&print_review($formname,$dom,\@codetitles,\%cat_titles,\%cat_order,
637: \@code_order));
638: $navtxt{'next'} = &mt('Submit course request');
1.8 raeburn 639: } elsif ($state eq '') {
640: my $result = &print_request_outcome($dom);
1.1 raeburn 641: }
1.2 raeburn 642: my @excluded = ('counter');
643: my %elements = &form_elements($dom);
644: if (ref($states) eq 'HASH') {
645: if (ref($states->{$action}) eq 'ARRAY') {
646: my @items = @{$states->{$action}};
647: my $numitems = scalar(@items);
648: if ($numitems) {
649: for (my $i=$numitems-1; $i>=0; $i--) {
650: if (ref($elements{$action}) eq 'HASH') {
651: if (ref($elements{$action}{$items[$i]}) eq 'HASH') {
652: foreach my $key (keys(%{$elements{$action}{$items[$i]}})) {
653: push(@excluded,$key);
654: }
655: }
656: }
657: last if ($items[$i] eq $state);
658: }
659: }
660: }
661: }
662: if (grep(/^instcode_/,@excluded)) {
663: push(@excluded,'instcode');
1.1 raeburn 664: }
1.2 raeburn 665: $r->print(&Apache::lonhtmlcommon::echo_form_input(\@excluded).'</form>');
1.4 raeburn 666: &display_navbuttons($r,$formname,$prev,$navtxt{'prev'},$next,$navtxt{'next'});
1.1 raeburn 667: return;
668: }
669:
1.2 raeburn 670: sub print_enrollment_menu {
671: my ($formname,$instcode,$dom,$codetitles,$cat_titles,$cat_order,$code_order) =@_;
672: my ($sections,$autoenroll,$access_dates);
673: my $starttime = time;
674: my $endtime = time+(6*30*24*60*60); # 6 months from now, approx
675:
676: my %accesstitles = (
677: 'start' => 'Default start access',
678: 'end' => 'Default end accss',
679: );
680: my %enrolltitles = (
681: 'start' => 'Start auto-enrollment',
682: 'end' => 'End auto-enrollment',
683: );
684: if ($env{'form.crstype'} eq 'official') {
685: if (&Apache::lonnet::auto_run('',$dom)) {
686: my ($section_form,$crosslist_form,$autoenroll_form);
687: $section_form = &inst_section_selector($dom,$instcode);
688: my $crosslisttotal = $env{'form.crosslisttotal'};
689: if (!defined($crosslisttotal)) {
690: $crosslisttotal = 1;
691: }
692: if ($env{'form.addcrosslist'}) {
693: $crosslisttotal ++;
694: }
695: for (my $i=0; $i<$crosslisttotal; $i++) {
696: $crosslist_form .= &coursecode_form($dom,'crosslist',$codetitles,
697: $cat_titles,$cat_order,$i);
698: }
699: if ($crosslist_form) {
700: $crosslist_form .=
701: &Apache::lonhtmlcommon::row_title(&mt('Add another?')).
702: '<input name="crosslisttotal" type="hidden" value="'.$crosslisttotal.'" />'.
703: '<input name="addcrosslist" type="checkbox" value="'.$crosslisttotal.'"'.
704: ' onclick="javascript:nextPage(document.'.$formname.",'".$env{'form.state'}.
705: "'".');" />'.&mt('Add?').&Apache::lonhtmlcommon::row_closure(1);
706: }
707: if ($section_form || $crosslist_form) {
708: $sections = '<div>'.&Apache::lonhtmlcommon::start_pick_box().
709: $section_form.$crosslist_form.
710: &Apache::lonhtmlcommon::end_pick_box().'</div>'."\n";
711: }
712: $autoenroll_form =
713: &Apache::lonhtmlcommon::row_title(&mt('Add registered students automatically')).
714: '<span class="LC_nobreak"><label>'.
715: '<input type="radio" name="autoadds" value="1">'.
716: &mt('Yes').'</label>'.(' 'x3).'<label>'.
717: '<input type="radio" name="autoadds" value="0" checked="checked">'.
718: &mt('No').'</label></span>'.
719: &Apache::lonhtmlcommon::row_closure().
720: &Apache::lonhtmlcommon::row_title(&mt('Drop unregistered students automatically')).
721: '<span class="LC_nobreak"><label>'.
722: '<input type="radio" name="autodrops" value="1">'.
723: &mt('Yes').'</label>'.(' 'x3).'<label>'.
724: '<input type="radio" name="autodrops" value="0" checked="checked">'.
725: &mt('No').'</label></span>'.
726: &Apache::lonhtmlcommon::row_closure().
727: &date_setting_table($starttime,$endtime,$formname,'enroll',%enrolltitles);
728: if ($autoenroll_form) {
729: $autoenroll = '<div>'.&Apache::lonhtmlcommon::start_pick_box().
730: $autoenroll_form.
731: &Apache::lonhtmlcommon::end_pick_box().'</div>'."\n";
732: }
733: }
734: }
735: my $access_dates_form =
736: &date_setting_table($starttime,$endtime,$formname,'access',%accesstitles);
737: if ($access_dates_form) {
738: $access_dates = '<div>'.&Apache::lonhtmlcommon::start_pick_box().
739: $access_dates_form.
740: &Apache::lonhtmlcommon::end_pick_box().'</div>'."\n";
741: }
742: return $sections.$autoenroll.$access_dates;
743: }
744:
1.1 raeburn 745: sub inst_section_selector {
1.2 raeburn 746: my ($dom,$instcode) = @_;
747: my @sections = &Apache::lonnet::auto_get_sections(undef,$dom,$instcode);
748: my $sectotal = scalar(@sections);
1.1 raeburn 749: my $output;
1.2 raeburn 750: if ($sectotal) {
751: $output .= &Apache::lonhtmlcommon::row_title('Sections').
752: &Apache::loncommon::start_data_table().
753: &Apache::loncommon::start_data_table_row().
754: '<th>'.&mt('Include?').'<input type="hidden" name="sectotal" '.
755: 'value="'.$sectotal.'"</th>'.
756: '<th>'.&mt('Institutional Section').'</th>'.
757: '<th>'.&mt('LON-CAPA section').'</th>'.
758: &Apache::loncommon::end_data_table_row();
759: for (my $i=0; $i<@sections; $i++) {
1.1 raeburn 760: my $colflag = $i%2;
761: $output .= &Apache::loncommon::start_data_table_row().
1.2 raeburn 762: '<td><input type="checkbox" name="sec_'.$i.
763: '" checked="checked" /></td>'.
764: '<td>'.$sections[$i].
1.1 raeburn 765: '<input type="hidden" name="secnum_'.$i.'" value="'.
1.2 raeburn 766: $sections[$i].'" /></td>'.
1.1 raeburn 767: '<td><input type="text" size="10" name="loncapasec_'.$i.
1.2 raeburn 768: '" value="'.$sections[$i].'" /></td>'.
1.1 raeburn 769: &Apache::loncommon::end_data_table_row();
770: }
1.2 raeburn 771: $output .= &Apache::loncommon::end_data_table().
772: &Apache::lonhtmlcommon::row_closure();
1.1 raeburn 773: }
774: return $output;
775: }
776:
1.2 raeburn 777: sub date_setting_table {
778: my ($starttime,$endtime,$formname,$suffix,%datetitles) = @_;
779: my ($perpetual,$table);
780: my $startform = &Apache::lonhtmlcommon::date_setter($formname,'start'.$suffix,
781: $starttime,'','','',1,'','','',1);
782: my $endform = &Apache::lonhtmlcommon::date_setter($formname,'end'.$suffix,
783: $endtime,'','','',1,'','','',1);
784: if ($suffix eq 'access') {
785: $perpetual = ' <span class="LC_nobreak"><label>'.
786: '<input type="checkbox" name="no_end_date" />'.
787: &mt('No end date').'</label></span>';
788: }
789: $table = &Apache::lonhtmlcommon::row_title($datetitles{'start'}).
790: $startform.
791: &Apache::lonhtmlcommon::row_closure().
792: &Apache::lonhtmlcommon::row_title($datetitles{'end'}).
793: $endform.$perpetual.
794: &Apache::lonhtmlcommon::row_closure(1);
795: return $table;
796: }
797:
798: sub print_personnel_menu {
1.8 raeburn 799: my ($dom,$formname,$crstype) = @_;
1.2 raeburn 800: my $output = '<div>'.&Apache::lonhtmlcommon::start_pick_box();
801: my $persontotal = $env{'form.persontotal'};
802: if (!defined($persontotal)) {
803: $persontotal = 1;
804: }
805: if ($env{'form.addperson'}) {
806: $persontotal ++;
807: }
808: my $userlinktxt = &mt('Set User');
809: my @items = ('uname','dom','last','first','email','hidedom');
810:
811: my $roleoptions;
812: my @roles = &Apache::lonuserutils::roles_by_context('course');
1.8 raeburn 813: my $type = 'Course';
814: if ($crstype eq 'community') {
815: $type = 'Community';
816: }
1.2 raeburn 817: foreach my $role (@roles) {
1.8 raeburn 818: my $plrole=&Apache::lonnet::plaintext($role,$type);
1.2 raeburn 819: $roleoptions .= ' <option value="'.$role.'">'.$plrole.'</option>'."\n";
820: }
821: my %customroles=&Apache::lonuserutils::my_custom_roles();
822: if (keys(%customroles) > 0) {
823: foreach my $cust (sort(keys(%customroles))) {
824: my $custrole='cr_cr_'.$env{'user.domain'}.
825: '_'.$env{'user.name'}.'_'.$cust;
826: $roleoptions .= ' <option value="'.$custrole.'">'.$cust.'</option>'."\n";
827: }
828: }
829:
830: my @currsecs;
831: if ($env{'form.sectotal'}) {
832: for (my $i=0; $i<$env{'form.sectotal'}; $i++) {
833: if (defined($env{'form.loncapasec_'.$i})) {
834: my $lcsec = $env{'form.loncapasec_'.$i};
835: unless (grep(/^\Q$lcsec\E$/,@currsecs)) {
836: push(@currsecs,$lcsec);
837: }
838: }
839: }
840: }
841:
842: my ($existtitle,$existops,$existmult,$newtitle,$seccolspan);
843: if (@currsecs) {
844: my $existsize = scalar(@currsecs);
845: if ($existsize > 3) {
846: $existsize = 3;
847: }
848: if ($existsize > 1) {
849: $existmult = ' multiple="multiple" size="'.$existsize.'" ';
850: }
851: @currsecs = sort { $a <=> $b } (@currsecs);
852: $existtitle = &mt('Official').': ';
853: $existops = '<option value="">'.&mt('None').'</option>';
854: foreach my $sec (@currsecs) {
855: $existops .= '<option value="'.$sec.'">'.$sec.'</option>'."\n";
856: }
857: $seccolspan = ' colspan="2"';
858: $newtitle = &mt('Other').': ';
859: }
860:
861: for (my $i=0; $i<$persontotal; $i++) {
862: my @linkargs = map { 'person_'.$i.'_'.$_ } (@items);
863: my $linkargstr = join("','",@linkargs);
1.7 raeburn 864: my $userlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,$userlinktxt);
1.2 raeburn 865: my $uname_form = '<input type="text" name="person_'.$i.'_uname" value=""'.
866: ' onFocus="this.blur();'.
1.7 raeburn 867: 'openuserbrowser('."'$formname','$linkargstr','$dom'".');" />';
1.2 raeburn 868: my $onchange = 'javascript:fix_domain('."'$formname','person_".$i."_dom',".
869: "'person_".$i."_hidedom'".');'.
1.7 raeburn 870: 'openuserbrowser('."'$formname','$linkargstr','$dom'".');';
1.2 raeburn 871: my $udom_form = &Apache::loncommon::select_dom_form($dom,'person_'.$i.'_dom','',
872: 1,$onchange).
873: '<input type="hidden" name="person_'.$i.'_hidedom" value="'.$dom.'" />';
874: my %form_elems;
875: foreach my $item (@items) {
876: next if (($item eq 'dom') || ($item eq 'uname') || ($item eq 'hidedom'));
877: $form_elems{$item} = '<input type="text" name="person_'.$i.'_'.$item.'" '.
878: 'value="" readonly="readonly" />';
879: }
880: my $roleselector = '<select name="person_'.$i.'_role">'."\n".
881: $roleoptions.'</select>';
882: my $sectionselector;
883: if (@currsecs) {
884: $sectionselector = $existtitle.'<select name="person_'.$i.'_sec"'.
885: $existmult.'>'."\n".$existops.'</select>'.(' ' x3);
886: }
887: $sectionselector .= $newtitle.
888: '<input type="text" name="person_'.$i.'_newsec" size="15" value="" />'.
889: '<input type="hidden" name="person_'.$i.'_sections" value="" />'."\n";
890:
891: $output .=
892: &Apache::lonhtmlcommon::row_title(&mt('Additional Personnel').'<br />'.
893: '<span class="LC_nobreak">'.$userlink.
894: '</span>').
895: '<table><tr><td align="center" valign="top">'.&mt('Username').'<br />'.$uname_form.'</td>'."\n".
896: '<td align="center" valign="top" colspan="2">'.&mt('Domain').'<br />'.$udom_form.'</td></tr><tr>'."\n".
897: '<td align="center" valign="top">'.&mt('First Name').'<br />'.$form_elems{'first'}.'</td>'."\n".
898: '<td align="center" valign="top">'.&mt('Last Name').'<br />'.$form_elems{'last'}.'</td>'."\n".
899: '<td align="center" valign="top">'.&mt('E-mail').'<br />'.$form_elems{email}.'</td></tr>'."\n".
900: '<tr><td align="center" valign="top">'.&mt('Role').'<br />'.$roleselector.'</td>'."\n".
901: '<td'.$seccolspan.' align="center" valign="top">'.&mt('Section(s)').'<br />'.$sectionselector.'</td>'."\n".
902: '</tr></table>'.&Apache::lonhtmlcommon::row_closure();
903: }
904: $output .= &Apache::lonhtmlcommon::row_title(&mt('Add another?')).
905: '<input name="persontotal" type="hidden" value="'.$persontotal.'" />'.
906: '<input name="addperson" type="checkbox" value="'.$persontotal.'"'.
907: ' onclick="javascript:nextPage(document.'.$formname.",'".$env{'form.state'}.
908: "'".');" />'.&mt('Add?').&Apache::lonhtmlcommon::row_closure(1).
909: &Apache::lonhtmlcommon::end_pick_box().'</div>';
910: return $output;
911: }
912:
1.1 raeburn 913: sub print_request_status {
914: return;
915: }
916:
917: sub print_request_logs {
918: return;
919: }
920:
921: sub print_review {
1.4 raeburn 922: my ($formname,$dom,$codetitles,$cat_titles,$cat_order,$code_order) = @_;
923: my ($types,$typename) = &course_types();
924: my ($owner,$ownername,$owneremail);
925: $owner = $env{'user.name'}.':'.$env{'user.domain'};
926: $ownername = &Apache::loncommon::plainname($env{'user.name'},
927: $env{'user.domain'},'first');
928: my %emails = &Apache::loncommon::getemails();
929: foreach my $email ('permanentemail','critnotification','notification') {
930: $owneremail = $emails{$email};
931: last if ($owneremail ne '');
932: }
933: my ($inst_headers,$inst_values,$crstypename,$enroll_headers,$enroll_values,
934: $section_headers,$section_values,$personnel_headers,$personnel_values);
935:
936: $crstypename = $env{'form.crstype'};
937: if (ref($typename) eq 'HASH') {
938: unless ($typename->{$env{'form.crstype'}} eq '') {
939: $crstypename = $typename->{$env{'form.crstype'}};
940: }
941: }
942:
943: $inst_headers = '<th>'.&mt('Description').'</th><th>'.&mt('Type').'</th>';
944: $inst_values = '<td>'.$env{'form.cdescr'}.'</td><td>'.$crstypename.'</td>';
945:
946: if ($env{'form.crstype'} eq 'official') {
947: if ((ref($codetitles) eq 'ARRAY') && (ref($cat_titles) eq 'HASH')) {
948: foreach my $title (@{$codetitles}) {
949: if ($env{'form.instcode_'.$title} ne '') {
950: $inst_headers .= '<th>'.$title.'</th>';
951: my $longitem = $env{'form.instcode_'.$title};
952: if (ref($cat_titles->{$title}) eq 'HASH') {
953: if ($cat_titles->{$title}{$env{'form.instcode_'.$title}} ne '') {
954: $longitem = $cat_titles->{$title}{$env{'form.instcode_'.$title}};
955: }
956: }
957: $inst_values .= '<td>'.$longitem.'</td>';
958: }
959: }
960: }
961: if (&Apache::lonnet::auto_run('',$dom)) {
962: $enroll_headers = '<th>'.&mt('Automatic Adds').'</th>'.
963: '<th>'.&mt('Automatic Drops').'</th>'.
964: '<th>'.&mt('Enrollment Starts').'</th>'.
965: '<th>'.&mt('Enrollment Ends').'</th>';
966: $section_headers = '<th>'.&mt('Sections').'</th>'.
967: '<th>'.&mt('Crosslistings').'</th>';
968:
969: my ($startenroll,$endenroll) = &dates_from_form('startenroll','endenroll');
970: my @autoroster = (&mt('No'),&mt('Yes'));
971: $enroll_values = '<td>'.$autoroster[$env{'form.autoadds'}].'</td>'.
972: '<td>'.$autoroster[$env{'form.autodrops'}].'</td>'.
973: '<td>'.&Apache::lonlocal::locallocaltime($startenroll).'</td>'.
974: '<td>'.&Apache::lonlocal::locallocaltime($endenroll).'</td>';
1.6 raeburn 975: $section_values = '<td><table class="LC_innerpickbox"><tr><th>'.
976: &mt('Institutional section').'</th>'.
977: '<th>'.&mt('LON-CAPA section').'</th></tr>';
1.5 raeburn 978: my $secinfo;
1.4 raeburn 979: if ($env{'form.sectotal'} > 0) {
980: for (my $i=0; $i<$env{'form.sectotal'}; $i++) {
981: if ($env{'form.sec_'.$i}) {
1.5 raeburn 982: $secinfo .= '<tr><td>'.$env{'form.secnum_'.$i}.'</td><td>';
1.4 raeburn 983: if ($env{'form.loncapasec_'.$i} ne '') {
1.5 raeburn 984: $secinfo .= $env{'form.loncapasec_'.$i};
985: } else {
986: $secinfo .= &mt('None');
1.4 raeburn 987: }
1.5 raeburn 988: $secinfo .= '</td></tr>';
1.4 raeburn 989: }
990: }
991: }
1.6 raeburn 992: if ($secinfo eq '') {
993: $secinfo = '<tr><td colspan="2">'.&mt('None').'</td></tr>';
1.5 raeburn 994: }
1.6 raeburn 995: $section_values .= $secinfo.'</table></td><td>'.
996: '<table class="LC_innerpickbox"><tr><th>'.
997: &mt('Institutional course/section').'</th>'.
998: '<th>'.&mt('LON-CAPA section').'</th></tr>';
1.5 raeburn 999: my $xlistinfo;
1.4 raeburn 1000: if ($env{'form.crosslisttotal'}) {
1001: for (my $i=0; $i<$env{'form.crosslisttotal'}; $i++) {
1002: if ($env{'form.crosslist_'.$i}) {
1.5 raeburn 1003: $xlistinfo .= '<tr><td>';
1004: if (ref($code_order) eq 'ARRAY') {
1005: if (@{$code_order} > 0) {
1006: foreach my $item (@{$code_order}) {
1007: $xlistinfo .= $env{'form.crosslist_'.$i.'_'.$item};
1.4 raeburn 1008: }
1009: }
1010: }
1.5 raeburn 1011: $xlistinfo .= $env{'form.crosslist_'.$i.'_instsec'}.'</td><td>';
1.4 raeburn 1012: if ($env{'form.crosslist_'.$i.'_lcsec'}) {
1.5 raeburn 1013: $xlistinfo .= $env{'form.crosslist_'.$i.'_lcsec'};
1014: } else {
1015: $xlistinfo .= &mt('None');
1.4 raeburn 1016: }
1.5 raeburn 1017: $xlistinfo .= '</td></tr>';
1.4 raeburn 1018: }
1019: }
1020: }
1.6 raeburn 1021: if ($xlistinfo eq '') {
1022: $xlistinfo = '<tr><td colspan="2">'.&mt('None').'</td></tr>';
1.5 raeburn 1023: }
1.6 raeburn 1024: $section_values .= $xlistinfo.'</table></td>';
1.4 raeburn 1025: }
1026: }
1027:
1028: my %ctxt = &clone_text();
1029: $inst_headers .= '<th>'.&mt('Clone From').'</th>';
1030: if (($env{'form.clonecourse'} =~ /^$match_name$/) &&
1031: ($env{'form.clonedomain'} =~ /^$match_domain$/)) {
1032: my %coursehash =
1033: &Apache::lonnet::courseiddump($env{'form.clonedomain'},'.',1,'.','.',
1034: $env{'form.clonecourse'},undef,undef,'.');
1035: my $cloneid = $env{'form.clonedomain'}.'_'.$env{'form.clonecourse'};
1036: if (ref($coursehash{$cloneid}) eq 'HASH') {
1037: $inst_headers .= '<th>'.$ctxt{'dsh'}.'</th>';
1038: my $clonedesc = $coursehash{$cloneid}{'description'};
1039: my $cloneinst = $coursehash{$cloneid}{'inst_code'};
1040:
1041: $inst_values .= '<td>'.$clonedesc.' ';
1042: if ($cloneinst ne '') {
1043: $inst_values .= &mt('([_1] in [_2])',$cloneinst,$env{'form.clonedomain'});
1044: } else {
1045: $inst_values .= &mt('(from [_1])',$env{'form.clonedomain'});
1046: }
1047: $inst_values .= '</td><td>';
1048: if ($env{'form.datemode'} eq 'preserve') {
1049: $inst_values .= $ctxt{'pcd'};
1050: } elsif ($env{'form.datemode'} eq 'shift') {
1051: $inst_values .= &mt('Shift dates by [_1] days',$env{'form.dateshift'});
1052: } else {
1053: $inst_values .= $ctxt{'ncd'};
1054: }
1055: $inst_values .= '</td>';
1056: } else {
1057: $inst_values .= '<td>'.&mt('Unknown').'</td>';
1058: }
1059: } else {
1060: $inst_values .= '<td>'.&mt('None').'</td>';
1061: }
1062: $enroll_headers .= '<th>'.&mt('Access Starts').'</th>'.
1063: '<th>'.&mt('Access Ends').'</th>';
1064: my ($startaccess,$endaccess) = &dates_from_form('startaccess','endaccess');
1065: $enroll_values .= '<td>'.&Apache::lonlocal::locallocaltime($startaccess).'</td>';
1066: if ($endaccess == 0) {
1067: $enroll_values .= '<td>'.&mt('No end date').'</td>';
1068: } else {
1069: $enroll_values .= '<td>'.&Apache::lonlocal::locallocaltime($endaccess).'</td>';
1070: }
1071:
1072: my $container = 'Course';
1073: if ($env{'form.crstype'} eq 'community') {
1074: $container = 'Community';
1075: }
1076:
1077: $personnel_headers = '<th>'.&mt('Name').'</th><th>'.&mt('Username:Domain').
1078: '</th><th>'.&mt('Role').'</th><th>'.&mt('LON-CAPA Sections').
1079: '</th>';
1080: $personnel_values .= '<tr><td>'.$ownername.'</td><td>'.$owner.'</td>'.
1081: '<td>'.&Apache::lonnet::plaintext('cc',$container).'</td>'.
1082: '<td>'.&mt('None').'</td></tr>';
1083: for (my $i=0; $i<$env{'form.persontotal'}; $i++) {
1084: if ($env{'form.person_'.$i.'_uname'} ne '') {
1085: $personnel_values .=
1086: '<tr><td>'.$env{'form.person_'.$i.'_first'}.' '.
1087: $env{'form.person_'.$i.'_last'}.'</td>'.
1088: '<td>'.$env{'form.person_'.$i.'_uname'}.':'.
1089: $env{'form.person_'.$i.'_dom'}.'</td>'.
1090: '<td>'.&Apache::lonnet::plaintext($env{'form.person_'.$i.'_role'},
1091: $container).'</td>'.
1092: '<td>'.$env{'form.person_'.$i.'_sections'}.'</td></tr>';
1093: }
1094: }
1095: my $output = '<p>'.&mt('Review the details of the course request before submission.').'</p>'.
1096: '<div>'.&Apache::lonhtmlcommon::start_pick_box().
1097: &Apache::lonhtmlcommon::row_title(&mt('Owner')).
1.6 raeburn 1098: '<table class="LC_innerpickbox"><tr>'.
1.4 raeburn 1099: '<th>'.&mt('Name').'</th>'.
1100: '<th>'.&mt('Username:Domain').'</th>'.
1101: '<th>'.&mt('E-mail address').'</th>'.
1102: '</tr><tr>'."\n".
1103: '<td>'.$ownername.'</td><td>'.$owner.'</td>'.
1104: '<td>'.$owneremail.'</td>'.
1105: '</tr></table>'."\n".
1106: &Apache::lonhtmlcommon::row_closure().
1.5 raeburn 1107: &Apache::lonhtmlcommon::row_title(&mt('Description')).
1.4 raeburn 1108: '<table class="LC_innerpickbox"><tr>'.$inst_headers.'</tr>'."\n".
1109: '<tr>'.$inst_values.'</tr></table>'."\n".
1110: &Apache::lonhtmlcommon::row_closure().
1111: &Apache::lonhtmlcommon::row_title(&mt('Enrollment')).
1112: '<table class="LC_innerpickbox"><tr>'.$enroll_headers.'</tr>'."\n".
1113: '<tr>'.$enroll_values.'</tr></table>'."\n".
1114: &Apache::lonhtmlcommon::row_closure();
1115: if ($section_headers ne '') {
1116: $output .= &Apache::lonhtmlcommon::row_title(&mt('Sections')).
1117: '<table class="LC_innerpickbox"><tr>'.$section_headers.'</tr>'."\n".
1118: '<tr>'.$section_values.'</tr></table>'."\n".
1119: &Apache::lonhtmlcommon::row_closure();
1120: }
1121: $output .= &Apache::lonhtmlcommon::row_title(&mt('Personnel')).
1122: '<table class="LC_innerpickbox"><tr>'.$personnel_headers.'</tr>'."\n".
1123: $personnel_values.'</table>'."\n".
1124: &Apache::lonhtmlcommon::row_closure(1).
1125: &Apache::lonhtmlcommon::end_pick_box();
1.8 raeburn 1126: my $cnum = &Apache::lonnet::generate_coursenum($dom);
1127: $output .= '<input type="hidden" name="cnum" value="'.$cnum.'" />';
1.4 raeburn 1128: return $output;
1129: }
1130:
1131: sub dates_from_form {
1132: my ($startname,$endname) = @_;
1133: my $startdate = &Apache::lonhtmlcommon::get_date_from_form($startname);
1134: my $enddate = &Apache::lonhtmlcommon::get_date_from_form($endname);
1135: if ($endname eq 'endaccess') {
1136: if (exists($env{'form.no_end_date'}) ) {
1137: $enddate = 0;
1138: }
1139: }
1140: return ($startdate,$enddate);
1.1 raeburn 1141: }
1142:
1143: sub courseinfo_form {
1.2 raeburn 1144: my ($dom,$formname,$crstype) = @_;
1145: my $output = '<div>'.&Apache::lonhtmlcommon::start_pick_box().
1146: &Apache::lonhtmlcommon::row_title('Course Description').
1147: '<input type="text" size="40" name="cdescr" />'.
1148: &Apache::lonhtmlcommon::row_closure(1).
1149: &Apache::lonhtmlcommon::end_pick_box().'</div>'.
1150: '<div>'.&clone_form($dom,$formname,$crstype).'</div>'."\n";
1.1 raeburn 1151: return $output;
1152: }
1153:
1154: sub clone_form {
1155: my ($dom,$formname,$crstype) = @_;
1156: my $type = 'Course';
1157: if ($crstype eq 'community') {
1158: $type = 'Community';
1159: }
1160: my $cloneform = &Apache::loncommon::select_dom_form($dom,'clonedomain').
1.2 raeburn 1161: &Apache::loncommon::selectcourse_link($formname,'clonecourse','clonedomain','','','',$type);
1.4 raeburn 1162: my %lt = &clone_text();
1.2 raeburn 1163: my $output .=
1164: &Apache::lonhtmlcommon::start_pick_box().
1165: &Apache::lonhtmlcommon::row_title($lt{'cid'}).'<label>'.
1166: '<input type="text" size="25" name="clonecourse" value="" onfocus="this.blur();'.
1167: 'opencrsbrowser('."'$formname','clonecourse','clonedomain','','','','$type'".');" />'.
1168: '</label>'.&Apache::lonhtmlcommon::row_closure(1).'<label>'.
1169: &Apache::lonhtmlcommon::row_title($lt{'dmn'}).'</label>'.
1170: $cloneform.'</label>'.&Apache::lonhtmlcommon::row_closure().
1171: &Apache::lonhtmlcommon::row_title($lt{'dsh'}).'<label>'.
1172: '<input type="radio" name="datemode" value="delete" /> '.$lt{'ncd'}.
1173: '</label><br /><label>'.
1174: '<input type="radio" name="datemode" value="preserve" /> '.$lt{'prd'}.
1175: '</label><br /><label>'.
1176: '<input type="radio" name="datemode" value="shift" checked="checked" /> '.
1177: $lt{'shd'}.'</label>'.
1178: '<input type="text" size="5" name="dateshift" value="365" />'.
1179: &Apache::lonhtmlcommon::row_closure(1).
1180: &Apache::lonhtmlcommon::end_pick_box();
1.1 raeburn 1181: return $output;
1182: }
1183:
1.4 raeburn 1184: sub clone_text {
1185: return &Apache::lonlocal::texthash(
1186: 'cid' => 'Course ID',
1187: 'dmn' => 'Domain',
1188: 'dsh' => 'Date Shift',
1189: 'ncd' => 'Do not clone date parameters',
1190: 'prd' => 'Clone date parameters as-is',
1191: 'shd' => 'Shift date parameters by number of days',
1192: );
1193: }
1194:
1.1 raeburn 1195: sub coursecode_form {
1.2 raeburn 1196: my ($dom,$context,$codetitles,$cat_titles,$cat_order,$num) = @_;
1.1 raeburn 1197: my $output;
1.2 raeburn 1198: my %rowtitle = (
1199: instcode => 'Course Category',
1200: crosslist => 'Cross Listed Course',
1201: );
1.1 raeburn 1202: if ((ref($codetitles) eq 'ARRAY') && (ref($cat_titles) eq 'HASH') &&
1203: (ref($cat_order))) {
1.2 raeburn 1204: my ($sel,$instsec,$lcsec);
1205: $sel = $context;
1206: if ($context eq 'crosslist') {
1207: $sel .= '_'.$num;
1208: $instsec = &mt('Institutional section').'<br />'.
1209: '<input type="text" size="10" name="'.$sel.'_instsec" />';
1210: $lcsec = &mt('LON-CAPA section').'<br />'.
1211: '<input type="text" size="10" name="'.$sel.'_lcsec" />';
1212: }
1.1 raeburn 1213: if (@{$codetitles} > 0) {
1214: my $lastitem = pop(@{$codetitles});
1.2 raeburn 1215: my $lastinput = '<input type="text" size="5" name="'.$sel.'_'. $lastitem.'" />';
1.1 raeburn 1216: if (@{$codetitles} > 0) {
1.2 raeburn 1217: $output = &Apache::lonhtmlcommon::row_title($rowtitle{$context}).
1218: '<table><tr>';
1.1 raeburn 1219: if ($context eq 'crosslist') {
1.2 raeburn 1220: $output .= '<td>'.&mt('Include?').'<br />'.
1221: '<input type="checkbox" name="'.$sel.'" value="1" /></td>';
1.1 raeburn 1222: }
1223: foreach my $title (@{$codetitles}) {
1224: if (ref($cat_order->{$title}) eq 'ARRAY') {
1225: if (@{$cat_order->{$title}} > 0) {
1226: $output .= '<td align="center">'.$title.'<br />'."\n".
1227: '<select name="'.$sel.'_'.$title.'">'."\n".
1228: ' <option value="" selected="selected">'.
1229: &mt('Select').'</option>'."\n";
1230: foreach my $item (@{$cat_order->{$title}}) {
1231: my $longitem = $item;
1232: if (ref($cat_titles->{$title}) eq 'HASH') {
1233: if ($cat_titles->{$title}{$item} ne '') {
1234: $longitem = $cat_titles->{$title}{$item};
1235: }
1236: }
1237: $output .= '<option value="'.$item.'">'.$longitem.
1238: '</option>'."\n";
1239: }
1240: }
1241: $output .= '</select></td>'."\n";
1242: }
1243: }
1244: if ($context eq 'crosslist') {
1245: $output .= '<td align="center">'.$lastitem.'<br />'."\n".
1.2 raeburn 1246: $lastinput.'</td><td align="center">'.$instsec.'</td>'.
1247: '<td align="center">'.$lcsec.'</td></tr></table>';
1.1 raeburn 1248: } else {
1249: $output .= '</tr></table>'.
1250: &Apache::lonhtmlcommon::row_closure().
1251: &Apache::lonhtmlcommon::row_title('Course '.$lastitem).
1252: $lastinput;
1253: }
1254: } else {
1255: if ($context eq 'crosslist') {
1256: $output .= &Apache::lonhtmlcommon::row_title($rowtitle{$context}).
1.2 raeburn 1257: '<table><tr>'.
1258: '<td align="center">'.$lastitem.'<br />'.$lastinput.'</td>'.
1259: '<td align="center">'.$instsec.'</td><td>'.$lcsec.'</td>'.
1260: '</tr></table>';
1.1 raeburn 1261: } else {
1262: $output .= &Apache::lonhtmlcommon::row_title('Course '.$lastitem).
1263: $lastinput;
1264: }
1265: }
1.2 raeburn 1266: $output .= &Apache::lonhtmlcommon::row_closure(1);
1267: push(@$codetitles,$lastitem);
1268: } elsif ($context eq 'crosslist') {
1269: $output .= &Apache::lonhtmlcommon::row_title($rowtitle{$context}).
1270: '<table><tr><td align="center">'.
1271: '<span class="LC_nobreak">'.&mt('Include?').
1272: '<input type="checkbox" name="'.$sel.'" value="1" /></span>'.
1273: '</td><td align="center">'.&mt('Institutional ID').'<br />'.
1274: '<input type="text" size="10" name="'.$sel.'_instsec" />'.
1275: '</td><td align="center">'.$lcsec.'</td></tr></table>'.
1276: &Apache::lonhtmlcommon::row_closure(1);
1.1 raeburn 1277: }
1278: }
1279: return $output;
1280: }
1281:
1282: sub get_course_dom {
1283: my $codedom = &Apache::lonnet::default_login_domain();
1284: if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne 'public')) {
1285: $codedom = $env{'user.domain'};
1286: if ($env{'request.role.domain'} ne '') {
1287: $codedom = $env{'request.role.domain'};
1288: }
1289: }
1290: if ($env{'form.showdom'} ne '') {
1291: if (&Apache::lonnet::domain($env{'form.showdom'}) ne '') {
1292: $codedom = $env{'form.showdom'};
1293: }
1294: }
1295: return $codedom;
1296: }
1297:
1298: sub display_navbuttons {
1299: my ($r,$formname,$prev,$prevtext,$next,$nexttext) = @_;
1300: $r->print('<div class="LC_navbuttons">');
1301: if ($prev) {
1302: $r->print('
1303: <input type="button" name="previous" value = "'.$prevtext.'"
1304: onclick="javascript:backPage(document.'.$formname.','."'".$prev."'".')"/>
1305: ');
1306: } elsif ($prevtext) {
1307: $r->print('
1308: <input type="button" name="previous" value = "'.$prevtext.'"
1309: onclick="javascript:history.back()"/>
1310: ');
1311: }
1312: if ($next) {
1313: $r->print('
1314: <input type="button" name="next" value="'.$nexttext.'"
1315: onclick="javascript:nextPage(document.'.$formname.','."'".$next."'".')" />');
1316: }
1317: $r->print('</div>');
1318: }
1319:
1320: sub print_request_outcome {
1.8 raeburn 1321: my ($dom) = @_;
1322: my $output;
1323: my $cnum = $env{'form.cnum'};
1324: unless ($cnum =~ /^$match_courseid$/) {
1325: $output = &mt('Invalid LON-CAPA course number for the new course')."\n";
1326: return $output;
1327: }
1.9 ! raeburn 1328: my $req_notifylist;
! 1329: my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom);
! 1330: if (ref($domconfig{'requestcourses'}) eq 'HASH') {
! 1331: if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') {
! 1332: $req_notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'};
! 1333: }
! 1334: }
1.8 raeburn 1335: my $now = time;
1336: my $crstype = $env{'form.crstype'};
1337: my ($startenroll,$endenroll,%sections,%crosslistings,%personnel);
1338: if ($crstype eq 'official') {
1339: if (&Apache::lonnet::auto_run('',$dom)) {
1340: ($startenroll,$endenroll)=&dates_from_form('startenroll','endenroll');
1341: }
1342: %sections = ();
1343: %crosslistings = ();
1344: }
1345: my ($startaccess,$endaccess) = &dates_from_form('startaccess','endacess');
1346: my $details = {
1347: owner => $env{'user.name'},
1348: domain => $env{'user.domain'},
1349: cdom => $dom,
1350: cnum => $cnum,
1351: cdesc => $env{'form.cdesc'},
1352: crstype => $env{'form.crstype'},
1353: instcode => $env{'form.instcode'},
1354: clonedomain => $env{'form.clonedomain'},
1355: clonecourse => $env{'form.clonecourse'},
1356: datemode => $env{'form.datemode'},
1357: dateshift => $env{'form.datshift'},
1358: sectotal => $env{'form.sectotal'},
1359: sections => \%sections,
1360: crosstotal => $env{'form.crosstotal'},
1361: crosslistings => \%crosslistings,
1362: autoadds => $env{'form.autoadds'},
1363: autodrops => $env{'form.autodrops'},
1364: startenroll => $startenroll,
1365: endenroll => $endenroll,
1366: startaccess => $startaccess,
1367: endaccess => $endaccess,
1368: personnel => \%personnel
1369: };
1370: my @inststatuses;
1.9 ! raeburn 1371: my $val = &get_processtype($dom,$crstype,\@inststatuses,\%domconfig);
1.8 raeburn 1372: if ($val eq '') {
1373: if ($crstype eq 'official') {
1374: $output = &mt('You are not permitted to request creation of official courses');
1375: } elsif ($crstype eq 'unofficial') {
1376: $output = &mt('You are not permitted to request creation of unofficial courses');
1377: } elsif ($crstype eq 'community') {
1378: $output = &mt('You are not permitted to request creation of communities');
1379: } else {
1380: $output = &mt('Unrecognized course type: [_1]',$crstype);
1381: }
1382: } else {
1383: my ($disposition,$message);
1384: my %reqhash = (
1385: crstype => $crstype,
1386: details => $details,
1387: );
1388: my $requestkey = $dom.'_'.$cnum;
1389: if ($val =~ /^autolimit=/) {
1390: $disposition = &check_autolimit($env{'user.name'},$env{'user.domain'},
1391: $dom,$crstype,$val,\$message);
1392: } elsif ($val eq 'validate') {
1393: $disposition =
1394: &Apache::lonnet::auto_courserequest_validation($dom,$details,
1395: \@inststatuses,\$message);
1396: } else {
1397: $disposition = 'approval';
1398: }
1399: $reqhash{'status'} = $disposition;
1400: if ($disposition eq 'rejected') {
1401: $output = &mt('Your course request was rejected.');
1402: if ($message) {
1403: $output .= '<div class="LC_warning">'.$message.'</div>';
1404: }
1405: } elsif ($disposition eq 'process') {
1406: my $type = 'Course';
1407: if ($crstype eq 'community') {
1408: $type = 'Community';
1409: }
1410: my ($logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg,%longroles);
1411: my @roles = &Apache::lonuserutils::roles_by_context('course');
1412: foreach my $role (@roles) {
1413: $longroles{$role}=&Apache::lonnet::plaintext($role,$type);
1414: }
1415: my %reqdetails = &build_batchcreatehash($details);
1416: my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'request',\%reqdetails,\%longroles,\$logmsg,\$newusermsg,\$addresult,\$enrollcount,\$output,\$keysmsg,$env{'user.domain'},$env{'user.name'},$cnum);
1417: $disposition = 'created';
1418: if ($cid eq $cnum) {
1419: $disposition = 'created';
1420: $output = &mt('Your course request has been processed and the course has been created.').'<br />'.&mt('You will need to logout and log-in again to be able to select a role in the course.');
1421: } else {
1422: $output = &mt('An error occurred when processing your course request.').'<br />'.&mt('You may want to review the request details and submit the request again.');
1423: }
1424: } else {
1425: my $requestid = $cnum.'_'.$disposition;
1426: my $request = {
1427: $requestid => {
1428: timestamp => $now,
1429: crstype => $crstype,
1430: ownername => $env{'user.name'},
1431: ownerdom => $env{'user.domain'},
1432: description => $env{'form.cdesc'},
1433: },
1434: };
1435: my $putresult = &Apache::lonnet::newput_dom('courserequestqueue',$request,
1436: $dom);
1437: if ($putresult eq 'ok') {
1438: my %emails = &Apache::loncommon::getemails();
1439: my $address;
1440: if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) {
1441: $address = $emails{'permanentemail'};
1442: if ($address eq '') {
1443: $address = $emails{'notification'};
1444: }
1445: }
1446: $output = &mt('Your course request has been recorded.').'<br />';
1447: if ($disposition eq 'approval') {
1448: $output .= &mt('Your course request has been recorded.').'<br />'.
1449: &mt('A message will be sent to your LON-CAPA account when a domain coordinator takes action on your request.').'<br />'.
1450: &mt('To access your LON-CAPA message, go to the Main Menu and click on "Send and Receive Messages".').'<br />';
1451: if ($address ne '') {
1452: $output.= &mt('An e-mail will also be sent to: [_1] when this occurs.',$address).'<br />';
1453: }
1454: if ($req_notifylist) {
1455: my $fullname = &Apache::loncommon::plainname($env{'user.name'},
1456: $env{'user.domain'});
1457: &Apache::loncoursequeueadmin::send_selfserve_notification($req_notifylist,$fullname,$now,$dom,$details);
1458: }
1459: } else {
1460: $output .= '<div class="LC_info">'.
1461: &mt('Your request has been placed in a queue pending administrative action.').'<br />'.
1462: &mt("Usually this means that your institution's information systems do not list you among the instructional personnel for this course.").'<br />'.
1463: &mt('The list of instructional personnel for the course will be automatically checked daily, and once you are listed the request will be processed.').
1464: '</div>';
1465: }
1466: } else {
1467: $reqhash{'status'} = 'domainerror';
1468: $reqhash{'disposition'} = $disposition;
1469: my $warning = &mt('An error occurred saving your request in the pending requests queue.');
1470: $output = '<span class"LC_warning">'.$warning.'</span><br />';
1471:
1472: }
1473: }
1474: my $storeresult = &Apache::lonnet::store_coursereq($requestkey,\%reqhash);
1475: if ($storeresult ne 'ok') {
1476: $output .= '<span class="LC_warning">'.&mt('An error occurred saving a record of the details of your request.').'</span><br />';
1477: &logthis("Error saving course request - $requestkey for $env{'user.name'}:$env{'user.domain'} - $storeresult");
1478: }
1479: }
1480: return $output;
1481: }
1482:
1483: sub get_processtype {
1.9 ! raeburn 1484: my ($dom,$crstype,$inststatuses,$domconfig) = @_;
! 1485: return unless ((ref($inststatuses) eq 'ARRAY') && (ref($domconfig) eq 'HASH'));
1.8 raeburn 1486: my (%userenv,%settings,$val);
1487: my @options = ('autolimit','validate','approve');
1488: if ($dom eq $env{'user.domain'}) {
1489: %userenv =
1490: &Apache::lonnet::userenvironment($env{'user.domain'},$env{'user.name'},
1491: 'requestcourses.'.$crstype,'inststatus');
1492: if ($userenv{'requestcourses.'.$crstype}) {
1493: $val = $userenv{'requestcourses.'.$crstype};
1494: @{$inststatuses} = ('_custom_');
1495: } else {
1496: my ($task,%alltasks);
1.9 ! raeburn 1497: if (ref($domconfig->{'requestcourses'}) eq 'HASH') {
! 1498: %settings = %{$domconfig->{'requestcourses'}};
1.8 raeburn 1499: if (ref($settings{$crstype}) eq 'HASH') {
1500: if (($env{'user.adv'}) && (exists($settings{$crstype}{'_LC_adv'}))) {
1501: $val = $settings{$crstype}{'_LC_adv'};
1502: @{$inststatuses} = ('_LC_adv_');
1503: } else {
1504: if ($userenv{'inststatus'} ne '') {
1505: @{$inststatuses} = split(',',$userenv{'inststatus'});
1506: } else {
1507: @{$inststatuses} = ('other');
1508: }
1509: foreach my $status (@{$inststatuses}) {
1510: if (exists($settings{$crstype}{$status})) {
1511: my $value = $settings{$crstype}{$status};
1512: next unless ($value);
1513: unless (exists($alltasks{$value})) {
1514: if (ref($alltasks{$value}) eq 'ARRAY') {
1515: unless(grep(/^\Q$status\E$/,@{$alltasks{$value}})) {
1516: push(@{$alltasks{$value}},$status);
1517: }
1518: } else {
1519: @{$alltasks{$value}} = ($status);
1520: }
1521: }
1522: }
1523: }
1524: my $maxlimit = 0;
1525: foreach my $key (sort(keys(%alltasks))) {
1526: if ($key =~ /^autolimit=(\d*)$/) {
1527: if ($1 eq '') {
1528: $val ='autolimit=';
1529: last;
1530: } elsif ($1 > $maxlimit) {
1531: $maxlimit = $1;
1532: }
1533: }
1534: }
1535: if ($maxlimit) {
1536: $val = 'autolimit='.$maxlimit;
1537: } else {
1538: foreach my $option (@options) {
1539: if ($alltasks{$option}) {
1540: $val = $option;
1541: last;
1542: }
1543: }
1544: }
1545: }
1546: }
1547: }
1548: }
1549: } else {
1550: %userenv = &Apache::lonnet::userenvironment($env{'user.domain'},
1551: $env{'user.name'},'reqcrsotherdom.'.$env{'form.crstype'});
1552: if ($userenv{'reqcrsotherdom'}) {
1553: my @doms = split(',',$userenv{'reqcrsotherdom'});
1554: my $optregex = join('|',@options);
1555: if (grep(/^\Q$dom\E:($optregex=?\d*)/,@doms)) {
1556: $val = $1;
1557: }
1558: @{$inststatuses} = ('_external_');
1559: }
1560: }
1561: return $val;
1562: }
1563:
1564: sub check_autolimit {
1.1 raeburn 1565: return;
1566: }
1567:
1.8 raeburn 1568: sub build_batchcreatehash {
1569: my ($details) = @_;
1570: my %batchhash;
1571: if (ref($details) eq 'HASH') {
1572:
1573: }
1574: return %batchhash;
1575: }
1576:
1.2 raeburn 1577: sub retrieve_settings {
1578: my ($dom,$request_id) = @_;
1579: my %reqinfo = &get_request_settings($request_id,$dom);
1580: my %stored;
1581: $stored{'cdescr'} = &unescape($reqinfo{'description'});
1582: $stored{'startaccess'} = $reqinfo{'startaccess'};
1583: $stored{'endaccess'} = $reqinfo{'endaccess'};
1584: if ($stored{'endaccess'} == 0) {
1585: $stored{'no_end_date'} = 1;
1586: }
1587: $stored{'startenroll'} = $reqinfo{'startenroll'};
1588: $stored{'endenroll'} = $reqinfo{'endenroll'};
1589: $stored{'crosslist'} = $reqinfo{'crosslist'};
1590: $stored{'clonecourse'} = $reqinfo{'clonecourse'};
1591: $stored{'clonedomain'} = $reqinfo{'clonedomain'};
1592: $stored{'sections'} = $reqinfo{'sections'};
1593: $stored{'personnel'} = $reqinfo{'personnel'};
1594:
1595: return %stored;
1596: }
1597:
1598: sub get_request_settings {
1599: my ($request_id,$dom);
1600: }
1601:
1.1 raeburn 1602: 1;
1603:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>