version 1.269.2.35, 2018/09/04 01:55:01
|
version 1.332, 2017/06/26 01:57:02
|
Line 140 use Apache::lonnavdisplay();
|
Line 140 use Apache::lonnavdisplay();
|
use Apache::loncoursequeueadmin; |
use Apache::loncoursequeueadmin; |
use Apache::longroup; |
use Apache::longroup; |
use Apache::lonrss; |
use Apache::lonrss; |
|
use Apache::lonplacementtest; |
use GDBM_File; |
use GDBM_File; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use HTML::Entities; |
use HTML::Entities; |
|
|
|
|
sub redirect_user { |
sub redirect_user { |
my ($r,$title,$url,$msg) = @_; |
my ($r,$title,$url,$msg) = @_; |
Line 151 sub redirect_user {
|
Line 152 sub redirect_user {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
my $swinfo=&Apache::lonmenu::rawconfig(); |
|
|
|
# Breadcrumbs |
# Breadcrumbs |
my $brcrum = [{'href' => $url, |
my $brcrum = [{'href' => $url, |
Line 166 sub redirect_user {
|
Line 166 sub redirect_user {
|
$url=~s/ /\%20/g; |
$url=~s/ /\%20/g; |
$r->print(<<ENDREDIR); |
$r->print(<<ENDREDIR); |
$start_page |
$start_page |
<script type="text/javascript"> |
|
// <![CDATA[ |
|
$swinfo |
|
// ]]> |
|
</script> |
|
<p>$msg</p> |
<p>$msg</p> |
$end_page |
$end_page |
ENDREDIR |
ENDREDIR |
Line 209 sub handler {
|
Line 204 sub handler {
|
my $r = shift; |
my $r = shift; |
|
|
# Check for critical messages and redirect if present. |
# Check for critical messages and redirect if present. |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'roles'); |
if ($redirect) { |
if ($redirect) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => $url); |
$r->header_out(Location => $url); |
Line 229 sub handler {
|
Line 224 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
|
|
# -------------------------------------------------- Check if setting hot list |
# -------------------------------------------------- Check if setting hot list |
my $hotlist; |
my $hotlist; |
if ($env{'form.action'} eq 'verify_and_change_rolespref') { |
if ($env{'form.action'} eq 'verify_and_change_rolespref') { |
$hotlist = &Apache::lonpreferences::verify_and_change_rolespref($r); |
$hotlist = &Apache::lonpreferences::verify_and_change_rolespref($r); |
Line 260 sub handler {
|
Line 255 sub handler {
|
|
|
my $envkey; |
my $envkey; |
my %dcroles = (); |
my %dcroles = (); |
my %helpdeskroles = (); |
my %helpdeskroles = (); |
my ($numdc,$numhelpdesk,$numadhoc) = |
my ($numdc,$numhelpdesk,$numadhoc) = |
&check_for_adhoc(\%dcroles,\%helpdeskroles,$update,$then); |
&check_for_adhoc(\%dcroles,\%helpdeskroles,$update,$then); |
my $loncaparev = $r->dir_config('lonVersion'); |
my $loncaparev = $r->dir_config('lonVersion'); |
|
|
Line 319 sub handler {
|
Line 314 sub handler {
|
if ($custom_adhoc) { |
if ($custom_adhoc) { |
my ($possroles,$description) = &Apache::lonnet::get_my_adhocroles($cdom.'_'.$cnum,1); |
my ($possroles,$description) = &Apache::lonnet::get_my_adhocroles($cdom.'_'.$cnum,1); |
if (ref($possroles) eq 'ARRAY') { |
if (ref($possroles) eq 'ARRAY') { |
if (grep(/^\Q$rolename\E$/,@{$possroles})) { |
if (grep(/^\Q$rolename\E$/,@{$possroles})) { |
if (&Apache::lonnet::check_adhoc_privs($cdom,$cnum,$update,$refresh,$now, |
if (&Apache::lonnet::check_adhoc_privs($cdom,$cnum,$update,$refresh,$now, |
"cr/$cdom/$cdom".'-domainconfig/'.$rolename,undef,$sec)) { |
"cr/$cdom/$cdom".'-domainconfig/'.$rolename,undef,$sec)) { |
&Apache::lonnet::appenv({"environment.internal.$cdom.$cnum.cr/$cdom/$cdom".'-domainconfig/'."$rolename.adhoc" => time}); |
&Apache::lonnet::appenv({"environment.internal.$cdom.$cnum.cr/$cdom/$cdom".'-domainconfig/'."$rolename.adhoc" => time}); |
Line 331 sub handler {
|
Line 326 sub handler {
|
# Check if user is a DC trying to enter a course or author space and needs privs to be created |
# Check if user is a DC trying to enter a course or author space and needs privs to be created |
# Check if user is a DH or DA trying to enter a course and needs privs to be created |
# Check if user is a DH or DA trying to enter a course and needs privs to be created |
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
if ($numdc) { |
|
# Is this an ad-hoc Coordinator role? |
# Is this an ad-hoc Coordinator role? |
|
if ($numdc) { |
if (my ($ccrole,$domain,$coursenum) = |
if (my ($ccrole,$domain,$coursenum) = |
($envkey =~ m-^form\.(cc|co)\./($match_domain)/($match_courseid)$-)) { |
($envkey =~ m-^form\.(cc|co)\./($match_domain)/($match_courseid)$-)) { |
if ($dcroles{$domain}) { |
if ($dcroles{$domain}) { |
Line 423 sub handler {
|
Line 418 sub handler {
|
} |
} |
last; |
last; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
foreach $envkey (keys(%env)) { |
foreach $envkey (keys(%env)) { |
next if ($envkey!~/^user\.role\./); |
next if ($envkey!~/^user\.role\./); |
my ($where,$trolecode,$role,$tstatus,$tend,$tstart); |
my ($where,$trolecode,$role,$tstatus,$tend,$tstart); |
Line 581 ENDENTERKEY
|
Line 575 ENDENTERKEY
|
} |
} |
} |
} |
my $msg; |
my $msg; |
my ($furl,$ferr)= |
my ($furl,$ferr)= |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
&Apache::lonuserstate::readmap($cdom.'/'.$cnum); |
unless ($ferr) { |
unless ($ferr) { |
unless (($env{'form.switchrole'}) || |
unless (($env{'form.switchrole'}) || |
($env{"environment.internal.$cdom.$cnum.$role.adhoc"})) { |
($env{"environment.internal.$cdom.$cnum.$role.adhoc"})) { |
&Apache::lonnet::put('nohist_crslastlogin', |
&Apache::lonnet::put('nohist_crslastlogin', |
{$env{'user.name'}.':'.$env{'user.domain'}. |
{$env{'user.name'}.':'.$env{'user.domain'}. |
':'.$csec.':'.$role => $now},$cdom,$cnum); |
':'.$csec.':'.$role => $now},$cdom,$cnum); |
} |
} |
if (($env{"environment.internal.$cdom.$cnum.$role.adhoc"}) && |
|
(&Apache::lonnet::allowed('vxc',$cdom.'_'.$cnum))) { |
|
my $owner = $env{'course.'.$cdom.'_'.$cnum.'.internal.courseowner'}; |
|
my @coowners = split(/,/,$env{'course.'.$env{'request.course.id'}.'.internal.co-owners'}); |
|
my %auaccess; |
|
foreach my $user ($owner,@coowners) { |
|
my ($cpname,$cpdom) = split(/:/,$user); |
|
my %auroles = &Apache::lonnet::get_my_roles($cpname,$cpdom,'userroles',undef,['au','ca','aa'],[$cdom]); |
|
foreach my $key (keys(%auroles)) { |
|
my ($auname,$audom,$aurole) = split(/:/,$key); |
|
if ($aurole eq 'au') { |
|
$auaccess{$cpname} = 1; |
|
} else { |
|
$auaccess{$auname} = 1; |
|
} |
|
} |
|
} |
|
&Apache::lonnet::appenv({'request.course.adhocsrcaccess' => join(',',sort(keys(%auaccess))) }); |
|
} |
|
my ($feeds,$syllabus_time); |
my ($feeds,$syllabus_time); |
&Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds); |
&Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds); |
&Apache::lonnet::appenv({'request.course.feeds' => $feeds}); |
&Apache::lonnet::appenv({'request.course.feeds' => $feeds}); |
Line 626 ENDENTERKEY
|
Line 601 ENDENTERKEY
|
} |
} |
if (($env{'form.orgurl'}) && |
if (($env{'form.orgurl'}) && |
($env{'form.orgurl'}!~/^\/adm\/flip/) && |
($env{'form.orgurl'}!~/^\/adm\/flip/) && |
($env{'form.orgurl'} ne '/adm/roles')) { |
($env{'form.orgurl'} ne '/adm/roles')) { |
my $dest=$env{'form.orgurl'}; |
my $dest=$env{'form.orgurl'}; |
if ($env{'form.symb'}) { |
if ($env{'form.symb'}) { |
if ($dest =~ /\?/) { |
if ($dest =~ /\?/) { |
Line 676 ENDENTERKEY
|
Line 651 ENDENTERKEY
|
$furl = "/adm/helper/course.initialization.helper"; |
$furl = "/adm/helper/course.initialization.helper"; |
# Send the user to the course they selected |
# Send the user to the course they selected |
} elsif ($env{'request.course.id'}) { |
} elsif ($env{'request.course.id'}) { |
|
if ((&Apache::loncommon::course_type() eq 'Placement') && |
|
(!$env{'request.role.adv'})) { |
|
my ($score,$incomplete) = |
|
&Apache::lonplacementtest::check_completion(undef,undef,1); |
|
if (($incomplete) && ($incomplete < 100)) { |
|
&redirect_user($r, &mt('Entering [_1]', |
|
$env{'course.'.$cdom.'_'.$cnum.'.description'}), |
|
'/adm/placement', $msg); |
|
return OK; |
|
} |
|
} |
my ($dest,$destsymb,$checkenc); |
my ($dest,$destsymb,$checkenc); |
$dest = $env{'form.destinationurl'}; |
$dest = $env{'form.destinationurl'}; |
$destsymb = $env{'form.destsymb'}; |
$destsymb = $env{'form.destsymb'}; |
Line 688 ENDENTERKEY
|
Line 674 ENDENTERKEY
|
} |
} |
} |
} |
} |
} |
|
if (($dest =~ m{^\Q/public/$cdom/$cnum/syllabus\E.*(\?|\&)usehttp=1}) || |
|
($dest =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) { |
|
if ($ENV{'SERVER_PORT'} == 443) { |
|
my $hostname = $r->hostname(); |
|
if ($hostname ne '') { |
|
$dest = 'http://'.$hostname.$dest; |
|
} |
|
} |
|
} |
if ($dest =~ m{^/enc/}) { |
if ($dest =~ m{^/enc/}) { |
if ($env{'request.role.adv'}) { |
if ($env{'request.role.adv'}) { |
$dest = &Apache::lonenc::unencrypted($dest); |
$dest = &Apache::lonenc::unencrypted($dest); |
if ($destsymb eq '') { |
if ($destsymb eq '') { |
($destsymb) = ($dest =~ /(?:\?|\&)symb=([^\&]*)/); |
($destsymb) = ($dest =~ /(?:\?|\&)symb=([^\&]*)/); |
$destsymb = &unescape($destsymb); |
$destsymb = &unescape($destsymb); |
} |
} |
} |
} |
Line 717 ENDENTERKEY
|
Line 712 ENDENTERKEY
|
} |
} |
} |
} |
} |
} |
unless (($dest =~ m{^/enc/}) || ($dest =~ /(\?|\&)symb=.+___\d+___.+/)) { |
unless (($dest =~ m{^/enc/}) || ($dest =~ /(\?|\&)symb=.+___\d+___.+/)) { |
if (($destsymb ne '') && ($destsymb !~ m{^/enc/})) { |
if (($destsymb ne '') && ($destsymb !~ m{^/enc/})) { |
my $esc_symb = &escape($destsymb); |
my $esc_symb = &escape($destsymb); |
$dest .= '?symb='.$esc_symb; |
$dest .= (($dest =~/\?/)? '&':'?').'symb='.$esc_symb; |
} |
} |
} |
} |
&redirect_user($r, &mt('Entering [_1]', |
&redirect_user($r, &mt('Entering [_1]', |
Line 832 ENDENTERKEY
|
Line 827 ENDENTERKEY
|
$crumbtext = 'Courses'; |
$crumbtext = 'Courses'; |
$pagetitle = 'My Courses'; |
$pagetitle = 'My Courses'; |
$recent = &mt('Recent Courses'); |
$recent = &mt('Recent Courses'); |
$standby = &mt('Course selected. Please stand by.'); |
$standby = &mt('Course selected. Please stand by.'); |
} |
} |
my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; |
my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; |
|
|
Line 845 ENDENTERKEY
|
Line 840 ENDENTERKEY
|
if ($domdefs{'catauth'}) { |
if ($domdefs{'catauth'}) { |
$cattype = $domdefs{'catauth'}; |
$cattype = $domdefs{'catauth'}; |
} |
} |
my $funcs = &get_roles_functions($showcount,$cattype); |
my $placementonly; |
my $crumbsright; |
if ($showcount == 1) { |
if ($env{'browser.mobile'}) { |
if ($env{'request.course.id'}) { |
$crumbsright = $funcs; |
if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') { |
undef($funcs); |
$placementonly = 1; |
|
} |
|
} else { |
|
foreach my $rolecode (keys(%roles_in_env)) { |
|
my ($cid) = ($rolecode =~ m{^\Quser.role.st./\E($match_domain/$match_courseid)(?:/|$)}); |
|
if ($cid) { |
|
my %coursedescription = |
|
&Apache::lonnet::coursedescription($cid,{'one_time' => '1'}); |
|
if ($coursedescription{'type'} eq 'Placement') { |
|
$placementonly = 1; |
|
} |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
my ($start_page,$funcs); |
|
if ($placementonly) { |
|
$start_page=&Apache::loncommon::start_page($pagetitle,undef, |
|
{bread_crumbs=>$brcrum,crstype=>'Placement'}); |
|
} else { |
|
$funcs = &get_roles_functions($showcount,$cattype); |
|
my $crumbsright; |
|
if ($env{'browser.mobile'}) { |
|
$crumbsright = $funcs; |
|
undef($funcs); |
|
} |
|
$start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, |
|
bread_crumbs_component=>$crumbsright}); |
} |
} |
my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, |
|
bread_crumbs_component=>$crumbsright}); |
|
&js_escape(\$standby); |
&js_escape(\$standby); |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
|
|
Line 886 function rolesView (caller) {
|
Line 907 function rolesView (caller) {
|
document.rolechoice.display.value = caller; |
document.rolechoice.display.value = caller; |
} else { |
} else { |
if ((caller == 'doupdate') || (caller == 'requestauthor') || |
if ((caller == 'doupdate') || (caller == 'requestauthor') || |
(caller == 'queued')) { |
(caller == 'queued')) { |
document.rolechoice.state.value = caller; |
document.rolechoice.state.value = caller; |
} |
} |
} |
} |
Line 970 ENDHEADER
|
Line 991 ENDHEADER
|
} |
} |
if ($hotlist) { |
if ($hotlist) { |
$showresult .= $hotlist; |
$showresult .= $hotlist; |
} |
} |
$showresult .= '</div>'; |
$showresult .= '</div>'; |
$r->print($showresult); |
$r->print($showresult); |
} elsif ($env{'form.state'} eq 'queued') { |
} elsif ($env{'form.state'} eq 'queued') { |
Line 995 ENDHEADER
|
Line 1016 ENDHEADER
|
\%sortrole,\%roleclass,\%futureroles,\%timezones,$loncaparev); |
\%sortrole,\%roleclass,\%futureroles,\%timezones,$loncaparev); |
$refresh = $now; |
$refresh = $now; |
&Apache::lonnet::appenv({'user.refresh.time' => $refresh}); |
&Apache::lonnet::appenv({'user.refresh.time' => $refresh}); |
if ((($cattype eq 'std') || ($cattype eq 'domonly')) && (!$env{'user.adv'})) { |
if ($countactive == 1) { |
|
if ($env{'request.course.id'}) { |
|
if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') { |
|
$placementonly = 1; |
|
} |
|
} elsif ($possiblerole) { |
|
if ($possiblerole =~ m{^st\./($match_domain)/($match_courseid)(?:/|$)}) { |
|
if ($env{'course.'.$1.'_'.$2.'.type'} eq 'Placement') { |
|
$placementonly = 1; |
|
} |
|
} |
|
} |
|
} |
|
if ((($cattype eq 'std') || ($cattype eq 'domonly')) && (!$env{'user.adv'}) && |
|
(!$placementonly)) { |
if ($countactive > 0) { |
if ($countactive > 0) { |
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description'); |
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description'); |
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); |
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); |
Line 1048 ENDHEADER
|
Line 1083 ENDHEADER
|
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
|
} elsif (($placementonly) && ($env{'request.role'} eq 'cm')) { |
|
$r->print('<h3>'.&mt('Please stand by.').'</h3> |
|
<input type="hidden" name="'.$possiblerole.'" value="1" /> |
|
<noscript><br /> |
|
<input type="submit" name="submit" value="'.&mt('Continue').'" /> |
|
</noscript></form>'); |
|
$r->rflush(); |
|
$r->print('<script type="text/javascript">document.forms.rolechoice.submit();</script>'); |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
} |
} |
# ----------------------------------------------------------------------- Table |
# ----------------------------------------------------------------------- Table |
|
|
Line 1256 sub gather_roles {
|
Line 1301 sub gather_roles {
|
$trole=Apache::lonnet::plaintext($role); |
$trole=Apache::lonnet::plaintext($role); |
my $ttype; |
my $ttype; |
my $twhere; |
my $twhere; |
|
my $skipcal; |
my ($tdom,$trest,$tsection)= |
my ($tdom,$trest,$tsection)= |
split(/\//,Apache::lonnet::declutter($where)); |
split(/\//,Apache::lonnet::declutter($where)); |
# First, Co-Authorship roles |
# First, Co-Authorship roles |
Line 1370 sub gather_roles {
|
Line 1416 sub gather_roles {
|
$env{'course.'.$tcourseid.'.description'}=$twhere; |
$env{'course.'.$tcourseid.'.description'}=$twhere; |
$sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey; |
$sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey; |
$ttype = 'Unavailable'; |
$ttype = 'Unavailable'; |
|
$skipcal = 1; |
} |
} |
} |
} |
|
if ($ttype eq 'Placement') { |
|
$ttype = 'Placement Test'; |
|
} |
if ($tsection) { |
if ($tsection) { |
$twhere.='<br />'.&mt('Section').': '.$tsection; |
$twhere.='<br />'.&mt('Section').': '.$tsection; |
} |
} |
Line 1388 sub gather_roles {
|
Line 1438 sub gather_roles {
|
($role_text,$role_text_end) = |
($role_text,$role_text_end) = |
&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain, |
&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain, |
$advanced,$tremark,$tbg,$trole,$twhere,$tpstart, |
$advanced,$tremark,$tbg,$trole,$twhere,$tpstart, |
$tpend,$nochoose,$button,$switchserver,$reinit,$switchwarning); |
$tpend,$nochoose,$button,$switchserver,$reinit, |
|
$switchwarning,$skipcal); |
$roletext->{$envkey}=[$role_text,$role_text_end]; |
$roletext->{$envkey}=[$role_text,$role_text_end]; |
if (!$sortkey) {$sortkey=$twhere."\0".$envkey;} |
if (!$sortkey) {$sortkey=$twhere."\0".$envkey;} |
$sortrole->{$sortkey}=$envkey; |
$sortrole->{$sortkey}=$envkey; |
Line 1486 sub roletable_headers {
|
Line 1537 sub roletable_headers {
|
} |
} |
|
|
sub roletypes { |
sub roletypes { |
my @types = ('Domain','Authoring Space','Course','Community','Unavailable','System'); |
my @types = ('Domain','Authoring Space','Course','Placement Test','Community','Unavailable','System'); |
return @types; |
return @types; |
} |
} |
|
|
Line 1548 sub findcourse_advice {
|
Line 1599 sub findcourse_advice {
|
<li>'.&mt('You are in a section of course for which automatic enrollment in the corresponding LON-CAPA course is not active.').'</li> |
<li>'.&mt('You are in a section of course for which automatic enrollment in the corresponding LON-CAPA course is not active.').'</li> |
<li>'.&mt('The start date for automated enrollment has yet to be reached.').'</li> |
<li>'.&mt('The start date for automated enrollment has yet to be reached.').'</li> |
<li>'.&mt('You registered for the course recently and there is a time lag between the time you register, and the time this information becomes available for the update of LON-CAPA course rosters.').'</li> |
<li>'.&mt('You registered for the course recently and there is a time lag between the time you register, and the time this information becomes available for the update of LON-CAPA course rosters.').'</li> |
<li>'.&mt('Automated enrollment added you to the course in the time since you last logged in.').' '.&mt('If that is the case you can use the "Check for changes" link in the gray Functions bar to update the list of your available course roles.').'</li> |
|
</ul>'); |
</ul>'); |
} else { |
} else { |
$r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'<br />'); |
$r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'<br />'); |
Line 1686 sub privileges_info {
|
Line 1736 sub privileges_info {
|
|
|
sub build_roletext { |
sub build_roletext { |
my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$trole,$twhere, |
my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$trole,$twhere, |
$tpstart,$tpend,$nochoose,$button,$switchserver,$reinit,$switchwarning) = @_; |
$tpstart,$tpend,$nochoose,$button,$switchserver,$reinit,$switchwarning,$skipcal) = @_; |
my ($roletext,$roletext_end,$poss_adhoc); |
my ($roletext,$roletext_end,$poss_adhoc); |
if ($trolecode =~ m/^d(c|h|a)\./) { |
if ($trolecode =~ m/^d(c|h|a)\./) { |
$poss_adhoc = 1; |
$poss_adhoc = 1; |
Line 1744 sub build_roletext {
|
Line 1794 sub build_roletext {
|
$trolecode."','".$buttonname.'\');" /></td>'; |
$trolecode."','".$buttonname.'\');" /></td>'; |
} |
} |
} |
} |
if ($trolecode !~ m/^(dc|ca|au|aa)\./) { |
if (($trolecode !~ m/^(dc|ca|au|aa)\./) && (!$skipcal)) { |
$tremark.=&Apache::lonannounce::showday(time,1, |
$tremark.=&Apache::lonannounce::showday(time,1, |
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
} |
} |
Line 1782 sub check_for_adhoc {
|
Line 1832 sub check_for_adhoc {
|
my $numdc = 0; |
my $numdc = 0; |
my $numhelpdesk = 0; |
my $numhelpdesk = 0; |
my $numadhoc = 0; |
my $numadhoc = 0; |
my $num_custom_adhoc = 0; |
my $num_custom_adhoc = 0; |
if (($env{'user.adv'}) || ($env{'user.rar'})) { |
if (($env{'user.adv'}) || ($env{'user.rar'})) { |
foreach my $envkey (sort(keys(%env))) { |
foreach my $envkey (sort(keys(%env))) { |
if ($envkey=~/^user\.role\.(dc|dh|da)\.\/($match_domain)\/$/) { |
if ($envkey=~/^user\.role\.(dc|dh|da)\.\/($match_domain)\/$/) { |
Line 1989 sub display_cc_role {
|
Line 2039 sub display_cc_role {
|
my $trolecode = $ccrole.'./'.$tdom.'/'.$trest; |
my $trolecode = $ccrole.'./'.$tdom.'/'.$trest; |
my $twhere; |
my $twhere; |
my $ttype; |
my $ttype; |
|
my $skipcal; |
my $tbg='LC_roles_is'; |
my $tbg='LC_roles_is'; |
my %newhash=&Apache::lonnet::coursedescription($tcourseid); |
my %newhash=&Apache::lonnet::coursedescription($tcourseid); |
if (%newhash) { |
if (%newhash) { |
Line 2000 sub display_cc_role {
|
Line 2051 sub display_cc_role {
|
} else { |
} else { |
$twhere=&mt('Currently not available'); |
$twhere=&mt('Currently not available'); |
$env{'course.'.$tcourseid.'.description'}=$twhere; |
$env{'course.'.$tcourseid.'.description'}=$twhere; |
|
$skipcal = 1; |
} |
} |
my $trole = &Apache::lonnet::plaintext($ccrole,$ttype,$tcourseid); |
my $trole = &Apache::lonnet::plaintext($ccrole,$ttype,$tcourseid); |
$twhere.="<br />".&mt('Domain').":".$tdom; |
$twhere.="<br />".&mt('Domain').":".$tdom; |
($roletext,$roletext_end) = &build_roletext($trolecode,$tdom,$trest,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,''); |
($roletext,$roletext_end) = &build_roletext($trolecode,$tdom,$trest,'is',$tryagain,$advanced,'',$tbg,$trole,$twhere,'','','',1,'','','',$skipcal); |
} |
} |
} |
} |
return ($roletext,$roletext_end); |
return ($roletext,$roletext_end); |
Line 2038 sub adhoc_customroles_row {
|
Line 2090 sub adhoc_customroles_row {
|
if ($tstart && $tstart>$limit) { $liverole = 0; } |
if ($tstart && $tstart>$limit) { $liverole = 0; } |
if ($tend && $tend <$limit) { $liverole = 0; } |
if ($tend && $tend <$limit) { $liverole = 0; } |
return unless ($liverole); |
return unless ($liverole); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dhdom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dhdom); |
if (ref($domdefaults{'adhocroles'}) eq 'HASH') { |
if (ref($domdefaults{'adhocroles'}) eq 'HASH') { |
if (scalar(keys(%{$domdefaults{'adhocroles'}})) > 0) { |
if (scalar(keys(%{$domdefaults{'adhocroles'}})) > 0) { |
return &Apache::loncommon::continue_data_table_row() |
return &Apache::loncommon::continue_data_table_row() |
Line 2368 sub update_session_roles {
|
Line 2420 sub update_session_roles {
|
&curr_role_status($currstart,$currend,$refresh,$update); |
&curr_role_status($currstart,$currend,$refresh,$update); |
my ($rolekey) = ($envkey =~ /^user\.role\.(.+)$/); |
my ($rolekey) = ($envkey =~ /^user\.role\.(.+)$/); |
my ($role,$rest)=split(m{\./},$rolekey,2); |
my ($role,$rest)=split(m{\./},$rolekey,2); |
$rest = '/'.$rest; |
$rest = '/'.$rest; |
if (&Apache::lonnet::delenv($envkey,undef,[$role])) { |
if (&Apache::lonnet::delenv($envkey,undef,[$role])) { |
if ($status_in_env eq 'active') { |
if ($status_in_env eq 'active') { |
if ($role eq 'gr') { |
if ($role eq 'gr') { |
Line 2568 sub update_session_roles {
|
Line 2620 sub update_session_roles {
|
} |
} |
my $groupdesc; |
my $groupdesc; |
unless (ref($curr_groups{$cdom.'_'.$cnum}) eq 'HASH') { |
unless (ref($curr_groups{$cdom.'_'.$cnum}) eq 'HASH') { |
%{$curr_groups{$cdom.'_'.$cnum}} = |
%{$curr_groups{$cdom.'_'.$cnum}} = |
&Apache::longroup::coursegroups($cdom,$cnum); |
&Apache::longroup::coursegroups($cdom,$cnum); |
} |
} |
unless ((ref($groupdescs{$cdom.'_'.$cnum}) eq 'HASH') && |
unless ((ref($groupdescs{$cdom.'_'.$cnum}) eq 'HASH') && |
($groupdescs{$cdom.'_'.$cnum}{$group})) { |
($groupdescs{$cdom.'_'.$cnum}{$group})) { |
|
|
my %groupinfo = |
my %groupinfo = |
&Apache::longroup::get_group_settings($curr_groups{$cdom.'_'.$cnum}{$group}); |
&Apache::longroup::get_group_settings($curr_groups{$cdom.'_'.$cnum}{$group}); |
$groupdescs{$cdom.'_'.$cnum}{$group} = |
$groupdescs{$cdom.'_'.$cnum}{$group} = |
&unescape($groupinfo{'description'}); |
&unescape($groupinfo{'description'}); |
} |
} |
$groupdesc = $groupdescs{$cdom.'_'.$cnum}{$group}; |
$groupdesc = $groupdescs{$cdom.'_'.$cnum}{$group}; |
Line 2695 sub update_session_roles {
|
Line 2747 sub update_session_roles {
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
my %groupdesc; |
my %groupdesc; |
if (ref($groupchange{$crs}) eq 'HASH') { |
if (ref($groupchange{$crs}) eq 'HASH') { |
$groupchgmsg .= '<li>'.&mt('Course/Community: [_1]','<b>'.$crsdesc.'</b><ul>'); |
$groupchgmsg .= '<li>'.&mt('Course/Community: [_1]','<b>'.$crsdesc.'</b><ul>'); |
foreach my $group (sort(keys(%{$groupchange{$crs}}))) { |
foreach my $group (sort(keys(%{$groupchange{$crs}}))) { |
Line 2928 sub get_queued {
|
Line 2980 sub get_queued {
|
if (ref($history{'details'}) eq 'HASH') { |
if (ref($history{'details'}) eq 'HASH') { |
$description = $history{details}{'cdescr'}; |
$description = $history{details}{'cdescr'}; |
} |
} |
@{$reqcrs{$reqtime}} = ($description,$showtype); |
@{$reqcrs{$reqtime}} = ($description,$showtype); |
} |
} |
} |
} |
my @sortedtimes = sort {$a <=> $b} (keys(%reqcrs)); |
my @sortedtimes = sort {$a <=> $b} (keys(%reqcrs)); |