Changeset 1390


Ignore:
Timestamp:
Sep 12, 2011, 10:46:12 AM (10 years ago)
Author:
Martin Svensson
Message:

References #317. Added warning if different boxes are used.

File:
1 edited

Legend:

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

    r1389 r1390  
    3636var debug = false;
    3737var currentStep = 1;
     38var usedBox = '';
    3839
    3940var caseInfo = null;
     
    201202  }
    202203  lateralityOnChange();
     204  specimenTypeOnClick();
     205  biopsyTypeOnClick();
    203206  if (thisCasePad != null)
    204207  {
     
    401404  var nofTubes = frm.nofTubes.value;
    402405 
    403   boxValue = boxValue.substring(2);
    404   while (boxValue.length < 3)
     406  boxValue = boxValue.substring(2); 
     407  while (boxValue.length > 0 && boxValue.length < 3)
    405408  {   
    406409    boxValue = '0'+boxValue;
     
    411414  wellsAreValid[tubeIndex] = false;
    412415 
    413   if (frm.elements[boxName].value == '')
     416  if (frm.elements[boxName].value == 'Sp')
    414417  {
    415418    boxesAreValid[tubeIndex] = true;
     
    449452    return false;
    450453  }   
    451   else
    452   {
     454  else
     455  {
     456    setInputStatus('rowColumn'+tubeIndex,'Row[A-'+response.rows+'], Columns[1-'+response.columns+']','');
    453457    boxesAreValid[tubeIndex] = true;
    454458    boxInfo[tubeIndex] = response.boxInfo; 
     
    456460    frm.elements[columnName].disabled = false;
    457461   
    458     var nextWellRow = response.freeRow;
    459     var nextWellColumn = parseInt(response.freeColumn)+1;
    460    
     462    var nextWellRow = '';
     463    var nextWellColumn = '';
     464   
     465    if (tubeIndex==0)
     466    {
     467      usedBox = boxValue;     
     468    }
     469   
     470    if (usedBox != boxValue)
     471    {     
     472      setInputStatus(boxName, 'More then one box is used','warning');
     473      frm.elements[rowName].focus();
     474      return;
     475    }
     476   
     477    nextWellRow = response.freeRow;
     478    nextWellColumn = parseInt(response.freeColumn)+1;   
    461479    if( (nextWellColumn + tubeIndex) > response.columns)
    462480    {
    463      
     481      nextWellColumn = 0;
     482      nextWellRow = '';
    464483    }
    465484    else
    466485    {
    467       nextWellColumn + tubeIndex;
    468     }
    469    
    470     frm.elements[rowName].value = nextWellRow
    471     frm.elements[columnName].value = nextWellColumn;
     486      nextWellColumn = nextWellColumn + tubeIndex;
     487    }   
     488   
     489    if (frm.elements[rowName].value == '' &&
     490        frm.elements[columnName].value == '')
     491    {
     492      frm.elements[rowName].value = nextWellRow;   
     493      frm.elements[columnName].value = nextWellColumn;
     494    }     
    472495    setInputStatus('rowColumn'+tubeIndex,'Row[A-'+response.rows+'], Columns[1-'+response.columns+']','');
    473496    setInputStatus(boxName, '', 'valid');   
     
    519542  }
    520543  for (var i=0;i<nofTubes;i++)
    521   {
     544  {   
    522545    if (i != tubeIndex && frm.elements['box'+i].value == boxValue)
    523546    {
Note: See TracChangeset for help on using the changeset viewer.