Changeset 1777


Ignore:
Timestamp:
Dec 12, 2012, 12:28:47 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #445: The HE glass registration wizard should have comment fields

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

Legend:

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

    r1726 r1777  
    221221 
    222222  setInnerHTML('blockName', paraffinBlock.name);
     223  frm.comment.value = paraffinBlock.comment;
    223224
    224225  var numWells = 0;
     
    374375
    375376  var frm = document.forms['reggie'];
     377  frm.stainDate.disabled = true;
     378  frm.stainingProtocol.disabled = true;
     379  frm.comment.disabled = true;
    376380 
    377381  var maxIndex = 1;
     
    409413  for (var glassNo = 0; glassNo < maxIndex; glassNo++)
    410414  {
    411     var nextStep = glassNo < (maxIndex-1) ? 'focusOnEnter(event, \'glassNo'+(glassNo+1)+'\')' : '';
     415    var nextStep = glassNo < (maxIndex-1) ? 'focusOnEnter(event, \'glassBox'+(glassNo+1)+'\');' : '';
    412416    var heSlide = new Object();
    413417   
     
    440444    }
    441445
    442     html += '<tr>';
    443     html += '<td style="width: 150px;">' + heSlide.name + '</td>';
     446    html += '<tr style="border-top: 1px dotted #A0A0A0;">';
     447    html += '<td style="width: 120px;">' + heSlide.name + '</td>';
    444448    html += '<td><input type="text" name="glassBox'+glassNo+'" value="'+heSlide.storageBox+'" onblur="glassBoxOnChange('+glassNo+')"';
    445449    html += ' onkeypress="focusOnEnter(event, \'position'+glassNo+'\'); return Numbers.integerOnly(event)" size="10" ></td>';
    446450    html += '<td><input type="text" name="position'+glassNo+'" value="'+heSlide.position+'" onblur="glassBoxOnChange('+glassNo+')"';
    447     html += ' onkeypress="' + nextStep + '; return Numbers.integerOnly(event)" size="10" ></td>';
     451    html += ' onkeypress="'+nextStep+' return Numbers.integerOnly(event)" size="10" ></td>';
    448452    html += '<td class="status" id="glassBox'+glassNo+'.status"></td>';
     453    html += '</tr>';
     454   
     455    html += '<tr>';
     456    html += '<td style="width: 120px;" class="subprompt">- comment</td>';
     457    html += '<td colspan="2"><input type="text" name="comment'+glassNo+'" value="" style="width: 100%;"></td>';
     458    html += '<td class="status"></td>';
    449459    html += '</tr>';
    450460  }
     
    453463  setInnerHTML('glassBoxInput', html);
    454464 
     465  for (var glassNo = 0; glassNo < heGlass.length; glassNo++)
     466  {
     467    frm['comment'+glassNo].value = heGlass[glassNo].comment;
     468    glassBoxOnChange(glassNo);
     469  }
     470 
    455471  frm.glassBox0.focus();
    456472}
     
    462478  if (frm['glassBox'+glassNo].value == '')
    463479  {
    464     setInputStatus('glassBox'+glassNo, null, 'invalid');
     480    setInputStatus('glassBox'+glassNo, 'Missing storage box', 'invalid');
    465481    return;
    466482  }
    467483  if (frm['position'+glassNo].value == '')
    468484  {
    469     setInputStatus('glassBox'+glassNo, null, 'invalid');
     485    setInputStatus('glassBox'+glassNo, 'Missing position', 'invalid');
    470486    return;
    471487  }
     
    554570    heGlass.storageBox = frm['glassBox'+glassNo].value;
    555571    heGlass.position = frm['position'+glassNo].value;
     572    heGlass.comment = frm['comment'+glassNo].value;
    556573    glassNo++;
    557574  }
     
    560577  paraffinBlock.stainDate = frm.stainDate.value;
    561578  paraffinBlock.protocolId = parseInt(frm.stainingProtocol[frm.stainingProtocol.selectedIndex].value, 10);
     579  paraffinBlock.comment = frm.comment.value;
    562580  submitInfo.paraffinBlock = paraffinBlock;
    563581 
     
    652670  {
    653671    padding: 2px;
    654     text-align: left;
    655672  }
    656673
     
    730747        <tr valign="top">
    731748          <td class="prompt">Protocol</td>
    732           <td class="input"><select style="width:90%" name="stainingProtocol" id="stainingProtocol"
     749          <td class="input"><select style="width:95%" name="stainingProtocol" id="stainingProtocol"
    733750            ></select></td>
    734751          <td class="status" id="stainingProtocol.status"></td>
     
    741758          <td class="input"><span id="blockName"></span></td>
    742759          <td class="status" id="paraffinblock.status"></td>
     760          <td class="help"></td>
     761        </tr>
     762        <tr valign="top">
     763          <td class="subprompt">- comment</td>
     764          <td class="input"><textarea name="comment" rows="2" style="width: 95%;"></textarea></td>
     765          <td class="status" id="comment.status"></td>
    743766          <td class="help"></td>
    744767        </tr>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/HistologyServlet.java

    r1776 r1777  
    207207        ReactionPlate paraffinBlock = ReactionPlate.getById(dc, bioPlateId, BioplateType.PARAFFIN_BLOCK);
    208208        paraffinBlock.loadBioWells(dc, true);
     209        paraffinBlock.setAnnotation("comment", paraffinBlock.getBioPlate().getDescription());
    209210       
    210211        // Load child HEglass plates
     
    216217          for (ReactionPlate heGlass : heGlassPlates)
    217218          {
     219            BioPlate hePlate = heGlass.getBioPlate();
    218220            heGlass.loadBioWells(dc, true);
    219221            heGlass.loadBioMaterialAnnotations(dc, "GoodStain", Annotationtype.GOOD_STAIN, null);
    220            
    221             BioPlate hePlate = heGlass.getBioPlate();
     222            heGlass.setAnnotation("comment", hePlate.getDescription());
    222223           
    223224            if (hePlate.getTray() != null && hePlate.getPosition() != null)
     
    507508        // and find the max "goodStain" value
    508509        BioPlate pb = BioPlate.getById(dc, plateId.intValue());
     510        pb.setDescription(Values.getStringOrNull((String)jsonPlate.get("comment")));
    509511        int maxGoodStain = 1;
    510512        for (int i = 0; i < jsonWells.size(); ++i)
     
    543545          String storageBox = Values.getStringOrNull((String)jsonGlass.get("storageBox"));
    544546          String position = Values.getStringOrNull((String)jsonGlass.get("position"));
     547          String comment = Values.getStringOrNull((String)jsonGlass.get("comment"));
    545548         
    546549          // Try to find an existing HE glass
     
    568571          heGlass.setTray(storageBox);
    569572          heGlass.setPosition(position);
     573          heGlass.setDescription(comment);
    570574         
    571575          int numGoodStains = 0;
Note: See TracChangeset for help on using the changeset viewer.