version 1.8, 2003/04/30 15:49:45
|
version 1.9, 2003/05/21 16:26:46
|
Line 121 sub handler {
|
Line 121 sub handler {
|
'dlsav' => $todayhash{'dlsav'} )); |
'dlsav' => $todayhash{'dlsav'} )); |
my $weekday=$firstday{'weekday'}; |
my $weekday=$firstday{'weekday'}; |
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
my $pjump_function = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
|
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
<html> |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
<script> |
<script> |
function pclose() { |
|
parmwin=window.open("/adm/rat/empty.html","LONCAPAparms", |
|
"height=350,width=350,scrollbars=no,menubar=no"); |
|
parmwin.close(); |
|
} |
|
|
|
$pjump_function |
|
|
|
function dateset() { |
|
if (document.anno.pres_marker.value=='end') { |
|
document.anno.enddate.value= |
|
document.anno.pres_value.value; |
|
} |
|
if (document.anno.pres_marker.value=='start') { |
|
document.anno.startdate.value= |
|
document.anno.pres_value.value; |
|
} |
|
pclose(); |
|
} |
|
|
|
function trysubmit() { |
function trysubmit() { |
if (document.anno.startdate.value=='') { |
|
alert("Announcements must have a starting date"); |
|
return ''; |
|
} |
|
if (document.anno.enddate.value=='') { |
|
alert("Announcements must have a starting date"); |
|
return ''; |
|
} |
|
if (document.anno.startdate.value>document.anno.enddate.value) { |
|
alert("Starting date is later than ending date"); |
|
return ''; |
|
} |
|
document.anno.action.value="new"; |
document.anno.action.value="new"; |
document.anno.submit(); |
document.anno.submit(); |
} |
} |
Line 183 ENDDOCUMENT
|
Line 152 ENDDOCUMENT
|
my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
# ----------------------------------------------------- Store new submitted one |
# ----------------------------------------------------- Store new submitted one |
if ($ENV{'form.action'} eq 'new') { |
if ($ENV{'form.action'} eq 'new') { |
|
my $startdate = |
|
&Apache::lonhtmlcommon::get_date_from_form('startdate'); |
|
my $enddate = |
|
&Apache::lonhtmlcommon::get_date_from_form('enddate'); |
|
unless ($startdate=~/^\d+$/) { $startdate=time; } |
|
unless ($enddate=~/^\d+$/) { $enddate=$startdate+1; } |
|
if ($startdate>$enddate) { |
|
my $buffer=$startdate; |
|
$startdate=$enddate; |
|
$enddate=$buffer; |
|
} |
&Apache::lonnet::put('calendar',{ |
&Apache::lonnet::put('calendar',{ |
$ENV{'form.startdate'}.'_'.$ENV{'form.enddate'} => |
$startdate.'_'.$enddate => |
$ENV{'form.msg'} },$coursedom,$coursenum); |
$ENV{'form.msg'} },$coursedom,$coursenum); |
} |
} |
# ---------------------------------------------------------------- Remove items |
# ---------------------------------------------------------------- Remove items |
Line 202 ENDDOCUMENT
|
Line 182 ENDDOCUMENT
|
$tomorrowhash{'day'}++; |
$tomorrowhash{'day'}++; |
my $tomorrow=&Apache::loncommon::maketime(%tomorrowhash); |
my $tomorrow=&Apache::loncommon::maketime(%tomorrowhash); |
|
|
|
# Deal with date forms |
|
my $startdateform = &Apache::lonhtmlcommon::date_setter('anno', |
|
'startdate', |
|
$today); |
|
my $enddateform = &Apache::lonhtmlcommon::date_setter('anno', |
|
'enddate', |
|
$tomorrow); |
|
# |
|
|
$r->print(<<ENDFORM); |
$r->print(<<ENDFORM); |
<form name="anno" method="post"> |
<form name="anno" method="post"> |
<input type="hidden" value='' name="action" > |
<input type="hidden" value='' name="action" > |
<input type="hidden" value='' name="pres_value" > |
<table><tr><td>Starting date:</td><td>$startdateform</td></tr> |
<input type="hidden" value='' name="pres_type" > |
<tr><td>Ending date:</td><td>$enddateform</td></tr></table> |
<input type="hidden" value='' name="pres_marker" > |
|
<input type="hidden" value='$today' name="startdate" > |
|
<input type="hidden" value='$tomorrow' name="enddate" > |
|
<a |
|
href="javascript:pjump('date_start','Starting Date',document.anno.startdate.value,'start','anno.pres','dateset');" |
|
>Set Starting Date</a> |
|
<a |
|
href="javascript:pjump('date_end','Ending Date',document.anno.enddate.value,'end','anno.pres','dateset');" |
|
>Set Ending Date</a><p> |
|
<textarea name="msg" rows="4" cols="60"> |
<textarea name="msg" rows="4" cols="60"> |
</textarea> |
</textarea> |
<input type="button" onClick="trysubmit()" value="Post Announcement"><hr> |
<input type="button" onClick="trysubmit()" value="Post Announcement"><hr> |
<input type="button" onClick="removesub()" value="Remove Marked"><hr> |
|
ENDFORM |
ENDFORM |
} |
} |
# ----------------------------------------------------- Summarize all calendars |
# ----------------------------------------------------- Summarize all calendars |
Line 264 ENDFORM
|
Line 243 ENDFORM
|
} |
} |
# ------------------------------------------------------------------- End table |
# ------------------------------------------------------------------- End table |
$r->print('</table>'); |
$r->print('</table>'); |
if ($allowed) { $r->print('</form>'); } |
if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries"></form>'); } |
$r->print('<p>'. |
$r->print('<p>'. |
'<a href="/adm/announcements?month='.$pm.'&year='.$py.'">Previous Month</a> '. |
'<a href="/adm/announcements?month='.$pm.'&year='.$py.'">Previous Month</a> '. |
'<a href="/adm/announcements?month='.$fm.'&year='.$fy.'">Next Month</a><p>'. |
'<a href="/adm/announcements?month='.$fm.'&year='.$fy.'">Next Month</a><p>'. |