--- loncom/interface/loncreateuser.pm 2010/10/08 01:59:39 1.351 +++ loncom/interface/loncreateuser.pm 2013/02/06 16:10:27 1.373 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.351 2010/10/08 01:59:39 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.373 2013/02/06 16:10:27 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -111,11 +111,11 @@ sub initialize_authen_forms { sub auth_abbrev { my %abv_auth = ( - krb5 => 'krb', - krb4 => 'krb', - internal => 'int', - localuth => 'loc', - unix => 'fsys', + krb5 => 'krb', + krb4 => 'krb', + internal => 'int', + localauth => 'loc', + unix => 'fsys', ); return %abv_auth; } @@ -223,6 +223,7 @@ sub build_tools_display { my %lt = &Apache::lonlocal::texthash ( 'blog' => "Personal User Blog", 'aboutme' => "Personal Information Page", + 'webdav' => "WebDAV access to authoring spaces (if SSL and author/co-author)", 'portfolio' => "Personal User Portfolio", 'avai' => "Available", 'cusa' => "availability", @@ -232,6 +233,7 @@ sub build_tools_display { 'official' => 'Can request creation of official courses', 'unofficial' => 'Can request creation of unofficial courses', 'community' => 'Can request creation of communities', + 'requestauthor' => 'Can request author space', ); if ($context eq 'requestcourses') { %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, @@ -246,10 +248,21 @@ sub build_tools_display { %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain); $isadv = &Apache::lonnet::is_advanced_user($ccuname,$ccdomain); + } elsif ($context eq 'requestauthor') { + %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, + 'requestauthor'); + @usertools = ('requestauthor'); + @options =('norequest','approval','automatic'); + %reqtitles = &requestauthor_titles(); + %reqdisplay = &requestauthor_display(); + $colspan = ' colspan="2"'; + %domconfig = + &Apache::lonnet::get_dom('configuration',['requestauthor'],$ccdomain); } else { %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, - 'tools.aboutme','tools.portfolio','tools.blog'); - @usertools = ('aboutme','blog','portfolio'); + 'tools.aboutme','tools.portfolio','tools.blog', + 'tools.webdav'); + @usertools = ('aboutme','blog','webdav','portfolio'); } foreach my $item (@usertools) { my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off, @@ -259,7 +272,12 @@ sub build_tools_display { $curr_access = &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, $context); - if ($userenv{$context.'.'.$item} ne '') { + if ($context eq 'requestauthor') { + if ($userenv{$context} ne '') { + $cust_on = ' checked="checked" '; + $cust_off = ''; + } + } elsif ($userenv{$context.'.'.$item} ne '') { $cust_on = ' checked="checked" '; $cust_off = ''; } @@ -269,6 +287,12 @@ sub build_tools_display { } else { $custom_access = &mt('Currently from custom setting.'); } + } elsif ($context eq 'requestauthor') { + if ($userenv{$context} eq '') { + $custom_access = &mt('Currently from default setting.'); + } else { + $custom_access = &mt('Currently from custom setting.'); + } } else { if ($userenv{$context.'.'.$item} eq '') { $custom_access = @@ -290,15 +314,27 @@ sub build_tools_display { ' '.$lt{$item}.''."\n". ' '."\n". &Apache::loncommon::start_data_table_row()."\n"; - if ($context eq 'requestcourses') { + if (($context eq 'requestcourses') || ($context eq 'requestauthor')) { my ($curroption,$currlimit); - if ($userenv{$context.'.'.$item} ne '') { - $curroption = $userenv{$context.'.'.$item}; + my $envkey = $context.'.'.$item; + if ($context eq 'requestauthor') { + $envkey = $context; + } + if ($userenv{$envkey} ne '') { + $curroption = $userenv{$envkey}; } else { my (@inststatuses); - $curroption = - &Apache::loncoursequeueadmin::get_processtype($ccuname,$ccdomain,$isadv,$ccdomain, - $item,\@inststatuses,\%domconfig); + if ($context eq 'requestcourses') { + $curroption = + &Apache::loncoursequeueadmin::get_processtype('course',$ccuname,$ccdomain, + $isadv,$ccdomain,$item, + \@inststatuses,\%domconfig); + } else { + $curroption = + &Apache::loncoursequeueadmin::get_processtype('requestauthor',$ccuname,$ccdomain, + $isadv,$ccdomain,undef, + \@inststatuses,\%domconfig); + } } if (!$curroption) { $curroption = 'norequest'; @@ -336,28 +372,36 @@ sub build_tools_display { $checked = ' checked="checked"'; } } + my $name = 'crsreq_'.$item; + if ($context eq 'requestauthor') { + $name = $item; + } $custdisp .= ' '; if ($option eq 'autolimit') { - $custdisp .= '
'. $reqtitles{'unlimited'}; - } else { - $custdisp .= ''; - } - $custdisp .= ''; + } else { + $custdisp .= ''; + } + $custdisp .= ''; } $custdisp .= ''; $custradio = ''.&mt('Custom setting').'
'.$custdisp; } else { $currdisp = ($curr_access?&mt('Yes'):&mt('No')); + my $name = $context.'_'.$item; + if ($context eq 'requestauthor') { + $name = $context; + } $custdisp = '  '; $custradio = (' 'x2).'--'.$lt{'cusa'}.': '.$custdisp. ''; @@ -453,6 +497,17 @@ sub coursereq_externaluser { return $output; } +sub domainrole_req { + my ($ccuname,$ccdomain) = @_; + return '

'. + &mt('User Can Request Assignment of Domain Roles?'). + '

'."\n". + &Apache::loncommon::start_data_table(). + &build_tools_display($ccuname,$ccdomain, + 'requestauthor'). + &Apache::loncommon::end_data_table(); +} + sub courserequest_titles { my %titles = &Apache::lonlocal::texthash ( official => 'Official', @@ -476,6 +531,80 @@ sub courserequest_display { return %titles; } +sub requestauthor_titles { + my %titles = &Apache::lonlocal::texthash ( + norequest => 'Not allowed', + approval => 'Approval by Dom. Coord.', + automatic => 'Automatic approval', + ); + return %titles; + +} + +sub requestauthor_display { + my %titles = &Apache::lonlocal::texthash ( + approval => 'Yes, need approval', + automatic => 'Yes, automatic approval', + norequest => 'No', + ); + return %titles; +} + +sub curr_requestauthor { + my ($uname,$udom,$isadv,$inststatuses,$domconfig) = @_; + return unless ((ref($inststatuses) eq 'ARRAY') && (ref($domconfig) eq 'HASH')); + if ($uname eq '' || $udom eq '') { + $uname = $env{'user.name'}; + $udom = $env{'user.domain'}; + $isadv = $env{'user.adv'}; + } + my (%userenv,%settings,$val); + my @options = ('automatic','approval'); + %userenv = + &Apache::lonnet::userenvironment($udom,$uname,'requestauthor','inststatus'); + if ($userenv{'requestauthor'}) { + $val = $userenv{'requestauthor'}; + @{$inststatuses} = ('_custom_'); + } else { + my %alltasks; + if (ref($domconfig->{'requestauthor'}) eq 'HASH') { + %settings = %{$domconfig->{'requestauthor'}}; + if (($isadv) && ($settings{'_LC_adv'} ne '')) { + $val = $settings{'_LC_adv'}; + @{$inststatuses} = ('_LC_adv_'); + } else { + if ($userenv{'inststatus'} ne '') { + @{$inststatuses} = split(',',$userenv{'inststatus'}); + } else { + @{$inststatuses} = ('default'); + } + foreach my $status (@{$inststatuses}) { + if (exists($settings{$status})) { + my $value = $settings{$status}; + next unless ($value); + unless (exists($alltasks{$value})) { + if (ref($alltasks{$value}) eq 'ARRAY') { + unless(grep(/^\Q$status\E$/,@{$alltasks{$value}})) { + push(@{$alltasks{$value}},$status); + } + } else { + @{$alltasks{$value}} = ($status); + } + } + } + } + foreach my $option (@options) { + if ($alltasks{$option}) { + $val = $option; + last; + } + } + } + } + } + return $val; +} + # =================================================================== Phase one sub print_username_entry_form { @@ -638,7 +767,6 @@ END sub entry_form { my ($dom,$srch,$forcenewuser,$context,$responsemsg,$crstype) = @_; - my %domconf = &Apache::lonnet::get_dom('configuration',['usercreation'],$dom); my ($usertype,$inexact); if (ref($srch) eq 'HASH') { if (($srch->{'srchin'} eq 'dom') && @@ -646,9 +774,10 @@ sub entry_form { ($srch->{'srchtype'} eq 'exact') && ($srch->{'srchdomain'} ne '') && ($srch->{'srchterm'} ne '')) { + my (%curr_rules,%got_rules); my ($rules,$ruleorder) = &Apache::lonnet::inst_userrules($srch->{'srchdomain'},'username'); - $usertype = &Apache::lonuserutils::check_usertype($srch->{'srchdomain'},$srch->{'srchterm'},$rules); + $usertype = &Apache::lonuserutils::check_usertype($srch->{'srchdomain'},$srch->{'srchterm'},$rules,\%curr_rules,\%got_rules); } else { $inexact = 1; } @@ -742,19 +871,13 @@ sub user_modification_js { '."\n"; - my $brcrum = [{href => "javascript:backPage(document.customresult,'pickrole','')", - text => "Pick custom role", - faq => 282, - bug => 'Instructor Interface',}, - {href => "javascript:backPage(document.customresult,'selected_custom_edit','')", - text => "Edit custom role", - faq => 282, - bug => 'Instructor Interface',}, - {href => "javascript:backPage(document.customresult,'set_custom_roles','')", - text => "Result", - faq => 282, - bug => 'Instructor Interface', - help => 'Course_Editing_Custom_Roles'}, - ]; - my $args = { bread_crumbs => $brcrum, + push(@{$brcrum}, + {href => "javascript:backPage(document.customresult,'pickrole','')", + text => "Pick custom role", + faq => 282, + bug => 'Instructor Interface',}, + {href => "javascript:backPage(document.customresult,'selected_custom_edit','')", + text => "Edit custom role", + faq => 282, + bug => 'Instructor Interface',}, + {href => "javascript:backPage(document.customresult,'set_custom_roles','')", + text => "Result", + faq => 282, + bug => 'Instructor Interface', + help => 'Course_Editing_Custom_Roles'}, + ); + my $args = { bread_crumbs => $brcrum, bread_crumbs_component => 'User Management'}; $r->print(&Apache::loncommon::start_page('Save Custom Role',$jscript,$args)); @@ -4039,6 +4206,10 @@ sub handler { my ($permission,$allowed) = &Apache::lonuserutils::get_permission($context,$crstype); if (!$allowed) { + if ($context eq 'course') { + $r->internal_redirect('/adm/viewclasslist'); + return OK; + } $env{'user.error.msg'}= "/adm/createuser:cst:0:0:Cannot create/modify user data ". "or view user status."; @@ -4093,7 +4264,11 @@ sub handler { if ($env{'form.phase'} eq 'createnewuser') { my $response; if ($env{'form.srchterm'} !~ /^$match_username$/) { - my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'); + my $response = + '' + .&mt('You must specify a valid username. Only the following are allowed:' + .' letters numbers - . @') + .''; $env{'form.phase'} = ''; &print_username_entry_form($r,$context,$response,$srch,undef,$crstype,$brcrum); } else { @@ -4157,6 +4332,32 @@ sub handler { } else { &custom_role_editor($r,$brcrum); } + } elsif (($env{'form.action'} eq 'processauthorreq') && + ($permission->{'cusr'}) && + (&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) { + push(@{$brcrum}, + {href => '/adm/createuser?action=processauthorreq', + text => 'Authoring space requests', + help => 'Domain_Role_Approvals'}); + $bread_crumbs_component = 'Authoring requests'; + if ($env{'form.state'} eq 'done') { + push(@{$brcrum}, + {href => '/adm/createuser?action=authorreqqueue', + text => 'Result', + help => 'Domain_Role_Approvals'}); + $bread_crumbs_component = 'Authoring request result'; + } + $args = { bread_crumbs => $brcrum, + bread_crumbs_component => $bread_crumbs_component}; + $r->print(&header(undef,$args)); + if (!exists($env{'form.state'})) { + $r->print(&Apache::loncoursequeueadmin::display_queued_requests('requestauthor', + $env{'request.role.domain'})); + } elsif ($env{'form.state'} eq 'done') { + $r->print('

'.&mt('Authoring request processing').'

'."\n"); + $r->print(&Apache::loncoursequeueadmin::update_request_queue('requestauthor', + $env{'request.role.domain'})); + } } elsif (($env{'form.action'} eq 'listusers') && ($permission->{'view'} || $permission->{'cusr'})) { if ($env{'form.phase'} eq 'bulkchange') { @@ -4188,6 +4389,7 @@ sub handler { bread_crumbs_component => $bread_crumbs_component}; my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles); my $formname = 'studentform'; + my $hidecall = "hide_searching();"; if (($context eq 'domain') && (($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community'))) { if ($env{'form.roletype'} eq 'course') { @@ -4204,16 +4406,22 @@ sub handler { ); $jscript = &Apache::lonhtmlcommon::set_form_elements(\%elements); } - $jscript .= &verify_user_display(); + $jscript .= &verify_user_display($context)."\n". + &Apache::loncommon::check_uncheck_jscript(); my $js = &add_script($jscript).$cb_jscript; my $loadcode = &Apache::lonuserutils::course_selector_loadcode($formname); if ($loadcode ne '') { - $args->{add_entries} = {onload => $loadcode}; + $args->{add_entries} = {onload => "$loadcode;$hidecall"}; + } else { + $args->{add_entries} = {onload => $hidecall}; } $r->print(&header($js,$args)); } else { - $r->print(&header(&add_script(&verify_user_display()),$args)); + $args->{add_entries} = {onload => $hidecall}; + $jscript = &verify_user_display($context). + &Apache::loncommon::check_uncheck_jscript(); + $r->print(&header(&add_script($jscript),$args)); } &Apache::lonuserutils::print_userlist($r,undef,$permission,$context, $formname,$totcodes,$codetitles,$idlist,$idlist_titles); @@ -4304,10 +4512,14 @@ sub handler { $cdom,$cnum,$coursedesc)); } } elsif ($env{'form.action'} eq 'changelogs') { + my $helpitem; + if ($context eq 'course') { + $helpitem = 'Course_User_Logs'; + } push (@{$brcrum}, {href => '/adm/createuser?action=changelogs', text => 'User Management Logs', - help => 'Course_User_Logs'}); + help => $helpitem}); $bread_crumbs_component = 'User Changes'; $args = { bread_crumbs => $brcrum, bread_crumbs_component => $bread_crumbs_component}; @@ -4345,14 +4557,69 @@ sub add_script { } sub verify_user_display { + my ($context) = @_; + my $photos; + if (($context eq 'course') && $env{'request.course.id'}) { + $photos = $env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}; + } my $output = <<"END"; +function hide_searching() { + if (document.getElementById('searching')) { + document.getElementById('searching').style.display = 'none'; + } + return; +} + function display_update() { document.studentform.action.value = 'listusers'; document.studentform.phase.value = 'display'; document.studentform.submit(); } +function updateCols(caller) { + var context = '$context'; + var photos = '$photos'; + if (caller == 'Status') { + if (document.studentform.Status.options[document.studentform.Status.selectedIndex].value == 'Any') { + document.getElementById('showcolstatus').checked = true; + document.getElementById('showcolstatus').disabled = ''; + document.getElementById('showcolstart').checked = true; + document.getElementById('showcolend').checked = true; + } else { + document.getElementById('showcolstatus').checked = false; + document.getElementById('showcolstatus').disabled = 'disabled'; + document.getElementById('showcolstart').checked = false; + document.getElementById('showcolend').checked = false; + } + } + if (caller == 'output') { + if (photos == 1) { + if (document.getElementById('showcolphoto')) { + var photoitem = document.getElementById('showcolphoto'); + if (document.studentform.output.options[document.studentform.output.selectedIndex].value == 'html') { + photoitem.checked = true; + photoitem.disabled = ''; + } else { + photoitem.checked = false; + photoitem.disabled = 'disabled'; + } + } + } + } + if (caller == 'showrole') { + if ((document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'Any') || + (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'cr')) { + document.getElementById('showcolrole').checked = true; + document.getElementById('showcolrole').disabled = ''; + } else { + document.getElementById('showcolrole').checked = false; + document.getElementById('showcolrole').disabled = 'disabled'; + } + } + return; +} + END return $output; @@ -4383,12 +4650,12 @@ sub print_main_menu { course => { upload => 'Upload a File of Course Users', singleuser => 'Add/Modify a Course User', - listusers => 'Manage Course Users', + listusers => 'List and Modify Multiple Course Users', }, community => { upload => 'Upload a File of Community Users', singleuser => 'Add/Modify a Community User', - listusers => 'Manage Community Users', + listusers => 'List and Modify Multiple Community Users', }, ); my %linktitles = ( @@ -4459,6 +4726,22 @@ sub print_main_menu { permission => $permission->{'custom'}, linktitle => 'Configure a custom role.', }, + { + linktext => 'Authoring Space Requests', + icon => 'selfenrl-queue.png', + #help => 'Domain_Role_Approvals', + url => '/adm/createuser?action=processauthorreq', + permission => $permission->{'cusr'}, + linktitle => 'Approve or reject author role requests', + }, + { + linktext => 'Change Log', + icon => 'document-properties.png', + #help => 'Course_User_Logs', + url => '/adm/createuser?action=changelogs', + permission => $permission->{'cusr'}, + linktitle => 'View change log.', + }, ); }elsif ($context eq 'course'){ @@ -4575,8 +4858,19 @@ sub print_main_menu { }, ); } - }; -return Apache::lonhtmlcommon::generate_menu(@menu); + } elsif ($context eq 'author') { + push(@{ $menu[2]->{items} }, #Category: Administration + { + linktext => 'Change Log', + icon => 'document-properties.png', + #help => 'Course_User_Logs', + url => '/adm/createuser?action=changelogs', + permission => $permission->{'cusr'}, + linktitle => 'View change log.', + }, + ); + } + return Apache::lonhtmlcommon::generate_menu(@menu); # { text => 'View Log-in History', # help => 'Course_User_Logins', # action => 'logins', @@ -5266,18 +5560,35 @@ sub selfenroll_date_forms { sub print_userchangelogs_display { my ($r,$context,$permission) = @_; - my $formname = 'roleslog'; - my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; - my $crstype = &Apache::loncommon::course_type(); - my %roleslog=&Apache::lonnet::dump('nohist_rolelog',$cdom,$cnum); + my $formname = 'rolelog'; + my ($username,$domain,$crstype,%roleslog); + if ($context eq 'domain') { + $domain = $env{'request.role.domain'}; + %roleslog=&Apache::lonnet::dump_dom('nohist_rolelog',$domain); + } else { + if ($context eq 'course') { + $domain = $env{'course.'.$env{'request.course.id'}.'.domain'}; + $username = $env{'course.'.$env{'request.course.id'}.'.num'}; + $crstype = &Apache::loncommon::course_type(); + my %saveable_parameters = ('show' => 'scalar',); + &Apache::loncommon::store_course_settings('roles_log', + \%saveable_parameters); + &Apache::loncommon::restore_course_settings('roles_log', + \%saveable_parameters); + } elsif ($context eq 'author') { + $domain = $env{'user.domain'}; + if ($env{'request.role'} =~ m{^au\./\Q$domain\E/$}) { + $username = $env{'user.name'}; + } else { + undef($domain); + } + } + if ($domain ne '' && $username ne '') { + %roleslog=&Apache::lonnet::dump('nohist_rolelog',$domain,$username); + } + } if ((keys(%roleslog))[0]=~/^error\:/) { undef(%roleslog); } - my %saveable_parameters = ('show' => 'scalar',); - &Apache::loncommon::store_course_settings('roles_log', - \%saveable_parameters); - &Apache::loncommon::restore_course_settings('roles_log', - \%saveable_parameters); # set defaults my $now = time(); my $defstart = $now - (7*24*3600); #7 days ago @@ -5319,7 +5630,8 @@ sub print_userchangelogs_display { # Form Header $r->print('
'. - &role_display_filter($formname,$cdom,$cnum,\%curr,$version,$crstype)); + &role_display_filter($context,$formname,$domain,$username,\%curr, + $version,$crstype)); # Create navigation my ($nav_script,$nav_links) = &userlogdisplay_nav($formname,\%curr,$more_records); @@ -5332,9 +5644,13 @@ sub print_userchangelogs_display { .''.&mt('When').'' .''.&mt('Who made the change').'' .''.&mt('Changed User').'' - .''.&mt('Role').'' - .''.&mt('Section').'' - .''.&mt('Context').'' + .''.&mt('Role').''; + + if ($context eq 'course') { + $tableheader .= ''.&mt('Section').''; + } + $tableheader .= + ''.&mt('Context').'' .''.&mt('Start').'' .''.&mt('End').'' .&Apache::loncommon::end_data_table_header_row(); @@ -5403,7 +5719,7 @@ sub print_userchangelogs_display { if ($roleslog{$id}{'logentry'}{'selfenroll'}) { $chgcontext = 'selfenroll'; } - my %lt = &rolechg_contexts($crstype); + my %lt = &rolechg_contexts($context,$crstype); if ($chgcontext ne '' && $lt{$chgcontext} ne '') { $chgcontext = $lt{$chgcontext}; } @@ -5413,9 +5729,12 @@ sub print_userchangelogs_display { .''.&Apache::lonlocal::locallocaltime($roleslog{$id}{'exe_time'}).'' .''.$whodunit{$roleslog{$id}{'exe_uname'}.':'.$roleslog{$id}{'exe_udom'}}.'' .''.$changed{$roleslog{$id}{'uname'}.':'.$roleslog{$id}{'udom'}}.'' - .''.&Apache::lonnet::plaintext($roleslog{$id}{'logentry'}{'role'},$crstype).'' - .''.$sec.'' - .''.$chgcontext.'' + .''.&Apache::lonnet::plaintext($roleslog{$id}{'logentry'}{'role'},$crstype).''); + if ($context eq 'course') { + $r->print(''.$sec.''); + } + $r->print( + ''.$chgcontext.'' .''.$rolestart.'' .''.$roleend.'' .&Apache::loncommon::end_data_table_row()."\n"); @@ -5483,9 +5802,11 @@ ENDSCRIPT } sub role_display_filter { - my ($formname,$cdom,$cnum,$curr,$version,$crstype) = @_; - my $context = 'course'; - my $lctype = lc($crstype); + my ($context,$formname,$cdom,$cnum,$curr,$version,$crstype) = @_; + my $lctype; + if ($context eq 'course') { + $lctype = lc($crstype); + } my $nolink = 1; my $output = '
'. ''.&mt('Changes/page:').'
'. @@ -5500,7 +5821,7 @@ sub role_display_filter { &Apache::lonhtmlcommon::date_setter($formname,'rolelog_end_date', $curr->{'rolelog_end_date'},undef, undef,undef,undef,undef,undef,undef,$nolink); - my %lt = &rolechg_contexts($crstype); + my %lt = &rolechg_contexts($context,$crstype); $output .= '
'.&mt('Window during which changes occurred:').'
'. ''. @@ -5514,7 +5835,7 @@ sub role_display_filter { $output .= ' selected="selected"'; } $output .= '>'.&mt('Any').''."\n"; - my @roles = &Apache::lonuserutils::course_roles($context,undef,1,$lctype); + my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype); foreach my $role (@roles) { my $plrole; if ($role eq 'cr') { @@ -5532,13 +5853,23 @@ sub role_display_filter { ''. ''. + ''. &Apache::loncommon::end_data_table_header_row(); my $otheritems = &Apache::loncommon::start_data_table_row()."\n". - ''."\n". + ''."\n". '
'.&mt('After:'). ''.$startform.'
  '. &mt('Context:').'
'. ''. ''; - my $courseform=''.&Apache::loncommon::selectcourse_link - ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Course/Community','crstype').''; + my $courseform=&Apache::loncommon::selectcourse_link + ('cu','dccourse','dcdomain','coursedesc',undef,undef,'Select','crstype'); my $cb_jscript = &Apache::loncommon::coursebrowser_javascript($dcdom,'currsec','cu','role','Course/Community Browser'); my %lt=&Apache::lonlocal::texthash( 'rol' => "Role", @@ -6216,15 +6569,17 @@ sub course_level_dc { 'sta' => "Start", 'end' => "End", 'ssd' => "Set Start Date", - 'sed' => "Set End Date" + 'sed' => "Set End Date", + 'scc' => "Course/Community" ); my $header = '

'.&mt('Course/Community Level').'

'. &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). - '
'.$courseform.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.''.$lt{'scc'}.''.$lt{'rol'}.''.$lt{'grs'}.''.$lt{'sta'}.''.$lt{'end'}.'

'. + $courseform.(' ' x4).'