--- loncom/interface/lonnotify.pm 2005/10/28 19:24:25 1.7
+++ loncom/interface/lonnotify.pm 2005/11/15 21:08:47 1.8
@@ -53,35 +53,50 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['command']);
my $command = $env{'form.command'};
+ my $origin = $env{'form.origin'};
+
&Apache::lonhtmlcommon::clear_breadcrumbs();
my %ltext=&Apache::lonlocal::texthash(
'note' => 'Notification E-mail',
);
my $function = &Apache::loncommon::get_users_function();
+ my $loadcode;
my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
- my $bodytag = &Apache::loncommon::bodytag('Broadcast e-mail to users');
+ if ((defined($env{'form.origin'})) && ($command eq 'compose' || $command eq 'pick_target' || $command eq 'pick_display')) {
+ unless ($env{'form.origin'} eq '') {
+ $loadcode = 'javascript:setFormElements(document.'.$env{'form.command'}.')';
+ if (($command eq 'pick_target') && (
+ ($origin eq 'compose') || ($origin eq 'process'))) {
+ if ($env{'form.coursepick'} eq 'category') {
+ $loadcode .= ';javascript:setCourseCat(document.'.$env{'form.command'}.')';
+ }
+ }
+ }
+ }
+ my $loaditems = ' onLoad="'.$loadcode.'" ';
+ my $bodytag = &Apache::loncommon::bodytag('Broadcast e-mail to users',$function,$loaditems);
my $html=&Apache::lonxml::xmlbegin();
&Apache::lonhtmlcommon::add_breadcrumb
({href=>'/adm/notify',
text=>"Broadcast E-mail"});
if ($command eq 'process') {
- &print_request_receipt($r,$cdom,$tablecolor,$bodytag,$html,\%ltext);
+ &print_request_receipt($r,$command,$cdom,$tablecolor,$bodytag,$html,\%ltext);
} elsif ($command eq 'compose') {
- &print_composition_form($r,$cdom,$tablecolor,$bodytag,$html,\%ltext);
+ &print_composition_form($r,$command,$cdom,$tablecolor,$bodytag,$html,\%ltext);
} elsif ($command eq 'pick_target') {
- &print_selection_form($r,$cdom,$tablecolor,$bodytag,$html,\%ltext);
+ &print_selection_form($r,$command,$cdom,$tablecolor,$bodytag,$html,\%ltext);
} elsif ($command eq 'pick_display') {
- &print_display_option_form($r,$cdom,$tablecolor,$bodytag,$html,\%ltext);
+ &print_display_option_form($r,$command,$cdom,$tablecolor,$bodytag,$html,\%ltext);
} elsif ($command eq 'display') {
- &print_display($r,$cdom,$tablecolor,$bodytag,$html,\%ltext);
+ &print_display($r,$command,$cdom,$tablecolor,$bodytag,$html,\%ltext);
} else {
- &print_front_page($r,$cdom,$tablecolor,$bodytag,$html,\%ltext);
+ &print_front_page($r,'front',$cdom,$tablecolor,$bodytag,$html,\%ltext);
}
return OK;
}
sub print_front_page {
- my ($r,$cdom,$tablecolor,$bodytag,$html,$ltext) = @_;
+ my ($r,$formname,$cdom,$tablecolor,$bodytag,$html,$ltext) = @_;
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs
(undef,'Broadcast e-mail to Domain','Broadcast_system_email');
my $jscript = qq|
@@ -110,7 +125,7 @@ $bodytag
$breadcrumbs
ENDONE
- $output .= '