version 1.60, 2011/09/26 15:48:06
|
version 1.66, 2020/08/10 19:28:21
|
Line 241 sub handler {
|
Line 241 sub handler {
|
} |
} |
|
|
# |
# |
|
# Check if display of course gradebook is blocked |
|
# |
|
|
|
if ($env{'request.course.id'}) { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my ($blocked,$blocktext) = |
|
&Apache::loncommon::blocking_status('grades',$cnum,$cdom); |
|
if ($blocked) { |
|
my $checkrole = "cm./$cdom/$cnum"; |
|
if ($env{'request.course.sec'} ne '') { |
|
$checkrole .= "/$env{'request.course.sec'}"; |
|
} |
|
unless ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) && |
|
($env{'request.role'} !~ m{^st\./$cdom/$cnum})) { |
|
&Apache::lonquickgrades::grades_blocked($r,$blocktext,'spreadsheet'); |
|
return OK; |
|
} |
|
} |
|
} |
|
|
|
# |
# Do not allow users without vgr or mgr priv to continue unless |
# Do not allow users without vgr or mgr priv to continue unless |
# grading type is set to spreadsheet. |
# grading type is set to spreadsheet. |
# |
# |
Line 276 sub handler {
|
Line 298 sub handler {
|
$symb = $env{'form.usymb'} if (exists($env{'form.usymb'})); |
$symb = $env{'form.usymb'} if (exists($env{'form.usymb'})); |
my $name = $env{'user.name'}; |
my $name = $env{'user.name'}; |
my $domain = $env{'user.domain'}; |
my $domain = $env{'user.domain'}; |
|
my $warning; |
if (exists($env{'form.sname'}) && $env{'form.sname'} ne '') { |
if (exists($env{'form.sname'}) && $env{'form.sname'} ne '') { |
$name = $env{'form.sname'}; |
if (($env{'form.sname'} ne $env{'user.name'}) || |
$domain = $env{'form.sdomain'}; |
($env{'form.sdomain'} ne $env{'user.domain'})) { |
|
if (($allowed_to_view) || ($allowed_to_edit)) { |
|
if (&Apache::lonnet::homeserver($env{'form.sname'},$env{'form.sdomain'}) ne 'no_host') { |
|
$name = $env{'form.sname'}; |
|
$domain = $env{'form.sdomain'}; |
|
} else { |
|
$warning = &mt('Requested user: "[_1]" does not exist; your own sheet is displayed instead.',$env{'form.sname'}.':'.$env{'form.sdomain'}); |
|
} |
|
} else { |
|
$warning = &mt('Your current role is not permitted to display this sheet for the requested user: "[_1]"; your own sheet is displayed instead.',$env{'form.sname'}.':'.$env{'form.sdomain'}); |
|
} |
|
} |
} |
} |
$env{'form.sname'} = $name; |
$env{'form.sname'} = $name; |
$env{'form.sdomain'} = $domain; |
$env{'form.sdomain'} = $domain; |
Line 333 sub handler {
|
Line 367 sub handler {
|
## |
## |
my $js; |
my $js; |
if ($allowed_to_edit) { |
if ($allowed_to_edit) { |
my %lt=( |
my %lt=&Apache::lonlocal::texthash( |
'ce' => 'Cell', |
'ce' => 'Cell', |
'ac' => 'Accept', |
'ac' => 'Save', |
'dc' => 'Discard Changes' |
'dc' => 'Cancel' |
); |
); |
my $extra_javascript = |
my $extra_javascript = |
&Apache::loncommon::browser_and_searcher_javascript(); |
&Apache::loncommon::browser_and_searcher_javascript(); |
Line 365 sub handler {
|
Line 399 sub handler {
|
// cellformula may contain less-than and greater-than symbols, so |
// cellformula may contain less-than and greater-than symbols, so |
// we need to escape them? |
// we need to escape them? |
edit_text +='$cell_edit_start'; |
edit_text +='$cell_edit_start'; |
edit_text += '<form name="editwinform">'; |
edit_text += '<form name="editwinform" action="">'; |
edit_text += '<center><h3>$lt{'ce'} '+cellname+'</h3>'; |
edit_text += '<center><h3>$lt{'ce'} '+cellname+'</h3>'; |
edit_text += '<textarea id="LC_newformula" name="newformula" '; |
edit_text += '<textarea id="LC_newformula" name="newformula" '; |
edit_text += ' cols="60" rows="12"; wrap="off" style="width:100%">'; |
edit_text += ' cols="60" rows="12"; wrap="off" style="width:100%">'; |
edit_text += cellformula+'</textarea>'; |
edit_text += cellformula+'</textarea>'; |
edit_text += '<div id="LC_aftertextarea"><br />'; |
edit_text += '<div id="LC_aftertextarea"><br />'; |
edit_text += '<input type="button" name="accept" value="$lt{'ac'}"'; |
edit_text += '<input type="button" name="accept" value="$lt{'ac'}"'; |
edit_text += ' onClick=\\\'javascript:'; |
edit_text += ' onclick=\\\'javascript:'; |
edit_text += 'opener.document.sheet.cell.value='; |
edit_text += 'opener.document.sheet.cell.value='; |
edit_text += '"'+cellname+'";'; |
edit_text += '"'+cellname+'";'; |
edit_text += 'opener.document.sheet.newformula.value='; |
edit_text += 'opener.document.sheet.newformula.value='; |
Line 382 sub handler {
|
Line 416 sub handler {
|
edit_text += ' '; |
edit_text += ' '; |
edit_text += '<input type="button" name="abort" '; |
edit_text += '<input type="button" name="abort" '; |
edit_text += 'value="$lt{'dc'}"'; |
edit_text += 'value="$lt{'dc'}"'; |
edit_text += ' onClick="javascript:self.close()" />'; |
edit_text += ' onclick="javascript:self.close()" />'; |
edit_text += '</center></div></form>$cell_edit_end'; |
edit_text += '</center></div></form>$cell_edit_end'; |
|
|
if (editwin != null && !(editwin.closed) ) { |
if (editwin != null && !(editwin.closed) ) { |
Line 416 ENDSCRIPT
|
Line 450 ENDSCRIPT
|
# |
# |
# Open the form |
# Open the form |
# |
# |
|
if ($warning) { |
|
$r->print('<p class="LC_info">'.$warning.'</p>'); |
|
} |
$r->print('<form action="'.$r->uri.'" name="sheet" method="post">'); |
$r->print('<form action="'.$r->uri.'" name="sheet" method="post">'); |
$r->print(&hiddenfield('sname' ,$env{'form.sname'}). |
$r->print(&hiddenfield('sname' ,$env{'form.sname'}). |
&hiddenfield('sdomain',$env{'form.sdomain'}). |
&hiddenfield('sdomain',$env{'form.sdomain'}). |
Line 520 ENDSCRIPT
|
Line 557 ENDSCRIPT
|
'</td>'. |
'</td>'. |
'<td valign="center">'.$html."</td></tr></table>\n"); |
'<td valign="center">'.$html."</td></tr></table>\n"); |
if ($action_message ne '') { |
if ($action_message ne '') { |
$r->print(<<END); |
$r->print( |
<table> |
&Apache::loncommon::confirmwrapper( |
<tr><td valign="top"><b>Last Action:</b></td> |
&mt('Last Action:') |
<td> </td> |
.$action_message) |
<td>$action_message</td> |
); |
</tr> |
|
</table> |
|
END |
|
} |
} |
$r->rflush(); |
$r->rflush(); |
} else { |
} else { |
Line 543 END
|
Line 577 END
|
if ($allowed_to_view) { |
if ($allowed_to_view) { |
$r->print('<td>'. |
$r->print('<td>'. |
&Apache::loncommon::help_open_topic("Spreadsheet_About", |
&Apache::loncommon::help_open_topic("Spreadsheet_About", |
'Spreadsheet Help'). |
&mt('Spreadsheet Help')). |
'</td>'); |
'</td>'); |
} |
} |
if ($allowed_to_edit) { |
if ($allowed_to_edit) { |
$r->print('<td>'. |
$r->print('<td>'. |
&Apache::loncommon::help_open_topic("Spreadsheet_Editing", |
&Apache::loncommon::help_open_topic("Spreadsheet_Editing", |
'Editing Help'). |
&mt('Editing Help')). |
'</td>'); |
'</td>'); |
} |
} |
$r->print('</tr></table>'); |
$r->print('</tr></table>'); |