version 1.109, 2006/06/22 15:33:35
|
version 1.110, 2006/06/22 15:42:38
|
Line 547 sub update_access {
|
Line 547 sub update_access {
|
my $updated_controls = $access_controls{$file_name}; |
my $updated_controls = $access_controls{$file_name}; |
my ($showstart,$showend); |
my ($showstart,$showend); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Type of change').'</th><th>'. |
$r->print('<th>'.&mt('Type of change').'</th><th>'. |
&mt('Access control').'</th><th>'.&mt('Dates available'). |
&mt('Access control').'</th><th>'.&mt('Dates available'). |
'</th><th>'.&mt('Additional information').'</th>'); |
'</th><th>'.&mt('Additional information').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
foreach my $chg (sort(keys(%processing))) { |
foreach my $chg (sort(keys(%processing))) { |
if (@{$processing{$chg}} > 0) { |
if (@{$processing{$chg}} > 0) { |
if ($chg eq 'delete') { |
if ($chg eq 'delete') { |
Line 830 sub access_setting_table {
|
Line 830 sub access_setting_table {
|
$r->print('<table border="0"><tr><td valign="top">'); |
$r->print('<table border="0"><tr><td valign="top">'); |
$r->print('<h3>'.&mt('Public access:').' '.$publictext.'</h3>'); |
$r->print('<h3>'.&mt('Public access:').' '.$publictext.'</h3>'); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>'); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
if ($public) { |
if ($public) { |
$r->print('<td>'.&actionbox('old',$publicnum,'public').'</td><td>'. |
$r->print('<td>'.&actionbox('old',$publicnum,'public').'</td><td>'. |
Line 846 sub access_setting_table {
|
Line 846 sub access_setting_table {
|
$r->print('</td><td width="40"> </td><td valign="top">'); |
$r->print('</td><td width="40"> </td><td valign="top">'); |
$r->print('<h3>'.&mt('Password-protected access:').' '.$guesttext.'</h3>'); |
$r->print('<h3>'.&mt('Password-protected access:').' '.$guesttext.'</h3>'); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available'). |
$r->print('<th>'.&mt('Action').'</th><th>'.&mt('Dates available'). |
'</th><th>'. &mt('Password').'</th>'); |
'</th><th>'. &mt('Password').'</th>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
my $passwd; |
my $passwd; |
if ($guest) { |
if ($guest) { |
Line 926 sub display_access_row {
|
Line 926 sub display_access_row {
|
my $uctype = $type; |
my $uctype = $type; |
$uctype =~ s/^(\w)/uc($1)/e; |
$uctype =~ s/^(\w)/uc($1)/e; |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_header_row()); |
$r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</td><th>'. |
$r->print('<th>'.&mt('Action?').'</th><th>'.&mt($uctype).'</th><th>'. |
&mt('Dates available').'</th>'); |
&mt('Dates available').'</th>'); |
if (($type eq 'course') || ($type eq 'group')) { |
if (($type eq 'course') || ($type eq 'group')) { |
$r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). |
$r->print('<th>'.&mt('Allowed [_1] member affiliations',$type). |
Line 938 sub display_access_row {
|
Line 938 sub display_access_row {
|
} elsif ($type eq 'domains') { |
} elsif ($type eq 'domains') { |
@all_doms = &Apache::loncommon::get_domains(); |
@all_doms = &Apache::loncommon::get_domains(); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
foreach my $key (@{$items}) { |
foreach my $key (@{$items}) { |
if (($type eq 'course') || ($type eq 'group')) { |
if (($type eq 'course') || ($type eq 'group')) { |
&course_row($r,$status,$type,$key,$access_controls, |
&course_row($r,$status,$type,$key,$access_controls, |
Line 956 sub display_access_row {
|
Line 957 sub display_access_row {
|
$r->print('<td colspan="',$colspan.'">'.&additional_item($type). |
$r->print('<td colspan="',$colspan.'">'.&additional_item($type). |
'</td>'); |
'</td>'); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} else { |
} else { |
$r->print(&mt('No [_1]-based conditions defined.<br />',$type). |
$r->print(&mt('No [_1]-based conditions defined.<br />',$type). |
Line 964 sub display_access_row {
|
Line 966 sub display_access_row {
|
return; |
return; |
} |
} |
|
|
sub course_row { |
sub course_js { |
my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; |
return qq| |
my %content; |
|
my $defdom = $env{'user.domain'}; |
|
if ($status eq 'old') { |
|
$defdom = $$access_controls{$item}{'domain'}; |
|
} |
|
$r->print(&Apache::loncommon::coursebrowser_javascript($defdom)); |
|
$r->print(qq| |
|
<script type="text/javascript"> |
<script type="text/javascript"> |
function setRoleOptions(caller,num,cdom,cnum,type) { |
function setRoleOptions(caller,num,cdom,cnum,type) { |
addIndexnum = getCallerIndex(caller); |
addIndexnum = getCallerIndex(caller); |
Line 1011 function getIndex(name,value) {
|
Line 1006 function getIndex(name,value) {
|
} |
} |
|
|
</script> |
</script> |
|); |
|; |
$r->print(&Apache::loncommon::start_data_table_row()); |
} |
|
|
|
sub course_row { |
|
my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; |
|
my %content; |
|
my $defdom = $env{'user.domain'}; |
|
if ($status eq 'old') { |
|
$defdom = $$access_controls{$item}{'domain'}; |
|
} |
|
my $js = &Apache::loncommon::coursebrowser_javascript($defdom) |
|
.&course_js(); |
my $crsgrptext = 'Groups'; |
my $crsgrptext = 'Groups'; |
if ($type eq 'group') { |
if ($type eq 'group') { |
$crsgrptext = 'Teams'; |
$crsgrptext = 'Teams'; |
} |
} |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
$type); |
$type); |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td>'); |
$r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>'); |
if ($status eq 'old') { |
if ($status eq 'old') { |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my $cid = $content{'domain'}.'_'.$content{'number'}; |
my %course_description = &Apache::lonnet::coursedescription($cid); |
my %course_description = &Apache::lonnet::coursedescription($cid); |
Line 1051 function getIndex(name,value) {
|
Line 1056 function getIndex(name,value) {
|
$r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); |
$r->print('<tr><td><input type="checkbox" name="add_role_'.$num.'" value="'.$role_id.'" checked="checked" />'.&mt('Add').'<input type="hidden" name="grplist_'.$num.'_'.$role_id.'" /></td>'.$role_selects); |
$r->print('</tr></table></td>'); |
$r->print('</tr></table></td>'); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
return; |
return; |
} |
} |
|
|
sub domains_row { |
sub domains_row { |
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; |
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
'domains'); |
'domains'); |
my $dom_select = '<select name="dom_'.$num.'" size="4" multiple="true"/>'. |
my $dom_select = '<select name="dom_'.$num.'" size="4" multiple="true"/>'. |
' <option value="">'.&mt('Please select').'</option>'; |
' <option value="">'.&mt('Please select').'</option>'; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
if ($status eq 'old') { |
if ($status eq 'old') { |
my $content = $$access_controls{$item}; |
my $content = $$access_controls{$item}; |
foreach my $dom (@{$all_doms}) { |
foreach my $dom (@{$all_doms}) { |
Line 1081 sub domains_row {
|
Line 1083 sub domains_row {
|
} |
} |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.$dom_select. |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.$dom_select. |
'</td><td>'.&dateboxes($num,$start,$end).'</td>'); |
'</td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
|
} |
} |
|
|
sub users_row { |
sub users_row { |
my ($r,$status,$item,$access_controls,$now,$then) = @_; |
my ($r,$status,$item,$access_controls,$now,$then) = @_; |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, |
'users'); |
'users'); |
my $curr_user_list; |
my $curr_user_list; |
Line 1096 sub users_row {
|
Line 1095 sub users_row {
|
$curr_user_list = &sort_users($content->{'users'}); |
$curr_user_list = &sort_users($content->{'users'}); |
} |
} |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.&mt("Format for users' username:domain information:").'<br /><tt>sparty:msu,illini:uiuc ... etc.</tt><br /><textarea name="users_'.$num.'" cols="30" rows="5">'.$curr_user_list.'</textarea></td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print('<td>'.&actionbox($status,$num,$scope).'</td><td>'.&mt("Format for users' username:domain information:").'<br /><tt>sparty:msu,illini:uiuc ... etc.</tt><br /><textarea name="users_'.$num.'" cols="30" rows="5">'.$curr_user_list.'</textarea></td><td>'.&dateboxes($num,$start,$end).'</td>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
} |
|
|
sub additional_item { |
sub additional_item { |