version 1.36, 2006/07/08 01:23:13
|
version 1.38, 2006/07/20 22:50:50
|
Line 78 sub handler {
|
Line 78 sub handler {
|
# ------------------------------------------------------------ Get Query String |
# ------------------------------------------------------------ Get Query String |
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['forcestudent','forceedit','register', |
($ENV{'QUERY_STRING'},['forcestudent','forceedit','register', |
'origpage','group']); |
'origpage','group','ref']); |
# ----------------------------------------------------- Force menu registration |
# ----------------------------------------------------- Force menu registration |
my %addentries; |
my %addentries; |
if ($env{'form.origpage'}) { |
if ($env{'form.origpage'}) { |
Line 90 sub handler {
|
Line 90 sub handler {
|
|
|
my $forceedit=''; |
my $forceedit=''; |
if ($env{'form.forceedit'}) { $forceedit='edit'; } |
if ($env{'form.forceedit'}) { $forceedit='edit'; } |
|
my $refarg = ''; |
|
if (exists($env{'form.ref'})) { $refarg = 'ref='.$env{'form.ref'}; } |
|
|
my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs); |
my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs); |
|
|
Line 134 sub handler {
|
Line 136 sub handler {
|
my $gpterm = &Apache::loncommon::group_term(); |
my $gpterm = &Apache::loncommon::group_term(); |
my $ucgpterm = $gpterm; |
my $ucgpterm = $gpterm; |
$ucgpterm =~ s/^(\w)/uc($1)/e; |
$ucgpterm =~ s/^(\w)/uc($1)/e; |
my ($groupboards,$boards) = &Apache::longroup::get_group_bbinfo( |
my ($groupboards,$boards) = |
$dom,$crs,$group); |
&Apache::longroup::get_group_bbinfo($dom,$crs,$group,$boardurl); |
my $boardtitle = $$boards{$marker}{'title'}; |
my $boardtitle; |
|
if ((ref($groupboards) eq 'ARRAY') && (@{$groupboards} > 0)) { |
|
$boardtitle = $$boards{$$groupboards[0]}{'title'}; |
|
} |
$boardurl .= '?register=1&group='.$group; |
$boardurl .= '?register=1&group='.$group; |
$r->print(&groupboard_breadcrumbs($dom,$crs,$group,$gpterm, |
$r->print(&groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm, |
$ucgpterm,$grp_desc,$boardurl,$boardtitle)); |
$ucgpterm,$grp_desc,$boardurl,$boardtitle)); |
} |
} |
} |
} |
my ($allowed); |
my ($allowed); |
if ($group ne '') { |
if ($group ne '') { |
$allowed=&Apache::lonnet::allowed('mdg',$env{'request.course.id'}); |
$allowed=&Apache::lonnet::allowed('mdg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); |
if (!$allowed) { |
if (!$allowed) { |
$allowed = &Apache::lonnet::allowed('cgb',$env{'request.course.id'}. |
$allowed = &Apache::lonnet::allowed('cgb',$env{'request.course.id'}. |
'/'.$group); |
'/'.$group); |
} |
} |
if (!$allowed) { |
if (!$allowed) { |
if ((!&Apache::lonnet::allowed('vcg',$env{'request.course.id'})) && |
if ((!&Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) && |
(!&Apache::lonnet::allowed('vgb',$env{'request.course.id'}. |
(!&Apache::lonnet::allowed('vgb',$env{'request.course.id'}. |
'/'.$group))) { |
'/'.$group))) { |
&print_end_page($r,$target); |
&print_end_page($r,$target); |
Line 171 sub handler {
|
Line 176 sub handler {
|
if ($allowed) { |
if ($allowed) { |
my $query_str = 'forcestudent=1'; |
my $query_str = 'forcestudent=1'; |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
$query_str.='&group='.$group; |
$query_str.='&group='.$group.'&'.$refarg; |
} |
} |
$r->print( |
$r->print( |
'<p>'. |
'<p>'. |
Line 180 sub handler {
|
Line 185 sub handler {
|
} elsif ($privileged and $target ne 'tex') { |
} elsif ($privileged and $target ne 'tex') { |
my $query_str = 'forceedit=edit'; |
my $query_str = 'forceedit=edit'; |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
$query_str.='&group='.$group; |
$query_str.='&group='.$group.'&'.$refarg; |
} |
} |
$r->print('<a href="'.$r->uri.'?'.$query_str.'"><font size="+1">' |
$r->print('<a href="'.$r->uri.'?'.$query_str.'"><font size="+1">' |
.&mt('Edit').'</font></a>'); |
.&mt('Edit').'</font></a>'); |
Line 192 sub handler {
|
Line 197 sub handler {
|
if ($syllabus{'uploaded.photourl'}) { |
if ($syllabus{'uploaded.photourl'}) { |
&Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'}); |
&Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'}); |
} |
} |
$syllabus{'uploaded.photourl'}= |
if ($group ne '') { |
&Apache::lonnet::userfileupload('uploaddoc',1,'bulletin'); |
$syllabus{'uploaded.photourl'}= |
|
&Apache::lonnet::userfileupload('uploaddoc',1, |
|
'bulletin/'.$group.'/'.$marker); |
|
} else { |
|
$syllabus{'uploaded.photourl'}= |
|
&Apache::lonnet::userfileupload('uploaddoc',1, |
|
'bulletin/'.$marker); |
|
} |
} |
} |
$syllabus{'uploaded.lastmodified'}=time; |
$syllabus{'uploaded.lastmodified'}=time; |
&Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); |
&Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); |
Line 281 sub handler {
|
Line 293 sub handler {
|
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print(&Apache::lonfeedback::list_discussion |
$r->print(&Apache::lonfeedback::list_discussion |
('board','OPEN','bulletin___'.$marker.'___'. |
('board','OPEN','bulletin___'.$marker.'___'. |
$r->uri)); |
$r->uri,undef,$group)); |
} else { |
} else { |
$r->print('\\\\'.&Apache::lonxml::xmlparse($r,'tex',&Apache::lonfeedback::list_discussion |
$r->print('\\\\'.&Apache::lonxml::xmlparse($r,'tex',&Apache::lonfeedback::list_discussion |
('board','OPEN','bulletin___'.$marker.'___'. |
('board','OPEN','bulletin___'.$marker.'___'. |
$r->uri))); |
$r->uri,undef,$group))); |
} |
} |
&print_end_page($r,$target); |
&print_end_page($r,$target); |
return OK; |
return OK; |
Line 301 sub print_end_page {
|
Line 313 sub print_end_page {
|
} |
} |
|
|
sub groupboard_breadcrumbs { |
sub groupboard_breadcrumbs { |
my ($cdom,$cnum,$group,$gpterm,$ucgpterm,$description,$boardurl,$boardtitle)= @_; |
my ($cdom,$cnum,$group,$refarg,$gpterm,$ucgpterm,$description,$boardurl, |
|
$boardtitle)= @_; |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
if ($refarg ne '') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/coursegroups", |
|
text=>"Groups", |
|
title=>"View course groups"}); |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/$cdom/$cnum/$group/smppg", |
({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg", |
text=>"$ucgpterm: $description", |
text=>"$ucgpterm: $description", |
title=>"Go to group's home page"}, |
title=>"Go to group's home page"}, |
{href=>"/adm/groupboards?group=$group", |
{href=>"/adm/groupboards?group=$group&$refarg", |
text=>"Discussion Boards", |
text=>"Discussion Boards", |
title=>"Display group discussion boards"}, |
title=>"Display group discussion boards"}, |
{href=>"$boardurl", |
{href=>"$boardurl", |