'.
'';
- my $escsymb=&Apache::lonnet::escape($ressymb);
+ my $escsymb=&escape($ressymb);
if ($visible>2) {
$discussion.=''.
''.&mt('Threaded View').' '.
''.&mt('Chronological View').'
'.&mt('Sorting/Filtering options').'  ';
} else {
$discussion .= ' | ';
@@ -419,12 +444,17 @@ imscp_v1p1.xsd http://www.imsglobal.org/
if ($newpostsflag) {
$discussion .= '&previous='.$prevread;
}
+ $discussion .= &group_args($group);
$discussion .= '">'.&mt('Export').'? | ';
if ($newpostsflag) {
if (!$markondisp) {
- $discussion .=''.
- &mt('Preferences on what is marked as NEW').
- ' '.&mt('Mark NEW posts no longer new').'';
+ $discussion .=' | '.
+ &mt('Preferences on what is marked as NEW').
+ ' '.&mt('Mark NEW posts no longer new').'';
} else {
$discussion .= ' | | ';
}
@@ -441,6 +471,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/
if ($newpostsflag) {
$discussion .= '&previous='.$prevread;
}
+ $discussion .= &group_args($group);
$discussion .= '">'.&mt('Show all posts').' '.&mt('to display').' '.
$numhidden.' ';
if ($showunmark) {
@@ -609,6 +640,10 @@ END
$filterchoice = ''.&mt('sections').'- '.$env{'form.sectionpick'};
$filterchoice .= ' ';
}
+ if (@grouppick > 0) {
+ $filterchoice = ''.&mt('groups').'- '.$env{'form.grouppick'};
+ $filterchoice .= ' ';
+ }
if (@rolefilter > 0) {
$filterchoice .= ''.&mt('roles').'-';
foreach (@rolefilter) {
@@ -687,88 +722,126 @@ END
if ($discussiononly) {
my $now = time;
my $attachnum = 0;
- my $newattachmsg = '';
- my @currnewattach = ();
- my @currdelold = ();
+ my $currnewattach = [];
+ my $currdelold = [];
my $comment = '';
my $subject = '';
if ($env{'form.origpage'}) {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['addnewattach','deloldattach','delnewattach','timestamp','idx','subject','comment']);
- $subject = &Apache::lonnet::unescape($env{'form.subject'});
- $comment = &Apache::lonnet::unescape($env{'form.comment'});
+ $subject = &unescape($env{'form.subject'});
+ $comment = &unescape($env{'form.comment'});
my @keepold = ();
- &process_attachments(\@currnewattach,\@currdelold,\@keepold);
- if (@currnewattach > 0) {
- $attachnum += @currnewattach;
+ &process_attachments($currnewattach,$currdelold,\@keepold);
+ if (@{$currnewattach} > 0) {
+ $attachnum += @{$currnewattach};
}
}
if (&discussion_open($status)) {
- $discussion.=(<
-
-
-
-
-
-
-Note: in anonymous discussion, your name is visible only
-to course faculty
-Title:
-
-ENDDISCUSS
- if ($env{'form.origpage'}) {
- $discussion.=''."\n";
- foreach (@currnewattach) {
- $discussion.=''."\n";
- }
- }
- $discussion.="\n";
- if ($outputtarget ne 'tex') {
- $discussion.=&generate_attachments_button('',$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,'',$mode);
- if (@currnewattach > 0) {
- $newattachmsg .= 'New attachments ';
- if (@currnewattach > 1) {
- $newattachmsg .= '';
- foreach my $item (@currnewattach) {
- $item =~ m#.*/([^/]+)$#;
- $newattachmsg .= '- '.$1.'
'."\n";
- }
- $newattachmsg .= ' '."\n";
- } else {
- $currnewattach[0] =~ m#.*/([^/]+)$#;
- $newattachmsg .= ''.$1.' '."\n";
- }
+ if (($group ne '') && ($mode eq 'board')) {
+ if (&check_group_priv($group,'pgd') eq 'ok') {
+ $discussion .=
+ &postingform_display($mode,$ressymb,$now,$subject,
+ $comment,$outputtarget,$attachnum,
+ $currnewattach,$currdelold,
+ $group);
}
- $discussion.=$newattachmsg;
- $discussion.=&generate_preview_button();
- }
+ } else {
+ $discussion.=
+ &postingform_display($mode,$ressymb,$now,$subject,
+ $comment,$outputtarget,$attachnum,
+ $currnewattach,$currdelold);
+ }
}
} else {
+ $discussion.='';
if (&discussion_open($status) &&
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
if ($outputtarget ne 'tex') {
- $discussion.='';
- }
+ $discussion.=''.
+ ''.
+ &mt('Post Discussion').' ';
+ }
}
+ $discussion.=''.
+ &mt('Send Message').' | ';
}
return $discussion;
}
+sub postingform_display {
+ my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
+ $currnewattach,$currdelold,$group) = @_;
+ my $newattachmsg;
+ my $postingform = (<
+
+
+
+
+Note: in anonymous discussion, your name is visible only
+to course faculty
+Title:
+
+ENDDISCUSS
+ if ($env{'form.origpage'}) {
+ $postingform .= ''."\n";
+ foreach my $att (@{$currnewattach}) {
+ $postingform .= ''."\n";
+ }
+ }
+ if (exists($env{'form.ref'})) {
+ $postingform .= '';
+ }
+ if ($group ne '') {
+ $postingform .='';
+ }
+ $postingform .= "\n";
+ if ($outputtarget ne 'tex') {
+ $postingform .= &generate_attachments_button('',$attachnum,$ressymb,
+ $now,$currnewattach,
+ $currdelold,'',$mode);
+ if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
+ $newattachmsg = ' New attachments ';
+ if (@{$currnewattach} > 1) {
+ $newattachmsg .= '';
+ foreach my $item (@{$currnewattach}) {
+ $item =~ m#.*/([^/]+)$#;
+ $newattachmsg .= '- '.$1.'
'."\n";
+ }
+ $newattachmsg .= ' '."\n";
+ } else {
+ $$currnewattach[0] =~ m#.*/([^/]+)$#;
+ $newattachmsg .= ''.$1.' '."\n";
+ }
+ }
+ $postingform .= $newattachmsg;
+ $postingform .= &generate_preview_button();
+ }
+ return $postingform;
+}
+
sub build_posting_display {
- my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt) = @_;
+ my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_;
my @original=();
my @index=();
+ my $skip_group_check = 0;
my $symb=&Apache::lonenc::check_decrypt($ressymb);
- my $escsymb=&Apache::lonnet::escape($ressymb);
+ my $escsymb=&escape($ressymb);
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
+ if ((@{$grouppick} == 0) || (grep(/^all$/,@{$grouppick}))) {
+ $skip_group_check = 1;
+ }
if ($contrib{'version'}) {
my $oldest = $contrib{'1:timestamp'};
if ($prevread eq '0') {
@@ -776,7 +849,8 @@ sub build_posting_display {
}
my ($skiptest,$rolematch,$roleregexp,$secregexp,$statusregexp);
if ($sortposts) {
- ($skiptest,$roleregexp,$secregexp,$statusregexp) = &filter_regexp($rolefilter,$sectionpick,$statusfilter);
+ ($skiptest,$roleregexp,$secregexp,$statusregexp) =
+ &filter_regexp($rolefilter,$sectionpick,$statusfilter);
$rolematch = $roleregexp.':'.$secregexp.':'.$statusregexp;
}
for (my $id=1;$id<=$contrib{'version'};$id++) {
@@ -865,7 +939,7 @@ sub build_posting_display {
@{$$subjectsort{$subject}} = ("$idx");
}
}
- if ((!$contrib{$idx.':anonymous'}) || ($seeid)) {
+ if ((!$contrib{$idx.':anonymous'}) || (&Apache::lonnet::allowed('rin',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')))) {
$sender=&Apache::loncommon::aboutmewrapper(
$plainname,
$contrib{$idx.':sendername'},
@@ -906,16 +980,19 @@ sub build_posting_display {
} else {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
- if (&editing_allowed()) {
+ if (&editing_allowed($escsymb.':::'.$idx,$group)) {
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
$sender.=' '.&mt('Edit').'';
+ $sender .= &group_args($group);
+ $sender .= '" '.$target.'>'.&mt('Edit').'';
+
unless ($seeid) {
- $sender.=" ';
}
}
@@ -936,14 +1013,13 @@ sub build_posting_display {
if ($$newpostsflag) {
$sender .= '&previous='.$prevread;
}
+ $sender .= &group_args($group);
$sender .= '">'.&mt('Hide').'';
- }
- $sender.=' '.&mt('Delete').'';
+ }
+ my $grpargs = &group_args($group);
+ $sender.=
+ " ";
+ $sender .= &mt('Delete').'';
}
} else {
if ($screenname) {
@@ -970,16 +1046,27 @@ sub build_posting_display {
@{$$namesort{'__anon'}{'__anon'}} = ("$idx");
}
}
- if (&discussion_open($status) &&
- &Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $sender.=' '.&mt('Reply').'';
+ } elsif (&Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.
+ $env{'request.course.sec'}:''))) {
+ $sender.=' '.&mt('Reply').'';
}
- $sender .= '" '.$target.'>'.&mt('Reply').'';
}
if ($viewgrades) {
$vgrlink=&Apache::loncommon::submlink('Submissions',
@@ -1036,7 +1123,7 @@ sub build_posting_display {
my $uname = $contrib{$idx.':sendername'};
my $udom = $contrib{$idx.':senderdomain'};
my $poster = $uname.':'.$udom;
- if (defined($env{'form.totposters'})) {
+ if ($env{'form.totposters'} ne '') {
if ($totposters == 0) {
$$shown{$idx} = 0;
} elsif ($totposters > 0) {
@@ -1061,6 +1148,23 @@ sub build_posting_display {
}
}
}
+ if ($$shown{$idx} && !$skip_group_check) {
+ my $showflag = 0;
+ if (ref($$classgroups{$poster}{active}) eq 'HASH') {
+ foreach my $grp (@{$grouppick}) {
+ if (grep/^\Q$grp\E$/,
+ keys(%{$$classgroups{$poster}{active}})) {
+ $showflag = 1;
+ last;
+ }
+ }
+ }
+ if ($showflag) {
+ $$shown{$idx} = 1;
+ } else {
+ $$shown{$idx} = 0;
+ }
+ }
} else {
$$shown{$idx} = 1;
}
@@ -1091,7 +1195,9 @@ sub build_posting_display {
my @postversions = ();
$$discussionitems[$idx] .= &mt('This post has been edited by the author.');
if ($seeid) {
- $$discussionitems[$idx] .= ' '.&mt('Display all versions').'';
+ $$discussionitems[$idx] .= ' '.&mt('Display all versions').'';
}
$$discussionitems[$idx].=' '.&mt('Earlier version(s) were posted on: ');
if ($contrib{$idx.':history'} =~ m/:/) {
@@ -1154,6 +1260,7 @@ sub filter_regexp {
$secregexp .= '[^:]*';
}
}
+
if (defined($statusfilter) && $statusfilter ne '') {
if ($statusfilter eq 'all') {
$statusregexp = '[^:]+';
@@ -1174,7 +1281,7 @@ sub get_post_contents {
%{$$imsfiles{$idx}}=();
if ($type eq 'allversions') {
unless($seeid) {
- $discussion=&mt('You do not have privileges to view all versions of posts.').&mt('Please select a different role');
+ $discussion=&mt('You do not have privileges to view all versions of posts.').' '.&mt('Please select a different role.');
return $discussion;
}
}
@@ -1301,7 +1408,7 @@ sub replicate_attachments {
sub mail_screen {
my ($r,$feedurl,$options) = @_;
if (exists($env{'form.origpage'})) {
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog']);
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']);
}
my $title=&Apache::lonnet::gettitle($feedurl);
@@ -1323,12 +1430,15 @@ sub mail_screen {
my $attachnum = 0;
my $anonchk = (< 0) {
my %msgversions = ();
&get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);
- $message = $msgversions{$numoldver};
+ $quote = $msgversions{$numoldver};
}
- &newline_to_br(\$message);
- $quote=''.&Apache::lontexconvert::msgtexconverted($message).' ';
if ($idx > 0) {
my %subversions = ();
&get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver);
@@ -1409,20 +1518,17 @@ END
$parentmsg = $contrib{$idx.':replyto'};
}
unless (exists($env{'form.origpage'})) {
- my $anonflag = 0;
+ my $anonflag = 'nonanon';
if ($contrib{$idx.':anonymous'}) {
- $anonflag = 1;
+ $anonflag = 'anon';
}
$anonscript = (< \%onload});
+ if ($quote ne '') {
+ &newline_to_br(\$quote);
+ $quote=''.&Apache::lontexconvert::msgtexconverted($quote).' ';
+ }
+
$r->print(<$title
@@ -1558,6 +1652,12 @@ Attachment (128 KB max size):
END
}
+ if (exists($env{'form.group'})) {
+ $r->print('');
+ }
+ if (exists($env{'form.ref'})) {
+ $r->print('');
+ }
$r->print(<
@@ -1578,7 +1678,7 @@ END
$r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver));
if ($attachnum > 0) {
if (@currnewattach > 0) {
- $newattachmsg .= 'New attachments ';
+ $newattachmsg .= ' New attachments ';
if (@currnewattach > 1) {
$newattachmsg .= '';
foreach my $item (@currnewattach) {
@@ -1592,7 +1692,7 @@ END
}
}
if ($attachmsg) {
- $r->print("Retained attachments:$attachmsg \n");
+ $r->print(" Retained attachments:$attachmsg \n");
}
if ($newattachmsg) {
$r->print("$newattachmsg ");
@@ -1749,44 +1849,45 @@ END
my $end_page =
&Apache::loncommon::end_page();
$r->print(<
+$start_page
+
$end_page
-END
+ ");
return;
}
@@ -1811,28 +1920,55 @@ sub print_sortfilter_options {
$r->send_http_header;
&Apache::lonenc::check_encrypt(\$symb);
- my @sections = ();
+ my @sections;
my $section_sel = '';
- my $numsections = 0;
my $numvisible = 5;
- my %sectioncount = ();
-
- $numsections = &Apache::loncommon::get_sections($env{'course.'.$env{'request.course.id'}.'.domain'},$env{'course.'.$env{'request.course.id'}.'.num'},\%sectioncount);
+ my @groups;
+ my $group_sel = '';
+ my $numgroupvis = 5;
+ my %sectioncount = &Apache::loncommon::get_sections();
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section
@sections = ('all',$env{'request.course.sec'});
$numvisible = 2;
} else {
@sections = sort {$a cmp $b} keys(%sectioncount);
+ if (scalar(@sections) < 4) {
+ $numvisible = scalar(@sections) + 1;
+ }
unshift(@sections,'all'); # Put 'all' at the front of the list
- if ($numsections < 4) {
- $numvisible = $numsections + 1;
+
+ }
+ foreach my $sec (@sections) {
+ $section_sel .= " \n";
+ }
+
+ if (&check_group_priv() eq 'ok') {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum);
+ @groups = sort {$a cmp $b} keys(%curr_groups);
+ if (scalar(@groups) < 4) {
+ $numgroupvis = scalar(@groups) + 1;
+ }
+ unshift(@groups,'all'); # Put 'all' at the front of the list
+ } else {
+ my @coursegroups = split(/:/,$env{'request.course.groups'});
+ if (@coursegroups > 0) {
+ @coursegroups = sort {$a cmp $b} @coursegroups;
+ @groups = ('all',@coursegroups);
+ if (scalar(@groups) < 4) {
+ $numgroupvis = scalar(@groups) + 1;
+ }
+ } else {
+ @groups = ('all');
+ $numgroupvis = 1;
}
}
- foreach (@sections) {
- $section_sel .= " $_\n";
+ foreach my $group (@groups) {
+ $group_sel .= " \n";
}
-
+
my $function = &Apache::loncommon::get_users_function();
my $tabcolor = &Apache::loncommon::designparm($function.'.tabbg',
$env{'user.domain'});
@@ -1845,6 +1981,7 @@ sub print_sortfilter_options {
'spur' => 'Specific user roles',
'sprs' => 'Specific role status',
'spse' => 'Specific sections',
+ 'spgr' => 'Specific groups',
'psub' => 'Pick specific users (by name)',
'shal' => 'Show a list of current posters'
);
@@ -1876,6 +2013,17 @@ function verifyFilter() {
if (secnum == 0) {
document.modifyshown.sectionpick.options[0].selected = true
}
+
+ var grpnum = 0
+ for (var i=0; i
@@ -1901,48 +2049,56 @@ $start_page
|
$lt{'spse'} |
|
+ $lt{'spgr'} |
+ |
$lt{'psub'} |
-
+ |
|
|
-
+ |
|
|
-
+ |
|
|
-
+ |
|
|
- |
+
+
+ |
+ |
+ |
@@ -1950,11 +2106,19 @@ $start_page
+END
+ if (exists($env{'form.group'})) {
+ $r->print('');
+ }
+ if (exists($env{'form.ref'})) {
+ $r->print('');
+ }
+ $r->print("
$end_page
-END
+");
}
sub print_showposters {
@@ -1969,19 +2133,36 @@ sub print_showposters {
$crs.='_'.$env{'request.course.sec'};
}
$crs=~s/\_/\//g;
- my $seeid=&Apache::lonnet::allowed('rin',$crs);
+ my $seeid;
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $group = $env{'form.group'};
+ my $ressymb = &wrap_symb($symb);
+ if (($group ne '') &&
+ ($ressymb =~ m|^bulletin___ \d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) {
+ if (&check_group_priv($group,'dgp') eq 'ok') {
+ $seeid = 1;
+ }
+ } else {
+ $seeid=&Apache::lonnet::allowed('rin',$crs);
+ }
my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
- $env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'});
+ $cdom,$cnum);
my %namesort = ();
my %postcounts = ();
+ my %lt = &Apache::lonlocal::texthash(
+ sele => 'Select',
+ full => 'Fullname',
+ usdo => 'Username/domain',
+ post => 'Posts',
+ );
if ($contrib{'version'}) {
for (my $idx=1;$idx<=$contrib{'version'};$idx++) {
my $hidden=($contrib{'hidden'}=~/\.$idx\./);
my $deleted=($contrib{'deleted'}=~/\.$idx\./);
unless ((($hidden) && (!$seeid)) || ($deleted)) {
- if ((!$contrib{$idx.':anonymous'}) || ($seeid)) {
+ if ((!$contrib{$idx.':anonymous'}) || (&Apache::lonnet::allowed('rin',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')))) {
my %names = &Apache::lonnet::get('environment',['firstname','lastname'],$contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'});
my $lastname = $names{'lastname'};
my $firstname = $names{'firstname'};
@@ -2009,19 +2190,17 @@ sub print_showposters {
}
my $start_page = &Apache::loncommon::start_page('Discussion options');
-
+ my $table_start =&Apache::loncommon::start_data_table();
$r->print(<
-
-
-
-
@@ -2131,18 +2311,18 @@ ENDFAILREDIR
}
sub redirect_back {
- my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$blog,$status,$previous,$sort,$rolefilter,$statusfilter,$sectionpick,$numpicks) = @_;
+ my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$blog,$status,$previous,$sort,$rolefilter,$statusfilter,$sectionpick,$grouppick,$numpicks,$group) = @_;
my $sorttag = '';
my $roletag = '';
my $statustag = '';
my $sectag = '';
+ my $grptag = '';
my $userpicktag = '';
my $qrystr = '';
my $prevtag = '';
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
-
&dewrapper(\$feedurl);
if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
if ($previous > 0) {
@@ -2181,6 +2361,20 @@ sub redirect_back {
$feedurl .= '§ionpick='.$sectionpick;
$sectag = '';
}
+ if (ref($grouppick) eq 'ARRAY') {
+ $feedurl .= '&grouppick=';
+ $sectag .= '';
+ } else {
+ $feedurl .= '&grouppick='.$grouppick;
+ $grptag = '';
+ }
if (ref($rolefilter) eq 'ARRAY') {
$feedurl .= '&rolefilter=';
$roletag .= '';
}
}
+ my $grouptag;
+ if ($group ne '') {
+ $grouptag = ''; my $refarg;
+ if (exists($env{'form.ref'})) {
+ $refarg = '&ref='.$env{'form.ref'};
+ $grouptag .= '';
+ }
+ if ($feedurl =~ /\?/) {
+ $feedurl .= '&group='.$group.$refarg;
+ } else {
+ $feedurl .= '?group='.$group.$refarg;
+ }
+ }
$feedurl=&Apache::lonenc::check_encrypt($feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
- my %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }");
+ my %onload;
+ if ($env{'environment.remote'} ne 'off') {
+ $onload{'onload'} =
+ "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
+ }
my $start_page=
- &Apache::loncommon::start_page('New posts marked as read',undef,
- {'redirect' => [2,$feedurl],
+ &Apache::loncommon::start_page('Feedback sent',undef,
+ {'redirect' => [0,$feedurl],
'only_body' => 1,
'add_entries' => \%onload});
my $end_page = &Apache::loncommon::end_page();
-
$r->print(<
@@ -2222,7 +2432,9 @@ $sorttag
$statustag
$roletag
$sectag
+$grptag
$userpicktag
+$grouptag
$end_page
ENDREDIR
@@ -2232,8 +2444,15 @@ sub no_redirect_back {
my ($r,$feedurl) = @_;
my $nofeed=&mt('Sorry, no feedback possible on this resource ...');
+ my %onload;
+ if ($env{'environment.remote'} ne 'off') {
+ $onload{'onload'} =
+ "if (window.name!='loncapaclient') { self.window.close(); }";
+ }
+
my %body_options = ('only_body' => 1,
- 'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"});
+ 'bgcolor' => '#FFFFFF',
+ 'add_entries' => \%onload,);
if ($feedurl !~ m{^/adm/feedback}) {
$body_options{'rediect'} = [2,$feedurl];
@@ -2247,8 +2466,7 @@ sub no_redirect_back {
$feedurl=&Apache::lonenc::check_encrypt($feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
$r->print (<
-
+$start_page
$nofeed
@@ -2263,36 +2481,35 @@ sub screen_header {
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) {
$msgoptions=
- ' | |