version 1.154, 2002/12/04 21:49:33
|
version 1.155, 2002/12/05 15:31:05
|
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); |