Changeset 1728


Ignore:
Timestamp:
Oct 23, 2012, 9:21:24 AM (11 years ago)
Author:
olle
Message:

Fixes #419. Added menu for manual selection of view type for the table.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/samplereportgenerator.jsp

    r1727 r1728  
    131131    frm.fromdate.disabled = true;
    132132    frm.todate.disabled = true;
     133    frm.viewtype.disabled = true;
    133134    Main.hide('gocreate');
    134135    Main.show('reportSection');
     
    140141      if (frm.fromdate.value != null) url += '&fdate='+frm.fromdate.value;
    141142      if (frm.todate.value != null) url += '&tdate='+frm.todate.value;
     143      if (frm.viewtype.value != null) url += '&vtype='+frm.viewtype.value;
    142144    }
    143145    var request = Ajax.getXmlHttpRequest();
     
    351353      if (sitesCombined[key] != '') gt += sitesCombined[key];
    352354    }
    353     sitesCombinedRow.appendChild(getTableCellElement(gt,'colsummary'));
     355    sitesCombinedRow.appendChild(getTableCellElement(gt, 'colsummary'));
    354356    reportTable.appendChild(sitesCombinedRow); 
    355357
     
    524526      tableRow.appendChild(tableCol);
    525527      tableRow.appendChild(getTableCellElement(year+'-'+(month)+'-'+date, 'reportdata'));
    526       var grandTotal = 0;   
     528      var grandTotal = 0;
    527529      var currentDate = new Date(periodStartDate.getFullYear(), periodStartDate.getMonth(), periodStartDate.getDate());     
    528530      var columnCounter = 0;
     
    747749                <span id="displayInterval.message" class="message" style="display: none;"></span>
    748750                Define which period the report should cover. Empty fields will include all tubes.<br>
    749                 The report will adjust itself depending on the size of the period.
     751              </td>
     752            </tr>
     753            <tr>         
     754              <td valign="top" class="prompt">View type</td>
     755              <td valign="top" class="input">
     756                <select name="viewtype">
     757                  <option value="AUTO" selected="yes">Auto</option>
     758                  <option value="WEEK">Week</option>
     759                  <option value="MONTH">Month</option>
     760                  <option value="QUARTER">Quarter</option>
     761                  <option value="YEAR">Year</option>
     762                </select>
     763              </td>
     764              <td valign="top" class="status" id="displayViewType.status"></td>
     765              <td class="help">
     766                <span id="displayViewType.message" class="message" style="display: none;"></span>
     767                Auto will adjust the report depending on the size of the period.
    750768                <ul>
    751769                  <li>Period shorter then 3 months - specimens per week</li>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SampleReportServlet.java

    r1727 r1728  
    8080        Date endDate = Reggie.CONVERTER_STRING_TO_DATE.convert(endDateParameter);
    8181       
     82        String viewType = null;
     83        String viewTypeParameter = Values.getString(req.getParameter("vtype"), null);
     84        if (viewTypeParameter != null && !viewTypeParameter.equals("AUTO"))
     85        {
     86          viewType = viewTypeParameter;
     87        }
     88
    8289        //List<Restriction> restrictions = new ArrayList<Restriction>();
    8390        ItemQuery<Sample> sampleQuery = Sample.getQuery();
     
    118125        Date latestDate = null;
    119126        JSONObject jsonSitesCombined = new JSONObject();
    120         String viewType = null;
    121127        JSONObject jsonStatistics = new JSONObject();
    122128        while (sampleIterator.hasNext())
Note: See TracChangeset for help on using the changeset viewer.