Changeset 5722
- Timestamp:
- Sep 7, 2011, 11:26:07 AM (11 years ago)
- Location:
- trunk/www
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/biomaterials/bioplates/view_bioplate.jsp
r5708 r5722 187 187 var pos = Main.getElementPosition(wellTd); 188 188 wellInfo.style.left = (pos.left + pos.width - 5) + 'px'; 189 wellInfo.style.top = (pos.top + 1 5) + 'px';189 wellInfo.style.top = (pos.top + 10) + 'px'; 190 190 Main.show('wellInfo'); 191 191 … … 210 210 var id = bioMaterial.id; 211 211 var type = bioMaterial.type; 212 html = '<b>' + type + '</b>: '; 213 html += Main.linkItem('<%=ID%>', type, id, bioMaterial.editable, bioMaterial.name); 212 var subtype = bioMaterial.subtype; 213 html = Main.linkItem('<%=ID%>', type, id, bioMaterial.editable, bioMaterial.name); 214 html += ': <b>' + type + '</b>'; 215 if (subtype) html += ' <span class="itemsubtype">[' + subtype.name + ']</span>'; 214 216 html += '<br>'+bioMaterial.description; 215 217 } … … 523 525 %> 524 526 </table> 525 <div class="postit" id="wellInfo" style="display:none; width: 300px; " onmouseout="event.cancelBubble=true"></div>527 <div class="postit" id="wellInfo" style="display:none; width: 300px; min-height: 30px;" onmouseout="event.cancelBubble=true"></div> 526 528 </base:section> 527 529 <jsp:include page="../../common/anytoany/list_anytoany.jsp"> -
trunk/www/biomaterials/bioplates/wells/ajax.jsp
r5557 r5722 28 28 import="net.sf.basedb.core.BioWell" 29 29 import="net.sf.basedb.core.MeasuredBioMaterial" 30 import="net.sf.basedb.core.ItemSubtype" 30 31 import="net.sf.basedb.core.InvalidDataException" 31 32 import="net.sf.basedb.core.PermissionDeniedException" … … 72 73 jsonBioMaterial.put("description", encodeStrings ? HTML.niceFormat(bioMaterial.getDescription()) : bioMaterial.getDescription()); 73 74 jsonBioMaterial.put("editable", bioMaterial.hasPermission(Permission.WRITE)); 75 ItemSubtype subtype = bioMaterial.getItemSubtype(); 76 if (subtype != null) 77 { 78 JSONObject jsonSubtype = new JSONObject(); 79 jsonSubtype.put("id", subtype.getId()); 80 jsonSubtype.put("name", HTML.encodeTags(subtype.getName())); 81 jsonBioMaterial.put("subtype", jsonSubtype); 82 } 74 83 } 75 84 catch (PermissionDeniedException ex) … … 79 88 json.put("bioMaterial", jsonBioMaterial); 80 89 } 81 /*82 String status = "Ok";83 MeasuredBioMaterial bioMaterial = null;84 if (isEmpty && !hasBeenUsed)85 {86 status = "Empty";87 }88 else89 {90 try91 {92 bm = isEmpty ? w.getOriginalBioMaterial() : w.getBioMaterial();93 }94 catch (PermissionDeniedException ex)95 {96 status = "Denied";97 bm = null;98 }99 }100 aw.ajaxPrintEntry("status", status);101 aw.ajaxPrintEntry("id", w.getId());102 json.put("id", well.getId());103 104 if (bm != null)105 {106 aw.ajaxPrintEntry("bm.id", bm.getId());107 aw.ajaxPrintEntry("bm.type", bm.getType().name());108 aw.ajaxPrintEntry("bm.editable", bm.hasPermission(Permission.WRITE) ? "1" : "0");109 aw.ajaxPrintEntry("bm.name", encodeStrings ? HTML.encodeTags(bm.getName()) : bm.getName());110 aw.ajaxPrintEntry("bm.description", encodeStrings ? HTML.niceFormat(bm.getDescription()) : bm.getDescription());111 }112 aw.ajaxEndRecord();113 */114 90 dc.close(); 115 91 } -
trunk/www/biomaterials/events/index.jsp
r5590 r5722 55 55 <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> 56 56 <%! 57 private static final ItemContext defaultContext = Base.createDefaultContext("entryDate", "type, entryDate,eventDate,quantity,protocol,comment");57 private static final ItemContext defaultContext = Base.createDefaultContext("entryDate", "type,bioPlateEvent,entryDate,eventDate,quantity,protocol,comment"); 58 58 private static final Item itemType = Item.BIOMATERIALEVENT; 59 59 %> -
trunk/www/biomaterials/wizards/index.jsp
r5662 r5722 22 22 @author Nicklas 23 23 --%> 24 <%@page import="net.sf.basedb.core.BioMaterialEventSource"%>25 24 <%@ page pageEncoding="UTF-8" session="false" 26 25 import="net.sf.basedb.core.SessionControl" 27 26 import="net.sf.basedb.core.BioMaterial" 28 27 import="net.sf.basedb.core.BioMaterialEvent" 28 import="net.sf.basedb.core.BioMaterialEventSource" 29 29 import="net.sf.basedb.core.BioPlate" 30 30 import="net.sf.basedb.core.BioPlateType" … … 310 310 { 311 311 child = Extract.getNew(dc, destParticipant); 312 if (!pooled) ((Extract)child).setSample((Sample)parent).setUsedQuantity(usedQuantity);312 //if (!pooled) ((Extract)child).setSample((Sample)parent).setUsedQuantity(usedQuantity); 313 313 } 314 314 /* -
trunk/www/biomaterials/wizards/move_biomaterial.jsp
r5557 r5722 28 28 import="net.sf.basedb.core.BioPlateEventType" 29 29 import="net.sf.basedb.core.MeasuredBioMaterial" 30 import="net.sf.basedb.core.BioWell" 31 import="net.sf.basedb.core.ItemSubtype" 30 32 import="net.sf.basedb.core.Hardware" 31 33 import="net.sf.basedb.core.Protocol" … … 71 73 catch (PermissionDeniedException ex) 72 74 {} 75 ItemSubtype commonSubtype = null; 76 boolean first = true; 77 for (BioWell well : sourcePlate.getBioWells().list(dc)) 78 { 79 try 80 { 81 if (!well.isEmpty()) 82 { 83 ItemSubtype subtype = well.getBioMaterial().getItemSubtype(); 84 if (first) 85 { 86 commonSubtype = subtype; 87 first = false; 88 } 89 else 90 { 91 if (subtype == null || !subtype.equals(commonSubtype)) 92 { 93 commonSubtype = null; 94 break; 95 } 96 } 97 } 98 } 99 catch (PermissionDeniedException ex) 100 {} 101 } 102 if (commonSubtype != null && itemType == null) 103 { 104 itemType = commonSubtype.getMainItemType(); 105 } 73 106 74 107 final String clazz = "class=\"text\""; … … 368 401 var url = '../bioplates/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setBioPlateCallback'; 369 402 url += '&resetTemporary=1&tmpfilter:INT:bioPlateType.bioMaterialType=<%=itemType == null ? "=" : "|" + itemType.getValue()%>' 403 <% 404 if (commonSubtype != null) 405 { 406 %> 407 url += '&tmpfilter:INT:bioPlateType.itemSubtype=|<%=commonSubtype.getId()%>' 408 <% 409 } 410 %> 370 411 url += '&exclude='+sourcePlate.id; 371 412 Main.openPopup(url, 'SelectBioPlate', 1000, 700); … … 374 415 function setBioPlateCallback(bioPlateId, name, isSourcePlate) 375 416 { 417 var win = Main.getWindow('SelectBioPlate'); 376 418 if (!isSourcePlate && bioPlateId == sourcePlate.id) 377 419 { 378 alert('It is not possible to use the same plate as both source and destination plate.');420 win.alert('It is not possible to use the same plate as both source and destination plate.'); 379 421 return; 380 422 } … … 388 430 if (plateInfo.status != 'ok') 389 431 { 390 alert(plateInfo.message);391 return false;432 win.alert(plateInfo.message); 433 return; 392 434 } 393 435 … … 556 598 } 557 599 url += '&resetTemporary=1'; 600 <% 601 if (commonSubtype != null) 602 { 603 ItemSubtype hardwareType = commonSubtype.getRelatedSubtype(Item.HARDWARE); 604 if (hardwareType != null) 605 { 606 %> 607 url += '&tmpfilter:INT:itemSubtype=<%=hardwareType.getId()%>'; 608 <% 609 } 610 } 611 %> 558 612 Main.openPopup(url, 'SelectHardware', 1000, 700); 559 613 } … … 581 635 } 582 636 url += '&resetTemporary=1'; 637 <% 638 ItemSubtype protocolType = null; 639 if (commonSubtype != null) 640 { 641 protocolType = commonSubtype.getRelatedSubtype(Item.PROTOCOL); 642 if (protocolType != null) 643 { 644 %> 645 url += '&tmpfilter:INT:itemSubtype=<%=protocolType.getId()%>'; 646 <% 647 } 648 } 649 %> 583 650 Main.openPopup(url, 'SelectProtocol', 1000, 700); 584 651 } … … 621 688 request.send(null); 622 689 var mappingInfo = Ajax.parseJsonResponse(request.responseText); 690 var win = Main.getWindow('SelectPlateMapping'); 623 691 if (mappingInfo.status != 'ok') 624 692 { 625 alert(mappingInfo.message);693 win.alert(mappingInfo.message); 626 694 return false; 627 695 } … … 629 697 if (mappingInfo.sourcePlates != 1 || mappingInfo.sourceRows != sourcePlate.rows || mappingInfo.sourceColumns != sourcePlate.columns) 630 698 { 631 if (! confirm("The selected mapping doesn't match the geometry of the source plate.\nContinue mapping overlapping positions?")) return;699 if (!win.confirm("The selected mapping doesn't match the geometry of the source plate.\nContinue mapping overlapping positions?")) return; 632 700 } 633 701 else if (mappingInfo.destinationPlates != 1 || mappingInfo.destinationRows != destPlate.rows || mappingInfo.destinationColumns != destPlate.columns) 634 702 { 635 if (! confirm("The selected mapping doesn't match the geometry of the destination plate.\nContinue mapping overlapping positions?")) return;703 if (!win.confirm("The selected mapping doesn't match the geometry of the destination plate.\nContinue mapping overlapping positions?")) return; 636 704 } 637 705 … … 662 730 <base:body onload="init()"> 663 731 <div id="canvas"></div> 664 <h3>Move biomaterial to plate </h3>732 <h3>Move biomaterial to plate <base:help helpid="bioplateevent.move" /></h3> 665 733 <div class="boxedbottom" style="height: <%=(int)(scale*500)%>px; padding: 0px;"> 666 734 <form name="main" action="index.jsp" method="post"> … … 776 844 <div style="max-height: <%=(int)(scale*350)%>px; overflow: auto;"> 777 845 <b>Source plate:</b> <span id="plate.src.name"></span> 846 <%=commonSubtype != null ? "<span class=\"itemsubtype\">[" + HTML.encodeTags(commonSubtype.getName()) + "]</span>" : "" %> 778 847 <div id="plate.src"></div> 779 848 </div> -
trunk/www/include/scripts/main.js
r5714 r5722 156 156 var win = this.getPageValue('open.windows', windowName); 157 157 if (win) win.focus(); 158 } 159 160 /** 161 Get a reference to a named window. If the window 162 doesn't exists or if it is closed, a reference to 163 the current window is returned. 164 */ 165 this.getWindow = function(windowName) 166 { 167 var win = this.getPageValue('open.windows', windowName); 168 if (!win || win.closed) win = window; 169 return win; 158 170 } 159 171
Note: See TracChangeset
for help on using the changeset viewer.