Changeset 2073


Ignore:
Timestamp:
Oct 16, 2013, 9:33:55 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #517: Ensure that the "Failure" option is not selected by mistake

Added a checkbox that is displayed next to the "Register" button when the "Failure" option is selected. The "Register" button is disabled until the checkbox is selected.

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

Legend:

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

    r1999 r2073  
    141141  }
    142142
     143  if (document.getElementById('outcomeFailed').checked)
     144  {
     145    setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure');
     146    Main.addClass(document.getElementById('goregister'), 'disabled');
     147  }
     148
    143149  frm.synthesisDate.focus();
    144150}
     
    219225function step2IsValid()
    220226{
     227  var frm = document.forms['reggie'];
    221228  if (!commentsIsValid) return false;
    222229 
    223230  if (dateIsValid['synthesisDate'] == false) return false;
     231  if (document.getElementById('outcomeFailed').checked && !frm.verifyFailure.checked) return false;
    224232 
    225233  return true;
     234}
     235
     236function verifyFailureOnClick()
     237{
     238  var frm = document.forms['reggie'];
     239  var checked = frm.verifyFailure.checked;
     240  Main.addOrRemoveClass(document.getElementById('goregister'), 'disabled', !checked);
    226241}
    227242
     
    234249  Main.hide('goregister');
    235250  Main.hide('gocancel');
     251  Main.hide('gonext.message');
    236252  Main.addClass(document.getElementById('step.2.section'), 'disabled');
    237253
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp

    r2070 r2073  
    122122  var frm = document.forms['reggie'];
    123123  var failed = frm.outcome[1].checked;
     124  if (failed && !frm.verifyFailure.checked) return false;
    124125 
    125126  var index = 0;
     
    139140}
    140141
     142function verifyFailureOnClick()
     143{
     144  var frm = document.forms['reggie'];
     145  var checked = frm.verifyFailure.checked;
     146  Main.addOrRemoveClass(document.getElementById('goregister'), 'disabled', !checked);
     147}
     148
    141149function step3IsValid()
    142150{
     
    207215    Main.show('goregister');
    208216    Main.hide('step.3.box');
     217   
     218    setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure');
     219    Main.addClass(document.getElementById('goregister'), 'disabled');
    209220  }
    210221
     
    518529  }
    519530 
    520 
    521531  Main.hide('goregister');
    522532  Main.hide('gocancel');
     533  Main.hide('gonext.message');
    523534 
    524535  var submitInfo = {};
     
    692703          <input type="radio" name="outcome" id="outcomeSuccess"
    693704            onchange="outcomeOnChange()" checked><label for="outcomeSuccess">Success</label> - sequencing has started<br>
    694           <input type="radio" name="outcome" id="outcomeFailed" disabled
    695             onchange="outcomeOnChange()"><label for="outcomeFailed" class="disabled">Failure</label> - no sequencing (TODO)
     705          <input type="radio" name="outcome" id="outcomeFailed"
     706            onchange="outcomeOnChange()"><label for="outcomeFailed">Failure</label> - no sequencing
    696707        </td>
    697708        <td class="status"></td>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/lib_registration.jsp

    r2039 r2073  
    195195    frm.libProtocol[0] = new Option('- none -', '');
    196196  }
     197 
     198  if (document.getElementById('outcomeFailed').checked)
     199  {
     200    setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure');
     201    Main.addClass(document.getElementById('goregister'), 'disabled');
     202  }
     203
    197204}
    198205
     
    443450function step2IsValid()
    444451{
     452  var frm = document.forms['reggie'];
    445453  if (dateIsValid['amplificationDate'] == false) return false;
    446454  if (dateIsValid['cleanupDate'] == false) return false;
     
    449457  if (failed)
    450458  {
     459    if (!frm.verifyFailure.checked) return false;
    451460    return libCommentsIsValid;
    452461  }
     
    457466}
    458467
     468function verifyFailureOnClick()
     469{
     470  var frm = document.forms['reggie'];
     471  var checked = frm.verifyFailure.checked;
     472  Main.addOrRemoveClass(document.getElementById('goregister'), 'disabled', !checked);
     473}
     474
    459475function goRegister()
    460476{
    461477  if (!step2IsValid()) return;
    462  
     478
    463479  Main.hide('messages');
    464480  Main.hide('goregister');
    465481  Main.hide('gocancel');
     482  Main.hide('gonext.message');
    466483
    467484  var frm = document.forms['reggie'];
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/mrna_registration.jsp

    r1998 r2073  
    147147  }
    148148
     149  if (document.getElementById('outcomeFailed').checked)
     150  {
     151    setInnerHTML('gonext.message', '<input type="checkbox" name="verifyFailure" onclick="verifyFailureOnClick()"> Check to verify registration of failure');
     152    Main.addClass(document.getElementById('goregister'), 'disabled');
     153  }
     154 
    149155  frm.dilutionDate.focus();
    150156}
     
    299305function step2IsValid()
    300306{
     307  var frm = document.forms['reggie'];
    301308  if (!pdfIsValid || !commentsIsValid) return false;
    302309 
     
    306313  if (dateIsValid['cleanupDate'] == false) return false;
    307314 
     315  if (document.getElementById('outcomeFailed').checked && !frm.verifyFailure.checked) return false;
     316 
    308317  return true;
     318}
     319
     320function verifyFailureOnClick()
     321{
     322  var frm = document.forms['reggie'];
     323  var checked = frm.verifyFailure.checked;
     324  Main.addOrRemoveClass(document.getElementById('goregister'), 'disabled', !checked);
    309325}
    310326
     
    318334  Main.hide('goregister');
    319335  Main.hide('gocancel');
     336  Main.hide('gonext.message');
    320337  Main.addClass(document.getElementById('step.2.section'), 'disabled');
    321338
Note: See TracChangeset for help on using the changeset viewer.