Changeset 4731
- Timestamp:
- Jan 20, 2009, 9:02:44 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/BioWell.java
r4677 r4731 112 112 */ 113 113 /** 114 Adds the {@link Measure BioMaterial},used in this well, to the Set.114 Adds the {@link MeasuredBioMaterial},used in this well, to the Set. 115 115 */ 116 116 @Override -
trunk/src/core/net/sf/basedb/core/data/BioWellData.java
r4685 r4731 40 40 /** 41 41 The bioplate this well belongs to. 42 @see BioPlateData#get Wells()42 @see BioPlateData#getBioWells() 43 43 @hibernate.many-to-one column="`bioplate_id`" not-null="true" outer-join="false" update="false" 44 44 */ -
trunk/www/biomaterials/bioplates/wells/index.jsp
r4729 r4731 33 33 import="net.sf.basedb.core.ItemQuery" 34 34 import="net.sf.basedb.core.DataQuery" 35 import="net.sf.basedb.core.MeasuredBioMaterial" 35 36 import="net.sf.basedb.core.Permission" 36 37 import="net.sf.basedb.core.PermissionDeniedException" … … 110 111 // Update the properties on an item (will close the popup) 111 112 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, defaultContext); 112 dc = sc.newDbControl(); 113 BioWell biowell = (BioWell)cc.getObject("item"); 114 dc.reattachItem(biowell); 115 message = "biowell updated"; 113 final int maxRecent = Base.getMaxRecent(sc); 114 message = "biowell updated"; 116 115 117 dc.commit(); 116 int biomaterialId = Values.getInt(request.getParameter("biomaterial_id")); 117 if (biomaterialId >= 0) 118 { 119 dc = sc.newDbControl(); 120 BioWell biowell = (BioWell)cc.getObject("item"); 121 dc.reattachItem(biowell); 122 MeasuredBioMaterial oldMbm = biowell.getBioMaterial(); 123 if (oldMbm != null) 124 { 125 dc.reattachItem(oldMbm); 126 oldMbm.setBioWell(null); 127 } 128 dc.commit(); 129 if (biomaterialId > 0) 130 { 131 dc = sc.newDbControl(); 132 Item biomaterialType = Item.valueOf(request.getParameter("biomaterial_type")); 133 MeasuredBioMaterial newMbm = (MeasuredBioMaterial)biomaterialType.getById(dc, biomaterialId); 134 newMbm.setBioWell(biowell); 135 dc.commit(); 136 } 137 138 } 118 139 cc.removeObject("item"); 119 140 } -
trunk/www/biomaterials/bioplates/wells/list_biowells.jsp
r4730 r4731 109 109 var submitPage = 'index.jsp'; 110 110 var formId = 'biowells'; 111 111 112 function editItem(itemId) 113 { 114 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); 115 } 112 116 function itemOnClick(itemId) 113 117 { … … 146 150 147 151 <base:body> 148 <p> 149 <p:path> 150 <p:pathelement title="Bioplates" href="<%="../index.jsp?ID="+ID%>" /> 151 <p:pathelement title="<%=HTML.encodeTags(bioplate.getName())%>" /> 152 </p:path> 153 154 <t:tabcontrol id="main" active="biowells" switch="switchTab"> 152 <% 153 if (!mode.isSelectionMode()) 154 { 155 %> 156 <p> 157 <p:path> 158 <p:pathelement title="Bioplates" href="<%="../index.jsp?ID="+ID%>" /> 159 <p:pathelement title="<%=HTML.encodeTags(bioplate.getName())%>" /> 160 </p:path> 161 <% 162 } 163 %> 164 165 <t:tabcontrol id="main" active="biowells" switch="switchTab" notabs="<%=mode.isSelectionMode()%>"> 155 166 <t:tab id="properties" title="Properties" /> 156 167 <t:tab id="annotations" title="Annotations" /> … … 386 397 </tbl:cell> 387 398 <tbl:cell column="column"><%=item.getColumn()%></tbl:cell> 388 <tbl:cell column="bioMaterial.name"> 399 <tbl:cell column="bioMaterial.name"> 389 400 <% 390 MeasuredBioMaterial bioMaterial = item.getBioMaterial(); 391 if (bioMaterial == null) 401 MeasuredBioMaterial bioMaterial = null; 402 boolean bmWritePermission = true; 403 try 404 { 405 bioMaterial = item.getBioMaterial(); 406 if (bioMaterial != null) 392 407 { 393 %> 394 <i>- none -</i> 395 <% 408 bmWritePermission = bioMaterial.hasPermission(Permission.WRITE); 396 409 } 397 else 398 { 399 %> 400 <%=Base.getLink(ID, bioMaterial.getName(), bioMaterial.getType(), bioMaterial.getId(), true)%> 401 <% 402 } 410 } 411 catch (PermissionDeniedException ex) 412 { 413 bmWritePermission = false; 414 } 403 415 %> 404 <base:icon 405 image="edit.gif" 406 tooltip="Change biomaterial of this biowell" 407 onclick="changeBioMaterial()" 408 /> 416 <base:propertyvalue 417 item="<%=item%>" 418 property="bioMaterial" 419 enableEditLink="<%=mode.hasEditLink() && bmWritePermission%>" 420 enablePropertyLink="<%=mode.hasPropertyLink()%>" 421 /> 422 <base:icon 423 image="<%=bmWritePermission ? "edit.gif" : "edit_disabled.gif" %>" 424 tooltip="<%=bmWritePermission ? "Change the biomaterial in this biowell" : 425 "You have not permission to change the current biomaterial"%>" 426 onclick="<%=bmWritePermission ? "editItem("+item.getId()+")" : ""%>" 427 /> 409 428 </tbl:cell> 410 429 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> -
trunk/www/include/scripts/main.js
r4704 r4731 427 427 this.controllers['BIOMATERIALLIST'] = { url:'biomaterials/lists/index.jsp', width:800, height:500 }; 428 428 this.controllers['BIOPLATE'] = { url:'biomaterials/bioplates/index.jsp', width:800, height:500 }; 429 this.controllers['BIOWELL'] = { url:'biomaterials/bioplates/wells/index.jsp', width: 800, height:500 };429 this.controllers['BIOWELL'] = { url:'biomaterials/bioplates/wells/index.jsp', width:450, height:280 }; 430 430 this.controllers['MESSAGE'] = { url:'my_base/messages/index.jsp', width:600, height:420, popup:true, edit:false }; 431 431 this.controllers['PROJECT'] = { url:'my_base/projects/index.jsp', width:600, height:460 };
Note: See TracChangeset
for help on using the changeset viewer.