--- loncom/interface/lonfeedback.pm 2006/01/11 08:31:37 1.178
+++ loncom/interface/lonfeedback.pm 2006/03/06 19:21:22 1.183
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.178 2006/01/11 08:31:37 albertel Exp $
+# $Id: lonfeedback.pm,v 1.183 2006/03/06 19:21:22 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -906,16 +906,16 @@ sub build_posting_display {
} else {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
- if ($env{'course.'.$env{'request.course.id'}.'.allow_discussion_post_editing'} =~ m/yes/i) {
+ if (&editing_allowed()) {
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
$sender.=' '.&mt('Edit').'';
unless ($seeid) {
- $sender.=" ';
}
}
@@ -925,22 +925,22 @@ sub build_posting_display {
unless ($studenthidden) {
$sender.=' '.&mt('Make Visible').'';
}
} else {
$sender.=' '.&mt('Hide').'';
}
$sender.=' '.&mt('Delete').'';
@@ -976,8 +976,8 @@ sub build_posting_display {
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
$sender.=' '.&mt('Reply').'';
}
@@ -2224,7 +2224,7 @@ $html
-
+
$typestyle
Sent $sendsomething message(s), and $sendposts post(s).
@@ -2264,7 +2264,7 @@ ENDNOREDIR
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
$r->print (<
-
+
$nofeed
$continue
@@ -2478,14 +2478,16 @@ sub feedback_available {
}
sub send_msg {
- my ($feedurl,$email,$citations,$attachmenturl,%to)=@_;
+ my ($title,$feedurl,$email,$citations,$attachmenturl,%to)=@_;
my $status='';
my $sendsomething=0;
+ if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; }
+ unless ($title=~/\w/) { $title=&mt('Feedback'); }
foreach (keys %to) {
if ($_) {
my $declutter=&Apache::lonnet::declutter($feedurl);
unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$_),
- 'Feedback ['.$declutter.']',$email,$citations,$feedurl,
+ $title.' ['.$declutter.']',$email,$citations,$feedurl,
$attachmenturl)=~/ok/) {
$status.='
'.&mt('Error sending message to').' '.$_.'
';
} else {
@@ -2587,7 +2589,7 @@ sub adddiscuss {
$newcontrib{$key} = $contrib{$_};
}
my $put_reply = &Apache::lonnet::putstore($env{'request.course.id'},
- \%newcontrib,
+ $oldsymb,$oldidx,\%contrib,
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
$status='Editing class discussion'.($anon?' (anonymous)':'');
@@ -2992,7 +2994,15 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']);
-
+ if ($env{'form.editdisc'}) {
+ if (!(&editing_allowed())) {
+ my $symb=(split(/\:\:\:/,$env{'form.editdisc'}))[0];
+ my ($map,$id,$url)=&Apache::lonnet::decode_symb($symb);
+ my $feedurl=&Apache::lonnet::clutter($url);
+ &redirect_back($r,$feedurl,&mt('Editing not permitted').'
', '0','0','','',$env{'form.previous'},'','','',);
+ return OK;
+ }
+ }
if ($env{'form.discsymb'}) {
my ($symb,$feedurl) = &get_feedurl_and_clean_symb($env{'form.discsymb'});
my $readkey = $symb.'_read';
@@ -3128,7 +3138,7 @@ $html
-
+
$textline