Annotation of loncom/interface/lonpickcourse.pm, revision 1.118
1.1 www 1: # The LearningOnline Network
2: # Pick a course
3: #
1.118 ! raeburn 4: # $Id: lonpickcourse.pm,v 1.117 2016/04/02 04:30:21 raeburn Exp $
1.1 www 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: package Apache::lonpickcourse;
30:
31: use strict;
32: use Apache::Constants qw(:common);
33: use Apache::loncommon;
1.106 raeburn 34: use Apache::lonhtmlcommon;
1.1 www 35: use Apache::loncoursedata;
36: use Apache::lonnet;
1.8 www 37: use Apache::lonlocal;
1.46 raeburn 38: use Apache::longroup;
1.85 raeburn 39: use LONCAPA qw(:DEFAULT :match);
1.1 www 40:
41: sub handler {
42: my $r = shift;
1.8 www 43: &Apache::loncommon::content_type($r,'text/html');
1.1 www 44: $r->send_http_header;
45: return OK if $r->header_only;
46:
47: # ------------------------------------------------------------ Print the screen
1.40 albertel 48:
1.55 raeburn 49: # Get parameters from query string
1.1 www 50: &Apache::loncommon::get_unprocessed_cgi
1.55 raeburn 51: ($ENV{'QUERY_STRING'},['domainfilter','form','cnumelement',
1.19 raeburn 52: 'cdomelement','cnameelement','roleelement',
1.116 raeburn 53: 'multiple','type','setroles','fixeddom','cloner',
54: 'crscode','crsdom']);
1.90 raeburn 55: my ($type,$title,$jscript,$multelement,$multiple,$roleelement,$typeelement,
1.116 raeburn 56: $lastaction,$autosubmit,$submitopener,$cloneruname,$clonerudom,$crscode,$crsdom);
1.55 raeburn 57:
1.117 raeburn 58: # Get course type - Course, Community or Placement.
1.54 raeburn 59: $type = $env{'form.type'};
60: if (!defined($env{'form.type'})) {
61: $type = 'Course';
62: }
1.82 bisitz 63: $title = 'Selecting a '.$type;
1.54 raeburn 64:
65: # Setup for multiple course selections, if flag for multiples set.
1.55 raeburn 66: $multiple = $env{'form.multiple'};
67: if ($multiple) {
68: ($jscript,$multelement) = &multiples_tag();
1.82 bisitz 69: $title = 'Selecting '.$type.'(s)';
1.54 raeburn 70: }
71:
1.55 raeburn 72: # if called when a DC is selecting a course
1.54 raeburn 73: my $roledom = $env{'form.roleelement'};
74: if ($roledom) {
75: $roleelement = '<input type="hidden" name="roleelement" value="'.$roledom.'" />';
1.66 raeburn 76: $submitopener = &processpick();
1.54 raeburn 77: $autosubmit = 'process_pick("'.$roledom.'")';
78: }
1.90 raeburn 79: if ($env{'form.typeelement'} ne '') {
80: $typeelement = '<input type="hidden" name="typeelement" value="'.$env{'form.typeelement'}.'" />';
81: }
1.54 raeburn 82:
1.92 raeburn 83: # if called when a DC is creating a course for another user.
1.85 raeburn 84: if ($env{'form.form'} eq 'ccrs') {
85: ($cloneruname,$clonerudom) = ($env{'form.cloner'} =~ /^($match_username):($match_domain)$/);
1.116 raeburn 86: $crscode = $env{'form.crscode'};
87: $crsdom = $env{'request.role.domain'};
1.85 raeburn 88: }
89:
90: # if called when requesting a course
91: if ($env{'form.form'} eq 'requestcrs') {
92: $cloneruname = $env{'user.name'};
93: $clonerudom = $env{'user.domain'};
1.116 raeburn 94: $crscode = $env{'form.crscode'};
95: $crsdom = $env{'form.crsdom'};
1.85 raeburn 96: }
97:
1.54 raeburn 98: my $onlyown = 0;
1.55 raeburn 99: # if called to assign course-based portfolio access control
1.59 raeburn 100: if ((($env{'form.form'} eq 'portform') && (!$env{'user.adv'}))) {
1.54 raeburn 101: $onlyown = 1;
1.49 raeburn 102: }
1.55 raeburn 103:
104: my %loaditem;
1.84 raeburn 105: if (($env{'form.type'} eq 'Course') && ($env{'form.numtitles'})) {
106: if (($env{'form.official'} eq 'on') && ($env{'form.state'} eq 'listing')) {
107: $loaditem{'onload'} = 'setElements(document.filterpicker); ';
108: }
1.78 raeburn 109: }
110:
1.66 raeburn 111: if ((($env{'form.form'} eq 'cu') || ($env{'form.form'} eq 'studentform')) &&
112: ($env{'form.pickedcourse'})) {
1.115 raeburn 113: if ($type ne 'Community') {
114: my %coursedescription =
115: &Apache::lonnet::coursedescription($env{'form.pickedcourse'},
116: {'one_time' => '1'});
117: my $cdom = $coursedescription{'domain'};
118: my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
119: if (($domdefs{'officialcredits'} || $domdefs{'unofficialcredits'} || $domdefs{'textbookcredits'})) {
120: $loaditem{'onload'} .= 'setDefaultCredits();';
121: }
122: }
123: $loaditem{'onload'} .= 'setRoles();setSections();';
1.30 raeburn 124: }
1.113 raeburn 125: if ((($env{'form.gosearch'}) && ($env{'form.updater'} eq '')) && (!$onlyown)) {
126: $loaditem{'onload'} .= 'hideSearching(); ';
127: }
1.112 raeburn 128: my $js = &Apache::loncommon::js_changer();
1.107 raeburn 129: $r->print(&Apache::loncommon::start_page($title,$js,
1.42 albertel 130: {'add_entries' => \%loaditem,
1.41 albertel 131: 'no_nav_bar' => 1, }));
1.55 raeburn 132:
133: if ($env{'form.form'} eq 'portform') {
134: $lastaction = 'document.courselist.submit()';
1.67 raeburn 135: } elsif ($env{'form.form'} eq 'cu' || ($env{'form.form'} eq 'studentform' &&
136: !$multiple)) {
1.55 raeburn 137: $lastaction =
138: 'document.courselist.pickedcourse.value = cdom+"_"+cname;'."\n".
139: 'document.courselist.submit();';
1.34 albertel 140: } else {
1.55 raeburn 141: $lastaction = 'self.close()';
1.1 www 142: }
1.19 raeburn 143:
1.55 raeburn 144: # if called to assign a role in a course to a user via CUSR
1.66 raeburn 145: if ($env{'form.form'} eq 'cu' || $env{'form.form'} eq 'studentform') {
1.68 raeburn 146: $r->print(&create_user_javascript($type));
1.55 raeburn 147: }
1.54 raeburn 148:
1.55 raeburn 149: # print javascript functions for choosing a course
1.85 raeburn 150: if ((($env{'form.gosearch'}) && ($env{'form.updater'} eq '')) ||
151: $onlyown) {
1.58 raeburn 152: $r->print(&gochoose_javascript($type,$multiple,$autosubmit,$lastaction));
1.55 raeburn 153: }
1.105 bisitz 154: $r->print(&Apache::lonhtmlcommon::scripttag($jscript));
1.55 raeburn 155: $r->print($submitopener);
1.54 raeburn 156:
1.55 raeburn 157: # ------------------------------------------ Display of filters to limit search
1.57 raeburn 158: my $filter = {};
159: my $action = '/adm/pickcourse';
1.99 raeburn 160: my ($numtitles,$showroles,$nohost,@codetitles);
1.112 raeburn 161: unless ($onlyown) {
1.111 raeburn 162: my $filterlist = ['domainfilter','sincefilter'];
1.94 raeburn 163: # created filter for DCs only
164: if ($env{'user.adv'} && $env{'form.domainfilter'} &&
1.95 raeburn 165: exists($env{'user.role.dc./'.$env{'form.domainfilter'}.'/'})
166: && $env{'form.form'} ne 'portform') {
1.94 raeburn 167: my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'form.domainfilter'});
168: if ($loncaparev ne 'unknown_cmd') {
169: push(@{$filterlist},'createdfilter');
170: }
171: }
172: push(@{$filterlist},('descriptfilter','instcodefilter'));
1.79 raeburn 173: if ($env{'form.form'} eq 'rules') {
1.111 raeburn 174: push(@{$filterlist},('personfilter','persondomfilter'));
175: if ($env{'form.persondomfilter'} eq '') {
176: unless ($env{'form.gosearch'}) {
177: $filter->{'persondomfilter'} = $env{'request.role.domain'};
178: }
179: } else {
180: $filter->{'persondomfilter'} =
181: &LONCAPA::clean_domain($env{'form.persondomfilter'});
182: }
1.79 raeburn 183: if (($env{'form.personfilter'} ne '') && ($env{'form.persondomfilter'} ne '')) {
184: if (&Apache::lonnet::homeserver($env{'form.personfilter'},
185: $env{'form.persondomfilter'}) eq 'no_host') {
186: $nohost = 1;
187: } else {
188: $showroles = 1;
189: }
190: }
191: } else {
1.111 raeburn 192: push(@{$filterlist},('ownerfilter','ownerdomfilter'));
1.79 raeburn 193: }
1.55 raeburn 194: # course ID filter for DCs only
195: if ($env{'user.adv'} && $env{'form.domainfilter'} &&
196: exists($env{'user.role.dc./'.$env{'form.domainfilter'}.'/'})) {
197: push(@{$filterlist},'coursefilter');
198: }
1.85 raeburn 199: if ($cloneruname ne '' && $clonerudom ne '') {
200: push(@{$filterlist},'cloneableonly');
201: }
1.111 raeburn 202: if ((ref($filterlist) eq 'ARRAY') && (ref($filter) eq 'HASH')) {
203: foreach my $item (@{$filterlist}) {
204: $filter->{$item} = $env{'form.'.$item};
205: }
206: }
207: if ($env{'form.form'} eq 'portform') {
208: $filter->{'domainfilter'} ||= $env{'user.domain'};
209: } elsif ($env{'form.form'} eq 'studentform') {
210: $filter->{'domainfilter'} ||= $env{'request.role.domain'};
211: }
212: my $codedom;
213: if ($env{'form.fixeddom'}) {
214: $codedom = $env{'request.role.domain'};
215: } else {
216: $codedom = $filter->{'domainfilter'};
217: }
218: my ($clonetext,$clonewarning);
219: if (($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) {
220: (my $coord_cloneable,$clonewarning) =
221: &get_coordinator_cloneable($cloneruname,$clonerudom,$type);
222: if ($env{'form.form'} eq 'ccrs') {
223: $clonetext = '<input type="hidden" name="cloner" value="'.$env{'form.cloner'}.'" />'."\n";
224: }
225: if ($coord_cloneable) {
226: $clonetext .= '<input type="hidden" name="cc_clone" value="'.$coord_cloneable.'" />';
227: }
1.116 raeburn 228: if ($crscode ne '') {
229: $clonetext .= '<input type="hidden" name="crscode" value="'.$crscode.'" />';
230: }
231: if ($crsdom ne '') {
232: $clonetext .= '<input type="hidden" name="crsdom" value="'.$crsdom.'" />';
233: }
1.111 raeburn 234: }
235: $r->print(&Apache::loncommon::build_filters($filterlist,$type,$roleelement,$multelement,
236: $filter,$action,\$numtitles,undef,$cloneruname,
237: $clonerudom,$typeelement,\@codetitles,$codedom,
238: $env{'form.form'},$env{'form.fixeddom'},
239: $env{'form.prevphase'},$env{'form.cnameelement'},
240: $env{'form.cnumelement'},$env{'form.cdomelement'},
241: $env{'form.setroles'},$clonetext,$clonewarning));
1.55 raeburn 242: }
1.54 raeburn 243:
244: # ---------------------------------------------------------------- Get the data
1.85 raeburn 245: if ((($env{'form.gosearch'}) && ($env{'form.updater'} eq '')) ||
246: $onlyown) {
1.98 raeburn 247: my $domcloner;
248: if ($env{'form.form'} eq 'ccrs') {
249: if (($env{'request.role.domain'} eq $env{'form.domainfilter'}) &&
250: (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'}))) {
251: $domcloner = 1;
252: }
253: }
1.112 raeburn 254: my %courses;
255: if (!$onlyown) {
256: $r->print('<div id="searching">'.&mt('Searching ...').'</div>');
257: $r->rflush();
258: my $srchdom = $filter->{'domainfilter'};
259: %courses = &Apache::loncommon::search_courses($srchdom,$type,$filter,$numtitles,
260: $cloneruname,$clonerudom,$domcloner,
1.116 raeburn 261: \@codetitles,$env{'form.cc_clone'},
262: $crsdom,$crscode);
1.112 raeburn 263: } else {
264: $r->print('<br />');
265: my %coursehash = &Apache::loncommon::findallcourses();
266: foreach my $cid (sort(keys(%coursehash))) {
267: $courses{$cid}{'description'} = $env{'course.'.$cid.'.description'};
268: }
269: }
1.79 raeburn 270: if ($nohost) {
271: $r->print ('<span class="LC_warning">'.
272: &mt('User does not exist - username: [_1], domain: [_2].',
273: '<b>'.$filter->{'personfilter'}.'</b>',
274: '<b>'.$filter->{'persondomfilter'}.'</b>').'</span>');
275: } else {
1.85 raeburn 276: &display_matched_courses($r,$type,$multiple,$action,$showroles,$cloneruname,
1.116 raeburn 277: $clonerudom,$crsdom,$crscode,%courses);
1.79 raeburn 278: }
1.54 raeburn 279: }
280: $r->print(&Apache::loncommon::end_page());
281: return OK;
282: }
283:
1.66 raeburn 284: sub processpick {
285: my $openerform = 'rolechoice';
286: if ($env{'form.form'} eq 'studentform') {
287: $openerform = $env{'form.form'};
288: }
289: my $process_pick = <<"ENDONE";
290: <script type="text/javascript">
291: function process_pick(dom) {
292: var pickedCourse=opener.document.$openerform.$env{'form.cnumelement'}.value;
293: var pickedDomain=opener.document.$openerform.$env{'form.cdomelement'}.value;
294: var okDomain = 0;
295: ENDONE
296: if ($openerform eq 'rolechoice') {
297: $process_pick .= <<"ENDTWO";
298: if (pickedDomain == dom) {
299: if (pickedCourse != '') {
1.88 raeburn 300: var ccrole = "cc";
301: var pickedType = "$env{'form.type'}";
302: if (pickedType == "Community") {
303: ccrole = "co";
304: }
305: var courseTarget = ccrole+"./"+pickedDomain+"/"+pickedCourse
1.66 raeburn 306: opener.document.title='Role selected. Please stand by.';
307: opener.status='Role selected. Please stand by.';
308: opener.document.rolechoice.newrole.value=courseTarget
309: opener.document.rolechoice.submit();
310: }
311: }
312: else {
313: alert("You may only use this screen to select courses in the current domain: "+dom+"\\nPlease return to the roles page window and click the 'Select Course' link for domain: "+pickedDomain+",\\n if you are a Domain Coordinator in that domain, and wish to become a Course Coordinator in a course in the domain");
314: }
315: ENDTWO
316: } else {
317: $process_pick .= <<"ENDTHREE";
318: if (pickedDomain != dom) {
319: alert("You may only use this screen to select courses in the current domain: "+dom+"\\nPlease return to the roles page window and click the 'Select Course' link for domain: "+pickedDomain+",\\n if you are a Domain Coordinator in that domain, and wish to become a Course Coordinator in a course in the domain");
320: return;
321: }
322: ENDTHREE
323: }
324: $process_pick .= "
325: }
326:
327: </script>
328: ";
329: return $process_pick;
330: }
331:
1.55 raeburn 332: sub create_user_javascript {
333: my ($type) = @_;
334: my $output;
335: #javascript for reporting sections and groups then closing
336: if ($env{'form.pickedcourse'}) {
1.87 raeburn 337: my %coursedescription =
338: &Apache::lonnet::coursedescription($env{'form.pickedcourse'},
339: {'one_time' => '1'});
340: my $cdom = $coursedescription{'domain'};
341: my $cnum = $coursedescription{'num'};
342: my $crstype = $coursedescription{'type'};
1.106 raeburn 343: my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
344: my ($showcredits,$credits);
345: if (($crstype ne 'Community') &&
1.109 raeburn 346: (($domdefs{'officialcredits'} || $domdefs{'unofficialcredits'} || $domdefs{'textbookcredits'}))) {
1.106 raeburn 347: $showcredits = 1;
348: $credits = $coursedescription{'internal.defaultcredits'};
349: }
1.55 raeburn 350: my $sec_element = 'currsec';
351: my $grplist_element = 'groups';
352: my ($sections,$groups) =
353: &Apache::loncommon::get_secgrprole_info($cdom,$cnum,'',$type);
354: my $num_sections = scalar(@{$sections});
355: my $seclist = join(',',@{$sections});
356: my $num_groups = scalar(@{$groups});
357: my $groupslist = join(',',@{$groups});
358: $output = qq|
359: <script type="text/javascript">
1.106 raeburn 360: // <![CDATA[
1.55 raeburn 361: function setSections() {
362: opener.document.$env{"form.form"}.$grplist_element.value='$groupslist';
363: window.opener.setSect('$seclist');
1.87 raeburn 364: self.close();
365: }
366: function setRoles() {
367: window.opener.setRole('$crstype');
1.55 raeburn 368: }
1.106 raeburn 369: |;
370: if ($showcredits) {
371: $output .= qq|
372: function setDefaultCredits() {
373: window.opener.setCredits('$credits');
374: }
375: |;
376: }
377: $output .= qq|
378: // ]]>
1.55 raeburn 379: </script>
380: |;
381: }
382: return $output;
383: }
384:
1.54 raeburn 385: sub display_matched_courses {
1.116 raeburn 386: my ($r,$type,$multiple,$action,$showroles,$cloneruname,$clonerudom,$crsdom,$crscode,%courses) = @_;
1.55 raeburn 387: if ($env{'form.form'} eq 'portform') {
388: $action = '/adm/portfolio';
389: }
1.68 raeburn 390: my $numcourses = keys(%courses);
1.55 raeburn 391: $r->print('<form name="courselist" method="post" action="'.$action.'">');
1.68 raeburn 392: if ($env{'form.form'} eq 'modifycourse') {
393: if ($numcourses > 0) {
1.89 raeburn 394: my $ccrole = 'cc';
395: if ($type eq 'Community') {
396: $ccrole = 'co';
397: }
398: my $cctitle = &Apache::lonnet::plaintext($ccrole,$type);
1.68 raeburn 399: my $dctitle = &Apache::lonnet::plaintext('dc');
1.93 raeburn 400: my $ccrolechk = ' ';
401: my $menuchk = ' checked="checked" ';
1.68 raeburn 402: $r->print(
1.106 raeburn 403: '<div class="LC_left_float">'
404: .'<fieldset>'
405: .'<legend>'.&mt('Pick action').'</legend>'
406: .'<span class="LC_nobreak"><label>'
1.75 bisitz 407: .'<input type="radio" name="phase" value="ccrole"'.$ccrolechk.'/>'
1.89 raeburn 408: .' ');
409: if ($type eq 'Community') {
410: $r->print(&mt('Enter the community with the role of [_1].',$cctitle));
1.118 ! raeburn 411: } elsif ($type eq 'Placement') {
! 412: $r->print(&mt('Enter the placement test with the role of [_1].',$cctitle));
1.89 raeburn 413: } else {
414: $r->print(&mt('Enter the course with the role of [_1].',$cctitle));
415: }
1.106 raeburn 416: $r->print('</label></span><br />'
417: .'<span class="LC_nobreak"><label>'
1.89 raeburn 418: .'<input type="radio" name="phase" value="menu"'.$menuchk.'/> ');
419: if ($type eq 'Community') {
420: $r->print(&mt('View or modify community settings which only a [_1] may modify.',$dctitle));
1.118 ! raeburn 421: } elsif ($type eq 'Placement') {
! 422: $r->print(&mt('View or modify placement test settings which only a [_1] may modify.',$dctitle));
1.89 raeburn 423: } else {
424: $r->print(&mt('View or modify course settings which only a [_1] may modify.',$dctitle));
425: }
1.106 raeburn 426: $r->print('</label></span>'
427: .'</fieldset></div>'
428: .'<br clear="all" />'
1.75 bisitz 429: );
1.68 raeburn 430: }
431: }
1.54 raeburn 432: my %by_descrip;
433: foreach my $course (keys(%courses)) {
434: my $descr;
1.64 raeburn 435: if (ref($courses{$course}) eq 'HASH') {
1.65 raeburn 436: $descr = $courses{$course}{'description'};
1.64 raeburn 437: } elsif ($courses{$course} =~ m/^([^:]*):/i) {
1.54 raeburn 438: $descr = &unescape($1);
1.34 albertel 439: } else {
1.54 raeburn 440: $descr = &unescape($courses{$course});
441: }
442: my $description = $descr;
443: push (@{$by_descrip{$description}}, $course);
444: }
1.71 bisitz 445:
1.54 raeburn 446: if ($numcourses > 1 && $multiple) {
1.104 bisitz 447: $r->print('<input type="button" value="'.&mt('check all').'"
1.54 raeburn 448: onclick="javascript:checkAll(document.courselist.course_id)" />
1.104 bisitz 449: <input type="button" value="'.&mt('uncheck all').'"
1.54 raeburn 450: onclick="javascript:uncheckAll(document.courselist.course_id)" />
451: <br /><br />');
452: }
1.71 bisitz 453:
454: if (%courses) {
455: $r->print(&Apache::loncommon::start_data_table());
456: $r->print(&Apache::loncommon::start_data_table_header_row());
1.89 raeburn 457: my $titlehdr = &mt('Course Title');
458: if ($type eq 'Community') {
459: $titlehdr = &mt('Community Title');
460: }
1.71 bisitz 461: $r->print('<th>'.&mt('Select').'</th>'
1.89 raeburn 462: .'<th>'.$titlehdr.'</th>'
463: .'<th>'.&mt('Domain').'</th>');
1.117 raeburn 464: unless (($type eq 'Community') || ($type eq 'Placement')) {
1.89 raeburn 465: $r->print('<th>'.&mt('Course Code').'</th>');
466: }
467: $r->print('<th>'.&mt('Owner/Co-owner(s)').'</th>');
1.79 raeburn 468: if ($showroles) {
469: $r->print('<th>'.&mt("Role(s) for [_1]",
470: &Apache::loncommon::plainname($env{'form.personfilter'},
471: $env{'form.persondomfilter'},'firstname')).'</th>');
472: }
1.71 bisitz 473: $r->print(&Apache::loncommon::end_data_table_header_row());
474: }
1.92 raeburn 475: my %cc_cloneable;
476: if (($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) {
477: my ($coord_cloneable,$warning) =
478: &get_coordinator_cloneable($cloneruname,$clonerudom,$type);
479: if ($coord_cloneable) {
480: map {$cc_cloneable{$_} = 1;} split('&',$coord_cloneable);
481: }
482: }
1.116 raeburn 483: my (%gotdomdefaults,%gotcodedefaults);
1.54 raeburn 484: foreach my $description (sort { lc($a) cmp lc($b) } (keys(%by_descrip))) {
485: foreach my $course (@{$by_descrip{$description}}) {
1.72 raeburn 486: $r->print(&Apache::loncommon::start_data_table_row());
1.54 raeburn 487: my $cleandesc=&HTML::Entities::encode($description,'<>&"');
488: $cleandesc=~s/'/\\'/g;
489: my ($cdom,$cnum)=split(/\_/,$course);
1.85 raeburn 490: my ($descr,$instcode,$ttype,$canclone,@owners);
1.64 raeburn 491: if (ref($courses{$course}) eq 'HASH') {
492: $descr = $courses{$course}{'description'};
1.85 raeburn 493: $instcode = $courses{$course}{'inst_code'};
494: $ttype = $courses{$course}{'type'};
495: if (($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) {
1.98 raeburn 496: if ($env{'form.form'} eq 'ccrs') {
497: if (($env{'request.role.domain'} eq $cdom) &&
498: (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'}))) {
499: $canclone = 1;
500: }
501: }
502: unless ($canclone) {
503: if ($cc_cloneable{$cnum.':'.$cdom}) {
504: $canclone = 1;
505: }
1.92 raeburn 506: }
507: unless ($canclone) {
508: my $cloners = $courses{$course}{'cloners'};
1.116 raeburn 509: if ($cloners ne '') {
1.92 raeburn 510: my @cloneable = split(',',$cloners);
511: if (grep(/^\*$/,@cloneable)) {
512: $canclone = 1;
513: }
1.97 raeburn 514: if (grep(/^\*:\Q$clonerudom\E$/,@cloneable)) {
1.92 raeburn 515: $canclone = 1;
516: }
517: if (grep(/^\Q$cloneruname\E:\Q$clonerudom\E$/,@cloneable)) {
518: $canclone = 1;
519: }
1.116 raeburn 520: unless ($canclone) {
521: if (($instcode) && ($crscode) && ($cdom eq $crsdom)) {
522: foreach my $cloner (@cloneable) {
523: if (($cloner ne '*') && ($cloner !~ /^\*\:$match_domain$/) &&
524: ($cloner !~ /^$match_username\:$match_domain$/) && ($cloner ne '')) {
525: if ($cloner =~ /\=/) {
526: my (%codedefaults,@code_order);
527: if (ref($gotcodedefaults{$cdom}) eq 'HASH') {
528: if (ref($gotcodedefaults{$cdom}{'defaults'}) eq 'HASH') {
529: %codedefaults = %{$gotcodedefaults{$cdom}{'defaults'}};
530: }
531: if (ref($gotcodedefaults{$cdom}{'order'}) eq 'ARRAY') {
532: @code_order = @{$gotcodedefaults{$cdom}{'order'}};
533: }
534: } else {
535: &Apache::lonnet::auto_instcode_defaults($cdom,
536: \%codedefaults,
537: \@code_order);
538: $gotcodedefaults{$cdom}{'defaults'} = \%codedefaults;
539: $gotcodedefaults{$cdom}{'order'} = \@code_order;
540: }
541: if (@code_order > 0) {
542: if (&Apache::lonnet::check_instcode_cloning(\%codedefaults,\@code_order,
543: $cloner,$instcode,$crscode)) {
544: $canclone = 1;
545: last;
546: }
547: }
548: }
549: }
550: }
551: }
552: }
553: } else {
554: my %domdefs;
555: if (ref($gotdomdefaults{$cdom}) eq 'HASH') {
556: %domdefs = %{$gotdomdefaults{$cdom}};
557: } else {
558: %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
559: $gotdomdefaults{$cdom} = \%domdefs;
560: }
561: if ($domdefs{'canclone'}) {
562: unless ($domdefs{'canclone'} eq 'none') {
563: if ($domdefs{'canclone'} eq 'domain') {
564: if ($clonerudom eq $cdom) {
565: $canclone = 1;
566: }
567: } elsif (($instcode) && ($crscode) &&
568: ($cdom eq $crsdom)) {
569: my (%codedefaults,@code_order);
570: if (ref($gotcodedefaults{$cdom}) eq 'HASH') {
571: if (ref($gotcodedefaults{$cdom}{'defaults'}) eq 'HASH') {
572: %codedefaults = %{$gotcodedefaults{$cdom}{'defaults'}};
573: }
574: if (ref($gotcodedefaults{$cdom}{'order'}) eq 'ARRAY') {
575: @code_order = @{$gotcodedefaults{$cdom}{'order'}};
576: }
577: } else {
578: &Apache::lonnet::auto_instcode_defaults($cdom,
579: \%codedefaults,
580: \@code_order);
581: $gotcodedefaults{$cdom}{'defaults'} = \%codedefaults;
582: $gotcodedefaults{$cdom}{'order'} = \@code_order;
583: }
584: if (@code_order > 0) {
585: if (&Apache::lonnet::default_instcode_cloning($cdom,$domdefs{'canclone'},
586: $instcode,$crscode,\%codedefaults,
587: \@code_order)) {
588: $canclone = 1;
589: }
590: }
591: }
592: }
593: }
1.85 raeburn 594: }
595: }
596: }
1.101 raeburn 597: push(@owners,$courses{$course}{'owner'});
598: if ($courses{$course}{'co-owners'} ne '') {
599: foreach my $item (split(/,/,$courses{$course}{'co-owners'})) {
600: push(@owners,$item);
1.64 raeburn 601: }
602: }
603: } else {
604: my $singleowner;
605: ($descr,$instcode,$singleowner,$ttype)=split(/:/,$courses{$course});
606: push(@owners,&unescape($singleowner));
607: }
1.93 raeburn 608: my $ownerstr = join(', ',map { &Apache::loncommon::plainname(split(':',$_)); } @owners);
1.85 raeburn 609: $r->print('<td>'.&course_chooser($multiple,$cdom,$cnum,$cleandesc,$canclone).'</td>');
1.71 bisitz 610: $r->print('<td>'.$description.'</td>');
611: $r->print('<td>');
612: $r->print(&Apache::lonnet::domain($cdom,'description')?
613: $cdom.' ('.&Apache::lonnet::domain($cdom,'description').')':$cdom);
614: $r->print('</td>');
1.117 raeburn 615: unless (($type eq 'Community') || ($type eq 'Placement')) {
1.89 raeburn 616: $r->print('<td>');
617: if ($instcode ne '') {
618: $r->print(&unescape($instcode));
619: } else {
620: $r->print(' ');
621: }
622: $r->print('</td>');
1.54 raeburn 623: }
1.72 raeburn 624: $r->print('<td>'.$ownerstr.'</td>');
1.79 raeburn 625: if ($showroles) {
626: $r->print('<td>');
627: my $rolestr;
628: if (ref($courses{$course}{'roles'}) eq 'ARRAY') {
629: my @roles = sort(@{$courses{$course}{'roles'}});
630: foreach my $role (@roles) {
631: if ($role =~ /^cr/) {
632: my (undef,$crdom,$crname,$crtitle) = split('/',$role);
633: $rolestr .= $crtitle.', ';
634: } else {
1.89 raeburn 635: $rolestr .= &Apache::lonnet::plaintext($role,$type).', ';
1.79 raeburn 636: }
637: }
638: $rolestr =~ s/\, $//;
639: }
640: $r->print($rolestr.'</td>');
641: }
1.54 raeburn 642: if ($multiple) { $r->print("</label>\n"); }
1.72 raeburn 643: $r->print(&Apache::loncommon::end_data_table_row());
1.71 bisitz 644: # $r->print("<br />\n");
1.19 raeburn 645: }
646: }
1.72 raeburn 647: if (%courses) {
648: $r->print(&Apache::loncommon::end_data_table());
649: }
1.71 bisitz 650:
1.54 raeburn 651: if (!%courses) {
1.104 bisitz 652: $r->print('<p class="LC_info">'.&mt('None found').'</p>');
1.54 raeburn 653: } elsif ($multiple) {
1.108 bisitz 654: $r->print('<input type="button" value="'.&mt('Submit').'" onclick="gochoose('."'','','')".'" />');
1.54 raeburn 655: }
656: $r->print('<input type="hidden" name="form" value="'.$env{'form.form'}.'" />'.
657: "\n".'<input type="hidden" name="pickedcourse" value="" />'."\n".
658: '<input type="hidden" name="type" value="'.$type.'" />'."\n");
659: if ((exists($env{'form.roleelement'})) && ($env{'form.form'} eq 'rolechoice')) {
660: $r->print('<input type="hidden" name="roleelement" value="'.
661: $env{'form.roleelement'}.'" />'."\n");
662: }
1.55 raeburn 663: if ($env{'form.form'} eq 'portform') {
664: $r->print('<input type="hidden" name="cnum" value="" />');
665: $r->print('<input type="hidden" name="cdom" value="" />');
666: $r->print('<input type="hidden" name="setroles" value="'.$env{'form.setroles'}.'" />');
667: $r->print('<input type="hidden" name="action" value="rolepicker" />');
1.57 raeburn 668: } elsif ($env{'form.form'} eq 'modifycourse') {
1.85 raeburn 669: $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','pickedcourse','type','form','numtitles','state']));
1.57 raeburn 670: } else {
671: $r->print('<input type="hidden" name="cnumelement" value="'.
672: $env{'form.cnumelement'}.'" />'."\n".
673: '<input type="hidden" name="cdomelement" value="'.
674: $env{'form.cdomelement'}.'" />'."\n");
1.90 raeburn 675: if ($env{'form.typeelement'} ne '') {
676: $r->print('<input type="hidden" name="typeelement" value="'.
677: $env{'form.typeelement'}.'" />'."\n");
678:
679: }
1.55 raeburn 680: }
1.78 raeburn 681: if ((exists($env{'form.fixeddom'})) && ($env{'form.form'} eq 'rules')) {
682: $r->print('<input type="hidden" name="fixeddom" value="'.
683: $env{'form.fixeddom'}.'" />');
684: }
685: if ($env{'form.numtitles'}) {
686: $r->print('<input type="hidden" name="numtitles" value="'.
687: $env{'form.numtitles'}.'" />');
688: }
1.54 raeburn 689: $r->print("</form>\n");
690: return;
691: }
692:
693: sub multiples_tag {
1.55 raeburn 694: my $jscript = &Apache::loncommon::check_uncheck_jscript();
695: my $multelement = '<input type="hidden" name="multiple" value="1" />';
696: return ($jscript,$multelement);
1.1 www 697: }
1.30 raeburn 698:
1.92 raeburn 699: sub get_coordinator_cloneable {
700: my ($cloneruname,$clonerudom,$type) = @_;
1.100 www 701: if (($cloneruname!~/\w/) || ($clonerudom!~/\w/)) {
702: my $warning = '<div class="LC_warning">'.&mt('Intended course owner not specified').
703: '</div>';
704: return ('',$warning);
705: } elsif (&Apache::lonnet::homeserver($cloneruname,$clonerudom) eq 'no_host') {
1.92 raeburn 706: my $warning = '<div class="LC_error">'.&mt('Intended course owner does not exist').
707: '</div>';
708: return ('',$warning);
709: } else {
710: my ($cc_clone,$ccrole);
711: if ($type eq 'Community') {
712: $ccrole = 'co';
1.117 raeburn 713: } else {
1.92 raeburn 714: $ccrole = 'cc';
715: }
716: my %ccroles = &Apache::lonnet::get_my_roles($cloneruname,$clonerudom,
717: 'userroles',['active'], [$ccrole]);
718: foreach my $key (sort(keys(%ccroles))) {
719: my ($cnum,$cdom,$role) = split(':',$key);
720: $cc_clone .= $cdom.':'.$cnum.'&';
721: }
722: $cc_clone =~ s/\&$//;
723: return ($cc_clone);
724: }
725: }
726:
1.30 raeburn 727: sub course_chooser {
1.85 raeburn 728: my ($multiple,$cdom,$cnum,$cleandesc,$canclone) = @_;
1.30 raeburn 729: my $output;
1.35 raeburn 730: if ($multiple) {
1.32 albertel 731: $output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n";
1.85 raeburn 732: } elsif ((($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) && (!$canclone)) {
733: if ($env{'form.form'} eq 'ccrs') {
1.114 bisitz 734: $output = &mt('No cloning for [_1]',$env{'form.cloner'})."\n";
1.85 raeburn 735: } else {
736: $output = &mt('No rights to clone')."\n";
737: }
1.30 raeburn 738: } else {
1.108 bisitz 739: $output = '<input type="button" value="'.&mt('Select').'" onclick="gochoose('.
1.30 raeburn 740: "'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n";
741: }
742: return $output;
1.49 raeburn 743: }
744:
1.55 raeburn 745: sub gochoose_javascript {
1.57 raeburn 746: my ($type,$multiple,$autosubmit,$lastaction) = @_;
1.55 raeburn 747: my %elements = (
748: 'Course' => {
749: name => 'coursepick',
750: total => 'coursetotal',
751: list => 'courselist',
752: },
1.83 raeburn 753: 'Community' => {
1.88 raeburn 754: name => 'coursepick',
755: total => 'coursetotal',
756: list => 'courselist',
1.55 raeburn 757: },
1.117 raeburn 758: 'Placement' => {
759: name => 'coursepick',
760: total => 'coursetotal',
761: list => 'courselist',
762: },
1.55 raeburn 763: );
1.107 raeburn 764: my $output = qq|
1.57 raeburn 765: function gochoose(cname,cdom,cdesc) {
1.55 raeburn 766: var openerForm = "$env{'form.form'}";
767: courseCount = 0;
768: var courses = '';
1.57 raeburn 769: |;
770: if ($multiple) {
771: $output .= <<"ENDSCRIPT";
772: courseCount = 0;
773: var courses = '';
774: if (typeof(document.courselist.course_id.length) == 'undefined') {
775: // only 1 course checkbox was created
776: if (document.courselist.course_id.checked) {
777: courses = courses + document.courselist.course_id.value + "&&";
778: courseCount ++;
779: }
780: } else {
781: for (var j=0; j<document.courselist.course_id.length; j++) {
782: if (document.courselist.course_id[j].checked) {
783: courses = courses + document.courselist.course_id[j].value + "&&";
1.55 raeburn 784: courseCount ++;
785: }
1.57 raeburn 786: }
787: }
788: opener.document.$env{'form.form'}.$elements{$type}{'total'}.value = courseCount;
789: if (typeof(opener.document.$env{'form.form'}.$elements{$type}{'name'}.length) ==
790: 'undefined') {
791: if (opener.document.$env{'form.form'}.$elements{$type}{'name'}.value == 'specific') {
792: opener.document.$env{'form.form'}.$elements{$type}{'name'}.checked = true;
1.55 raeburn 793: } else {
1.57 raeburn 794: opener.document.$env{'form.form'}.$elements{$type}{'name'}.checked = false;
1.55 raeburn 795: }
1.57 raeburn 796: } else {
797: for (var j=0; j<opener.document.$env{'form.form'}.$elements{$type}{'name'}.length; j++) {
798: if (opener.document.$env{'form.form'}.$elements{$type}{'name'}\[j].value == 'specific') {
799: opener.document.$env{'form.form'}.$elements{$type}{'name'}\[j].checked = true;
1.55 raeburn 800: } else {
1.57 raeburn 801: opener.document.$env{'form.form'}.$elements{$type}{'name'}\[j].checked = false;
1.54 raeburn 802: }
1.55 raeburn 803: }
1.57 raeburn 804: }
805: if (courseCount > 0) {
806: courses = courses.substr(0,courses.length-2);
807: opener.document.$env{'form.form'}.$elements{$type}{'list'}.value = courses;
808: }
809: ENDSCRIPT
810: } else {
1.90 raeburn 811: my ($name_code,$type_code);
1.57 raeburn 812: if ($env{'form.cnameelement'} ne '') {
1.103 raeburn 813: $name_code = <<ENDNAMECODE;
814: var showcdesc = cdesc;
815: if (cdesc.length > 25) {
816: showcdesc = cdesc.substr(0,25)+' ...';
817: }
818: opener.document.$env{'form.form'}.$env{'form.cnameelement'}.value=showcdesc;
819: ENDNAMECODE
1.55 raeburn 820: }
1.90 raeburn 821: if ($env{'form.typeelement'} ne '') {
822: $type_code = 'opener.document.'.$env{'form.form'}.'.'.
823: $env{'form.typeelement'}.'.value=document.courselist.type;';
824: }
825:
1.57 raeburn 826: $output .= qq|
1.55 raeburn 827: $name_code
1.90 raeburn 828: $type_code
1.55 raeburn 829: opener.document.$env{'form.form'}.$env{'form.cnumelement'}.value=cname;
830: var slct=opener.document.$env{'form.form'}.$env{'form.cdomelement'};
831: if (slct.options == undefined) {
832: opener.document.$env{'form.form'}.$env{'form.cdomelement'}.value=cdom;
833: }
834: else {
835: var i;
836: for (i=0;i<slct.length;i++) {
837: if (slct.options[i].value==cdom) { slct.selectedIndex=i; }
1.54 raeburn 838: }
839: }
1.57 raeburn 840: |;
1.54 raeburn 841: }
1.57 raeburn 842: $output .= qq|
1.55 raeburn 843: if (openerForm == 'portform') {
844: document.courselist.cnum.value = cname;
845: document.courselist.cdom.value = cdom;
846: }
847: $autosubmit
848: $lastaction
1.54 raeburn 849: }
1.57 raeburn 850: |;
1.105 bisitz 851: return &Apache::lonhtmlcommon::scripttag($output);
1.54 raeburn 852: }
853:
1.55 raeburn 854: 1;
855: __END__
856:
857: =pod
858:
859: =head1 NAME
860:
861: Apache::lonpickcourse - Search for course(s) based on user-specified criteria.
862:
863: =head1 SYNOPSIS
864:
865: Invoked by other LON-CAPA modules, when course(s) need to be selected by the user.
866:
867: =head1 OVERVIEW
868:
869: Two screens are typically displayed to the user. The first is a set of criteria which are used to constrain the search for courses.
870:
871: =head2 Search Criteria (Screen One)
872:
873: =head3 Criteria:
874:
875: =over 4
876:
877: =item *
878: Course Activity - how recently was course last visited by anyone.
879:
880: =item *
881: Course Domain - the domain of the course
882:
883: =item *
1.117 raeburn 884: Type - Course, Community or Placement
1.55 raeburn 885:
886: =item *
887: Course Institutional Code - the institutional identifier assigned to the course
888:
889: =item *
890: Course Owner's Username - the username of the owner of the course (assigned by the Domain Coordinator and/or when the course was created).
891:
892: =item *
893: Course Owner's Domain - the domain of the owner of the course
894:
895: =item *
1.76 bisitz 896: Course Title - text which appears in the Course Title, as set in the Course Parameters.
1.55 raeburn 897:
898: =item *
899: Course ID - the internal course number (course ID part after initial 'domain_') used by LON-CAPA (this criterion is only displayed to Domain Coordinators selecting a course in the same domain as their DC role).
900:
901: =back
902:
903: The criteria setting screen is not displayed if course picking is done by a user who does not have advanced privileges (as defined by $env{'user.adv'}).
904:
905: =head2 Course Display (Screen Two)
906:
907: A list of courses matching the search criteria is displayed. If the user is not an advanced user, screen one will have been skipped and the courses displayed will be all courses in which the user has currently active roles. The information displayed for each course is:
908:
909: =over 4
910:
911: =item *
912: Course description
913:
914: =item *
915: Domain description of course domain
916:
917: =item *
918: Course institutional code
919:
920: =item *
921: Course owner (username:domain)
922:
923: =back
924:
925: Depending on context, the display may include a single select box for each course, allowing selection of only a single course, or may include checkboxes allowing selection of more than one course.
926:
927: Following selection, and/or submission, the course description, number and domain are transferred to the browser window from which the course picker window was opened. In most cases, the child window containing the course picker screens will be closed. However, in some cases closure will be delayed until a third screen has been displayed (e.g., setting of course-based conditional access controls for portfolio files). In this case the page is generated via /adm/portfolio and the page features select boxes to allow the user to select roles, access types, sections and groups.
928:
929: =head1 SUBROUTINES
930:
931: =over 4
932:
933: =item *
934: X<create_user_javascript()>
935: B<create_user_javascript($type)>:
936:
1.117 raeburn 937: Input: 1 - $type - the course type - Course, Community, or Placement
1.55 raeburn 938:
939: Output: 1 - $output - javascript wrapped in E<lt>scriptE<gt>E<lt>/scriptE<gt> tags
940:
941: Side Effects: None
942:
943: javascript code for reporting selected sections (as a string of comma separated sections) and groups in the selected course (as a comma separated list) then calling setSect() javscript function in the opener window (to populate section select box) then closing current window.
944:
945:
946: =item *
947: X<display_matched_courses()>
1.116 raeburn 948: B<display_matched_courses($r,$type,$multiple,$action,$showroles,$cloneruname,$clonerudom,$crsdom,$crscode,%courses)>:
1.55 raeburn 949:
1.116 raeburn 950: Input: 8 - request object, course type, multiple (0 or 1), form action, whether to show roles (for course personnel filter), username of new course owner, domain of new course owner, domain of new course, institutional code of new course, hash of courses.
1.55 raeburn 951:
952: Output: 0
953:
954: Side Effects: prints select buttons (multiple = 0) or checkboxes (multiple = 1) and hidden form elements for selection of one or more courses which met search criteria.
955:
956: =item *
957: X<multiples_tag()>
958: B<multiples_tag()>:
959:
960:
961: Input: 0
962:
963: Output: 2 - $jscript - javascript for check all/uncheck all checkboxes; $multelement - hidden form element with multiple set to 1.
964:
965: Side Effects: None
966:
967:
968: =item *
969: X<course_chooser()>
1.85 raeburn 970: B<course_chooser($multiple,$cdom,$cnum,$cleandesc,$canclone)>:
1.55 raeburn 971:
1.85 raeburn 972: Input: 5 - single (0) or multiple (1) courses; course domain, course number; course description; can clone course (1 if new course owner has cloning rights).
1.55 raeburn 973:
1.85 raeburn 974: Output: 1 - HTML for either checkbox (multiple=1) or select button (multiple=0) for user to indicate course selection.
1.55 raeburn 975:
976: Side Effects: None
977:
978:
979: =item *
980: X<gochoose_javascript()>
1.57 raeburn 981: B<gochoose_javascript($type,$multiple,$autosubmit,$lastaction)>:
1.55 raeburn 982:
1.66 raeburn 983: Input: 4 - course type; single (0) or multiple courses (1); in context of DC selecting a CC role in a course: javascript code from &processpick(); final action to take after user chooses course(s): either close window, or submit form for display of next page etc.
1.55 raeburn 984:
985: Output: 1 $output - javascript wrapped in E<lt>scriptE<gt>E<lt>/scriptE<gt> tags
986:
987: Side Effects: None
988:
989: javascript functions used when user selects a course(s). Different behavior depending on context:
990:
991: =back
992:
993: =over 8
994:
995: =item
996:
997: (a) Domain Coordinator using MAIL to select recipients of broadcast e-mail - && separated list of selected courses written to hidden form element in opener window. Child window closes.
998:
999: =item
1000:
1001: (b) Domain Coordinator choosing a course for adoption of a CC role from roles screen - write course identifying information to hidden form elements in opener window and automatically submit role selection form in opener window. Child window closes.
1002:
1003: =item
1004:
1005: (c) Domain Coordinator creating a course, and selecting a course to clone - course number and domain written to visible form elements in opener window. Child window closes.
1006:
1007: =item
1.54 raeburn 1008:
1.55 raeburn 1009: (d) User selecting a course for course-based conditional access control for a portfolio file - form is submitted, and new page is displayed for selection of roles, access types, sections and groups to be used in conditional ACL. New page is generated by /adm/portfolio.
1.54 raeburn 1010:
1.55 raeburn 1011: =item
1.54 raeburn 1012:
1.55 raeburn 1013: (e) Domain Coordinator assigning a role to a user - form is submitted, and new page does an onload call to a javascript function to (a) write lists of sections and groups to hidden elements in opener window, (b) call function in opener window to dynamically populate select box showing current sections.
1.54 raeburn 1014:
1.55 raeburn 1015: =item
1.54 raeburn 1016:
1.55 raeburn 1017: (f) Author modifying a rights entry in a .rights file - selected course number and domain are witten to visible form elements in opener window. Child window closes.
1.54 raeburn 1018:
1.55 raeburn 1019: =item
1.49 raeburn 1020:
1.102 bisitz 1021: (g) Bubblesheet Scanning Operator uploading a bubblesheet file to a course - course number is written to visible form element in opener window. Child window closes.
1.30 raeburn 1022:
1.84 raeburn 1023: =item
1024:
1025: (h) User requesting creation of a course, and selecting a course to clone - course number and domain written to visible form elements in opener window. Child window closes.
1026:
1.55 raeburn 1027: =back
1028:
1029: =cut
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>