Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit c4ea399

Browse files
committed
* Fix unit tests
* Fix sql error
1 parent 7f2d243 commit c4ea399

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

mycollab-services-community/src/test/resources/com/mycollab/module/project/service/ProjectServiceTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<dataset>
44
<s_account id="1" createdTime="2013-04-10 13:29:23" paymentMethod="Credit Card" status="Active"/>
55

6-
<s_user username="admin" firstname="Nguyen" lastname="Hai" email="[email protected]"/>
6+
<s_user username="admin" firstname="Nguyen" lastname="Hai" email="[email protected]"
7+
status="EmailVerified"/>
78

8-
<s_user username="user2" firstname="A" lastname="B" email="[email protected]"/>
9+
<s_user username="user2" firstname="A" lastname="B" email="[email protected]" status="EmailVerified"/>
910

1011
<s_user_account id="1" isAccountOwner="1"
1112
registerStatus="Active" username="admin" accountId="1"

mycollab-services/src/main/resources/sqlMap/project/ProjectMapperExt.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@
489489
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
490490
notifier.firstname AS notifiers_firstname, notifier.lastname AS notifiers_lastname,
491491
notifier.username AS notifiers_username, notifier.timezone AS notifiers_timezone,
492-
notifier.email AS notifiers_email, notifier.language AS notifiers_language, s_relay_email_notification.sAccountId AS notifiers_accountId
492+
notifier.email AS notifiers_email, notifier.language AS notifiers_language,
493+
notifier.status AS notifiers_status, s_relay_email_notification.sAccountId AS notifiers_accountId
493494
FROM s_relay_email_notification
494495
INNER JOIN m_tracker_bug ON (s_relay_email_notification.type='Project-Bug' AND m_tracker_bug.id=s_relay_email_notification.typeId)
495496
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
@@ -512,7 +513,8 @@
512513
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
513514
notifier.firstname AS notifiers_firstname, notifier.lastname AS notifiers_lastname,
514515
notifier.username AS notifiers_username, notifier.timezone AS notifiers_timezone,
515-
notifier.email AS notifiers_email, notifier.language AS notifiers_language, s_relay_email_notification.sAccountId AS notifiers_accountId
516+
notifier.email AS notifiers_email, notifier.language AS notifiers_language,
517+
notifier.status AS notifiers_status, s_relay_email_notification.sAccountId AS notifiers_accountId
516518
FROM s_relay_email_notification
517519
INNER JOIN m_prj_task ON (s_relay_email_notification.type='Project-Task' AND m_prj_task.id=s_relay_email_notification.typeId)
518520
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
@@ -535,7 +537,7 @@
535537
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
536538
NULL AS notifiers_firstname, NULL AS notifiers_lastname, NULL AS notifiers_username,
537539
NULL AS notifiers_timezone, NULL AS notifiers_email, NULL AS notifiers_language,
538-
NULL AS notifiers_accountId
540+
NULL AS notifiers_status, NULL AS notifiers_accountId
539541
FROM s_relay_email_notification
540542
INNER JOIN m_prj_message ON (s_relay_email_notification.type='Project-Message' AND m_prj_message.id=s_relay_email_notification.typeId)
541543
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
@@ -554,7 +556,7 @@
554556
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
555557
NULL AS notifiers_firstname, NULL AS notifiers_lastname,
556558
NULL AS notifiers_username, NULL AS notifiers_timezone,
557-
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_accountId
559+
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_status, NULL AS notifiers_accountId
558560
FROM s_relay_email_notification
559561
INNER JOIN m_prj_milestone ON (s_relay_email_notification.type='Project-Milestone' AND m_prj_milestone.id=s_relay_email_notification.typeId)
560562
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
@@ -573,7 +575,7 @@
573575
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
574576
NULL AS notifiers_firstname, NULL AS notifiers_lastname,
575577
NULL AS notifiers_username, NULL AS notifiers_timezone,
576-
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_accountId
578+
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_status, NULL AS notifiers_accountId
577579
FROM s_relay_email_notification
578580
INNER JOIN m_prj_risk ON (s_relay_email_notification.type='Project-Risk' AND m_prj_risk.id=s_relay_email_notification.typeId)
579581
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
@@ -592,7 +594,7 @@
592594
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
593595
NULL AS notifiers_firstname, NULL AS notifiers_lastname, NULL AS notifiers_username,
594596
NULL AS notifiers_timezone, NULL AS notifiers_email, NULL AS notifiers_language,
595-
NULL AS notifiers_accountId
597+
NULL AS notifiers_status, NULL AS notifiers_accountId
596598
FROM s_relay_email_notification
597599
INNER JOIN m_tracker_component ON (s_relay_email_notification.type='Project-Component' AND m_tracker_component.id=s_relay_email_notification.typeId)
598600
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
@@ -611,7 +613,7 @@
611613
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
612614
NULL AS notifiers_firstname, NULL AS notifiers_lastname, NULL AS notifiers_username,
613615
NULL AS notifiers_timezone, NULL AS notifiers_email, NULL AS notifiers_language,
614-
NULL AS notifiers_accountId
616+
NULL AS notifiers_status, NULL AS notifiers_accountId
615617
FROM s_relay_email_notification
616618
INNER JOIN m_tracker_version ON (s_relay_email_notification.type='Project-Version' AND m_tracker_version.id=s_relay_email_notification.typeId)
617619
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)

mycollab-services/src/main/resources/sqlMap/project/ProjectMemberMapperExt.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
</select>
207207

208208
<select id="getActiveUsersInProjects" parameterType="map" resultMap="com.mycollab.module.user.dao.UserMapperExt.SimpleUserResult" lang="velocity">
209-
SELECT DISTINCT s_user.username, s_user.firstname, s_user.lastname, s_user.email, s_status
209+
SELECT DISTINCT s_user.username, s_user.firstname, s_user.lastname, s_user.email, s_user.status
210210
FROM s_user, s_user_account, m_prj_member
211211
WHERE s_user.username=s_user_account.username AND s_user_account.accountId=@{_parameter.sAccountId,jdbcType=NUMERIC}
212212
AND m_prj_member.username=s_user.username AND m_prj_member.projectId IN
@@ -238,18 +238,18 @@
238238
resultMap="com.mycollab.module.user.dao.UserMapperExt.SimpleUserResult" lang="velocity">
239239
<![CDATA[
240240
SELECT DISTINCT s_user.username, s_user.firstname, s_user.lastname, s_user.email,
241-
s_user.status, s_user.website, s_user.registeredTime, s_user_account.registerStatus,
242-
s_user_account.accountId, s_user.language, s_user.avatarid
243-
FROM s_user, s_user_account
241+
s_user.status, s_user.website, s_user.registeredTime, s_user_account.registerStatus,
242+
s_user_account.accountId, s_user.language, s_user.avatarid
243+
FROM s_user, s_user_account
244244
WHERE s_user.username=@{username} AND s_user.username=s_user_account.username AND
245-
s_user_account.accountId=@{sAccountId} AND
246-
EXISTS (SELECT 1
247-
FROM m_prj_member
248-
WHERE m_prj_member.username = s_user.username
249-
AND m_prj_member.status='Active'
250-
AND m_prj_member.projectId=@{projectId,jdbcType=NUMERIC}
251-
AND s_user_account.username=s_user.username
252-
LIMIT 1)
245+
s_user_account.accountId=@{sAccountId} AND
246+
EXISTS (SELECT 1
247+
FROM m_prj_member
248+
WHERE m_prj_member.username = s_user.username
249+
AND m_prj_member.status='Active'
250+
AND m_prj_member.projectId=@{projectId,jdbcType=NUMERIC}
251+
AND s_user_account.username=s_user.username
252+
LIMIT 1)
253253
]]>
254254
</select>
255255

0 commit comments

Comments
 (0)