version 1.217, 2013/12/24 21:59:36
|
version 1.218, 2013/12/25 20:43:46
|
Line 2022 sub print_requestmail {
|
Line 2022 sub print_requestmail {
|
sub print_studentcode { |
sub print_studentcode { |
my ($settings,$rowtotal) = @_; |
my ($settings,$rowtotal) = @_; |
my $rownum = 0; |
my $rownum = 0; |
my %choices; |
my ($output,%current); |
$choices{'uniquecode'} = &mt('Generate unique six character code as course identifier?'); |
my @crstypes = ('official','unofficial','community','textbook'); |
my @toggles = ('uniquecode'); |
if (ref($settings->{'uniquecode'}) eq 'HASH') { |
my %defaultchecked = ('uniquecode' => 'off'); |
foreach my $type (@crstypes) { |
(my $reports,$rownum) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
$current{$type} = $settings->{'uniquecode'}{$type}; |
\%choices,$rownum); |
} |
$$rowtotal += $rownum; |
} |
return $reports; |
$output .= '<tr>'. |
|
'<td class="LC_left_item">'.&mt('Generate unique six character code as course identifier?').'</td>'. |
|
'<td class="LC_left_item">'; |
|
foreach my $type (@crstypes) { |
|
my $check = ' '; |
|
if ($current{$type}) { |
|
$check = ' checked="checked" '; |
|
} |
|
$output .= '<span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="uniquecode" value="'.$type.'"'.$check.'/>'. |
|
&mt($type).'</label></span>'.(' 'x2).' '; |
|
} |
|
$output .= '</td></tr>'; |
|
$$rowtotal ++; |
|
return $output; |
} |
} |
|
|
sub print_textbookcourses { |
sub print_textbookcourses { |
Line 6109 sub modify_quotas {
|
Line 6123 sub modify_quotas {
|
my @approvalnotify = &Apache::loncommon::get_env_multiple('form.reqapprovalnotify'); |
my @approvalnotify = &Apache::loncommon::get_env_multiple('form.reqapprovalnotify'); |
@approvalnotify = sort(@approvalnotify); |
@approvalnotify = sort(@approvalnotify); |
$confhash{'notify'}{'approval'} = join(',',@approvalnotify); |
$confhash{'notify'}{'approval'} = join(',',@approvalnotify); |
if ($env{'form.uniquecode'}) { |
my @crstypes = ('official','unofficial','community','textbook'); |
$confhash{'uniquecode'} = 1; |
my @hasuniquecode = &Apache::loncommon::get_env_multiple('form.uniquecode'); |
} else { |
foreach my $type (@hasuniquecode) { |
$confhash{'uniquecode'} = ''; |
if (grep(/^\Q$type\E$/,@crstypes)) { |
|
$confhash{'uniquecode'}{$type} = 1; |
|
} |
} |
} |
my ($newbook,@allpos); |
my ($newbook,@allpos); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
Line 6147 sub modify_quotas {
|
Line 6163 sub modify_quotas {
|
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
} |
} |
if ($domconfig{$action}{'uniquecode'}) { |
if (ref($domconfig{$action}{'uniquecode'}) eq 'HASH') { |
unless ($confhash{'uniquecode'}) { |
if (ref($confhash{'uniquecode'}) eq 'HASH') { |
$changes{'uniquecode'} = 1; |
foreach my $crstype (keys(%{$domconfig{$action}{'uniquecode'}})) { |
} |
unless ($confhash{'uniquecode'}{$crstype}) { |
} else { |
$changes{'uniquecode'} = 1; |
if ($confhash{'uniquecode'}) { |
} |
$changes{'uniquecode'} = 1; |
} |
} |
unless ($changes{'uniquecode'}) { |
|
foreach my $crstype (keys(%{$confhash{'uniquecode'}})) { |
|
unless ($domconfig{$action}{'uniquecode'}{$crstype}) { |
|
$changes{'uniquecode'} = 1; |
|
} |
|
} |
|
} |
|
} else { |
|
$changes{'uniquecode'} = 1; |
|
} |
|
} elsif (ref($confhash{'uniquecode'}) eq 'HASH') { |
|
$changes{'uniquecode'} = 1; |
} |
} |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
if (ref($domconfig{$action}{'textbooks'}) eq 'HASH') { |
if (ref($domconfig{$action}{'textbooks'}) eq 'HASH') { |
Line 6216 sub modify_quotas {
|
Line 6243 sub modify_quotas {
|
if ($confhash{'notify'}{'approval'}) { |
if ($confhash{'notify'}{'approval'}) { |
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
if ($confhash{'uniquecode'}) { |
if (ref($confhash{'uniquecode'} eq 'HASH')) { |
$changes{'uniquecode'} = 1; |
$changes{'uniquecode'} = 1; |
} |
} |
} |
} |
Line 6544 sub modify_quotas {
|
Line 6571 sub modify_quotas {
|
if ($action eq 'requestcourses') { |
if ($action eq 'requestcourses') { |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
if ($changes{'uniquecode'}) { |
if ($changes{'uniquecode'}) { |
$resulttext .= '<li>'. |
if (ref($confhash{'uniquecode'}) eq 'HASH') { |
&mt('Generation of six character code as course identifier for distribution to students set to '. |
my $codestr = join(' ',map{ &mt($_); } sort(keys(%{$confhash{'uniquecode'}}))); |
$offon[$env{'form.uniquecode'}]). |
$resulttext .= '<li>'. |
'</li>'; |
&mt('Generation of six character code as course identifier for distribution to students set to on for: [_1].','<b>'.$codestr.'</b>'). |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Generation of six character code as course identifier for distribution to students set to off.'). |
|
'</li>'; |
|
} |
} |
} |
if (ref($changes{'textbooks'}) eq 'HASH') { |
if (ref($changes{'textbooks'}) eq 'HASH') { |
$resulttext .= '<li>'.&mt('Available textbooks updated').'<ul>'; |
$resulttext .= '<li>'.&mt('Available textbooks updated').'<ul>'; |