Changeset 3821


Ignore:
Timestamp:
Apr 4, 2016, 9:26:36 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #861: YellowLabel? tracking wizard

Added Completed date field in the "Create ZIP" dialog to make it possible to mark the specimen as completed at the same time as the ZIP file is created.

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

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/yellowlabel/list.js

    r3815 r3821  
    340340    {
    341341      var raw = [];
     342      var specimen = [];
    342343      for (var i = 0; i < selected.length; i++)
    343344      {
    344345        raw[i] = selected[i].raw.id;
     346        specimen[i] = selected[i].id;
    345347      }
    346348     
     
    348350      url += '&cmd=CreatePilotReportZip';
    349351      url += '&rawBioAssays='+raw.join(',');
     352      url += '&specimen='+specimen.join(',');
    350353      url += '&password='+encodeURIComponent(options.password);
     354      url += '&completedDate='+encodeURIComponent(options.completedDate);
    351355      window.open(url);
    352356    }
  • extensions/net.sf.basedb.reggie/trunk/resources/yellowlabel/make-zip.js

    r3791 r3821  
    77  zip.initPage = function()
    88  {
     9    Events.addEventHandler('completedDate', 'blur', Wizard.validateDate);
     10
    911    Buttons.addClickHandler('close', App.closeWindow);
    1012    Buttons.addClickHandler('btnOk', zip.makeZip);
    11 
    1213  }
    1314 
     
    1516  {
    1617    var frm = document.forms['options'];
     18    if (!Wizard.isValid('completedDate'))
     19    {
     20      Forms.showNotification('completedDate', 'Not a valid date');
     21      return;
     22    }
    1723   
    1824    var options = {};
    1925    options.password = frm.password.value;
     26    options.completedDate = frm.completedDate.value;
    2027   
    2128    window.opener.YellowLabel.createPilotReportZip(null, options);
  • extensions/net.sf.basedb.reggie/trunk/resources/yellowlabel/make-zip.jsp

    r3791 r3821  
    3636  <div class="content bottomborder">
    3737 
    38     <table class="fullform input100 step-form">
     38    <table class="fullform input100">
    3939    <tr>
    4040      <th>Password</th>
     
    4343          type="text" name="password" id="password" maxlength="20">
    4444      </td>
    45       <td></td>
     45    </tr>
     46    <tr>
     47      <th class="subprompt"></th>
     48      <td>
     49        <i>(If empty, the ZIP file is not password protected)</i>
     50        <div id="wizard-status"></div>
     51      </td>
     52    </tr>
     53    <tr>
     54      <th>Completed date</th>
     55      <td>
     56        <input type="text" name="completedDate" id="completedDate" style="width: 12em;" maxlength="10"
     57          title="Enter completed date in YYYYMMDD format">
     58          <base:icon
     59            id="completedDateCalendar"
     60            subclass="auto-init"
     61            data-auto-init="calendar"
     62            data-textarea-id="completedDate"
     63            data-date-format="yyyyMMdd"
     64            image="calendar.png"
     65            tooltip="Select a date from a calendar"
     66            tabindex="-1"
     67          />
     68      </td>
    4669    </tr>
    4770    <tr class="dynamic">
    48       <th></th>
    49       <td colspan="2">
    50         <i>(If empty, the ZIP file is not password protected)</i>
    51         <div id="wizard-status"></div>
     71      <th class="subprompt"></th>
     72      <td>
     73        <i>(If empty, the selected specimen are not marked as completed)</i>
    5274      </td>
    5375    </tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/YellowLabelServlet.java

    r3815 r3821  
    169169        ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR);
    170170
     171        Date completedDate = Reggie.CONVERTER_STRING_TO_DATE.convert(req.getParameter("completedDate"));
     172        if (completedDate != null)
     173        {
     174          Integer[] ids = Values.getInt(req.getParameter("specimen").split(","));
     175          for (int id : ids)
     176          {
     177            Sample specimen = Sample.getById(dc, id);
     178            Annotationtype.COMPLETED_DATE.setAnnotationValue(dc, specimen, completedDate);
     179          }
     180        }
     181       
    171182        Integer[] ids = Values.getInt(req.getParameter("rawBioAssays").split(","));
    172183        String password = Values.getStringOrNull(req.getParameter("password"));
     
    189200        combiner.combineReports(dc, rawBioAssays, null, null);
    190201
     202        dc.commit();
    191203        pdf2Zip.close();
    192204        out.flush();
Note: See TracChangeset for help on using the changeset viewer.