merging 6.7.8 bug fixes

This commit is contained in:
JT Smith 2005-11-29 01:28:28 +00:00
parent 89f8729ba5
commit 9749fd7005
7 changed files with 152 additions and 10 deletions

View file

@ -100,7 +100,7 @@ save you many hours of grief.
6.7.0
--------------------------------------------------------------------
* In order to upgrade to 6.7 you must first upgrade to 6.6.
* In order to upgrade to 6.7 you must first upgrade to at least 6.6.1.
* The asset API has changed slightly due to versioning, so if you
have any custom assets, check out migration.txt to make

File diff suppressed because one or more lines are too long

View file

@ -13,8 +13,129 @@ my $quiet;
start();
protectUserProfileFields();
correctEditProfileTemplate();
fixCalendarTemplates();
finish();
#-------------------------------------------------
sub fixCalendarTemplates {
print "\tFixing bugs in calendar templates.\n" unless ($quiet);
my $template = <<STOP;
<h1><tmpl_var title></h1>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td valign="top" class="tableHeader" width="100%">
<b><tmpl_var start.label>:</b> <tmpl_var start.date><br />
<b><tmpl_var end.label>:</b> <tmpl_var end.date><br />
</td><td valign="top" class="tableMenu" nowrap="1">
<tmpl_if canEdit>
<a href="<tmpl_var edit.url>"><tmpl_var edit.label></a><br />
<a href="<tmpl_var delete.url>"><tmpl_var delete.label></a><br />
</tmpl_if>
<tmpl_if previous.url>
<a href="<tmpl_var previous.url>"><tmpl_var previous.label></a><br />
</tmpl_if>
<tmpl_if next.url>
<a href="<tmpl_var next.url>"><tmpl_var next.label></a><br />
</tmpl_if>
</td></tr>
</table>
<tmpl_var description>
<tmpl_loop others_loop>
<tmpl_if __FIRST__>
<p /><b>Events Near This One</b><br />
</tmpl_if>
<ul>
<li><a href="<tmpl_var url>"><tmpl_var title></a></li>
</ul>
</tmpl_loop>
STOP
my $asset = WebGUI::Asset->new("PBtmpl0000000000000023","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $asset);
$template = <<STOP;
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<tmpl_var description>
<p />
</tmpl_if>
<tmpl_if session.var.adminOn>
<a href="<tmpl_var addevent.url>"><tmpl_var addevent.label></a>
<p />
</tmpl_if>
<tmpl_loop month_loop>
<table border="1">
<tr><td colspan=7 class="tableHeader"><tmpl_var month> <tmpl_var year></td></tr>
<tr>
<tmpl_if session.user.firstDayOfWeek>
<th class="tableData"><tmpl_var monday.label.short></th>
<th class="tableData"><tmpl_var tuesday.label.short></th>
<th class="tableData"><tmpl_var wednesday.label.short></th>
<th class="tableData"><tmpl_var thursday.label.short></th>
<th class="tableData"><tmpl_var friday.label.short></th>
<th class="tableData"><tmpl_var saturday.label.short></th>
<th class="tableData"><tmpl_var sunday.label.short></th>
<tmpl_else>
<th class="tableData"><tmpl_var sunday.label.short></th>
<th class="tableData"><tmpl_var monday.label.short></th>
<th class="tableData"><tmpl_var tuesday.label.short></th>
<th class="tableData"><tmpl_var wednesday.label.short></th>
<th class="tableData"><tmpl_var thursday.label.short></th>
<th class="tableData"><tmpl_var friday.label.short></th>
<th class="tableData"><tmpl_var saturday.label.short></th>
</tmpl_if>
</tr><tr>
<tmpl_loop prepad_loop>
<td>&nbsp;</td>
</tmpl_loop>
<tmpl_loop day_loop>
<tmpl_if isStartOfWeek>
<tr>
</tmpl_if>
<td class="table<tmpl_if isToday>Header<tmpl_else>Data</tmpl_if>" width="28" valign="top" align="left"><p><b>
<tmpl_if hasEvents>
<a href="<tmpl_var url>"><tmpl_var day></a>
<tmpl_else>
<tmpl_var day>
</tmpl_if>
</b></p></td>
<tmpl_if isEndOfWeek>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_loop postpad_loop>
<td>&nbsp;</td>
</tmpl_loop>
</tr>
</table>
</tmpl_loop>
<tmpl_if pagination.pageCount.isMultiple>
<div class="pagination">
<tmpl_var pagination.previousPage> &middot; <tmpl_var pagination.pageList.upTo20> &middot; <tmpl_var pagination.nextPage>
</div>
</tmpl_if>
STOP
$asset = WebGUI::Asset->new("PBtmpl0000000000000105","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $asset);
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering

View file

@ -21,6 +21,7 @@ use WebGUI::Id;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Style;
use WebGUI::URL;
use WebGUI::Asset;
@ -200,7 +201,6 @@ sub setParent {
#-------------------------------------------------------------------
sub view {
my $self = shift;
return WebGUI::Privilege::noAccess() unless $self->canView;
my ($output, $event, $id);
my %var = $self->get;
$event = $self;
@ -216,9 +216,21 @@ sub view {
$var{"edit.label"} = WebGUI::International::get(575,"Asset_Event");
$var{"delete.url"} = WebGUI::URL::page('func=deleteEvent;rid='.$self->getValue("EventsCalendar_recurringId"));
$var{"delete.label"} = WebGUI::International::get(576,"Asset_Event");
#get parent so we can get the parent's style. Hopefully the parent is an EventsCalendar. If not, oh well.
my $parent = $self->getParent;
return WebGUI::Style::process($self->processTemplate(\%var,$self->getValue("templateId")),$parent->getValue("styleTemplateId"));
my @others;
my ($start, $garbage) = WebGUI::DateTime::dayStartEnd($self->get("eventStartDate"));
my ($garbage, $end) = WebGUI::DateTime::dayStartEnd($self->get("eventEndDate"));
my $sth = WebGUI::SQL->read("select assetId from EventsCalendar_event where ((eventStartDate >= $start and eventStartDate <= $end) or (eventEndDate >= $start and eventEndDate <= $end)) and assetId<>".quote($self->getId));
while (my ($assetId) = $sth->array) {
my $asset = WebGUI::Asset::Event->new($assetId);
# deal with multiple versions of the same event with conflicting dates
next unless (($asset->get("eventStartDate") >= $start && $asset->get("eventStartDate") <= $end) || ($asset->get("eventEndDate") >= $start && $asset->get("eventEndDate") <= $end));
push(@others,{
url=>$asset->getUrl,
title=>$asset->getTitle,
});
}
$var{others_loop} = \@others;
return $self->processTemplate(\%var,$self->getValue("templateId"));
}
@ -264,6 +276,13 @@ sub www_edit {
return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get('13', 'Asset_Event'));
}
#-------------------------------------------------------------------
sub www_view {
my $self = shift;
return WebGUI::Privilege::insufficient() unless ($self->canView);
return WebGUI::Style::process($self->view,$self->getParent->getValue("styleTemplateId"));
}
1;

View file

@ -353,6 +353,7 @@ sub view {
isStartOfWeek=>($dayOfWeekCounter==1),
isEndOfWeek=>($dayOfWeekCounter==7),
isToday=>($date[0]."-".$date[1]."-".$dayCounter eq $now[0]."-".$now[1]."-".$now[2]),
hasEvents=>(exists $events{$dayCounter}),
event_loop=>\@{$events{$dayCounter}},
url=>$events{$dayCounter}->[0]->{url}
});

View file

@ -707,13 +707,13 @@ my %transactionData = %{$self->{_transactionParams}};
" <EmailText>
<EmailTextItem>".$self->get('emailMessage')."</EmailTextItem>
<EmailTextItem>ID: $transactionData{ORGID}</EmailTextItem>
</EmailText>\n";
</EmailText>
<OrderItems>\n";
$items = WebGUI::Commerce::Transaction->new($transactionData{ORGID})->getItems;
foreach (@{$items}) {
$xml .=
" <OrderItems>
<Item>
" <Item>
<Description>".$_->{itemName}."</Description>
<Cost>".$_->{amount}."</Cost>
<Qty>".$_->{quantity}."</Qty>

View file

@ -10,6 +10,7 @@ use WebGUI::Commerce::Payment;
use WebGUI::Commerce::Shipping;
use WebGUI::AdminConsole;
use WebGUI::TabForm;
use WebGUI::Setting;
use WebGUI::Style;
use WebGUI::Commerce;
use WebGUI::Operation;
@ -512,7 +513,7 @@ sub www_editCommerceSettingsSave {
fieldValue => $session{form}{$_}
});
} elsif ($_ ne 'op') {
WebGUI::SQL->write('update settings set value='.quote($session{form}{$_}).' where name='.quote($_));
WebGUI::Setting::set($_,$session{form}{$_});
}
}