Changeset 6997
- Timestamp:
- Nov 3, 2015, 12:42:15 PM (7 years ago)
- Location:
- trunk/www/biomaterials
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/biomaterials/bioplates/events/edit_event.jsp
r6306 r6997 27 27 import="net.sf.basedb.core.Item" 28 28 import="net.sf.basedb.core.Hardware" 29 import="net.sf.basedb.core.Kit" 29 30 import="net.sf.basedb.core.Protocol" 30 31 import="net.sf.basedb.core.ItemContext" … … 76 77 boolean readCurrentProtocol = true; 77 78 Protocol currentProtocol = null; 79 boolean readCurrentKit = true; 80 Kit currentKit = null; 78 81 79 82 // Load recently used items 80 83 List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE); 81 84 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL); 85 List<Kit> recentKits = (List<Kit>)cc.getRecent(dc, Item.KIT); 82 86 83 87 cc.setObject("item", event); … … 99 103 { 100 104 readCurrentProtocol = false; 105 } 106 try 107 { 108 currentKit = event.getKit(); 109 } 110 catch (PermissionDeniedException ex) 111 { 112 readCurrentKit = false; 101 113 } 102 114 … … 161 173 denied="<%=!readCurrentProtocol%>" 162 174 recent="<%=recentProtocols%>" 175 /> 176 </td> 177 <td></td> 178 </tr> 179 <tr> 180 <th>Kit</th> 181 <td> 182 <base:select 183 id="kit_id" 184 clazz="selectionlist" 185 required="false" 186 current="<%=currentKit%>" 187 denied="<%=!readCurrentKit%>" 188 recent="<%=recentKits%>" 163 189 /> 164 190 </td> -
trunk/www/biomaterials/bioplates/events/events.js
r6389 r6997 48 48 Buttons.addClickHandler('protocol_id.select', plateevents.selectProtocol); 49 49 Events.addEventHandler('protocol_id', 'base-selected', plateevents.setProtocolCallback); 50 51 // Kit 52 Buttons.addClickHandler('kit_id.select', plateevents.selectKit); 53 Events.addEventHandler('kit_id', 'base-selected', plateevents.setKitCallback); 50 54 } 51 55 else if (pageId == 'view-page') … … 179 183 } 180 184 185 plateevents.selectKit = function() 186 { 187 var frm = document.forms['event']; 188 url = '&resetTemporary=1'; 189 url += '&tmpfilter:BOOLEAN:inactive=0'; 190 if (frm.kit_id.length > 1) 191 { 192 var id = Math.abs(parseInt(frm.kit_id[1].value)); 193 url += '&item_id='+id; 194 } 195 Dialogs.selectItem('KIT', 'kit_id', 0, url); 196 } 197 198 plateevents.setKitCallback = function(event) 199 { 200 var frm = document.forms['event']; 201 var list = frm.kit_id; 202 if (list.length < 2 || list[1].value == '0') 203 { 204 Forms.addListOption(list, 1, new Option()); 205 } 206 list[1].value = event.detail.id; 207 list[1].text = event.detail.name; 208 list.selectedIndex = 1; 209 } 181 210 182 211 return plateevents; -
trunk/www/biomaterials/bioplates/events/index.jsp
r6192 r6997 29 29 import="net.sf.basedb.core.BioPlate" 30 30 import="net.sf.basedb.core.BioPlateEvent" 31 import="net.sf.basedb.core.Kit" 31 32 import="net.sf.basedb.core.Protocol" 32 33 import="net.sf.basedb.core.Hardware" … … 154 155 } 155 156 157 int kitId = Values.getInt(request.getParameter("kit_id"), -1); 158 if (kitId >= 0) // < 0 = denied or unchanged 159 { 160 Kit kit = kitId == 0 ? null : Kit.getById(dc, kitId); 161 event.setKit(kit); 162 if (kit != null) cc.setRecent(kit, maxRecent); 163 } 164 156 165 int hardwareId = Values.getInt(request.getParameter("hardware_id"), -1); 157 166 if (hardwareId >= 0) // < 0 = denied or unchanged -
trunk/www/biomaterials/bioplates/events/list_events.jsp
r6834 r6997 209 209 datatype="string" 210 210 title="Protocol" 211 sortable="true" 212 filterable="true" 213 exportable="true" 214 /> 215 <tbl:columndef 216 id="kit" 217 property="kit.name" 218 datatype="string" 219 title="Kit" 211 220 sortable="true" 212 221 filterable="true" … … 502 511 enablePropertyLink="<%=mode.hasPropertyLink()%>" 503 512 /></tbl:cell> 513 <tbl:cell column="kit" 514 ><base:propertyvalue 515 item="<%=item%>" 516 property="kit" 517 enableEditLink="<%=mode.hasEditLink()%>" 518 enablePropertyLink="<%=mode.hasPropertyLink()%>" 519 /></tbl:cell> 504 520 <tbl:cell column="hardware" 505 521 ><base:propertyvalue -
trunk/www/biomaterials/bioplates/events/view_event.jsp
r6605 r6997 270 270 </tr> 271 271 <tr> 272 <th>Kit</th> 273 <td><base:propertyvalue item="<%=event%>" property="kit"/></td> 274 </tr> 275 <tr> 272 276 <th>Hardware</th> 273 277 <td><base:propertyvalue item="<%=event%>" property="hardware"/></td> -
trunk/www/biomaterials/wizards/create_child_bioplate.js
r6611 r6997 63 63 Buttons.addClickHandler('protocol_id.select', child.selectProtocol); 64 64 Events.addEventHandler('protocol_id', 'base-selected', Wizards.setProtocolCallback); 65 66 // Protocol 67 Buttons.addClickHandler('kit_id.select', child.selectKit); 68 Events.addEventHandler('kit_id', 'base-selected', Wizards.setKitCallback); 65 69 66 70 // Tag … … 181 185 url += ItemSubtype.createRelatedFilter(childType+'_subtype_id', 'PROTOCOL'); 182 186 Dialogs.selectItem('PROTOCOL', 'protocol_id', 0, url); 187 } 188 189 child.selectKit = function() 190 { 191 var frm = document.forms['main']; 192 var url = '&resetTemporary=1'; 193 url += '&tmpfilter:BOOLEAN:inactive=0'; 194 if (frm.kit_id.length > 1) 195 { 196 var id = Math.abs(parseInt(frm.kit_id[1].value)); 197 url += '&item_id='+id; 198 } 199 var childType = frm.child_biomaterial_type[frm.child_biomaterial_type.selectedIndex].value; 200 url += ItemSubtype.createRelatedFilter(childType+'_subtype_id', 'KIT'); 201 Dialogs.selectItem('KIT', 'kit_id', 0, url); 183 202 } 184 203 -
trunk/www/biomaterials/wizards/create_child_bioplate_step1.jsp
r6399 r6997 31 31 import="net.sf.basedb.core.MeasuredBioMaterial" 32 32 import="net.sf.basedb.core.Hardware" 33 import="net.sf.basedb.core.Kit" 33 34 import="net.sf.basedb.core.Protocol" 34 35 import="net.sf.basedb.core.Tag" … … 75 76 List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE, sourceBioMaterialType.name()); 76 77 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL, sourceBioMaterialType.name()); 78 List<Kit> recentKits = (List<Kit>)cc.getRecent(dc, Item.KIT, sourceBioMaterialType.name()); 77 79 List<PlateGeometry> recentGeometry = (List<PlateGeometry>)cc.getRecent(dc, Item.PLATEGEOMETRY, sourceBioMaterialType.name()); 78 80 List<BioPlateType> recentPlateTypes = (List<BioPlateType>)cc.getRecent(dc, Item.BIOPLATETYPE, sourceBioMaterialType.name()); … … 192 194 </tr> 193 195 <tr> 196 <th>Kit</th> 197 <td> 198 <base:select 199 id="kit_id" 200 clazz="selectionlist" 201 required="false" 202 current="<%=null%>" 203 recent="<%=recentKits%>" 204 /> 205 </td> 206 </tr> 207 <tr> 194 208 <th>Hardware</th> 195 209 <td> -
trunk/www/biomaterials/wizards/create_child_bioplate_step2.jsp
r6611 r6997 96 96 <input type="hidden" name="event_date" value="<%=HTML.encodeTags(request.getParameter("event_date"))%>"> 97 97 <input type="hidden" name="protocol_id" value="<%=Values.getInt(request.getParameter("protocol_id"))%>"> 98 <input type="hidden" name="kit_id" value="<%=Values.getInt(request.getParameter("kit_id"))%>"> 98 99 <input type="hidden" name="hardware_id" value="<%=Values.getInt(request.getParameter("hardware_id"))%>"> 99 100 <!-- child plate properties --> -
trunk/www/biomaterials/wizards/index.jsp
r6192 r6997 39 39 import="net.sf.basedb.core.MeasuredBioMaterial" 40 40 import="net.sf.basedb.core.Hardware" 41 import="net.sf.basedb.core.Kit" 41 42 import="net.sf.basedb.core.Protocol" 42 43 import="net.sf.basedb.core.Sample" … … 100 101 cc.setRecent(pt, maxRecent); 101 102 } 103 int kitId = Values.getInt(request.getParameter("kit_id")); 104 if (kitId > 0) 105 { 106 Kit kit = Kit.getById(dc, kitId); 107 event.setKit(kit); 108 cc.setRecent(kit, maxRecent); 109 } 102 110 int hardwareId = Values.getInt(request.getParameter("hardware_id")); 103 111 if (hardwareId > 0) … … 160 168 cc.setRecent(pt, maxRecent); 161 169 } 170 int kitId = Values.getInt(request.getParameter("kit_id")); 171 if (kitId > 0) 172 { 173 Kit kit = Kit.getById(dc, kitId); 174 event.setKit(kit); 175 cc.setRecent(kit, maxRecent); 176 } 162 177 int hardwareId = Values.getInt(request.getParameter("hardware_id")); 163 178 if (hardwareId > 0) … … 219 234 event.setProtocol(pt); 220 235 cc.setRecent(pt, sourceBioMaterialType.name(), maxRecent); 236 } 237 int kitId = Values.getInt(request.getParameter("kit_id")); 238 if (kitId > 0) 239 { 240 Kit kit = Kit.getById(dc, kitId); 241 event.setKit(kit); 242 cc.setRecent(kit, maxRecent); 221 243 } 222 244 int hardwareId = Values.getInt(request.getParameter("hardware_id")); -
trunk/www/biomaterials/wizards/move_biomaterial.js
r6611 r6997 51 51 Buttons.addClickHandler('protocol_id.select', Wizards.selectProtocol); 52 52 Events.addEventHandler('protocol_id', 'base-selected', Wizards.setProtocolCallback); 53 54 // Kit 55 Buttons.addClickHandler('kit_id.select', Wizards.selectKit); 56 Events.addEventHandler('kit_id', 'base-selected', Wizards.setKitCallback); 53 57 54 58 // Hardware -
trunk/www/biomaterials/wizards/move_biomaterial.jsp
r6611 r6997 32 32 import="net.sf.basedb.core.Hardware" 33 33 import="net.sf.basedb.core.Protocol" 34 import="net.sf.basedb.core.Kit" 34 35 import="net.sf.basedb.core.DbControl" 35 36 import="net.sf.basedb.core.Item" … … 65 66 List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE); 66 67 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL); 68 List<Kit> recentKits = (List<Kit>)cc.getRecent(dc, Item.KIT); 67 69 68 70 Item itemType = null; … … 107 109 ItemSubtype protocolType = null; 108 110 ItemSubtype hardwareType = null; 111 ItemSubtype kitType = null; 109 112 if (commonSubtype != null) 110 113 { 111 114 protocolType = commonSubtype.getRelatedSubtype(Item.PROTOCOL); 112 115 hardwareType = commonSubtype.getRelatedSubtype(Item.HARDWARE); 116 kitType = commonSubtype.getRelatedSubtype(Item.KIT); 113 117 } 114 118 … … 128 132 data-protocol-type="<%=protocolType != null ? protocolType.getId() : 0 %>" 129 133 data-hardware-type="<%=hardwareType != null ? hardwareType.getId() : 0 %>" 134 data-kit-type="<%=kitType != null ? kitType.getId() : 0 %>" 130 135 data-biomaterial-type="<%=itemType != null ? itemType.getValue() : 0 %>" 131 136 data-common-subtype="<%=commonSubtype != null ? commonSubtype.getId() : 0 %>" … … 142 147 143 148 <div class="content" > 144 <div class="absolutefull" style="height: 1 0em;">149 <div class="absolutefull" style="height: 12em;"> 145 150 <div class="absolutefull" style="width: 50%; bottom: 2em;"> 146 151 <table class="fullform input100 smaller"> … … 173 178 </tr> 174 179 <tr> 180 <th>Kit</th> 181 <td> 182 <base:select 183 id="kit_id" 184 clazz="selectionlist" 185 required="false" 186 current="<%=null%>" 187 recent="<%=recentKits%>" 188 /> 189 </td> 190 </tr> 191 <tr> 175 192 <th>Hardware</th> 176 193 <td> … … 233 250 </div> 234 251 </div> 235 <div class="absolutefull bottomborder" style="top: 1 0em;">252 <div class="absolutefull bottomborder" style="top: 12em;"> 236 253 <div class="absolutefull" style="width: 50%;"> 237 254 <div class="absolutefull bg-filled-100" style="height: 2em;"> -
trunk/www/biomaterials/wizards/place_on_plate.js
r6611 r6997 48 48 Buttons.addClickHandler('protocol_id.select', Wizards.selectProtocol); 49 49 Events.addEventHandler('protocol_id', 'base-selected', Wizards.setProtocolCallback); 50 51 // Kit 52 Buttons.addClickHandler('kit_id.select', Wizards.selectKit); 53 Events.addEventHandler('kit_id', 'base-selected', Wizards.setKitCallback); 50 54 51 55 // Hardware -
trunk/www/biomaterials/wizards/place_on_plate.jsp
r6611 r6997 27 27 import="net.sf.basedb.core.MeasuredBioMaterial" 28 28 import="net.sf.basedb.core.Hardware" 29 import="net.sf.basedb.core.Kit" 29 30 import="net.sf.basedb.core.Protocol" 30 31 import="net.sf.basedb.core.ItemSubtype" … … 61 62 List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE); 62 63 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL); 64 List<Kit> recentKits = (List<Kit>)cc.getRecent(dc, Item.KIT); 63 65 64 66 ItemQuery<MeasuredBioMaterial> query = (ItemQuery<MeasuredBioMaterial>)cc.getQuery(); … … 101 103 ItemSubtype protocolType = null; 102 104 ItemSubtype hardwareType = null; 105 ItemSubtype kitType = null; 103 106 if (commonSubtype != null) 104 107 { 105 108 protocolType = commonSubtype.getRelatedSubtype(Item.PROTOCOL); 106 109 hardwareType = commonSubtype.getRelatedSubtype(Item.HARDWARE); 110 kitType = commonSubtype.getRelatedSubtype(Item.KIT); 107 111 } 108 112 if (protocolType == null) … … 115 119 String defaultId = Hardware.getDefaultSystemId(itemType); 116 120 if (defaultId != null) hardwareType = ItemSubtype.getById(dc, SystemItems.getId(defaultId)); 121 } 122 if (kitType == null) 123 { 124 String defaultId = Kit.getDefaultSystemId(itemType); 125 if (defaultId != null) kitType = ItemSubtype.getById(dc, SystemItems.getId(defaultId)); 117 126 } 118 127 %> … … 125 134 <div id="page-data" class="datacontainer" 126 135 data-protocol-type="<%=protocolType != null ? protocolType.getId() : 0 %>" 136 data-kit-type="<%=kitType != null ? kitType.getId() : 0 %>" 127 137 data-hardware-type="<%=hardwareType != null ? hardwareType.getId() : 0 %>" 128 138 data-biomaterial-type="<%=itemType.getValue()%>" … … 154 164 { 155 165 %> 156 <div class="absolutefull" style="height: 1 0em;">166 <div class="absolutefull" style="height: 12em;"> 157 167 <div class="absolutefull" style="width: 50%; bottom: 2em;"> 158 168 <table class="fullform input100 smaller"> … … 181 191 current="<%=null%>" 182 192 recent="<%=recentProtocols%>" 193 /> 194 </td> 195 </tr> 196 <tr> 197 <th>Kit</th> 198 <td> 199 <base:select 200 id="kit_id" 201 clazz="selectionlist" 202 required="false" 203 current="<%=null%>" 204 recent="<%=recentKits%>" 183 205 /> 184 206 </td> … … 240 262 </div> 241 263 242 <div class="absolutefull bottomborder" style="top: 1 0em;">264 <div class="absolutefull bottomborder" style="top: 12em;"> 243 265 <div class="absolutefull rightborder" style="width: 280px;"> 244 266 <div class="absolutefull bg-filled-100" style="height: 2em;"> -
trunk/www/biomaterials/wizards/wizards.js
r6396 r6997 90 90 } 91 91 92 wizards.selectKit = function() 93 { 94 var frm = document.forms['main']; 95 var url = '&resetTemporary=1'; 96 url += '&tmpfilter:BOOLEAN:inactive=0'; 97 if (frm.kit_id.length > 1) 98 { 99 var id = Math.abs(parseInt(frm.kit_id[1].value)); 100 url += '&item_id='+id; 101 } 102 var kitType = Data.int('page-data', 'kit-type'); 103 if (kitType) 104 { 105 url += '&tmpfilter:INT:itemSubtype='+kitType; 106 } 107 Dialogs.selectItem('KIT', 'kit_id', 0, url); 108 } 109 110 wizards.setKitCallback = function(event) 111 { 112 var frm = document.forms['main']; 113 var list = frm.kit_id; 114 if (list.length < 2 || list[1].value == '0') 115 { 116 Forms.addListOption(list, 1, new Option()); 117 } 118 list[1].value = event.detail.id; 119 list[1].text = event.detail.name; 120 list.selectedIndex = 1; 121 } 92 122 93 123 return wizards;
Note: See TracChangeset
for help on using the changeset viewer.