version 1.154, 2002/12/04 21:49:33
|
version 1.156, 2002/12/09 14:50:11
|
Line 1284 sub html_uneditable_cell {
|
Line 1284 sub html_uneditable_cell {
|
sub outsheet_html { |
sub outsheet_html { |
my ($sheet,$r) = @_; |
my ($sheet,$r) = @_; |
my ($num_uneditable,$realm,$row_type); |
my ($num_uneditable,$realm,$row_type); |
|
my $requester_is_student = ($ENV{'request.role'} =~ /^st\./); |
if ($sheet->{'sheettype'} eq 'assesscalc') { |
if ($sheet->{'sheettype'} eq 'assesscalc') { |
$num_uneditable = 1; |
$num_uneditable = 1; |
$realm = 'Assessment'; |
$realm = 'Assessment'; |
Line 1328 END
|
Line 1329 END
|
#################################### |
#################################### |
# Print out template row |
# Print out template row |
#################################### |
#################################### |
my ($rowlabel,@rowdata) = &get_row($sheet,'-'); |
my ($num_cols_output,$row_html,$rowlabel,@rowdata); |
my $row_html = '<tr><td>'.&format_html_rowlabel($sheet,$rowlabel).'</td>'; |
|
my $num_cols_output = 0; |
if (! $requester_is_student) { |
foreach my $cell (@rowdata) { |
($rowlabel,@rowdata) = &get_row($sheet,'-'); |
if ($num_cols_output++ < $num_uneditable) { |
$row_html = '<tr><td>'.&format_html_rowlabel($sheet,$rowlabel).'</td>'; |
$row_html .= '<td bgcolor="#FFDDDD">'; |
$num_cols_output = 0; |
$row_html .= &html_uneditable_cell($cell,'#FFDDDD'); |
foreach my $cell (@rowdata) { |
} else { |
if ($requester_is_student || |
$row_html .= '<td bgcolor="#EOFFDD">'; |
$num_cols_output++ < $num_uneditable) { |
$row_html .= &html_editable_cell($cell,'#E0FFDD'); |
$row_html .= '<td bgcolor="#FFDDDD">'; |
|
$row_html .= &html_uneditable_cell($cell,'#FFDDDD'); |
|
} else { |
|
$row_html .= '<td bgcolor="#EOFFDD">'; |
|
$row_html .= &html_editable_cell($cell,'#E0FFDD'); |
|
} |
|
$row_html .= '</td>'; |
} |
} |
$row_html .= '</td>'; |
$row_html.= "</tr>\n"; |
|
$r->print($row_html); |
} |
} |
$row_html.= "</tr>\n"; |
|
$r->print($row_html); |
|
#################################### |
#################################### |
# Print out summary/export row |
# Print out summary/export row |
#################################### |
#################################### |
($rowlabel,@rowdata) = &get_row($sheet,'0'); |
($rowlabel,@rowdata) = &get_row($sheet,'0'); |
$row_html = '<tr><td>'.&format_html_rowlabel($sheet,$rowlabel).'</td>'; |
$row_html = '<tr><td>'.&format_html_rowlabel($sheet,'Summary').'</td>'; |
$num_cols_output = 0; |
$num_cols_output = 0; |
foreach my $cell (@rowdata) { |
foreach my $cell (@rowdata) { |
if ($num_cols_output++ < 26) { |
if ($num_cols_output++ < 26 && ! $requester_is_student) { |
$row_html .= '<td bgcolor="#CCCCFF">'; |
$row_html .= '<td bgcolor="#CCCCFF">'; |
$row_html .= &html_editable_cell($cell,'#CCCCFF'); |
$row_html .= &html_editable_cell($cell,'#CCCCFF'); |
} else { |
} else { |
$row_html .= '<td bgcolor="#DDCCFF">'; |
$row_html .= '<td bgcolor="#DDCCFF">'; |
$row_html .= &html_uneditable_cell(undef,'#CCCCFF'); |
$row_html .= &html_uneditable_cell($cell,'#CCCCFF'); |
} |
} |
$row_html .= '</td>'; |
$row_html .= '</td>'; |
} |
} |
Line 1432 END
|
Line 1438 END
|
$bgcolor='#FFDDDD' if ($shown_cells < $num_uneditable); |
$bgcolor='#FFDDDD' if ($shown_cells < $num_uneditable); |
# |
# |
$row_html.='<td bgcolor='.$bgcolor.'>'; |
$row_html.='<td bgcolor='.$bgcolor.'>'; |
if ($shown_cells < $num_uneditable) { |
if ($requester_is_student || $shown_cells < $num_uneditable) { |
$row_html .= &html_uneditable_cell($cell,$bgcolor); |
$row_html .= &html_uneditable_cell($cell,$bgcolor); |
} else { |
} else { |
$row_html .= &html_editable_cell($cell,$bgcolor); |
$row_html .= &html_editable_cell($cell,$bgcolor); |
Line 3123 ENDSCRIPT
|
Line 3129 ENDSCRIPT
|
# If a new formula had been entered, go from work copy |
# If a new formula had been entered, go from work copy |
if ($ENV{'form.unewfield'}) { |
if ($ENV{'form.unewfield'}) { |
$r->print('<h2>Modified Workcopy</h2>'); |
$r->print('<h2>Modified Workcopy</h2>'); |
$ENV{'form.unewformula'}=~s/\'/\"/g; |
#$ENV{'form.unewformula'}=~s/\'/\"/g; |
$r->print('<p>Cell '.$ENV{'form.unewfield'}.' = <pre>'); |
$r->print('<p>Cell '.$ENV{'form.unewfield'}.' = <pre>'); |
$r->print(&HTML::Entities::encode($ENV{'form.unewformula'}). |
$r->print(&HTML::Entities::encode($ENV{'form.unewformula'}). |
'</pre></p>'); |
'</pre></p>'); |