version 1.79, 2008/10/21 14:29:39
|
version 1.80, 2008/10/22 17:39:05
|
Line 1646 END
|
Line 1646 END
|
$$functions{$allfunctions[$i]}.'</label></td> |
$$functions{$allfunctions[$i]}.'</label></td> |
<td> </td><td> </td>'); |
<td> </td><td> </td>'); |
} |
} |
$r->print('<td><input type="button" value="check all" '. |
$r->print('<td><input type="button" value="'.&mt('check all').'" '. |
'onclick="javascript:checkAll(document.'.$formname.'.tool)" />'. |
'onclick="javascript:checkAll(document.'.$formname.'.tool)" />'. |
'</td></tr><tr><td> </td>'); |
'</td></tr><tr><td> </td>'); |
for (my $j=$halfnum; $j<@allfunctions; $j++) { |
for (my $j=$halfnum; $j<@allfunctions; $j++) { |
Line 1660 END
|
Line 1660 END
|
} |
} |
$r->print(' |
$r->print(' |
<td> |
<td> |
<input type="button" value="uncheck all" |
<input type="button" value="'.&mt('uncheck all').'" |
onclick="javascript:uncheckAll(document.'.$formname.'.tool)" /> |
onclick="javascript:uncheckAll(document.'.$formname.'.tool)" /> |
</td> |
</td> |
</tr> |
</tr> |
Line 1669 END
|
Line 1669 END
|
<td colspan="10">'.$lt{'doyo'}.' <label><input type="radio" name="granularity" value="Yes" />'.&mt('Yes').'</label> <label><input type="radio" name="granularity" value="No" checked="checked" />'.&mt('No').'</label>'); |
<td colspan="10">'.$lt{'doyo'}.' <label><input type="radio" name="granularity" value="Yes" />'.&mt('Yes').'</label> <label><input type="radio" name="granularity" value="No" checked="checked" />'.&mt('No').'</label>'); |
if ($action eq 'modify') { |
if ($action eq 'modify') { |
$r->print(' ('.&mt('Currently set to "[_1]"', |
$r->print(' ('.&mt('Currently set to "[_1]"', |
$$stored{'granularity'}).')'); |
&mt($$stored{'granularity'})).')'); |
} |
} |
$r->print(' |
$r->print(' |
</td> |
</td> |
Line 1806 sub sections_selection {
|
Line 1806 sub sections_selection {
|
|
|
sub access_date_settings { |
sub access_date_settings { |
my ($r,$action,$formname,$stored,$image,$gpterm,$ucgpterm) = @_; |
my ($r,$action,$formname,$stored,$image,$gpterm,$ucgpterm) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my $sten = &mt("Default start and end dates for $gpterm access"); |
'sten' => "Default start and end dates for $gpterm access", |
|
); |
|
my $starttime = time; |
my $starttime = time; |
my $endtime = time+(6*30*24*60*60); # 6 months from now, approx |
my $endtime = time+(6*30*24*60*60); # 6 months from now, approx |
if ($action eq 'modify') { |
if ($action eq 'modify') { |
Line 1818 sub access_date_settings {
|
Line 1816 sub access_date_settings {
|
} |
} |
} |
} |
my ($table) = &date_setting_table($starttime,$endtime,$formname); |
my ($table) = &date_setting_table($starttime,$endtime,$formname); |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'sten'}).' |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$sten).' |
'.$table.' |
'.$table.' |
'); |
'); |
return; |
return; |
Line 1935 sub print_current_settings {
|
Line 1933 sub print_current_settings {
|
ygrs => "Your group selections - ", |
ygrs => "Your group selections - ", |
tfwa => "The following settings will apply to the group:", |
tfwa => "The following settings will apply to the group:", |
difn => 'Different collaborative tools<br />for different members:', |
difn => 'Different collaborative tools<br />for different members:', |
stda => 'Start date', |
stda => 'Start date:', |
enda => 'End date:', |
enda => 'End date:', |
); |
); |
my $showstart = &Apache::lonlocal::locallocaltime($startdate); |
my $showstart = &Apache::lonlocal::locallocaltime($startdate); |
Line 1987 sub print_current_settings {
|
Line 1985 sub print_current_settings {
|
$r->print('</tr></table><br />'); |
$r->print('</tr></table><br />'); |
} |
} |
if (@{$unavailable} > 0) { |
if (@{$unavailable} > 0) { |
$r->print('<b>'.&mt('<b>Unavailable for assignment:').'</b>'. |
$r->print('<b>'.&mt('Unavailable for assignment:').'</b>'. |
'<table class="LC_group_priv"><tr>'); |
'<table class="LC_group_priv"><tr>'); |
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; |
my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; |
for (my $j=0; $j<@{$unavailable}; $j++) { |
for (my $j=0; $j<@{$unavailable}; $j++) { |
Line 2005 sub print_current_settings {
|
Line 2003 sub print_current_settings {
|
$r->print('</tr></table>'); |
$r->print('</tr></table>'); |
} |
} |
my $quota_text=&mt('[_1] Mb',$quota); |
my $quota_text=&mt('[_1] Mb',$quota); |
|
my $granu_text=&mt($granularity); |
$r->print(<<"END"); |
$r->print(<<"END"); |
</td> |
</td> |
<td valign="top"><b>$lt{'difn'}</b> $granularity</td> |
<td valign="top"><b>$lt{'difn'}</b> $granu_text</td> |
<td valign="top">$quota_text</td> |
<td valign="top">$quota_text</td> |
<td valign="top"><b>$lt{'stda'}</b> $showstart<br /> |
<td valign="top"><b>$lt{'stda'}</b> $showstart<br /> |
<b>$lt{'enda'}</b> $showend |
<b>$lt{'enda'}</b> $showend |
Line 2067 sub pick_new_members {
|
Line 2066 sub pick_new_members {
|
$r->print('<td> |
$r->print('<td> |
<fieldset><legend><b>'.$lt{'setf'}.'</b></legend> |
<fieldset><legend><b>'.$lt{'setf'}.'</b></legend> |
<nobr> |
<nobr> |
<input type="button" value="check all" |
<input type="button" value="'.&mt('check all').'" |
onclick="javascript:checkAllTools(document.'.$formname.')" /> |
onclick="javascript:checkAllTools(document.'.$formname.')" /> |
|
|
<input type="button" value="uncheck all" |
<input type="button" value="'.&mt('uncheck all').'" |
onclick="javascript:uncheckAllTools(document.'.$formname.')" /> |
onclick="javascript:uncheckAllTools(document.'.$formname.')" /> |
</nobr> |
</nobr> |
</fieldset></td>'); |
</fieldset></td>'); |
Line 2512 sub current_membership {
|
Line 2511 sub current_membership {
|
<td> |
<td> |
<nobr> |
<nobr> |
<fieldset><legend><b>'.$lt{'curf'}.'</b></legend> |
<fieldset><legend><b>'.$lt{'curf'}.'</b></legend> |
<input type="button" value="check all" |
<input type="button" value="'.&mt('check all').'" |
onclick="javascript:checkAllTools(document.'.$formname.')" /> |
onclick="javascript:checkAllTools(document.'.$formname.')" /> |
|
|
<input type="button" value="uncheck all" |
<input type="button" value="'.&mt('uncheck all').'" |
onclick="javascript:uncheckAllTools(document.'.$formname.')" /> |
onclick="javascript:uncheckAllTools(document.'.$formname.')" /> |
</fieldset> |
</fieldset> |
</nobr> |
</nobr> |
Line 2671 sub check_uncheck_buttons {
|
Line 2670 sub check_uncheck_buttons {
|
<fieldset> |
<fieldset> |
<legend><b>'.$title.'</b></legend> |
<legend><b>'.$title.'</b></legend> |
<nobr> |
<nobr> |
<input type="button" value="check all" |
<input type="button" value="'.&mt('check all').'" |
onclick="javascript:checkAll(document.'.$formname.'.'.$field.')" /> |
onclick="javascript:checkAll(document.'.$formname.'.'.$field.')" /> |
|
|
<input type="button" value="uncheck all" |
<input type="button" value="'.&mt('uncheck all').'" |
onclick="javascript:uncheckAll(document.'.$formname.'.'.$field.')" /> |
onclick="javascript:uncheckAll(document.'.$formname.'.'.$field.')" /> |
</nobr> |
</nobr> |
</fieldset> |
</fieldset> |
Line 2876 sub member_privileges_form {
|
Line 2875 sub member_privileges_form {
|
'members being added or modified, '. |
'members being added or modified, '. |
'there are no optional privileges to set '. |
'there are no optional privileges to set '. |
'for specific members.', |
'for specific members.', |
'algr' => 'All new group members will receive the same privileges.', 'ifex' => 'If previously expired members are being re-enabled, or '. |
'algr' => 'All new group members will receive the same privileges.', |
|
'ifex' => 'If previously expired members are being re-enabled, or '. |
'if access for future members is being activated now, '. |
'if access for future members is being activated now, '. |
'previously set privileges will be preserved.', |
'previously set privileges will be preserved.', |
'asno' => 'As no group members are being added, '. |
'asno' => 'As no group members are being added, '. |
Line 2954 sub member_privileges_form {
|
Line 2954 sub member_privileges_form {
|
$r->print('<td valign="top">'); |
$r->print('<td valign="top">'); |
$r->print('<table class="thinborder"><tr>'. |
$r->print('<table class="thinborder"><tr>'. |
'<th colspan="'.$colspan.'">'. |
'<th colspan="'.$colspan.'">'. |
$tool.'</th></tr><tr>'); |
&mt($tool).'</th></tr><tr>'); |
my $privcount = 0; |
my $privcount = 0; |
foreach my $priv (@{$showboxes{$tool}}) { |
foreach my $priv (@{$showboxes{$tool}}) { |
$privcount ++; |
$privcount ++; |
Line 2968 sub member_privileges_form {
|
Line 2968 sub member_privileges_form {
|
} else { |
} else { |
$r->print('<td>'); |
$r->print('<td>'); |
} |
} |
$r->print(qq| |
$r->print( |
<fieldset><legend><b>$$toolprivs{$tool}{$priv}</b></legend> |
'<fieldset><legend><b>'.&mt($$toolprivs{$tool}{$priv}).'</b></legend>' |
<nobr> |
.'<span class="LC_nobreak">' |
<input type="button" value="check all" |
.' <input type="button" value="'.&mt('check all').'"' |
onclick="javascript:checkAll(document.$formname.userpriv_$priv)" /> |
.' onclick="javascript:checkAll(document.'.$formname.'.userpriv_'.$priv.')" />' |
|
.' ' |
<input type="button" value="uncheck all" |
.'<input type="button" value="'.&mt('uncheck all').'"' |
onclick="javascript:uncheckAll(document.$formname.userpriv_$priv)" /> |
.' onclick="javascript:uncheckAll(document.'.$formname.'.userpriv_'.$priv.')" />' |
</nobr></fieldset><br />|); |
.'</span></fieldset><br />' |
|
); |
$r->print('</td>'); |
$r->print('</td>'); |
if ($privcount < @{$showboxes{$tool}}) { |
if ($privcount < @{$showboxes{$tool}}) { |
if (@{$showboxes{$tool}} > 2) { |
if (@{$showboxes{$tool}} > 2) { |
Line 3471 sub process_membership {
|
Line 3472 sub process_membership {
|
$r->print('<br />'); |
$r->print('<br />'); |
} |
} |
if (@unchanged > 0) { |
if (@unchanged > 0) { |
$r->print(&mt('No change occurred for the following users:<br />')); |
$r->print(&mt('No change occurred for the following users:').'<br />'); |
foreach my $user (sort(@unchanged)) { |
foreach my $user (sort(@unchanged)) { |
$r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />'); |
$r->print($$userdata{$user}[$$idx{fullname}].' - '.$user.'<br />'); |
} |
} |
$r->print('<br />'); |
$r->print('<br />'); |
} |
} |
if ($roster_result eq 'ok') { |
if ($roster_result eq 'ok') { |
$r->print('<br />'.&mt('[_1] membership list updated.',$ucgpterm)); |
$r->print('<div class="LC_success">' |
$r->print('<p>'.&mt("Any currently logged in course users affected by the changes you made to group membership or privileges for the [_1] group will need to log out and log back in for their LON-CAPA sessions to reflect these changes.",$groupname).'</p>'); |
.&mt($ucgpterm.' membership list updated.') |
|
.'</div>'); |
|
$r->print('<p class="LC_info">' |
|
.&mt('Any currently logged in course users affected by the changes you made' |
|
.' to group membership or privileges for the [_1] group will need to log out' |
|
.' and log back in for their LON-CAPA sessions to reflect these changes.' |
|
,'<i>'.$groupname.'</i>') |
|
.'</p>' |
|
); |
} else { |
} else { |
$r->print('<br />'.&mt('An error occurred while updating the [_1] membership list -',$gpterm).$roster_result.'<br />'); |
$r->print('<div class="LC_error">' |
|
.&mt("An error occurred while updating the $gpterm membership list:") |
|
.'<br />'.$roster_result |
|
.'</div>'); |
} |
} |
return; |
return; |
} |
} |
Line 3523 sub automapping {
|
Line 3535 sub automapping {
|
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).' |
$r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).' |
<b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br /> |
<b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br /> |
<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" />'.&mt('on').' </label><label><input type="radio" name="autoadd" value="off" checked="checked" />'.&mt('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><br /> |
</nobr><br /> |
<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" />'.&mt('on').' </label><label><input type="radio" name="autodrop" value="off" checked="checked" />'.&mt('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>)'); |
} |
} |
Line 3747 sub add_group_folder {
|
Line 3759 sub add_group_folder {
|
my ($cdom,$cnum,$now,$groupname,$action,$description,$tools,$groupinfo, |
my ($cdom,$cnum,$now,$groupname,$action,$description,$tools,$groupinfo, |
$gpterm,$ucgpterm,$crstype) = @_; |
$gpterm,$ucgpterm,$crstype) = @_; |
if ($cdom eq '' || $cnum eq '') { |
if ($cdom eq '' || $cnum eq '') { |
return &mt('Error: invalid course domain or number - group folder creation failed'); |
return '<span class="LC_error">' |
|
.&mt('Error: invalid course domain or number - group folder creation failed.') |
|
.'</span>'; |
} |
} |
my ($outcome,$allgrpsmap,$grpmap,$boardsmap,$grppage,$warning); |
my ($outcome,$allgrpsmap,$grpmap,$boardsmap,$grppage,$warning); |
my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/'; |
my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/'; |
Line 3757 sub add_group_folder {
|
Line 3771 sub add_group_folder {
|
# check if group_allfolders.sequence exists. |
# check if group_allfolders.sequence exists. |
my $mapcontents = &Apache::lonnet::getfile($allgrpsmap); |
my $mapcontents = &Apache::lonnet::getfile($allgrpsmap); |
if ($mapcontents eq '-1') { #file does not exist; |
if ($mapcontents eq '-1') { #file does not exist; |
my $grpstitle = &mt('[_1] [_2]s',$crstype,$ucgpterm); |
my $grpstitle = &mt("$crstype $ucgpterm".'s'); |
my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'}; |
my $topmap_url = '/'.$env{'course.'.$env{'request.course.id'}.'.url'}; |
$topmap_url =~ s|/+|/|g; |
$topmap_url =~ s|/+|/|g; |
if ($topmap_url =~ m|^/uploaded|) { |
if ($topmap_url =~ m|^/uploaded|) { |
$outcome = &map_updater($cdom,$cnum,'group_allfolders.sequence', |
$outcome = &map_updater($cdom,$cnum,'group_allfolders.sequence', |
'toplevelgroup',$grpstitle,$topmap_url); |
'toplevelgroup',$grpstitle,$topmap_url); |
} else { |
} else { |
$outcome = &mt('Non-standard course - folder for all groups not added.'); |
$outcome = '<span class="LC_warning">' |
|
.&mt('Non-standard course - folder for all groups not added.') |
|
.'</span>'; |
} |
} |
if ($outcome ne 'ok') { |
if ($outcome ne 'ok') { |
my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders'); |
my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders'); |
Line 3779 sub add_group_folder {
|
Line 3795 sub add_group_folder {
|
$warning = $delresult ; |
$warning = $delresult ; |
} |
} |
} else { |
} else { |
$outcome = &mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.'); |
$outcome = '<span class="LC_error">' |
|
.&mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.') |
|
.'</div>'; |
return $outcome; |
return $outcome; |
} |
} |
my $grpfolder = &mt($ucgpterm.' Folder - [_1]',$description); |
my $grpfolder = &mt($ucgpterm.' Folder - [_1]',$description); |
Line 3855 sub release_folder_lock {
|
Line 3873 sub release_folder_lock {
|
my @del_lock = ($folder_name."\0".'locked_folder'); |
my @del_lock = ($folder_name."\0".'locked_folder'); |
my $dellockoutcome=&Apache::lonnet::del('coursegroups',\@del_lock,$cdom,$cnum); |
my $dellockoutcome=&Apache::lonnet::del('coursegroups',\@del_lock,$cdom,$cnum); |
if ($dellockoutcome ne 'ok') { |
if ($dellockoutcome ne 'ok') { |
return ('<br />'.&mt('Warning: failed to release lock for folder: [_1].',$folder_name).'<br />'); |
return ('<div class="LC_error">' |
|
.&mt('Warning: failed to release lock for folder: [_1].','<tt>'.$folder_name.'</tt>') |
|
.'</div>' |
|
); |
} else { |
} else { |
return 'ok'; |
return 'ok'; |
} |
} |
Line 3870 sub map_updater {
|
Line 3891 sub map_updater {
|
my $newmapurl=&Apache::lonnet::finishuserfileupload($cnum,$cdom,$itemname, |
my $newmapurl=&Apache::lonnet::finishuserfileupload($cnum,$cdom,$itemname, |
$newfile); |
$newfile); |
if ($newmapurl !~ m|^/uploaded|) { |
if ($newmapurl !~ m|^/uploaded|) { |
$outcome = &mt('Error uploading new folder.')." ($newfile): $newmapurl".'<br />'; |
$outcome = '<div class="LC_error">' |
|
.&mt('Error uploading new folder.')." ($newfile): $newmapurl" |
|
.'</div>'; |
return $outcome; |
return $outcome; |
} |
} |
my ($errtext,$fatal)=&LONCAPA::map::mapread($parentmap); |
my ($errtext,$fatal)=&LONCAPA::map::mapread($parentmap); |
if ($fatal) { |
if ($fatal) { |
$outcome = &mt('Error reading contents of parent folder')." ($parentmap): $errtext".'<br />'; |
$outcome = '<div class="LC_error">' |
|
.&mt('Error reading contents of parent folder.')." ($parentmap): $errtext" |
|
.'</div>'; |
return $outcome; |
return $outcome; |
} else { |
} else { |
my $newidx=&LONCAPA::map::getresidx($newmapurl); |
my $newidx=&LONCAPA::map::getresidx($newmapurl); |
Line 3884 sub map_updater {
|
Line 3909 sub map_updater {
|
$LONCAPA::map::order[1+$#LONCAPA::map::order]=$newidx; |
$LONCAPA::map::order[1+$#LONCAPA::map::order]=$newidx; |
my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1); |
my ($outtext,$errtext) = &LONCAPA::map::storemap($parentmap,1); |
if ($errtext) { |
if ($errtext) { |
$outcome = &mt('Error saving updated parent folder')." ($parentmap): $errtext".'<br />'; |
$outcome = '<div class="LC_error">' |
|
.&mt('Error saving updated parent folder.')." ($parentmap): $errtext" |
|
.'</div>'; |
return $outcome; |
return $outcome; |
} |
} |
} |
} |
Line 3934 sub parm_setter {
|
Line 3961 sub parm_setter {
|
} |
} |
} |
} |
} else { |
} else { |
$allresults = &mt('Parameters not set for [_1] because the resource was not recognized as part of the course',$url).'<br />'; |
$allresults = '<div class="LC_warning">' |
|
.&mt('Parameters not set for [_1] because the resource was not recognized' |
|
.' as part of the course.','<tt>'.$url.'</tt>') |
|
.'</div>'; |
} |
} |
return $allresults; |
return $allresults; |
} |
} |