--- loncom/interface/lonrequestcourse.pm 2020/07/20 11:30:21 1.95.2.5.2.1 +++ loncom/interface/lonrequestcourse.pm 2016/04/04 01:07:17 1.97 @@ -1,7 +1,7 @@ # The LearningOnline Network # Request a course # -# $Id: lonrequestcourse.pm,v 1.95.2.5.2.1 2020/07/20 11:30:21 raeburn Exp $ +# $Id: lonrequestcourse.pm,v 1.97 2016/04/04 01:07:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -119,10 +119,6 @@ use Apache::loncoursequeueadmin; use Apache::lonuserutils; use LONCAPA qw(:DEFAULT :match); -my $registered_flush; -my $registered_instcats; -my $modified_dom; - sub handler { my ($r) = @_; &Apache::loncommon::content_type($r,'text/html'); @@ -131,10 +127,6 @@ sub handler { return OK; } - $registered_flush = 0; - $registered_instcats = 0; - $modified_dom = ''; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['action','showdom','cnum','state','crstype','queue','tabs']); &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -559,7 +551,6 @@ sub form_elements { clonedom => 'selectbox', datemode => 'radio', dateshift => 'text', - tinyurls => 'radio', }, enrollment => { accessstart_month => 'selectbox', @@ -769,6 +760,7 @@ function check_can_request(crschoice,act var unofficial = ''; var community = ''; var textbook = ''; + var placement = ''; END if (ref($can_request) eq 'HASH') { foreach my $item (keys(%{$can_request})) { @@ -782,6 +774,7 @@ END unofficial => 'You are not permitted to request creation of an unofficial course in this domain.', community => 'You are not permitted to request creation of a community in this domain.', textbook => 'You are not permitted to request creation of a textbook course in this domain', + placement => 'You are not permitted to request creation of a placement test in this domain', all => 'You must choose a specific course type when making a new course request.', allt => '"All types" is not allowed.', ); @@ -811,9 +804,16 @@ END return false; } } else { - if (actionchoice == 'new') { - alert('$js_lt{'all'}'+'\\n'+'$js_lt{'allt'}'); - return false; + if (crschoice == 'placement') { + if (placement != 1) { + alert("$js_lt{'placement'}"); + return false; + } + } else { + if (actionchoice == 'new') { + alert('$js_lt{'all'}'+'\\n'+'$js_lt{'allt'}'); + return false; + } } } } @@ -824,7 +824,7 @@ END END my ($pagetitle,$pageinfo,$domaintitle,$earlyout); if (ref($can_request) eq 'HASH') { - if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || $can_request->{'textbook'}) { + if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || ($can_request->{'textbook'}) || ($can_request->{'placement'})) { if ($can_request->{'community'}) { $pagetitle = 'Course/Community Requests'; $pageinfo = &mt('Request creation of a new course or community, or review your pending requests.'); @@ -1001,6 +1001,8 @@ END $title = &mt('Pending requests for unofficial courses'); } elsif ($env{'form.crstype'} eq 'textbook') { $title = &mt('Pending requests for textbook courses'); + } elsif ($env{'form.crstype'} eq 'textbook') { + $title = &mt('Pending requests for placement tests'); } else { $title = &mt('Pending course/community requests'); } @@ -2102,22 +2104,11 @@ sub print_personnel_menu { official => 'Requestor is automatically assigned Course Coordinator role.', ); $lt{'unofficial'} = $lt{'official'}; - $lt{'textbook'} = $lt{'textbook'}; + $lt{'textbook'} = $lt{'official'}; + $lt{'placement'} = $lt{'official'}; $output .= &Apache::lonhtmlcommon::row_headline(). '

'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').' '.$lt{$crstype}.' '.&mt('Include other personnel?').'

'; } - my $cansearch = 1; - my @alldoms = &Apache::lonnet::all_domains(); - if (@alldoms == 1) { - my %domsrch = &Apache::lonnet::get_dom('configuration', - ['directorysrch'],$alldoms[0]); - if (ref($domsrch{'directorysrch'}) eq 'HASH') { - if ((!$domsrch{'directorysrch'}{'available'}) && - ($domsrch{'directorysrch'}{'lcavailable'} eq '0')) { - $cansearch = 0; - } - } - } for (my $i=0; $i<$persontotal; $i++) { my @linkargs = map { 'person_'.$i.'_'.$_ } (@items); my $linkargstr = join("','",@linkargs); @@ -2142,14 +2133,9 @@ sub print_personnel_menu { } $sectionselector .= $newtitle. ''."\n"; - my $usersrchlink; - if ($cansearch) { - my $usersrchlinktxt = &mt('Search for user'); - $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, - $usersrchlinktxt); - } else { - $usersrchlink = ' '; - } + my $usersrchlinktxt = &mt('Search for user'); + my $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, + $usersrchlinktxt); my $userchklinktxt = &mt('Check username'); my $userchklink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, $userchklinktxt,'checkusername'); @@ -2530,7 +2516,7 @@ sub print_request_logs { if (ref($domconfig{'requestcourses'}) eq 'HASH') { if (ref($domconfig{'requestcourses'}{'uniquecode'}) eq 'HASH') { if ($curr{'crstype'} eq 'any') { - my @types = qw(official unofficial community textbook); + my @types = qw(official unofficial community textbook placement); foreach my $type (@types) { if ($domconfig{'requestcourses'}{'uniquecode'}{$type}) { $showuniquecode = 1; @@ -2698,7 +2684,7 @@ sub reqstatus_names { rejected => 'Request rejected', cancelled => 'Request cancelled', ); - if (($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook')) { + if (($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook') || ($crstype eq 'placement')) { $statusnames{'created'} = &mt('Course created'); } elsif ($crstype eq 'community') { $statusnames{'created'} = &mt('Community created'); @@ -2926,7 +2912,7 @@ sub print_review { $inst_values .= ''.$env{'form.coursecredits'}.''; } - my %ctxt = &clone_text($env{'form.crstype'}); + my %ctxt = &clone_text(); $inst_headers .= ''.&mt('Clone From').''; if (($env{'form.cloning'}) && ($env{'form.clonecrs'} =~ /^$match_name$/) && @@ -2938,8 +2924,7 @@ sub print_review { my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'}, $env{'form.clonecrs'},('description','internal.coursecode')); if (keys(%courseenv) > 0) { - $inst_headers .= ''.$ctxt{'dsh'}.''. - ''.$ctxt{'dpl'}.''; + $inst_headers .= ''.$ctxt{'dsh'}.''; $inst_values .= ''.$courseenv{'description'}.' '; my $cloneinst = $courseenv{'internal.coursecode'}; if ($cloneinst ne '') { @@ -2955,14 +2940,6 @@ sub print_review { } else { $inst_values .= $ctxt{'ncd'}; } - $inst_values .= ''; - if ($env{'form.tinyurls'} eq 'delete') { - $inst_values .= $ctxt{'nsl'}; - } elsif ($env{'form.tinyurls'} eq 'transfer') { - $inst_values .= $ctxt{'tsl'}; - } else { - $inst_values .= $ctxt{'csl'}; - } $inst_values .= ''; } else { $inst_values .= ''.&mt('Unknown').''; @@ -3111,6 +3088,7 @@ sub courseinfo_form { &js_escape(\%js_lt); $js_lt{'unofficial'} = $js_lt{'official'}; $js_lt{'textbook'} = $js_lt{'official'}; + $js_lt{'placement'} = $js_lt{'official'}; my $js_validate = <<"ENDJS";