version 1.43, 2006/07/07 19:34:20
|
version 1.44, 2006/07/07 19:50:21
|
Line 1197 sub general_settings_form {
|
Line 1197 sub general_settings_form {
|
&privilege_specificity($r,$tabcol,$rowColor1,$rowColor2,$action, |
&privilege_specificity($r,$tabcol,$rowColor1,$rowColor2,$action, |
3,$tools,$stored,$toolprivs,$fixedprivs, |
3,$tools,$stored,$toolprivs,$fixedprivs, |
\@available,$formname,$gpterm,$ucgpterm); |
\@available,$formname,$gpterm,$ucgpterm); |
&mapping_options($r,$action,$formname,$page,$tabcol,$sectioncount, |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
$states,$stored,$navbuttons,4,5,$rowColor1, |
$states,$stored,$navbuttons,4,5, |
$rowColor2,$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype); |
$nexttext = $$navbuttons{'mose'}; |
$nexttext = $$navbuttons{'mose'}; |
} |
} |
$prevtext = $$navbuttons{'gtpp'}; |
$prevtext = $$navbuttons{'gtpp'}; |
Line 1491 sub choose_members_form {
|
Line 1491 sub choose_members_form {
|
&privilege_specificity($r,$tabcol,$rowColor1,$rowColor2,$action, |
&privilege_specificity($r,$tabcol,$rowColor1,$rowColor2,$action, |
$specimg,$tools,$stored,$toolprivs, |
$specimg,$tools,$stored,$toolprivs, |
$fixedprivs,\@available,$formname,$gpterm,$ucgpterm); |
$fixedprivs,\@available,$formname,$gpterm,$ucgpterm); |
my $newusers = &pick_new_members($r,$action,$formname,$tabcol,$rowColor1, |
my $newusers = &pick_new_members($r,$action,$formname,\@available,$idx, |
$rowColor2,\@available,$idx,$stored, |
$stored,$memimg,$users,$userdata, |
$memimg,$users,$userdata,$granularity, |
$granularity,\%origmembers,$gpterm, |
\%origmembers,$gpterm,$ucgpterm); |
$ucgpterm); |
if ($newusers || $action eq 'create') { |
if ($newusers || $action eq 'create') { |
&display_navbuttons($r,$formname,$$states{$action}[$page-1], |
&display_navbuttons($r,$formname,$$states{$action}[$page-1], |
$$navbuttons{'gtps'},$$states{$action}[$page+1], |
$$navbuttons{'gtps'},$$states{$action}[$page+1], |
Line 1632 END
|
Line 1632 END
|
} |
} |
|
|
sub pick_new_members { |
sub pick_new_members { |
my ($r,$action,$formname,$tabcol,$rowColor1,$rowColor2,$available,$idx, |
my ($r,$action,$formname,$available,$idx,$stored,$img,$users,$userdata, |
$stored,$img,$users,$userdata,$granularity,$origmembers,$gpterm, |
$granularity,$origmembers,$gpterm,$ucgpterm) = @_; |
$ucgpterm) = @_; |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'gpme' => "$ucgpterm membership", |
'gpme' => "$ucgpterm membership", |
'addm' => 'Add members', |
'addm' => 'Add members', |
Line 2438 sub choose_privs_form {
|
Line 2437 sub choose_privs_form {
|
if (keys(%{$sectioncount}) > 0) { |
if (keys(%{$sectioncount}) > 0) { |
my $img1 = 7; |
my $img1 = 7; |
my $img2 = 8; |
my $img2 = 8; |
&mapping_options($r,$action,$formname,$page,$tabcol,$sectioncount, |
&mapping_options($r,$action,$formname,$page,$sectioncount, |
$states,$stored,$navbuttons,$img1,$img2, |
$states,$stored,$navbuttons,$img1,$img2, |
$rowColor1,$rowColor2,$gpterm,$ucgpterm,$crstype); |
$gpterm,$ucgpterm,$crstype); |
} |
} |
} |
} |
my $prevtext = $$navbuttons{'gtps'}; |
my $prevtext = $$navbuttons{'gtps'}; |
Line 3070 sub process_membership {
|
Line 3069 sub process_membership {
|
} |
} |
|
|
sub mapping_options { |
sub mapping_options { |
my ($r,$action,$formname,$page,$tabcol,$sectioncount,$states,$stored, |
my ($r,$action,$formname,$page,$sectioncount,$states,$stored, |
$navbuttons,$img1,$img2,$rowColor1,$rowColor2,$gpterm,$ucgpterm, |
$navbuttons,$img1,$img2,$gpterm,$ucgpterm,$crstype) = @_; |
$crstype) = @_; |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'auto' => "Settings for automatic $gpterm enrollment", |
'auto' => "Settings for automatic $gpterm enrollment", |
'gmma' => "$ucgpterm membership mapping to specific sections/roles", |
'gmma' => "$ucgpterm membership mapping to specific sections/roles", |
Line 3088 sub mapping_options {
|
Line 3086 sub mapping_options {
|
'auex' => "Automatically expire $gpterm membership when roles are removed?", |
'auex' => "Automatically expire $gpterm membership when roles are removed?", |
'mapr' => "Mapping of roles and sections affected by automatic $gpterm enrollment/disenrollment follows scheme chosen below.", |
'mapr' => "Mapping of roles and sections affected by automatic $gpterm enrollment/disenrollment follows scheme chosen below.", |
); |
); |
&automapping($r,$action,$tabcol,$stored,\%lt,$img1); |
&automapping($r,$action,$stored,\%lt,$img1); |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td colspan="4"> </td> |
<td colspan="4"> </td> |
</tr>'); |
</tr>'); |
&mapping_settings($r,$tabcol,$rowColor1,$rowColor2,$sectioncount,\%lt, |
&mapping_settings($r,$sectioncount,\%lt,$stored,$img2,$crstype); |
$stored,$img2,$crstype); |
|
return; |
return; |
} |
} |
|
|
sub automapping { |
sub automapping { |
my ($r,$action,$tabcol,$stored,$lt,$image) = @_; |
my ($r,$action,$stored,$lt,$image) = @_; |
my $add = 'off'; |
my $add = 'off'; |
my $drop = 'off'; |
my $drop = 'off'; |
if (exists($$stored{'autoadd'})) { |
if (exists($$stored{'autoadd'})) { |
Line 3110 sub automapping {
|
Line 3107 sub automapping {
|
} |
} |
&topic_bar($r,$image,$$lt{'endi'}); |
&topic_bar($r,$image,$$lt{'endi'}); |
$r->print(' |
$r->print(' |
<tr> |
<b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br /> |
<td> </td> |
|
<td colspan="3"> |
|
<b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td colspan="4"> </td> |
|
</tr> |
|
<tr> |
|
<td> </td> |
|
<td colspan="3"> |
|
<nobr>'.$$lt{'auad'}.': |
<nobr>'.$$lt{'auad'}.': |
<label><input type="radio" name="autoadd" value="on" />on </label><label><input type="radio" name="autoadd" value="off" checked="checked" />off</label>'); |
<label><input type="radio" name="autoadd" value="on" />on </label><label><input type="radio" name="autoadd" value="off" checked="checked" />off</label>'); |
if ($action eq 'modify') { |
if ($action eq 'modify') { |
$r->print(' ('.$$lt{'curr'}.' <b>'.$$lt{$add}.'</b>)'); |
$r->print(' ('.$$lt{'curr'}.' <b>'.$$lt{$add}.'</b>)'); |
} |
} |
$r->print(' |
$r->print(' |
</nobr> |
</nobr><br /> |
</td> |
|
</tr> |
|
<tr> |
|
<td> </td> |
|
<td colspan="3"> |
|
<nobr>'.$$lt{'auex'}.': |
<nobr>'.$$lt{'auex'}.': |
<label><input type="radio" name="autodrop" value="on" />on </label><label><input type="radio" name="autodrop" value="off" checked="checked" />off</label>'); |
<label><input type="radio" name="autodrop" value="on" />on </label><label><input type="radio" name="autodrop" value="off" checked="checked" />off</label>'); |
if ($action eq 'modify') { |
if ($action eq 'modify') { |
$r->print(' ('.$$lt{'curr'}.' <b>'.$$lt{$drop}.'</b>)'); |
$r->print(' ('.$$lt{'curr'}.' <b>'.$$lt{$drop}.'</b>)'); |
} |
} |
$r->print('</nobr> |
$r->print('</nobr><br /><br />'.$$lt{'mapr'}); |
</td> |
|
</tr> |
|
<tr> |
|
<td colspan="4"> </td> |
|
</tr> |
|
<tr> |
|
<td> </td> |
|
<td colspan="3">'.$$lt{'mapr'}.' |
|
</td> |
|
</tr> |
|
'); |
|
} |
} |
|
|
sub mapping_settings { |
sub mapping_settings { |
my ($r,$tabcol,$rowColor1,$rowColor2,$sectioncount,$lt,$stored,$image, |
my ($r,$sectioncount,$lt,$stored,$image,$crstype) = @_; |
$crstype) = @_; |
|
my @sections = keys(%{$sectioncount}); |
my @sections = keys(%{$sectioncount}); |
if (@sections > 0) { |
if (@sections > 0) { |
@sections = sort {$a cmp $b} @sections; |
@sections = sort {$a cmp $b} @sections; |
Line 3163 sub mapping_settings {
|
Line 3132 sub mapping_settings {
|
unshift(@sections,'all'); # Put 'all' at the front of the list |
unshift(@sections,'all'); # Put 'all' at the front of the list |
} |
} |
&topic_bar($r,$image,$$lt{'pirs'}); |
&topic_bar($r,$image,$$lt{'pirs'}); |
$r->print(' |
|
<tr> |
|
<td> </td> |
|
<td colspan="3"> |
|
'); |
|
my @roles = &standard_roles(); |
my @roles = &standard_roles(); |
my %customroles = &my_custom_roles(); |
my %customroles = &my_custom_roles(); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row()); |
$r->print(' |
$r->print(' |
<tr bgcolor="'.$tabcol.'"> |
|
<th>'.&mt('Active?').'</th> |
<th>'.&mt('Active?').'</th> |
<th>'.&mt('Role').'</th>'); |
<th>'.&mt('Role').'</th>'); |
if (@sections > 0) { |
if (@sections > 0) { |
$r->print('<th>'.&mt('Sections').'</th></tr>'."\n"); |
$r->print('<th>'.&mt('Sections').'</th>'); |
} |
} |
my $rowNum = 0; |
$r->print(&Apache::loncommon::end_data_table_header_row()."\n"); |
my $rowColor; |
|
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $plrole=&Apache::lonnet::plaintext($role,$crstype); |
my $plrole=&Apache::lonnet::plaintext($role,$crstype); |
my $sections_sel; |
my $sections_sel; |
Line 3194 sub mapping_settings {
|
Line 3157 sub mapping_settings {
|
'</td>'; |
'</td>'; |
} |
} |
} |
} |
if ($rowNum %2 == 1) { |
$r->print(&Apache::loncommon::start_data_table_row(). |
$rowColor = $rowColor1; |
'<td><input type="checkbox" '. |
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
$r->print('<tr bgcolor="'.$rowColor.'"><td><input type="checkbox" '. |
|
'name="autorole" value="'.$role.'"></td><td>'.$plrole. |
'name="autorole" value="'.$role.'"></td><td>'.$plrole. |
'</td>'.$sections_sel.'</tr>'); |
'</td>'.$sections_sel. |
$rowNum ++; |
&Apache::loncommon::end_data_table_row()); |
} |
} |
foreach my $role (sort(keys(%customroles))) { |
foreach my $role (sort(keys(%customroles))) { |
my $sections_sel; |
my $sections_sel; |
if (@sections > 0) { |
if (@sections > 0) { |
$sections_sel = '<td>'.§ions_selection(\@sections,'sec_'.$role). |
$sections_sel = |
'</td>'; |
'<td>'.§ions_selection(\@sections,'sec_'.$role).'</td>'; |
} |
} |
if ($rowNum %2 == 1) { |
$r->print(&Apache::loncommon::start_data_table_row(). |
$rowColor = $rowColor1; |
'<td><input type="checkbox" '. |
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
$r->print('<tr bgcolor="'.$rowColor.'"><td><input type="checkbox" '. |
|
'value="'.$role.'"></td><td>'.$role.'</td>'. |
'value="'.$role.'"></td><td>'.$role.'</td>'. |
$sections_sel.'</tr>'); |
$sections_sel. |
$rowNum ++; |
&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::loncommon::end_data_table()); |
return; |
return; |
} |
} |
|
|