'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').' '.$lt{$crstype}.' '.&mt('Include other personnel?').'
';
}
+ my $cansearch = 1;
+ my @alldoms = &Apache::lonnet::all_domains();
+ if (@alldoms == 1) {
+ my %domsrch = &Apache::lonnet::get_dom('configuration',
+ ['directorysrch'],$alldoms[0]);
+ if (ref($domsrch{'directorysrch'}) eq 'HASH') {
+ if ((!$domsrch{'directorysrch'}{'available'}) &&
+ ($domsrch{'directorysrch'}{'lcavailable'} eq '0')) {
+ $cansearch = 0;
+ }
+ }
+ }
for (my $i=0; $i<$persontotal; $i++) {
my @linkargs = map { 'person_'.$i.'_'.$_ } (@items);
my $linkargstr = join("','",@linkargs);
@@ -2070,9 +2141,14 @@ sub print_personnel_menu {
}
$sectionselector .= $newtitle.
''."\n";
- my $usersrchlinktxt = &mt('Search for user');
- my $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,
- $usersrchlinktxt);
+ my $usersrchlink;
+ if ($cansearch) {
+ my $usersrchlinktxt = &mt('Search for user');
+ $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,
+ $usersrchlinktxt);
+ } else {
+ $usersrchlink = ' ';
+ }
my $userchklinktxt = &mt('Check username');
my $userchklink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom,
$userchklinktxt,'checkusername');
@@ -2374,8 +2450,9 @@ ENDJS
}
sub viewcancel_javascript {
- my $alert = &mt('Are you sure you want to cancel this request?').'\\n'.
+ my $alert = &mt('Are you sure you want to cancel this request?')."\n".
&mt('Your request will be removed.');
+ &js_escape(\$alert);
return << "ENDJS";
function nextPage(formname,nextstate) {
if (confirm('$alert')) {
@@ -2747,6 +2824,7 @@ sub print_review {
my $enrollrow_title = &mt('Default Access Dates').' '.
'('.&Apache::lonnet::plaintext('st',$category).')';
+ my $instcode;
if ($env{'form.crstype'} eq 'official') {
if ((ref($codetitles) eq 'ARRAY') && (ref($cat_titles) eq 'HASH')) {
foreach my $title (@{$codetitles}) {
@@ -2762,6 +2840,11 @@ sub print_review {
}
}
}
+ if (ref($code_order) eq 'ARRAY') {
+ foreach my $item (@{$code_order}) {
+ $instcode .= $env{'form.instcode_'.$item};
+ }
+ }
$inst_headers .= '
'.&mt('Credits').'
';
if ($instcredits) {
$inst_values .= '
'.$instcredits.'
';
@@ -2849,7 +2932,7 @@ sub print_review {
($env{'form.clonedom'} =~ /^$match_domain$/)) {
my $canclone = &Apache::loncoursequeueadmin::can_clone_course($uname,
$udom,$env{'form.clonecrs'},$env{'form.clonedom'},
- $env{'form.crstype'});
+ $env{'form.crstype'},$dom,$instcode);
if ($canclone) {
my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'},
$env{'form.clonecrs'},('description','internal.coursecode'));
@@ -3011,19 +3094,20 @@ sub dates_from_form {
sub courseinfo_form {
my ($dom,$formname,$crstype,$next,$description) = @_;
- my %lt = &Apache::lonlocal::texthash(
+ my %js_lt = &Apache::lonlocal::texthash(
official => 'You must provide a (brief) course description.',
community => 'You must provide a (brief) community description.'
);
- $lt{'unofficial'} = $lt{'official'};
- $lt{'textbook'} = $lt{'official'};
+ &js_escape(\%js_lt);
+ $js_lt{'unofficial'} = $js_lt{'official'};
+ $js_lt{'textbook'} = $js_lt{'official'};
my $js_validate = <<"ENDJS";