r387 - in trunk: chorem-entities/src/main/java/org/chorem/entities chorem-entities/src/main/java/org/chorem/project chorem-webmotion/src/main/java/org/chorem/webmotion/actions chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project
Author: meynier Date: 2013-08-16 11:07:56 +0200 (Fri, 16 Aug 2013) New Revision: 387 Url: http://chorem.org/projects/chorem/repository/revisions/387 Log: Cleaned the code Removed: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/Extensions.java Modified: trunk/chorem-entities/src/main/java/org/chorem/entities/QuotationStatus.java trunk/chorem-entities/src/main/java/org/chorem/project/AdcCalculation.java trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java trunk/chorem-entities/src/main/java/org/chorem/project/TaskCalculation.java trunk/chorem-entities/src/main/java/org/chorem/project/TotalQuotationCalculation.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdcDashboardAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/EmployeeEditAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/QuotationStatusAction.java trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/TaskData.java Modified: trunk/chorem-entities/src/main/java/org/chorem/entities/QuotationStatus.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/entities/QuotationStatus.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-entities/src/main/java/org/chorem/entities/QuotationStatus.java 2013-08-16 09:07:56 UTC (rev 387) @@ -41,6 +41,19 @@ DELIVERED, // developpement fini et livre (on peut envoyer la facture de fin) RSV, // l'application est en verification en service regulier chez le client (~1 mois) WARRANTY, // fin de la vsr, on passe en garantie et on peut facture le reste (s'il reste encore des choses) - CLOSED // tout est fini et clos, plus rien a faire + CLOSED; // tout est fini et clos, plus rien a faire + String[] extensions = { + "Quotation", + "Draft", + "Sent", + "Rejected", + "Accepted", + "Started", + "Delivered", + "RSV", + "Warranty", + "Closed", + "Cancelled" + }; } Modified: trunk/chorem-entities/src/main/java/org/chorem/project/AdcCalculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/AdcCalculation.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-entities/src/main/java/org/chorem/project/AdcCalculation.java 2013-08-16 09:07:56 UTC (rev 387) @@ -18,6 +18,7 @@ import org.nuiton.wikitty.query.WikittyQuery; import org.nuiton.wikitty.query.WikittyQueryMaker; import org.nuiton.wikitty.query.WikittyQueryResult; +import org.nuiton.wikitty.query.conditions.Aggregate; /** * Makes the calculation for the adc. @@ -72,7 +73,7 @@ /** * Initiate the start and end date to the beginning and end of the year - * TODO : Manage this in the configuration of chorem + * TODO : Manage this in the admin configuration of chorem */ protected void initDate() { Calendar cstart = new GregorianCalendar(); @@ -110,6 +111,8 @@ //Construct the query WikittyQuery expenseQuery = new WikittyQueryMaker() + .select() + .sum(FinancialTransaction.ELEMENT_FIELD_FINANCIALTRANSACTION_AMOUNT) .and() .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION) //of type financial transaction .or() @@ -120,34 +123,42 @@ //The payment hapened during the year .bw(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, start, end) .end(); + System.out.println("QUERY = " + expenseQuery); - WikittyQueryResult<FinancialTransaction> result = client.findAllByQuery(FinancialTransaction.class, expenseQuery); - + //WikittyQueryResult<FinancialTransaction> result = client.findAllByQuery(FinancialTransaction.class, expenseQuery); + Double result = client.findByQuery(Double.class, expenseQuery); //Calculates the total - double total = 0; - for(FinancialTransaction ft : result.getAll()) { + double total = result; + System.out.println("RESULT = " + result); + /*for(FinancialTransaction ft : result.getAll()) { total += ft.getAmount(); - } + }*/ return total; } /** - * Calculates the employee cost at full time - * @return + * Calculates the employee cost at full time. + * + * @param e employee concerned + * @return employee cost at full time */ public double getMonthlyFullTimeCost(EmployeeHR e) { double salary = e.getSalary(); double otherPayments = e.getOtherPayments(); double partialTime = e.getPartialTime(); - return ( ( salary + otherPayments) * (partialTime/100) ); + return ( ( salary + otherPayments) * 100 ) / partialTime; } /** - * calculates the estimated number of prodctive days when the employee will work - * @return + * calculates the estimated number of productive days when the employee will work + * + * It takes the average number of days in a year (218) and multiplicates it by the partial time + * and the productivity rate + * @param e employee concerned + * @return estimated number of productive days */ public double getEstimatedNumberOfProductiveDays(EmployeeHR e) { int daysInYear = 218; //It would be *much* better to calculate this or at least get it from input @@ -159,7 +170,7 @@ /** * Returns the real number of procuctive days in year, which is the sum of all the time object by the employee - * @param e + * @param e employee concerned * @return */ public double getRealNumberOfProductiveDays(EmployeeHR e) { @@ -213,6 +224,7 @@ double total = 0; for(EmployeeHR e : getEmployeesHR()) { total += getYearCost(e, real); + System.out.println("total = " + total); } return total; } @@ -267,8 +279,9 @@ } /** - * Returns the employee's adc - * @return + * Returns the employee's adc. + * See the documentation for a complete description of the operations made during this calculation. + * @return the employee's adc */ public double getAdc(boolean real) { @@ -285,47 +298,23 @@ double cost = getYearCost(employee, real); double totalCost = getTotalYearCost(real); - System.out.println("EXPENSES : " + expenses); - System.out.println("PROD DAYS : " + productiveDays); - System.out.println("COST : " + expenses); - System.out.println("TOTAL COST : " + expenses); - double adc = ( (expenses * cost) / totalCost ) / productiveDays; return adc; } - public double getAdc() { - return getAdc(false); - } - public Map<String, Double> getMultipleAdc() { - return getMultipleAdc(false); - } /** * Returns multiple adc form the given employee list. * @param client * @param employees - * @return + * @return adc of the employees */ public Map<String, Double> getMultipleAdc(boolean real) { if(employees.size() == 0) return null; - Calendar cend = new GregorianCalendar(); - cend.add(Calendar.YEAR, -1); - cend.set(Calendar.MONTH, Calendar.DECEMBER); - cend.set(Calendar.DAY_OF_MONTH, 31); - - Calendar cstart = new GregorianCalendar(); - cstart.add(Calendar.YEAR, -1); - cstart.set(Calendar.MONTH, Calendar.JANUARY); - cstart.set(Calendar.DAY_OF_MONTH, 1); - - Date start = cstart.getTime(); - Date end = cend.getTime(); - //Calculate all the "static" values before double expenses = getTotalExpenses(); @@ -359,10 +348,4 @@ } - - - - - - } Modified: trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-entities/src/main/java/org/chorem/project/Calculation.java 2013-08-16 09:07:56 UTC (rev 387) @@ -1,6 +1,7 @@ package org.chorem.project; import java.util.HashMap; +import java.util.Map; import java.util.Set; import org.chorem.ChoremClient; @@ -72,26 +73,30 @@ /** * Calculates the real number of days from the Time objects. - * @return + * @return real number of days needed for the project/task */ public abstract double realDays(); /** * Return the times (in hour) per employee for the current object - * @return + * @return time spent on the project/task (per Employee) */ - protected abstract HashMap<Employee, Double> getTimes(); + protected abstract Map<Employee, Double> getTimes(); /** * Return the percentages for the current object - * @return + * @return estimated time spent on the project/task (per Employee, in percentage) */ - protected abstract HashMap<Employee, Double> getPercentages(); + protected abstract Map<Employee, Double> getPercentages(); - public HashMap<Employee, Double> getTimePercentages() { - HashMap<Employee, Double> times = getTimes(); - HashMap<Employee, Double> timePercentages = new HashMap<Employee, Double>(); + /** + * Calculates the percentage of time spent on the project/task + * @return time spent on the project/task (per Employee, in percentage) + */ + public Map<Employee, Double> getTimePercentages() { + Map<Employee, Double> times = getTimes(); + Map<Employee, Double> timePercentages = new HashMap<Employee, Double>(); double sum = 0; Set<Employee> keySet = times.keySet(); for (Employee key : keySet) { @@ -106,12 +111,12 @@ } /** * Return the average Return for all the employees, ponderated by the percentages - * @return + * @return average estimated return */ public double avgReturn() { //Fetch the percentages per employee - HashMap<Employee, Double> percentages = getPercentages(); + Map<Employee, Double> percentages = getPercentages(); if(percentages.size() == 0) { return client.getConfiguration().getDailyReturn(); } @@ -126,10 +131,10 @@ /** * Calculates the real daily return from the different times object and the daily return of the employees. - * @return + * @return real average return */ public double realReturn() { - HashMap<Employee, Double> times = getTimes(); + Map<Employee, Double> times = getTimes(); if(times.size() == 0) { return client.getConfiguration().getDailyReturn(); } @@ -139,9 +144,6 @@ double srp = client.getDailyReturn(key); double hoursPerDay = client.getDailyHoursWorked(key); - //TODO :Find a way to use the different work hours - - //} realReturn += srp* ( times.get(key) / hoursPerDay ) ; } realReturn = realReturn/getRealDays(); @@ -160,8 +162,8 @@ /** - * Gives the difference between the real number of days and the estimated value - * @return + * Gives the difference between the real number of days and the estimated value of days spent + * @return difference between estimation and real time */ public double deltaDays() { return getRealDays() - nbDays; @@ -169,7 +171,7 @@ /** * Calculates the real ADR from the real number of days. - * @return + * @return real adr */ public double realAdr() { double realDays = getRealDays(); @@ -179,7 +181,7 @@ /** * Profit calculated from the estimated ADR and the estimated numer of days - * @return + * @return expected profit */ public double expectedProfit() { return amount - (nbDays*getAvgReturn()); @@ -187,15 +189,16 @@ /** * Real profit (or loss) done when the quotation is closed. - * @return + * @return real profit (or loss) */ public double lossOrProfit() { return amount - (getRealDays() * getRealReturn()); } /** - * Average profit/loss per day - * @return + * Average profit/loss per day. + * It is not currently used in the dashboards. + * @return average profit (or loss) per day */ public double resultPerDay() { return getLossOrProfit() / getRealDays(); Modified: trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-entities/src/main/java/org/chorem/project/QuotationCalculation.java 2013-08-16 09:07:56 UTC (rev 387) @@ -2,6 +2,7 @@ import java.util.HashMap; import java.util.List; +import java.util.Map; import org.chorem.ChoremClient; import org.chorem.entities.Employee; @@ -11,8 +12,13 @@ public class QuotationCalculation extends Calculation<Quotation> { - private List<Task> tasks = null; + protected List<Task> tasks = null; + /** + * Initiate the calculation class + * @param q quotation + * @param client chorem client + */ public QuotationCalculation(Quotation q, ChoremClient client) { super(q, q.getAmount(), q.getEstimatedDays(), client); } @@ -30,8 +36,8 @@ } @Override - public HashMap<Employee, Double> getPercentages() { - HashMap<Employee, Double> percentages = new HashMap<Employee, Double>(); + public Map<Employee, Double> getPercentages() { + Map<Employee, Double> percentages = new HashMap<Employee, Double>(); double totalDays = 0; for(Task t : getTasks()) totalDays += t.getEstimatedDays(); @@ -39,7 +45,7 @@ List<Task> tasks = getTasks(); for(Task t : tasks) { - HashMap<Employee, Double> taskPercentages = new TaskCalculation(t, client).getPercentages(); + Map<Employee, Double> taskPercentages = new TaskCalculation(t, client).getPercentages(); for(Employee emp : taskPercentages.keySet()) { double rate = (t.getEstimatedDays()/totalDays); if(percentages.containsKey(emp)) { @@ -53,22 +59,18 @@ } } - //Caluculate the average for each employee - /*Set<Employee> keySet = percentages.keySet(); - for(Employee emp : keySet) { - percentages.put(emp, percentages.get(emp)/tasks.size()); - }*/ + return percentages; } @Override - public HashMap<Employee, Double> getTimes() { + public Map<Employee, Double> getTimes() { HashMap<Employee, Double> times = new HashMap<Employee, Double>(); for(Task t : getTasks()) { - HashMap<Employee, Double> taskPercentages = new TaskCalculation(t, client).getTimes(); + Map<Employee, Double> taskPercentages = new TaskCalculation(t, client).getTimes(); for(Employee emp : taskPercentages.keySet()) { if(times.containsKey(emp)) { times.put(emp, times.get(emp) + taskPercentages.get(emp)); @@ -85,8 +87,8 @@ } /** - * Fetch the tasks of the quotation keep a reference - * @return + * Fetch the tasks of the quotation and keep a reference + * @return lits of the quotation's task */ public List<Task> getTasks() { if(tasks == null) Modified: trunk/chorem-entities/src/main/java/org/chorem/project/TaskCalculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/TaskCalculation.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-entities/src/main/java/org/chorem/project/TaskCalculation.java 2013-08-16 09:07:56 UTC (rev 387) @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.Map; import org.chorem.ChoremClient; import org.chorem.ChoremUtil; @@ -53,8 +54,8 @@ } @Override - protected HashMap<Employee, Double> getPercentages() { - HashMap<Employee, Double> pct = new HashMap<Employee, Double>(); + protected Map<Employee, Double> getPercentages() { + Map<Employee, Double> pct = new HashMap<Employee, Double>(); //get all the Worker objects WikittyQuery workerQuery = new WikittyQueryMaker() .eq(Worker.ELEMENT_FIELD_WORKER_TASK, e) @@ -72,8 +73,8 @@ } @Override - protected HashMap<Employee, Double> getTimes() { - HashMap<Employee, Double> times = new HashMap<Employee, Double>(); + protected Map<Employee, Double> getTimes() { + Map<Employee, Double> times = new HashMap<Employee, Double>(); Modified: trunk/chorem-entities/src/main/java/org/chorem/project/TotalQuotationCalculation.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/project/TotalQuotationCalculation.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-entities/src/main/java/org/chorem/project/TotalQuotationCalculation.java 2013-08-16 09:07:56 UTC (rev 387) @@ -1,7 +1,7 @@ package org.chorem.project; -import java.util.HashMap; import java.util.List; +import java.util.Map; import org.chorem.entities.Employee; import org.chorem.entities.Quotation; @@ -9,7 +9,9 @@ /** * Calculates the total values of the quotation calculations * Usage : construct the cobject by sending the list of quotation in parameter, then you can get the totals - * by using the total* methdds. + * by using the total methods. + * Fore the totalAmount and the total estimated days, juste call the getAmount and getEstimatedDays functions, + * as it is calculated during the object's initialisation. * @author gwenn * */ @@ -18,20 +20,20 @@ /** * List of quotation calculation */ - private List<QuotationCalculation> calculations; + protected List<QuotationCalculation> calculations; /** - * - * @param calculations list of calculation used to calculate the total. + * Initiates the calculation object by calculating the total amount and the total estimated days + * @param calculations list of QuotationCalculation objects used to calculate the total. */ public TotalQuotationCalculation(List<QuotationCalculation> calculations) { super(null, totalAmount(calculations), totalEstimatedDays(calculations), null); - //super(q, q.getAmount(), q.getEstimatedDays(), client); this.calculations = calculations; } /** - * + * Calculates the total amount of all the quotations + * This is a method called on initialisation. It shouldn't be called in any other context. * @param calculations * @return total amount */ @@ -45,9 +47,10 @@ } /** - * + * Calculates the total estimatedDays + * This is a method called on initialisation. It shouldn't be called in any other context. * @param calculations - * @return + * @return estimated days. */ private static double totalEstimatedDays(List<QuotationCalculation> calculations) { double total = 0; @@ -121,22 +124,24 @@ + /* + * Those following methods should'nt be called + */ - @Override - public HashMap<Employee, Double> getPercentages() { + public Map<Employee, Double> getPercentages() { return null; } @Override - public HashMap<Employee, Double> getTimePercentages() { + public Map<Employee, Double> getTimePercentages() { return null; } @Override - public HashMap<Employee, Double> getTimes() { + public Map<Employee, Double> getTimes() { return null; } Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdcDashboardAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdcDashboardAction.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdcDashboardAction.java 2013-08-16 09:07:56 UTC (rev 387) @@ -68,7 +68,6 @@ - // simply return them return renderView("dashboardAdc.jsp", "employees", employees, "from", from, @@ -117,7 +116,7 @@ /** - * Structure used to store information about an employee Used for the AJAX + * Structure used to store information about an employee. Used for the AJAX * request * * @author gwenn @@ -145,7 +144,7 @@ } /** - * Structure used to store information about an employee used for the + * Structure used to store information about an employee. used for the * standard http request * * @author gwenn Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/EmployeeEditAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/EmployeeEditAction.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/EmployeeEditAction.java 2013-08-16 09:07:56 UTC (rev 387) @@ -2,7 +2,6 @@ import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -16,6 +15,7 @@ import org.chorem.entities.ADC; import org.chorem.entities.ADCImpl; import org.chorem.entities.Company; +import org.chorem.entities.CompanyHR; import org.chorem.entities.CompanyImpl; import org.chorem.entities.Employee; import org.chorem.entities.EmployeeHR; @@ -93,8 +93,8 @@ Map<String, Object> params = call.getExtractParameters(); for(String key : params.keySet()) { //Prevent false data - if((key.equals("CompanyHR.dailyReturn") - || key.equals("CompanyHR.dailyHoursWorked"))) { + if((key.equals(CompanyHR.FQ_FIELD_COMPANYHR_DAILYRETURN) + || key.equals(CompanyHR.FQ_FIELD_COMPANYHR_DAILYHOURSWORKED))) { try { double value = Double.parseDouble(((String[])params.get(key))[0]); w.setFqField(key, value); @@ -111,7 +111,7 @@ if(addExtension != null && addExtension.equals("true")) { Wikitty w = client.restore(company.getWikittyId()); - w.addExtension(client.restoreExtensionLastVersion("CompanyHR")); + w.addExtension(client.restoreExtensionLastVersion(CompanyHR.EXT_COMPANYHR)); client.store(w); } @@ -221,8 +221,8 @@ */ public Render editEmployeeValues(ChoremClient client, String employeeId, String salaryStr , String productivityRateStr, String partialTimeStr, String dailyReturnStr, String otherPaymentsStr) { + Render render = null; Wikitty employeeWikitty = client.restore(employeeId); - Employee employee = new EmployeeImpl(employeeWikitty); if(!employeeWikitty.hasExtension(EmployeeHR.EXT_EMPLOYEEHR)) { employeeWikitty.addExtension(client.restoreExtensionLastVersion(EmployeeHR.EXT_EMPLOYEEHR)); } @@ -273,32 +273,37 @@ if(partialTime > 100 || partialTime < 0) { errors.add(new ErrorJson("partialTime", "Partial time must be between 0 and 100")); } - if(errors.size() != 0) - return renderJSON("data", "error", "errors", errors); + + + + if(errors.size() != 0) { + render = renderJSON("data", "error", "errors", errors); + } + else { + if(salary != 0) + employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_SALARY, salary); + employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_PRODUCTIVITYRATE, productivityRate); + employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_PARTIALTIME, partialTime); + employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_DAILYRETURN, dailyReturn); + employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_OTHERPAYMENTS, otherPayments); + client.store(employeeWikitty); - if(salary != 0) - employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_SALARY, salary); - employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_PRODUCTIVITYRATE, productivityRate); - employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_PARTIALTIME, partialTime); - employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_DAILYRETURN, dailyReturn); - employeeWikitty.setFqField(EmployeeHR.FQ_FIELD_EMPLOYEEHR_OTHERPAYMENTS, otherPayments); - client.store(employeeWikitty); + EmployeeData data = new EmployeeData(new EmployeeImpl(employeeWikitty), client); - EmployeeData data = new EmployeeData(new EmployeeImpl(employeeWikitty), client); + EmployeeJson json = new EmployeeJson( + data.getSalary() + "", + data.getProductivityRate(), + data.getPartialTime(), + data.getDailyReturn(), + data.getDailyHoursWorked(), + data.getOtherPayments() + ); + render = renderJSON("data", json); + } + return render; - EmployeeJson json = new EmployeeJson( - data.getSalary() + "", - data.getProductivityRate(), - data.getPartialTime(), - data.getDailyReturn(), - data.getDailyHoursWorked(), - data.getOtherPayments() - ); - - return renderJSON("data", json); - } /** @@ -349,7 +354,7 @@ * @author gwenn * */ - public class EmployeeData implements Comparable{ + public class EmployeeData implements Comparable<EmployeeData>{ private Employee e; private String salary; @@ -413,8 +418,7 @@ } @Override - public int compareTo(Object o) { - EmployeeData e = (EmployeeData)o; + public int compareTo(EmployeeData e) { return this.getObject().getPerson(false).getLastName().compareTo(e.getObject().getPerson(false).getLastName()); } Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/DashboardProjectAction.java 2013-08-16 09:07:56 UTC (rev 387) @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.apache.commons.logging.Log; @@ -25,10 +26,8 @@ import org.chorem.entities.Project; import org.chorem.entities.Task; import org.chorem.entities.Time; -import org.chorem.entities.Worker; import org.chorem.project.QuotationCalculation; import org.chorem.project.TotalQuotationCalculation; -import org.nuiton.wikitty.entities.Wikitty; import org.nuiton.wikitty.query.WikittyQuery; import org.nuiton.wikitty.query.WikittyQueryMaker; import org.nuiton.wikitty.query.WikittyQueryResult; @@ -56,7 +55,7 @@ WikittyQuery quotationQuery = new WikittyQueryMaker().ideq(quotationFilter).end(); WikittyQueryResult<Quotation> quotationResult = client.findAllByQuery(Quotation.class, quotationQuery); - HashMap<Project, List<QuotationData>> projectData = new HashMap<Project, List<QuotationData>>(); + Map<Project, List<QuotationData>> projectData = new HashMap<Project, List<QuotationData>>(); //If some quotation has been found if(quotationResult != null && quotationResult.size() != 0) { @@ -95,7 +94,7 @@ WikittyQueryResult<Quotation> quotationResult = null; - HashMap<Project, List<QuotationData>> projectData = new HashMap<Project, List<QuotationData>>(); + Map<Project, List<QuotationData>> projectData = new HashMap<Project, List<QuotationData>>(); //Fetch the projects from the id or the filter WikittyQueryMaker projectQueryMaker = new WikittyQueryMaker(); @@ -184,7 +183,7 @@ Collection<Quotation> quotations = result.getAll(); - HashMap<Quotation, QuotationCalculation> calculations = new HashMap<Quotation, QuotationCalculation>(); + Map<Quotation, QuotationCalculation> calculations = new HashMap<Quotation, QuotationCalculation>(); for(Quotation q : quotations) { QuotationCalculation calc = new QuotationCalculation(q, client); calc.calculate(); @@ -207,7 +206,7 @@ } /** - * + * Generate the employee page * @param client * @param id * @param from @@ -358,12 +357,12 @@ } /** - * - * @param client - * @param project_name - * @param project_id - * @param quotationFilter - * @return + * Request the generation of the single-projetc page + * @param client chorem client + * @param project_name project name + * @param project_id project id + * @param quotationFilter quotation filter + * @return the project page */ public Render requestProject(ChoremClient client, String project_name, String project_id, String quotationFilter) { if(quotationFilter == null) @@ -380,24 +379,24 @@ return render; } /** - * - * @param client - * @param from - * @param to - * @return + * Request the generation of the multi project page + * @param client chorem client + * @param from start date + * @param to end date + * @return the multi project page */ public Render requestMultiProject(ChoremClient client, Date from, Date to) { return multiProjectFilter(client, from, to); } /** - * - * @param client - * @param id - * @param from - * @param to - * @param quotations - * @return + * request the generation of the employee page + * @param client chorem client + * @param id employee id + * @param from start date + * @param to end date + * @param quotations quotation filter + * @return the employee page */ public Render requestEmployee(ChoremClient client, String id, Date from, Date to, String[] quotations) { System.out.println("QUOTATIONS : " + Arrays.toString(quotations)); Deleted: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/Extensions.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/Extensions.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/Extensions.java 2013-08-16 09:07:56 UTC (rev 387) @@ -1,17 +0,0 @@ -package org.chorem.webmotion.actions.project; - -public interface Extensions { - public static final String[] extensions = { - "Quotation", - "Draft", - "Sent", - "Rejected", - "Accepted", - "Started", - "Delivered", - "RSV", - "Warranty", - "Closed", - "Cancelled" - }; -} Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/QuotationStatusAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/QuotationStatusAction.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/QuotationStatusAction.java 2013-08-16 09:07:56 UTC (rev 387) @@ -45,7 +45,6 @@ protected Wikitty upgradeInternal(ChoremClient client, String id, String[] extensionStr, Call call) { log.debug("save: " + id); - System.out.println("EXTENSIONS §§§§ : "); System.out.println(Arrays.toString(extensionStr)); System.out.println(ChoremUtil.asList(null, extensionStr)); Wikitty w = client.restore(id); @@ -59,7 +58,6 @@ return w; Collection<WikittyExtension> exts = client.restoreExtensionLastVersion(extList); - System.out.println("EXTENSION : " + exts); w.addExtension(exts); Map<String, Object> params = call.getExtractParameters(); String error = setWikittyField(w, "", params); Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/TaskData.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/TaskData.java 2013-08-14 15:57:01 UTC (rev 386) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/project/TaskData.java 2013-08-16 09:07:56 UTC (rev 387) @@ -6,7 +6,8 @@ import org.chorem.project.TaskCalculation; /** - * + * Represents a task withe the alert and the info linked to it. + * Used in a jsp page. * @author gwenn * */
participants (1)
-
meynier@users.chorem.org