--- loncom/interface/lonfeedback.pm 2010/01/25 03:56:00 1.273.4.6 +++ loncom/interface/lonfeedback.pm 2009/11/04 17:45:49 1.278 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.273.4.6 2010/01/25 03:56:00 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.278 2009/11/04 17:45:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -91,7 +91,7 @@ sub list_discussion { if (not &discussion_visible($status)) { if ($mode ne 'board') { &Apache::lonenc::check_encrypt(\$ressymb); - return '
'.&send_message_link($ressymb); + return '
"; } } if ($group ne '' && $mode eq 'board') { @@ -103,9 +103,12 @@ sub list_discussion { my ($blocked,$blocktext) = &Apache::loncommon::blocking_status('boards'); if ($blocked) { + $blocktext = '
'; + }else{ + $blocktext.=""; } return $blocktext; } @@ -171,7 +174,6 @@ sub list_discussion { my $cnum = $env{'course.'.$cid.'.num'}; my $crstype = &Apache::loncommon::course_type(); - # Get information about students and non-students in course for filtering display of posts my %roleshash = (); my %roleinfo = (); @@ -354,10 +356,10 @@ sub list_discussion { $togglink = 'toggoff'; } - $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink; + $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink; if ($newpostsflag) { - $chglink .= '&previous='.$prevread; + $chglink .= '&previous='.$prevread; } $chglink.=&group_args($group); @@ -420,7 +422,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ var symbparm = symb+':::'+idx var prevparm = "" if (newflag == 1) { - prevparm = "&previous="+previous + prevparm = "&previous="+previous } if (caller == 'studentdelete') { if (confirm("$lt{'aysu'}\\n$lt{'dpwn'},\\n$lt{'bwco'}")) { @@ -448,7 +450,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ $discussion.="\n".''. ''.&mt('Show all posts').' '.&mt('to display').' '. @@ -567,7 +569,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ + $lt{'cuse'}:
- $lt{'cuse'}:  END @@ -589,7 +591,7 @@ END   - $lt{'chgt'}? + $lt{'chgt'}?
@@ -757,9 +759,9 @@ sub send_feedback_link { my $output = ''. ' '. - ''.&mt('Post Discussion').''; + '" border="0" />'.&mt('Post Discussion').''; return $output; } @@ -767,9 +769,9 @@ sub send_message_link { my ($ressymb) = @_; my $output = ''. ' '.&mt('Send Feedback').''; + '" border="0" />'.&mt('Send Feedback').''; return $output; } @@ -782,7 +784,7 @@ sub action_links_bar { if ($visible>2) { $discussion .= ''.&mt('Threaded View').'  '. @@ -813,7 +815,7 @@ sub action_links_bar { &mt('Preferences on what is marked as NEW'). '
'.&mt('Mark NEW posts no longer new').''; + $discussion .= '">'.&mt('Mark NEW posts no longer new').''; } else { $discussion .= ' '; } @@ -846,7 +848,7 @@ sub postingform_display {
$lt{'note'}
$lt{'title'}: 

- + ENDDISCUSS if ($env{'form.origpage'}) { $postingform .= '['.$$anonhash{$key}.']
'. $screenname; @@ -1022,7 +1023,6 @@ sub build_posting_display { if ($see_anonymous) { $sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'}); } - $sender = ''.$sender.''; # Set up for sorting by domain, then username unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) { %{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); @@ -1057,7 +1057,7 @@ sub build_posting_display { $sender.=' '.&mt('Edit').''; @@ -1083,7 +1083,7 @@ sub build_posting_display { $sender.=' '.&mt('Hide').''; @@ -1124,7 +1124,7 @@ sub build_posting_display { $sender.=' '.&mt('Reply').''; @@ -1172,7 +1172,7 @@ sub build_posting_display { $$imsitems{$idx}{'attach'}=$attachtxt{$numoldver}; $$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'}; $$imsitems{$idx}{'sender'}=$plainname.' ('. - $contrib{$idx.':sendername'}.' at '. + $contrib{$idx.':sendername'}.':'. $contrib{$idx.':senderdomain'}.')'; $$imsitems{$idx}{'isanonymous'}='false'; if ($contrib{$idx.':anonymous'}) { @@ -1245,24 +1245,24 @@ sub build_posting_display { if ($prevread > 0 && $prevread <= $posttime) { $$newitem{$idx} = 1; $$discussionitems[$idx] .= ' - +

'; } else { $$newitem{$idx} = 0; $$discussionitems[$idx] .= ' -
'.&mt('NEW').'
+

'; } $$discussionitems[$idx] .= ''; if ($$dischash{$toggkey}) { $$discussionitems[$idx].=''; } $$discussionitems[$idx].= '
   '. ''.$subject.'  '. - $sender.' '.$vgrlink.' ('. + $sender.' '.$vgrlink.' ('. &Apache::lonlocal::locallocaltime($posttime).')  '. $ctlink.'
'. - $message.'
'; + $message.'

'; if ($contrib{$idx.':history'}) { my @postversions = (); $$discussionitems[$idx] .= &mt('This post has been edited by the author.'); @@ -1369,7 +1369,7 @@ sub get_post_contents { $$plainname, $$contrib{$idx.':sendername'}, $$contrib{$idx.':senderdomain'}).' ('. - $$contrib{$idx.':sendername'}.' at '. + $$contrib{$idx.':sendername'}.':'. $$contrib{$idx.':senderdomain'}.')'; my $attachmenturls = $$contrib{$idx.':attachmenturl'}; my @postversions = (); @@ -1484,6 +1484,7 @@ sub mail_screen { } my %lt = &Apache::lonlocal::texthash( + 'plch' => 'Please check at least one of the following feedback types:', 'myqu' => 'My question/comment/feedback:', 'title' => 'Title', 'reta' => 'Retained attachments', @@ -1665,10 +1666,15 @@ END END + # Breadcrumbs + my $brcrum = [{'href' => '', + 'text' => 'Resource Feedback and Discussion'}]; + my %onload = ('onload' => 'window.focus();setposttype();'); my $start_page= &Apache::loncommon::start_page('Resource Feedback and Discussion',$js, - {'add_entries' => \%onload}); + {'add_entries' => \%onload, + 'bread_crumbs' => $brcrum,}); if ($quote ne '') { &newline_to_br(\$quote); @@ -1694,6 +1700,7 @@ END END } $r->print(< $quote

$lt{'myqu'}

@@ -1703,7 +1710,7 @@ $latexHelp

$lt{'title'}:

-

END @@ -1740,7 +1747,7 @@ END $r->print(< - +

END @@ -1947,9 +1954,9 @@ END $r->print(<$lt{'disa'} $lt{$discdisp} - +
- + END $r->print(&Apache::loncommon::end_data_table_row()); @@ -1964,7 +1971,7 @@ END $r->print(<$lt{'dotm'} $lt{$disctogg} - + END my $save = &mt('Save'); $r->print(&Apache::loncommon::end_data_table_row()); @@ -1978,7 +1985,7 @@ END - + END if (exists($env{'form.group'})) { $r->print(''); @@ -2016,7 +2023,7 @@ sub print_sortfilter_options { $ccrole = 'co'; } push(@courseroles,$ccrole); - + if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section @sections = ('all',$env{'request.course.sec'}); $numvisible = 2; @@ -2131,17 +2138,17 @@ $start_page

- - - - - - - - - - - + + + + + + + + + + +
$lt{'soor'} $lt{'sprs'} $lt{'spur'} $lt{'spse'} $lt{'spgr'} $lt{'psub'}$lt{'soor'} $lt{'sprs'} $lt{'spur'} $lt{'spse'} $lt{'spgr'} $lt{'psub'}
@@ -2196,7 +2203,7 @@ $start_page
- + END if (exists($env{'form.group'})) { $r->print(''); @@ -2319,7 +2326,7 @@ END
- + $end_page END @@ -2422,7 +2429,7 @@ sub redirect_back { if ($previous > 0) { $qrystr = 'previous='.$previous; if ($feedurl =~ /\?register=1/) { - $feedurl .= '&'.$qrystr; + $feedurl .= '&'.$qrystr; } else { $feedurl .= '?'.$qrystr; } @@ -2431,14 +2438,14 @@ sub redirect_back { if (defined($sort)) { my $sortqry = 'sortposts='.$sort; if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) { - $feedurl .= '&'.$sortqry; + $feedurl .= '&'.$sortqry; } else { $feedurl .= '?'.$sortqry; } $sorttag = ''; if (defined($numpicks)) { my $userpickqry = 'totposters='.$numpicks; - $feedurl .= '&'.$userpickqry; + $feedurl .= '&'.$userpickqry; $userpicktag = ''; } else { if (ref($sectionpick) eq 'ARRAY') { @@ -2452,7 +2459,7 @@ sub redirect_back { $sectag =~ s/,$//; $sectag .= '" />'; } else { - $feedurl .= '&sectionpick='.$sectionpick; + $feedurl .= '§ionpick='.$sectionpick; $sectag = ''; } if (ref($grouppick) eq 'ARRAY') { @@ -2466,7 +2473,7 @@ sub redirect_back { $grptag =~ s/,$//; $grptag .= '" />'; } else { - $feedurl .= '&grouppick='.$grouppick; + $feedurl .= '&grouppick='.$grouppick; $grptag = ''; } if (ref($rolefilter) eq 'ARRAY') { @@ -2483,7 +2490,7 @@ sub redirect_back { $feedurl .= '&rolefilter='.$rolefilter; $roletag = ''; } - $feedurl .= '&statusfilter='.$statusfilter; + $feedurl .= '&statusfilter='.$statusfilter; $statustag =''; } } @@ -2625,11 +2632,10 @@ sub screen_header { $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { $discussoptions='
'. - + $contribdisc. + '
'. ''.&mt('Change Screenname').''; my $blockblog = &Apache::loncommon::blocking_status('blogs'); if (!$blockblog) { @@ -2639,12 +2645,12 @@ sub screen_header { } if ($msgoptions) { $msgoptions='

' - .' '.&mt('Send Feedback').'

'.&Apache::lonhtmlcommon::coursepreflink(&mt('Feedback Settings'),'feedback').'

' + .' '.&mt('Send Feedback').'' .$msgoptions; } if ($discussoptions) { $discussoptions='

' - .' '.&mt('Discussion Contributions').'

'.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'

' + .' '.&mt('Discussion Contributions').'' .$discussoptions; } return $msgoptions.$discussoptions; @@ -2696,6 +2702,9 @@ sub assemble_email { 'orig' => 'Original screen output (if applicable)', 'corr' => 'Correct Answer(s) (if applicable)', ); + if (&Apache::loncommon::course_type() eq 'Community') { + $lt{'prev'} = &mt('Previous attempts of member (if applicable)'); + } my $email=<<"ENDEMAIL"; $message ENDEMAIL @@ -2942,19 +2951,6 @@ sub show_preview { ); } -sub contains_block_html { - my ($message)=@_; - return ($message =~ m{ - <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) - \s* - (\w+\=['"]\w+['"])* - \s* - ( - \s*/>| - >.* - )}xs - ); -} sub newline_to_br { my ($message)=@_; @@ -2988,7 +2984,7 @@ sub generate_preview_button { +onClick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" /> ENDPREVIEW } @@ -3014,8 +3010,12 @@ sub modify_attachments { END + # Breadcrumbs + my $brcrum = [{'href' => '', + 'text' => 'Discussion Post Attachments'}]; my $start_page = - &Apache::loncommon::start_page('Discussion Post Attachments',$js); + &Apache::loncommon::start_page('Discussion Post Attachments',$js, + {'bread_crumbs' => $brcrum,}); my $orig_subject = &unescape($env{'form.subject'}); my $subject=&clear_out_html($orig_subject,undef,1); @@ -3043,7 +3043,7 @@ $toolarge @@ -3094,7 +3094,7 @@ END $r->print(''."\n"); } $r->print(< + $end_page END @@ -3357,14 +3357,14 @@ sub sort_filter_names { } if (ref($status_types) eq 'HASH') { %{$status_types} = ( - all => 'Roles of any status', - Active => 'Only active roles', - Expired => 'Only past roles', - Future => 'Only future roles', - ); + all => 'Roles of any status', + Active => 'Only active roles', + Expired => 'Only past roles', + Future => 'Only future roles', + ); } } - + sub handler { my $r = shift; if ($r->header_only) { @@ -3424,7 +3424,13 @@ sub handler { &Apache::loncommon::no_cache($r); $r->send_http_header; - $r->print(&Apache::loncommon::start_page('Discussion Post Versions')); + # Breadcrumbs + my $brcrum = [{'href' => '', + 'text' => 'Discussion Post Versions'}]; + + $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef, + {'bread_crumbs' => $brcrum,}) + ); my $crs='/'.$env{'request.course.id'}; if ($env{'request.course.sec'}) {
- Subject: $subject

+ Subject: $subject

END if ($idx) { if ($attachmenturls) { @@ -3071,7 +3071,7 @@ END
- $lt{'adda'} + $lt{'adda'}