Changeset 1931


Ignore:
Timestamp:
Apr 16, 2013, 10:41:09 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #473: Register library processing results

Split the library registration wizard into two. One for registering QC results and one for the final registration of the complete plate.

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

Legend:

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

    r1924 r1931  
    253253            <li><a href="libprep/assign_barcode.jsp?ID=<%=ID%>">Assign barcodes to cDNA plate</a>
    254254            <li><a href="libprep/libprep_protocol.jsp?ID=<%=ID%>">Lab protocols and files for library preparation</a>
    255             <li><a href="libprep/lib_registration.jsp?ID=<%=ID%>">Library registration and quality control results</a>
     255            <li><a href="libprep/libqc_registration.jsp?ID=<%=ID%>">Register quality control results</a>
     256            <li><a href="libprep/lib_registration.jsp?ID=<%=ID%>">Library registration</a>
    256257            </ul>
    257258          </dd>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/lib_registration.jsp

    r1918 r1931  
    3232var currentStep = 1;
    3333
    34 var pdfQcIsValid = false;
    35 var qcDateIsValid = false;
    36 var qcCommentsIsValid = false;
    37 
    3834var libDateIsValid = false;
    3935var wellTableIsValid = false;
     
    124120  frm.outcome[0].disabled = true;
    125121  frm.outcome[1].disabled = true;
    126 
    127122 
    128123  currentStep = 2;
     
    132127  Main.show('goregister');
    133128 
    134   var fullRegistration = document.getElementById('regTypeFull').checked;
    135   if (fullRegistration)
    136   {
    137     Main.show('step.2B.section');
    138     frm.libDate.focus();
    139 
    140     // Load Library protocols
    141     var libProtocols = getProtocols('LIBRARY_PROTOCOL');
    142     for (var i = 0; i < libProtocols.length; i++)
    143     {
    144       var protocol = libProtocols[i];
    145       frm.libProtocol[frm.libProtocol.length] = new Option(protocol.name, protocol.id, protocol.isDefault);
    146       setInputStatus('libProtocol', '', 'valid');
    147     }
    148     if (frm.libProtocol.length == 0)
    149     {
    150       frm.libProtocol[0] = new Option('- none -', '');
    151     }
    152  
    153   }
    154   else
    155   {
    156     Main.show('step.2A.section');
    157     frm.qcDate.focus();
     129  Main.show('step.2.section');
     130  frm.libDate.focus();
     131
     132  // Load Library protocols
     133  var libProtocols = getProtocols('LIBRARY_PROTOCOL');
     134  for (var i = 0; i < libProtocols.length; i++)
     135  {
     136    var protocol = libProtocols[i];
     137    frm.libProtocol[frm.libProtocol.length] = new Option(protocol.name, protocol.id, protocol.isDefault);
     138    setInputStatus('libProtocol', '', 'valid');
     139  }
     140  if (frm.libProtocol.length == 0)
     141  {
     142    frm.libProtocol[0] = new Option('- none -', '');
    158143  }
    159144}
     
    189174}
    190175
    191 function regTypeOnChange()
    192 {
    193   var frm = document.forms['reggie'];
    194   Main.showHide('outcomeSection', document.getElementById('regTypeFull').checked);
    195 }
    196 
    197176function outcomeOnChange()
    198177{
     
    205184    Main.hide('filesSection');
    206185  }
    207   //Main.addOrRemoveClass(frm['pdf.path'], 'required', document.getElementById('outcomeSuccess').checked);
    208 
    209 
    210186}
    211187
     
    232208    preValidateCsvFile();
    233209  }
    234   else if (lastPrefix == 'pdfqc')
    235   {
    236     pdfqcFileOnChange();
    237     frm.qccomments.focus();
    238   }
    239210  else if (lastPrefix == 'qubitcsv')
    240211  {
     
    246217    setInputStatus(lastPrefix, '', 'valid');
    247218  }
    248  
    249 }
    250 
    251 function pdfqcFileOnChange()
    252 {
    253   var frm = document.forms['reggie'];
    254   pdfQcIsValid = false;
    255   if (!frm['pdfqc.id'].value)
    256   {
    257     // A PDF is reuired for successful registration, optional after a failure
    258     var msg = frm['pdfqc.path'].value ? 'Use the Browse button to select a file' : 'Missing';
    259     setInputStatus('pdfqc', msg, 'invalid');
    260     return;
    261   }
    262   pdfQcIsValid = true;
    263   setInputStatus('pdfqc', '', 'valid');
    264 }
    265 
    266 function qcDateOnChange()
    267 {
    268   var frm = document.forms['reggie'];
    269   qcDateIsValid = false;
    270   setInputStatus('qcDate', '', '');
    271  
    272   var qcDate = frm.qcDate.value;
    273   if (qcDate == '')
    274   {
    275     setInputStatus('qcDate', 'Missing', 'invalid');
    276     return;
    277   }
    278 
    279   // Auto-fill the date if it's only given with 4(MMdd) or 6(yyMMdd) digits.   
    280   qcDate = autoFillDate(qcDate);
    281   frm.qcDate.value = qcDate;
    282  
    283   if (!Dates.isDate(qcDate, 'yyyyMMdd'))
    284   {
    285     setInputStatus('qcDate', 'Not a valid date', 'invalid');
    286     return;
    287   }
    288  
    289   setInputStatus('qcDate', '', 'valid');
    290   qcDateIsValid = true;
    291 }
    292 
    293 function qcCommentsOnChange()
    294 {
    295   var frm = document.forms['reggie'];
    296   qcCommentsIsValid = false;
    297   setInputStatus('qccomments', '', '');
    298  
    299   var comments = frm.qccomments.value;
    300   if (comments == '')
    301   {
    302     setInputStatus('qccomments', 'Missing', 'invalid');
    303     return;
    304   }
    305 
    306   setInputStatus('qccomments', '', 'valid');
    307   qcCommentsIsValid = true;
    308219}
    309220
     
    425336function step2IsValid()
    426337{
    427   var fullRegistration = document.getElementById('regTypeFull').checked;
    428  
    429   if (fullRegistration)
    430   {
    431     var failed = document.getElementById('outcomeFailed').checked;
    432     if (failed)
    433     {
    434       return libDateIsValid && libCommentsIsValid;
    435     }
    436     else
    437     {
    438       return libDateIsValid && wellTableIsValid && qubitCsvIsValid;
    439     }
     338  var failed = document.getElementById('outcomeFailed').checked;
     339  if (failed)
     340  {
     341    return libDateIsValid && libCommentsIsValid;
    440342  }
    441343  else
    442344  {
    443     // QC registration
    444     return pdfQcIsValid && qcDateIsValid && qcCommentsIsValid;
    445   }
    446  
     345    return libDateIsValid && wellTableIsValid && qubitCsvIsValid;
     346  }
    447347}
    448348
     
    456356  Main.hide('gocancel');
    457357
    458   var url = '';
    459358  var submitInfo = {};
    460359  submitInfo.bioplate = parseInt(frm.bioplate.value, 10);
    461360
    462   var fullRegistration = document.getElementById('regTypeFull').checked;
    463   if (fullRegistration)
    464   {
    465     Main.addClass(document.getElementById('step.2B.section'), 'disabled');
    466     url = '../LibPrep.servlet?ID=<%=ID%>&cmd=ImportLibPrepResults';
    467     var failed = document.getElementById('outcomeFailed').checked;
    468     submitInfo.failed = failed;
     361  Main.addClass(document.getElementById('step.2.section'), 'disabled');
     362  var url = '../LibPrep.servlet?ID=<%=ID%>&cmd=ImportLibPrepResults';
     363  var failed = document.getElementById('outcomeFailed').checked;
     364  submitInfo.failed = failed;
    469365   
    470     if (!failed)
    471     {
    472       submitInfo.wellTableCsv = parseInt(frm['welltable.id'].value, 10);
    473       submitInfo.caliperGxd = parseInt(frm['calipergxd.id'].value, 10);
    474       submitInfo.caliperPdf = parseInt(frm['caliperpdf.id'].value, 10);
    475       submitInfo.qubitCsv = parseInt(frm['qubitcsv.id'].value, 10);
    476     }
     366  if (!failed)
     367  {
     368    submitInfo.wellTableCsv = parseInt(frm['welltable.id'].value, 10);
     369    submitInfo.caliperGxd = parseInt(frm['calipergxd.id'].value, 10);
     370    submitInfo.caliperPdf = parseInt(frm['caliperpdf.id'].value, 10);
     371    submitInfo.qubitCsv = parseInt(frm['qubitcsv.id'].value, 10);
     372  }
    477373   
    478     submitInfo.libDate = frm.libDate.value;
    479     submitInfo.libProtocol = parseInt(frm.libProtocol.value, 10);
    480     submitInfo.libOperator = frm.libOperator.value;
    481     submitInfo.libComments = frm.libComments.value;
    482    
    483   }
    484   else
    485   {
    486     // QC Registration
    487     Main.addClass(document.getElementById('step.2A.section'), 'disabled');
    488     url = '../LibPrep.servlet?ID=<%=ID%>&cmd=ImportLibPrepQcResults';
    489    
    490     submitInfo.qcDate = frm.qcDate.value;
    491     submitInfo.qcPdf = parseInt(frm['pdfqc.id'].value, 10);
    492     submitInfo.qcComments = frm.qccomments.value;
    493    
    494   }
     374  submitInfo.libDate = frm.libDate.value;
     375  submitInfo.libProtocol = parseInt(frm.libProtocol.value, 10);
     376  submitInfo.libOperator = frm.libOperator.value;
     377  submitInfo.libComments = frm.libComments.value;
    495378 
    496379  if (debug) Main.debug(JSON.stringify(submitInfo));
     
    549432  <p:path><p:pathelement
    550433    title="Reggie" href="<%="../index.jsp?ID="+ID%>"
    551     /><p:pathelement title="Library registration and quality control results"
     434    /><p:pathelement title="Library registration"
    552435    /></p:path>
    553436
     
    588471        </td>
    589472      </tr>
    590       <tr valign="top">
    591         <td class="prompt">Registration type</td>
    592         <td class="input">
    593           <input type="radio" name="regType" id="regTypeQc"
    594             onchange="regTypeOnChange()" checked><label for="regTypeQc">Quality control</label><br>
    595           <input type="radio" name="regType" id="regTypeFull"
    596             onchange="regTypeOnChange()"><label for="regTypeFull">Full plate</label>
    597         </td>
    598         <td class="status"></td>
    599         <td class="help">
    600           <b>Quality control</b> results can be registered multiple times. Use the <b>Full plate</b>
    601           option when the entire plate has been completed or if the processing of this plate should
    602           be aborted.
    603         </td>
    604       </tr>
    605       <tr valign="top" style="display: none;" id="outcomeSection">
     473      <tr valign="top" id="outcomeSection">
    606474        <td class="prompt">Outcome</td>
    607475        <td class="input">
     
    623491  </div>
    624492 
    625   <div id="step.2A.section" style="display: none;">
    626   <table class="stepform">
    627   <tr>
    628     <td rowspan="3" class="stepno">2</td>
    629     <td class="steptitle">Quality control results</td>
    630   </tr>
    631   <tr>
    632     <td class="stepfields">
    633       <table>
    634       <tr valign="top">
    635         <td class="prompt">Date</td>
    636         <td class="input">
    637           <input type="text" class="required" name="qcDate" value="" size="12" maxlength="10"
    638             onblur="qcDateOnChange()" onkeypress="focusOnEnter(event, 'pdfqc.path')">
    639         </td>
    640         <td class="status" id="qcDate.status"></td>
    641         <td class="help">
    642           <span id="qcDate.message" class="message" style="display: none;"></span>(YYYYMMDD or MMDD)
    643         </td>
    644       </tr>
    645       <tr valign="top">
    646         <td class="prompt">PDF file</td>
    647         <td class="input">
    648           <input type="hidden" name="pdfqc.id" value="">
    649           <table>
    650           <tr>
    651           <td><input class="text required" type="text"
    652             name="pdfqc.path" value=""
    653             size="50" onkeypress="doOnEnter(event, function(){document.getElementById('btnPdfQc').click()})"
    654             onblur="pdfqcFileOnChange()"
    655             ></td>
    656           <td style="padding-left: 4px;"><base:button
    657               title="Browse&hellip;"
    658               onclick="browseOnClick('pdfqc', 'pdf')"
    659               id="btnPdfQc"
    660               />
    661           </td>
    662           </tr>
    663           </table>
    664         </td>
    665         <td class="status" id="pdfqc.status"></td>
    666         <td class="help"><span id="pdfqc.message" class="message" style="display: none;"></span>
    667           Select the PDF file that contains a printout with diagrams and other
    668           useful documentation.
    669         </td>
    670       </tr>
    671       <tr valign="top">
    672         <td class="prompt">Comments</td>
    673         <td class="input"><textarea class="required" rows="4" cols="50" style="width: 90%;" name="qccomments" value="" onblur="qcCommentsOnChange()"></textarea></td>
    674         <td class="status" id="qccomments.status"></td>
    675         <td class="help"><span id="qccomments.message" class="message" style="display: none;"></span>Comments about the quality control results.</td>
    676       </tr>
    677       </table>
    678     </td>
    679   </tr>
    680   </table>
    681   </div>
    682  
    683   <div id="step.2B.section" style="display: none;">
     493 
     494  <div id="step.2.section" style="display: none;">
    684495  <table class="stepform">
    685496  <tr>
Note: See TracChangeset for help on using the changeset viewer.