version 1.71.2.2, 2008/09/25 01:53:50
|
version 1.79, 2009/04/04 21:47:40
|
Line 53 sub editfield {
|
Line 53 sub editfield {
|
my $enddateform = &Apache::lonhtmlcommon::date_setter('anno', |
my $enddateform = &Apache::lonhtmlcommon::date_setter('anno', |
'enddate', |
'enddate', |
$end); |
$end); |
my $help=&Apache::loncommon::help_open_menu('Calendar Add Announcement','Calendar_Add_Announcement',274,'Communication Tools'); |
#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_topic('Calendar_Add_Announcement'); |
|
|
|
my %lt=&Apache::lonlocal::texthash('annon' => 'Course Announcements', |
|
'post' => 'Post Announcement', |
'start' => 'Starting date', |
'start' => 'Starting date', |
'end' => 'Ending date', |
'end' => 'Ending date', |
'incrss' => 'Include in course RSS newsfeed'); |
'incrss' => 'Include in course RSS newsfeed'); |
|
|
$r->print(<<ENDFORM); |
$r->print(<<ENDFORM); |
$help |
<h2>$lt{'annon'} $help</h2> |
<form name="anno" method="post"> |
<form name="anno" method="post"> |
<input type="hidden" value='' name="action" /> |
<input type="hidden" value='' name="action" /> |
<table><tr><td>$lt{'start'}:</td><td>$startdateform</td></tr> |
<table><tr><td>$lt{'start'}:</td><td>$startdateform</td></tr> |
Line 412 sub picklink {
|
Line 415 sub picklink {
|
|
|
sub dialscript { |
sub dialscript { |
return (<<ENDDIA); |
return (<<ENDDIA); |
<script language="Javascript"> |
<script type="text/javascript" language="JavaScript"> |
function dialin(day,month,year) { |
function dialin(day,month,year) { |
opener.document.$env{'form.formname'}.$env{'form.element'}\_year.value=year; |
opener.document.$env{'form.formname'}.$env{'form.element'}\_year.value=year; |
var slct=opener.document.$env{'form.formname'}.$env{'form.element'}\_month; |
var slct=opener.document.$env{'form.formname'}.$env{'form.element'}\_month; |
Line 514 sub handler {
|
Line 517 sub handler {
|
|
|
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
my $js = <<ENDDOCUMENT; |
my $js = <<ENDDOCUMENT; |
<script type="text/javascript"> |
<script type="text/javascript" language="JavaScript"> |
|
|
function trysubmit() { |
function trysubmit() { |
document.anno.action.value="new"; |
document.anno.action.value="new"; |
Line 535 ENDDOCUMENT
|
Line 538 ENDDOCUMENT
|
&dialscript(). |
&dialscript(). |
'<font size="1">'); |
'<font size="1">'); |
} else { |
} else { |
$r->print(&Apache::loncommon::start_page("Announcements and Calendar", |
my $brcrum = [{href=>"/adm/announcements",text=>"Announcements and Calendar"}]; |
$js)); |
$r->print(&Apache::loncommon::start_page("Communication",$js,{'bread_crumbs' => $brcrum})); |
} |
} |
# does this user have privileges to post, etc? |
# does this user have privileges to post, etc? |
my $allowed=0; |
my $allowed=0; |
Line 567 ENDDOCUMENT
|
Line 570 ENDDOCUMENT
|
} |
} |
} |
} |
} |
} |
$r->print(<<SERVERANNOUNCE); |
$r->print('<form name="serveranno" method="post">' |
<form name="serveranno" method="post"> |
.'<h2>'.&mt('Post Server Announcements').'</h2>' |
<h3>Post Server Announcements</h3> |
.&mt('Post announcements to the system login and roles screen').'<br />' |
Post announcements to the system login and roles screen<br /> |
.'<i>'.&mt('(leave blank to delete announcement)').'</i><br />' |
<i>(leave blank to delete announcement)</i><br /> |
.'<textarea name="serverannnounce" cols="60" rows="5"></textarea><br />' |
<textarea name="serverannnounce" cols="60" rows="5"></textarea><br /> |
.&mt('Check machines:').'<br />' |
Check machines:<br /> |
); |
SERVERANNOUNCE |
|
# list servers |
# list servers |
my %hostname = &Apache::lonnet::all_hostnames(); |
my %hostname = &Apache::lonnet::all_hostnames(); |
foreach my $host (sort(keys(%hostname))) { |
foreach my $host (sort(keys(%hostname))) { |
if (&Apache::lonnet::allowed('psa', |
if (&Apache::lonnet::allowed('psa', |
&Apache::lonnet::host_domain($host))) { |
&Apache::lonnet::host_domain($host))) { |
$r->print ('<br /><label><input type="checkbox" name="postto_'.$host.'" /> '. |
$r->print ('<label><input type="checkbox" name="postto_'.$host.'" /> '. |
$host.' <tt>'.$hostname{$host}.'</tt> '. |
$host.' <tt>'.$hostname{$host}.'</tt> '. |
'</label><a href="http://'.$hostname{$host}. |
'</label><a href="http://'.$hostname{$host}. |
'/announcement.txt?time='.time.'" target="annowin">current</a>'); |
'/announcement.txt?time='.time.'" target="annowin">'. |
|
&mt('Current Announcement').'</a><br />'); |
} |
} |
} |
} |
$r->print( |
$r->print( |
'<br /><input type="submit" name="serveraction" value="Post"></form><hr />'); |
'<br /><input type="submit" name="serveraction" value="'.&mt('Post').'" /></form><hr />'); |
} |
} |
if ($allowed) { |
if ($allowed) { |
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 640 SERVERANNOUNCE
|
Line 643 SERVERANNOUNCE
|
if ($pm<1) { ($pm,$py)=(12,$year-1); } |
if ($pm<1) { ($pm,$py)=(12,$year-1); } |
if ($fm>12){ ($fm,$fy)=(1,$year+1); } |
if ($fm>12){ ($fm,$fy)=(1,$year+1); } |
|
|
$r->print('<h1>'.('',&mt('January'),&mt('February'),&mt('March'), |
$r->print('<h2>'.&mt('Calendar').'</h2>' |
|
.'<h3>'.('',&mt('January'),&mt('February'),&mt('March'), |
&mt('April'),&mt('May'), |
&mt('April'),&mt('May'), |
&mt('June'),&mt('July'),&mt('August'), |
&mt('June'),&mt('July'),&mt('August'), |
&mt('September'),&mt('October'), |
&mt('September'),&mt('October'), |
&mt('November'),&mt('December'))[$month].' '. |
&mt('November'),&mt('December'))[$month].' '. |
$year.' '.&show_timezone().'</h1>'); |
$year.' '.&show_timezone().'</h3>'); |
# Reached the end of times, give up |
# Reached the end of times, give up |
if (($year<1970) || ($year>2037)) { |
if (($year<1970) || ($year>2037)) { |
$r->print('<h3>No calendar available for this date.</h3>'. |
$r->print('<p class="LC_warning">' |
'<a href="/adm/announcements?month='.$todayhash{'month'}. |
.&mt('No calendar available for this date.') |
'&year='.$todayhash{'year'}.'">Current Month</a>'. |
.'</p>' |
&Apache::loncommon::end_page()); |
.'<a href="/adm/announcements?month='.$todayhash{'month'} |
|
.'&year='.$todayhash{'year'}.'">'.&mt('Current Month').'</a>' |
|
.&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|
Line 660 SERVERANNOUNCE
|
Line 666 SERVERANNOUNCE
|
$class .= " LC_calendar_pickdate"; |
$class .= " LC_calendar_pickdate"; |
} |
} |
# ------------------------------------------------ Determine first day of a week |
# ------------------------------------------------ Determine first day of a week |
# my $datelocale = &Apache::lonlocal::getdatelocale(); |
my $datelocale = &Apache::lonlocal::getdatelocale(); |
my $datelocale; |
|
my $days_in_week = 7; |
my $days_in_week = 7; |
my $startweek = 0; |
my $startweek = 0; |
if (ref($datelocale)) { |
if (ref($datelocale)) { |
Line 741 SERVERANNOUNCE
|
Line 746 SERVERANNOUNCE
|
# ----------------------------------------------------------------- Check marks |
# ----------------------------------------------------------------- Check marks |
undef(%showedcheck); |
undef(%showedcheck); |
# --------------------------------------------------------------- Remove button |
# --------------------------------------------------------------- Remove button |
if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries">'. |
if ($allowed) { $r->print('<br /><input type="button" onClick="removesub()" value="'.&mt('Remove Checked Entries').'">'. |
&Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); } |
&Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); } |
$r->print('<p>'. |
$r->print('<p>'. |
'<a href="/adm/announcements?month='.$pm.'&year='.$py. |
'<a href="/adm/announcements?month='.$pm.'&year='.$py. |