diff --git a/actions/challengeRegistration.js b/actions/challengeRegistration.js index 791121d3f..5b0c09319 100644 --- a/actions/challengeRegistration.js +++ b/actions/challengeRegistration.js @@ -403,8 +403,12 @@ var sendNotificationEmail = function (api, componentInfo, userId, activeForumCat forumURL = api.config.tcConfig.studioForumsUrlPrefix + activeForumCategoryId; submitURL = process.env.TC_STUDIO_SERVER_NAME + '/?module=ViewContestDetails&ct=' + challengeId; } - - template = 'registration_notification_email'; + + if (componentInfo.review_type && componentInfo.review_type == 'PEER') + template = 'peer_review_registration'; + else + template = 'registration_notification_email'; + if (challengeType === CHALLENGE_TYPE.DESIGN) { template = 'design_registration_notification_email'; // Get forum type diff --git a/actions/challenges.js b/actions/challenges.js index 88fb6b460..c7703307f 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -796,13 +796,9 @@ var addFilter = function (sql, filter, isMyChallenges, helper, caller) { if (_.isDefined(filter.review)) { review = "'" + filter.review.toUpperCase().replace(/,/g, "','") + "'"; + sql.count = editSql(sql.count, REVIEW_FILTER, review); + sql.data = editSql(sql.data, REVIEW_FILTER, review); } - else { - review = "'COMMUNITY','INTERNAL'"; - } - - sql.count = editSql(sql.count, REVIEW_FILTER, review); - sql.data = editSql(sql.data, REVIEW_FILTER, review); if (isMyChallenges) { sql.count = editSql(sql.count, MY_CHALLENGES_FILTER, null); diff --git a/actions/memberRegistration.js b/actions/memberRegistration.js index f95e0e1f4..cb75d89cf 100644 --- a/actions/memberRegistration.js +++ b/actions/memberRegistration.js @@ -33,6 +33,7 @@ var bignum = require("bignum"); var _ = require("underscore"); var IllegalArgumentError = require('../errors/IllegalArgumentError'); var BadRequestError = require('../errors/BadRequestError'); +var request = require('request'); /** * The max surname length @@ -1150,8 +1151,21 @@ exports.memberRegister = { if (err) { api.helper.handleError(api, connection, err); } else { - api.log("Member registration succeeded.", "debug"); - connection.response = {userId : result}; + var finalize = function() { + api.log("Member registration succeeded.", "debug"); + connection.response = {userId : result}; + }; + + if (connection.params.regSource !== null && connection.params.regSource === 'apple') { + request.post({ + headers: { 'Authorization' : 'Bearer ' + connection.rawConnection.req.headers.authorization }, + url: 'https://api.' + api.config.tcConfig.oauthDomain + '.com/v3/memberCert/registrations/' + result + '/programs/3445' + }, + function(error, response, body) { + finalize(); + }); + } + else finalize(); } next(connection, true); diff --git a/mail_templates/peer_registration/html.ejs b/mail_templates/peer_registration/html.ejs new file mode 100644 index 000000000..b783470dd --- /dev/null +++ b/mail_templates/peer_registration/html.ejs @@ -0,0 +1,14 @@ +

Hi <%= userName %>,

+ +

Congratulations! You are now registered for <%= projectName %> Challenge.

+ +

You now have access to the challenge discussion forum ( <%= forumURL %> ), which may have important information or documentation<%= documentationDetails %> about the challenge. It is also the place to ask questions regarding the challenge. Please post your questions at any time and the challenge holder will respond within 24 hours. Any questions asked within a few hours of the submission deadline may not be answered in time, so get your questions in early!

+ +

The deadline for submitting a solution is <%= deadlineDate %>. Please upload your submission here: <%= submitURL %>. If you encounter any problems, please contact us at support@topcoder.com. All late submissions will be ignored.

+ +

Need more information? Visit the Help Center at http://help.topcoder.com.

+ +

Do you have questions or technical problems? Please contact support@topcoder.com.

+ +

Good luck!

+

The topcoder Team

\ No newline at end of file diff --git a/mail_templates/peer_registration/style.css b/mail_templates/peer_registration/style.css new file mode 100644 index 000000000..adc68fa6a --- /dev/null +++ b/mail_templates/peer_registration/style.css @@ -0,0 +1,3 @@ +h1 { + color: red; +} diff --git a/mail_templates/peer_registration/text.ejs b/mail_templates/peer_registration/text.ejs new file mode 100644 index 000000000..367d29477 --- /dev/null +++ b/mail_templates/peer_registration/text.ejs @@ -0,0 +1,14 @@ +Hi <%= userName %>, + +Congratulations! You are now registered for <%= projectName %> Challenge. + +You now have access to the challenge discussion forum ( <%= forumURL %> ), which may have important information or documentation<%= documentationDetails %> about the challenge. It is also the place to ask questions regarding the challenge. Please post your questions at any time and the challenge holder will respond within 24 hours. Any questions asked within a few hours of the submission deadline may not be answered in time, so get your questions in early! + +The deadline for submitting a solution is <%= deadlineDate %>. Please upload your submission here: <%= submitURL %>. If you encounter any problems, please contact us at support@topcoder.com. All late submissions will be ignored. + +Need more information? Visit the Help Center at http://help.topcoder.com. + +Do you have questions or technical problems? Please contact support@topcoder.com. + +Good luck! +The topcoder Team diff --git a/mail_templates/registration_notification_email/text.ejs b/mail_templates/registration_notification_email/text.ejs index a8eec799c..dce77bd10 100644 --- a/mail_templates/registration_notification_email/text.ejs +++ b/mail_templates/registration_notification_email/text.ejs @@ -1,3 +1,16 @@ -Here is the registration notification email +Hi <%= userName %>, -Have fun! +Congratulations! You are now registered for <%= projectName %> Challenge. + +You now have access to the challenge discussion forum ( <%= forumURL %> ), which may have important information or documentation<%= documentationDetails %> about the challenge. It is also the place to ask questions regarding the challenge. Please post your questions at any time and the challenge holder will respond within 24 hours. Any questions asked within a few hours of the submission deadline may not be answered in time, so get your questions in early! + +The deadline for submitting a solution is <%= deadlineDate %>. Please upload your submission here: <%= submitURL %>. If you encounter any problems, please contact us at support@topcoder.com. All late submissions will be ignored. + +Additional tasks for this challenge can be accessed in Online Review. This is where you can unregister, contact a manager, view your review scorecard, submit appeals and final fixes, and other important tasks. <%= reviewURL %> + +Need more information about competing? Visit the Help Center at http://help.topcoder.com. + +Do you have questions or technical problems? Please contact support@topcoder.com. + +Good luck! +The topcoder Team diff --git a/queries/get_component_info b/queries/get_component_info index 262b8836e..40374a911 100644 --- a/queries/get_component_info +++ b/queries/get_component_info @@ -8,11 +8,17 @@ SELECT -- the project category id, e.g. Logo Design, Developemnt, Assembly (select project_category_id from project where project_id = @challengeId@ ) as project_category_id, -- the project name. - (select value from project_info where project_id = @challengeId@ AND project_info_type_id = 6 ) as project_name + (select value from project_info where project_id = @challengeId@ AND project_info_type_id = 6 ) as project_name, + pi79.value as review_type FROM comp_versions c - INNER JOIN project_info p ON c.component_id = p.value - INNER JOIN project_phase d ON d.project_id = @challengeId@ and phase_type_id = 2 + , project_info p + , project_phase d + , project_info pi79 WHERE p.project_info_type_id = 2 AND c.phase_id IN (112, 113) - AND p.project_id = @challengeId@ \ No newline at end of file + AND c.component_id = p.value + AND p.project_id = @challengeId@ + AND d.project_id = @challengeId@ and d.phase_type_id = 2 + AND pi79.project_info_type_id = 79 + AND pi79.project_id = @challengeId@ \ No newline at end of file