[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
foxr
foxr@source.lon-capa.org
Mon, 21 Dec 2009 12:11:51 -0000
foxr Mon Dec 21 12:11:51 2009 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Fix errors printing syllabus for other people..
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.567 loncom/interface/lonprintout.pm:1.568
--- loncom/interface/lonprintout.pm:1.567 Wed Dec 16 11:06:48 2009
+++ loncom/interface/lonprintout.pm Mon Dec 21 12:11:51 2009
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.567 2009/12/16 11:06:48 foxr Exp $
+# $Id: lonprintout.pm,v 1.568 2009/12/21 12:11:51 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2805,6 +2805,7 @@
# so we will just rely on prntout.pl to strip ENDOFSTUDENTSTAMP from the
# postscript. Each ENDOFSTUDENTSTAMP will go on a line by itself.
#
+ my $syllabus_first = 0;
foreach my $curresline (@{$master_seq}) {
if (defined $page_breaks{$curresline}) {
if($i != 0) {
@@ -2863,8 +2864,10 @@
}
$current_output .= $rendered;
} elsif ($res_url=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) {
+ if ($i == 1) {
+ $syllabus_first = 1;
+ }
$printed .= $curresline.':';
-
my $rendered = &get_student_view_with_retries($curresline,$ssi_retry_count,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv);
if ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes') {
my $url = &Apache::lonnet::clutter($res_url);
@@ -2908,8 +2911,11 @@
my $header_start = ($columns_in_format == 1) ? '\lhead'
: '\fancyhead[LO]';
$header_line = $header_start.'{'.$header_line.'}';
- if ($current_output=~/\\documentclass/) {
+ if ($current_output=~/\\documentclass/ && (!$syllabus_first)) {
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$header_line$namepostfix}\\vskip 5 mm /;
+ } elsif ($syllabus_first) {
+
+ $current_output =~ s/\\\\ Last updated:/Last updated:/
} else {
my $blankpages =
'\clearpage\strut\clearpage'x$helper->{'VARS'}->{'EMPTY_PAGES'};