Changeset 1986
- Timestamp:
- May 21, 2013, 2:34:28 PM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/libprep/lib_registration.jsp
r1968 r1986 49 49 { 50 50 var bioplate = bioplates[i]; 51 var option = new Option(bioplate.name, bioplate.id); 52 option.comments = bioplate.comments; 51 var warning = bioplate.numFiles == 0 ? ' ( ! )' : ''; 52 var option = new Option(bioplate.name + warning, bioplate.id); 53 option.bioplate = bioplate; 53 54 plates.options[plates.length] = option; 54 55 } … … 214 215 { 215 216 var frm = document.forms['reggie']; 217 var selectedPlate = frm.bioplate[frm.bioplate.selectedIndex].bioplate; 218 if (selectedPlate.numFiles == 0) 219 { 220 setInputStatus('bioplate', 'No quality control PDF has been registered for this plate', 'warning'); 221 } 222 else 223 { 224 setInputStatus('bioplate', '', 'valid'); 225 } 216 226 } 217 227 -
extensions/net.sf.basedb.reggie/trunk/resources/libprep/libqc_registration.jsp
r1931 r1986 32 32 var currentStep = 1; 33 33 34 var bioplateIsValid = false; 34 35 var pdfQcIsValid = false; 35 36 var qcDateIsValid = false; … … 53 54 plates.options[plates.length] = option; 54 55 } 55 bioplateIsValid = true; 56 setInputStatus('bioplate', '', 'valid'); 57 bioPlateOnChange(); 58 } 59 else 60 { 61 var msg = 'No Library bioplates available for processing.'; 62 setFatalError(msg); 63 return; 64 } 65 66 // All is ok 56 } 57 67 58 frm.bioplate.focus(); 59 bioPlateOnChange(); 68 60 } 69 61 … … 115 107 function gotoStep2() 116 108 { 109 if (!bioplateIsValid) return; 117 110 var frm = document.forms['reggie']; 118 111 frm.bioplate.disabled = true; … … 131 124 { 132 125 var frm = document.forms['reggie']; 126 bioplateIsValid = false; 127 128 if (frm.bioplate.length == 0) 129 { 130 setInputStatus('bioplate', 'No Library plate available for processing.', 'invalid'); 131 return; 132 } 133 134 bioplateIsValid = true; 135 setInputStatus('bioplate', '', 'valid'); 133 136 } 134 137 … … 294 297 } 295 298 299 function selectLibPlate() 300 { 301 var frm = document.forms['reggie']; 302 if (frm.bioplate.disabled) return; 303 304 var url = getRoot() + 'biomaterials/bioplates/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setLibPlateCallback'; 305 url += '&tmpfilter:STRING:bioPlateType.name=Library+plate'; 306 Main.openPopup(url, 'SelectLibPlate', 1000, 700); 307 } 308 function setLibPlateCallback(id, name) 309 { 310 var frm = document.forms['reggie']; 311 var plateList = frm.bioplate; 312 for (var i = 0; i < plateList.length; i++) 313 { 314 if (plateList[i].value == id) 315 { 316 plateList[i].selected = true; 317 return; 318 } 319 } 320 321 var option = new Option(name, id, true, true); 322 plateList[plateList.length] = option; 323 bioPlateOnChange(); 324 } 296 325 297 326 </script> … … 334 363 <td class="input"><select class="required" style="width:90%;" 335 364 name="bioplate" id="bioplate" onchange="bioPlateOnChange()"></select> 365 366 <base:buttongroup style="margin-top: 0.5em;"> 367 <base:button title="Select manually…" onclick="selectLibPlate()" id="btnSelectLibPlate" /> 368 </base:buttongroup> 336 369 </td> 337 370 <td class="status" id="bioplate.status"></td> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/LibPrepServlet.java
r1984 r1986 34 34 import net.sf.basedb.core.File; 35 35 import net.sf.basedb.core.InvalidDataException; 36 import net.sf.basedb.core.Item; 36 37 import net.sf.basedb.core.ItemQuery; 37 38 import net.sf.basedb.core.ItemSubtype; … … 44 45 import net.sf.basedb.core.plugin.ParameterValues; 45 46 import net.sf.basedb.core.query.Annotations; 47 import net.sf.basedb.core.query.Expressions; 46 48 import net.sf.basedb.core.query.Hql; 47 49 import net.sf.basedb.core.query.Orders; … … 183 185 for (BioPlate plate : plates) 184 186 { 187 ItemQuery<AnyToAny> fileQuery = AnyToAny.getLinksFrom(plate); 188 Restrictions.eq(Hql.property("toType"), Expressions.integer(Item.FILE.getValue())); 189 long fileCount = fileQuery.count(dc); 190 185 191 JSONObject jsonPlate = new JSONObject(); 186 192 jsonPlate.put("id", plate.getId()); 187 193 jsonPlate.put("name", plate.getName()); 188 194 jsonPlate.put("comments", plate.getDescription()); 195 jsonPlate.put("numFiles", fileCount); 189 196 jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, plate)); 190 197 jsonPlate.put("barcodeVariant", Annotationtype.BARCODE_VARIANT.getAnnotationValue(dc, plate));
Note: See TracChangeset
for help on using the changeset viewer.