extensions/net.sf.basedb.meludi/trunk/resources/libprep/edit_libprep_kit_details.js

Code
Comments
Other
Rev Date Author Line
3560 27 Oct 15 olle 1 var Details = function()
3560 27 Oct 15 olle 2 {
3560 27 Oct 15 olle 3   var details = {};
3560 27 Oct 15 olle 4   var debug = 0;
3560 27 Oct 15 olle 5
3560 27 Oct 15 olle 6   var jsonConsumables = {};
3560 27 Oct 15 olle 7
3560 27 Oct 15 olle 8   var jsonKitName = [];
3560 27 Oct 15 olle 9   var jsonLibraryPrepBox1 = [];
3560 27 Oct 15 olle 10   var jsonIndexKit = [];
3560 27 Oct 15 olle 11   var jsonContentSetBox3 = [];
3560 27 Oct 15 olle 12   var jsonOligoPoolA_FPA = [];
3560 27 Oct 15 olle 13   var jsonOligoPoolB_FPB = [];
3560 27 Oct 15 olle 14   var jsonOligoHybridizationSequencingReagent3 = [];
3560 27 Oct 15 olle 15   var jsonStringentWash1_SW1 = [];
3560 27 Oct 15 olle 16   var jsonExtensionLigationMix3 = [];
3560 27 Oct 15 olle 17   var jsonPcrMasterMix2_PMM2 = [];
3560 27 Oct 15 olle 18   var jsonUB1 = [];
3560 27 Oct 15 olle 19   var jsonTDP = [];
3560 27 Oct 15 olle 20   var jsonFilterplate = [];
3560 27 Oct 15 olle 21     
3560 27 Oct 15 olle 22   var jsonIndexPrimerA701 = [];
3560 27 Oct 15 olle 23   var jsonIndexPrimerA702 = [];
3560 27 Oct 15 olle 24   var jsonIndexPrimerA703 = [];
3560 27 Oct 15 olle 25   var jsonIndexPrimerA704 = [];
3560 27 Oct 15 olle 26   var jsonIndexPrimerA705 = [];
3560 27 Oct 15 olle 27   var jsonIndexPrimerA706 = [];
3560 27 Oct 15 olle 28   var jsonIndexPrimerA707 = [];
3560 27 Oct 15 olle 29   var jsonIndexPrimerA708 = [];
3560 27 Oct 15 olle 30   var jsonIndexPrimerA709 = [];
3560 27 Oct 15 olle 31   var jsonIndexPrimerA710 = [];
3560 27 Oct 15 olle 32   var jsonIndexPrimerA711 = [];
3560 27 Oct 15 olle 33   var jsonIndexPrimerA712 = [];
3560 27 Oct 15 olle 34     
3560 27 Oct 15 olle 35   var jsonIndexPrimerA501 = [];
3560 27 Oct 15 olle 36   var jsonIndexPrimerA502 = [];
3560 27 Oct 15 olle 37   var jsonIndexPrimerA503 = [];
3560 27 Oct 15 olle 38   var jsonIndexPrimerA504 = [];
3560 27 Oct 15 olle 39   var jsonIndexPrimerA505 = [];
3560 27 Oct 15 olle 40   var jsonIndexPrimerA506 = [];
3560 27 Oct 15 olle 41   var jsonIndexPrimerA507 = [];
3560 27 Oct 15 olle 42   var jsonIndexPrimerA508 = [];
3560 27 Oct 15 olle 43
3560 27 Oct 15 olle 44   var jsonRegistrationDate = [];
3560 27 Oct 15 olle 45   var jsonLastUpdatedDate = [];
3560 27 Oct 15 olle 46   var jsonExpirationDate = [];
3610 20 Nov 15 olle 47   var jsonActive = [];
3560 27 Oct 15 olle 48   var jsonTimesUsed = [];
3560 27 Oct 15 olle 49   var jsonUnusedFpaPlateLocs = [];
3560 27 Oct 15 olle 50   var jsonComment = [];
3560 27 Oct 15 olle 51
4206 04 Nov 16 olle 52   var bioplateGlobal;
4206 04 Nov 16 olle 53
3560 27 Oct 15 olle 54   // Page initialization
3560 27 Oct 15 olle 55   details.initPage = function()
3560 27 Oct 15 olle 56   {
3560 27 Oct 15 olle 57     Buttons.addClickHandler('close', App.closeWindow);
3560 27 Oct 15 olle 58     Buttons.addClickHandler('btnSave', details.saveDetails);
3560 27 Oct 15 olle 59
3560 27 Oct 15 olle 60     Events.addEventHandler('expirationDate', 'change', details.expirationDateOnChange);
3560 27 Oct 15 olle 61     Events.addEventHandler('numTimesUsed', 'keypress', Events.numberOnly);
3560 27 Oct 15 olle 62     
3560 27 Oct 15 olle 63     var index = Data.int('page-data', 'index');
3560 27 Oct 15 olle 64     var frm = document.forms['details'];
3560 27 Oct 15 olle 65     var pfrm = window.opener.document.forms['meludi'];
3560 27 Oct 15 olle 66
3560 27 Oct 15 olle 67     // Get JSONObject with kit component JSONArrays for all kits
3560 27 Oct 15 olle 68     jsonConsumables = window.opener.ExtractionReg.fetchJsonConsumables();
3560 27 Oct 15 olle 69 //alert("edit_libprep_kit_details.js::initPage(): jsonConsumables = " + JSON.stringify(jsonConsumables));
3560 27 Oct 15 olle 70
3560 27 Oct 15 olle 71 /*
3560 27 Oct 15 olle 72     // Get kit component JSONArrays for all kits    
3560 27 Oct 15 olle 73     var jsonKitName = jsonConsumables['KitName'];
3560 27 Oct 15 olle 74     var jsonLibraryPrepBox1 = jsonConsumables['LibraryPrepBox1'];
3560 27 Oct 15 olle 75     var jsonIndexKit = jsonConsumables['IndexKit'];
3560 27 Oct 15 olle 76     var jsonContentSetBox3 = jsonConsumables['ContentSetBox3'];
3560 27 Oct 15 olle 77     var jsonOligoPoolA_FPA = jsonConsumables['OligoPoolA_FPA'];
3560 27 Oct 15 olle 78     var jsonOligoPoolB_FPB = jsonConsumables['OligoPoolB_FPB'];
3560 27 Oct 15 olle 79     var jsonOligoHybridizationSequencingReagent3 = jsonConsumables['OligoHybridizationSequencingReagent3'];
3560 27 Oct 15 olle 80     var jsonStringentWash1_SW1 = jsonConsumables['StringentWash1_SW1'];
3560 27 Oct 15 olle 81     var jsonExtensionLigationMix3 = jsonConsumables['ExtensionLigationMix3'];
3560 27 Oct 15 olle 82     var jsonPcrMasterMix2_PMM2 = jsonConsumables['PcrMasterMix2_PMM2'];
3560 27 Oct 15 olle 83     var jsonUB1 = jsonConsumables['UB1'];
3560 27 Oct 15 olle 84     var jsonTDP = jsonConsumables['TDP'];
3560 27 Oct 15 olle 85     var jsonFilterplate = jsonConsumables['Filterplate'];
3560 27 Oct 15 olle 86     
3560 27 Oct 15 olle 87     var jsonIndexPrimerA701 = jsonConsumables['IndexPrimerA701'];
3560 27 Oct 15 olle 88     var jsonIndexPrimerA702 = jsonConsumables['IndexPrimerA702'];
3560 27 Oct 15 olle 89     var jsonIndexPrimerA703 = jsonConsumables['IndexPrimerA703'];
3560 27 Oct 15 olle 90     var jsonIndexPrimerA704 = jsonConsumables['IndexPrimerA704'];
3560 27 Oct 15 olle 91     var jsonIndexPrimerA705 = jsonConsumables['IndexPrimerA705'];
3560 27 Oct 15 olle 92     var jsonIndexPrimerA706 = jsonConsumables['IndexPrimerA706'];
3560 27 Oct 15 olle 93     var jsonIndexPrimerA707 = jsonConsumables['IndexPrimerA707'];
3560 27 Oct 15 olle 94     var jsonIndexPrimerA708 = jsonConsumables['IndexPrimerA708'];
3560 27 Oct 15 olle 95     var jsonIndexPrimerA709 = jsonConsumables['IndexPrimerA709'];
3560 27 Oct 15 olle 96     var jsonIndexPrimerA710 = jsonConsumables['IndexPrimerA710'];
3560 27 Oct 15 olle 97     var jsonIndexPrimerA711 = jsonConsumables['IndexPrimerA711'];
3560 27 Oct 15 olle 98     var jsonIndexPrimerA712 = jsonConsumables['IndexPrimerA712'];
3560 27 Oct 15 olle 99     
3560 27 Oct 15 olle 100     var jsonIndexPrimerA501 = jsonConsumables['IndexPrimerA501'];
3560 27 Oct 15 olle 101     var jsonIndexPrimerA502 = jsonConsumables['IndexPrimerA502'];
3560 27 Oct 15 olle 102     var jsonIndexPrimerA503 = jsonConsumables['IndexPrimerA503'];
3560 27 Oct 15 olle 103     var jsonIndexPrimerA504 = jsonConsumables['IndexPrimerA504'];
3560 27 Oct 15 olle 104     var jsonIndexPrimerA505 = jsonConsumables['IndexPrimerA505'];
3560 27 Oct 15 olle 105     var jsonIndexPrimerA506 = jsonConsumables['IndexPrimerA506'];
3560 27 Oct 15 olle 106     var jsonIndexPrimerA507 = jsonConsumables['IndexPrimerA507'];
3560 27 Oct 15 olle 107     var jsonIndexPrimerA508 = jsonConsumables['IndexPrimerA508'];
3560 27 Oct 15 olle 108
3560 27 Oct 15 olle 109     var jsonRegistrationDate = jsonConsumables['RegistrationDate'];
3560 27 Oct 15 olle 110     var jsonLastUpdatedDate = jsonConsumables['LastUpdatedDate'];
3560 27 Oct 15 olle 111     var jsonExpirationDate = jsonConsumables['ExpirationDate'];
3610 20 Nov 15 olle 112     var jsonActive = jsonConsumables['Active'];
3560 27 Oct 15 olle 113     var jsonTimesUsed = jsonConsumables['TimesUsed'];
3560 27 Oct 15 olle 114     var jsonUnusedFpaPlateLocs = jsonConsumables['UnusedFpaPlateLocs'];
3560 27 Oct 15 olle 115     var jsonComment = jsonConsumables['Comment'];
3560 27 Oct 15 olle 116 */
3610 20 Nov 15 olle 117
3560 27 Oct 15 olle 118     // Get kit component JSONArrays for all kits    
3560 27 Oct 15 olle 119     jsonKitName = jsonConsumables['KitName'];
3560 27 Oct 15 olle 120     jsonLibraryPrepBox1 = jsonConsumables['LibraryPrepBox1'];
3560 27 Oct 15 olle 121     jsonIndexKit = jsonConsumables['IndexKit'];
3560 27 Oct 15 olle 122     jsonContentSetBox3 = jsonConsumables['ContentSetBox3'];
3560 27 Oct 15 olle 123     jsonOligoPoolA_FPA = jsonConsumables['OligoPoolA_FPA'];
3560 27 Oct 15 olle 124     jsonOligoPoolB_FPB = jsonConsumables['OligoPoolB_FPB'];
3560 27 Oct 15 olle 125     jsonOligoHybridizationSequencingReagent3 = jsonConsumables['OligoHybridizationSequencingReagent3'];
3560 27 Oct 15 olle 126     jsonStringentWash1_SW1 = jsonConsumables['StringentWash1_SW1'];
3560 27 Oct 15 olle 127     jsonExtensionLigationMix3 = jsonConsumables['ExtensionLigationMix3'];
3560 27 Oct 15 olle 128     jsonPcrMasterMix2_PMM2 = jsonConsumables['PcrMasterMix2_PMM2'];
3560 27 Oct 15 olle 129     jsonUB1 = jsonConsumables['UB1'];
3560 27 Oct 15 olle 130     jsonTDP = jsonConsumables['TDP'];
3560 27 Oct 15 olle 131     jsonFilterplate = jsonConsumables['Filterplate'];
3560 27 Oct 15 olle 132     
3560 27 Oct 15 olle 133     jsonIndexPrimerA701 = jsonConsumables['IndexPrimerA701'];
3560 27 Oct 15 olle 134     jsonIndexPrimerA702 = jsonConsumables['IndexPrimerA702'];
3560 27 Oct 15 olle 135     jsonIndexPrimerA703 = jsonConsumables['IndexPrimerA703'];
3560 27 Oct 15 olle 136     jsonIndexPrimerA704 = jsonConsumables['IndexPrimerA704'];
3560 27 Oct 15 olle 137     jsonIndexPrimerA705 = jsonConsumables['IndexPrimerA705'];
3560 27 Oct 15 olle 138     jsonIndexPrimerA706 = jsonConsumables['IndexPrimerA706'];
3560 27 Oct 15 olle 139     jsonIndexPrimerA707 = jsonConsumables['IndexPrimerA707'];
3560 27 Oct 15 olle 140     jsonIndexPrimerA708 = jsonConsumables['IndexPrimerA708'];
3560 27 Oct 15 olle 141     jsonIndexPrimerA709 = jsonConsumables['IndexPrimerA709'];
3560 27 Oct 15 olle 142     jsonIndexPrimerA710 = jsonConsumables['IndexPrimerA710'];
3560 27 Oct 15 olle 143     jsonIndexPrimerA711 = jsonConsumables['IndexPrimerA711'];
3560 27 Oct 15 olle 144     jsonIndexPrimerA712 = jsonConsumables['IndexPrimerA712'];
3560 27 Oct 15 olle 145     
3560 27 Oct 15 olle 146     jsonIndexPrimerA501 = jsonConsumables['IndexPrimerA501'];
3560 27 Oct 15 olle 147     jsonIndexPrimerA502 = jsonConsumables['IndexPrimerA502'];
3560 27 Oct 15 olle 148     jsonIndexPrimerA503 = jsonConsumables['IndexPrimerA503'];
3560 27 Oct 15 olle 149     jsonIndexPrimerA504 = jsonConsumables['IndexPrimerA504'];
3560 27 Oct 15 olle 150     jsonIndexPrimerA505 = jsonConsumables['IndexPrimerA505'];
3560 27 Oct 15 olle 151     jsonIndexPrimerA506 = jsonConsumables['IndexPrimerA506'];
3560 27 Oct 15 olle 152     jsonIndexPrimerA507 = jsonConsumables['IndexPrimerA507'];
3560 27 Oct 15 olle 153     jsonIndexPrimerA508 = jsonConsumables['IndexPrimerA508'];
3560 27 Oct 15 olle 154
3560 27 Oct 15 olle 155     jsonRegistrationDate = jsonConsumables['RegistrationDate'];
3560 27 Oct 15 olle 156     jsonLastUpdatedDate = jsonConsumables['LastUpdatedDate'];
3560 27 Oct 15 olle 157     jsonExpirationDate = jsonConsumables['ExpirationDate'];
3610 20 Nov 15 olle 158     jsonActive = jsonConsumables['Active'];
3560 27 Oct 15 olle 159     jsonTimesUsed = jsonConsumables['TimesUsed'];
3560 27 Oct 15 olle 160     jsonUnusedFpaPlateLocs = jsonConsumables['UnusedFpaPlateLocs'];
3560 27 Oct 15 olle 161     jsonComment = jsonConsumables['Comment'];
3560 27 Oct 15 olle 162     // Get kit component values for current kit
3560 27 Oct 15 olle 163     var kitName = jsonKitName[index];
3560 27 Oct 15 olle 164     var expirationDate = jsonExpirationDate[index];
3610 20 Nov 15 olle 165     var active = jsonActive[index];
3560 27 Oct 15 olle 166     var numTimesUsed = jsonTimesUsed[index];
3560 27 Oct 15 olle 167     var unusedFpaPlateLocs = jsonUnusedFpaPlateLocs[index];
3560 27 Oct 15 olle 168     var comment = jsonComment[index];
3560 27 Oct 15 olle 169
3610 20 Nov 15 olle 170     var activeStr = 'yes';
3610 20 Nov 15 olle 171     if (!jsonActive[index])
3610 20 Nov 15 olle 172     {
3610 20 Nov 15 olle 173       activeStr = 'no';
3610 20 Nov 15 olle 174     }
3610 20 Nov 15 olle 175     var timesUsed = '' + jsonTimesUsed[index];
3610 20 Nov 15 olle 176
3560 27 Oct 15 olle 177     // Enter default values for input fields
3560 27 Oct 15 olle 178     //
3560 27 Oct 15 olle 179     frm.expirationDate.value = Strings.encodeTags(expirationDate);
3610 20 Nov 15 olle 180     frm.active.value = activeStr;
3610 20 Nov 15 olle 181     frm.numTimesUsed.value = Strings.encodeTags(timesUsed);
4206 04 Nov 16 olle 182     //frm.unusedFpaLocs.value = Strings.encodeTags(unusedFpaPlateLocs);
3560 27 Oct 15 olle 183     frm.kitComment.value = Strings.encodeTags(comment);
3560 27 Oct 15 olle 184     //
3560 27 Oct 15 olle 185     Doc.element('libraryPrepBox1.default').innerHTML = Strings.encodeTags(jsonLibraryPrepBox1[index]);
3560 27 Oct 15 olle 186     Doc.element('indexKit.default').innerHTML = Strings.encodeTags(jsonIndexKit[index]);
3560 27 Oct 15 olle 187     Doc.element('contentSetBox3.default').innerHTML = Strings.encodeTags(jsonContentSetBox3[index]);
3560 27 Oct 15 olle 188     Doc.element('oligoPoolA_FPA.default').innerHTML = Strings.encodeTags(jsonOligoPoolA_FPA[index]);
3560 27 Oct 15 olle 189     Doc.element('oligoPoolB_FPB.default').innerHTML = Strings.encodeTags(jsonOligoPoolB_FPB[index]);
3560 27 Oct 15 olle 190     Doc.element('oligoHybridizationSequencingReagent3.default').innerHTML = Strings.encodeTags(jsonOligoHybridizationSequencingReagent3[index]);
3560 27 Oct 15 olle 191     Doc.element('stringentWash1_SW1.default').innerHTML = Strings.encodeTags(jsonStringentWash1_SW1[index]);
3560 27 Oct 15 olle 192     Doc.element('extensionLigationMix3.default').innerHTML = Strings.encodeTags(jsonExtensionLigationMix3[index]);
3560 27 Oct 15 olle 193     Doc.element('pcrMasterMix2_PMM2.default').innerHTML = Strings.encodeTags(jsonPcrMasterMix2_PMM2[index]);
3560 27 Oct 15 olle 194     Doc.element('ub1.default').innerHTML = Strings.encodeTags(jsonUB1[index]);
3560 27 Oct 15 olle 195     Doc.element('tdp.default').innerHTML = Strings.encodeTags(jsonTDP[index]);
3560 27 Oct 15 olle 196     Doc.element('filterplate.default').innerHTML = Strings.encodeTags(jsonFilterplate[index]);
3560 27 Oct 15 olle 197     //
3560 27 Oct 15 olle 198     Doc.element('indexPrimerA701.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA701[index]);
3560 27 Oct 15 olle 199     Doc.element('indexPrimerA702.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA702[index]);
3560 27 Oct 15 olle 200     Doc.element('indexPrimerA703.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA703[index]);
3560 27 Oct 15 olle 201     Doc.element('indexPrimerA704.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA704[index]);
3560 27 Oct 15 olle 202     Doc.element('indexPrimerA705.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA705[index]);
3560 27 Oct 15 olle 203     Doc.element('indexPrimerA706.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA706[index]);
3560 27 Oct 15 olle 204     Doc.element('indexPrimerA707.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA707[index]);
3560 27 Oct 15 olle 205     Doc.element('indexPrimerA708.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA708[index]);
3560 27 Oct 15 olle 206     Doc.element('indexPrimerA709.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA709[index]);
3560 27 Oct 15 olle 207     Doc.element('indexPrimerA710.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA710[index]);
3560 27 Oct 15 olle 208     Doc.element('indexPrimerA711.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA711[index]);
3560 27 Oct 15 olle 209     Doc.element('indexPrimerA712.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA712[index]);
3560 27 Oct 15 olle 210     //
3560 27 Oct 15 olle 211     Doc.element('indexPrimerA501.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA501[index]);
3560 27 Oct 15 olle 212     Doc.element('indexPrimerA502.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA502[index]);
3560 27 Oct 15 olle 213     Doc.element('indexPrimerA503.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA503[index]);
3560 27 Oct 15 olle 214     Doc.element('indexPrimerA504.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA504[index]);
3560 27 Oct 15 olle 215     Doc.element('indexPrimerA505.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA505[index]);
3560 27 Oct 15 olle 216     Doc.element('indexPrimerA506.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA506[index]);
3560 27 Oct 15 olle 217     Doc.element('indexPrimerA507.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA507[index]);
3560 27 Oct 15 olle 218     Doc.element('indexPrimerA508.default').innerHTML = Strings.encodeTags(jsonIndexPrimerA508[index]);
3560 27 Oct 15 olle 219
3560 27 Oct 15 olle 220 /*
3560 27 Oct 15 olle 221     var reagents = window.opener.ExtractionReg.REAGENTS;
3560 27 Oct 15 olle 222     for (var i = 0; i < reagents.length; i++)
3560 27 Oct 15 olle 223     {
3560 27 Oct 15 olle 224       var rg = reagents[i];
3560 27 Oct 15 olle 225       frm[rg].value = specimen[rg] || '';
3560 27 Oct 15 olle 226       Doc.element(rg+'.default').innerHTML = Strings.encodeTags(pfrm[rg].value);
3560 27 Oct 15 olle 227     }
3560 27 Oct 15 olle 228 */    
3560 27 Oct 15 olle 229     //details.checkForm();
4206 04 Nov 16 olle 230
4206 04 Nov 16 olle 231     // Get JSONObject with plate info for selected kit
4206 04 Nov 16 olle 232     details.kitPlateInfoLoaded();
4206 04 Nov 16 olle 233   }
4206 04 Nov 16 olle 234
4206 04 Nov 16 olle 235   details.kitPlateInfoLoaded = function()
4206 04 Nov 16 olle 236   {
4206 04 Nov 16 olle 237     var frm = document.forms['meludi'];
4206 04 Nov 16 olle 238     // Get JSONObject with plate info for selected kit
4206 04 Nov 16 olle 239     var plateInfo = window.opener.ExtractionReg.fetchKitPlateInfo();
4206 04 Nov 16 olle 240     if (plateInfo)
4206 04 Nov 16 olle 241     {
4206 04 Nov 16 olle 242       // Display half plate chart of unused wells for FPA aliquots
4206 04 Nov 16 olle 243       bioplateGlobal = plateInfo;
4206 04 Nov 16 olle 244       var bioplate = bioplateGlobal;
4206 04 Nov 16 olle 245       // Editable plate table with checkboxes
4206 04 Nov 16 olle 246       var addCheckboxes = true;
4206 04 Nov 16 olle 247       var html = '';
4206 04 Nov 16 olle 248       html += '<br>';
4206 04 Nov 16 olle 249       html += details.buildKitInfoPlate(bioplate, addCheckboxes);
4206 04 Nov 16 olle 250       html += '<br>';
4206 04 Nov 16 olle 251       Doc.element('kitplatetablecontent').innerHTML = html;
4206 04 Nov 16 olle 252       Doc.show('kitplatetablecontent');
4206 04 Nov 16 olle 253       // Default plate table
4206 04 Nov 16 olle 254       addCheckboxes = false;
4206 04 Nov 16 olle 255       html = '';
4206 04 Nov 16 olle 256       html += '<br>';
4206 04 Nov 16 olle 257       html += details.buildKitInfoPlate(bioplate, addCheckboxes);
4206 04 Nov 16 olle 258       html += '<br>';
4206 04 Nov 16 olle 259       Doc.element('kitplatetablecontentdefault').innerHTML = html;
4206 04 Nov 16 olle 260       Doc.show('kitplatetablecontentdefault');
4206 04 Nov 16 olle 261     }
3560 27 Oct 15 olle 262     frm.kitComment.focus();
3560 27 Oct 15 olle 263   }
4206 04 Nov 16 olle 264
4206 04 Nov 16 olle 265   details.buildKitInfoPlate = function(plate, addCheckboxes)
4206 04 Nov 16 olle 266   {
4206 04 Nov 16 olle 267     // Table with kit FPA plate location data
4206 04 Nov 16 olle 268
4206 04 Nov 16 olle 269     // Added data for kit
4206 04 Nov 16 olle 270     var kitName = plate.kitName;
4206 04 Nov 16 olle 271     var expirationDate = plate.expirationDate;
4206 04 Nov 16 olle 272     var timesUsed = plate.timesUsed;
4206 04 Nov 16 olle 273     //
4206 04 Nov 16 olle 274     var unusedWellsJsonArr = plate.unusedWells;
4206 04 Nov 16 olle 275     var effUnusedWellsJsonArr = plate.effUnusedWells;
4206 04 Nov 16 olle 276     var reservedWellsJsonArr = plate.reservedWells;
4206 04 Nov 16 olle 277
4206 04 Nov 16 olle 278     // Kit as plate
4206 04 Nov 16 olle 279     // Only show FPA columns, i.e. columns 0-5
4206 04 Nov 16 olle 280     var colNoEnd = 5;
4206 04 Nov 16 olle 281     if (plate.geometry.columns < colNoEnd)
4206 04 Nov 16 olle 282     {
4206 04 Nov 16 olle 283       colNoEnd = plate.geometry.columns;
4206 04 Nov 16 olle 284     }
4206 04 Nov 16 olle 285     
4206 04 Nov 16 olle 286     // Create HTML table header row
4206 04 Nov 16 olle 287     var html = '';
4206 04 Nov 16 olle 288     html += '<table class="plate">';
4206 04 Nov 16 olle 289     html += '<tr class="header"><th></th>';
4206 04 Nov 16 olle 290     for (var colNo = 0; colNo <= colNoEnd; colNo++)
4206 04 Nov 16 olle 291     {
4206 04 Nov 16 olle 292       html += '<th>'+(colNo+1)+'</th>';
4206 04 Nov 16 olle 293     }
4206 04 Nov 16 olle 294     html += '</tr>';
4206 04 Nov 16 olle 295
4206 04 Nov 16 olle 296     var wells = plate.bioWells;
4206 04 Nov 16 olle 297     var wellNo = 0;
4206 04 Nov 16 olle 298     for (var rowNo = 0; rowNo < plate.geometry.rows; rowNo++)
4206 04 Nov 16 olle 299     {
4206 04 Nov 16 olle 300       html += '<tr class="row-'+rowNo+'">';
4206 04 Nov 16 olle 301       html += '<th>'+Meludi.wellToAlpha(rowNo)+'</th>';
4206 04 Nov 16 olle 302       for (var colNo = 0; colNo <= colNoEnd; colNo++)
4206 04 Nov 16 olle 303       {
4206 04 Nov 16 olle 304         var well = wells[wellNo];
4206 04 Nov 16 olle 305         well.extraVolume = 0;
4206 04 Nov 16 olle 306         well.comment = '';
4206 04 Nov 16 olle 307
4206 04 Nov 16 olle 308         if (well.bioMaterial)
4206 04 Nov 16 olle 309         {
4206 04 Nov 16 olle 310           html += '<td id="well-'+well.id+'"';
4206 04 Nov 16 olle 311           html += ' class="well selectable col-'+colNo+'"';
4206 04 Nov 16 olle 312           html += ' title="'+Strings.encodeTags(well.bioMaterial.name)+'" data-well-id="'+well.id+'"';
4206 04 Nov 16 olle 313           html += '>0'+THIN_SPACE+'µl</td>';
4206 04 Nov 16 olle 314         }
4206 04 Nov 16 olle 315         else
4206 04 Nov 16 olle 316         {
4206 04 Nov 16 olle 317           // Check if kit is used for current well
4206 04 Nov 16 olle 318           var wellName = Meludi.wellToAlpha(rowNo) + (colNo+1);
4206 04 Nov 16 olle 319           var usedWell = true;
4206 04 Nov 16 olle 320           for (var i = 0; i < unusedWellsJsonArr.length; i++)
4206 04 Nov 16 olle 321           {
4206 04 Nov 16 olle 322             var nameOfUnusedWell = unusedWellsJsonArr[i];
4206 04 Nov 16 olle 323             if (wellName == nameOfUnusedWell)
4206 04 Nov 16 olle 324             {
4206 04 Nov 16 olle 325               usedWell = false;
4206 04 Nov 16 olle 326             }
4206 04 Nov 16 olle 327           }
4206 04 Nov 16 olle 328           var effUsedWell = true;
4206 04 Nov 16 olle 329           for (var i = 0; i < effUnusedWellsJsonArr.length; i++)
4206 04 Nov 16 olle 330           {
4206 04 Nov 16 olle 331             var nameOfUnusedWell = effUnusedWellsJsonArr[i];
4206 04 Nov 16 olle 332             if (wellName == nameOfUnusedWell)
4206 04 Nov 16 olle 333             {
4206 04 Nov 16 olle 334               effUsedWell = false;
4206 04 Nov 16 olle 335             }
4206 04 Nov 16 olle 336           }
4206 04 Nov 16 olle 337           var reservedWell = false;
4206 04 Nov 16 olle 338           for (var i = 0; i < reservedWellsJsonArr.length; i++)
4206 04 Nov 16 olle 339           {
4206 04 Nov 16 olle 340             var nameOfReservedWell = reservedWellsJsonArr[i];
4206 04 Nov 16 olle 341             if (wellName == nameOfReservedWell)
4206 04 Nov 16 olle 342             {
4206 04 Nov 16 olle 343               reservedWell = true;
4206 04 Nov 16 olle 344             }
4206 04 Nov 16 olle 345           }
4206 04 Nov 16 olle 346           var wellType = '';
4206 04 Nov 16 olle 347           if (usedWell)
4206 04 Nov 16 olle 348           {
4206 04 Nov 16 olle 349             // Empty well
4206 04 Nov 16 olle 350             wellType = 'empty';
4206 04 Nov 16 olle 351           }
4206 04 Nov 16 olle 352           else
4206 04 Nov 16 olle 353           {
4206 04 Nov 16 olle 354             // Unused well
4206 04 Nov 16 olle 355             if (effUsedWell)
4206 04 Nov 16 olle 356             {
4206 04 Nov 16 olle 357               wellType = 'unused';
4206 04 Nov 16 olle 358             }
4206 04 Nov 16 olle 359             else
4206 04 Nov 16 olle 360             {
4206 04 Nov 16 olle 361               if (reservedWell)
4206 04 Nov 16 olle 362               {
4206 04 Nov 16 olle 363                 wellType = 'reserved';
4206 04 Nov 16 olle 364               }
4206 04 Nov 16 olle 365               else
4206 04 Nov 16 olle 366               {
4206 04 Nov 16 olle 367                 wellType = 'effunused';
4206 04 Nov 16 olle 368               }
4206 04 Nov 16 olle 369             }
4206 04 Nov 16 olle 370           }
4206 04 Nov 16 olle 371
4206 04 Nov 16 olle 372           // Add HTML for table column cell (one plate well)
4206 04 Nov 16 olle 373           if (addCheckboxes)
4206 04 Nov 16 olle 374           {
4206 04 Nov 16 olle 375             var checkDefault = '';
4206 04 Nov 16 olle 376             if (!usedWell)
4206 04 Nov 16 olle 377             {
4206 04 Nov 16 olle 378               checkDefault = 'checked';
4206 04 Nov 16 olle 379             }
4206 04 Nov 16 olle 380             //html += '<td class="kitwell ' + wellType + '">';
4206 04 Nov 16 olle 381             html += '<td class="kitwell">';
4206 04 Nov 16 olle 382             html += '<input type="checkbox" id="fpaWellCb-' + wellName + '" ' + checkDefault + ' />';
4206 04 Nov 16 olle 383           }
4206 04 Nov 16 olle 384           else
4206 04 Nov 16 olle 385           {
4206 04 Nov 16 olle 386             html += '<td class="kitwell ' + wellType + ' col-' + colNo + '">';
4206 04 Nov 16 olle 387           }
4206 04 Nov 16 olle 388           html += '</td>';
4206 04 Nov 16 olle 389         }
4206 04 Nov 16 olle 390         wellNo++;
4206 04 Nov 16 olle 391       }
4206 04 Nov 16 olle 392       html += '</tr>';
4206 04 Nov 16 olle 393     }
4206 04 Nov 16 olle 394     html += '</table>';
4206 04 Nov 16 olle 395
4206 04 Nov 16 olle 396     return html;
4206 04 Nov 16 olle 397   }
4206 04 Nov 16 olle 398
3560 27 Oct 15 olle 399   details.checkForm = function()
3560 27 Oct 15 olle 400   {
3560 27 Oct 15 olle 401     var frm = document.forms['details'];
3560 27 Oct 15 olle 402     
3560 27 Oct 15 olle 403     var index = Data.int('page-data', 'index');
3560 27 Oct 15 olle 404 /*
3560 27 Oct 15 olle 405     var selItemsList = getSelectedItemsList();
3560 27 Oct 15 olle 406     var item = selItemsList[index];
3560 27 Oct 15 olle 407
3560 27 Oct 15 olle 408     // DNA
3560 27 Oct 15 olle 409     var dnaVolume = parseFloat(frm.dnaVolume.value);
3560 27 Oct 15 olle 410     if (!(dnaVolume > 0))
3560 27 Oct 15 olle 411     {
3560 27 Oct 15 olle 412       Forms.showNotification('dnaVolume', 'Invalid value for DNA volume.');
3560 27 Oct 15 olle 413       return false;
3560 27 Oct 15 olle 414     }
3560 27 Oct 15 olle 415
3560 27 Oct 15 olle 416     // RNA
3560 27 Oct 15 olle 417     var rnaVolume = parseFloat(frm.rnaVolume.value);
3560 27 Oct 15 olle 418     if (!(rnaVolume > 0))
3560 27 Oct 15 olle 419     {
3560 27 Oct 15 olle 420       Forms.showNotification('rnaVolume', 'Invalid value for RNA volume.');
3560 27 Oct 15 olle 421       showError('Invalid value for RNA volume.');
3560 27 Oct 15 olle 422       return false;
3560 27 Oct 15 olle 423     }
3560 27 Oct 15 olle 424 */
3560 27 Oct 15 olle 425     return true;
3560 27 Oct 15 olle 426   }
3560 27 Oct 15 olle 427
3560 27 Oct 15 olle 428   details.expirationDateOnChange = function()
3560 27 Oct 15 olle 429   {
3560 27 Oct 15 olle 430     var frm = document.forms['details'];
3560 27 Oct 15 olle 431     
3560 27 Oct 15 olle 432     var expirationDateIsValid = Wizard.isValid('expirationDate');
3560 27 Oct 15 olle 433 //alert("edit_libprep_kit_details.js::expirationDateOnChange(): expirationDateIsValid = " + expirationDateIsValid);
3560 27 Oct 15 olle 434     
3560 27 Oct 15 olle 435     if (!expirationDateIsValid) return;
3560 27 Oct 15 olle 436
3560 27 Oct 15 olle 437     var expirationDate = Dates.parseString(frm.expirationDate.value, 'yyyyMMdd');
3560 27 Oct 15 olle 438     if (expirationDate == null)
3560 27 Oct 15 olle 439     {
3560 27 Oct 15 olle 440       Forms.showNotification('expirationDate', 'Not a valid date.');
3560 27 Oct 15 olle 441       //Wizard.setInputStatus('expirationDate', 'invalid', 'Not a valid date');
3560 27 Oct 15 olle 442       return;
3560 27 Oct 15 olle 443     }
3560 27 Oct 15 olle 444     var currentDate = Dates.parseString(details.getTodaysDate(), 'yyyyMMdd');
3560 27 Oct 15 olle 445     if (currentDate > expirationDate)
3560 27 Oct 15 olle 446     {
3560 27 Oct 15 olle 447       Forms.showNotification('expirationDate', 'Expiration date is already passed!');
3560 27 Oct 15 olle 448       //Wizard.setInputStatus('expirationDate', 'warning', 'Expiration date is already passed!');
3560 27 Oct 15 olle 449       return;
3560 27 Oct 15 olle 450     }
3560 27 Oct 15 olle 451
3560 27 Oct 15 olle 452     //Wizard.setInputStatus('expirationDate', 'valid');
3560 27 Oct 15 olle 453   }
3560 27 Oct 15 olle 454
3560 27 Oct 15 olle 455   details.getTodaysDate = function()
3560 27 Oct 15 olle 456   {
3560 27 Oct 15 olle 457     // Get current time stamp
3560 27 Oct 15 olle 458     var now = new Date();
3560 27 Oct 15 olle 459     return exreg.timestampToDateString(now);
3560 27 Oct 15 olle 460   }
3560 27 Oct 15 olle 461
3560 27 Oct 15 olle 462   details.timestampToDateString = function(timestamp)
3560 27 Oct 15 olle 463   {
3560 27 Oct 15 olle 464     // Get  date in components yyyy, mm, dd
3560 27 Oct 15 olle 465     var yyyy = timestamp.getFullYear();
3560 27 Oct 15 olle 466     var mm = timestamp.getMonth()+1; //January is 0!
3560 27 Oct 15 olle 467     if (mm < 10)
3560 27 Oct 15 olle 468     {
3560 27 Oct 15 olle 469       mm = '0' + mm;
3560 27 Oct 15 olle 470     }
3560 27 Oct 15 olle 471     var dd = timestamp.getDate();
3560 27 Oct 15 olle 472     if (dd < 10)
3560 27 Oct 15 olle 473     {
3560 27 Oct 15 olle 474       dd = '0' + dd;
3560 27 Oct 15 olle 475     }
3560 27 Oct 15 olle 476     var dateString = '' + yyyy + mm + dd;
3560 27 Oct 15 olle 477
3560 27 Oct 15 olle 478     return dateString;
3560 27 Oct 15 olle 479   }
3560 27 Oct 15 olle 480
4206 04 Nov 16 olle 481   details.fetchUnusedFpaPlateLocations = function()
4206 04 Nov 16 olle 482   {
4206 04 Nov 16 olle 483     var frm = document.forms['details'];
4206 04 Nov 16 olle 484
4206 04 Nov 16 olle 485     // Fetch unused FPA plate locations from check box values in fpa locs table
4206 04 Nov 16 olle 486     var unusedFpaPlateLocations = "";
4206 04 Nov 16 olle 487     // Only use FPA columns, i.e. columns 0-5
4206 04 Nov 16 olle 488     var bioplate = bioplateGlobal;
4206 04 Nov 16 olle 489     var colNoEnd = 5;
4206 04 Nov 16 olle 490     if (bioplate.geometry.columns < colNoEnd)
4206 04 Nov 16 olle 491     {
4206 04 Nov 16 olle 492       colNoEnd = bioplate.geometry.columns;
4206 04 Nov 16 olle 493     }
4206 04 Nov 16 olle 494     // Unused FPA plate locations are stored column after column, from top
4206 04 Nov 16 olle 495     for (var colNo = 0; colNo <= colNoEnd; colNo++)
4206 04 Nov 16 olle 496     {
4206 04 Nov 16 olle 497       for (var rowNo = 0; rowNo < bioplate.geometry.rows; rowNo++)
4206 04 Nov 16 olle 498       {
4206 04 Nov 16 olle 499         var wellName = Meludi.wellToAlpha(rowNo) + (colNo+1);
4206 04 Nov 16 olle 500         var checkboxId = 'fpaWellCb-' + wellName;
4206 04 Nov 16 olle 501         var unusedWell = frm[checkboxId].checked;
4206 04 Nov 16 olle 502         if (unusedWell)
4206 04 Nov 16 olle 503         {
4206 04 Nov 16 olle 504           // Add well name to comma-separated list after optional comma
4206 04 Nov 16 olle 505           if (unusedFpaPlateLocations != "")
4206 04 Nov 16 olle 506           {
4206 04 Nov 16 olle 507             unusedFpaPlateLocations += ",";
4206 04 Nov 16 olle 508           }
4206 04 Nov 16 olle 509           unusedFpaPlateLocations += wellName;
4206 04 Nov 16 olle 510         }
4206 04 Nov 16 olle 511       }
4206 04 Nov 16 olle 512     }
4206 04 Nov 16 olle 513     return unusedFpaPlateLocations;
4206 04 Nov 16 olle 514   }
4206 04 Nov 16 olle 515
4206 04 Nov 16 olle 516
3560 27 Oct 15 olle 517   details.saveDetails = function()
3560 27 Oct 15 olle 518   {
3560 27 Oct 15 olle 519     if (!details.checkForm()) return;
3560 27 Oct 15 olle 520     
3560 27 Oct 15 olle 521     var index = Data.int('page-data', 'index');
3560 27 Oct 15 olle 522     //var mode = Data.get('page-data', 'mode');
3560 27 Oct 15 olle 523
3560 27 Oct 15 olle 524     // Update JSONObject jsonConsumables
3560 27 Oct 15 olle 525
3560 27 Oct 15 olle 526     var frm = document.forms['details'];
3560 27 Oct 15 olle 527
3610 20 Nov 15 olle 528     // Convert 'active' string value to boolean
3610 20 Nov 15 olle 529     var activeStr = frm.active.value;
3610 20 Nov 15 olle 530     var active = true;
3610 20 Nov 15 olle 531     if (activeStr == 'no')
3610 20 Nov 15 olle 532     {
3610 20 Nov 15 olle 533       active = false;
3610 20 Nov 15 olle 534     }
3560 27 Oct 15 olle 535     // Update kit component values for current kit
3560 27 Oct 15 olle 536     //
3560 27 Oct 15 olle 537     jsonLibraryPrepBox1[index] = valueToUse(jsonLibraryPrepBox1[index], frm.libraryPrepBox1.value);
3560 27 Oct 15 olle 538     jsonIndexKit[index] = valueToUse(jsonIndexKit[index], frm.indexKit.value);
3560 27 Oct 15 olle 539     jsonContentSetBox3[index] = valueToUse(jsonContentSetBox3[index], frm.contentSetBox3.value);
3560 27 Oct 15 olle 540     jsonOligoPoolA_FPA[index] = valueToUse(jsonOligoPoolA_FPA[index], frm.oligoPoolA_FPA.value);
3560 27 Oct 15 olle 541     jsonOligoPoolB_FPB[index] = valueToUse(jsonOligoPoolB_FPB[index], frm.oligoPoolB_FPB.value);
3560 27 Oct 15 olle 542     jsonOligoHybridizationSequencingReagent3[index] = valueToUse(jsonOligoHybridizationSequencingReagent3[index], frm.oligoHybridizationSequencingReagent3.value);
3560 27 Oct 15 olle 543     jsonStringentWash1_SW1[index] = valueToUse(jsonStringentWash1_SW1[index], frm.stringentWash1_SW1.value);
3560 27 Oct 15 olle 544     jsonExtensionLigationMix3[index] = valueToUse(jsonExtensionLigationMix3[index], frm.extensionLigationMix3.value);
3560 27 Oct 15 olle 545     jsonPcrMasterMix2_PMM2[index] = valueToUse(jsonPcrMasterMix2_PMM2[index], frm.pcrMasterMix2_PMM2.value);
3560 27 Oct 15 olle 546     jsonUB1[index] = valueToUse(jsonUB1[index], frm.ub1.value);
3560 27 Oct 15 olle 547     jsonTDP[index] = valueToUse(jsonTDP[index], frm.tdp.value);
3560 27 Oct 15 olle 548     jsonFilterplate[index] = valueToUse(jsonFilterplate[index], frm.filterplate.value);
3560 27 Oct 15 olle 549     //
3560 27 Oct 15 olle 550     jsonIndexPrimerA701[index] = valueToUse(jsonIndexPrimerA701[index], frm.indexPrimerA701.value);
3560 27 Oct 15 olle 551     jsonIndexPrimerA702[index] = valueToUse(jsonIndexPrimerA702[index], frm.indexPrimerA702.value);
3560 27 Oct 15 olle 552     jsonIndexPrimerA703[index] = valueToUse(jsonIndexPrimerA703[index], frm.indexPrimerA703.value);
3560 27 Oct 15 olle 553     jsonIndexPrimerA704[index] = valueToUse(jsonIndexPrimerA704[index], frm.indexPrimerA704.value);
3560 27 Oct 15 olle 554     jsonIndexPrimerA705[index] = valueToUse(jsonIndexPrimerA705[index], frm.indexPrimerA705.value);
3560 27 Oct 15 olle 555     jsonIndexPrimerA706[index] = valueToUse(jsonIndexPrimerA706[index], frm.indexPrimerA706.value);
3560 27 Oct 15 olle 556     jsonIndexPrimerA707[index] = valueToUse(jsonIndexPrimerA707[index], frm.indexPrimerA707.value);
3560 27 Oct 15 olle 557     jsonIndexPrimerA708[index] = valueToUse(jsonIndexPrimerA708[index], frm.indexPrimerA708.value);
3560 27 Oct 15 olle 558     jsonIndexPrimerA709[index] = valueToUse(jsonIndexPrimerA709[index], frm.indexPrimerA709.value);
3560 27 Oct 15 olle 559     jsonIndexPrimerA710[index] = valueToUse(jsonIndexPrimerA710[index], frm.indexPrimerA710.value);
3560 27 Oct 15 olle 560     jsonIndexPrimerA711[index] = valueToUse(jsonIndexPrimerA711[index], frm.indexPrimerA711.value);
3560 27 Oct 15 olle 561     jsonIndexPrimerA712[index] = valueToUse(jsonIndexPrimerA712[index], frm.indexPrimerA712.value);
3560 27 Oct 15 olle 562     //
3560 27 Oct 15 olle 563     jsonIndexPrimerA501[index] = valueToUse(jsonIndexPrimerA501[index], frm.indexPrimerA501.value);
3560 27 Oct 15 olle 564     jsonIndexPrimerA502[index] = valueToUse(jsonIndexPrimerA502[index], frm.indexPrimerA502.value);
3560 27 Oct 15 olle 565     jsonIndexPrimerA503[index] = valueToUse(jsonIndexPrimerA503[index], frm.indexPrimerA503.value);
3560 27 Oct 15 olle 566     jsonIndexPrimerA504[index] = valueToUse(jsonIndexPrimerA504[index], frm.indexPrimerA504.value);
3560 27 Oct 15 olle 567     jsonIndexPrimerA505[index] = valueToUse(jsonIndexPrimerA505[index], frm.indexPrimerA505.value);
3560 27 Oct 15 olle 568     jsonIndexPrimerA506[index] = valueToUse(jsonIndexPrimerA506[index], frm.indexPrimerA506.value);
3560 27 Oct 15 olle 569     jsonIndexPrimerA507[index] = valueToUse(jsonIndexPrimerA507[index], frm.indexPrimerA507.value);
3560 27 Oct 15 olle 570     jsonIndexPrimerA508[index] = valueToUse(jsonIndexPrimerA508[index], frm.indexPrimerA508.value);
3560 27 Oct 15 olle 571     //
3560 27 Oct 15 olle 572     jsonExpirationDate[index] = frm.expirationDate.value;
3610 20 Nov 15 olle 573     jsonActive[index] = active;
3560 27 Oct 15 olle 574     jsonTimesUsed[index] = frm.numTimesUsed.value;
4206 04 Nov 16 olle 575     //jsonUnusedFpaPlateLocs[index] = frm.unusedFpaLocs.value;
4206 04 Nov 16 olle 576     jsonUnusedFpaPlateLocs[index] = details.fetchUnusedFpaPlateLocations();
3560 27 Oct 15 olle 577     jsonComment[index] = frm.kitComment.value;
3560 27 Oct 15 olle 578
3560 27 Oct 15 olle 579     // Set kit component JSONArrays for all kits    
3560 27 Oct 15 olle 580     //jsonConsumables['KitName'] = ;
3560 27 Oct 15 olle 581     jsonConsumables['LibraryPrepBox1'] = jsonLibraryPrepBox1;
3560 27 Oct 15 olle 582     jsonConsumables['IndexKit'] = jsonIndexKit;
3560 27 Oct 15 olle 583     jsonConsumables['ContentSetBox3'] = jsonContentSetBox3;
3560 27 Oct 15 olle 584     jsonConsumables['OligoPoolA_FPA'] = jsonOligoPoolA_FPA;
3560 27 Oct 15 olle 585     jsonConsumables['OligoPoolB_FPB'] = jsonOligoPoolB_FPB;
3560 27 Oct 15 olle 586     jsonConsumables['OligoHybridizationSequencingReagent3'] = jsonOligoHybridizationSequencingReagent3;
3560 27 Oct 15 olle 587     jsonConsumables['StringentWash1_SW1'] = jsonStringentWash1_SW1;
3560 27 Oct 15 olle 588     jsonConsumables['ExtensionLigationMix3'] = jsonExtensionLigationMix3;
3560 27 Oct 15 olle 589     jsonConsumables['PcrMasterMix2_PMM2'] = jsonPcrMasterMix2_PMM2;
3560 27 Oct 15 olle 590     jsonConsumables['UB1'] = jsonUB1;
3560 27 Oct 15 olle 591     jsonConsumables['TDP'] = jsonTDP;
3560 27 Oct 15 olle 592     jsonConsumables['Filterplate'] = jsonFilterplate;
3560 27 Oct 15 olle 593     
3560 27 Oct 15 olle 594     jsonConsumables['IndexPrimerA701'] = jsonIndexPrimerA701;
3560 27 Oct 15 olle 595     jsonConsumables['IndexPrimerA702'] = jsonIndexPrimerA702;
3560 27 Oct 15 olle 596     jsonConsumables['IndexPrimerA703'] = jsonIndexPrimerA703;
3560 27 Oct 15 olle 597     jsonConsumables['IndexPrimerA704'] = jsonIndexPrimerA704;
3560 27 Oct 15 olle 598     jsonConsumables['IndexPrimerA705'] = jsonIndexPrimerA705;
3560 27 Oct 15 olle 599     jsonConsumables['IndexPrimerA706'] = jsonIndexPrimerA706;
3560 27 Oct 15 olle 600     jsonConsumables['IndexPrimerA707'] = jsonIndexPrimerA707;
3560 27 Oct 15 olle 601     jsonConsumables['IndexPrimerA708'] = jsonIndexPrimerA708;
3560 27 Oct 15 olle 602     jsonConsumables['IndexPrimerA709'] = jsonIndexPrimerA709;
3560 27 Oct 15 olle 603     jsonConsumables['IndexPrimerA710'] = jsonIndexPrimerA710;
3560 27 Oct 15 olle 604     jsonConsumables['IndexPrimerA711'] = jsonIndexPrimerA711;
3560 27 Oct 15 olle 605     jsonConsumables['IndexPrimerA712'] = jsonIndexPrimerA712;
3560 27 Oct 15 olle 606     
3560 27 Oct 15 olle 607     jsonConsumables['IndexPrimerA501'] = jsonIndexPrimerA501;
3560 27 Oct 15 olle 608     jsonConsumables['IndexPrimerA502'] = jsonIndexPrimerA502;
3560 27 Oct 15 olle 609     jsonConsumables['IndexPrimerA503'] = jsonIndexPrimerA503;
3560 27 Oct 15 olle 610     jsonConsumables['IndexPrimerA504'] = jsonIndexPrimerA504;
3560 27 Oct 15 olle 611     jsonConsumables['IndexPrimerA505'] = jsonIndexPrimerA505;
3560 27 Oct 15 olle 612     jsonConsumables['IndexPrimerA506'] = jsonIndexPrimerA506;
3560 27 Oct 15 olle 613     jsonConsumables['IndexPrimerA507'] = jsonIndexPrimerA507;
3560 27 Oct 15 olle 614     jsonConsumables['IndexPrimerA508'] = jsonIndexPrimerA508;
3560 27 Oct 15 olle 615
3560 27 Oct 15 olle 616     //jsonConsumables['RegistrationDate'] = ;
3560 27 Oct 15 olle 617     //jsonConsumables['LastUpdatedDate'] = ;
3560 27 Oct 15 olle 618     jsonConsumables['ExpirationDate'] = jsonExpirationDate;
3610 20 Nov 15 olle 619     jsonConsumables['Active'] = jsonActive;
3560 27 Oct 15 olle 620     jsonConsumables['TimesUsed'] = jsonTimesUsed;
3560 27 Oct 15 olle 621     jsonConsumables['UnusedFpaPlateLocs'] = jsonUnusedFpaPlateLocs;
3560 27 Oct 15 olle 622     jsonConsumables['Comment'] = jsonComment;
3560 27 Oct 15 olle 623
3560 27 Oct 15 olle 624 /*
3560 27 Oct 15 olle 625     if (mode != null && mode == 'ExtractionReg')
3560 27 Oct 15 olle 626     {
3560 27 Oct 15 olle 627       var reagents = window.opener.ExtractionReg.REAGENTS;
3560 27 Oct 15 olle 628       for (var i = 0; i < reagents.length; i++)
3560 27 Oct 15 olle 629       {
3560 27 Oct 15 olle 630         var rg = reagents[i];
3560 27 Oct 15 olle 631         specimen[rg] = frm[rg].value || null;
3560 27 Oct 15 olle 632       }
3560 27 Oct 15 olle 633     }
3560 27 Oct 15 olle 634 */
3560 27 Oct 15 olle 635
3560 27 Oct 15 olle 636 /*
3560 27 Oct 15 olle 637     if (mode != null && mode == 'ExtractionReg')
3560 27 Oct 15 olle 638     {
3560 27 Oct 15 olle 639       window.opener.ExtractionReg.updateDetailsTable();
3560 27 Oct 15 olle 640     }
3560 27 Oct 15 olle 641     else
3560 27 Oct 15 olle 642     {
3560 27 Oct 15 olle 643       window.opener.ExtractionPrep.updateDetailsTable();
3560 27 Oct 15 olle 644     }
3560 27 Oct 15 olle 645 */
3560 27 Oct 15 olle 646     window.opener.ExtractionReg.updateDetailsTable();
3560 27 Oct 15 olle 647     window.close();
3560 27 Oct 15 olle 648   }
3560 27 Oct 15 olle 649
3560 27 Oct 15 olle 650   valueToUse = function(oldValue, newValue)
3560 27 Oct 15 olle 651   {
3560 27 Oct 15 olle 652     var value = oldValue;
3560 27 Oct 15 olle 653     if (newValue != null && newValue != '')
3560 27 Oct 15 olle 654     {
3560 27 Oct 15 olle 655       value = newValue;
3560 27 Oct 15 olle 656     }
3560 27 Oct 15 olle 657     return value;
3560 27 Oct 15 olle 658   }
3560 27 Oct 15 olle 659 /*
3560 27 Oct 15 olle 660   getSelectedItemsList = function()
3560 27 Oct 15 olle 661   {
3560 27 Oct 15 olle 662     var pfrm = window.opener.document.forms['meludi'];
3560 27 Oct 15 olle 663     
3560 27 Oct 15 olle 664     // Get number of selected extract source items
3560 27 Oct 15 olle 665     var numItems = 0;
3560 27 Oct 15 olle 666     var selItemsList = [];
3560 27 Oct 15 olle 667     for (var i = 0; i < pfrm.extractSourceItems.length; i++)
3560 27 Oct 15 olle 668     {
3560 27 Oct 15 olle 669       if (pfrm.extractSourceItems[i].selected)
3560 27 Oct 15 olle 670       {
3560 27 Oct 15 olle 671         if (pfrm.extractSourceItems[i].item != null)
3560 27 Oct 15 olle 672         {
3560 27 Oct 15 olle 673           selItemsList[numItems] = pfrm.extractSourceItems[i].item;
3560 27 Oct 15 olle 674           numItems++;
3560 27 Oct 15 olle 675         }
3560 27 Oct 15 olle 676       }
3560 27 Oct 15 olle 677     }
3560 27 Oct 15 olle 678     return selItemsList;
3560 27 Oct 15 olle 679   }
3560 27 Oct 15 olle 680 */
3560 27 Oct 15 olle 681   return details;
3560 27 Oct 15 olle 682 }();
3560 27 Oct 15 olle 683
3560 27 Oct 15 olle 684 Doc.onLoad(Details.initPage);
3560 27 Oct 15 olle 685