fix: t::WebGUI::PseudoRequest now works properly

add: Added some additional vars to Calendar Week view
fix: WebGUI::DateTime now handles MySQL strings more robustly
This commit is contained in:
Doug Bell 2007-03-20 17:27:30 +00:00
parent 74b688810f
commit 991aac998a
5 changed files with 85 additions and 15 deletions

View file

@ -1019,7 +1019,6 @@ sub viewDay {
### Get all the events in this time period
# Get the range of the epoch of this day
my $dt = WebGUI::DateTime->new($session, $params->{start});
$dt->set_locale($i18n->get("locale"));
$dt->truncate( to => "day");
my @events = $self->getEventsIn($dt->toMysql,$dt->clone->add(days => 1)->toMysql);
@ -1113,7 +1112,6 @@ sub viewMonth {
#### Get all the events in this time period
# Get the range of the epoch of this month
my $dt = WebGUI::DateTime->new($self->session, $params->{start});
$dt->set_locale($i18n->get("locale"));
$dt->truncate( to => "month");
my @events
@ -1292,7 +1290,6 @@ sub viewWeek {
for my $event (@events) {
# Get the week this event is in, and add it to that week in
# the template variables
my $dt_event_start = $event->getDateTimeStart;
my $dt_event_end = $event->getDateTimeEnd;
$dt_event_start->set_locale($i18n->get("locale"));
@ -1311,6 +1308,7 @@ sub viewWeek {
$var->{"pagePrevUrl"}
= $self->getUrl("type=week;start=" . $dt->clone->subtract(weeks=>1)->toMysql);
$var->{"startMonth" } = $dt->month;
$var->{"startMonthName" } = $dt->month_name;
$var->{"startMonthAbbr" } = $dt->month_abbr;
$var->{"startDayOfMonth" } = $dt->day_of_month;
@ -1318,6 +1316,7 @@ sub viewWeek {
$var->{"startDayAbbr" } = $dt->day_abbr;
$var->{"startYear" } = $dt->year;
$var->{"endMonth" } = $dtEnd->month;
$var->{"endMonthName" } = $dtEnd->month_name;
$var->{"endMonthAbbr" } = $dtEnd->month_abbr;
$var->{"endDayOfMonth" } = $dtEnd->day_of_month;

View file

@ -611,16 +611,23 @@ DateTime
sub _splitMysql
{
my $string = shift;
my ($y,$m,$d,$h,$n,$s) = split /\D+/,$string;
my %hash = (
year => $y,
month => $m,
day => $d,
hour => $h,
minute => $n,
second => $s,
);
my %hash;
@hash{ qw( year month day hour minute second ) }
= $string =~ m{
(\d+) # Year
\D*
(\d+) # Month
\D*
(\d+) # Day
\D*
(\d+) # Hours
\D*
(\d+) # Minutes
\D*
(\d+) # Seconds
}x;
return %hash;
}

View file

@ -221,6 +221,9 @@ our $HELP = {
'name' => 'pagePrevUrl',
'description' => 'pagePrevUrl weekVar'
},
{
'name' => 'startMonth',
},
{
'name' => 'startMonthName'
},
@ -239,6 +242,9 @@ our $HELP = {
{
'name' => 'startYear'
},
{
'name' => 'endMonth',
},
{
'name' => 'endMonthName'
},

View file

@ -276,6 +276,18 @@ our $I18N = {
context => q{Description of what the Calendar Update Feeds workflow activity does},
},
'workflow generateRecurringEvents' => {
message => q{Generate Recurring Events},
lastUpdated => 0,
context => q{The name of the CalendarGenerateRecurringEvents workflow activity},
},
'workflow generateRecurringEvents description' => {
message => q{This activity generates recurring events for calendars. }
. q{This activity also maintains recurring events in the future.},
lastUpdated => 0,
context => q{Description of what the CalendarGenerateRecurringEvents workflow activity does},
},
#################### HELP PAGES ####################
@ -510,6 +522,11 @@ our $I18N = {
lastUpdated => 1171171998,
},
'startMonth' => {
message => q{The number (1-12) of the month this week starts.},
lastUpdated => 1171043883,
},
'startMonthName' => {
message => q|The name of the month this week starts.|,
lastUpdated => 1171043883,
@ -540,6 +557,11 @@ our $I18N = {
lastUpdated => 1171043883,
},
'endMonth' => {
message => q{The number (1-12) of the month this week ends.},
lastUpdated => 117104883,
},
'endMonthName' => {
message => q|The name of the month this week ends.|,
lastUpdated => 1171043883,