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 a8dc44ba1..60e78053b 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 days field) + * Version 1.3.0 (Topcoder - Add effort hours 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 Days Estimate" key + * Represent "Effort Hours Estimate" key */ - public static final String EFFORT_HOURS_ESTIMATE = "Effort Days Estimate"; + public static final String EFFORT_HOURS_ESTIMATE = "Effort Hours 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 250c6fdd8..2b605b317 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 days field) - * - Add enable effort days field for client + * Version 1.3 (TC - Add effort hours field) + * - Add enable effort hours 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_days " + + " cp.client_id, c.name as client_name, p.is_manual_prize_setting, c.code_name, c.enable_effort_hours " + " 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_days " + + " cp.client_id, c.name as client_name, p.is_manual_prize_setting, c.code_name, c.enable_effort_hours " + " 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 enableEffortDays = Integer.parseInt(os[16].toString()); - client.setEnableEffortDays(enableEffortDays == 1 ? true : false); + int enableEffortHours = Integer.parseInt(os[16].toString()); + client.setEnableEffortHours(enableEffortHours == 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 f6f1a3f51..5b3b666b5 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 'enableEffortDays' property of the Client. + * This field represents the 'enableEffortHours' 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.enableEffortDays [Client.isEffortDaysEnabled()] and in table - * client.enable_effort_days. + * Client.enableEffortHours [Client.isEffortHoursEnabled()] and in table + * client.enable_effort_hours. *

*

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

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

@@ -377,21 +377,21 @@ public void setStartDate(Date startDate) { } /** - * Gets whether this client enabled effort days. + * Gets whether this client enabled effort hours. * - * @return whether this client enabled effort days. + * @return whether this client enabled effort hours. */ - public Boolean isEffortDaysEnabled() { - return this.enableEffortDays; + public Boolean isEffortHoursEnabled() { + return this.enableEffortHours; } /** - * Sets whether this client enabled effort days. + * Sets whether this client enabled effort hours. * - * @param enableEffortDays - * whether this client enabled effort days. + * @param enableEffortHours + * whether this client enabled effort hours. */ - public void setEnableEffortDays(Boolean enableEffortDays) { - this.enableEffortDays = enableEffortDays; + public void setEnableEffortHours(Boolean enableEffortHours) { + this.enableEffortHours = enableEffortHours; } } 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 8393eb1b5..de0fb86e7 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 ysfield): + * Version 3.13 (Topcoder - Add effort hours field): * * * @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 effortDaysEnabled = false; + Boolean effortHoursEnabled = false; try { Client client = projectService.getClientByProject(fullProjectData.getProjectHeader().getTcDirectProjectId()); if (client != null) { - effortDaysEnabled = client.isEffortDaysEnabled() == null ? false : client.isEffortDaysEnabled(); + effortHoursEnabled = client.isEffortHoursEnabled() == null ? false : client.isEffortHoursEnabled(); } } catch (PersistenceFault e) { - effortDaysEnabled = false; + effortHoursEnabled = false; } - if(!effortDaysEnabled) { + if(!effortHoursEnabled) { 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/specification_review_service/test_files/insert.sql b/services/specification_review_service/test_files/insert.sql index 2ecb29c28..43ddb9d4d 100644 --- a/services/specification_review_service/test_files/insert.sql +++ b/services/specification_review_service/test_files/insert.sql @@ -1,10 +1,10 @@ INSERT INTO id_sequences(name, next_block_start, block_size, exhausted) - VALUES('resource_id_seq', 1, 1, 0); + VALUES('resource_id_seq', 1, 1, 0); INSERT INTO id_sequences(name, next_block_start, block_size, exhausted) - VALUES('notification_type_id_seq', 1, 1, 0); + VALUES('notification_type_id_seq', 1, 1, 0); INSERT INTO id_sequences(name, next_block_start, block_size, exhausted) VALUES('resource_role_id_seq', 1, 1, 0); - + INSERT INTO id_sequences(name, next_block_start, block_size, exhausted) VALUES('project_id_seq', 1, 1, 0); INSERT INTO id_sequences(name, next_block_start, block_size, exhausted) @@ -261,7 +261,7 @@ INSERT INTO phase_criteria_type_lu(phase_criteria_type_id, name, description, cr INSERT INTO phase_criteria_type_lu(phase_criteria_type_id, name, description, create_user, create_date, modify_user, modify_date) VALUES(6, 'Reviewer Number', 'Reviewer Number', 'System', CURRENT, 'System', CURRENT); INSERT INTO phase_criteria_type_lu(phase_criteria_type_id, name, description, create_user, create_date, modify_user, modify_date) - VALUES(7, 'Post-Mortem Reviewer Number', 'Post-Mortem Reviewer Number', 'System', CURRENT, 'System', CURRENT); + VALUES(7, 'Post-Mortem Reviewer Number', 'Post-Mortem Reviewer Number', 'System', CURRENT, 'System', CURRENT); INSERT INTO resource_role_lu(resource_role_id,phase_type_id,name,description, create_user,create_date,modify_user,modify_date) VALUES (1, NULL, 'Submitter', 'Submitter', 'System', '2006-11-02 20:14:24.000', 'System', '2006-11-02 20:14:24.000'); @@ -502,7 +502,7 @@ insert into project_info_type_lu(project_info_type_id, name, description, create VALUES(44, 'Post-Mortem Required', 'Post-Mortem Required', 'System', CURRENT, 'System', CURRENT); insert into project_info_type_lu(project_info_type_id, name, description, create_user, create_date, modify_user, modify_date) - VALUES(88, 'Effort Days Estimate', 'Effort Days Estimate', 'System', CURRENT, 'System', CURRENT); + VALUES(88, 'Effort Hours Estimate', 'Effort Hours Estimate', 'System', CURRENT, 'System', CURRENT); INSERT INTO submission_type_lu(submission_type_id, name, description, create_user, create_date, modify_user, modify_date) VALUES(1, 'Contest Submission', 'The contest submission', 'System', CURRENT, 'System', CURRENT); @@ -526,7 +526,7 @@ INSERT INTO deliverable_lu (deliverable_id, phase_type_id, resource_role_id, nam VALUES (25, 13, 1, 'Specification Submission', 'Specification Submission', 0, 0, 'System', CURRENT, 'System', CURRENT ); INSERT INTO deliverable_lu (deliverable_id, phase_type_id, resource_role_id, name, description, per_submission, required, create_user, create_date, modify_user, modify_date) VALUES (26, 14, 15, 'Specification Review', 'Specification Review', 1, 1, 'System', CURRENT, 'System', CURRENT ); - + INSERT INTO link_type_lu(link_type_id, link_type_name,allow_overlap) VALUES(1,'Depends On', 0); INSERT INTO link_type_lu(link_type_id, link_type_name,allow_overlap) VALUES(2,'Is Related To', 1); diff --git a/src/java/main/com/topcoder/direct/services/view/action/contest/launch/CommonAction.java b/src/java/main/com/topcoder/direct/services/view/action/contest/launch/CommonAction.java index 44550acf6..9681f6d5d 100644 --- a/src/java/main/com/topcoder/direct/services/view/action/contest/launch/CommonAction.java +++ b/src/java/main/com/topcoder/direct/services/view/action/contest/launch/CommonAction.java @@ -43,7 +43,7 @@ * *

    Version 1.2 Changes (Module Assembly - Contest Fee Based on % of Member Cost User Part): * - Modified method getBillingProjectContestFees. Added support for fee percentage. - * - If the billing is configured by percentage of member cost, the contest fee will be calculated + * - If the billing is configured by percentage of member cost, the contest fee will be calculated * - as a percentage of the member cost. *

    * @@ -57,7 +57,7 @@ * - Updates method {@link #getBillingAccountsForProject()} to return all the billing accounts of the project without * checking the billing account permission of the users. *

    - * + * *

    * Version 1.5 (Release Assembly - TopCoder Cockpit - Launch Contest Update for Marathon Match) * - New method {@link #getActiveProblemSet()} to return active problems as JSON. @@ -94,9 +94,9 @@ *

    * *

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

    *

    * @@ -166,7 +166,7 @@ public String getDirectProjectCopilots() throws Exception { Map value = new HashMap(); for (ContestCopilotDTO copilot : copilots) { value.put(String.valueOf(copilot.getUserId()), copilot.getHandle()); - + // current user is one of the copilots if(currentUserId == copilot.getUserId()) { isCurrentUser = true; @@ -281,12 +281,12 @@ public String getDirectProjectContests() { return SUCCESS; } - + /** *

    * Gets the active problems. *

    - * + * * @return the active problems. * @since 1.5 */ @@ -305,7 +305,7 @@ public String getActiveProblemSet() throws Exception { setResult(result); return SUCCESS; } - + /** *

    @@ -348,7 +348,7 @@ public String getContestConfigs() throws Exception { */ public String getBillingProjectContestFees() throws Exception { Map result = new HashMap(); - + // set the percentage info ProjectContestFeePercentage percentage = getContestFeePercentageService().getByProjectId(billingProjectId); if (percentage != null && percentage.isActive()) { @@ -383,26 +383,26 @@ public String getBillingAccountsForProject() { List billingAccountsByProject = getProjectServiceFacade().getBillingAccountsByProject(getDirectProjectId()); List> result = new ArrayList>(); - + long[] billingAccountIds = new long[billingAccountsByProject.size()]; - + for (int i = 0; i < billingAccountIds.length; i++){ billingAccountIds[i] = billingAccountsByProject.get(i).getId(); } - + boolean[] requireCCAs = getContestServiceFacade().requireBillingProjectsCCA(billingAccountIds); - + for (int i = 0; i < billingAccountIds.length; i++){ Map billingAccount = new HashMap(); billingAccount.put("id", String.valueOf(billingAccountsByProject.get(i).getId())); billingAccount.put("name", billingAccountsByProject.get(i).getName()); billingAccount.put("cca", String.valueOf(requireCCAs[i])); - // Add enableEffortDays for each billing account + // Add enableEffortHours for each billing account Client client = billingAccountsByProject.get(i).getClient(); - if (client != null && client.isEffortDaysEnabled() != null) { - billingAccount.put("enableEffortDays", client.isEffortDaysEnabled()); + if (client != null && client.isEffortHoursEnabled() != null) { + billingAccount.put("enableEffortHours", String.valueOf(client.isEffortHoursEnabled())); } else { - billingAccount.put("enableEffortDays", false); + billingAccount.put("enableEffortHours", "false"); } result.add(billingAccount); @@ -440,7 +440,7 @@ public String getCurrentUserRecentProjects() { return SUCCESS; } - + /** *

    * Gets the billing project information. diff --git a/src/java/main/com/topcoder/direct/services/view/action/contest/launch/GetContestAction.java b/src/java/main/com/topcoder/direct/services/view/action/contest/launch/GetContestAction.java index 44000429a..40b39123a 100644 --- a/src/java/main/com/topcoder/direct/services/view/action/contest/launch/GetContestAction.java +++ b/src/java/main/com/topcoder/direct/services/view/action/contest/launch/GetContestAction.java @@ -171,7 +171,7 @@ * *

    * - *

    + *

    * Version 2.2 BUGR-8788 (TC Cockpit - New Client Billing Config Type) change notes: *

      *
    • change on {@link #billingAccountsForProject} to suuport CCA related for billing account
    • @@ -256,20 +256,20 @@ *
    • Added regEndDate property
    • *
    *

    - * + * *

    * Version 3.3 - Topcoder - Remove JIRA Issues Related Functionality In Direct App v1.0 * - remove JIRA related functionality *

    - * + * *

    * Version 3.4 - Quick72Hrs!! Topcoder - Remove VM Management Feature In Direct App version 1.0 * - remove VM related functionality *

    * *

    - * Version 3.5 - Topcoder - Add effort days field - * - add enable effort days + * Version 3.5 - Topcoder - Add effort hours field + * - add enable effort hours *

    * * @author fabrizyo, FireIce, isv, morehappiness, GreatKevin, minhu, Veve, Ghost_141, GreatKevin, Veve, GreatKevin, TCSCODER @@ -557,9 +557,9 @@ protected void executeAction() throws Exception { // set billing accounts for the direct project List billingProjects = getProjectServiceFacade().getBillingAccountsByProject(softwareCompetition.getProjectHeader().getTcDirectProjectId()); - + long[] billingAccountIds = new long[billingProjects.size()]; - + for (int i = 0; i < billingAccountIds.length; i++){ billingAccountIds[i] = billingProjects.get(i).getId(); } @@ -569,12 +569,12 @@ protected void executeAction() throws Exception { billingAccount.put("id", String.valueOf(billingProjects.get(i).getId())); billingAccount.put("name", billingProjects.get(i).getName()); billingAccount.put("cca", String.valueOf(requireCCAs[i])); - // Add enableEffortDays for each billing account + // Add enableEffortHours for each billing account Client client = billingProjects.get(i).getClient(); - if (client != null && client.isEffortDaysEnabled() != null) { - billingAccount.put("enableEffortDays", client.isEffortDaysEnabled()); + if (client != null && client.isEffortHoursEnabled() != null) { + billingAccount.put("enableEffortHours", String.valueOf(client.isEffortHoursEnabled())); } else { - billingAccount.put("enableEffortDays", false); + billingAccount.put("enableEffortHours", "false"); } billingAccountsForProject.add(billingAccount); } @@ -634,7 +634,7 @@ public String specReviewScheduled() { } return SUCCESS; } - + /** *

    * Gets the project id. diff --git a/src/web/WEB-INF/contest-details2.jsp b/src/web/WEB-INF/contest-details2.jsp index d0566f3d8..99d586f79 100644 --- a/src/web/WEB-INF/contest-details2.jsp +++ b/src/web/WEB-INF/contest-details2.jsp @@ -135,7 +135,7 @@ billingAccounts.push({"id": "", "name" : "", "cca" : "", - "enableEffortDays" : "" + "enableEffortDays" : "" }); diff --git a/src/web/scripts/launch/contestDetail.js b/src/web/scripts/launch/contestDetail.js index fce3c42ff..5d9233e15 100644 --- a/src/web/scripts/launch/contestDetail.js +++ b/src/web/scripts/launch/contestDetail.js @@ -337,8 +337,8 @@ function populateTypeSection() { $('#challegneCreatorLabel').html(mainWidget.competition.contestData.challengeCreator); $('#rChallengeCreator').html(mainWidget.competition.contestData.challengeCreator); - $('#effortDaysEstimate').html(mainWidget.competition.contestData.projectHeader.properties['Effort Days Estimate']); - $('#rEffortDaysEstimate').html(mainWidget.competition.contestData.projectHeader.properties['Effort Days Estimate']); + $('#effortDaysEstimate').html(mainWidget.competition.contestData.projectHeader.properties['Effort Hours Estimate']); + $('#rEffortDaysEstimate').html(mainWidget.competition.contestData.projectHeader.properties['Effort Hours Estimate']); if(isBillingEditable()) { $('#billingAccountDivEdit').show(); diff --git a/src/web/scripts/launch/contestDetailSoftware.js b/src/web/scripts/launch/contestDetailSoftware.js index 172b57fbb..cd98eb744 100644 --- a/src/web/scripts/launch/contestDetailSoftware.js +++ b/src/web/scripts/launch/contestDetailSoftware.js @@ -890,7 +890,7 @@ function initContest(contestJson) { mainWidget.softwareCompetition.regEndDate = parseDate(contestJson.regEndDate); $('#contestTypeNameText').text(getProjectCategoryById(mainWidget.softwareCompetition.projectHeader.projectCategory.id).name); - mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate'] = contestJson.properties['Effort Days Estimate']; + mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] = contestJson.properties['Effort Hours Estimate']; // copilots var copilots = contestJson.copilots; // get copilots data from result @@ -1437,7 +1437,8 @@ function populateTypeSection() { $(".matchRoundId").show(); } - var effortDaysEstimate = parseFloat(p['Effort Days Estimate']); + // change to days + var effortDaysEstimate = parseFloat(p['Effort Hours Estimate']) / 24; if (!isNaN(effortDaysEstimate) && effortDaysEstimate > 0 ) { $('#rEffortDaysEstimate').text(parseFloat(effortDaysEstimate)); $('input[name=effortDaysEstimate]').val(effortDaysEstimate); @@ -3633,7 +3634,7 @@ function handleProjectDropDownChange() { $.each(billingAccounts, function(key, value) { var _cca = value["cca"] == "true" ? true : false; - var _enableEffortDays = value["enableEffortDays"] == "true" ? true : false; + var _enableEffortDays = value["enableEffortHours"] == "true" ? true : false; $("#billingProjects").append($('').val(value["id"]).text(value["name"]).data("cca", _cca).data("enableEffortDays", _enableEffortDays)); }); $("#chkboxCCA").removeAttr('checked'); diff --git a/src/web/scripts/launch/main.js b/src/web/scripts/launch/main.js index 20f56200f..41bcb2fb6 100644 --- a/src/web/scripts/launch/main.js +++ b/src/web/scripts/launch/main.js @@ -1195,10 +1195,11 @@ function saveAsDraftRequest() { } if($(".effortEstimateRow").is(":visible")) { - var effortDaysEstimate = $("input[name=effortDaysEstimate]").val(); - mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate'] = effortDaysEstimate; + var effortDaysEstimate = $("input[name=effortDaysEstimate]").val().trim(); + if (effortDaysEstimate.length > 0) effortDaysEstimate *= 24; + mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] = effortDaysEstimate; } else { - mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate'] = ''; + mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] = ''; } /* diff --git a/src/web/scripts/launch/pages/orderReview.js b/src/web/scripts/launch/pages/orderReview.js index 5b64846b5..5aacdfc79 100644 --- a/src/web/scripts/launch/pages/orderReview.js +++ b/src/web/scripts/launch/pages/orderReview.js @@ -70,9 +70,11 @@ function updateOrderReviewAlgorithm() { $('#alorProject').html($("#projects option[value="+ mainWidget.softwareCompetition.projectHeader.tcDirectProjectId +"]").text()); $('#alorBillingAccount').html((billingProjectId == -1)?"(not selected)":$("#billingProjects option[value="+ billingProjectId +"]").text()); - - $('#alorEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate']); - + if (mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'].toString().length > 0) { + $('#alorEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] / 24 ); + } else { + $('#alorEffortDaysEstimate').html(""); + } $('#alorStartDate').html(formatDateForReview(mainWidget.softwareCompetition.assetDTO.directjsProductionDate)); //points @@ -144,7 +146,11 @@ function updateOrderReviewSoftware() { $('#sworContestName').html(mainWidget.softwareCompetition.assetDTO.name); $('#sworProjectName').html($("#projects option[value="+ mainWidget.softwareCompetition.projectHeader.tcDirectProjectId +"]").text()); $('#sworBillingAccount').html($("#billingProjects option[value="+ billingProjectId +"]").text()); - $('#sworEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate']); + if (mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'].toString().length > 0) { + $('#sworEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] / 24); + } else { + $('#sworEffortDaysEstimate').html(""); + } $('#sworStartDate').html(formatDateForReview(mainWidget.softwareCompetition.assetDTO.directjsProductionDate)); //points @@ -296,8 +302,11 @@ function updateOrderReviewStudio() { $('#orBillingAccount').html((billingProjectId == -1)?"(not selected)":$("#billingProjects option[value="+ billingProjectId +"]").text()); - $('#orEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate']); - + if (mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'].toString().length > 0) { + $('#orEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] / 24 ); + } else { + $('#orEffortDaysEstimate').html(""); + } $('#orStartDate').html(formatDateForReview(mainWidget.softwareCompetition.assetDTO.directjsProductionDate)); //points diff --git a/src/web/scripts/launch/pages/review.js b/src/web/scripts/launch/pages/review.js index 68c9a6d6e..9591990e6 100644 --- a/src/web/scripts/launch/pages/review.js +++ b/src/web/scripts/launch/pages/review.js @@ -43,7 +43,11 @@ function updateReviewAlgorithm() { var billingProjectId = mainWidget.softwareCompetition.projectHeader.getBillingProject(); $('#ralBillingAccount').html((billingProjectId == -1)?" ":$("#billingProjects option[value="+ billingProjectId +"]").text()); - $('#ralEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate']); + if (mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'].toString().length > 0) { + $('#ralEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] / 24); + } else { + $('#ralEffortDaysEstimate').html(""); + } $('#ralStartDate').html(formatDateForReview(mainWidget.softwareCompetition.assetDTO.directjsProductionDate)); // to do @@ -89,9 +93,11 @@ function updateReviewSoftware() { var billingProjectId = mainWidget.softwareCompetition.projectHeader.getBillingProject(); $('#rswBillingAccount').html((billingProjectId == -1)?" ":$("#billingProjects option[value="+ billingProjectId +"]").text()); - - $('#rswEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate']); - + if (mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'].toString().length > 0) { + $('#rswEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] / 24); + } else { + $('#rswEffortDaysEstimate').html(""); + } $('#rswStartDate').html(formatDateForReview(mainWidget.softwareCompetition.assetDTO.directjsProductionDate)); $('#rswDetailedRequirements').html(mainWidget.softwareCompetition.projectHeader.projectSpec.detailedRequirements); @@ -248,8 +254,11 @@ function updateReviewStudio() { } else { $("#reviewPage .maxSubmissions").show(); } - - $('#rEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate']); + if (mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'].toString().length > 0) { + $('#rEffortDaysEstimate').html(mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] / 24); + } else { + $('#rEffortDaysEstimate').html(""); + } } /** diff --git a/src/web/scripts/launch/pages/selection.js b/src/web/scripts/launch/pages/selection.js index 36e2b4a3e..e7881b096 100644 --- a/src/web/scripts/launch/pages/selection.js +++ b/src/web/scripts/launch/pages/selection.js @@ -120,7 +120,7 @@ function initCompetitionSelectionCommonData() { var tcProjectId = parseInt($('select#projects').val()); var billingProjectId = parseInt($('select#billingProjects').val()); var isMultiRound = hasMultiRound(categoryId) && ('multi' == $('#roundTypes').val()); - var effortDaysEstimate = $('input#effortDaysEstimate').val(); + var effortDaysEstimate = $('input#effortDaysEstimate').val().trim(); // apply category id data var projectCategory = getProjectCategoryById(categoryId); @@ -143,7 +143,9 @@ function initCompetitionSelectionCommonData() { mainWidget.softwareCompetition.projectHeader.setProjectName(contestName); mainWidget.softwareCompetition.multiRound = isMultiRound; - mainWidget.softwareCompetition.projectHeader.properties['Effort Days Estimate'] = effortDaysEstimate; + // change to hours + if (effortDaysEstimate.length > 0) effortDaysEstimate *= 24; + mainWidget.softwareCompetition.projectHeader.properties['Effort Hours Estimate'] = effortDaysEstimate; } function validateFieldsContestSelectionAlgorithm() { diff --git a/src/web/scripts/launchcontest.js b/src/web/scripts/launchcontest.js index 388b0e8cd..e63914c27 100644 --- a/src/web/scripts/launchcontest.js +++ b/src/web/scripts/launchcontest.js @@ -658,8 +658,8 @@ function handleProjectDropDownChange() { $.each(billingAccounts, function(key, value) { - - $("#billingProjects").append($('').val(value["id"]).html(value["name"]).data("cca", (value["cca"] == "true" ? true : false)).data("enableEffortDays", value["enableEffortDays"])); + var _enableEffortDays = value["enableEffortHours"] == "true" ? true : false; + $("#billingProjects").append($('').val(value["id"]).html(value["name"]).data("cca", (value["cca"] == "true" ? true : false)).data("enableEffortDays", _enableEffortDays)); if(value["id"] == $("input[name=CMCBillingID]").val()) { CMCBillingExisting = true;