Changeset 1430 for extensions
- Timestamp:
- Oct 31, 2011, 1:22:42 PM (12 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/partitionform.jsp
r1426 r1430 37 37 var apWeightsAreValid; 38 38 var hisWeightsAreValid; 39 var oneOrMoreWeightsAreSet; 39 40 var nofPiecesAreValid; 40 41 … … 85 86 for (var i=0; i<spWeightsAreValid.length; i++) 86 87 { 88 87 89 if (spWeightsAreValid[i] == false || 88 90 apWeightsAreValid[i] == false || 89 91 hisWeightsAreValid[i] == false || 90 92 nofPiecesAreValid[i] == false) 93 { 94 return false; 95 } 96 if (oneOrMoreWeightsAreSet[i] == false) 91 97 { 92 98 return false; … … 138 144 hisWeightsAreValid = Array(); 139 145 nofPiecesAreValid = Array(); 146 oneOrMoreWeightsAreSet = Array(); 147 for (var i=0;i<selectedTubes.length;i++) 148 { 149 spWeightsAreValid[i] = true; 150 apWeightsAreValid[i] = true; 151 hisWeightsAreValid[i] = true; 152 nofPiecesAreValid[i] = false; 153 oneOrMoreWeightsAreSet[i] = false; 154 } 140 155 141 156 inputWeightHtml = ''; … … 152 167 153 168 var appearanceOptions = '<option selected ></option>'; 154 appearanceOptions += '<option value="HOMOGEN US">Homogenus</option>';155 appearanceOptions += '<option value="HETEROGEN US">Heterogenus</option>';169 appearanceOptions += '<option value="HOMOGENOUS">Homogenous</option>'; 170 appearanceOptions += '<option value="HETEROGENOUS">Heterogenous</option>'; 156 171 157 172 var necrosisOptions = '<option selected value="0">0</option>'; … … 172 187 { 173 188 var tube = selectedTubes[i]; 174 var nextStep = i<(selectedTubes.length-1) ? 'focusOnEnter(event, \'bloody'+(i+1)+'\')' : ' doOnTabOrEnter(event, goCreate)';189 var nextStep = i<(selectedTubes.length-1) ? 'focusOnEnter(event, \'bloody'+(i+1)+'\')' : ''; 175 190 176 191 inputWeightHtml += '<tr>'; … … 190 205 inputWeightHtml += '<td>'+fatTitle+'<select name=fat'+i+' onfocus="messageOnFocus(3,'+i+')" onkeypress="focusOnEnter(event, \'coloured'+i+'\')">'+fatOptions+'</select></td>'; 191 206 inputWeightHtml += '<td>'+colouredTitle+'<input type=checkbox name=coloured'+i+' onfocus="messageOnFocus(4,'+i+')" onkeypress="checkOnNumber(event, this);focusOnEnter(event, \'nofPieces'+i+'\')" /></td>' 192 inputWeightHtml += '<td>'+nofTitle+'<input name="nofPieces'+i+'" onfocus="messageOnFocus(5,'+i+')" on change="nofPiecesOnChange('+i+')" onkeypress="focusOnEnter(event, \'spWeight'+i+'\')" size=2 /></td>';193 inputWeightHtml += '<td>'+spTitle+'<input name="spWeight'+i+'" onfocus="messageOnFocus(6,'+i+')" on change="spWeightOnChange('+i+')" onkeypress="focusOnEnter(event, \'hisWeight'+i+'\')" size=2 /></td>';194 inputWeightHtml += '<td>'+hisTitle+'<input name="hisWeight'+i+'" onfocus="messageOnFocus(7,'+i+')" on change="hisWeightOnChange('+i+')" onkeypress="focusOnEnter(event, \'apWeight'+i+'\')" size=2 /></td>';195 inputWeightHtml += '<td>'+apTitle+'<input name="apWeight'+i+'" onfocus="messageOnFocus(8,'+i+')" on change="apWeightOnChange('+i+')" onkeypress="'+nextStep+'" size=2 /></td>';207 inputWeightHtml += '<td>'+nofTitle+'<input name="nofPieces'+i+'" onfocus="messageOnFocus(5,'+i+')" onblur="nofPiecesOnChange('+i+')" onkeypress="focusOnEnter(event, \'spWeight'+i+'\')" size=2 /></td>'; 208 inputWeightHtml += '<td>'+spTitle+'<input name="spWeight'+i+'" onfocus="messageOnFocus(6,'+i+')" onblur="spWeightOnChange('+i+')" onkeypress="focusOnEnter(event, \'hisWeight'+i+'\')" size=2 /></td>'; 209 inputWeightHtml += '<td>'+hisTitle+'<input name="hisWeight'+i+'" onfocus="messageOnFocus(7,'+i+')" onblur="hisWeightOnChange('+i+')" onkeypress="focusOnEnter(event, \'apWeight'+i+'\')" size=2 /></td>'; 210 inputWeightHtml += '<td>'+apTitle+'<input name="apWeight'+i+'" onfocus="messageOnFocus(8,'+i+')" onblur="apWeightOnChange('+i+')" onkeypress="'+nextStep+'" size=2 /></td>'; 196 211 inputWeightHtml += '</tr>'; 197 212 inputWeightHtml += '</table>'; … … 291 306 setInputStatus(tubeIndex, 'APWeight is invalid.', 'invalid'); 292 307 return; 293 } 308 } 309 310 var spWeightValue = frm.elements['spWeight'+tubeIndex].value; 311 var apWeightValue = frm.elements['apWeight'+tubeIndex].value; 312 var hisWeightValue = frm.elements['hisWeight'+tubeIndex].value; 313 if (spWeightValue == '' && apWeightValue == '' && hisWeightValue == '') 314 { 315 oneOrMoreWeightsAreSet[tubeIndex] = false; 316 setInputStatus(tubeIndex, 'No weight is defined.', 'invalid'); 317 return; 318 } 319 oneOrMoreWeightsAreSet[tubeIndex] = true; 294 320 setInputStatus(tubeIndex, '', 'valid'); 295 321 } … … 376 402 if (fieldInput == '0') 377 403 { 378 frm.elements[inputName].value = ''; 379 } 380 } 404 fieldInput = ''; 405 frm.elements[inputName].value = fieldInput; 406 } 407 } 408 if (fieldInput == '') 409 { 410 nofPiecesAreValid[tubeIndex] = false; 411 updateInputStatus(tubeIndex); 412 return; 413 } 381 414 nofPiecesAreValid[tubeIndex] = true; 382 415 updateInputStatus(tubeIndex); … … 483 516 // Generate partition comment string 484 517 if (frm.elements['bloody'+i].checked == true) partitionComment += 'BLOODY'; 485 if (appearanceValue != '') partitionComment += (partitionComment.length>0 ? ' :' : '') + appearanceValue;486 if (necrosisValue != '0') partitionComment += (partitionComment.length>0 ? ' :' : '') + 'NECROSIS'+necrosisValue+'%';487 if (fatValue != '0') partitionComment += (partitionComment.length>0 ? ' :' : '') + 'FAT'+fatValue+'%';488 if (frm.elements['coloured'+i].checked == true) partitionComment += partitionComment.length>0 ? ' :COLOURED' : 'COLOURED';518 if (appearanceValue != '') partitionComment += (partitionComment.length>0 ? ';' : '') + appearanceValue; 519 if (necrosisValue != '0') partitionComment += (partitionComment.length>0 ? ';' : '') + 'NECROSIS'+necrosisValue+'%'; 520 if (fatValue != '0') partitionComment += (partitionComment.length>0 ? ';' : '') + 'FAT'+fatValue+'%'; 521 if (frm.elements['coloured'+i].checked == true) partitionComment += partitionComment.length>0 ? ';COLOURED' : 'COLOURED'; 489 522 490 523 specimenTube.operatorPartitionComment = partitionComment.length > 0 ? partitionComment : null; -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PartitionRegistrationServlet.java
r1426 r1430 208 208 209 209 Reggie.setAnnotationValue(hisSample, partitionDateType, partitionDate); 210 211 // Set box position212 if (specimenBoxName != null)213 {214 String hisBoxName = "His" + specimenBoxName.substring(2);215 ItemQuery<BioPlate> hisBoxQuery = BioPlate.getQuery();216 hisBoxQuery.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(hisBoxName)));217 List<BioPlate> hisBoxes = hisBoxQuery.list(dc);218 if (hisBoxes.size()>1)219 {220 throw new InvalidDataException("More then one his-box were found with name: "+hisBoxName+". " +221 "This wizard can not be used until this is fixed.");222 }223 else if (hisBoxes.size()<1)224 {225 throw new InvalidDataException("No his-box was found with name: "+hisBoxName+". " +226 "This wizard can not be used until this is fixed.");227 }228 BioPlate hisBox = hisBoxes.get(0);229 if (!hisBox.getBioWell(specimenWell.getRow(), specimenWell.getColumn()).isEmpty())230 {231 throw new InvalidDataException("Position [" + specimenWell.getRow() + "," + specimenWell.getColumn() + "]" +232 " is not empty in box: " + hisBoxName);233 }234 hisSample.setBioWell(hisBox.getBioWell(specimenWell.getRow(), specimenWell.getColumn()));235 }236 210 } 237 211 }
Note: See TracChangeset
for help on using the changeset viewer.