version 1.242, 2007/02/23 00:39:31
|
version 1.247, 2007/05/02 01:33:49
|
Line 637 END
|
Line 637 END
|
} |
} |
} |
} |
if ($dischash{$toggkey}) { |
if ($dischash{$toggkey}) { |
my $storebutton = &mt('Store read/unread changes'); |
my $storebutton = &mt('Save read/unread changes'); |
$discussion.='<td align="right">'. |
$discussion.='<td align="right">'. |
'<input type="hidden" name="discsymb" value="'.$ressymb.'">'."\n". |
'<input type="hidden" name="discsymb" value="'.$ressymb.'">'."\n". |
'<input type="button" name="readoptions" value="'.$storebutton.'"'. |
'<input type="button" name="readoptions" value="'.$storebutton.'"'. |
Line 1012 sub build_posting_display {
|
Line 1012 sub build_posting_display {
|
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$screenname; |
$screenname; |
} |
} |
|
$sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'}); |
# Set up for sorting by domain, then username |
# Set up for sorting by domain, then username |
unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) { |
unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) { |
%{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); |
%{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); |
Line 1967 END
|
Line 1967 END
|
<input type="hidden" name="$dispchgB" value=""/> |
<input type="hidden" name="$dispchgB" value=""/> |
<input type="hidden" name="$markchg" value=""/> |
<input type="hidden" name="$markchg" value=""/> |
<input type="hidden" name="$toggchg" value="" /> |
<input type="hidden" name="$toggchg" value="" /> |
<input type="button" name="sub" value="Store Changes" onClick="javascript:setDisp()" /> |
<input type="button" name="sub" value="Save Changes" onClick="javascript:setDisp()" /> |
END |
END |
if (exists($env{'form.group'})) { |
if (exists($env{'form.group'})) { |
$r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'); |
$r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />'); |
Line 2055 sub print_sortfilter_options {
|
Line 2055 sub print_sortfilter_options {
|
'spgr' => 'Specific groups', |
'spgr' => 'Specific groups', |
'psub' => 'Pick specific users (by name)', |
'psub' => 'Pick specific users (by name)', |
'shal' => 'Show a list of current posters', |
'shal' => 'Show a list of current posters', |
'stor' => 'Store changes', |
'stor' => 'Save changes', |
); |
); |
|
|
my %sort_types = (); |
my %sort_types = (); |
Line 2559 sub screen_header {
|
Line 2559 sub screen_header {
|
'<p><label><input type="radio" name="discuss" value="author" /> '. |
'<p><label><input type="radio" name="discuss" value="author" /> '. |
&mt('Feedback to resource author').'</label></p>'; |
&mt('Feedback to resource author').'</label></p>'; |
} |
} |
|
my %optionhash=(); |
|
foreach my $type ('question','comment','policy') { |
|
$optionhash{$type}=$env{'course.'.$env{'request.course.id'}.'.'.$type.'.email.text'}; |
|
} |
if (&feedback_available(1)) { |
if (&feedback_available(1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="question" /> '. |
'<p><label><input type="radio" name="discuss" value="question" /> '. |
&mt('Question about resource content').'</label></p>'; |
($optionhash{'question'}?$optionhash{'question'}:&mt('Question about resource content')).'</label></p>'; |
} |
} |
if (&feedback_available(0,1)) { |
if (&feedback_available(0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
&mt('Question/Comment/Feedback about course content'). |
($optionhash{'comment'}?$optionhash{'comment'}:&mt('Question/Comment/Feedback about course content')). |
'</label></p>'; |
'</label></p>'; |
} |
} |
if (&feedback_available(0,0,1)) { |
if (&feedback_available(0,0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
&mt('Question/Comment/Feedback about course policy'). |
($optionhash{'policy'}?$optionhash{'policy'}:&mt('Question/Comment/Feedback about course policy')). |
'</label></p>'; |
'</label></p>'; |
} |
} |
} |
} |
Line 2671 sub feedback_available {
|
Line 2675 sub feedback_available {
|
} |
} |
|
|
sub send_msg { |
sub send_msg { |
my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_; |
my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_; |
my $status=''; |
my $status=''; |
my $sendsomething=0; |
my $sendsomething=0; |
my $restitle = &get_resource_title($symb,$feedurl); |
my $restitle = &get_resource_title($symb,$feedurl); |
if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; } |
if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; } |
unless ($title=~/\w/) { $title=&mt('Feedback'); } |
unless ($title=~/\w/) { $title=&mt('Feedback'); } |
foreach my $key (keys(%to)) { |
foreach my $key (keys(%to)) { |
if ($key) { |
if ($key) { |
unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$key), |
my ($user,$domain) = split(/\:/,$key,2); |
$title.' ['.$restitle.']',$email,$citations,$feedurl, |
if (!defined($user)) { |
$attachmenturl,undef,undef,$symb,$restitle)=~/ok/) { |
$status.='<br />'.&mt('Error sending message to [_1], no user specified.',$key); |
$status.='<br />'.&mt('Error sending message to').' '.$key.'<br />'; |
} elsif (!defined($domain)) { |
} else { |
$status.='<br />'.&mt('Error sending message to [_1], no domain specified.',$key); |
$sendsomething++; |
} else { |
} |
unless (&Apache::lonmsg::user_normal_msg($user,$domain, |
|
$title.' ['.$restitle.']',$email,$citations,$feedurl, |
|
$attachmenturl,undef,undef,$symb,$restitle)=~/ok/) { |
|
$status.='<br />'.&mt('Error sending message to').' '.$key.'<br />'; |
|
} else { |
|
$sendsomething++; |
|
} |
|
} |
|
} |
} |
} |
} |
|
|
|
my %record=&Apache::lonnet::restore('_feedback'); |
my %record=&Apache::lonnet::restore('_feedback'); |
my ($temp)=keys(%record); |
my ($temp)=keys(%record); |
unless ($temp=~/^error\:/) { |
unless ($temp=~/^error\:/) { |
my %newrecord=(); |
my %newrecord=(); |
$newrecord{'resource'}=$feedurl; |
$newrecord{'resource'}=$feedurl; |
$newrecord{'subnumber'}=$record{'subnumber'}+1; |
$newrecord{'subnumber'}=$record{'subnumber'}+1; |
unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') { |
unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') { |
$status.='<br />'.&mt('Not registered').'<br />'; |
$status.='<br />'.&mt('Not registered').'<br />'; |
} |
} |
} |
} |
|
|
return ($status,$sendsomething); |
return ($status,$sendsomething); |
} |
} |
|
|
sub adddiscuss { |
sub adddiscuss { |
Line 2923 sub modify_attachments {
|
Line 2935 sub modify_attachments {
|
'chth' => 'Check the checkboxes for any you wish to remove.', |
'chth' => 'Check the checkboxes for any you wish to remove.', |
'thef' => 'The following attachments have been uploaded for inclusion with this posting.', |
'thef' => 'The following attachments have been uploaded for inclusion with this posting.', |
'adda' => 'Add a new attachment to this post.', |
'adda' => 'Add a new attachment to this post.', |
'stch' => 'Store Changes', |
'stch' => 'Save Changes', |
); |
); |
my $js = <<END; |
my $js = <<END; |
<script type="text/javascript"> |
<script type="text/javascript"> |