Annotation of loncom/interface/lonmodifycourse.pm, revision 1.48
1.20 albertel 1: # The LearningOnline Network with CAPA
1.28 raeburn 2: # handler for DC-only modifiable course settings
1.20 albertel 3: #
1.48 ! raeburn 4: # $Id: lonmodifycourse.pm,v 1.47 2009/10/23 16:14:43 bisitz Exp $
1.20 albertel 5: #
1.3 raeburn 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: #
1.1 raeburn 28: package Apache::lonmodifycourse;
29:
30: use strict;
31: use Apache::Constants qw(:common :http);
32: use Apache::lonnet;
33: use Apache::loncommon;
1.28 raeburn 34: use Apache::lonhtmlcommon;
1.1 raeburn 35: use Apache::lonlocal;
1.36 raeburn 36: use Apache::lonuserutils;
1.28 raeburn 37: use Apache::lonpickcourse;
1.1 raeburn 38: use lib '/home/httpd/lib/perl';
1.25 www 39: use LONCAPA;
1.1 raeburn 40:
1.28 raeburn 41: sub get_dc_settable {
1.48 ! raeburn 42: my ($type) = @_;
! 43: if ($type eq 'Community') {
! 44: return ('courseowner');
! 45: } else {
! 46: return ('courseowner','coursecode','authtype','autharg');
! 47: }
! 48: }
! 49:
! 50: sub autoenroll_keys {
! 51: my $internals = ['coursecode','courseowner','authtype','autharg','autoadds','autodrops',
! 52: 'autostart','autoend','sectionnums','crosslistings'];
! 53: my $accessdates = ['default_enrollment_start_date','default_enrollment_end_date'];
! 54: return ($internals,$accessdates);
1.28 raeburn 55: }
56:
1.38 raeburn 57: sub catalog_settable {
58: my ($confhash) = @_;
59: my @settable;
60: if (ref($confhash) eq 'HASH') {
61: if ($confhash->{'togglecats'} ne 'crs') {
62: push(@settable,'togglecats');
63: }
64: if ($confhash->{'categorize'} ne 'crs') {
65: push(@settable,'categorize');
66: }
67: } else {
68: push(@settable,('togglecats','categorize'));
69: }
70: return @settable;
71: }
72:
1.28 raeburn 73: sub get_enrollment_settings {
74: my ($cdom,$cnum) = @_;
1.48 ! raeburn 75: my ($internals,$accessdates) = &autoenroll_keys();
! 76: my @items;
! 77: if ((ref($internals) eq 'ARRAY') && (ref($accessdates) eq 'ARRAY')) {
! 78: @items = map { 'internal.'.$_; } (@{$internals});
! 79: push(@items,@{$accessdates});
! 80: }
! 81: my %settings = &Apache::lonnet::get('environment',\@items,$cdom,$cnum);
1.28 raeburn 82: my %enrollvar;
83: $enrollvar{'autharg'} = '';
84: $enrollvar{'authtype'} = '';
1.48 ! raeburn 85: foreach my $item (keys(%settings)) {
1.28 raeburn 86: if ($item =~ m/^internal\.(.+)$/) {
87: my $type = $1;
88: if ( ($type eq "autoadds") || ($type eq "autodrops") ) {
89: if ($settings{$item} == 1) {
90: $enrollvar{$type} = "ON";
91: } else {
92: $enrollvar{$type} = "OFF";
1.10 raeburn 93: }
1.28 raeburn 94: } elsif ( ($type eq "autostart") || ($type eq "autoend") ) {
95: if ( ($type eq "autoend") && ($settings{$item} == 0) ) {
1.48 ! raeburn 96: $enrollvar{$type} = &mt('No end date');
1.28 raeburn 97: } else {
1.48 ! raeburn 98: $enrollvar{$type} = &Apache::lonlocal::locallocaltime($settings{$item});
1.14 raeburn 99: }
1.30 raeburn 100: } elsif ($type eq "sectionnums") {
1.28 raeburn 101: $enrollvar{$type} = $settings{$item};
102: $enrollvar{$type} =~ s/,/, /g;
103: } elsif ($type eq "authtype"
104: || $type eq "autharg" || $type eq "coursecode"
105: || $type eq "crosslistings") {
106: $enrollvar{$type} = $settings{$item};
107: } elsif ($type eq 'courseowner') {
108: if ($settings{$item} =~ /^[^:]+:[^:]+$/) {
109: $enrollvar{$type} = $settings{$item};
110: } else {
111: if ($settings{$item} ne '') {
112: $enrollvar{$type} = $settings{$item}.':'.$cdom;
1.26 raeburn 113: }
1.1 raeburn 114: }
1.28 raeburn 115: }
116: } elsif ($item =~ m/^default_enrollment_(start|end)_date$/) {
117: my $type = $1;
118: if ( ($type eq 'end') && ($settings{$item} == 0) ) {
1.48 ! raeburn 119: $enrollvar{$item} = &mt('No end date');
1.28 raeburn 120: } elsif ( ($type eq 'start') && ($settings{$item} eq '') ) {
121: $enrollvar{$item} = 'When enrolled';
122: } else {
1.48 ! raeburn 123: $enrollvar{$item} = &Apache::lonlocal::locallocaltime($settings{$item});
1.1 raeburn 124: }
125: }
126: }
1.28 raeburn 127: return %enrollvar;
128: }
129:
130: sub print_course_search_page {
131: my ($r,$dom,$domdesc) = @_;
1.48 ! raeburn 132: my $action = '/adm/modifycourse';
! 133: my $type = $env{'form.type'};
! 134: if (!defined($env{'form.type'})) {
! 135: $type = 'Course';
! 136: }
! 137: &print_header($r,$type);
1.28 raeburn 138: my $filterlist = ['descriptfilter',
139: 'instcodefilter','ownerfilter',
1.44 raeburn 140: 'coursefilter'];
1.28 raeburn 141: my $filter = {};
1.48 ! raeburn 142: my ($numtitles,$cctitle,$dctitle);
! 143: my $ccrole = 'cc';
! 144: if ($type eq 'Community') {
! 145: $ccrole = 'co';
1.46 raeburn 146: }
1.48 ! raeburn 147: $cctitle = &Apache::lonnet::plaintext($ccrole,$type);
1.46 raeburn 148: $dctitle = &Apache::lonnet::plaintext('dc');
149: $r->print(&Apache::lonpickcourse::js_changer());
1.48 ! raeburn 150: if ($type eq 'Community') {
! 151: $r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>');
! 152: } else {
! 153: $r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>');
1.46 raeburn 154: }
1.28 raeburn 155: $r->print(&Apache::lonpickcourse::build_filters($filterlist,$type,
1.44 raeburn 156: undef,undef,$filter,$action,\$numtitles,'modifycourse'));
1.48 ! raeburn 157: if ($type eq 'Community') {
! 158: $r->print(&mt('Actions available after searching for a community:').'<ul>'.
! 159: '<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n".
! 160: '<li>'.&mt('View or modify community settings which only a [_1] may modify.',$dctitle).
! 161: '</li>'."\n".'</ul>');
! 162: } else {
! 163: $r->print(&mt('Actions available after searching for a course:').'<ul>'.
! 164: '<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n".
! 165: '<li>'.&mt('View or modify course settings which only a [_1] may modify.',$dctitle).
! 166: '</li>'."\n".'</ul>');
! 167: }
1.28 raeburn 168: }
169:
170: sub print_course_selection_page {
171: my ($r,$dom,$domdesc) = @_;
1.48 ! raeburn 172: my $type = $env{'form.type'};
! 173: if (!defined($type)) {
! 174: $type = 'Course';
! 175: }
! 176: &print_header($r,$type);
1.28 raeburn 177:
178: # Criteria for course search
179: my $filterlist = ['descriptfilter',
180: 'instcodefilter','ownerfilter',
181: 'ownerdomfilter','coursefilter'];
182: my %filter;
183: my $action = '/adm/modifycourse';
184: my $dctitle = &Apache::lonnet::plaintext('dc');
1.46 raeburn 185: my $numtitles;
186: $r->print(&Apache::lonpickcourse::js_changer());
1.48 ! raeburn 187: $r->print(&mt('Revise your search criteria for this domain').' ('.$domdesc.').<br />');
1.28 raeburn 188: $r->print(&Apache::lonpickcourse::build_filters($filterlist,$type,
1.46 raeburn 189: undef,undef,\%filter,$action,\$numtitles));
1.28 raeburn 190: $filter{'domainfilter'} = $dom;
191: my %courses = &Apache::lonpickcourse::search_courses($r,$type,0,
1.46 raeburn 192: \%filter,$numtitles);
193: &Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef,
1.28 raeburn 194: %courses);
1.1 raeburn 195: return;
196: }
197:
1.28 raeburn 198: sub print_modification_menu {
1.48 ! raeburn 199: my ($r,$cdesc,$domdesc,$dom,$type) = @_;
! 200: &print_header($r,$type);
! 201: my ($ccrole,$setquota_text,$setparams_text,$cat_text);
! 202: if ($type eq 'Community') {
! 203: $ccrole = 'co';
! 204: } else {
! 205: $ccrole = 'cc';
! 206: }
1.37 raeburn 207: my $action = '/adm/modifycourse';
1.48 ! raeburn 208: if ($type eq 'Community') {
! 209: $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.');
! 210: $setparams_text = 'View/Modify community owner';
! 211: $cat_text = 'View/Modify catalog settings for community';
! 212: } else {
! 213: $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');
! 214: $setparams_text = 'View/Modify course owner, institutional code, and default authentication';
! 215: $cat_text = 'View/Modify catalog settings for course';
! 216: }
1.28 raeburn 217: my @menu =
218: (
1.48 ! raeburn 219: { text => $setparams_text,
! 220: phase => 'setparms',
! 221: },
! 222: { text => 'View/Modify quota for group portfolio files',
1.28 raeburn 223: phase => 'setquota',
1.48 ! raeburn 224: }
! 225: );
1.38 raeburn 226: my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);
227: my @additional_params = &catalog_settable($domconf{'coursecategories'});
228: if (@additional_params > 0) {
1.48 ! raeburn 229: push (@menu, { text => $cat_text,
1.38 raeburn 230: phase => 'catsettings',
231: });
232: }
1.48 ! raeburn 233: unless ($type eq 'Community') {
! 234: push(@menu,
! 235: { text => 'Display current settings for automated enrollment',
! 236: phase => 'viewparms',
! 237: }
! 238: );
! 239: }
! 240: my $menu_html = '<h3>'.&mt('View/Modify settings for: ').
! 241: ' <span class="LC_nobreak">'.$cdesc.'</span></h3>'."\n";
! 242: if ($type eq 'Community') {
! 243: $menu_html .= &mt('Although almost all community settings can be modified by a Coordinator, the following may only be set or modified by a Domain Coordinator:');
! 244: } else {
! 245: $menu_html .= &mt('Although almost all course settings can be modified by a Course Coordinator, the following may only be set or modified by a Domain Coordinator:');
! 246: }
! 247: $menu_html .= '<ul>';
! 248: if ($type eq 'Community') {
! 249: $menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>';
! 250: } else {
! 251: $menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'.
! 252: '<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>';
! 253: }
! 254: $menu_html .= '<li>'.$setquota_text.'</li>'."\n";
1.38 raeburn 255: foreach my $item (@additional_params) {
1.48 ! raeburn 256: if ($type eq 'Community') {
! 257: if ($item eq 'togglecats') {
! 258: $menu_html .= ' <li>'.&mt('Hiding/unhiding a community from the catalog (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
! 259: } elsif ($item eq 'categorize') {
! 260: $menu_html .= ' <li>'.&mt('Manual cataloging of a community (although can be [_1]configured[_2] to be modifiable by a Coordinator in community context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
! 261: }
! 262: } else {
! 263: if ($item eq 'togglecats') {
! 264: $menu_html .= ' <li>'.&mt('Hiding/unhiding a course from the course catalog (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
! 265: } elsif ($item eq 'categorize') {
! 266: $menu_html .= ' <li>'.&mt('Manual cataloging of a course (although can be [_1]configured[_2] to be modifiable by a Course Coordinator in course context).','<a href="/adm/domainprefs?actions=coursecategories&phase=display">','</a>').'</li>'."\n";
! 267: }
1.38 raeburn 268: }
269: }
270: $menu_html .= ' </ul>
1.37 raeburn 271: <form name="menu" method="post" action="'.$action.'" />'."\n".
272: &hidden_form_elements();
1.28 raeburn 273: foreach my $menu_item (@menu) {
1.48 ! raeburn 274: $menu_html.='<h3>';
1.28 raeburn 275: $menu_html.=
276: qq|<a href="javascript:changePage(document.menu,'$menu_item->{'phase'}')">|;
1.48 ! raeburn 277: $menu_html.= &mt($menu_item->{'text'}).'</a>';
! 278: $menu_html.='</h3>';
1.3 raeburn 279: }
1.28 raeburn 280:
281: $r->print($menu_html);
282: return;
283: }
284:
1.37 raeburn 285: sub print_ccrole_selected {
1.48 ! raeburn 286: my ($r,$type) = @_;
! 287: &print_header($r,$type);
1.37 raeburn 288: my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'});
289: $r->print('<form name="ccrole" method="post" action="/adm/roles">
290: <input type="hidden" name="selectrole" value="1" />
291: <input type="hidden" name="newrole" value="cc./'.$cdom.'/'.$cnum.'" />
292: </form>');
293: }
294:
1.28 raeburn 295: sub print_settings_display {
296: my ($r,$cdom,$cnum,$cdesc,$type) = @_;
297: my %enrollvar = &get_enrollment_settings($cdom,$cnum);
1.48 ! raeburn 298: my %longtype = &course_settings_descrip($type);
1.28 raeburn 299: my %lt = &Apache::lonlocal::texthash(
1.48 ! raeburn 300: 'valu' => 'Current value',
! 301: 'cour' => 'Current settings are:',
! 302: 'cose' => "Settings which control auto-enrollment using classlists from your institution's student information system fall into two groups:",
! 303: 'dcon' => 'Modifiable only by Domain Coordinator',
! 304: 'back' => 'Pick another action',
1.28 raeburn 305: );
1.48 ! raeburn 306: my $ccrole = 'cc';
! 307: if ($type eq 'Community') {
! 308: $ccrole = 'co';
! 309: }
! 310: my $cctitle = &Apache::lonnet::plaintext($ccrole,$type);
1.28 raeburn 311: my $dctitle = &Apache::lonnet::plaintext('dc');
1.48 ! raeburn 312: my @modifiable_params = &get_dc_settable($type);
! 313: my ($internals,$accessdates) = &autoenroll_keys();
! 314: my @items;
! 315: if ((ref($internals) eq 'ARRAY') && (ref($accessdates) eq 'ARRAY')) {
! 316: @items = (@{$internals},@{$accessdates});
! 317: }
1.28 raeburn 318: my $disp_table = &Apache::loncommon::start_data_table()."\n".
319: &Apache::loncommon::start_data_table_header_row()."\n".
1.48 ! raeburn 320: "<th> </th>\n".
1.28 raeburn 321: "<th>$lt{'valu'}</th>\n".
322: "<th>$lt{'dcon'}</th>\n".
323: &Apache::loncommon::end_data_table_header_row()."\n";
1.48 ! raeburn 324: foreach my $item (@items) {
1.28 raeburn 325: $disp_table .= &Apache::loncommon::start_data_table_row()."\n".
1.48 ! raeburn 326: "<td><b>$longtype{$item}</b></td>\n".
! 327: "<td>$enrollvar{$item}</td>\n";
! 328: if (grep(/^\Q$item\E$/,@modifiable_params)) {
! 329: $disp_table .= '<td align="right">'.&mt('Yes').'</td>'."\n";
1.28 raeburn 330: } else {
1.48 ! raeburn 331: $disp_table .= '<td align="right">'.&mt('No').'</td>'."\n";
1.28 raeburn 332: }
333: $disp_table .= &Apache::loncommon::end_data_table_row()."\n";
1.3 raeburn 334: }
1.28 raeburn 335: $disp_table .= &Apache::loncommon::end_data_table()."\n";
1.48 ! raeburn 336: &print_header($r,$type);
! 337: my $newrole = $ccrole.'./'.$cdom.'/'.$cnum;
! 338: my $escuri = &HTML::Entities::encode('/adm/roles?selectrole=1&'.$newrole.
! 339: '=1&destinationurl=/adm/populate','&<>"');
! 340: $r->print('<h3>'.&mt('Current automated enrollment settings for:').
! 341: ' <span class="LC_nobreak">'.$cdesc.'</span></h3>'.
! 342: '<form action="/adm/modifycourse" method="post" name="viewparms">'."\n".
! 343: '<p>'.$lt{'cose'}.'<ul>'.
! 344: '<li>'.&mt('Settings modifiable by a [_1] via the [_2]Automated Enrollment Manager[_3] in a course.',$cctitle,'<a href="'.$escuri.'">','</a>').'</li>'.
! 345: '<li>'.&mt('Settings modifiable by a [_1] via [_2]View/Modify course owner, institutional code, and default authentication[_3].',$dctitle,'<a href="javascript:changePage(document.viewparms,'."'setparms'".');">','</a>')."\n".
! 346: '</li></ul></p>'.
! 347: '<p>'.$lt{'cour'}.'</p><p>'.$disp_table.'</p><p>'.
! 348: '<a href="javascript:changePage(document.viewparms,'."'menu'".')">'.$lt{'back'}.'</a>'."\n".
! 349: &hidden_form_elements().
! 350: '</p></form>'
! 351: );
1.28 raeburn 352: }
1.3 raeburn 353:
1.28 raeburn 354: sub print_setquota {
355: my ($r,$cdom,$cnum,$cdesc,$type) = @_;
356: my %lt = &Apache::lonlocal::texthash(
1.48 ! raeburn 357: 'cquo' => 'Disk space for storage of group portfolio files for:',
1.28 raeburn 358: 'gpqu' => 'Course portfolio files disk space',
1.42 schafran 359: 'modi' => 'Save',
1.48 ! raeburn 360: 'back' => 'Pick another action',
1.28 raeburn 361: );
1.48 ! raeburn 362: if ($type eq 'Community') {
! 363: $lt{'gpqu'} = &mt('Community portfolio files disk space');
! 364: }
1.28 raeburn 365: my %settings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum);
366: my $coursequota = $settings{'internal.coursequota'};
367: if ($coursequota eq '') {
368: $coursequota = 20;
1.3 raeburn 369: }
1.48 ! raeburn 370: &print_header($r,$type);
1.28 raeburn 371: my $hidden_elements = &hidden_form_elements();
1.48 ! raeburn 372: my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_Quota');
1.28 raeburn 373: $r->print(<<ENDDOCUMENT);
374: <form action="/adm/modifycourse" method="post" name="setquota">
1.48 ! raeburn 375: <h3>$lt{'cquo'} <span class="LC_nobreak">$cdesc</span></h3>
1.28 raeburn 376: <p>
1.48 ! raeburn 377: $helpitem $lt{'gpqu'}: <input type="text" size="4" name="coursequota" value="$coursequota" /> Mb
1.28 raeburn 378: <input type="button" onClick="javascript:verify_quota(this.form)" value="$lt{'modi'}" />
379: </p>
380: $hidden_elements
381: <a href="javascript:changePage(document.setquota,'menu')">$lt{'back'}</a>
382: </form>
383: ENDDOCUMENT
384: return;
385: }
1.3 raeburn 386:
1.38 raeburn 387: sub print_catsettings {
1.48 ! raeburn 388: my ($r,$cdom,$cnum,$cdesc,$type) = @_;
! 389: &print_header($r,$type);
1.38 raeburn 390: my %lt = &Apache::lonlocal::texthash(
1.48 ! raeburn 391: 'back' => 'Pick another action',
! 392: 'catset' => 'Catalog Settings for Course',
! 393: 'visi' => 'Visibility in Course/Community Catalog',
! 394: 'exclude' => 'Exclude from course catalog:',
! 395: 'categ' => 'Categorize Course',
! 396: 'assi' => 'Assign one or more categories and/or subcategories to this course.'
1.38 raeburn 397: );
1.48 ! raeburn 398: if ($type eq 'Community') {
! 399: $lt{'catset'} = &mt('Catalog Settings for Community');
! 400: $lt{'exclude'} = &mt('Exclude from course catalog');
! 401: $lt{'categ'} = &mt('Categorize Community');
! 402: $lt{'assi'} = &mt('Assign one or more categories and/or subcategories to this community.');
! 403: }
1.38 raeburn 404: $r->print('<form action="/adm/modifycourse" method="post" name="catsettings">'.
1.48 ! raeburn 405: '<h3>'.$lt{'catset'}.' <span class="LC_nobreak">'.$cdesc.'</span></h3>');
1.38 raeburn 406: my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
407: my @cat_params = &catalog_settable($domconf{'coursecategories'});
408: if (@cat_params > 0) {
409: my %currsettings =
410: &Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum);
411: if (grep(/^togglecats$/,@cat_params)) {
412: my $excludeon = '';
413: my $excludeoff = ' checked="checked" ';
414: if ($currsettings{'hidefromcat'} eq 'yes') {
415: $excludeon = $excludeoff;
416: $excludeoff = '';
417: }
1.48 ! raeburn 418: $r->print('<br /><h4>'.$lt{'visi'}.'</h4>'.
! 419: $lt{'exclude'}.
! 420: ' <label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.' />'.&mt('Yes').'</label> <label><input name="hidefromcat" type="radio" value="" '.$excludeoff.' />'.&mt('No').'</label><br /><p>');
! 421: if ($type eq 'Community') {
! 422: $r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded."));
! 423: } else {
! 424: $r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':<ul>'.
! 425: '<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'.
! 426: '<li>'.&mt('The course has been categorized using at least one of the course categories defined for the domain.').'</li></ul>');
! 427: }
! 428: $r->print('</ul></p>');
1.38 raeburn 429: }
430: if (grep(/^categorize$/,@cat_params)) {
1.48 ! raeburn 431: $r->print('<br /><h4>'.$lt{'categ'}.'</h4>');
1.38 raeburn 432: if (ref($domconf{'coursecategories'}) eq 'HASH') {
433: my $cathash = $domconf{'coursecategories'}{'cats'};
434: if (ref($cathash) eq 'HASH') {
1.48 ! raeburn 435: $r->print($lt{'assi'}.'<br /><br />'.
1.38 raeburn 436: &Apache::loncommon::assign_categories_table($cathash,
437: $currsettings{'categories'}));
438: } else {
439: $r->print(&mt('No categories defined for this domain'));
440: }
441: } else {
442: $r->print(&mt('No categories defined for this domain'));
443: }
1.48 ! raeburn 444: unless ($type eq 'Community') {
! 445: $r->print('<p>'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses, in addition to receiving a listing under any manually assigned categor(ies).').'</p>');
! 446: }
1.38 raeburn 447: }
1.48 ! raeburn 448: $r->print('<p><input type="button" name="chgcatsettings" value="'.
! 449: &mt('Save').'" onclick="javascript:changePage(document.catsettings,'."'processcat'".');" /></p>');
1.38 raeburn 450: } else {
1.48 ! raeburn 451: $r->print('<span class="LC_warning">');
! 452: if ($type eq 'Community') {
! 453: $r->print(&mt('Catalog settings in this domain are set in community context via "Community Configuration".'));
! 454: } else {
! 455: $r->print(&mt('Catalog settings in this domain are set in course context via "Course Configuration".'));
! 456: }
! 457: $r->print('</span><br /><br />'."\n".
1.38 raeburn 458: '<a href="javascript:changePage(document.catsettings,'."'menu'".');">'.
459: $lt{'back'}.'</a>');
460: }
461: $r->print(&hidden_form_elements().'</form>'."\n");
462: return;
463: }
464:
1.28 raeburn 465: sub print_course_modification_page {
1.48 ! raeburn 466: my ($r,$cdom,$cnum,$cdesc,$type) = @_;
1.2 raeburn 467: my %lt=&Apache::lonlocal::texthash(
468: 'actv' => "Active",
469: 'inac' => "Inactive",
470: 'ownr' => "Owner",
471: 'name' => "Name",
1.26 raeburn 472: 'unme' => "Username:Domain",
1.2 raeburn 473: 'stus' => "Status",
1.48 ! raeburn 474: 'nocc' => 'There is currently no owner set for this course.',
1.32 raeburn 475: 'gobt' => "Save",
1.2 raeburn 476: );
1.48 ! raeburn 477: my ($ownertable,$ccrole,$javascript_validations,$authenitems,$ccname);
! 478: my %enrollvar = &get_enrollment_settings($cdom,$cnum);
! 479: if ($type eq 'Community') {
! 480: $ccrole = 'co';
! 481: $lt{'nocc'} = &mt('There is currently no owner set for this community.');
! 482: } else {
! 483: $ccrole ='cc';
! 484: ($javascript_validations,$authenitems) = &gather_authenitems($cdom,\%enrollvar);
! 485: }
! 486: $ccname = &Apache::lonnet::plaintext($ccrole,$type);
! 487: my %roleshash = &Apache::lonnet::get_my_roles($cnum,$cdom,'','',[$ccrole]);
! 488: my (@local_ccs,%cc_status,%pname);
! 489: foreach my $item (keys(%roleshash)) {
! 490: my ($uname,$udom) = split(/:/,$item);
! 491: if (!grep(/^\Q$uname\E:\Q$udom\E$/,@local_ccs)) {
! 492: push(@local_ccs,$uname.':'.$udom);
! 493: $pname{$uname.':'.$udom} = &Apache::loncommon::plainname($uname,$udom);
! 494: $cc_status{$uname.':'.$udom} = $lt{'actv'};
1.1 raeburn 495: }
496: }
1.48 ! raeburn 497: if (($enrollvar{'courseowner'} ne '') &&
! 498: (!grep(/^$enrollvar{'courseowner'}$/,@local_ccs))) {
! 499: push(@local_ccs,$enrollvar{'courseowner'});
1.26 raeburn 500: my ($owneruname,$ownerdom) = split(/:/,$enrollvar{'courseowner'});
501: $pname{$enrollvar{'courseowner'}} =
502: &Apache::loncommon::plainname($owneruname,$ownerdom);
1.48 ! raeburn 503: my $active_cc = &Apache::loncommon::check_user_status($ownerdom,$owneruname,
! 504: $cdom,$cnum,$ccrole);
1.19 raeburn 505: if ($active_cc eq 'active') {
1.2 raeburn 506: $cc_status{$enrollvar{'courseowner'}} = $lt{'actv'};
1.1 raeburn 507: } else {
1.2 raeburn 508: $cc_status{$enrollvar{'courseowner'}} = $lt{'inac'};
1.1 raeburn 509: }
510: }
1.48 ! raeburn 511: @local_ccs = sort(@local_ccs);
! 512: if (@local_ccs == 0) {
! 513: $ownertable = $lt{'nocc'};
! 514: } else {
! 515: my $numlocalcc = scalar(@local_ccs);
! 516: $ownertable = '<input type="hidden" name="numlocalcc" value="'.$numlocalcc.'" />'.
! 517: &Apache::loncommon::start_data_table()."\n".
! 518: &Apache::loncommon::start_data_table_header_row()."\n".
! 519: '<th>'.$lt{'ownr'}.'</th>'.
! 520: '<th>'.$lt{'name'}.'</th>'.
! 521: '<th>'.$lt{'unme'}.'</th>'.
! 522: '<th>'.$lt{'stus'}.'</th>'.
! 523: &Apache::loncommon::end_data_table_header_row()."\n";
! 524: foreach my $cc (@local_ccs) {
! 525: $ownertable .= &Apache::loncommon::start_data_table_row()."\n";
! 526: if ($cc eq $enrollvar{'courseowner'}) {
! 527: $ownertable .= '<td><input type="radio" name="courseowner" value="'.$cc.'" checked="checked" /></td>'."\n";
! 528: } else {
! 529: $ownertable .= '<td><input type="radio" name="courseowner" value="'.$cc.'" /></td>'."\n";
! 530: }
! 531: $ownertable .=
! 532: '<td>'.$pname{$cc}.'</td>'."\n".
! 533: '<td>'.$cc.'</td>'."\n".
! 534: '<td>'.$cc_status{$cc}.' '.$ccname.'</td>'."\n".
! 535: &Apache::loncommon::end_data_table_row()."\n";
! 536: }
! 537: $ownertable .= &Apache::loncommon::end_data_table();
! 538: }
! 539: &print_header($r,$type,$javascript_validations);
! 540: my $dctitle = &Apache::lonnet::plaintext('dc');
! 541: my $mainheader = &modifiable_only_title($type);
! 542: my $hidden_elements = &hidden_form_elements();
! 543: $r->print('<form action="/adm/modifycourse" method="post" name="'.$env{'form.phase'}.'">'."\n".
! 544: '<h3>'.$mainheader.' <span class="LC_nobreak">'.$cdesc.'</span></h3><p>'.
! 545: &Apache::lonhtmlcommon::start_pick_box());
! 546: if ($type eq 'Community') {
! 547: $r->print(&Apache::lonhtmlcommon::row_title(
! 548: &Apache::loncommon::help_open_topic('Modify_Community_Owner').
! 549: ' '.&mt('Community Owner'))."\n");
! 550: } else {
! 551: $r->print(&Apache::lonhtmlcommon::row_title(
! 552: &Apache::loncommon::help_open_topic('Modify_Course_Instcode').
! 553: ' '.&mt('Course Code'))."\n".
! 554: '<input type="text" size="10" name="coursecode" value="'.$enrollvar{'coursecode'}.'" />'.
! 555: &Apache::lonhtmlcommon::row_closure().
! 556: &Apache::lonhtmlcommon::row_title(
! 557: &Apache::loncommon::help_open_topic('Modify_Course_Defaultauth').
! 558: ' '.&mt('Default Authentication method'))."\n".
! 559: $authenitems."\n".
! 560: &Apache::lonhtmlcommon::row_closure().
! 561: &Apache::lonhtmlcommon::row_title(
! 562: &Apache::loncommon::help_open_topic('Modify_Course_Owner').
! 563: ' '.&mt('Course Owner'))."\n");
! 564: }
! 565: $r->print($ownertable."\n".&Apache::lonhtmlcommon::row_closure(1).
! 566: &Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements.
! 567: '<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');');
! 568: if ($type eq 'Community') {
! 569: $r->print('this.form.submit();"');
! 570: } else {
! 571: $r->print('javascript:verify_message(this.form);"');
! 572: }
! 573: $r->print('value="'.$lt{'gobt'}.'" /></p></form>');
! 574: return;
! 575: }
! 576:
! 577: sub modifiable_only_title {
! 578: my ($type) = @_;
! 579: my $dctitle = &Apache::lonnet::plaintext('dc');
! 580: if ($type eq 'Community') {
! 581: return &mt('Community settings modifiable only by [_1] for:',$dctitle);
! 582: } else {
! 583: return &mt('Course settings modifiable only by [_1] for:',$dctitle);
! 584: }
! 585: }
1.24 albertel 586:
1.48 ! raeburn 587: sub gather_authenitems {
! 588: my ($cdom,$enrollvar) = @_;
1.28 raeburn 589: my ($krbdef,$krbdefdom)=&Apache::loncommon::get_kerberos_defaults($cdom);
1.2 raeburn 590: my $curr_authtype = '';
591: my $curr_authfield = '';
1.48 ! raeburn 592: if (ref($enrollvar) eq 'HASH') {
! 593: if ($enrollvar->{'authtype'} =~ /^krb/) {
! 594: $curr_authtype = 'krb';
! 595: } elsif ($enrollvar->{'authtype'} eq 'internal' ) {
! 596: $curr_authtype = 'int';
! 597: } elsif ($enrollvar->{'authtype'} eq 'localauth' ) {
! 598: $curr_authtype = 'loc';
! 599: }
1.2 raeburn 600: }
601: unless ($curr_authtype eq '') {
602: $curr_authfield = $curr_authtype.'arg';
1.33 raeburn 603: }
1.48 ! raeburn 604: my $javascript_validations =
! 605: &Apache::lonuserutils::javascript_validations('modifycourse',$krbdefdom,
! 606: $curr_authtype,$curr_authfield);
1.35 raeburn 607: my %param = ( formname => 'document.'.$env{'form.phase'},
1.48 ! raeburn 608: kerb_def_dom => $krbdefdom,
! 609: kerb_def_auth => $krbdef,
1.2 raeburn 610: mode => 'modifycourse',
611: curr_authtype => $curr_authtype,
1.48 ! raeburn 612: curr_autharg => $enrollvar->{'autharg'}
! 613: );
1.32 raeburn 614: my (%authform,$authenitems);
615: $authform{'krb'} = &Apache::loncommon::authform_kerberos(%param);
616: $authform{'int'} = &Apache::loncommon::authform_internal(%param);
617: $authform{'loc'} = &Apache::loncommon::authform_local(%param);
618: foreach my $item ('krb','int','loc') {
619: if ($authform{$item} ne '') {
620: $authenitems .= $authform{$item}.'<br />';
621: }
1.1 raeburn 622: }
1.48 ! raeburn 623: return($javascript_validations,$authenitems);
1.1 raeburn 624: }
625:
626: sub modify_course {
1.30 raeburn 627: my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
1.48 ! raeburn 628: my %longtype = &course_settings_descrip($type);
! 629: my @items = ('internal.courseowner','description');
! 630: unless ($type eq 'Community') {
! 631: push(@items,('internal.coursecode','internal.authtype','internal.autharg',
! 632: 'internal.sectionnums','internal.crosslistings'));
1.1 raeburn 633: }
1.48 ! raeburn 634: my %settings = &Apache::lonnet::get('environment',\@items,$cdom,$cnum);
! 635: my $description = $settings{'description'};
! 636: my ($ccrole,$response,$chgresponse,$nochgresponse,$reply,%currattr,%newattr,%cenv,%changed,
! 637: @changes,@nochanges,@sections,@xlists,@warnings);
! 638: my @modifiable_params = &get_dc_settable($type);
1.28 raeburn 639: foreach my $param (@modifiable_params) {
1.48 ! raeburn 640: $currattr{$param} = $settings{'internal.'.$param};
1.1 raeburn 641: }
1.48 ! raeburn 642: if ($type eq 'Community') {
! 643: %changed = ( owner => 0 );
! 644: $ccrole = 'co';
! 645: } else {
! 646: %changed = ( code => 0,
! 647: owner => 0,
! 648: );
! 649: $ccrole = 'cc';
! 650: unless ($settings{'internal.sectionnums'} eq '') {
! 651: if ($settings{'internal.sectionnums'} =~ m/,/) {
! 652: @sections = split/,/,$settings{'internal.sectionnums'};
! 653: } else {
! 654: $sections[0] = $settings{'internal.sectionnums'};
! 655: }
! 656: }
! 657: unless ($settings{'internal.crosslistings'} eq'') {
! 658: if ($settings{'internal.crosslistings'} =~ m/,/) {
! 659: @xlists = split/,/,$settings{'internal.crosslistings'};
! 660: } else {
! 661: $xlists[0] = $settings{'internal.crosslistings'};
! 662: }
! 663: }
! 664: if ($env{'form.login'} eq 'krb') {
! 665: $newattr{'authtype'} = $env{'form.login'};
! 666: $newattr{'authtype'} .= $env{'form.krbver'};
! 667: $newattr{'autharg'} = $env{'form.krbarg'};
! 668: } elsif ($env{'form.login'} eq 'int') {
! 669: $newattr{'authtype'} ='internal';
! 670: if ((defined($env{'form.intarg'})) && ($env{'form.intarg'})) {
! 671: $newattr{'autharg'} = $env{'form.intarg'};
! 672: }
! 673: } elsif ($env{'form.login'} eq 'loc') {
! 674: $newattr{'authtype'} = 'localauth';
! 675: if ((defined($env{'form.locarg'})) && ($env{'form.locarg'})) {
! 676: $newattr{'autharg'} = $env{'form.locarg'};
! 677: }
! 678: }
! 679: if ( $newattr{'authtype'}=~ /^krb/) {
! 680: if ($newattr{'autharg'} eq '') {
! 681: push(@warnings,
! 682: &mt('As you did not include the default Kerberos domain'
1.45 bisitz 683: .' to be used for authentication in this class, the'
684: .' institutional data used by the automated'
685: .' enrollment process must include the Kerberos'
1.48 ! raeburn 686: .' domain for each new student.'));
! 687: }
! 688: }
! 689:
! 690: if ( exists($env{'form.coursecode'}) ) {
! 691: $newattr{'coursecode'}=$env{'form.coursecode'};
! 692: unless ( $newattr{'coursecode'} eq $currattr{'coursecode'} ) {
! 693: $changed{'code'} = 1;
! 694: }
1.1 raeburn 695: }
696: }
697:
1.16 albertel 698: if ( exists($env{'form.courseowner'}) ) {
699: $newattr{'courseowner'}=$env{'form.courseowner'};
1.14 raeburn 700: unless ( $newattr{'courseowner'} eq $currattr{'courseowner'} ) {
1.38 raeburn 701: $changed{'owner'} = 1;
1.1 raeburn 702: }
703: }
1.48 ! raeburn 704:
1.38 raeburn 705: if ($changed{'owner'} || $changed{'code'}) {
706: my %crsinfo = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',$cnum,
707: undef,undef,'.');
708: if (ref($crsinfo{$env{'form.pickedcourse'}}) eq 'HASH') {
1.48 ! raeburn 709: if ($changed{'code'}) {
! 710: $crsinfo{$env{'form.pickedcourse'}}{'inst_code'} = $env{'form.coursecode'};
! 711: }
! 712: if ($changed{'owner'}) {
! 713: $crsinfo{$env{'form.pickedcourse'}}{'owner'} = $env{'form.courseowner'};
! 714: }
1.38 raeburn 715: my $chome = &Apache::lonnet::homeserver($cnum,$cdom);
716: my $putres = &Apache::lonnet::courseidput($cdom,\%crsinfo,$chome,'notime');
717: }
1.14 raeburn 718: }
1.28 raeburn 719: foreach my $param (@modifiable_params) {
720: if ($currattr{$param} eq $newattr{$param}) {
721: push(@nochanges,$param);
1.1 raeburn 722: } else {
1.48 ! raeburn 723: $cenv{'internal.'.$param} = $newattr{$param};
1.28 raeburn 724: push(@changes,$param);
1.1 raeburn 725: }
726: }
727: if (@changes > 0) {
1.48 ! raeburn 728: $chgresponse = &mt("The following settings have been changed:<br/><ul>");
1.1 raeburn 729: }
1.48 ! raeburn 730: if (@nochanges > 0) {
! 731: $nochgresponse = &mt("The following settings remain unchanged:<br/><ul>");
1.1 raeburn 732: }
1.33 raeburn 733: if (@changes > 0) {
1.28 raeburn 734: my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom,$cnum);
1.1 raeburn 735: if ($putreply !~ /^ok$/) {
1.48 ! raeburn 736: $response = '<p class="LC_error">'.
! 737: &mt('There was a problem processing your requested changes.').'<br />';
! 738: if ($type eq 'Community') {
! 739: $response .= &mt('Settings for this community have been left unchanged.');
! 740: } else {
! 741: $response .= &mt('Settings for this course have been left unchanged.');
! 742: }
! 743: $response .= '<br/>'.&mt('Error: ').$putreply.'</p>';
1.1 raeburn 744: } else {
1.28 raeburn 745: foreach my $attr (@modifiable_params) {
1.48 ! raeburn 746: if (grep/^\Q$attr\E$/,@changes) {
! 747: $chgresponse .= '<li>'.$longtype{$attr}.' '.&mt('now set to:').' "'.$newattr{$attr}.'".</li>';
1.1 raeburn 748: } else {
1.48 ! raeburn 749: $nochgresponse .= '<li>'.$longtype{$attr}.' '.&mt('still set to:').' "'.$currattr{$attr}.'".</li>';
1.1 raeburn 750: }
751: }
1.48 ! raeburn 752: if (($type ne 'Community') && ($changed{'code'} || $changed{'owner'})) {
1.1 raeburn 753: if ( $newattr{'courseowner'} eq '') {
1.48 ! raeburn 754: push(@warnings,&mt('There is no owner associated with this LON-CAPA course.').
! 755: '<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.'));
1.1 raeburn 756: } else {
757: if (@sections > 0) {
1.38 raeburn 758: if ($changed{'code'}) {
1.2 raeburn 759: foreach my $sec (@sections) {
760: if ($sec =~ m/^(.+):/) {
1.48 ! raeburn 761: my $instsec = $1;
1.8 raeburn 762: my $inst_course_id = $newattr{'coursecode'}.$1;
1.28 raeburn 763: my $course_check = &Apache::lonnet::auto_validate_courseID($cnum,$cdom,$inst_course_id);
1.7 raeburn 764: if ($course_check eq 'ok') {
1.28 raeburn 765: my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'});
1.48 ! raeburn 766: unless ($outcome eq 'ok') {
! 767:
! 768: push(@warnings,&mt('If automatic enrollment is enabled for "[_1]" automated enrollment may fail for "[_2]" - section: [_3], for the following reason: "[_4]"',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>');
1.1 raeburn 769: }
770: } else {
1.48 ! raeburn 771: push(@warnings,&mt('If automatic enrollment is enabled for "[_1]" automated enrollment may fail for "[_2]" - section: [_3], for the following reason: "[_4]"',$description,$newattr{'coursecode'},$instsec,$course_check));
1.1 raeburn 772: }
773: } else {
1.48 ! raeburn 774: push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3], because this is not a valid section entry.',$description,$newattr{'coursecode'},$sec));
1.1 raeburn 775: }
776: }
1.38 raeburn 777: } elsif ($changed{'owner'}) {
1.4 raeburn 778: foreach my $sec (@sections) {
779: if ($sec =~ m/^(.+):/) {
1.48 ! raeburn 780: my $instsec = $1;
! 781: my $inst_course_id = $newattr{'coursecode'}.$instsec;
1.28 raeburn 782: my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'});
1.4 raeburn 783: unless ($outcome eq 'ok') {
1.48 ! raeburn 784: push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome));
1.4 raeburn 785: }
786: } else {
1.48 ! raeburn 787: push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section [_3] because this is not a valid section entry.',$description,$newattr{'coursecode'},$sec));
1.4 raeburn 788: }
789: }
790: }
1.1 raeburn 791: } else {
1.48 ! raeburn 792: push(@warnings,&mt('As no section numbers are currently listed for "[_1]" automated enrollment will not occur for any sections of institutional course code: "[_2]".',$description,$newattr{'coursecode'}));
1.1 raeburn 793: }
1.38 raeburn 794: if ( (@xlists > 0) && ($changed{'owner'}) ) {
1.1 raeburn 795: foreach my $xlist (@xlists) {
796: if ($xlist =~ m/^(.+):/) {
1.48 ! raeburn 797: my $instxlist = $1;
! 798: my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$instxlist,$newattr{'courseowner'});
1.1 raeburn 799: unless ($outcome eq 'ok') {
1.48 ! raeburn 800: push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for crosslisted class "[_2]" for the following reason: "[_3]".',$description,$instxlist,$outcome));
1.1 raeburn 801: }
1.28 raeburn 802: }
1.1 raeburn 803: }
804: }
805: }
806: }
807: }
1.2 raeburn 808: } else {
1.28 raeburn 809: foreach my $attr (@modifiable_params) {
1.48 ! raeburn 810: $nochgresponse .= '<li>'.$longtype{$attr}.' '.&mt('still set to').' "'.$currattr{$attr}.'".</li>';
1.2 raeburn 811: }
1.1 raeburn 812: }
813:
814: if (@changes > 0) {
815: $chgresponse .= "</ul><br/><br/>";
816: }
817: if (@nochanges > 0) {
818: $nochgresponse .= "</ul><br/><br/>";
819: }
1.48 ! raeburn 820: my ($warning,$numwarnings);
! 821: my $numwarnings = scalar(@warnings);
! 822: if ($numwarnings) {
! 823: $warning = &mt('The following [quant,_1,warning was,warnings were] generated when applying your changes to automated enrollment:',$numwarnings).'<p><ul>';
! 824: foreach my $warn (@warnings) {
! 825: $warning .= '<li><span class="LC_warning">'.$warn.'</span></li>';
! 826: }
! 827: $warning .= '</ul></p>';
1.1 raeburn 828: }
1.48 ! raeburn 829: if ($response) {
! 830: $reply = $response;
! 831: } else {
1.1 raeburn 832: $reply = $chgresponse.$nochgresponse.$warning;
833: }
1.48 ! raeburn 834: &print_header($r,$type);
! 835: my $mainheader = &modifiable_only_title($type);
! 836: $reply = '<h3>'.$mainheader.' <span class="LC_nobreak">'.$cdesc.'</span></h3>'."\n".
! 837: '<p>'.$reply.'</p>'."\n".
1.28 raeburn 838: '<form action="/adm/modifycourse" method="post" name="processparms">'.
839: &hidden_form_elements().
1.48 ! raeburn 840: '<a href="javascript:changePage(document.processparms,'."'menu'".')">'.
! 841: &mt('Pick another action').'</a>';
! 842: if ($numwarnings) {
! 843: my $newrole = $ccrole.'./'.$cdom.'/'.$cnum;
! 844: my $escuri = &HTML::Entities::encode('/adm/roles?selectrole=1&'.$newrole.
! 845: '=1&destinationurl=/adm/populate','&<>"');
! 846:
! 847: $reply .= '<br /><a href="'.$escuri.'">'.
! 848: &mt('Go to Automated Enrollment Manager for course').'</a>';
! 849: }
! 850: $reply .= '</form>';
1.3 raeburn 851: $r->print($reply);
1.28 raeburn 852: return;
853: }
854:
855: sub modify_quota {
1.48 ! raeburn 856: my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
! 857: &print_header($r,$type);
! 858: $r->print('<form action="/adm/modifycourse" method="post" name="processquota">'."\n".
! 859: '<h3>'.&mt('Disk space for storage of group portfolio files for:').
! 860: ' <span class="LC_nobreak">'.$cdesc.'</span></h3><br />');
1.28 raeburn 861: my %oldsettings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum);
862: my $defaultquota = 20;
863: if ($env{'form.coursequota'} ne '') {
864: my $newquota = $env{'form.coursequota'};
865: if ($newquota =~ /^\s*(\d+\.?\d*|\.\d+)\s*$/) {
866: $newquota = $1;
867: if ($oldsettings{'internal.coursequota'} eq $env{'form.coursequota'}) {
1.48 ! raeburn 868: $r->print(&mt('The disk space allocated for group portfolio files remains unchanged as [_1] Mb.',$env{'form.coursequota'}));
1.28 raeburn 869: } else {
870: my %cenv = (
871: 'internal.coursequota' => $env{'form.coursequota'},
872: );
873: my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom,
874: $cnum);
875: if (($oldsettings{'internal.coursequota'} eq '') &&
876: ($env{'form.coursequota'} == $defaultquota)) {
1.48 ! raeburn 877: if ($type eq 'Community') {
! 878: $r->print(&mt('The disk space allocated for group portfolio files in this community is the default quota for this domain: [_1] Mb.',$defaultquota));
! 879: } else {
! 880: $r->print(&mt('The disk space allocated for group portfolio files in this course is the default quota for this domain: [_1] Mb.',$defaultquota));
! 881: }
1.28 raeburn 882: } else {
883: if ($putreply eq 'ok') {
884: my %updatedsettings = &Apache::lonnet::get('environment',['internal.coursequota'],$cdom,$cnum);
1.48 ! raeburn 885: $r->print(&mt('The disk space allocated for group portfolio files is now: [_1] Mb.',$updatedsettings{'internal.coursequota'}));
1.28 raeburn 886: my $usage = &Apache::longroup::sum_quotas($cdom.'_'.$cnum);
887: if ($usage >= $updatedsettings{'internal.coursequota'}) {
888: my $newoverquota;
889: if ($usage < $oldsettings{'internal.coursequota'}) {
890: $newoverquota = 'now';
891: }
1.48 ! raeburn 892: $r->print('<p>');
! 893: if ($type eq 'Community') {
! 894: $r->print(&mt('Disk usage [_1] exceeds the quota for this community.',$newoverquota).' '.
! 895: &mt('Upload of new portfolio files and assignment of a non-zero Mb quota to new groups in the community will not be possible until some files have been deleted, and total usage is below community quota.'));
! 896: } else {
! 897: $r->print(&mt('Disk usage [_1] exceeds the quota for this course.',$newoverquota).' '.
! 898: &mt('Upload of new portfolio files and assignment of a non-zero Mb quota to new groups in the course will not be possible until some files have been deleted, and total usage is below course quota.'));
! 899: }
! 900: $r->print('</p>');
1.28 raeburn 901: }
902: } else {
1.48 ! raeburn 903: $r->print(&mt('An error occurred storing the quota for group portfolio files: ').
! 904: $putreply);
1.28 raeburn 905: }
906: }
907: }
908: } else {
909: $r->print(&mt('The new quota requested contained invalid characters, so the quota is unchanged.'));
910: }
911: }
1.48 ! raeburn 912: $r->print('<p>'.
! 913: '<a href="javascript:changePage(document.processquota,'."'menu'".')">'.
! 914: &mt('Pick another action').'</a>');
1.28 raeburn 915: $r->print(&hidden_form_elements().'</form>');
916: return;
1.1 raeburn 917: }
918:
1.38 raeburn 919: sub modify_catsettings {
1.48 ! raeburn 920: my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_;
! 921: &print_header($r,$type);
! 922: my ($ccrole,%desc);
! 923: if ($type eq 'Community') {
! 924: $desc{'hidefromcat'} = &mt('Excluded from community catalog');
! 925: $desc{'categories'} = &mt('Assigned categories for this community');
! 926: $ccrole = 'co';
! 927: } else {
! 928: $desc{'hidefromcat'} = &mt('Excluded from course catalog');
! 929: $desc{'categories'} = &mt('Assigned categories for this course');
! 930: $ccrole = 'cc';
! 931: }
1.38 raeburn 932: $r->print('
933: <form action="/adm/modifycourse" method="post" name="processcat">
934: <h3>'.&mt('Category settings').'</h3>');
935: my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
936: my @cat_params = &catalog_settable($domconf{'coursecategories'});
937: if (@cat_params > 0) {
938: my (%cenv,@changes,@nochanges);
939: my %currsettings =
940: &Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum);
941: my (@newcategories,%showitem);
942: if (grep(/^togglecats$/,@cat_params)) {
943: if ($currsettings{'hidefromcat'} ne $env{'form.hidefromcat'}) {
944: push(@changes,'hidefromcat');
945: $cenv{'hidefromcat'} = $env{'form.hidefromcat'};
946: } else {
947: push(@nochanges,'hidefromcat');
948: }
949: if ($env{'form.hidefromcat'} eq 'yes') {
950: $showitem{'hidefromcat'} = '"'.&mt('Yes')."'";
951: } else {
952: $showitem{'hidefromcat'} = '"'.&mt('No').'"';
953: }
954: }
955: if (grep(/^categorize$/,@cat_params)) {
956: my (@cats,@trails,%allitems,%idx,@jsarray);
957: if (ref($domconf{'coursecategories'}) eq 'HASH') {
958: my $cathash = $domconf{'coursecategories'}{'cats'};
959: if (ref($cathash) eq 'HASH') {
960: &Apache::loncommon::extract_categories($cathash,\@cats,\@trails,
961: \%allitems,\%idx,\@jsarray);
962: }
963: }
964: @newcategories = &Apache::loncommon::get_env_multiple('form.usecategory');
965: if (@newcategories == 0) {
966: $showitem{'categories'} = '"'.&mt('None').'"';
967: } else {
968: $showitem{'categories'} = '<ul>';
969: foreach my $item (@newcategories) {
970: $showitem{'categories'} .= '<li>'.$trails[$allitems{$item}].'</li>';
971: }
972: $showitem{'categories'} .= '</ul>';
973: }
974: my $catchg = 0;
975: if ($currsettings{'categories'} ne '') {
976: my @currcategories = split('&',$currsettings{'categories'});
977: foreach my $cat (@currcategories) {
978: if (!grep(/^\Q$cat\E$/,@newcategories)) {
979: $catchg = 1;
980: last;
981: }
982: }
983: if (!$catchg) {
984: foreach my $cat (@newcategories) {
985: if (!grep(/^\Q$cat\E$/,@currcategories)) {
986: $catchg = 1;
987: last;
988: }
989: }
990: }
991: } else {
992: if (@newcategories > 0) {
993: $catchg = 1;
994: }
995: }
996: if ($catchg) {
997: $cenv{'categories'} = join('&',@newcategories);
998: push(@changes,'categories');
999: } else {
1000: push(@nochanges,'categories');
1001: }
1002: if (@changes > 0) {
1003: my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom,$cnum);
1004: if ($putreply eq 'ok') {
1005: my %crsinfo = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',
1006: $cnum,undef,undef,'.');
1007: if (ref($crsinfo{$env{'form.pickedcourse'}}) eq 'HASH') {
1008: if (grep(/^hidefromcat$/,@changes)) {
1009: $crsinfo{$env{'form.pickedcourse'}}{'hidefromcat'} = $env{'form.hidefromcat'};
1010: }
1011: if (grep(/^categories$/,@changes)) {
1012: $crsinfo{$env{'form.pickedcourse'}}{'categories'} = $cenv{'categories'};
1013: }
1014: my $chome = &Apache::lonnet::homeserver($cnum,$cdom);
1015: my $putres = &Apache::lonnet::courseidput($cdom,\%crsinfo,$chome,'notime');
1016: }
1.48 ! raeburn 1017: $r->print(&mt('The following changes occurred:').'<ul>');
1.38 raeburn 1018: foreach my $item (@changes) {
1.48 ! raeburn 1019: $r->print('<li>'.&mt('[_1] now set to: [_2]',$desc{$item},$showitem{$item}).'</li>');
1.38 raeburn 1020: }
1021: $r->print('</ul><br />');
1022: }
1023: }
1024: if (@nochanges > 0) {
1.48 ! raeburn 1025: $r->print(&mt('The following were unchanged:').'<ul>');
1.38 raeburn 1026: foreach my $item (@nochanges) {
1.48 ! raeburn 1027: $r->print('<li>'.&mt('[_1] still set to: [_2]',$desc{$item},$showitem{$item}).'</li>');
1.38 raeburn 1028: }
1029: $r->print('</ul>');
1030: }
1031: }
1032: } else {
1.48 ! raeburn 1033: my $newrole = $ccrole.'./'.$cdom.'/'.$cnum;
! 1034: my $escuri = &HTML::Entities::encode('/adm/roles?selectrole=1&'.$newrole.
! 1035: '=1&destinationurl=/adm/courseprefs','&<>"');
! 1036: if ($type eq 'Community') {
! 1037: $r->print(&mt('Category settings for communities in this domain should be modified in community context (via "[_1]Community Configuration[_2]").','<a href="$escuri">','</a>').'<br />');
! 1038: } else {
! 1039: $r->print(&mt('Category settings for courses in this domain should be modified in course context (via "[_1]Course Configuration[_2]").','<a href="$escuri">','</a>').'<br />');
! 1040: }
1.38 raeburn 1041: }
1042: $r->print('<br />'."\n".
1043: '<a href="javascript:changePage(document.processcat,'."'menu'".')">'.
1.48 ! raeburn 1044: &mt('Pick another action').'</a>');
1.38 raeburn 1045: $r->print(&hidden_form_elements().'</form>');
1046: return;
1047: }
1048:
1.1 raeburn 1049: sub print_header {
1.48 ! raeburn 1050: my ($r,$type,$javascript_validations) = @_;
1.28 raeburn 1051: my $phase = "start";
1052: if ( exists($env{'form.phase'}) ) {
1053: $phase = $env{'form.phase'};
1054: }
1055: my $js = qq|
1056: <script type="text/javascript">
1057: function changePage(formname,newphase) {
1058: formname.phase.value = newphase;
1059: if (newphase == 'processparms') {
1060: return;
1.1 raeburn 1061: }
1.28 raeburn 1062: formname.submit();
1063: }
1064: </script>
1065: |;
1066: if ($phase eq 'setparms') {
1067: $js .= qq|
1068: <script type="text/javascript">
1069: $javascript_validations
1070: </script>
1071: |;
1072: } elsif ($phase eq 'courselist') {
1073: $js .= qq|
1074: <script type="text/javascript">
1075: function gochoose(cname,cdom,cdesc) {
1076: document.courselist.pickedcourse.value = cdom+'_'+cname;
1077: document.courselist.submit();
1078: }
1079: </script>
1080: |;
1081: } elsif ($phase eq 'setquota') {
1082: $js .= <<'ENDSCRIPT';
1083: <script type="text/javascript">
1084: function verify_quota(formname) {
1085: var newquota = formname.coursequota.value;
1086: var num_reg = /^\s*(\d+\.?\d*|\.\d+)\s*$/;
1087: if (num_reg.test(newquota)) {
1088: changePage(formname,'processquota');
1.1 raeburn 1089: } else {
1.28 raeburn 1090: alert("The quota you entered contained invalid characters.\nYou must enter a number");
1.1 raeburn 1091: }
1.28 raeburn 1092: return;
1093: }
1094: </script>
1095: ENDSCRIPT
1.1 raeburn 1096: }
1.37 raeburn 1097: my $starthash;
1098: if ($env{'form.phase'} eq 'ccrole') {
1099: $starthash = {
1100: add_entries => {'onload' => "javascript:document.ccrole.submit();"},
1101: };
1102: }
1.48 ! raeburn 1103: $r->print(&Apache::loncommon::start_page('View/Modify Course/Community Settings',
1.37 raeburn 1104: $js,$starthash));
1.48 ! raeburn 1105: my $bread_text = "View/Modify Courses/Communities";
! 1106: if ($type eq 'Community') {
! 1107: $bread_text = 'Community Settings';
1.41 raeburn 1108: } else {
1.48 ! raeburn 1109: $bread_text = 'Course Settings';
1.41 raeburn 1110: }
1.48 ! raeburn 1111: $r->print(&Apache::lonhtmlcommon::breadcrumbs($bread_text));
1.5 raeburn 1112: return;
1.1 raeburn 1113: }
1114:
1115: sub print_footer {
1.23 albertel 1116: my ($r) = @_;
1117: $r->print('<br />'.&Apache::loncommon::end_page());
1.5 raeburn 1118: return;
1.3 raeburn 1119: }
1120:
1121: sub check_course {
1.28 raeburn 1122: my ($r,$dom,$domdesc) = @_;
1123: my ($ok_course,$description,$instcode,$owner);
1.35 raeburn 1124: my %args = (
1125: one_time => 1,
1126: );
1127: my %coursehash =
1128: &Apache::lonnet::coursedescription($env{'form.pickedcourse'},\%args);
1129: my $cnum = $coursehash{'num'};
1130: my $cdom = $coursehash{'domain'};
1131: if ($cdom eq $dom) {
1132: my $description;
1133: my %courseIDs = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',
1.38 raeburn 1134: $cnum,undef,undef,'.');
1.35 raeburn 1135: if (keys(%courseIDs) > 0) {
1136: $ok_course = 'ok';
1137: my ($instcode,$owner);
1138: if (ref($courseIDs{$cdom.'_'.$cnum}) eq 'HASH') {
1139: $description = $courseIDs{$cdom.'_'.$cnum}{'description'};
1140: $instcode = $courseIDs{$cdom.'_'.$cnum}{'inst_code'};
1141: $owner = $courseIDs{$cdom.'_'.$cnum}{'owner'};
1142: } else {
1143: ($description,$instcode,$owner) =
1144: split(/:/,$courseIDs{$cdom.'_'.$cnum});
1145: }
1146: $description = &unescape($description);
1147: $instcode = &unescape($instcode);
1148: if ($instcode) {
1149: $description .= " ($instcode)";
1.5 raeburn 1150: }
1.35 raeburn 1151: return ($ok_course,$description);
1.3 raeburn 1152: }
1153: }
1.1 raeburn 1154: }
1155:
1.28 raeburn 1156: sub course_settings_descrip {
1.48 ! raeburn 1157: my ($type) = @_;
! 1158: my %longtype;
! 1159: if ($type eq 'Community') {
! 1160: %longtype = &Apache::lonlocal::texthash(
! 1161: 'courseowner' => "Username:domain of community owner",
! 1162: );
! 1163:
! 1164: } else {
! 1165: %longtype = &Apache::lonlocal::texthash(
1.28 raeburn 1166: 'authtype' => 'Default authentication method',
1167: 'autharg' => 'Default authentication parameter',
1168: 'autoadds' => 'Automated adds',
1169: 'autodrops' => 'Automated drops',
1170: 'autostart' => 'Date of first automated enrollment',
1171: 'autoend' => 'Date of last automated enrollment',
1172: 'default_enrollment_start_date' => 'Date of first student access',
1173: 'default_enrollment_end_date' => 'Date of last student access',
1174: 'coursecode' => 'Official course code',
1175: 'courseowner' => "Username:domain of course owner",
1176: 'notifylist' => 'Course Coordinators to be notified of enrollment changes',
1.48 ! raeburn 1177: 'sectionnums' => 'Course section number:LON-CAPA section',
! 1178: 'crosslistings' => 'Crosslisted class:LON-CAPA section',
! 1179: );
! 1180: }
1.28 raeburn 1181: return %longtype;
1182: }
1183:
1184: sub hidden_form_elements {
1185: my $hidden_elements =
1.46 raeburn 1186: &Apache::lonhtmlcommon::echo_form_input(['gosearch','updater','coursecode',
1.37 raeburn 1187: 'prevphase','numlocalcc','courseowner','login','coursequota','intarg',
1.38 raeburn 1188: 'locarg','krbarg','krbver','counter','hidefromcat','usecategory'])."\n".
1.37 raeburn 1189: '<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />';
1.28 raeburn 1190: return $hidden_elements;
1191: }
1.1 raeburn 1192:
1193: sub handler {
1194: my $r = shift;
1195: if ($r->header_only) {
1196: &Apache::loncommon::content_type($r,'text/html');
1197: $r->send_http_header;
1198: return OK;
1199: }
1.28 raeburn 1200: my $dom = $env{'request.role.domain'};
1.31 albertel 1201: my $domdesc = &Apache::lonnet::domain($dom,'description');
1.28 raeburn 1202: if (&Apache::lonnet::allowed('ccc',$dom)) {
1.1 raeburn 1203: &Apache::loncommon::content_type($r,'text/html');
1204: $r->send_http_header;
1205:
1.28 raeburn 1206: &Apache::lonhtmlcommon::clear_breadcrumbs();
1207:
1208: my $phase = $env{'form.phase'};
1.46 raeburn 1209: if ($env{'form.updater'}) {
1210: $phase = '';
1211: }
1.37 raeburn 1212: if ($phase eq '') {
1213: &Apache::lonhtmlcommon::add_breadcrumb
1.28 raeburn 1214: ({href=>"/adm/modifycourse",
1.48 ! raeburn 1215: text=>"Course/Community search"});
1.28 raeburn 1216: &print_course_search_page($r,$dom,$domdesc);
1.1 raeburn 1217: } else {
1.37 raeburn 1218: my $firstform = $phase;
1219: if ($phase eq 'courselist') {
1220: $firstform = 'filterpicker';
1.48 ! raeburn 1221: }
! 1222: my $choose_text;
! 1223: my $type = $env{'form.type'};
! 1224: if ($type eq '') {
! 1225: $type = 'Course';
! 1226: }
! 1227: if ($type eq 'Community') {
! 1228: $choose_text = "Choose a community";
! 1229: } else {
! 1230: $choose_text = "Choose a course";
1.37 raeburn 1231: }
1.28 raeburn 1232: &Apache::lonhtmlcommon::add_breadcrumb
1.37 raeburn 1233: ({href=>"javascript:changePage(document.$firstform,'')",
1.48 ! raeburn 1234: text=>"Course/Community search"},
1.37 raeburn 1235: {href=>"javascript:changePage(document.$phase,'courselist')",
1.48 ! raeburn 1236: text=>$choose_text});
1.28 raeburn 1237: if ($phase eq 'courselist') {
1238: &print_course_selection_page($r,$dom,$domdesc);
1239: } else {
1240: my ($checked,$cdesc) = &check_course($r,$dom,$domdesc);
1241: if ($checked eq 'ok') {
1.48 ! raeburn 1242: my $enter_text;
! 1243: if ($type eq 'Community') {
! 1244: $enter_text = 'Enter community';
! 1245: } else {
! 1246: $enter_text = 'Enter course';
! 1247: }
1.28 raeburn 1248: if ($phase eq 'menu') {
1.37 raeburn 1249: &Apache::lonhtmlcommon::add_breadcrumb
1250: ({href=>"javascript:changePage(document.$phase,'menu')",
1251: text=>"Pick action"});
1.48 ! raeburn 1252: &print_modification_menu($r,$cdesc,$domdesc,$dom,$type);
1.37 raeburn 1253: } elsif ($phase eq 'ccrole') {
1254: &Apache::lonhtmlcommon::add_breadcrumb
1255: ({href=>"javascript:changePage(document.$phase,'ccrole')",
1.48 ! raeburn 1256: text=>$enter_text});
! 1257: &print_ccrole_selected($r,$type);
1.28 raeburn 1258: } else {
1.37 raeburn 1259: &Apache::lonhtmlcommon::add_breadcrumb
1260: ({href=>"javascript:changePage(document.$phase,'menu')",
1261: text=>"Pick action"});
1.28 raeburn 1262: my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'});
1263: if ($phase eq 'setquota') {
1264: &Apache::lonhtmlcommon::add_breadcrumb
1265: ({href=>"javascript:changePage(document.$phase,'$phase')",
1266: text=>"Set quota"});
1.38 raeburn 1267: &print_setquota($r,$cdom,$cnum,$cdesc,$type);
1.28 raeburn 1268: } elsif ($phase eq 'processquota') {
1269: &Apache::lonhtmlcommon::add_breadcrumb
1270: ({href=>"javascript:changePage(document.$phase,'setquota')",
1271: text=>"Set quota"});
1272: &Apache::lonhtmlcommon::add_breadcrumb
1273: ({href=>"javascript:changePage(document.$phase,'$phase')",
1274: text=>"Result"});
1.48 ! raeburn 1275: &modify_quota($r,$cdom,$cnum,$cdesc,$domdesc,$type);
1.28 raeburn 1276: } elsif ($phase eq 'viewparms') {
1277: &Apache::lonhtmlcommon::add_breadcrumb
1278: ({href=>"javascript:changePage(document.$phase,'viewparms')",
1279: text=>"Display settings"});
1280: &print_settings_display($r,$cdom,$cnum,$cdesc,$type);
1281: } elsif ($phase eq 'setparms') {
1282: &Apache::lonhtmlcommon::add_breadcrumb
1283: ({href=>"javascript:changePage(document.$phase,'$phase')",
1284: text=>"Change settings"});
1.48 ! raeburn 1285: &print_course_modification_page($r,$cdom,$cnum,$cdesc,$type);
1.28 raeburn 1286: } elsif ($phase eq 'processparms') {
1287: &Apache::lonhtmlcommon::add_breadcrumb
1288: ({href=>"javascript:changePage(document.$phase,'setparms')",
1289: text=>"Change settings"});
1290: &Apache::lonhtmlcommon::add_breadcrumb
1291: ({href=>"javascript:changePage(document.$phase,'$phase')",
1292: text=>"Result"});
1.30 raeburn 1293: &modify_course($r,$cdom,$cnum,$cdesc,$domdesc,$type);
1.38 raeburn 1294: } elsif ($phase eq 'catsettings') {
1295: &Apache::lonhtmlcommon::add_breadcrumb
1296: ({href=>"javascript:changePage(document.$phase,'$phase')",
1297: text=>"Catalog settings"});
1298: &print_catsettings($r,$cdom,$cnum,$cdesc,$type);
1299: } elsif ($phase eq 'processcat') {
1300: &Apache::lonhtmlcommon::add_breadcrumb
1301: ({href=>"javascript:changePage(document.$phase,'catsettings')",
1302: text=>"Catalog settings"});
1303: &Apache::lonhtmlcommon::add_breadcrumb
1304: ({href=>"javascript:changePage(document.$phase,'$phase')",
1305: text=>"Result"});
1.48 ! raeburn 1306: &modify_catsettings($r,$cdom,$cnum,$cdesc,$domdesc,$type);
1.28 raeburn 1307: }
1308: }
1309: } else {
1.48 ! raeburn 1310: $r->print('<span class="LC_error">');
! 1311: if ($type eq 'Community') {
! 1312: $r->print(&mt('The course you selected is not a valid course in this domain'));
! 1313: } else {
! 1314: $r->print(&mt('The community you selected is not a valid community in this domain'));
! 1315: }
! 1316: $r->print(" ($domdesc)</span>");
1.28 raeburn 1317: }
1318: }
1.1 raeburn 1319: }
1.28 raeburn 1320: &print_footer($r);
1.1 raeburn 1321: } else {
1.16 albertel 1322: $env{'user.error.msg'}=
1.48 ! raeburn 1323: "/adm/modifycourse:ccc:0:0:Cannot modify course/community settings";
1.1 raeburn 1324: return HTTP_NOT_ACCEPTABLE;
1325: }
1326: return OK;
1327: }
1328:
1329: 1;
1330: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>