--- loncom/interface/lonrequestcourse.pm 2014/01/03 18:39:51 1.73 +++ loncom/interface/lonrequestcourse.pm 2014/01/08 17:18:12 1.76 @@ -1,7 +1,7 @@ # The LearningOnline Network # Request a course # -# $Id: lonrequestcourse.pm,v 1.73 2014/01/03 18:39:51 raeburn Exp $ +# $Id: lonrequestcourse.pm,v 1.76 2014/01/08 17:18:12 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -817,7 +817,7 @@ END return true; } END - my ($pagetitle,$pageinfo,$domaintitle); + my ($pagetitle,$pageinfo,$domaintitle,$earlyout); if (ref($can_request) eq 'HASH') { if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || $can_request->{'textbook'}) { if ($can_request->{'community'}) { @@ -833,15 +833,24 @@ END $pagetitle = 'Community Requests'; $pageinfo = &mt('Request creation of a new course, or review your pending requests.'); $domaintitle = &mt('Community Domain'); - } else { + } elsif ((ref($incdoms) eq 'ARRAY') && ((@{$incdoms} > 1) || + ((@{$incdoms} == 1) && ($incdoms->[0] ne $dom)))) { $pagetitle = 'Course/Community Requests'; $pageinfo = &mt('You do not have rights to request creation of courses in this domain; please choose a different domain.'); $domaintitle = &mt('Course/Community Domain'); + } else { + $pagetitle = 'Course/Community Requests'; + $pageinfo = &mt('You do not have rights to request creation of courses or communities.'); + $earlyout = 1; } } $r->print(&header($pagetitle,$js.$jscript,$loaditems).$crumb. - '

'.$pageinfo.'

'. - '
'. + '

'.$pageinfo.'

'); + if ($earlyout) { + $r->print(&Apache::loncommon::end_page()); + return; + } + $r->print('
'. &Apache::lonhtmlcommon::start_pick_box(). &Apache::lonhtmlcommon::row_title($domaintitle). '
'. @@ -1540,7 +1549,7 @@ sub print_request_form { if ($result eq 'created') { my $role = 'au'; my $spec = "$role./$env{'form.showdom'}/"; - push(@links,&mt('Enter your authoring space with role: [_1]', + push(@links,&mt('Enter your Authoring Space with role: [_1]', ''. &Apache::lonnet::plaintext($role).'')); } @@ -1615,12 +1624,12 @@ sub print_request_form { sub print_author_prompt { my ($r,$action,$cnum,$showdom,$crstype,$storeresult) = @_; - $r->print('

'.&mt('Access to authoring space').'

'. + $r->print('

'.&mt('Access to Authoring Space').'

'. '

'. &mt('Although assessment items can be created directly inside a course, such items only use part of the assessment capabilities of LON-CAPA.'). '
'. - &mt('By contrast, items created in authoring space, then imported into a course, can use all of the features of the assessment engine.').'

'. - '

'.&mt('Request authoring space access now?'). + &mt('By contrast, items created in Authoring Space, then imported into a course, can use all of the features of the assessment engine.').'

'. + '

'.&mt('Request Authoring Space access now?'). ' '. ''. (' 'x2). @@ -3706,7 +3715,7 @@ sub process_request { if (($code) || ((ref($postprocess) eq 'HASH') && (($postprocess->{'createdweb'}) || ($postprocess->{'createdmsg'})))) { $output .= ¬ification_information($disposition,$env{'user.name'}.':'.$env{'user.domain'}, - $cnum,$now,$code,$postprocess); + $dom,$cnum,$now,$code,$postprocess); } if ($code) { $reqhash{'code'} = $code; @@ -3764,7 +3773,7 @@ sub process_request { } $output .= '
'. ¬ification_information($disposition,$req_notifylist, - $cnum,$now); + $dom,$cnum,$now); } else { $reqstatus = 'domainerror'; $reqhash{'disposition'} = $disposition; @@ -3782,7 +3791,7 @@ sub process_request { } else { $output .= '

'.&mt('Your course request has been updated').'

'; } - $output .= ¬ification_information($disposition,$req_notifylist,$cnum,$now); + $output .= ¬ification_information($disposition,$req_notifylist,$dom,$cnum,$now); if ($disposition eq 'approval') { my $fullname = &Apache::loncommon::plainname($env{'user.name'}, $env{'user.domain'}); @@ -3792,7 +3801,7 @@ sub process_request { if ((ref($postprocess) eq 'HASH') && ((ref($postprocess->{'queuedmsg'}) eq 'HASH') || ($postprocess->{'queuedweb'}))) { my $recipient = $env{'user.name'}.':'.$env{'user.domain'}; - $output .= ¬ification_information($disposition,$recipient,$cnum,$now,undef,$postprocess); + $output .= ¬ification_information($disposition,$recipient,$dom,$cnum,$now,undef,$postprocess); } } } @@ -3946,7 +3955,7 @@ sub update_requestors_roles { } sub notification_information { - my ($disposition,$req_notifylist,$cnum,$now,$code,$postprocess) = @_; + my ($disposition,$req_notifylist,$dom,$cnum,$now,$code,$postprocess) = @_; my %emails = &Apache::loncommon::getemails(); my $address; if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) { @@ -3966,7 +3975,8 @@ sub notification_information { my $fullname = &Apache::loncommon::plainname($env{'user.name'}, $env{'user.domain'}); my $sender = $env{'user.name'}.':'.$env{'user.domain'}; - &Apache::loncoursequeueadmin::send_selfserve_notification($req_notifylist,"$fullname ($env{'user.name'}:$env{'user.domain'})",$cnum,$env{'form.cdescr'},$now,'coursereq',$sender); + &Apache::loncoursequeueadmin::send_selfserve_notification($req_notifylist,"$fullname ($env{'user.name'}:$env{'user.domain'})", + 'undef',$env{'form.cdescr'},$now,'coursereq',$sender); } if (ref($postprocess) eq 'HASH') { if (ref($postprocess->{'queuedmsg'}) eq 'ARRAY') { @@ -3982,7 +3992,7 @@ sub notification_information { } } if (scalar(@{$addmsg}) > 0) { - &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,$cnum, + &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,undef, $env{'form.cdescr'},$now, 'queuedreq',$sender); } @@ -4006,8 +4016,8 @@ sub notification_information { my $sender = $recipient; if ($code) { push(@{$addmsg},{ - mt => 'Students can automatically select your course by entering this code: [_1]', - args => [$code], + mt => 'Students can automatically select your course: "[_1]" by entering this code: [_2]', + args => [$env{'form.cdescr'},$code], }); $output .= '

'. &mt('Students can automatically select your course by entering this code: [_1].',''.$code.''). @@ -4037,7 +4047,7 @@ sub notification_information { if ($code) { $type = 'uniquecode'; } - &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,$cnum,$env{'form.cdescr'}, + &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,$dom.'_'.$cnum,$env{'form.cdescr'}, $now,$type,$sender); } }