X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=blobdiff_plain;f=perl%2Fschedproc;h=2a80bc3df745f296e61985445c172f254d6c1f81;hp=f1e462ca379ad235676a363adc49b87b9a7dc1c2;hb=HEAD;hpb=c0508bd0b73d97f758bfb691f090f55f5d70910d diff --git a/perl/schedproc b/perl/schedproc index f1e462c..2a80bc3 100755 --- a/perl/schedproc +++ b/perl/schedproc @@ -453,7 +453,7 @@ EOF my @schedule = get_schedule(@_); open(STDOUT, ">" . $file) || die $! if(defined($file) && (! -d $file)); open(STDOUT, ">/dev/null") || die $! if(defined($file) && (-d $file)); - print "BEGIN:VCALENDAR$r\nVERSION:2.0$r\nMETHOD:PUBLISH$r\n$timezone"; + print "BEGIN:VCALENDAR$r\nPRODID:-//Tim Pope//NONSGML Schedproc//EN$r\nVERSION:2.0$r\nMETHOD:PUBLISH$r\n$timezone"; foreach my $row (@schedule) { map { s/\n/-/g; $_} %$row; my ($starttime, $stoptime)=($row->{'begin'}, $row->{'end'}); @@ -471,7 +471,7 @@ EOF if(defined($file) && (-d $file)) { open FH, ">$file/" . $row->{'id'} . ".vcs" or die "$!"; select FH; - print "BEGIN:VCALENDAR$r\nVERSION:2.0$r\nMETHOD:PUBLISH$r\n$timezone"; + print "BEGIN:VCALENDAR$r\nPRODID:-//Tim Pope//NONSGML Schedproc//EN$r\nVERSION:2.0$r\nMETHOD:PUBLISH$r\n$timezone"; } print "BEGIN:VEVENT$r\n"; print "ORGANIZER:mailto:" . $opts{'email'} . "$r\n" if $opts{'email'}; @@ -551,7 +551,7 @@ sub do_html_schedule { $b=~s/(1[3-9]|2\d|00):(\d\d)AM/sprintf "%d:%02dPM",abs $1-12,$2/e; print "$a-$b"; print "" . $row->{'duration'} . ""; - print "" . $row->{'location'} . ""; + print "" . (ref($row->{'location'})?"":$row->{'location'}) . ""; print "\n"; } print "\n"; @@ -586,13 +586,15 @@ sub do_html_grades { print "\n"; } } - my $lastrow = $grades->{'cumulative'}->[scalar @{$grades->{'cumulative'}}-1]; - print 'Cumulative: through ', capitalize($lastrow->{'term'}); - print ''; - print $lastrow->{'gpa'}; - print ''; - print join('', ($lastrow->{'earned'}, $lastrow->{'hours'}, $lastrow->{'points'})); - print "\n"; + if(exists($grades->{'cumulative'})) { + my $lastrow = $grades->{'cumulative'}->[scalar @{$grades->{'cumulative'}}-1]; + print 'Cumulative: through ', capitalize($lastrow->{'term'}); + print ''; + print $lastrow->{'gpa'}; + print ''; + print join('', ($lastrow->{'earned'}, $lastrow->{'hours'}, $lastrow->{'points'})); + print "\n"; + } print "\n"; select STDOUT; }