version 1.88, 2009/02/19 16:12:21
|
version 1.99.2.1, 2010/01/27 14:35:46
|
Line 42 use Time::Local;
|
Line 42 use Time::Local;
|
use GDBM_File; |
use GDBM_File; |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
|
use HTML::Entities; |
|
|
#---------------------------- |
#---------------------------- |
# handler |
# handler |
Line 99 sub handler {
|
Line 100 sub handler {
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew', |
({href=>'/adm/whatsnew', |
text=>"Display Action Items"}); |
text=>"What's New?"}); |
if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) { |
if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, |
({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, |
Line 267 END
|
Line 268 END
|
'; |
'; |
} |
} |
my $course_type=&Apache::loncommon::course_type(); |
my $course_type=&Apache::loncommon::course_type(); |
return &Apache::loncommon::start_page($course_type.' Action Items', |
return &Apache::loncommon::start_page("What's New?", |
$scripttag); |
$scripttag); |
} |
} |
|
|
Line 288 sub display_actions_box {
|
Line 289 sub display_actions_box {
|
my $lctype = lc($crstype); |
my $lctype = lc($crstype); |
my %stulabel = ( |
my %stulabel = ( |
'Course' => 'students', |
'Course' => 'students', |
'Group' => 'members', |
'Community' => 'members', |
); |
); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'yacc' => 'You are accessing an invalid course', |
'yacc' => 'You are accessing an invalid course', |
Line 341 sub display_actions_box {
|
Line 342 sub display_actions_box {
|
return; |
return; |
} |
} |
|
|
|
my $header = ''; |
if ($refpage eq 'start') { |
if ($refpage eq 'start') { |
if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db', |
if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db', |
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
my $furl=$bighash{'first_url'}; |
my $furl=&HTML::Entities::encode($bighash{'first_url'},'"<>&'); |
untie(%bighash); |
untie(%bighash); |
$r->print('<span style="font-size: larger;"><a href="'.$furl.'">'.$lt{'gtfr'}. |
$r->print('<span style="font-size: larger;"><a href="'.$furl.'">'.$lt{'gtfr'}. |
'</a></span><br />'); |
'</a></span><br />'); |
Line 354 sub display_actions_box {
|
Line 356 sub display_actions_box {
|
.' <span class="LC_nobreak">' |
.' <span class="LC_nobreak">' |
.&mt('Currently: [_1].','<i>'.$currinit.'</i>') |
.&mt('Currently: [_1].','<i>'.$currinit.'</i>') |
.' ' |
.' ' |
.&mt('[_1]Change[_2] for just [_3]this course[_4] or for all [_5]your courses[_6].' |
.&mt('[_1]Change[_2] for just [_3]this '.$lctype.'[_4] or for [_5]all your courses/communities[_6].' |
,'<b>' |
,'<b>' |
,'</b>' |
,'</b>' |
,'<a href="/adm/whatsnew?command=courseinit&refpage='.$refpage.'">' |
,'<a href="/adm/whatsnew?command=courseinit&refpage='.$refpage.'">' |
Line 363 sub display_actions_box {
|
Line 365 sub display_actions_box {
|
,'</a>') |
,'</a>') |
.' </span><br /><hr />'); |
.' </span><br /><hr />'); |
|
|
|
$r->print(&Apache::loncommon::head_subbox($header)); |
|
|
if ($command eq 'reset') { |
if ($command eq 'reset') { |
$result = &process_reset($cdom,$crs); |
$result = &process_reset($cdom,$crs); |
} elsif ($command eq 'update') { |
} elsif ($command eq 'update') { |
Line 378 sub display_actions_box {
|
Line 382 sub display_actions_box {
|
unless ($store_result eq 'ok') { |
unless ($store_result eq 'ok') { |
&Apache::lonnet::logthis('Error saving whatsnew settings: '. |
&Apache::lonnet::logthis('Error saving whatsnew settings: '. |
$store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
$store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
$result .= &mt('Unable to save visibility settings due to [_1]', |
$result .= '<span class="LC_error">' |
$store_result); |
.&mt('Unable to save visibility settings due to [_1]', |
|
$store_result) |
|
.'</span>'; |
} |
} |
|
|
if ($result) { |
if ($result) { |
$r->print($result.'<hr width="100%" />'); |
$r->print($result.'<hr />'); |
} |
} |
$r->rflush(); |
$r->rflush(); |
|
|
Line 683 function toggle_countunread(choice) {
|
Line 689 function toggle_countunread(choice) {
|
$r->print('<br />' |
$r->print('<br />' |
.&mt('Choose whether or not to display a count of the number of new posts for each resource or discussion board which has unread posts.') |
.&mt('Choose whether or not to display a count of the number of new posts for each resource or discussion board which has unread posts.') |
.'<br />' |
.'<br />' |
.&mt("This can increase the time taken to gather data for the '<i>What's New Page</i>' by a few seconds.") |
.&mt("This can increase the time taken to gather data for the [_1]What's New Page[_2] by a few seconds.",'<i>','</i>') |
.' ' |
.' ' |
.&mt('Currently set to [_1].','<b>'.$current.'</b>.') |
.&mt('Currently set to [_1].','<b>'.$current.'</b>.') |
); |
); |
Line 725 sub courseinit_config {
|
Line 731 sub courseinit_config {
|
'anis' => 'and is set to display', |
'anis' => 'and is set to display', |
'padc' => 'Page display controlled by', |
'padc' => 'Page display controlled by', |
'chce' => 'Choose '.$lctype.' entry', |
'chce' => 'Choose '.$lctype.' entry', |
'moce' => 'Modify '.$lctype.' entry', |
'moce' => 'Save', |
); |
); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<br />$lt{'chwp'} |
<br />$lt{'chwp'} |
Line 1124 sub process_reset {
|
Line 1130 sub process_reset {
|
|
|
sub process_update { |
sub process_update { |
my ($uname,$udom,$threshold_titles) = @_; |
my ($uname,$udom,$threshold_titles) = @_; |
my $setoutput = '<b>'.&mt('Changes to threshold(s) for problem tracking:').'</b><br />'; |
my $setoutput = '<b>'.&mt('Changes to threshold(s) for problem tracking:').'</b><br/><br />'; |
foreach (keys %env) { |
foreach (keys %env) { |
next if ($_!~/^form\.(.+)\_setparmval$/); |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name = $1; |
my $name = $1; |
Line 1135 sub process_update {
|
Line 1141 sub process_update {
|
|
|
my ($shortname) = ($name =~ /^\Q$env{'request.course.id'}\E:threshold_(.+)$/); |
my ($shortname) = ($name =~ /^\Q$env{'request.course.id'}\E:threshold_(.+)$/); |
if ($put_result eq 'ok') { |
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]', |
'<b>'.$$threshold_titles{$shortname}.'</b>', |
'<b>'.$$threshold_titles{$shortname}.'</b>', |
'<b>'.$value.'</b>').'<br />'; |
'<b>'.$value.'</b>').'<br />'); |
} else { |
} 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].', |
'<b>'.$name.'</b>','<b>'.$value.'</b>', |
'<b>'.$name.'</b>','<b>'.$value.'</b>', |
'<tt>'.$put_result.'</tt>').'<br />'; |
'<tt>'.$put_result.'</tt>').'<br />',1); |
} |
} |
} |
} |
} |
} |
return $setoutput; |
return &Apache::loncommon::confirmwrapper($setoutput); |
} |
} |
|
|
sub getnormalmail { |
sub getnormalmail { |
Line 1161 sub getnormalmail {
|
Line 1167 sub getnormalmail {
|
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
my $numsendtime = $sendtime; |
my $numsendtime = $sendtime; |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
|
if ($status eq 'new') { |
if ($status eq 'new') { |
$msgcount ++; |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
|
$msgcount ++; |
if ($shortsubj eq '') { |
if ($shortsubj eq '') { |
$shortsubj = &mt('No subject'); |
$shortsubj = &mt('No subject'); |
} |
} |
Line 1835 sub store_interval_setting {
|
Line 1841 sub store_interval_setting {
|
\%interval_settings,$udom,$uname); |
\%interval_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
if (ref($interval_titles->{$context}) eq 'HASH') { |
if (ref($interval_titles->{$context}) eq 'HASH') { |
$result = &mt('New filter setting: [_1].','<b>'. |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('New filter setting: [_1].','<b>'. |
$interval_titles->{$context}->{$env{'form.interval'}}.'</b>').'<br />'; |
$interval_titles->{$context}->{$env{'form.interval'}}.'</b>').'<br />'); |
} |
} |
} else { |
} else { |
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
&Apache::lonnet::logthis('Error saving whatsnew '.$context.' interval setting'. |
&Apache::lonnet::logthis('Error saving whatsnew '.$context.' interval setting'. |
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
' '.$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].', |
'<b>'.$interval_titles->{$context}->{$env{'form.interval'}}.'</b>', |
'<b>'.$interval_titles->{$context}->{$env{'form.interval'}}.'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>'),1); |
} |
} |
} |
} |
return $result; |
return &Apache::loncommon::confirmwrapper($result); |
} |
} |
|
|
sub store_discussion_setting { |
sub store_discussion_setting { |
Line 1859 sub store_discussion_setting {
|
Line 1865 sub store_discussion_setting {
|
my $outcome = &Apache::lonnet::put('nohist_whatsnew', |
my $outcome = &Apache::lonnet::put('nohist_whatsnew', |
\%discussion_settings,$udom,$uname); |
\%discussion_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
$result = &mt('Count unread posts in discussions display set to [_1]', |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('Count unread posts in discussions display set to [_1]', |
'<b>'.&mt($env{'form.countunread'}).'</b>').'<br />'; |
'<b>'.&mt($env{'form.countunread'}).'</b>').'<br />'); |
|
|
} else { |
} else { |
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
&Apache::lonnet::logthis('Error saving whatsnew countunread setting'. |
&Apache::lonnet::logthis('Error saving whatsnew countunread setting'. |
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
' '.$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].', |
' due to [_2].', |
'<b>'.&mt($env{'form.countunread'}).'</b>', |
'<b>'.&mt($env{'form.countunread'}).'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>'),1); |
} |
} |
} |
} |
return $result; |
return &Apache::loncommon::confirmwrapper($result); |
} |
} |
|
|
sub store_courseinit_setting { |
sub store_courseinit_setting { |
Line 1897 sub store_courseinit_setting {
|
Line 1903 sub store_courseinit_setting {
|
\%courseinit_settings,$udom,$uname); |
\%courseinit_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
if ($page_control eq 'global preferences') { |
if ($page_control eq 'global preferences') { |
$result = &mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'<b>','</b>'); |
$result = &Apache::lonhtmlcommon::confirm_success(&mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'<b>','</b>')); |
} else { |
} else { |
$result = &mt('Page displayed after role selection in this '.$lctype.' set to [_1].' |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('Page displayed after role selection in this '.$lctype.' set to [_1].' |
,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>'); |
,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>')); |
} |
} |
} else { |
} else { |
&Apache::lonnet::logthis('Error saving whatsnew courseinit '. |
&Apache::lonnet::logthis('Error saving whatsnew courseinit '. |
'setting: '.$outcome.' for '.$uname. |
'setting: '.$outcome.' for '.$uname. |
':'.$udom.' in '.$lctype.' '.$cid); |
':'.$udom.' in '.$lctype.' '.$cid); |
if ($page_control eq 'global preferences') { |
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].', |
' due to [_2].', |
'<b>'.$page_control.'</b>', |
'<b>'.$page_control.'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>'),1); |
} else { |
} 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].' |
,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>' |
,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>' |
,'<tt>'.$outcome.'</tt>') |
,'<tt>'.$outcome.'</tt>'),1); |
.'<br />'; |
|
} |
} |
} |
} |
} |
} |
} |
} |
return $result; |
return &Apache::loncommon::confirmwrapper($result); |
} |
} |
|
|
sub start_box { |
sub start_box { |
Line 1952 sub start_box {
|
Line 1957 sub start_box {
|
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'">'.$lt{'chth'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'">'.$lt{'chth'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif (($caller eq 'versionchanges') && ($$show{$caller})) { |
} elsif (($caller eq 'versionchanges') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif ($caller eq 'coursediscussion') { |
} elsif ($caller eq 'coursediscussion') { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif (($caller eq 'newroles') && ($$show{$caller})) { |
} elsif (($caller eq 'newroles') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgnewroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgnewroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif (($caller eq 'oldroles') && ($$show{$caller})) { |
} elsif (($caller eq 'oldroles') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgoldroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgoldroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} |
} |