| 1 | package HTML::CalendarMonthSimple::MultiDaysEvent; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | our $VERSION = '0.03'; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use base 'HTML::CalendarMonthSimple'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | my $self = $class->SUPER::new;; | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | bless $self,$class; | |||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | $self->{events}->{$_} = [] for (1..31); | |||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | sub multidays_HTML { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
multidays_HTML: called CC=137 SCAR=70.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | my %params = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | my $html = ''; | |||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | my(@days,$weeks,$WEEK,$DAY); | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | # To make the grid even, pad the start of the series with 0s | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | @days = (1 .. Date::Calc::Days_in_Month($self->year(),$self->month() ) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | if ($self->weekstartsonmonday()) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | foreach (1 .. (Date::Calc::Day_of_Week($self->year(), | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | $self->month(),1) -1 )) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | unshift(@days,0); | |||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | foreach (1 .. (Date::Calc::Day_of_Week($self->year(), | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | $self->month(),1)%7) ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | unshift(@days,0); | |||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 1 | $weeks = int((scalar(@days)+6)/7); | |||||||||||||||||||||||||||||||||||||||||||||
| 37 | # And pad the end as well, to avoid "uninitialized value" warnings | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | foreach (scalar(@days)+1 .. $weeks*7) { | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | 5 | push(@days,0); | |||||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # Define some scalars for generating the table | ||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | my $border = $self->border(); | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | my $tablewidth = $self->width(); | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | ▶ | $tablewidth =~ m/^(\d+)(\%?)$/; my $cellwidth = (int($1/7))||'14'; if ($2) { $cellwidth .= '%'; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
int $1 / 7 || '14'
MC/DC0%0/1
int $1 / 7 || '14'
int $1 / 7
Truth table50%1/2
A
A= int $1 / 7
| |||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | my $header = $self->header(); | |||||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | my $cellalignment = $self->cellalignment(); | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | my $vcellalignment = $self->vcellalignment(); | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | my $contentfontsize = $self->contentfontsize(); | |||||||||||||||||||||||||||||||||||||||||||||
| 50 | 1 | my $bgcolor = $self->bgcolor(); | |||||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | ▶ | my $weekdaycolor = $self->weekdaycolor() || $self->bgcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekdaycolor || $self->bgcolor
MC/DC0%0/2
$self->weekdaycolor || $self->bgcolor
$self->weekdaycolor
$self->bgcolor
Truth table33%1/3
A || B
A= $self->weekdaycolorB= $self->bgcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | ▶ | my $weekendcolor = $self->weekendcolor() || $self->bgcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekendcolor || $self->bgcolor
MC/DC0%0/2
$self->weekendcolor || $self->bgcolor
$self->weekendcolor
$self->bgcolor
Truth table33%1/3
A || B
A= $self->weekendcolorB= $self->bgcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1 | ▶ | my $todaycolor = $self->todaycolor() || $self->bgcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->todaycolor || $self->bgcolor
MC/DC0%0/2
$self->todaycolor || $self->bgcolor
$self->todaycolor
$self->bgcolor
Truth table33%1/3
A || B
A= $self->todaycolorB= $self->bgcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | ▶ | my $contentcolor = $self->contentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->contentcolor || $self->contentcolor
MC/DC0%0/2
$self->contentcolor || $self->contentcolor
$self->contentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->contentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | ▶ | my $weekdaycontentcolor = $self->weekdaycontentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekdaycontentcolor || $self->contentcolor
MC/DC0%0/2
$self->weekdaycontentcolor || $self->contentcolor
$self->weekdaycontentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->weekdaycontentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | ▶ | my $weekendcontentcolor = $self->weekendcontentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekendcontentcolor || $self->contentcolor
MC/DC0%0/2
$self->weekendcontentcolor || $self->contentcolor
$self->weekendcontentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->weekendcontentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | ▶ | my $todaycontentcolor = $self->todaycontentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->todaycontentcolor || $self->contentcolor
MC/DC0%0/2
$self->todaycontentcolor || $self->contentcolor
$self->todaycontentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->todaycontentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | ▶ | my $bordercolor = $self->bordercolor() || $self->bordercolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->bordercolor || $self->bordercolor
MC/DC0%0/2
$self->bordercolor || $self->bordercolor
$self->bordercolor
$self->bordercolor
Truth table33%1/3
A || B
A= $self->bordercolorB= $self->bordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | ▶ | my $weekdaybordercolor = $self->weekdaybordercolor() || $self->bordercolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekdaybordercolor || $self->bordercolor
MC/DC0%0/2
$self->weekdaybordercolor || $self->bordercolor
$self->weekdaybordercolor
$self->bordercolor
Truth table33%1/3
A || B
A= $self->weekdaybordercolorB= $self->bordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | ▶ | my $weekendbordercolor = $self->weekendbordercolor() || $self->bordercolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekendbordercolor || $self->bordercolor
MC/DC0%0/2
$self->weekendbordercolor || $self->bordercolor
$self->weekendbordercolor
$self->bordercolor
Truth table33%1/3
A || B
A= $self->weekendbordercolorB= $self->bordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | ▶ | my $todaybordercolor = $self->todaybordercolor() || $self->bordercolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->todaybordercolor || $self->bordercolor
MC/DC0%0/2
$self->todaybordercolor || $self->bordercolor
$self->todaybordercolor
$self->bordercolor
Truth table33%1/3
A || B
A= $self->todaybordercolorB= $self->bordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | ▶ | my $weekdayheadercolor = $self->weekdayheadercolor() || $self->bgcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekdayheadercolor || $self->bgcolor
MC/DC0%0/2
$self->weekdayheadercolor || $self->bgcolor
$self->weekdayheadercolor
$self->bgcolor
Truth table33%1/3
A || B
A= $self->weekdayheadercolorB= $self->bgcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | ▶ | my $weekendheadercolor = $self->weekendheadercolor() || $self->bgcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekendheadercolor || $self->bgcolor
MC/DC0%0/2
$self->weekendheadercolor || $self->bgcolor
$self->weekendheadercolor
$self->bgcolor
Truth table33%1/3
A || B
A= $self->weekendheadercolorB= $self->bgcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | ▶ | my $headercontentcolor = $self->headercontentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->headercontentcolor || $self->contentcolor
MC/DC0%0/2
$self->headercontentcolor || $self->contentcolor
$self->headercontentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->headercontentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 1 | ▶ | my $weekdayheadercontentcolor = $self->weekdayheadercontentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekdayheadercontentcolor || $self->contentcolor
MC/DC0%0/2
$self->weekdayheadercontentcolor || $self->contentcolor
$self->weekdayheadercontentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->weekdayheadercontentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | my $weekendheadercontentcolor = $self->weekendheadercontentcolor() || $self->contentcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekendheadercontentcolor || $self->contentcolor
MC/DC0%0/2
$self->weekendheadercontentcolor || $self->contentcolor
$self->weekendheadercontentcolor
$self->contentcolor
Truth table33%1/3
A || B
A= $self->weekendheadercontentcolorB= $self->contentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | ▶ | my $headercolor = $self->headercolor() || $self->bgcolor(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->headercolor || $self->bgcolor
MC/DC0%0/2
$self->headercolor || $self->bgcolor
$self->headercolor
$self->bgcolor
Truth table33%1/3
A || B
A= $self->headercolorB= $self->bgcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1 | my $cellpadding = $self->cellpadding(); | |||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | my $cellspacing = $self->cellspacing(); | |||||||||||||||||||||||||||||||||||||||||||||
| 70 | 1 | my $sharpborders = $self->sharpborders(); | |||||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | my $cellheight = $self->cellheight(); | |||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | my $cellclass = $self->cellclass(); | |||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | my $tableclass = $self->tableclass(); | |||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | ▶ | my $weekdaycellclass = $self->weekdaycellclass() || $self->cellclass(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekdaycellclass || $self->cellclass
MC/DC0%0/2
$self->weekdaycellclass || $self->cellclass
$self->weekdaycellclass
$self->cellclass
Truth table33%1/3
A || B
A= $self->weekdaycellclassB= $self->cellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 1 | ▶ | my $weekendcellclass = $self->weekendcellclass() || $self->cellclass(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->weekendcellclass || $self->cellclass
MC/DC0%0/2
$self->weekendcellclass || $self->cellclass
$self->weekendcellclass
$self->cellclass
Truth table33%1/3
A || B
A= $self->weekendcellclassB= $self->cellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 1 | ▶ | my $todaycellclass = $self->todaycellclass() || $self->cellclass(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->todaycellclass || $self->cellclass
MC/DC0%0/2
$self->todaycellclass || $self->cellclass
$self->todaycellclass
$self->cellclass
Truth table33%1/3
A || B
A= $self->todaycellclassB= $self->cellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | ▶ | my $headerclass = $self->headerclass() || $self->cellclass(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->headerclass || $self->cellclass
MC/DC0%0/2
$self->headerclass || $self->cellclass
$self->headerclass
$self->cellclass
Truth table33%1/3
A || B
A= $self->headerclassB= $self->cellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | my $nowrap = $self->nowrap(); | |||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||
| 80 | # Get today's date, in case there's a todaycolor() | ||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | my($todayyear,$todaymonth,$todaydate) = ($self->today_year(),$self->today_month(),$self->today_date()); | |||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||
| 83 | # the table declaration - sharpborders wraps the table inside a table cell | ||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 1 | ▶ | if ($sharpborders) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | $html .= "<table border=\"0\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | $html .= " class=\"$tableclass\"" if defined $tableclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | $html .= " width=\"$tablewidth\"" if defined $tablewidth; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $html .= " cellpadding=\"0\" cellspacing=\"0\">\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | $html .= "<tr valign=\"top\" align=\"left\">\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | $html .= "<td align=\"left\" valign=\"top\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | $html .= " bgcolor=\"$bordercolor\"" if defined $bordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | $html .= ">"; | |||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | $html .= "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\">"; | |||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 95 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 1 | $html .= "<table"; | |||||||||||||||||||||||||||||||||||||||||||||
| 97 | 1 | ▶ | $html .= " class=\"$tableclass\"" if defined $tableclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 1 | ▶ | $html .= " border=\"$border\"" if defined $border; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 1 | ▶ | $html .= " width=\"$tablewidth\"" if defined $tablewidth; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1 | ▶ | $html .= " bgcolor=\"$bgcolor\"" if defined $bgcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | ▶ | $html .= " bordercolor=\"$bordercolor\"" if defined $bordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 1 | ▶ | $html .= " cellpadding=\"$cellpadding\"" if defined $cellpadding; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 1 | ▶ | $html .= " cellspacing=\"$cellspacing\"" if defined $cellspacing; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 1 | $html .= ">\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 106 | # the header | ||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 1 | ▶ | if ($header) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 1 | $html .= "<tr><td colspan=\"7\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 109 | 1 | ▶ | $html .= " bgcolor=\"$headercolor\"" if defined $headercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | ▶ | $html .= " class=\"$headerclass\"" if defined $headerclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 1 | $html .= ">"; | |||||||||||||||||||||||||||||||||||||||||||||
| 112 | 1 | ▶ | $html .= "<font color=\"$headercontentcolor\">" if defined $headercontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | $html .= $header; | |||||||||||||||||||||||||||||||||||||||||||||
| 114 | 1 | ▶ | $html .= "</font>" if defined $headercontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 1 | $html .= "</td></tr>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 117 | # the names of the days of the week | ||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 1 | ▶ | if ($self->showweekdayheaders) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 1 | ▶ | my $celltype = $self->weekdayheadersbig() ? "th" : "td"; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | my @weekdays = $self->weekdays(); | |||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 1 | ▶ | my $saturday_html = "<$celltype" | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 123 | . ( defined $weekendheadercolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 124 | ? qq| bgcolor="$weekendheadercolor"| | ||||||||||||||||||||||||||||||||||||||||||||||
| 125 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 126 | . ( defined $weekendcellclass | ||||||||||||||||||||||||||||||||||||||||||||||
| 127 | ? qq| class="$weekendcellclass"| | ||||||||||||||||||||||||||||||||||||||||||||||
| 128 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 129 | . ">" | ||||||||||||||||||||||||||||||||||||||||||||||
| 130 | . ( defined $weekendheadercontentcolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 131 | ? qq|<font color="$weekendheadercontentcolor">| | ||||||||||||||||||||||||||||||||||||||||||||||
| 132 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 133 | . $self->saturday() | ||||||||||||||||||||||||||||||||||||||||||||||
| 134 | . ( defined $weekendheadercontentcolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ? qq|</font>| | ||||||||||||||||||||||||||||||||||||||||||||||
| 136 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 137 | . "</$celltype>\n"; | ||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | ▶ | my $sunday_html = "<$celltype" | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 140 | . ( defined $weekendheadercolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 141 | ? qq| bgcolor="$weekendheadercolor"| | ||||||||||||||||||||||||||||||||||||||||||||||
| 142 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 143 | . ( defined $weekendcellclass | ||||||||||||||||||||||||||||||||||||||||||||||
| 144 | ? qq| class="$weekendcellclass"| | ||||||||||||||||||||||||||||||||||||||||||||||
| 145 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 146 | . ">" | ||||||||||||||||||||||||||||||||||||||||||||||
| 147 | . ( defined $weekendheadercontentcolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 148 | ? qq|<font color="$weekendheadercontentcolor">| | ||||||||||||||||||||||||||||||||||||||||||||||
| 149 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 150 | . $self->sunday() | ||||||||||||||||||||||||||||||||||||||||||||||
| 151 | . ( defined $weekendheadercontentcolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 152 | ? qq|</font>| | ||||||||||||||||||||||||||||||||||||||||||||||
| 153 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 154 | . "</$celltype>\n"; | ||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 1 | my $weekday_html = ''; | |||||||||||||||||||||||||||||||||||||||||||||
| 157 | 1 | foreach (@weekdays) { # draw the weekday headers | |||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 5 | ▶ | $weekday_html .= "<$celltype" | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 160 | . ( defined $weekendheadercolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 161 | ? qq| bgcolor="$weekdayheadercolor"| | ||||||||||||||||||||||||||||||||||||||||||||||
| 162 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 163 | . ( defined $weekendcellclass | ||||||||||||||||||||||||||||||||||||||||||||||
| 164 | ? qq| class="$weekdaycellclass"| | ||||||||||||||||||||||||||||||||||||||||||||||
| 165 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 166 | . ">" | ||||||||||||||||||||||||||||||||||||||||||||||
| 167 | . ( defined $weekdayheadercontentcolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 168 | ? qq|<font color="$weekdayheadercontentcolor">| | ||||||||||||||||||||||||||||||||||||||||||||||
| 169 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 170 | . $_ | ||||||||||||||||||||||||||||||||||||||||||||||
| 171 | . ( defined $weekdayheadercontentcolor | ||||||||||||||||||||||||||||||||||||||||||||||
| 172 | ? qq|</font>| | ||||||||||||||||||||||||||||||||||||||||||||||
| 173 | : '' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 174 | . "</$celltype>\n"; | ||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | $html .= "<tr>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 178 | 1 | ▶ | if ($self->weekstartsonmonday()) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | $html .= $weekday_html | |||||||||||||||||||||||||||||||||||||||||||||
| 180 | . $saturday_html | ||||||||||||||||||||||||||||||||||||||||||||||
| 181 | . $sunday_html; | ||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 183 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1 | $html .= $sunday_html | |||||||||||||||||||||||||||||||||||||||||||||
| 185 | . $weekday_html | ||||||||||||||||||||||||||||||||||||||||||||||
| 186 | . $saturday_html; | ||||||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 1 | $html .= "</tr>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 1 | my $_saturday_index = 6; | |||||||||||||||||||||||||||||||||||||||||||||
| 192 | 1 | my $_sunday_index = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 193 | 1 | ▶ | if ($self->weekstartsonmonday()) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | $_saturday_index = 5; | |||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $_sunday_index = 6; | |||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 197 | # now do each day, the actual date-content-containing cells | ||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 1 | foreach $WEEK (0 .. ($weeks-1)) { | |||||||||||||||||||||||||||||||||||||||||||||
| 199 | 5 | my $weekevents = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 200 | 5 | my %prerow; | |||||||||||||||||||||||||||||||||||||||||||||
| 201 | my %daycol; | ||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 5 | my $firstday = $days[(7*$WEEK)]; | |||||||||||||||||||||||||||||||||||||||||||||
| 203 | 5 | my $lastday = $firstday + 6; | |||||||||||||||||||||||||||||||||||||||||||||
| 204 | 5 | my $firstevent; | |||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 5 | for $DAY (0 .. 6) { | |||||||||||||||||||||||||||||||||||||||||||||
| 207 | 35 | my $thisday = $days[((7*$WEEK)+$DAY)]; | |||||||||||||||||||||||||||||||||||||||||||||
| 208 | 35 | ▶ | if ($#{$self->{events}->{$thisday}} > -1) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 1 | ▶ | $firstevent = $thisday unless ($firstevent); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 1 | $weekevents += scalar(@{$self->{events}->{$thisday}}); | |||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | for my $event (sort { $a->{length} <=> $b->{length} } (@{$self->{events}->{$thisday}})) { | |||||||||||||||||||||||||||||||||||||||||||||
| 212 | 1 | for (0 .. $event->{length} - 1) { | |||||||||||||||||||||||||||||||||||||||||||||
| 213 | 3 | ▶ | $prerow{$thisday+$_} = $weekevents unless ($prerow{$thisday+$_}); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 1 | ▶ | if ($thisday + ($event->{length} - 1) > $lastday) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 216 | $self->add_event( date => $lastday+1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 217 | event => $event->{event}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 218 | length => $event->{length} - | ||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | ($lastday - $thisday + 1) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $event->{length} = $lastday-$thisday+1; | |||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 5 | $html .= "<tr style=\"line-height:4em;\">\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 226 | 5 | foreach $DAY ( 0 .. 6 ) { | |||||||||||||||||||||||||||||||||||||||||||||
| 227 | 35 | my($thiscontent,$thisday,$thisbgcolor,$thisbordercolor,$thiscontentcolor,$thiscellclass); | |||||||||||||||||||||||||||||||||||||||||||||
| 228 | 35 | $thisday = $days[((7*$WEEK)+$DAY)]; | |||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||
| 230 | # Get the cell's coloration and CSS class | ||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 35 | ▶ | if ($self->year == $todayyear && $self->month == $todaymonth && $thisday == $todaydate) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
$self->year == $todayyear and $self->month == $todaymonth and $thisday == $todaydate
$self->year == $todayyear and $self->month == $todaymonth
MC/DC33%1/3
$self->year == $todayyear and $self->month == $todaymonth and $thisday == $todaydate
$self->year == $todayyear
$self->month == $todaymonth
$thisday == $todaydate
Truth table50%2/4
A and B and C
A= $self->year == $todayyearB= $self->month == $todaymonthC= $thisday == $todaydate
| |||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 1 | ▶ | $thisbgcolor = $self->datecolor($thisday) || $todaycolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecolor($thisday) || $todaycolor
MC/DC0%0/2
$self->datecolor($thisday) || $todaycolor
$self->datecolor($thisday)
$todaycolor
Truth table33%1/3
A || B
A= $self->datecolor($thisday)B= $todaycolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 1 | ▶ | $thisbordercolor = $self->datebordercolor($thisday) || $todaybordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datebordercolor($thisday) || $todaybordercolor
MC/DC0%0/2
$self->datebordercolor($thisday) || $todaybordercolor
$self->datebordercolor($thisday)
$todaybordercolor
Truth table33%1/3
A || B
A= $self->datebordercolor($thisday)B= $todaybordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 1 | ▶ | $thiscontentcolor = $self->datecontentcolor($thisday) || $todaycontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecontentcolor($thisday) || $todaycontentcolor
MC/DC0%0/2
$self->datecontentcolor($thisday) || $todaycontentcolor
$self->datecontentcolor($thisday)
$todaycontentcolor
Truth table33%1/3
A || B
A= $self->datecontentcolor($thisday)B= $todaycontentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 1 | ▶ | $thiscellclass = $self->datecellclass($thisday) || $todaycellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecellclass($thisday) || $todaycellclass
MC/DC0%0/2
$self->datecellclass($thisday) || $todaycellclass
$self->datecellclass($thisday)
$todaycellclass
Truth table33%1/3
A || B
A= $self->datecellclass($thisday)B= $todaycellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 236 | ▶ | } elsif (($DAY == $_sunday_index) || ($DAY == $_saturday_index)) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$DAY == $_sunday_index or $DAY == $_saturday_index
MC/DC100%2/2
$DAY == $_sunday_index or $DAY == $_saturday_index
$DAY == $_sunday_index
$DAY == $_saturday_index
Truth table100%3/3
A or B
A= $DAY == $_sunday_indexB= $DAY == $_saturday_index
| |||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 10 | ▶ | $thisbgcolor = $self->datecolor($thisday) || $weekendcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecolor($thisday) || $weekendcolor
MC/DC0%0/2
$self->datecolor($thisday) || $weekendcolor
$self->datecolor($thisday)
$weekendcolor
Truth table33%1/3
A || B
A= $self->datecolor($thisday)B= $weekendcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 10 | ▶ | $thisbordercolor = $self->datebordercolor($thisday) || $weekendbordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datebordercolor($thisday) || $weekendbordercolor
MC/DC0%0/2
$self->datebordercolor($thisday) || $weekendbordercolor
$self->datebordercolor($thisday)
$weekendbordercolor
Truth table33%1/3
A || B
A= $self->datebordercolor($thisday)B= $weekendbordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 10 | ▶ | $thiscontentcolor = $self->datecontentcolor($thisday) || $weekendcontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecontentcolor($thisday) || $weekendcontentcolor
MC/DC0%0/2
$self->datecontentcolor($thisday) || $weekendcontentcolor
$self->datecontentcolor($thisday)
$weekendcontentcolor
Truth table33%1/3
A || B
A= $self->datecontentcolor($thisday)B= $weekendcontentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 10 | ▶ | $thiscellclass = $self->datecellclass($thisday) || $weekendcellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecellclass($thisday) || $weekendcellclass
MC/DC0%0/2
$self->datecellclass($thisday) || $weekendcellclass
$self->datecellclass($thisday)
$weekendcellclass
Truth table33%1/3
A || B
A= $self->datecellclass($thisday)B= $weekendcellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 24 | ▶ | $thisbgcolor = $self->datecolor($thisday) || $weekdaycolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecolor($thisday) || $weekdaycolor
MC/DC0%0/2
$self->datecolor($thisday) || $weekdaycolor
$self->datecolor($thisday)
$weekdaycolor
Truth table33%1/3
A || B
A= $self->datecolor($thisday)B= $weekdaycolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 24 | ▶ | $thisbordercolor = $self->datebordercolor($thisday) || $weekdaybordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datebordercolor($thisday) || $weekdaybordercolor
MC/DC0%0/2
$self->datebordercolor($thisday) || $weekdaybordercolor
$self->datebordercolor($thisday)
$weekdaybordercolor
Truth table33%1/3
A || B
A= $self->datebordercolor($thisday)B= $weekdaybordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 24 | ▶ | $thiscontentcolor = $self->datecontentcolor($thisday) || $weekdaycontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecontentcolor($thisday) || $weekdaycontentcolor
MC/DC0%0/2
$self->datecontentcolor($thisday) || $weekdaycontentcolor
$self->datecontentcolor($thisday)
$weekdaycontentcolor
Truth table33%1/3
A || B
A= $self->datecontentcolor($thisday)B= $weekdaycontentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 24 | ▶ | $thiscellclass = $self->datecellclass($thisday) || $weekdaycellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecellclass($thisday) || $weekdaycellclass
MC/DC0%0/2
$self->datecellclass($thisday) || $weekdaycellclass
$self->datecellclass($thisday)
$weekdaycellclass
Truth table33%1/3
A || B
A= $self->datecellclass($thisday)B= $weekdaycellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||
| 248 | # mark the date, and we should count the events first. | ||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 35 | ▶ | my $rowspan = $prerow{$thisday} || (1 + $weekevents); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$prerow{$thisday} || 1 + $weekevents
MC/DC0%0/2
$prerow{$thisday} || 1 + $weekevents
$prerow{$thisday}
1 + $weekevents
Truth table66%2/3
A || B
A= $prerow{$thisday}B= 1 + $weekevents
| |||||||||||||||||||||||||||||||||||||||||||||||
| 250 | # Done with this cell - push it into the table | ||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 35 | $html .= "<td style=\"border-bottom-width:0px;\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 252 | 35 | ▶ | $html .= " nowrap" if $nowrap; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 35 | ▶ | $html .= " class=\"$thiscellclass\"" if defined $thiscellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 35 | ▶ | $html .= " height=\"$cellheight\"" if defined $cellheight; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 35 | ▶ | $html .= " width=\"$cellwidth\"" if defined $cellwidth; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 35 | $html .= " valign=\"top\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 257 | 35 | ▶ | $html .= " align=\"$cellalignment\"" if defined $cellalignment; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 35 | ▶ | $html .= " bgcolor=\"$thisbgcolor\"" if defined $thisbgcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 35 | ▶ | $html .= " bordercolor=\"$thisbordercolor\"" if defined $thisbordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 35 | $html .= " rowspan=\"$rowspan\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 261 | 35 | $html .= ">"; | |||||||||||||||||||||||||||||||||||||||||||||
| 262 | 35 | ▶ | $html .= "<font" if (defined $thiscontentcolor || | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $thiscontentcolor or defined $contentfontsize
MC/DC0%0/2
defined $thiscontentcolor or defined $contentfontsize
defined $thiscontentcolor
defined $contentfontsize
Truth table33%1/3
A or B
A= defined $thiscontentcolorB= defined $contentfontsize
| |||||||||||||||||||||||||||||||||||||||||||||||
| 263 | defined $contentfontsize); | ||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 35 | ▶ | $html .= " color=\"$thiscontentcolor\"" if defined $thiscontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 35 | ▶ | $html .= " size=\"$contentfontsize\"" if defined $contentfontsize; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 35 | ▶ | $html .= ">" if (defined $thiscontentcolor || | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $thiscontentcolor or defined $contentfontsize
MC/DC0%0/2
defined $thiscontentcolor or defined $contentfontsize
defined $thiscontentcolor
defined $contentfontsize
Truth table33%1/3
A or B
A= defined $thiscontentcolorB= defined $contentfontsize
| |||||||||||||||||||||||||||||||||||||||||||||||
| 267 | defined $contentfontsize); | ||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 35 | ▶ | $html .= "<b>$thisday</b>\n" if ($thisday); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 35 | ▶ | $html .= "</font>" if (defined $thiscontentcolor || | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $thiscontentcolor or defined $contentfontsize
MC/DC0%0/2
defined $thiscontentcolor or defined $contentfontsize
defined $thiscontentcolor
defined $contentfontsize
Truth table33%1/3
A or B
A= defined $thiscontentcolorB= defined $contentfontsize
| |||||||||||||||||||||||||||||||||||||||||||||||
| 270 | defined $contentfontsize); | ||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 35 | $html .= "</td>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 5 | $html .= "</tr>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 274 | 5 | my $i = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 275 | 5 | for $DAY (0 .. 6) { | |||||||||||||||||||||||||||||||||||||||||||||
| 276 | 35 | my $thisday = $days[((7*$WEEK)+$DAY)]; | |||||||||||||||||||||||||||||||||||||||||||||
| 277 | 35 | ▶ | if (exists $self->{events}->{$thisday}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | for my $event (sort { $a->{length} <=> $b->{length} } @{$self->{events}->{$thisday}}) { | |||||||||||||||||||||||||||||||||||||||||||||
| 279 | 1 | my $colspan = $event->{length}; | |||||||||||||||||||||||||||||||||||||||||||||
| 280 | 1 | my $preoffset = $weekevents - $i + 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 281 | 1 | $html .= "<tr>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 282 | 1 | for (0 .. ($thisday - $firstevent - 1)) { | |||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | ▶ | if ($preoffset) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | $html .= "<td rowspan=$preoffset style=\"border-top-width:0px;border-bottom-width:0px;\" boder=0 class=\"calweekendcell\" width=\"14%\" valign=\"top\" align=\"left\"></td>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 1 | $html .= "<td bgcolor=#EEE colspan=$colspan style=\"border-top-width:0px;border-bottom-width:0px;\" width=\"14%\" valign=\"top\">".$event->{event}."</td>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 288 | 1 | $html .= "</tr>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | $firstevent = $thisday; | |||||||||||||||||||||||||||||||||||||||||||||
| 290 | 1 | $i++; | |||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 5 | $html .= "<tr style=\"line-height:4em;\">\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 295 | 5 | foreach $DAY ( 0 .. 6 ) { | |||||||||||||||||||||||||||||||||||||||||||||
| 296 | 35 | my($thiscontent,$thisday,$thisbgcolor,$thisbordercolor,$thiscontentcolor,$thiscellclass); | |||||||||||||||||||||||||||||||||||||||||||||
| 297 | 35 | $thisday = $days[((7*$WEEK)+$DAY)]; | |||||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||||||
| 299 | # Get the cell's coloration and CSS class | ||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 35 | ▶ | if ($self->year == $todayyear && $self->month == $todaymonth && $thisday == $todaydate) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
$self->year == $todayyear and $self->month == $todaymonth and $thisday == $todaydate
$self->year == $todayyear and $self->month == $todaymonth
MC/DC33%1/3
$self->year == $todayyear and $self->month == $todaymonth and $thisday == $todaydate
$self->year == $todayyear
$self->month == $todaymonth
$thisday == $todaydate
Truth table50%2/4
A and B and C
A= $self->year == $todayyearB= $self->month == $todaymonthC= $thisday == $todaydate
| |||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 1 | ▶ | $thisbgcolor = $self->datecolor($thisday) || $todaycolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecolor($thisday) || $todaycolor
MC/DC0%0/2
$self->datecolor($thisday) || $todaycolor
$self->datecolor($thisday)
$todaycolor
Truth table33%1/3
A || B
A= $self->datecolor($thisday)B= $todaycolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 1 | ▶ | $thisbordercolor = $self->datebordercolor($thisday) || $todaybordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datebordercolor($thisday) || $todaybordercolor
MC/DC0%0/2
$self->datebordercolor($thisday) || $todaybordercolor
$self->datebordercolor($thisday)
$todaybordercolor
Truth table33%1/3
A || B
A= $self->datebordercolor($thisday)B= $todaybordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 1 | ▶ | $thiscontentcolor = $self->datecontentcolor($thisday) || $todaycontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecontentcolor($thisday) || $todaycontentcolor
MC/DC0%0/2
$self->datecontentcolor($thisday) || $todaycontentcolor
$self->datecontentcolor($thisday)
$todaycontentcolor
Truth table33%1/3
A || B
A= $self->datecontentcolor($thisday)B= $todaycontentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 1 | ▶ | $thiscellclass = $self->datecellclass($thisday) || $todaycellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecellclass($thisday) || $todaycellclass
MC/DC0%0/2
$self->datecellclass($thisday) || $todaycellclass
$self->datecellclass($thisday)
$todaycellclass
Truth table33%1/3
A || B
A= $self->datecellclass($thisday)B= $todaycellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 305 | ▶ | } elsif (($DAY == $_sunday_index) || ($DAY == $_saturday_index)) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$DAY == $_sunday_index or $DAY == $_saturday_index
MC/DC100%2/2
$DAY == $_sunday_index or $DAY == $_saturday_index
$DAY == $_sunday_index
$DAY == $_saturday_index
Truth table100%3/3
A or B
A= $DAY == $_sunday_indexB= $DAY == $_saturday_index
| |||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 10 | ▶ | $thisbgcolor = $self->datecolor($thisday) || $weekendcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecolor($thisday) || $weekendcolor
MC/DC0%0/2
$self->datecolor($thisday) || $weekendcolor
$self->datecolor($thisday)
$weekendcolor
Truth table33%1/3
A || B
A= $self->datecolor($thisday)B= $weekendcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 10 | ▶ | $thisbordercolor = $self->datebordercolor($thisday) || $weekendbordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datebordercolor($thisday) || $weekendbordercolor
MC/DC0%0/2
$self->datebordercolor($thisday) || $weekendbordercolor
$self->datebordercolor($thisday)
$weekendbordercolor
Truth table33%1/3
A || B
A= $self->datebordercolor($thisday)B= $weekendbordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 10 | ▶ | $thiscontentcolor = $self->datecontentcolor($thisday) || $weekendcontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecontentcolor($thisday) || $weekendcontentcolor
MC/DC0%0/2
$self->datecontentcolor($thisday) || $weekendcontentcolor
$self->datecontentcolor($thisday)
$weekendcontentcolor
Truth table33%1/3
A || B
A= $self->datecontentcolor($thisday)B= $weekendcontentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 10 | ▶ | $thiscellclass = $self->datecellclass($thisday) || $weekendcellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecellclass($thisday) || $weekendcellclass
MC/DC0%0/2
$self->datecellclass($thisday) || $weekendcellclass
$self->datecellclass($thisday)
$weekendcellclass
Truth table33%1/3
A || B
A= $self->datecellclass($thisday)B= $weekendcellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 310 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 24 | ▶ | $thisbgcolor = $self->datecolor($thisday) || $weekdaycolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecolor($thisday) || $weekdaycolor
MC/DC0%0/2
$self->datecolor($thisday) || $weekdaycolor
$self->datecolor($thisday)
$weekdaycolor
Truth table33%1/3
A || B
A= $self->datecolor($thisday)B= $weekdaycolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 24 | ▶ | $thisbordercolor = $self->datebordercolor($thisday) || $weekdaybordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datebordercolor($thisday) || $weekdaybordercolor
MC/DC0%0/2
$self->datebordercolor($thisday) || $weekdaybordercolor
$self->datebordercolor($thisday)
$weekdaybordercolor
Truth table33%1/3
A || B
A= $self->datebordercolor($thisday)B= $weekdaybordercolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 24 | ▶ | $thiscontentcolor = $self->datecontentcolor($thisday) || $weekdaycontentcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecontentcolor($thisday) || $weekdaycontentcolor
MC/DC0%0/2
$self->datecontentcolor($thisday) || $weekdaycontentcolor
$self->datecontentcolor($thisday)
$weekdaycontentcolor
Truth table33%1/3
A || B
A= $self->datecontentcolor($thisday)B= $weekdaycontentcolor
| |||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 24 | ▶ | $thiscellclass = $self->datecellclass($thisday) || $weekdaycellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$self->datecellclass($thisday) || $weekdaycellclass
MC/DC0%0/2
$self->datecellclass($thisday) || $weekdaycellclass
$self->datecellclass($thisday)
$weekdaycellclass
Truth table33%1/3
A || B
A= $self->datecellclass($thisday)B= $weekdaycellclass
| |||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||
| 317 | # mark the date, and we should count the events first. | ||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 35 | ▶ | my $rowspan = $prerow{$thisday} || (1+$weekevents); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$prerow{$thisday} || 1 + $weekevents
MC/DC0%0/2
$prerow{$thisday} || 1 + $weekevents
$prerow{$thisday}
1 + $weekevents
Truth table66%2/3
A || B
A= $prerow{$thisday}B= 1 + $weekevents
| |||||||||||||||||||||||||||||||||||||||||||||||
| 319 | # Done with this cell - push it into the table | ||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 35 | $html .= "<td style=\"line-height:5px;border-top-width:0px;line-height:4em;\""; | |||||||||||||||||||||||||||||||||||||||||||||
| 321 | 35 | ▶ | $html .= " nowrap" if $nowrap; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 35 | ▶ | $html .= " class=\"$thiscellclass\"" if defined $thiscellclass; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 35 | ▶ | $html .= " height=\"$cellheight\"" if defined $cellheight; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 35 | ▶ | $html .= " width=\"$cellwidth\"" if defined $cellwidth; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 35 | ▶ | $html .= " valign=\"$vcellalignment\"" if defined $vcellalignment; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 35 | ▶ | $html .= " align=\"$cellalignment\"" if defined $cellalignment; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 35 | ▶ | $html .= " bgcolor=\"$thisbgcolor\"" if defined $thisbgcolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 35 | ▶ | $html .= " bordercolor=\"$thisbordercolor\"" if defined $thisbordercolor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 35 | $html .= "> "; | |||||||||||||||||||||||||||||||||||||||||||||
| 330 | 35 | $html .= "</td>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 332 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 1 | $html .= "</table>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||
| 335 | # if sharpborders, we need to break out of the enclosing table cell | ||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 1 | ▶ | if ($sharpborders) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | $html .= "</td>\n</tr>\n</table>\n"; | |||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 1 | return $html; | |||||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 1 | ▶ | sub add_event { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_event: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 345 | 1 | my %params = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 346 | 1 | my $date = $params{date}; | |||||||||||||||||||||||||||||||||||||||||||||
| 347 | 1 | $date =~ s/^0*//; | |||||||||||||||||||||||||||||||||||||||||||||
| 348 | 1 | my $event = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 349 | 1 | $event->{event} = $params{event}; | |||||||||||||||||||||||||||||||||||||||||||||
| 350 | 1 | ▶ | $event->{length} = $params{length} || 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$params{'length'} || 1
MC/DC0%0/1
$params{'length'} || 1
$params{'length'}
Truth table50%1/2
A
A= $params{'length'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 1 | push @{$self->{events}->{$date}}, $event; | |||||||||||||||||||||||||||||||||||||||||||||
| 352 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||||||
| 357 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||