--- loncom/interface/lonannounce.pm 2008/09/25 01:53:50 1.71.2.2 +++ loncom/interface/lonannounce.pm 2010/03/16 20:10:13 1.82 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.71.2.2 2008/09/25 01:53:50 raeburn Exp $ +# $Id: lonannounce.pm,v 1.82 2010/03/16 20:10:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -45,7 +45,7 @@ my %todayhash; my %showedcheck; sub editfield { - my ($r,$start,$end,$text)=@_; + my ($r,$start,$end,$text,$crstype)=@_; # Deal with date forms my $startdateform = &Apache::lonhtmlcommon::date_setter('anno', 'startdate', @@ -53,14 +53,21 @@ sub editfield { my $enddateform = &Apache::lonhtmlcommon::date_setter('anno', 'enddate', $end); - my $help=&Apache::loncommon::help_open_menu('Calendar Add Announcement','Calendar_Add_Announcement',274,'Communication Tools'); - my %lt=&Apache::lonlocal::texthash('post' => 'Post Announcement', + #my $help=&Apache::loncommon::help_open_menu('Calendar Add Announcement','Calendar_Add_Announcement',274,'Communication Tools'); + my $help=&Apache::loncommon::help_open_topic('Calendar_Add_Announcement'); + + my %lt=&Apache::lonlocal::texthash('annon' => 'Course Announcements', + 'post' => 'Post Announcement', 'start' => 'Starting date', 'end' => 'Ending date', 'incrss' => 'Include in course RSS newsfeed'); + if ($crstype eq 'Community') { + $lt{'annon'} = &mt('Community Announcements'); + $lt{'incrss'} = &mt('Include in community RSS newsfeed'); + } $r->print(<$lt{'annon'} $help
@@ -412,7 +419,8 @@ sub picklink { sub dialscript { return (< + ENDDIA } @@ -499,8 +508,8 @@ sub handler { # ---------------------------------------------- See if we are in pickdate mode my $pickdatemode=($env{'form.pickdate'} eq 'yes'); - my $pickinfo='&pickdate=yes&formname='.$env{'form.formname'}. - '&element='.$env{'form.element'}; + my $pickinfo='&pickdate=yes&formname='.$env{'form.formname'}. + '&element='.$env{'form.element'}; # --------------------------------------------- Find out first day of the month my $tk = &Apache::loncommon::maketime( 'day' => 1, @@ -514,7 +523,8 @@ sub handler { # ------------------------------------------------------------ Print the screen my $js = < + ENDDOCUMENT @@ -535,8 +546,8 @@ ENDDOCUMENT &dialscript(). ''); } else { - $r->print(&Apache::loncommon::start_page("Announcements and Calendar", - $js)); + my $brcrum = [{href=>"/adm/announcements",text=>"Announcements and Calendar"}]; + $r->print(&Apache::loncommon::start_page("Communication",$js,{'bread_crumbs' => $brcrum})); } # does this user have privileges to post, etc? my $allowed=0; @@ -567,31 +578,32 @@ ENDDOCUMENT } } } - $r->print(< -

Post Server Announcements

-Post announcements to the system login and roles screen
-(leave blank to delete announcement)
-
-Check machines:
-SERVERANNOUNCE + $r->print('' + .'

'.&mt('Post Server Announcements').'

' + .&mt('Post announcements to the system login and roles screen').'
' + .''.&mt('(leave blank to delete announcement)').'
' + .'
' + .&mt('Check machines:').'
' + ); # list servers my %hostname = &Apache::lonnet::all_hostnames(); foreach my $host (sort(keys(%hostname))) { if (&Apache::lonnet::allowed('psa', &Apache::lonnet::host_domain($host))) { - $r->print ('
$lt{'start'}:$startdateform
'); + '&year='.$todayhash{'year'}. + ($pickdatemode?$pickinfo:'').'">'.&mt('Current Month').'
'. + '
'); for (my $i=0; $i<@localdays; $i++) { $r->print(''); } @@ -737,22 +757,23 @@ SERVERANNOUNCE } } # ------------------------------------------------------------------- End table - $r->print('
'.&mt($localdays[$i]).'
'); + $r->print(''); # ----------------------------------------------------------------- Check marks undef(%showedcheck); # --------------------------------------------------------------- Remove button - if ($allowed) { $r->print(''. + if ($allowed) { $r->print('
'. &Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').''); } $r->print('

'. - ''.&mt('Previous Month').' '. - ''.&mt('Next Month').''. '   '.&mt('Current Month').'

'. - ($pickdatemode?'
':'').&Apache::loncommon::end_page()); - $r->print(''.&mt('Download your Calendar as iCalendar File').''); + ($pickdatemode?'':''). + ''.&mt('Download your Calendar as iCalendar File').''. + &Apache::loncommon::end_page()); return OK; }