Ignore:
Timestamp:
Oct 28, 2011, 2:35:36 PM (10 years ago)
Author:
Martin Svensson
Message:

References #330 The partition wizard is now fully functional. Some testings are left to do.

File:
1 edited

Legend:

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

    r1420 r1425  
    151151    var bloodyTitle = 'Bloody<br>';
    152152   
    153     var appearanceOptions = '<option selected></option>'; 
    154     appearanceOptions += '<option value=homogenus>Homogenus</option>';
    155     appearanceOptions += '<option value=heterogenus>Heterogenus</option>';
    156    
    157     var necrosisOptions = '<option selected value=0>0</option>';
    158     necrosisOptions += '<option value=20>20</option>';
    159     necrosisOptions += '<option value=40>40</option>';
    160     necrosisOptions += '<option value=60>60</option>';
    161     necrosisOptions += '<option value=80>80</option>';
    162     necrosisOptions += '<option value=100>100</option>';
     153    var appearanceOptions = '<option selected ></option>'; 
     154    appearanceOptions += '<option value="HOMOGENUS">Homogenus</option>';
     155    appearanceOptions += '<option value="HETEROGENUS">Heterogenus</option>';
     156   
     157    var necrosisOptions = '<option selected value="0">0</option>';
     158    necrosisOptions += '<option value="20">20</option>';
     159    necrosisOptions += '<option value="40">40</option>';
     160    necrosisOptions += '<option value="60">60</option>';
     161    necrosisOptions += '<option value="80">80</option>';
     162    necrosisOptions += '<option value="100">100</option>';
    163163   
    164164    var fatOptions = '<option selected value=0>0</option>';
     
    202202      inputWeightHtml += '<tr>';
    203203      inputWeightHtml += '<td style="width:400px;" class="help"><span class="message" id="'+i+'.message"></span><span id="'+i+'.help"></span></td>';     
    204       inputWeightHtml += '</tr>';
    205      
     204      inputWeightHtml += '</tr>';     
    206205      inputWeightHtml += '<tr><td>&nbsp;</td></tr>';
    207206    }
     
    439438function goCreate()
    440439{
    441   alert('goCreate');
    442440  if (!step3IsValid()) return;
    443441 
    444442  Main.hide('gocancel');
    445443  Main.hide('gocreate');
    446   var frm = document.forms['reggie'];
    447  
    448   var specimens = caseInfo.specimen;
     444 
     445  var frm = document.forms['reggie'];
     446  var tubeInfo = new Object();
     447 
     448  var specimens = selectedTubes;
    449449  var nofTubes = specimens.length;
    450450  var partitionDateValue = frm.elements['partitionDate'].value;
    451   //var partitionCommentValue = frm.elements['partitionComment'].value;
    452   caseInfo.partitionDate = partitionDateValue;
    453 //  if (partitionCommentValue != null) caseInfo.otherPartitionComment = partitionCommentValue;
    454  
     451  tubeInfo.partitionDate = partitionDateValue;
    455452  for (var i=0; i<nofTubes; i++)
    456453  {
     
    459456    frm.elements['hisWeight'+i].disabled = true;
    460457    frm.elements['nofPieces'+i].disabled = true;
    461    
     458    frm.elements['bloody'+i].disabled = true;
     459    frm.elements['appearance'+i].disabled = true;
     460    frm.elements['necrosis'+i].disabled = true;
     461    frm.elements['fat'+i].disabled = true;
     462    frm.elements['coloured'+i].disabled = true;
     463       
    462464    var specimenTube = specimens[i];
    463465   
     
    471473    if (nofPiecesValue != '') specimenTube.nofPieces = nofPiecesValue;
    472474   
    473     caseInfo.specimen[i] = specimenTube;   
    474   }
     475    var partitionComment = ''; 
     476    var appearanceElement = frm.elements['appearance'+i];
     477    var necrosisElement = frm.elements['necrosis'+i];
     478    var fatElement = frm.elements['fat'+i];
     479    var appearanceValue = appearanceElement.options[appearanceElement.selectedIndex].value;   
     480    var necrosisValue = necrosisElement.options[necrosisElement.selectedIndex].value;
     481    var fatValue = fatElement.options[fatElement.selectedIndex].value;
     482   
     483    // Generate partition comment string
     484    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';
     489   
     490    specimenTube.otherPartitionComment = partitionComment.length > 0 ? partitionComment : null;
     491   
     492    specimens[i] = specimenTube;   
     493  }
     494  tubeInfo.specimens = specimens;
    475495  var submitInfo = new Object();
    476   submitInfo.caseInfo = caseInfo;
     496  submitInfo.tubeInfo = tubeInfo;
    477497 
    478498  if (debug) Main.debug(JSON.stringify(caseInfo));
     
    481501  var url = 'PartitionRegistration.servlet?ID=<%=ID%>&cmd=CreatePartitions';
    482502  request.open("POST", url, false);
    483   request.setRequestHeader("Content-Type", "application/json");
     503  request.setRequestHeader("Content-Type", "application/json"); 
    484504  request.send(JSON.stringify(submitInfo));
    485505
Note: See TracChangeset for help on using the changeset viewer.