--- loncom/interface/lonrequestcourse.pm 2009/11/04 17:42:17 1.39
+++ loncom/interface/lonrequestcourse.pm 2009/11/18 19:15:44 1.40
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Request a course
#
-# $Id: lonrequestcourse.pm,v 1.39 2009/11/04 17:42:17 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.40 2009/11/18 19:15:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -157,7 +157,7 @@ sub handler {
my @invalidcrosslist;
my %trail = (
- crstype => 'Course Request Action',
+ crstype => 'Request Action',
codepick => 'Category',
courseinfo => 'Description',
enrollment => 'Access Dates',
@@ -192,16 +192,30 @@ sub handler {
if (($udom =~ /^$match_domain$/) && ($uname =~ /^$match_username$/)) {
$result = &retrieve_settings($dom,$cnum,$udom,$uname);
} else {
- $warning = &mt('Invalid username or domain for course requestor');
+ if ($env{'form.crstype'} eq 'community') {
+ $warning = &mt('Invalid username or domain for community requestor');
+ } else {
+ $warning = &mt('Invalid username or domain for course requestor');
+ }
}
} else {
- $warning = &mt('No information was found for this course request.');
+ if ($env{'form.crstype'} eq 'community') {
+ $warning = &mt('No information was found for this community request.');
+ } else {
+ $warning = &mt('No information was found for this course request.');
+ }
}
} else {
$warning = &mt('No course request ID provided.');
}
} else {
- $warning = &mt('You do not have rights to view course request information.');
+ if ($env{'form.crstype'} eq 'any') {
+ $warning = &mt('You do not have rights to view course or community request information.');
+ } elsif ($env{'form.crstype'} eq 'community') {
+ $warning = &mt('You do not have rights to view community request information.');
+ } else {
+ $warning = &mt('You do not have rights to view course request information.');
+ }
}
} elsif ((defined($state)) && (defined($action))) {
if (($action eq 'view') && ($state eq 'details')) {
@@ -287,9 +301,9 @@ sub handler {
\@invalidcrosslist);
}
} else {
- $r->print(&header('Course Requests').$crumb.
+ $r->print(&header('Course/Community Requests').$crumb.
'
'.
- &mt('You do not have privileges to request creation of courses.').
+ &mt('You do not have privileges to request creation of courses or communities.').
'
'.&Apache::loncommon::end_page());
}
} elsif ($action eq 'view') {
@@ -302,8 +316,8 @@ sub handler {
} elsif ($action eq 'display') {
if ($warning ne '') {
my $args = { only_body => 1 };
- $r->print(&header('Course Requests','','',$args).$crumb.
- '
'."\n".$form."\n".
&print_review($dom,\@codetitles,\%cat_titles,\%cat_order,
\@code_order)."\n".
''."\n");
@@ -867,8 +908,14 @@ END
$navtxt{'next'},$state,$other,$navtxt{'other'});
$r->print('');
} elsif ($state eq 'cancel') {
+ my $title;
+ if ($env{'form.crstype'} eq 'community') {
+ $title = &mt('Cancel community request');
+ } else {
+ $title = &mt('Cancel course request');
+ }
my ($result,$output) = &print_cancel_request($dom,$env{'form.origcnum'});
- $r->print('
'.&mt('Cancel course request').'
'."\n".$form."\n".
+ $r->print('
'.$title.'
'."\n".$form."\n".
$output);
my @excluded = &get_excluded_elements($dom,$states,'view','cancel');
$r->print(&Apache::lonhtmlcommon::echo_form_input(\@excluded).'
');
@@ -917,7 +964,11 @@ END
''."\n".
''."\n");
if ($result eq 'ok') {
- $r->print(&mt('Your course request has been cancelled.'));
+ if ($env{'form.crstype'} eq 'community') {
+ $r->print(&mt('Your community request has been cancelled.'));
+ } else {
+ $r->print(&mt('Your course request has been cancelled.'));
+ }
} else {
$r->print('
'.
&mt('The request cancellation process was not complete.').
@@ -932,8 +983,16 @@ END
&Apache::lonnet::auto_possible_instcodes($dom,\@codetitles,\%cat_titles,
\%cat_order,\@code_order);
}
- $r->print(&header('Course Request','','','',{ 'only_body' => 1}).
- $crumb."\n".'
'.&mt('You may also add users later, once the community has been created, by using the "Manage community users" link, accessible from the "Main Menu".').'
';
+ } else {
+ $output .= '
'.&mt('You may also add users later, once the course has been created, by using the "Manage course users" link, accessible from the "Main Menu".').'
'.&mt('You have no matching course requests awaiting approval by a Domain Coordinator or held in a queue pending administrative action at your institution.').'
';
+ if ($env{'form.crstype'} eq 'any') {
+$output .= '
'.&mt('You have no matching course or community requests awaiting approval by a Domain Coordinator or held in a queue pending administrative action at your institution.').'
'.&mt('You have no matching community requests awaiting approval by a Domain Coordinator or held in a queue pending administrative action at your institution.').'
';
+ } else {
+ $output .= '
'.&mt('You have no matching course requests awaiting approval by a Domain Coordinator or held in a queue pending administrative action at your institution.').'
'.
- &mt('Cancelling the request will remove it from the queue of pending course requests').'
';
+ '
';
+ if ($crstype eq 'community') {
+ $output .= &mt('Cancelling the request will remove it from the queue of pending community requests').'
';
+ } else {
+ $output .= &mt('Cancelling the request will remove it from the queue of pending course requests').'
';
+ }
$result = 'ok';
} else {
$output = '
'.&mt('No record exists for the course ID').'
';
@@ -2266,8 +2355,10 @@ function validateForm() {
ENDJS
my $title = &mt('Brief Course Description');
+ my $clonetitle = &mt('Clone content and settings from an existing course?');
if ($crstype eq 'community') {
$title = &mt('Brief Community Description');
+ $clonetitle = &mt('Clone content and settings from an existing community?');
}
my $output .= $js_validate."\n".'