diff --git a/components/project_management/src/java/main/com/topcoder/management/project/ProjectPropertyType.java b/components/project_management/src/java/main/com/topcoder/management/project/ProjectPropertyType.java index 60e78053b..a8dc44ba1 100644 --- a/components/project_management/src/java/main/com/topcoder/management/project/ProjectPropertyType.java +++ b/components/project_management/src/java/main/com/topcoder/management/project/ProjectPropertyType.java @@ -67,7 +67,7 @@ *

* *

- * Version 1.3.0 (Topcoder - Add effort hours field) + * Version 1.3.0 (Topcoder - Add effort days field) *

@@ -95,21 +95,21 @@ public class ProjectPropertyType implements Serializable { /** * Represents key for Allow Stock Art property. - * + * * @since 1.2.1 */ public static final String ALLOW_STOCK_ART_KEY = "Allow Stock Art"; - + /** * Represents key for Viewable Submissions Flag property. - * + * * @since 1.2.1 */ public static final String VIEWABLE_SUBMISSIONS_FLAG_KEY_STRING = "Viewable Submissions Flag"; - + /** * Represents key for Viewable Submitters property. - * + * * @since 1.2.1 */ public static final String VIEWABLE_SUBMITTERS_KEY = "Viewable Submitters"; @@ -184,7 +184,7 @@ public class ProjectPropertyType implements Serializable { */ public static final String BILLING_PROJECT_PROJECT_PROPERTY_KEY = "Billing Project"; - + /** *

* Represents the "confidentiality type" project property key @@ -217,7 +217,7 @@ public class ProjectPropertyType implements Serializable { * */ public static final String PUBLIC_PROJECT_PROPERTY_KEY = "Public"; - + /** * Represents the "Rated" project property key * @@ -289,7 +289,7 @@ public class ProjectPropertyType implements Serializable { */ public static final String ROOT_CATALOG_ID_PROJECT_PROPERTY_KEY = "Root Catalog ID"; - + /** * Represents the "Approval Required" project property key * @@ -338,13 +338,13 @@ public class ProjectPropertyType implements Serializable { * */ public static final String COPILOT_COST_PROJECT_PROPERTY_KEY = "Copilot Cost"; - + /** * Represents the "Contest Fee Percentage" project property key * */ public static final String CONTEST_FEE_PERCENTAGE_PROJECT_PROPERTY_KEY = "Contest Fee Percentage"; - + /** * Represents the "Review Feedback Flag" project property key * @@ -372,7 +372,7 @@ public class ProjectPropertyType implements Serializable { */ public static final String ALLOW_MULTIPLE_SUBMISSIONS_PROPERTY_KEY = "Allow multiple submissions"; - + /** * Represents the "CloudSpokes CMC Task" project property key. * @@ -437,9 +437,9 @@ public class ProjectPropertyType implements Serializable { public static final String REVIEW_TYPE_KEY = "Review Type"; /* - * Represent "Effort Hours Estimate" key + * Represent "Effort Days Estimate" key */ - public static final String EFFORT_HOURS_ESTIMATE = "Effort Hours Estimate"; + public static final String EFFORT_HOURS_ESTIMATE = "Effort Days Estimate"; /** * Represents the id of this instance. Only values greater than zero is diff --git a/services/client_project_entities_dao/src/java/main/com/topcoder/clients/dao/ejb3/ProjectDAOBean.java b/services/client_project_entities_dao/src/java/main/com/topcoder/clients/dao/ejb3/ProjectDAOBean.java index 2b605b317..250c6fdd8 100644 --- a/services/client_project_entities_dao/src/java/main/com/topcoder/clients/dao/ejb3/ProjectDAOBean.java +++ b/services/client_project_entities_dao/src/java/main/com/topcoder/clients/dao/ejb3/ProjectDAOBean.java @@ -82,8 +82,8 @@ *

* *

- * Version 1.3 (TC - Add effort hours field) - * - Add enable effort hours field for client + * Version 1.3 (TC - Add effort days field) + * - Add enable effort days field for client *

* *

@@ -124,7 +124,7 @@ public class ProjectDAOBean extends GenericEJB3DAO implements private static final String SELECT_PROJECT = "select p.project_id, p.name, p.po_box_number, p.description, " + " p.active, p.sales_tax, p.payment_terms_id, p.modification_user, p.modification_date, " + " p.creation_date, p.creation_user, p.is_deleted, " - + " cp.client_id, c.name as client_name, p.is_manual_prize_setting, c.code_name, c.enable_effort_hours " + + " cp.client_id, c.name as client_name, p.is_manual_prize_setting, c.code_name, c.enable_effort_days " + " from project as p left join client_project as cp on p.project_id = cp.project_id left join client c " + " on c.client_id = cp.client_id and (c.is_deleted = 0 or c.is_deleted is null) " + " where p.active = 1 and p.start_date <= current and current <= p.end_date "; @@ -135,7 +135,7 @@ public class ProjectDAOBean extends GenericEJB3DAO implements private static final String SELECT_PROJECT_BY_CLIENT_ID = "select p.project_id, p.name, p.po_box_number, p.description, " + " p.active, p.sales_tax, p.payment_terms_id, p.modification_user, p.modification_date, " + " p.creation_date, p.creation_user, p.is_deleted, " - + " cp.client_id, c.name as client_name, p.is_manual_prize_setting, c.code_name, c.enable_effort_hours " + + " cp.client_id, c.name as client_name, p.is_manual_prize_setting, c.code_name, c.enable_effort_days " + " from project as p, client_project as cp, client as c " + " where p.start_date <= current and current <= p.end_date " + " and c.client_id = cp.client_id and (p.is_deleted = 0 or p.is_deleted is null) " @@ -154,8 +154,8 @@ public class ProjectDAOBean extends GenericEJB3DAO implements + " where p.start_date <= current and current <= p.end_date " + " and c.client_id = cp.client_id and (p.is_deleted = 0 or p.is_deleted is null) " + " and p.project_id = cp.project_id "; - - + + /** * The query string used to select project by project id. * @@ -499,8 +499,8 @@ private List convertQueryToListProjects(Query query) { } if (os[16] != null) { - int enableEffortHours = Integer.parseInt(os[16].toString()); - client.setEnableEffortHours(enableEffortHours == 1 ? true : false); + int enableEffortDays = Integer.parseInt(os[16].toString()); + client.setEnableEffortDays(enableEffortDays == 1 ? true : false); } result.add(c); @@ -957,13 +957,13 @@ public List getProjectsByIds(List projectIds) throws DAOException } EntityManager entityManager = Helper.checkEntityManager(getEntityManager()); - + StringBuilder projectIdsClause = new StringBuilder(); - + projectIdsClause.append(" ("); boolean first = true; - + for(int i = 0; i < projectIds.size(); ++i) { if(projectIds.get(i) != null) { @@ -978,11 +978,11 @@ public List getProjectsByIds(List projectIds) throws DAOException } projectIdsClause.append(")"); - - + + try { String queryString = SELECT_PROJECTS_BY_IDS + projectIdsClause.toString(); - + System.out.println(queryString); Query query = entityManager.createNativeQuery(queryString); diff --git a/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java b/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java index 5b3b666b5..f6f1a3f51 100644 --- a/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java +++ b/services/client_project_entities_dao/src/java/main/com/topcoder/clients/model/Client.java @@ -95,7 +95,7 @@ public class Client extends AuditableEntity { /** *

- * This field represents the 'enableEffortHours' property of the Client. + * This field represents the 'enableEffortDays' property of the Client. *

*

* It is default to the default value of this data type when it is not @@ -103,16 +103,16 @@ public class Client extends AuditableEntity { *

*

* Through corresponding getter/setter methods. It is retrieved from - * Client.enableEffortHours [Client.isEffortHoursEnabled()] and in table - * client.enable_effort_hours. + * Client.enableEffortDays [Client.isEffortDaysEnabled()] and in table + * client.enable_effort_days. *

*

* There are no restrictions at this moment. It can take any value. * OPTIONAL. *

*/ - @Column(name = "enable_effort_hours") - private Boolean enableEffortHours; + @Column(name = "enable_effort_days") + private Boolean enableEffortDays; /** *

@@ -377,21 +377,21 @@ public void setStartDate(Date startDate) { } /** - * Gets whether this client enabled effort hours. + * Gets whether this client enabled effort days. * - * @return whether this client enabled effort hours. + * @return whether this client enabled effort days. */ - public Boolean isEffortHoursEnabled() { - return this.enableEffortHours; + public Boolean isEffortDaysEnabled() { + return this.enableEffortDays; } /** - * Sets whether this client enabled effort hours. + * Sets whether this client enabled effort days. * - * @param enableEffortHours - * whether this client enabled effort hours. + * @param enableEffortDays + * whether this client enabled effort days. */ - public void setEnableEffortHours(Boolean enableEffortHours) { - this.enableEffortHours = enableEffortHours; + public void setEnableEffortDays(Boolean enableEffortDays) { + this.enableEffortDays = enableEffortDays; } } diff --git a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java index de0fb86e7..8393eb1b5 100644 --- a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java +++ b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java @@ -918,9 +918,9 @@ *

  • Add CONTEST_PRIZE_TYPE_ID
  • * * - * Version 3.13 (Topcoder - Add effort hours field): + * Version 3.13 (Topcoder - Add effort ysfield): * * * @author snow01, pulky, murphydog, waits, BeBetter, hohosky, isv, tangzx, GreatKevin, lmmortal, minhu, GreatKevin, tangzx @@ -1229,17 +1229,17 @@ public class ContestServiceFacadeBean implements ContestServiceFacadeLocal, Cont private final static int GLOBAL_TIMELINE_NOTIFICATION = 29; private final static int GLOBAL_FORUM_WATCH = 30; - + /** * CCA Not set - * + * * @since 1.9.6 */ private final static String CONFIDENTIALITY_PUBLIC = "public"; - + /** * Standard CCA - * + * * @since 1.9.6 */ private final static String CONFIDENTIALITY_STANDARD = "standard_cca"; @@ -1720,13 +1720,13 @@ public class ContestServiceFacadeBean implements ContestServiceFacadeLocal, Cont * @since 1.9.5 */ private static ReviewAuctionType SPEC_REVIEW_TYPE; - + /** * The iterative review type. * */ private static ReviewAuctionType ITERATIVE_REVIEW_TYPE; - + /** * The iterative review type. * @@ -3381,9 +3381,9 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo // do not add approver for bug hunt and copilot posting requireApproval = false; } - + checkBillingProjectCCA(contest); - + //update the AssetDTO and update corresponding properties createUpdateAssetDTO(tcSubject, contest); @@ -3605,10 +3605,10 @@ else if (roleId == ResourceRole.RESOURCE_ROLE_OBSERVER_ID) { String cmcTaskId = contest.getProjectHeader().getProperty( ProjectPropertyType.CLOUDSPOKES_CMC_TASK_PROPERTY_KEY); String apiURL = ""; - + if(isStudio(contest)) { apiURL = "http://api.topcoder.com/v2/design/challenges/" + String.valueOf(contest.getProjectHeader().getId()); - } else { + } else { apiURL = "http://api.topcoder.com/v2/develop/challenges/" + String.valueOf(contest.getProjectHeader().getId()); } @@ -3831,7 +3831,7 @@ else if (isDevContest) contest.getProjectHeader().setProperty(ProjectPropertyType.CONFIDENTIALITY_TYPE_PROJECT_PROPERTY_KEY, "standard_cca"); contest.getProjectHeader().setProperty(ProjectPropertyType.TRACK_LATE_DELIVERABLES_PROJECT_PROPERTY_KEY, "false"); } - + if (contest.getProjectHeader().getProjectCategory().getId() == ProjectCategory.BUG_HUNT.getId()) { contest.getProjectHeader().setProperty(ProjectPropertyType.RELIABILITY_BONUS_ELIGIBLE_PROJECT_PROPERTY_KEY, "false"); @@ -4572,7 +4572,7 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCo *

    * Updates a SoftwareCompetition in the persistence. *

    - * + * * @param tcSubject TCSubject instance contains the login security info for the current user * @param contest the SoftwareCompetition to update as a contest * @param tcDirectProjectId the TC direct project id. @@ -5955,18 +5955,18 @@ public SoftwareCompetition getSoftwareContestByProjectId(TCSubject tcSubject, lo FullProjectData fullProjectData = this.projectServices.getFullProjectData(projectId); - Boolean effortHoursEnabled = false; + Boolean effortDaysEnabled = false; try { Client client = projectService.getClientByProject(fullProjectData.getProjectHeader().getTcDirectProjectId()); if (client != null) { - effortHoursEnabled = client.isEffortHoursEnabled() == null ? false : client.isEffortHoursEnabled(); + effortDaysEnabled = client.isEffortDaysEnabled() == null ? false : client.isEffortDaysEnabled(); } } catch (PersistenceFault e) { - effortHoursEnabled = false; + effortDaysEnabled = false; } - if(!effortHoursEnabled) { + if(!effortDaysEnabled) { fullProjectData.getProjectHeader().getProperties().remove(ProjectPropertyType.EFFORT_HOURS_ESTIMATE); } @@ -7401,15 +7401,15 @@ else if (autoDevCreating && isDevContest) { //it will link to design contest if it exists, it forwards to project link manager projectServices.linkDevelopmentToDesignContest(newVersionORProject.getProjectHeader().getId()); } - + SoftwareCompetition com = new SoftwareCompetition(); - + com.setProjectHeader(newVersionORProject.getProjectHeader()); com.setProjectPhases(newVersionORProject); com.setProjectResources(newVersionORProject.getResources()); com.setProjectData(newVersionORProject); com.setId(newVersionORProject.getProjectHeader().getId()); - + addReviewAuction(com); logger.debug("Exit createNewVersionForDesignDevContest"); @@ -7504,20 +7504,20 @@ public long reOpenSoftwareContest(TCSubject tcSubject, long projectId, long tcDi // persistContestEligility(reOpendedProject.getProjectHeader(), ce, false); // } persistContestEligility(reOpendedProject.getProjectHeader(), contestEligibilities, false); - - + + reOpenContestId = reOpendedProject.getProjectHeader().getId(); - + SoftwareCompetition com = new SoftwareCompetition(); - + com.setProjectHeader(reOpendedProject.getProjectHeader()); com.setProjectPhases(reOpendedProject); com.setProjectResources(reOpendedProject.getResources()); com.setProjectData(reOpendedProject); com.setId(reOpendedProject.getProjectHeader().getId()); - + addReviewAuction(com); - + return reOpenContestId; } catch (Exception e) { sessionContext.setRollbackOnly(); @@ -8392,7 +8392,7 @@ public void selectCopilot(TCSubject currentUser, long tcDirectProjectId, long co // Find the screener resource for current user; if there is none then create one com.topcoder.management.resource.Resource screener = addPrimaryScreener(currentUser, copilotPostingProjectId, currentUser.getUserId()); - + long screeningPhaseId = getScreening(softwareCompetition).getId(); // we will pass screening for all @@ -8646,7 +8646,7 @@ private boolean hasScreening(SoftwareCompetition SoftwareCompetition) return false; } - + private com.topcoder.project.phases.Phase getScreening(SoftwareCompetition SoftwareCompetition) { Set allPhases = SoftwareCompetition.getProjectPhases().getPhases(); @@ -8658,7 +8658,7 @@ private com.topcoder.project.phases.Phase getScreening(SoftwareCompetition Softw } return null; } - + private com.topcoder.project.phases.Phase getReview(SoftwareCompetition SoftwareCompetition) { Set allPhases = SoftwareCompetition.getProjectPhases().getPhases(); @@ -9087,7 +9087,7 @@ public void saveStudioSubmisionWithRankAndFeedback(TCSubject tcSubject, long pro } else { reviewData = getReview(projectId, reviewerResource.getId(), submissionId); } - + com.topcoder.project.phases.Phase targetPhase = null; for (com.topcoder.project.phases.Phase phase : phases) { if (phase.getPhaseType().getId() == phaseType.getId()) { @@ -9095,7 +9095,7 @@ public void saveStudioSubmisionWithRankAndFeedback(TCSubject tcSubject, long pro break; } } - + Scorecard scorecard = reviewData.getScorecard(); if (reviewData.getReview() == null) { // no review board yet, create a new review @@ -9246,7 +9246,7 @@ public void saveSoftwareCheckpointReviewWithRankAndFeedback(TCSubject tcSubject, * @throws ContestEligibilityPersistenceException if fail to get contest eligibility * @since 1.9.5 */ - private void addReviewAuction(SoftwareCompetition softwareCompetition) throws ReviewAuctionManagerException, ContestEligibilityPersistenceException { + private void addReviewAuction(SoftwareCompetition softwareCompetition) throws ReviewAuctionManagerException, ContestEligibilityPersistenceException { if (isStudio(softwareCompetition)) { return; } @@ -9255,7 +9255,7 @@ private void addReviewAuction(SoftwareCompetition softwareCompetition) throws Re softwareCompetition.getProjectHeader().getProjectCategory().getId())) { return; } - + boolean hasEligibility = contestEligibilityManager.haveEligibility( new Long[]{softwareCompetition.getProjectHeader().getId()}, false).size() > 0; long billingProjectId = getBillingProjectId(softwareCompetition); @@ -9291,20 +9291,20 @@ private void addReviewAuction(SoftwareCompetition softwareCompetition) throws Re reviewAuction.setAuctionType(SPEC_REVIEW_TYPE); reviewAuctionManager.createAuction(reviewAuction); } - + if (hasIterativeReview) { ReviewAuction reviewAuction = new ReviewAuction(); reviewAuction.setProjectId(softwareCompetition.getProjectHeader().getId()); reviewAuction.setAuctionType(ITERATIVE_REVIEW_TYPE); reviewAuctionManager.createAuction(reviewAuction); } - + if (hasReview) { ReviewAuction reviewAuction = new ReviewAuction(); reviewAuction.setProjectId(softwareCompetition.getProjectHeader().getId()); - - - + + + if (softwareCompetition.getProjectHeader().getProjectCategory().getId() == ProjectCategory.DEVELOPMENT.getId()) { reviewAuction.setAuctionType(DEV_REVIEW_TYPE); } else if (softwareCompetition.getProjectHeader().getProjectCategory().getId() == ProjectCategory.CODE.getId()) { @@ -9317,10 +9317,10 @@ private void addReviewAuction(SoftwareCompetition softwareCompetition) throws Re } /** * Check cca status of contest. If billing account must use cca while current property not, the change it - * + * * @param contest the contest * @throws PersistenceException - * + * * @since 1.9.6 */ private void checkBillingProjectCCA(SoftwareCompetition contest) throws PersistenceException { @@ -9338,24 +9338,24 @@ private void checkBillingProjectCCA(SoftwareCompetition contest) throws Persiste } /** * Check if the array of billing project required CCA. - * - * @param billingProjectId + * + * @param billingProjectId * @return boolean status of cca required * @throws PersistenceException if any other error occurs. - * + * * @since 1.9.6 */ public boolean requireBillingProjectCCA(long billingProjectId) throws PersistenceException { return projectManager.requireBillingProjectCCA(billingProjectId); } - + /** * Check if the array of billing project required CCA. - * + * * @param billingProjectId array of billing project id * @return array of boolean status of cca required * @throws PersistenceException if any other error occurs. - * + * * @since 1.2.5 */ public boolean[] requireBillingProjectsCCA(long[] billingProjectIds) throws PersistenceException { diff --git a/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java b/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java index 56a2b9eb9..db3b0e5fc 100644 --- a/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java +++ b/services/project_services/src/java/main/com/topcoder/project/service/impl/ProjectServicesImpl.java @@ -247,7 +247,7 @@ * Changes in v1.4.4 (TC Direct Release Assembly 7) * - add method updateContestSale for updating contest sale. *

    - * + * *

    * Version 1.4.4 (TC Direct Replatforming Release 1) Change notes: *

    *

    - * + * *

    * Version 1.4.5 (TC Direct Replatforming Release 2) Change notes: *