diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 874437118..a82c66b55 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -5,6 +5,8 @@ - fixed: Syndicated Content asset makes template engine choke - fixed: Security issue in CS RSS feeds - fixed: Asset Manager breaks when an asset is locked + - fixed: EMS - Data error when trying to list badges + - fixed: EMS - Not able to refund tickets - fixed: Asset Manager is slow to load - fixed: project management application unable to add or edit tasks. - fixed: dashboard not working due to using legacy ajax handlers @@ -12,6 +14,7 @@ - fixed: Asset Manager can now change ranks again - fixed: Cannot manage revisions in version tags. + 7.5.12 - skipping this release diff --git a/docs/upgrades/upgrade_7.5.12-7.5.13.pl b/docs/upgrades/upgrade_7.5.12-7.5.13.pl index 9b7a97c57..f38faa201 100644 --- a/docs/upgrades/upgrade_7.5.12-7.5.13.pl +++ b/docs/upgrades/upgrade_7.5.12-7.5.13.pl @@ -28,21 +28,25 @@ my $quiet; # this line required my $session = start(); # this line required +fixShop($session); addSelectableProfileTemplates($session); -# upgrade functions go here 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 fixShop { + my $session = shift; + print "\tFixing Shop properties" unless $quiet; + my $db = $session->db; + $db->write("update EventManagementSystem set registrationStaffGroupId='3' where registrationStaffGroupId=''"); + my ($driverId) = $db->quickScalar("select paymentGatewayId from paymentGateway where className='WebGUI::Shop::PayDriver::ITransact'"); + $db->write("update transaction set paymentDriverId=?",[$driverId]); + print "DONE!\n" unless $quiet; +} + +#---------------------------------------------------------------------------- sub addSelectableProfileTemplates { my $session = shift; my $tmpl = $session->setting->get('viewUserProfileTemplate') || 'PBtmpl0000000000000052'; diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index 2608c5caa..dd9aeeea0 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -20,6 +20,7 @@ use Tie::IxHash; use WebGUI::HTMLForm; use JSON; use Digest::MD5; +use WebGUI::Exception; use WebGUI::Workflow::Instance; use WebGUI::Cache; use WebGUI::International; @@ -845,7 +846,7 @@ sub www_getRegistrantsAsJson { if ($keywords ne "") { $db->buildSearchQuery(\$sql, \@params, $keywords, [qw{badgeNumber name address1 address2 address3 city state country email notes zipcode phoneNumber organization}]) } - + # limit $sql .= ' limit ?,?'; push(@params, $startIndex, $numberOfResults); @@ -858,6 +859,10 @@ sub www_getRegistrantsAsJson { $results{'totalRecords'} = $db->quickScalar('select found_rows()') + 0; ##Convert to numeric while (my $badgeInfo = $badges->hashRef) { my $badge = WebGUI::Asset::Sku::EMSBadge->new($session, $badgeInfo->{badgeAssetId}); + unless (defined $badge) { + $session->log->error('badge '.$badgeInfo->{badgeAssetId}.' does not exist.'); + next; + } $badgeInfo->{title} = $badge->getTitle; $badgeInfo->{sku} = $badge->get('sku'); $badgeInfo->{assetId} = $badge->getId; @@ -1456,7 +1461,11 @@ sub www_refundItem { return $session->privilege->insufficient() unless $self->canView; my @itemIds = $session->form->param("transactionItemId"); foreach my $id (@itemIds) { - my $item = WebGUI::Shop::TransactionItem->newByDynamicTransaction($session, $id); + my $item = eval{WebGUI::Shop::TransactionItem->newByDynamicTransaction($session, $id)}; + if (WebGUI::Error->caught('WebGUI::Error::InvalidParam')) { + $session->log->warn('Got "'.$@.'" which probably means we are working on a registrant that was migrated, and cannot be refunded.'); + $self->www_manageRegistrant(); + } if (defined $item) { $item->issueCredit; } diff --git a/lib/WebGUI/Shop/PayDriver/ITransact.pm b/lib/WebGUI/Shop/PayDriver/ITransact.pm index 3b67fef12..c6374af53 100644 --- a/lib/WebGUI/Shop/PayDriver/ITransact.pm +++ b/lib/WebGUI/Shop/PayDriver/ITransact.pm @@ -7,17 +7,6 @@ use Data::Dumper; use base qw/WebGUI::Shop::PayDriver/; #------------------------------------------------------------------- - -=head2 _generateCancelRecurXml ( transaction ) - -Generates the XML that cancels a recurring payment. Includes the xml header. - -=head3 transaction - -The instantiated WebGUI::Shop::Transaction object for the transaction the recurring payment should be stopped. - -=cut - sub _generateCancelRecurXml { my $self = shift; my $transaction = shift; @@ -51,17 +40,6 @@ sub _generateCancelRecurXml { } #------------------------------------------------------------------- - -=head2 _generatePaymentRequestXML ( transaction ) - -Generates the XML that will perform the payment transaction. - -=head3 transaction - -The instantiated WebGUI::Shop::Transaction object for the transaction that should be payed. - -=cut - sub _generatePaymentRequestXML { my $self = shift; my $transaction = shift; @@ -188,13 +166,6 @@ sub _generatePaymentRequestXML { } #------------------------------------------------------------------- - -=head _monthYear () - -Returns the HTML for month/year combo box as is used for the credit card expiration date in the checkout form. - -=cut - sub _monthYear { my $session = shift; my $form = $session->form; @@ -221,19 +192,6 @@ sub _monthYear { } #------------------------------------------------------------------- - -=head2 _resolveRecurRecipe ( duration ) - -Returns the ITransact recipe name tied to one of the allowed recurring payment term durations as used within the -commerce system. - -=head3 duration - -The idenntifier for the term of the recurring transaction. May be either 'Weekly', 'BiWeekly', 'FourWeekly', -'Monthly', 'BiMonthly', 'Quarterly', 'HalfYearly' or 'Yearly'. - -=cut - sub _resolveRecurRecipe { my $self = shift; my $duration = shift; @@ -252,6 +210,8 @@ sub _resolveRecurRecipe { return $resolve{ $duration }; } + + #------------------------------------------------------------------- =head2 cancelRecurringPayment ( transaction ) @@ -316,22 +276,6 @@ sub cancelRecurringPayment { } #------------------------------------------------------------------- - -=head2 checkRecurringTransaction ( xid, expectedAmount ) - -Does a request to ITransact to check the amount tied to a transaction. This is maily used to check whether a -postback result is an actual post back from ITransact and not a falsified post back by a malicious user. - -=head3 xid - -The id ITranscat to the transaction. Make sure not to use the orig_xid. - -=head3 expectedAmount - -The amount the transaction should be. - -=cut - sub checkRecurringTransaction { my $self = shift; my $xid = shift; @@ -399,21 +343,6 @@ sub checkRecurringTransaction { } #------------------------------------------------------------------- - -=head2 definition ( session, definition ) - -The defintion method of the plugin. See WebGUI::Shop::PayDriver->definition for more information. - -=head3 session - -An instantiated WebGUI::Session object. - -=head3 definition - -Arrayref. Used to let every subclass add its properties to the definition. - -=cut - sub definition { my $class = shift; my $session = shift; @@ -425,29 +354,29 @@ sub definition { %fields = ( vendorId => { fieldType => 'text', - label => $i18n->get('vendorId'), - hoverHelp => $i18n->get('vendorId help'), + label => $i18n->echo('vendorId'), + hoverHelp => $i18n->echo('vendorId help'), }, password => { fieldType => 'password', - label => $i18n->get('password'), - hoverHelp => $i18n->get('password help'), + label => $i18n->echo('password'), + hoverHelp => $i18n->echo('password help'), }, useCVV2 => { fieldType => 'yesNo', - label => $i18n->get('use cvv2'), - hoverHelp => $i18n->get('use cvv2 help'), + label => $i18n->echo('use cvv2'), + hoverHelp => $i18n->echo('use cvv2 help'), }, emailMessage => { fieldType => 'textarea', - label => $i18n->get('emailMessage'), - hoverHelp => $i18n->get('emailMessage help'), + label => $i18n->echo('emailMessage'), + hoverHelp => $i18n->echo('emailMessage help'), }, # readonly stuff from old plugin here? ); push @{ $definition }, { - name => $i18n->get('Itransact'), + name => $i18n->echo('Itransact'), properties => \%fields, }; @@ -498,35 +427,20 @@ sub doXmlRequest { } #------------------------------------------------------------------- - -=head2 getButton ( ) - -Return the HTML for a button inside a form that, when clicked, will take the user to the checkout screen for this -plugin. - -=cut - sub getButton { my $self = shift; my $session = $self->session; - my $i18n = WebGUI::International->new($session, 'PayDriver_ITransact'); + my $i18n = WebGUI::International->new($session, 'PayDriver_ITansact'); my $payForm = WebGUI::Form::formHeader($session) . $self->getDoFormTags('getCredentials') - . WebGUI::Form::submit($session, {value => $i18n->get('ITransact') }) + . WebGUI::Form::submit($session, {value => $i18n->echo('ITransact') }) . WebGUI::Form::formFooter($session); return $payForm; } #------------------------------------------------------------------- - -=head2 getEditForm ( ) - -Adds account setup information to the edit form for this plugin. Returns an instantiated WebGUI::HTMLForm obejct. - -=cut - sub getEditForm { my $self = shift; my $session = $self->session; @@ -566,15 +480,6 @@ sub handlesRecurring { } #------------------------------------------------------------------- - -=head2 processCredentials ( ) - -Checks and processes the data submitted by the user to the checkout form. Returns an array ref containing error messages if an -error occurred. If everything is okay, undef will be returned. Since this method stores the redentials in this -object instance you must execute this method before attempting a payment request. - -=cut - sub processCredentials { my $self = shift; my $session = $self->session; @@ -631,26 +536,6 @@ sub processCredentials { } #------------------------------------------------------------------- - -=head2 processPayment ( transaction ) - -Sends a payment request to ITransact, parses the result and depending on the outcome returns either: - -On a succesfull request: - - (1, GatewayCode, Status, Message) - -On a failed request: - - (0, GatewayCode, Status, Message) - -Note that in the former case Message can be empty, while in the latter case GatewayCode may not be available (for -instance on a connection error) and wil be undef. - -See also WebGUI::Shop::PayDriver->processPayment. - -=cut - sub processPayment { my $self = shift; my $transaction = shift; @@ -703,17 +588,6 @@ sub processPayment { } #------------------------------------------------------------------- - -=head2 www_getCredentials ( errors ) - -Displays the checkout form where users who want to pay can enter their address and credit card data. - -=head3 errors - -Arrayref containing error messages for errors that the user made in entering his data. - -=cut - sub www_getCredentials { my $self = shift; my $errors = shift; @@ -733,7 +607,8 @@ sub www_getCredentials { # Process form errors if ( $errors ) { - $output .= $i18n->get('error occurred message') + #### TODO: i18n + $output .= $i18n->echo('The following errors occurred:') . '