Changeset 1726


Ignore:
Timestamp:
Oct 4, 2012, 3:49:43 PM (8 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #418: Dates are not parsed correctly by the sample report generator

Hope this doesn't break some other wizard...

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

Legend:

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

    r1720 r1726  
    195195  if (!isValidDate)
    196196  {
    197     var dayInMonth = parseInt(datePart.substring(-2)); // Last two characters
     197    var dayInMonth = parseInt(datePart.substring(-2), 10); // Last two characters
    198198    if (dayInMonth > 60)
    199199    {
     
    348348    if (pnr.length == 10 && pnrIsValid)
    349349    {
    350       var year = fullYear(parseInt(pnr.substr(0, 2)));
     350      var year = fullYear(parseInt(pnr.substr(0, 2), 10));
    351351      pnr = year + pnr.substr(2);
    352352    }
     
    483483  if (frm.copyConsent.checked && frm.copyConsent.value)
    484484  {
    485     bloodInfo.copyConsent = parseInt(frm.copyConsent.value);
     485    bloodInfo.copyConsent = parseInt(frm.copyConsent.value, 10);
    486486  }
    487487
  • extensions/net.sf.basedb.reggie/trunk/resources/edit_dnarna_details.jsp

    r1648 r1726  
    6262  var frm = document.forms['details'];
    6363
    64   lysate.qiacubePosition = parseInt(frm.qiacubePosition.value);
     64  lysate.qiacubePosition = parseInt(frm.qiacubePosition.value, 10);
    6565  lysate.originalQuantity = parseFloat(frm.lysateOriginalQuantity.value);
    6666  lysate.processedQuantity = parseFloat(frm.lysateUsedQuantity.value);
     
    8484 
    8585  // Qiacube position
    86   var qiacubePosition = parseInt(frm.qiacubePosition.value);
     86  var qiacubePosition = parseInt(frm.qiacubePosition.value, 10);
    8787  if (!(qiacubePosition > 0) || !(qiacubePosition <= 12))
    8888  {
  • extensions/net.sf.basedb.reggie/trunk/resources/extraction_registration.jsp

    r1719 r1726  
    550550  submitInfo.lysates = selectedLysates;
    551551  submitInfo.lysisDate = frm.lysisDate.value;
    552   submitInfo.lysisProtocol = parseInt(frm.lysisProtocol.value);
     552  submitInfo.lysisProtocol = parseInt(frm.lysisProtocol.value, 10);
    553553  submitInfo.qiacubeDate = frm.qiacubeDate.value;
    554   submitInfo.qiacubeRunNo = parseInt(frm.qiacubeRunNo.value);
     554  submitInfo.qiacubeRunNo = parseInt(frm.qiacubeRunNo.value, 10);
    555555  submitInfo.qiacubeOperator = frm.qiacubeOperator.value;
    556   submitInfo.dnaProtocol = parseInt(frm.dnaProtocol.value);
    557   submitInfo.rnaProtocol = parseInt(frm.rnaProtocol.value);
    558   submitInfo.ftProtocol = parseInt(frm.ftProtocol.value);
     556  submitInfo.dnaProtocol = parseInt(frm.dnaProtocol.value, 10);
     557  submitInfo.rnaProtocol = parseInt(frm.rnaProtocol.value, 10);
     558  submitInfo.ftProtocol = parseInt(frm.ftProtocol.value, 10);
    559559
    560560  if (debug) Main.debug(JSON.stringify(submitInfo));
     
    669669    return;
    670670  }
    671   if (!(parseInt(runNumber) >= 1))
     671  if (!(parseInt(runNumber, 10) >= 1))
    672672  {
    673673    setInputStatus('qiacubeRunNo', 'Must be at least 1', 'invalid');
  • extensions/net.sf.basedb.reggie/trunk/resources/histology_block.jsp

    r1696 r1726  
    272272 
    273273  workList.moveDate = frm.moveDate.value;
    274   workList.protocolId = parseInt(frm.histologyProtocol[frm.histologyProtocol.selectedIndex].value);
     274  workList.protocolId = parseInt(frm.histologyProtocol[frm.histologyProtocol.selectedIndex].value, 10);
    275275
    276276  for (var blockNo = 0; blockNo < workList.blocks.length; blockNo++)
  • extensions/net.sf.basedb.reggie/trunk/resources/histology_glass.jsp

    r1696 r1726  
    332332  {
    333333    var field = frm[wells[i]];
    334     if (!(parseInt(field.value) > 0))
     334    if (!(parseInt(field.value, 10) > 0))
    335335    {
    336336      setInputStatus(field.name, null, 'invalid');
     
    358358{
    359359  var frm = document.forms['reggie'];
    360   if (!(parseInt(frm[field].value) > 0))
     360  if (!(parseInt(frm[field].value, 10) > 0))
    361361  {
    362362    frm[field].focus();
     
    380380    var field = frm[wells[i]];
    381381    field.disabled = true;
    382     if (parseInt(field.value) > maxIndex)
    383     {
    384       maxIndex = parseInt(field.value);
     382    if (parseInt(field.value, 10) > maxIndex)
     383    {
     384      maxIndex = parseInt(field.value, 10);
    385385    }
    386386  }
     
    538538    if (frm[field])
    539539    {
    540       well.GoodStain = parseInt(frm[field].value);
     540      well.GoodStain = parseInt(frm[field].value, 10);
    541541    }
    542542  }
     
    559559  var submitInfo = new Object();
    560560  paraffinBlock.stainDate = frm.stainDate.value;
    561   paraffinBlock.protocolId = parseInt(frm.stainingProtocol[frm.stainingProtocol.selectedIndex].value);
     561  paraffinBlock.protocolId = parseInt(frm.stainingProtocol[frm.stainingProtocol.selectedIndex].value, 10);
    562562  submitInfo.paraffinBlock = paraffinBlock;
    563563 
  • extensions/net.sf.basedb.reggie/trunk/resources/histology_protocol2.jsp

    r1699 r1726  
    150150    if (numLabelsPerBlock == null) return;
    151151   
    152     if (!parseInt(numLabelsPerBlock))
     152    if (!parseInt(numLabelsPerBlock, 10))
    153153    {
    154154      alert('"' + numLabelsPerBlock + '" is not a valid number');
     
    158158    var url = 'Histology.servlet?ID=<%=ID%>&cmd=DownloadHEGlassLabels';
    159159    url += '&workListId=<%=listId%>';
    160     url += '&numSlides=' + parseInt(numLabelsPerBlock);
     160    url += '&numSlides=' + parseInt(numLabelsPerBlock, 10);
    161161   
    162162    location.href = url;
  • extensions/net.sf.basedb.reggie/trunk/resources/histology_work_list.jsp

    r1696 r1726  
    220220  for (var i = 0; i < frm.histology.length; i++)
    221221  {
    222     if (frm.histology[i].selected) histology[histology.length] = parseInt(frm.histology[i].value);
     222    if (frm.histology[i].selected) histology[histology.length] = parseInt(frm.histology[i].value, 10);
    223223  }
    224224 
  • extensions/net.sf.basedb.reggie/trunk/resources/persinfo.jsp

    r1720 r1726  
    226226  if (!isValidDate)
    227227  {
    228     var dayInMonth = parseInt(datePart.substring(-2)); // Last two characters
     228    var dayInMonth = parseInt(datePart.substring(-2), 10); // Last two characters
    229229    if (dayInMonth > 60)
    230230    {
     
    463463  if (pnr.length == 10 && pnrIsValid)
    464464  {
    465     var year = fullYear(parseInt(pnr.substr(0, 2)));
     465    var year = fullYear(parseInt(pnr.substr(0, 2), 10));
    466466    pnr = year + pnr.substr(2);
    467467  }
     
    805805  if (frm.copyConsent.checked && frm.copyConsent.value)
    806806  {
    807     caseInfo.copyConsent = parseInt(frm.copyConsent.value);
     807    caseInfo.copyConsent = parseInt(frm.copyConsent.value, 10);
    808808  }
    809809
  • extensions/net.sf.basedb.reggie/trunk/resources/reggie.js

    r1668 r1726  
    169169  for (var i = 0; i < 9; i++)
    170170  {
    171     var digit = parseInt(pnr.substr(i, 1));
     171    var digit = parseInt(pnr.substr(i, 1), 10);
    172172    var tmp = factor * digit;
    173173    sum += tmp >= 10 ? tmp - 9: tmp;
     
    177177  var control = 10 - (sum % 10);
    178178  if (control == 10) control = 0;
    179   return (control == parseInt(pnr.substr(9, 1)))
     179  return (control == parseInt(pnr.substr(9, 1), 10))
    180180}
    181181
     
    207207  if (shortDate.length == 4 && Dates.isDate(shortDate, 'MMdd'))
    208208  {
    209     var month = parseInt(shortDate.substring(0,2));
    210     var date = parseInt(shortDate.substring(2));
     209    var month = parseInt(shortDate.substring(0,2), 10);
     210    var date = parseInt(shortDate.substring(2), 10);
    211211    if ((month > (currentDate.getMonth()+1))  ||
    212212        ( (month == (currentDate.getMonth()+1)) && (date > currentDate.getDate())) )
     
    218218  else if (shortDate.length == 6 && Dates.isDate(shortDate, 'yyMMdd'))
    219219  {
    220     var year = parseInt(shortDate.substring(0,2));   
     220    var year = parseInt(shortDate.substring(0,2), 10);   
    221221    fullDateString = ((2000+year)>currentYear ? "19" : "20") + fullDateString;
    222222  }
  • extensions/net.sf.basedb.reggie/trunk/resources/rnaqc_aliquot.jsp

    r1689 r1726  
    656656  }
    657657 
    658   var colC = parseInt(column)-1;
     658  var colC = parseInt(column, 10)-1;
    659659  if (isNaN(colC) || colC < 0 || colC >= selectedBioPlate.geometry.columns)
    660660  {
     
    767767 
    768768  var protocol = new Object();
    769   protocol.id = parseInt(frm.protocols[frm.protocols.selectedIndex].value);
     769  protocol.id = parseInt(frm.protocols[frm.protocols.selectedIndex].value, 10);
    770770  if (protocol.id != 0)
    771771  {
     
    777777  {
    778778    var rnaQc = new Object();
    779     rnaQc.parentId = parseInt(selectedRnaExtracts[i].id);
     779    rnaQc.parentId = parseInt(selectedRnaExtracts[i].id, 10);
    780780    rnaQc.name = selectedRnaExtracts[i].nextRnaQcName;
    781781    rnaQc.row = frm['row'+i].value;
  • extensions/net.sf.basedb.reggie/trunk/resources/rnaqc_plate_import.jsp

    r1653 r1726  
    151151{
    152152  var frm = document.forms['reggie'];
    153   var csvId = parseInt(frm['csv.id'].value);
    154   var gxdStdId = parseInt(frm['gxd.std.id'].value);
    155   var gxdHiId = parseInt(frm['gxd.hi.id'].value);
    156   var pdfId = parseInt(frm['pdf.id'].value);
     153  var csvId = parseInt(frm['csv.id'].value, 10);
     154  var gxdStdId = parseInt(frm['gxd.std.id'].value, 10);
     155  var gxdHiId = parseInt(frm['gxd.hi.id'].value, 10);
     156  var pdfId = parseInt(frm['pdf.id'].value, 10);
    157157 
    158158  if (!csvId)
  • extensions/net.sf.basedb.reggie/trunk/resources/samplereportgenerator.jsp

    r1653 r1726  
    9494      {
    9595        fdate = frm.fromdate.value;
    96         fdate = new Date(fdate.substr(0,4), parseInt(fdate.substr(4,2))-1, fdate.substr(6,2));
     96        fdate = new Date(fdate.substr(0,4), parseInt(fdate.substr(4,2), 10)-1, fdate.substr(6,2));
    9797      }
    9898    }
     
    109109      {
    110110        tdate = frm.todate.value;
    111         tdate = new Date(tdate.substr(0,4), parseInt(tdate.substr(4,2))-1, tdate.substr(6,2));
     111        tdate = new Date(tdate.substr(0,4), parseInt(tdate.substr(4,2), 10)-1, tdate.substr(6,2));
    112112      }
    113113    }
     
    371371        if (currentYear == startDate.getFullYear())
    372372        {
    373           colspan =  11-parseInt(startDate.getMonth())+1;
     373          colspan =  11-startDate.getMonth()+1;
    374374          if (endDate.getFullYear() == currentYear)
    375375          {
    376             colspan = colspan - (11-parseInt(endDate.getMonth()));
     376            colspan = colspan - (11-endDate.getMonth());
    377377          }
    378378        }
    379379        else if (currentYear == endDate.getFullYear())
    380           colspan = parseInt(endDate.getMonth()+1);
     380          colspan = endDate.getMonth()+1;
    381381        else
    382382          colspan = 12;
     
    560560        columnCounter++;       
    561561      }while (columnCounter< numCols)     
    562       tableRow.appendChild(getTableCellElement(parseInt(grandTotal), 'rowsummary'));
     562      tableRow.appendChild(getTableCellElement(grandTotal, 'rowsummary'));
    563563      reportTable.appendChild(tableRow);
    564564    }
  • extensions/net.sf.basedb.reggie/trunk/resources/specimentube.jsp

    r1720 r1726  
    422422    {
    423423      nextWellRow = response.freeRow;
    424       nextWellColumn = parseInt(response.freeColumn)+1;   
     424      nextWellColumn = parseInt(response.freeColumn, 10)+1;   
    425425     
    426426      nextWellColumn = nextWellColumn + tubeIndex;
     
    553553      {
    554554        nextWellRow = response.freeRow;
    555         nextWellColumn = parseInt(response.freeColumn)+1;
     555        nextWellColumn = parseInt(response.freeColumn, 10)+1;
    556556        if( (nextWellColumn + tubeIndex) > response.columns)
    557557        {
Note: See TracChangeset for help on using the changeset viewer.