Changeset 1931
- Timestamp:
- Apr 16, 2013, 10:41:09 AM (10 years ago)
- 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 253 253 <li><a href="libprep/assign_barcode.jsp?ID=<%=ID%>">Assign barcodes to cDNA plate</a> 254 254 <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> 256 257 </ul> 257 258 </dd> -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/lib_registration.jsp
r1918 r1931 32 32 var currentStep = 1; 33 33 34 var pdfQcIsValid = false;35 var qcDateIsValid = false;36 var qcCommentsIsValid = false;37 38 34 var libDateIsValid = false; 39 35 var wellTableIsValid = false; … … 124 120 frm.outcome[0].disabled = true; 125 121 frm.outcome[1].disabled = true; 126 127 122 128 123 currentStep = 2; … … 132 127 Main.show('goregister'); 133 128 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 -', ''); 158 143 } 159 144 } … … 189 174 } 190 175 191 function regTypeOnChange()192 {193 var frm = document.forms['reggie'];194 Main.showHide('outcomeSection', document.getElementById('regTypeFull').checked);195 }196 197 176 function outcomeOnChange() 198 177 { … … 205 184 Main.hide('filesSection'); 206 185 } 207 //Main.addOrRemoveClass(frm['pdf.path'], 'required', document.getElementById('outcomeSuccess').checked);208 209 210 186 } 211 187 … … 232 208 preValidateCsvFile(); 233 209 } 234 else if (lastPrefix == 'pdfqc')235 {236 pdfqcFileOnChange();237 frm.qccomments.focus();238 }239 210 else if (lastPrefix == 'qubitcsv') 240 211 { … … 246 217 setInputStatus(lastPrefix, '', 'valid'); 247 218 } 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 failure258 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;308 219 } 309 220 … … 425 336 function step2IsValid() 426 337 { 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; 440 342 } 441 343 else 442 344 { 443 // QC registration 444 return pdfQcIsValid && qcDateIsValid && qcCommentsIsValid; 445 } 446 345 return libDateIsValid && wellTableIsValid && qubitCsvIsValid; 346 } 447 347 } 448 348 … … 456 356 Main.hide('gocancel'); 457 357 458 var url = '';459 358 var submitInfo = {}; 460 359 submitInfo.bioplate = parseInt(frm.bioplate.value, 10); 461 360 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; 469 365 470 471 472 473 474 475 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 } 477 373 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; 495 378 496 379 if (debug) Main.debug(JSON.stringify(submitInfo)); … … 549 432 <p:path><p:pathelement 550 433 title="Reggie" href="<%="../index.jsp?ID="+ID%>" 551 /><p:pathelement title="Library registration and quality control results"434 /><p:pathelement title="Library registration" 552 435 /></p:path> 553 436 … … 588 471 </td> 589 472 </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"> 606 474 <td class="prompt">Outcome</td> 607 475 <td class="input"> … … 623 491 </div> 624 492 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…" 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;"> 684 495 <table class="stepform"> 685 496 <tr>
Note: See TracChangeset
for help on using the changeset viewer.