From 338efd3df37f3d2dfb316c3a0fc8d774a08de3fb Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 27 Nov 2007 16:17:42 +0000 Subject: [PATCH] merging 7.4.16 bugfix --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/Wobject/EventManagementSystem.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5b6ba87da..52a4a84ea 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -11,6 +11,8 @@ 7.4.16 - fix: EMS - Adding Prerequisite sets. + - fix: Multiple Instances of EMS displaying on View Purchase + 7.4.15 - fix: Image asset test fails diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index 42e49ae9b..cb739f541 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -2985,8 +2985,8 @@ sub www_managePurchases { return $self->www_viewPurchase unless $isAdmin; my $i18n = WebGUI::International->new($self->session,'Asset_EventManagementSystem'); my $whereClause = ($isAdmin)?'':" and (t.userId='".$self->session->user->userId."' or b.userId='".$self->session->user->userId."' or b.createdByUserId='".$self->session->user->userId."') and e.endDate > '".$self->session->datetime->time()."'"; - my $sql = "select distinct(t.transactionId) as purchaseId, t.initDate as initDate from transaction as t, EventManagementSystem_purchases as p, EventManagementSystem_registrations as r, EventManagementSystem_badges as b, EventManagementSystem_products as e where p.transactionId=t.transactionId and b.badgeId=r.badgeId and t.status='Completed' and p.purchaseId=r.purchaseId and r.productId=e.productId $whereClause order by t.initDate"; - my $sth = $self->session->db->read($sql); + my $sql = "select distinct(t.transactionId) as purchaseId, t.initDate as initDate from transaction as t, EventManagementSystem_purchases as p, EventManagementSystem_registrations as r, EventManagementSystem_badges as b, EventManagementSystem_products as e where p.transactionId=t.transactionId and b.badgeId=r.badgeId and t.status='Completed' and p.purchaseId=r.purchaseId and r.productId=e.productId and r.assetId=? $whereClause order by t.initDate"; + my $sth = $self->session->db->read($sql,[$self->getId]); my @purchasesLoop; while (my $purchase = $sth->hashRef) { $purchase->{datePurchasedHuman} = $self->session->datetime->epochToHuman($purchase->{initDate});