Merge commit 'v7.10.15' into 8
Conflicts: docs/gotcha.txt docs/previousVersion.sql docs/templates.txt lib/WebGUI.pm lib/WebGUI/Asset.pm lib/WebGUI/Asset/Event.pm lib/WebGUI/Asset/File.pm lib/WebGUI/Asset/MapPoint.pm lib/WebGUI/Asset/RichEdit.pm lib/WebGUI/Asset/Sku/Product.pm lib/WebGUI/Asset/Snippet.pm lib/WebGUI/Asset/Story.pm lib/WebGUI/Asset/Template.pm lib/WebGUI/Asset/Template/TemplateToolkit.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/Carousel.pm lib/WebGUI/Asset/Wobject/Collaboration.pm lib/WebGUI/Asset/Wobject/Dashboard.pm lib/WebGUI/Asset/Wobject/DataForm.pm lib/WebGUI/Asset/Wobject/Folder.pm lib/WebGUI/Asset/Wobject/Map.pm lib/WebGUI/Asset/Wobject/Search.pm lib/WebGUI/Asset/Wobject/Shelf.pm lib/WebGUI/Asset/Wobject/StockData.pm lib/WebGUI/Asset/Wobject/StoryTopic.pm lib/WebGUI/Asset/Wobject/SyndicatedContent.pm lib/WebGUI/Asset/Wobject/Thingy.pm lib/WebGUI/Asset/Wobject/WeatherData.pm lib/WebGUI/AssetClipboard.pm lib/WebGUI/AssetCollateral/DataForm/Entry.pm lib/WebGUI/AssetExportHtml.pm lib/WebGUI/AssetLineage.pm lib/WebGUI/AssetMetaData.pm lib/WebGUI/AssetTrash.pm lib/WebGUI/AssetVersioning.pm lib/WebGUI/Auth.pm lib/WebGUI/Cache/CHI.pm lib/WebGUI/Content/AssetManager.pm lib/WebGUI/Fork/ProgressBar.pm lib/WebGUI/Form/JsonTable.pm lib/WebGUI/Form/TimeField.pm lib/WebGUI/Form/Zipcode.pm lib/WebGUI/Group.pm lib/WebGUI/International.pm lib/WebGUI/Macro/AssetProxy.pm lib/WebGUI/Macro/FileUrl.pm lib/WebGUI/Operation/SSO.pm lib/WebGUI/Operation/User.pm lib/WebGUI/Role/Asset/Subscribable.pm lib/WebGUI/Shop/Cart.pm lib/WebGUI/Shop/Transaction.pm lib/WebGUI/Shop/TransactionItem.pm lib/WebGUI/Test.pm lib/WebGUI/URL/Content.pm lib/WebGUI/URL/Uploads.pm lib/WebGUI/User.pm lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm lib/WebGUI/Workflow/Activity/SendNewsletters.pm lib/WebGUI/i18n/English/Asset.pm lib/WebGUI/i18n/English/WebGUI.pm sbin/installClass.pl sbin/rebuildLineage.pl sbin/search.pl sbin/testEnvironment.pl t/Asset/Asset.t t/Asset/AssetClipboard.t t/Asset/AssetLineage.t t/Asset/AssetMetaData.t t/Asset/Event.t t/Asset/File.t t/Asset/File/Image.t t/Asset/Post/notification.t t/Asset/Sku.t t/Asset/Story.t t/Asset/Template.t t/Asset/Wobject/Collaboration/templateVariables.t t/Asset/Wobject/Collaboration/unarchiveAll.t t/Asset/Wobject/Shelf.t t/Auth.t t/Macro/EditableToggle.t t/Macro/FilePump.t t/Shop/Cart.t t/Shop/Transaction.t t/Storage.t t/User.t t/Workflow.t
This commit is contained in:
commit
277faae8a1
783 changed files with 32041 additions and 25495 deletions
|
|
@ -42,6 +42,11 @@ property shippingAddressName => (
|
|||
noFormPost => 1,
|
||||
default => '',
|
||||
);
|
||||
property shippingOrganization => (
|
||||
is => 'rw',
|
||||
noFormPost => 1,
|
||||
default => '',
|
||||
);
|
||||
property shippingAddress1 => (
|
||||
is => 'rw',
|
||||
noFormPost => 1,
|
||||
|
|
@ -122,6 +127,11 @@ property isRecurring => (
|
|||
noFormPost => 1,
|
||||
default => '',
|
||||
);
|
||||
property paymentOrganization => (
|
||||
is => 'rw',
|
||||
noFormPost => 1,
|
||||
default => '',
|
||||
);
|
||||
property paymentAddress1 => (
|
||||
is => 'rw',
|
||||
noFormPost => 1,
|
||||
|
|
@ -663,7 +673,9 @@ A hash reference with the address properties.
|
|||
|
||||
sub formatAddress {
|
||||
my ($self, $address) = @_;
|
||||
my $formatted = $address->{name} . "<br />" . $address->{address1} . "<br />";
|
||||
my $formatted = $address->{name} . "<br />";
|
||||
$formatted .= $address->{organization} . "<br />" if ($address->{organization} ne "");
|
||||
$formatted .= $address->{address1} . "<br />";
|
||||
$formatted .= $address->{address2} . "<br />" if ($address->{address2} ne "");
|
||||
$formatted .= $address->{address3} . "<br />" if ($address->{address3} ne "");
|
||||
$formatted .= $address->{city} . ", ";
|
||||
|
|
@ -797,6 +809,7 @@ sub getTransactionVars {
|
|||
shippingPrice => sprintf( "%.2f", $self->shippingPrice ),
|
||||
shippingAddress => $self->formatAddress( {
|
||||
name => $self->shippingAddressName,
|
||||
organization => $self->shippingOrganization,
|
||||
address1 => $self->shippingAddress1,
|
||||
address2 => $self->shippingAddress2,
|
||||
address3 => $self->shippingAddress3,
|
||||
|
|
@ -808,6 +821,7 @@ sub getTransactionVars {
|
|||
} ),
|
||||
paymentAddress => $self->formatAddress({
|
||||
name => $self->paymentAddressName,
|
||||
organization => $self->paymentOrganization,
|
||||
address1 => $self->paymentAddress1,
|
||||
address2 => $self->paymentAddress2,
|
||||
address3 => $self->paymentAddress3,
|
||||
|
|
@ -825,25 +839,31 @@ sub getTransactionVars {
|
|||
my $address = '';
|
||||
if ($self->shippingAddressId ne $item->get('shippingAddressId')) {
|
||||
$address = $self->formatAddress({
|
||||
name => $item->get('shippingAddressName'),
|
||||
address1 => $item->get('shippingAddress1'),
|
||||
address2 => $item->get('shippingAddress2'),
|
||||
address3 => $item->get('shippingAddress3'),
|
||||
city => $item->get('shippingCity'),
|
||||
state => $item->get('shippingState'),
|
||||
code => $item->get('shippingCode'),
|
||||
country => $item->get('shippingCountry'),
|
||||
phoneNumber => $item->get('shippingPhoneNumber'),
|
||||
name => $item->get('shippingAddressName'),
|
||||
organization => $self->get('shippingOrganization'),
|
||||
address1 => $item->get('shippingAddress1'),
|
||||
address2 => $item->get('shippingAddress2'),
|
||||
address3 => $item->get('shippingAddress3'),
|
||||
city => $item->get('shippingCity'),
|
||||
state => $item->get('shippingState'),
|
||||
code => $item->get('shippingCode'),
|
||||
country => $item->get('shippingCountry'),
|
||||
phoneNumber => $item->get('shippingPhoneNumber'),
|
||||
});
|
||||
}
|
||||
|
||||
# Post purchase actions
|
||||
my $actionsLoop = [];
|
||||
my $actions = $item->getSku->getPostPurchaseActions( $item );
|
||||
for my $label ( keys %{$actions} ) {
|
||||
push @{$actionsLoop}, {
|
||||
label => $label,
|
||||
url => $actions->{$label},
|
||||
my $sku = eval { $item->getSku };
|
||||
my $has_sku = 0;
|
||||
if (! WebGUI::Error->caught) {
|
||||
my $actions = $sku->getPostPurchaseActions( $item );
|
||||
$has_sku = 1;
|
||||
for my $label ( keys %{$actions} ) {
|
||||
push @{$actionsLoop}, {
|
||||
label => $label,
|
||||
url => $actions->{$label},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -861,7 +881,8 @@ sub getTransactionVars {
|
|||
%{$item->get},
|
||||
%taxVars,
|
||||
viewItemUrl => $url->page('shop=transaction;method=viewItem;transactionId='.$self->getId.';itemId='.$item->getId, 1),
|
||||
price => sprintf("%.2f", $item->get('price')),
|
||||
hasSku => $has_sku,
|
||||
price => sprintf( "%.2f", $item->get('price') ),
|
||||
pricePlusTax => sprintf( "%.2f", $price + $taxAmount ),
|
||||
extendedPrice => sprintf( "%.2f", $quantity * $price ),
|
||||
extendedPricePlusTax => sprintf( "%.2f", $quantity * ( $price + $taxAmount ) ),
|
||||
|
|
@ -1222,8 +1243,8 @@ Refunds a specific item from a transaction and then issues shop credit.
|
|||
sub www_refundItem {
|
||||
my ($class, $session) = @_;
|
||||
return $session->privilege->insufficient unless (WebGUI::Shop::Admin->new($session)->canManage);
|
||||
my $self = $class->new($session, $session->form->get("transactionId"));
|
||||
my $form = $session->form;
|
||||
my $self = $class->new($session, $form->get("transactionId"));
|
||||
my $item = eval { $self->getItem($form->get("itemId")) };
|
||||
if (WebGUI::Error->caught()) {
|
||||
$session->log->error("Can't get item ".$form->get("itemId"));
|
||||
|
|
@ -1327,15 +1348,16 @@ sub www_view {
|
|||
</tr>
|
||||
<tr>
|
||||
<th>}. $i18n->get("shipping address") .q{</th><td>}. $transaction->formatAddress({
|
||||
name => $transaction->get('shippingAddressName'),
|
||||
address1 => $transaction->get('shippingAddress1'),
|
||||
address2 => $transaction->get('shippingAddress2'),
|
||||
address3 => $transaction->get('shippingAddress3'),
|
||||
city => $transaction->get('shippingCity'),
|
||||
state => $transaction->get('shippingState'),
|
||||
code => $transaction->get('shippingCode'),
|
||||
country => $transaction->get('shippingCountry'),
|
||||
phoneNumber => $transaction->get('shippingPhoneNumber'),
|
||||
name => $transaction->get('shippingAddressName'),
|
||||
organization => $transaction->get('shippingOrganization'),
|
||||
address1 => $transaction->get('shippingAddress1'),
|
||||
address2 => $transaction->get('shippingAddress2'),
|
||||
address3 => $transaction->get('shippingAddress3'),
|
||||
city => $transaction->get('shippingCity'),
|
||||
state => $transaction->get('shippingState'),
|
||||
code => $transaction->get('shippingCode'),
|
||||
country => $transaction->get('shippingCountry'),
|
||||
phoneNumber => $transaction->get('shippingPhoneNumber'),
|
||||
}) .q{</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -1346,15 +1368,16 @@ sub www_view {
|
|||
</tr>
|
||||
<tr>
|
||||
<th>}. $i18n->get("payment address") .q{</th><td>}. $transaction->formatAddress({
|
||||
name => $transaction->get('paymentAddressName'),
|
||||
address1 => $transaction->get('paymentAddress1'),
|
||||
address2 => $transaction->get('paymentAddress2'),
|
||||
address3 => $transaction->get('paymentAddress3'),
|
||||
city => $transaction->get('paymentCity'),
|
||||
state => $transaction->get('paymentState'),
|
||||
code => $transaction->get('paymentCode'),
|
||||
country => $transaction->get('paymentCountry'),
|
||||
phoneNumber => $transaction->get('paymentPhoneNumber'),
|
||||
name => $transaction->get('paymentAddressName'),
|
||||
organization => $transaction->get('paymentOrganization'),
|
||||
address1 => $transaction->get('paymentAddress1'),
|
||||
address2 => $transaction->get('paymentAddress2'),
|
||||
address3 => $transaction->get('paymentAddress3'),
|
||||
city => $transaction->get('paymentCity'),
|
||||
state => $transaction->get('paymentState'),
|
||||
code => $transaction->get('paymentCode'),
|
||||
country => $transaction->get('paymentCountry'),
|
||||
phoneNumber => $transaction->get('paymentPhoneNumber'),
|
||||
}) .q{</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -1379,6 +1402,8 @@ sub www_view {
|
|||
<tbody>
|
||||
};
|
||||
foreach my $item (@{$transaction->getItems}) {
|
||||
eval { $item->getSku; };
|
||||
my $sku_exists = !WebGUI::Error->caught;
|
||||
$output .= WebGUI::Form::formHeader($session)
|
||||
.WebGUI::Form::hidden($session, {name=>"shop",value=>"transaction"})
|
||||
.WebGUI::Form::hidden($session, {name=>"method",value=>"updateItem"})
|
||||
|
|
@ -1386,9 +1411,15 @@ sub www_view {
|
|||
.WebGUI::Form::hidden($session, {name=>"itemId",value=>$item->getId})
|
||||
.q{
|
||||
<tr>
|
||||
<td>}.$item->get('lastUpdated').q{</td>
|
||||
<td><a href="}.$url->page('shop=transaction;method=viewItem;transactionId='.$transaction->getId.';itemId='.$item->getId).q{">}.$item->get('configuredTitle').q{</a></td>
|
||||
<td>}.$transaction->formatCurrency($item->get('price')).q{</td>
|
||||
<td>}.$item->get('lastUpdated').qq{</td>\n}.
|
||||
(
|
||||
$sku_exists
|
||||
? q{<td><a href="}.$url->page('shop=transaction;method=viewItem;transactionId='.$transaction->getId
|
||||
. ';itemId='.$item->getId).q{">}.$item->get('configuredTitle').qq{</a></td>\n}
|
||||
: q{<td>}.$item->get('configuredTitle').q{<br />}.$i18n->get('item sku deleted').qq{</td>\n}
|
||||
|
||||
)
|
||||
. q{<td>}.$transaction->formatCurrency($item->get('price')).q{</td>
|
||||
<td>}.$item->get('quantity').q{</td>
|
||||
};
|
||||
if ($item->get('shippingAddressId') eq $transaction->get('shippingAddressId')) {
|
||||
|
|
@ -1397,15 +1428,16 @@ sub www_view {
|
|||
else {
|
||||
$output .= q{
|
||||
<td class="smallAddress">}. $transaction->formatAddress({
|
||||
name => $item->get('shippingAddressName'),
|
||||
address1 => $item->get('shippingAddress1'),
|
||||
address2 => $item->get('shippingAddress2'),
|
||||
address3 => $item->get('shippingAddress3'),
|
||||
city => $item->get('shippingCity'),
|
||||
state => $item->get('shippingState'),
|
||||
code => $item->get('shippingCode'),
|
||||
country => $item->get('shippingCountry'),
|
||||
phoneNumber => $item->get('shippingPhoneNumber'),
|
||||
name => $item->get('shippingAddressName'),
|
||||
organization => $item->get('shippingOrganization'),
|
||||
address1 => $item->get('shippingAddress1'),
|
||||
address2 => $item->get('shippingAddress2'),
|
||||
address3 => $item->get('shippingAddress3'),
|
||||
city => $item->get('shippingCity'),
|
||||
state => $item->get('shippingState'),
|
||||
code => $item->get('shippingCode'),
|
||||
country => $item->get('shippingCountry'),
|
||||
phoneNumber => $item->get('shippingPhoneNumber'),
|
||||
}) .q{</td>
|
||||
};
|
||||
}
|
||||
|
|
@ -1464,7 +1496,12 @@ sub www_viewItem {
|
|||
$session->log->error("Can't get item ".$session->form->get("itemId"));
|
||||
return $class->www_view($session);
|
||||
}
|
||||
return $item->getSku->www_view;
|
||||
my $sku = eval { $item->getSku };
|
||||
if (WebGUI::Error->caught()) {
|
||||
$session->errorHandler->error("Can't get sku for ".$session->form->get("itemId"));
|
||||
return $class->www_view($session);
|
||||
}
|
||||
return $sku->www_view;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue