diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 723c0285b..bea643219 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - Moved Asset ID and Class Name fields to the Meta tab of all assets. - Made Classname from control a subclass of ReadOnly. - Added query keys to WebGUI::Crud. + - EMS Saved Address (#8864) - WebGUI::Crud can now automatically resolve differences between its definition and the table schema. - Fixed a limit bug in the asset discovery service. @@ -15,6 +16,9 @@ - rfe #740: Thingy Pre-Text (SDH Consulting Group) - rfe #746: use the menu title in asset manager - rfe #549: New macro for checking spectre status. VersionTag::RequestCommit and Operation::VestionTag::www_commitVertionTag now both check for spectre status before trying to commit. + + + 7.6.1 - changed: the list of extensions for the export system to pass through unmodified has been moved to the configuration file under the diff --git a/docs/upgrades/packages-7.6.2/shopping-cart-collateral-items_address-default.wgpkg b/docs/upgrades/packages-7.6.2/shopping-cart-collateral-items_address-default.wgpkg new file mode 100644 index 000000000..a1cf0e561 Binary files /dev/null and b/docs/upgrades/packages-7.6.2/shopping-cart-collateral-items_address-default.wgpkg differ diff --git a/docs/upgrades/upgrade_7.6.1-7.6.2.pl b/docs/upgrades/upgrade_7.6.1-7.6.2.pl index 047d45bd2..386b67384 100644 --- a/docs/upgrades/upgrade_7.6.1-7.6.2.pl +++ b/docs/upgrades/upgrade_7.6.1-7.6.2.pl @@ -31,17 +31,19 @@ my $session = start(); # this line required # upgrade functions go here repairManageWorkflows($session); addPreTextToThingyFields($session); +updateAddressBook($session); finish($session); # this line required #---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} +sub updateAddressBook { + my $session = shift; + print "\tAdd Organization and Email Address to address book." unless $quiet; + my $db = $session->db; + $db->write("alter table address add column organization char(255)"); + $db->write("alter table address add column email char(255)"); + print "DONE!\n" unless $quiet; +} #---------------------------------------------------------------------------- sub repairManageWorkflows { diff --git a/lib/WebGUI/Asset/Sku/EMSBadge.pm b/lib/WebGUI/Asset/Sku/EMSBadge.pm index cc5321114..0ae432658 100644 --- a/lib/WebGUI/Asset/Sku/EMSBadge.pm +++ b/lib/WebGUI/Asset/Sku/EMSBadge.pm @@ -396,7 +396,7 @@ sub view { }); $vars{organization} = WebGUI::Form::text($session, { name => 'organization', - defaultValue => $form->get("organization"), + defaultValue => (defined $address) ? $address->get("organization") : $form->get('organization'), }); $vars{address1} = WebGUI::Form::text($session, { name => 'address1', @@ -432,7 +432,7 @@ sub view { }); $vars{email} = WebGUI::Form::text($session, { name => 'email', - defaultValue => $form->get('email','email'), + defaultValue => (defined $address) ? $address->get('email') : $form->get('email','email'), }); if($self->getQuantityAvailable() > 0){ $vars{submitAddress} = WebGUI::Form::submit($session, {value => $i18n->get('add to cart'),}); diff --git a/lib/WebGUI/Shop/Address.pm b/lib/WebGUI/Shop/Address.pm index d18ddfdff..3ab0b6818 100644 --- a/lib/WebGUI/Shop/Address.pm +++ b/lib/WebGUI/Shop/Address.pm @@ -111,13 +111,17 @@ Returns an HTML formatted address for display. sub getHtmlFormatted { my $self = shift; - my $address = $self->get("firstName"). " " .$self->get("lastName") . "
" . $self->get("address1") . "
"; + my $address = $self->get("firstName"). " " .$self->get("lastName") . "
"; + $address .= $self->get("organization") . "
" if ($self->get("organization") ne ""); + $address .= $self->get("address1") . "
"; $address .= $self->get("address2") . "
" if ($self->get("address2") ne ""); $address .= $self->get("address3") . "
" if ($self->get("address3") ne ""); $address .= $self->get("city") . ", "; $address .= $self->get("state") . " " if ($self->get("state") ne ""); $address .= $self->get("code") if ($self->get("code") ne ""); $address .= '
' . $self->get("country"); + $address .= '
'.$self->get("phoneNumber") if ($self->get("phoneNumber") ne ""); + $address .= '
'.$self->get("email").'' if ($self->get("email") ne ""); return $address; } @@ -228,6 +232,14 @@ The country that this address is in. A telephone number for this address. It is required by some shippers. +=head4 email + +An email address for this user. + +=head4 organization + +The organization or company that this user is a part of. + =head4 addressBookId The address book that this address belongs to. @@ -237,7 +249,7 @@ The address book that this address belongs to. sub update { my ($self, $newProperties) = @_; my $id = id $self; - foreach my $field (qw(address1 address2 address3 state code city label firstName lastName country phoneNumber)) { + foreach my $field (qw(email organization address1 address2 address3 state code city label firstName lastName country phoneNumber)) { $properties{$id}{$field} = (exists $newProperties->{$field}) ? $newProperties->{$field} : $properties{$id}{$field}; } $properties{$id}{addressBookId} = $self->addressBook->getId; diff --git a/lib/WebGUI/Shop/AddressBook.pm b/lib/WebGUI/Shop/AddressBook.pm index ec05a8bc0..1c36b9182 100644 --- a/lib/WebGUI/Shop/AddressBook.pm +++ b/lib/WebGUI/Shop/AddressBook.pm @@ -369,6 +369,10 @@ sub www_editAddress { {name=>"code", defaultValue=>($form->get("code") || ((defined $address) ? $address->get('code') : undef))}), phoneNumberField => WebGUI::Form::phone($session, {name=>"phoneNumber", defaultValue=>($form->get("phoneNumber") || ((defined $address) ? $address->get('phoneNumber') : undef))}), + emailField => WebGUI::Form::email($session, + {name=>"email", defaultValue=>($form->get("email") || ((defined $address) ? $address->get('email') : undef))}), + organizationField => WebGUI::Form::text($session, + {name=>"organization", defaultValue=>($form->get("organization") || ((defined $address) ? $address->get('organization') : undef))}), ); my $template = WebGUI::Asset::Template->new($session, $session->setting->get("shopAddressTemplateId")); $template->prepare; @@ -425,6 +429,8 @@ sub www_editAddressSave { code => $form->get("code","zipcode"), country => $form->get("country","country"), phoneNumber => $form->get("phoneNumber","phone"), + email => $form->get("email","email"), + organization => $form->get("organization"), ); if ($form->get('addressId') eq '') { $self->addAddress(\%addressData); diff --git a/lib/WebGUI/i18n/English/Shop.pm b/lib/WebGUI/i18n/English/Shop.pm index cbb95960c..4f4c25a99 100644 --- a/lib/WebGUI/i18n/English/Shop.pm +++ b/lib/WebGUI/i18n/English/Shop.pm @@ -9,6 +9,18 @@ our $I18N = { context => q|vendor label|, }, + 'organization' => { + message => q|Organization|, + lastUpdated => 0, + context => q|address book label|, + }, + + 'email' => { + message => q|Email|, + lastUpdated => 0, + context => q|address book label|, + }, + 'Payment Information' => { message => q|Payment Information|, lastUpdated => 0,