';
$partcount ++;
}
$$triggered{$symb}{numparts} = $partcount;
@@ -1166,14 +1139,7 @@ sub check_thresholds {
sub get_curr_thresholds {
- my ($threshold,$uname,$udom,$cid,$cdom,$crs,$custommenu) = @_;
- if ($custommenu) {
- %$threshold = (av_attempts => 0,
- degdiff => 0.00000000000000,
- numstudents => 1
- );
- return;
- }
+ my ($threshold,$uname,$udom,$cid,$cdom,$crs) = @_;
# set default values
%$threshold = (av_attempts => 2,
degdiff => 0.5,
@@ -1265,7 +1231,7 @@ sub process_reset {
sub process_update {
my ($uname,$udom,$threshold_titles) = @_;
- my $setoutput = ''.&mt('Changes to threshold(s) for problem tracking:').' ';
+ my $setoutput = ''.&mt('Changes to threshold(s) for problem tracking:').'
';
foreach (keys %env) {
next if ($_!~/^form\.(.+)\_setparmval$/);
my $name = $1;
@@ -1276,17 +1242,17 @@ sub process_update {
my ($shortname) = ($name =~ /^\Q$env{'request.course.id'}\E:threshold_(.+)$/);
if ($put_result eq 'ok') {
- $setoutput.=&mt('Set threshold for [_1] to [_2]',
+ $setoutput.= &Apache::lonhtmlcommon::confirm_success(&mt('Set threshold for [_1] to [_2]',
''.$$threshold_titles{$shortname}.'',
- ''.$value.'').' ';
+ ''.$value.'').' ');
} else {
- $setoutput.=&mt('Unable to set threshold for [_1] to [_2] due to [_3].',
+ $setoutput.= &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set threshold for [_1] to [_2] due to [_3].',
''.$name.'',''.$value.'',
- ''.$put_result.'').' ';
+ ''.$put_result.'').' ',1);
}
}
}
- return $setoutput;
+ return &Apache::loncommon::confirmwrapper($setoutput);
}
sub getnormalmail {
@@ -1301,7 +1267,6 @@ sub getnormalmail {
&Apache::lonmsg::unpackmsgid($msgid);
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) {
if (defined($sendtime) && $sendtime!~/error/) {
- my $numsendtime = $sendtime;
if ($status eq 'new') {
$sendtime = &Apache::lonlocal::locallocaltime($sendtime);
$msgcount ++;
@@ -1333,7 +1298,6 @@ sub getcritmail {
&Apache::lonmsg::unpackmsgid($msgid);
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) {
if (defined($sendtime) && $sendtime!~/error/) {
- my $numsendtime = $sendtime;
$sendtime = &Apache::lonlocal::locallocaltime($sendtime);
$critmsgcount ++;
if ($shortsubj eq '') {
@@ -1583,7 +1547,7 @@ sub getloggedin {
}
}
return $logincount;
-}
+}
sub checkversions {
my ($cdom,$crs,$navmap,$changed,$starttime) = @_;
@@ -1601,7 +1565,7 @@ sub checkversions {
'lastrevisiondate');
$revdate = &Apache::lonlocal::locallocaltime($revdate);
my $linkurl=&Apache::lonnet::clutter($key);
- my $usedversion=$navmap->usedVersion('version_'.$linkurl);
+ my $usedversion=$navmap->usedVersion($linkurl);
my @resources = $navmap->getResourceByUrl($linkurl,1);
if (($usedversion) && ($usedversion ne 'mostrecent')) {
$version = $usedversion;
@@ -1685,7 +1649,7 @@ sub display_haserrors {
}
sub display_abovethreshold {
- my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror,$custommenu) = @_;
+ my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror) = @_;
my %lt = &Apache::lonlocal::texthash(
reso => 'Resource',
part => 'Part',
@@ -1699,35 +1663,16 @@ sub display_abovethreshold {
);
if (@{$warnings} > 0) {
@{$warnings} = sort { &cmp_title($a,$b,$res_title) } @{$warnings};
- if ($custommenu) {
- my (%bynum,@overthresh);
- foreach my $item (@{$warnings}) {
- my ($probnum) = ($res_title->{$item} =~ /^Problem\s+(\d+)$/);
- if ($probnum ne '') {
- $bynum{$probnum} = $item;
- }
- }
- foreach my $num (sort { $a <=> $b } keys(%bynum)) {
- push(@overthresh,$bynum{$num});
- }
- @{$warnings} = @overthresh;
- }
- if ($custommenu) {
- $r->print('
'.
- '
'.$lt{'reso'}.'
'.
- '
'.$lt{'part'}.'
'.$lt{'nust'}.'
');
- } else {
- $r->print('');
- }
+ $r->print('
');
} elsif ($itemserror) {
$r->print('
'.$itemserror.'
');
} else {
@@ -1872,7 +1815,7 @@ sub display_crslogins {
'number' => 'Total number of logins',
);
if ($logincount) {
-
+
my $hdr = '
'.
'
'.$lt{'user'}.'
'.
'
'.$lt{'role'}.'
'.
@@ -1914,18 +1857,18 @@ sub display_crslogins {
}
my $table;
foreach my $person (sort(keys(%bylastname))) {
- if (ref($bylastname{$person}) eq 'ARRAY') {
- foreach my $item (@{$bylastname{$person}}) {
+ if (ref($bylastname{$person}) eq 'ARRAY') {
+ foreach my $item (@{$bylastname{$person}}) {
$numlogin ++;
my $css_class = $numlogin%2?' class="LC_odd_row"':'';
- $table .= '
'.$item.'
';
+ $table .= '
'.$item.'
';
}
}
}
my $numrow = 0;
foreach my $role (sort(keys(%counts))) {
my $showrole = &Apache::lonnet::plaintext($role,$crstype);
- if (ref($counts{$role}) eq 'HASH') {
+ if (ref($counts{$role}) eq 'HASH') {
foreach my $sec (sort { $b <=> $a } (keys(%{$counts{$role}}))) {
$numrow ++;
my $css_class = $numrow%2?' class="LC_odd_row"':'';
@@ -2118,19 +2061,19 @@ sub store_interval_setting {
\%interval_settings,$udom,$uname);
if ($outcome eq 'ok') {
if (ref($interval_titles->{$context}) eq 'HASH') {
- $result = &mt('New filter setting: [_1].',''.
- $interval_titles->{$context}->{$env{'form.interval'}}.'').' ';
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('New filter setting: [_1].',''.
+ $interval_titles->{$context}->{$env{'form.interval'}}.'').' ');
}
} else {
my $lctype = lc(&Apache::loncommon::course_type());
&Apache::lonnet::logthis('Error saving whatsnew '.$context.' interval setting'.
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
- $result = &mt('Unable to set interval to [_1] due to [_2].',
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set interval to [_1] due to [_2].',
''.$interval_titles->{$context}->{$env{'form.interval'}}.'',
- ''.$outcome.'. ');
+ ''.$outcome.''),1);
}
}
- return $result;
+ return &Apache::loncommon::confirmwrapper($result);
}
sub store_discussion_setting {
@@ -2142,20 +2085,20 @@ sub store_discussion_setting {
my $outcome = &Apache::lonnet::put('nohist_whatsnew',
\%discussion_settings,$udom,$uname);
if ($outcome eq 'ok') {
- $result = &mt('Count unread posts in discussions display set to [_1]',
- ''.&mt($env{'form.countunread'}).'').' ';
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Count unread posts in discussions display set to [_1]',
+ ''.&mt($env{'form.countunread'}).'').' ');
} else {
my $lctype = lc(&Apache::loncommon::course_type());
&Apache::lonnet::logthis('Error saving whatsnew countunread setting'.
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
- $result = &mt('Unable to set "number unread posts display" to [_1]'.
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set "number unread posts display" to [_1]'.
' due to [_2].',
''.&mt($env{'form.countunread'}).'',
- ''.$outcome.'. ');
+ ''.$outcome.''),1);
}
}
- return $result;
+ return &Apache::loncommon::confirmwrapper($result);
}
sub store_courseinit_setting {
@@ -2180,34 +2123,33 @@ sub store_courseinit_setting {
\%courseinit_settings,$udom,$uname);
if ($outcome eq 'ok') {
if ($page_control eq 'global preferences') {
- $result = &mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'','');
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'',''));
} else {
- $result = &mt('Page displayed after role selection in this '.$lctype.' set to [_1].'
- ,''.$$initpage{$env{'form.courseinit_page'}}.'');
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Page displayed after role selection in this '.$lctype.' set to [_1].'
+ ,''.$$initpage{$env{'form.courseinit_page'}}.''));
}
} else {
&Apache::lonnet::logthis('Error saving whatsnew courseinit '.
'setting: '.$outcome.' for '.$uname.
':'.$udom.' in '.$lctype.' '.$cid);
if ($page_control eq 'global preferences') {
- $result = &mt('Unable to set control of page display to [_1]'.
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set control of page display to [_1]'.
' due to [_2].',
''.$page_control.'',
- ''.$outcome.'. ');
+ ''.$outcome.''),1);
} else {
- $result = &mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].'
+ $result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].'
,''.$$initpage{$env{'form.courseinit_page'}}.''
- ,''.$outcome.'')
- .' ';
+ ,''.$outcome.''),1);
}
}
}
}
- return $result;
+ return &Apache::loncommon::confirmwrapper($result);
}
sub start_box {
- my ($r,$show,$heading,$caller,$refpage,$action,$custommenu) = @_;
+ my ($r,$show,$heading,$caller,$refpage) = @_;
my %lt = &Apache::lonlocal::texthash(
chth => 'Change thresholds?',
chin => 'Change interval?',
@@ -2232,7 +2174,7 @@ sub start_box {
'.$showhide.'
');
if (($caller eq 'abovethreshold') && ($$show{$caller})) {
- if ($$show{$caller} && !$custommenu) {
+ if ($$show{$caller}) {
$r->print('