--- loncom/interface/groupboards.pm 2006/07/14 17:23:49 1.6
+++ loncom/interface/groupboards.pm 2006/07/17 14:52:00 1.7
@@ -50,7 +50,7 @@ sub handler {
}
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['group']);
+ ['group','ref']);
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -62,20 +62,24 @@ sub handler {
my $bodytitle = &mt('[_1] Discussion Boards',$crstype);
my $group = $env{'form.group'};
$group =~ s/\W//g;
- my ($description,$earlyout);
+ my ($description,$earlyout,$refarg);
+
+ if (exists($env{'form.ref'})) {
+ $refarg = 'ref='.$env{'form.ref'};
+ }
&Apache::lonhtmlcommon::clear_breadcrumbs();
if (!defined($group)) {
$earlyout = &mt('No [_1] defined, so there are no [_1] discussion boards to display',$gpterm);
$r->print(&display_error($cdom,$cnum,$group,$description,$gpterm,
- $ucgpterm,$bodytitle,$earlyout));
+ $ucgpterm,$bodytitle,$earlyout,$refarg));
return OK;
}
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum,$group);
if (!defined($curr_groups{$group})) {
$earlyout = &mt('Invalid [_1]',$gpterm);
$r->print(&display_error($cdom,$cnum,$group,$description,$gpterm,
- $ucgpterm,$bodytitle,$earlyout));
+ $ucgpterm,$bodytitle,$earlyout,$refarg));
return OK;
}
my %content = &Apache::longroup::get_group_settings($curr_groups{$group});
@@ -83,33 +87,33 @@ sub handler {
my $can_create=&Apache::lonnet::allowed('cgb',$env{'request.course.id'}.
'/'.$group);
- my $can_view = &Apache::lonnet::allowed('vcg',$env{'request.course.id'});
+ my $can_view = &Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''));
if (!$can_view) {
- $can_view = &Apache::lonnet::allowed('pgd',$env{'request.course.id'}.
+ $can_view = &Apache::lonnet::allowed('vgb',$env{'request.course.id'}.
'/'.$group);
}
if (!$can_view) {
$earlyout=&mt('You do not have privileges to view discussion boards in this [_1]',$gpterm);
$r->print(&display_error($cdom,$cnum,$group,$description,$gpterm,
- $ucgpterm,$bodytitle,$earlyout));
+ $ucgpterm,$bodytitle,$earlyout,$refarg));
return OK;
}
if (defined($env{'form.newbul'})) {
if (($can_create) || (&Apache::lonnet::allowed('mdg',$env{'request.course.id'}))) {
$r->print(&boards_header($cdom,$cnum,$group,$description,$gpterm,
- $ucgpterm,$bodytitle));
+ $ucgpterm,$bodytitle,$refarg));
my ($outcome,$newurl,$bbtitle) =
&create_board($cdom,$cnum,$group,$env{'form.newbul'});
if ($outcome eq 'ok') {
my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
$r->print(&mt('The new discussion board was added successfully.
'));
$r->print('
'. - ''. - &mt('Edit [_1] board',$bbtitle).' | '. + ''.&mt('Edit [_1] board',$bbtitle).''. ''. - ''. - &mt('View all group discussion boards'). + ''.&mt('View all group discussion boards'). ' |