Changeset 2472
- Timestamp:
- Jul 31, 2006, 8:43:18 AM (17 years ago)
- Location:
- trunk/www
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/biomaterials/extracts/edit_extract.jsp
r2466 r2472 93 93 name = currentSample.getName() + ".e" + (currentSample.countExtracts() + 1); 94 94 } 95 else if(Values.getBoolean(request.getParameter("pooled"))) 96 { 97 isPooled = true; 98 name = Values.getString(cc.getPropertyValue("name"), "New pooled extract"); 99 } 95 100 else 96 101 { … … 283 288 { 284 289 frm.used_quantity.value = item.value; 290 frm.used_quantity.focus(); 285 291 } 286 292 else … … 348 354 %> 349 355 Link.addNewItem(extracts, new Item('E', <%=e.getId()%>, '<%=HTML.javaScriptEncode(e.getName())%> [<%=usedQuantity%> µg]', '<%=usedQuantity%>')); 356 <% 357 } 358 } 359 else if (extract == null && Values.getBoolean(request.getParameter("pooled"))) 360 { 361 for (int eId : cc.getSelected()) 362 { 363 Extract extractToPool = Extract.getById(dc, eId); 364 %> 365 Link.addNewItem(extracts, new Item('E', <%=extractToPool.getId()%>, '<%=HTML.javaScriptEncode(extractToPool.getName())%> [-]', '', '0')); 350 366 <% 351 367 } -
trunk/www/biomaterials/extracts/index.jsp
r2464 r2472 124 124 forward = editPage; 125 125 } 126 else if ("NewPooledItem".equals(cmd)) 127 { 128 // Display the edit page for a new pooled item (should be opened in a popup) 129 if (!sc.hasPermission(Permission.CREATE, itemType)) 130 { 131 throw new PermissionDeniedException(Permission.CREATE, itemType.toString()); 132 } 133 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 134 cc.setId(0); 135 forward = editPage+"&pooled="+true; 136 } 126 137 else if ("UpdateItem".equals(cmd)) 127 138 { -
trunk/www/biomaterials/extracts/list_extracts.jsp
r2464 r2472 107 107 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true); 108 108 } 109 function newPooledItem() 110 { 111 Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPooledItem'); 112 } 109 113 function editItem(itemId) 110 114 { … … 349 353 title="New…" 350 354 tooltip="<%=createPermission ? "Create new extract" : "You do not have permission to create extracts"%>" 355 /> 356 <tbl:button 357 disabled="<%=createPermission ? false : true%>" 358 image="<%=createPermission ? "new_pooled.gif" : "new_pooled_disabled.gif"%>" 359 onclick="newPooledItem()" 360 title="Pool…" 361 tooltip="<%=createPermission ? "Create new pooled extract" : "You do not have permission to create extracts"%>" 351 362 /> 352 363 <tbl:button -
trunk/www/biomaterials/labeledextracts/edit_labeledextract.jsp
r2466 r2472 105 105 name = currentExtract.getName() +".lbe"+ (currentExtract.countLabeledExtracts() + 1); 106 106 } 107 else if (Values.getBoolean(request.getParameter("pooled"))) 108 { 109 isPooled = true; 110 name = Values.getString(cc.getPropertyValue("name"), "New pooled labeled extract"); 111 } 107 112 else 108 113 { … … 311 316 { 312 317 frm.used_quantity.value = item.value; 318 frm.used_quantity.focus(); 313 319 } 314 320 else … … 375 381 %> 376 382 Link.addNewItem(extracts, new Item('E', <%=e.getId()%>, '<%=HTML.javaScriptEncode(e.getName())%> [<%=usedQuantity%> µg]', '<%=usedQuantity%>')); 383 <% 384 } 385 } 386 else if (extract == null && Values.getBoolean(request.getParameter("pooled"))) 387 { 388 for (int id : cc.getSelected()) 389 { 390 LabeledExtract e = LabeledExtract.getById(dc, id); 391 %> 392 Link.addNewItem(extracts, new Item('E', <%=e.getId()%>, '<%=HTML.javaScriptEncode(e.getName())%> [-]', '', '0')); 377 393 <% 378 394 } … … 584 600 <td> 585 601 <select name="labeledextracts" size="5" multiple style="width: 20em;" 586 onchange=" extractsOnChange()">602 onchange="labeledExtractsOnChange()"> 587 603 </select> <br> 588 604 Used -
trunk/www/biomaterials/labeledextracts/index.jsp
r2465 r2472 125 125 forward = editPage; 126 126 } 127 else if ("NewPooledItem".equals(cmd)) 128 { 129 //Display the edit page for a new pooled item (should be opened in a popup) 130 if (!sc.hasPermission(Permission.CREATE, itemType)) 131 { 132 throw new PermissionDeniedException(Permission.CREATE, itemType.toString()); 133 } 134 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 135 cc.setId(0); 136 forward = editPage+"&pooled="+true; 137 } 127 138 else if ("UpdateItem".equals(cmd)) 128 139 { -
trunk/www/biomaterials/labeledextracts/list_labeledextracts.jsp
r2466 r2472 103 103 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true); 104 104 } 105 function newPooledItem() 106 { 107 Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPooledItem'); 108 } 105 109 function editItem(itemId) 106 110 { … … 290 294 /> 291 295 <tbl:columndef 292 id="parent "293 title="Parent "296 id="parents" 297 title="Parents" 294 298 /> 295 299 <tbl:columndef … … 357 361 title="New…" 358 362 tooltip="<%=createPermission ? "Create new labeled extract" : "You do not have permission to create labeled extracts"%>" 363 /> 364 <tbl:button 365 disabled="<%=createPermission ? false : true%>" 366 image="<%=createPermission ? "new_pooled.gif" : "new_pooled_disabled.gif"%>" 367 onclick="newPooledItem()" 368 title="Pool…" 369 tooltip="<%=createPermission ? "Create new pooled labeled extract" : "You do not have permission to create labeled extracts"%>" 359 370 /> 360 371 <tbl:button … … 520 531 <tbl:cell column="eventDate"><%=Values.formatDate(creationEvent.getEventDate())%></tbl:cell> 521 532 <tbl:cell column="entryDate"><%=Values.formatDate(creationEvent.getEntryDate())%></tbl:cell> 522 <tbl:cell column="parent ">533 <tbl:cell column="parents"> 523 534 <% 524 535 if (!item.isPooled()) … … 531 542 { 532 543 String separator = ""; 533 ItemQuery< Extract> parentQuery = (ItemQuery<Extract>)item.getCreationEvent().getSources();544 ItemQuery<LabeledExtract> parentQuery = (ItemQuery<LabeledExtract>)item.getCreationEvent().getSources(); 534 545 parentQuery.include(Include.MINE, Include.OTHERS, Include.IN_PROJECT, Include.SHARED); 535 546 parentQuery.order(Orders.asc(Hql.property("name"))); 536 547 537 for ( Extract e : parentQuery.list(dc))548 for (LabeledExtract e : parentQuery.list(dc)) 538 549 { 539 550 out.write(separator); -
trunk/www/biomaterials/samples/edit_sample.jsp
r2456 r2472 92 92 name = currentBioSource.getName() + ".s" + (currentBioSource.countSamples() + 1); 93 93 } 94 else if (Values.getBoolean(request.getParameter("pooled"))) 95 { 96 isPooled = true; 97 name = Values.getString(cc.getPropertyValue("name"),"New pooled sample"); 98 } 94 99 else 95 100 { … … 279 284 { 280 285 frm.used_quantity.value = item.value; 286 frm.used_quantity.focus(); 281 287 } 282 288 else … … 333 339 %> 334 340 Link.addNewItem(samples, new Item('S', <%=s.getId()%>, '<%=HTML.javaScriptEncode(s.getName())%> [<%=usedQuantity%> µg]', '<%=usedQuantity%>')); 341 <% 342 } 343 } 344 else if(sample == null && Values.getBoolean(request.getParameter("pooled"))) 345 { 346 for (int sid : cc.getSelected()) 347 { 348 Sample sampleToPool = Sample.getById(dc, sid); 349 %> 350 Link.addNewItem(samples, new Item('S', <%=sampleToPool.getId()%>, '<%=HTML.javaScriptEncode(sampleToPool.getName())%> [-]', '', '0')); 335 351 <% 336 352 } -
trunk/www/biomaterials/samples/index.jsp
r2421 r2472 124 124 forward = editPage; 125 125 } 126 else if ("NewPooledItem".equals(cmd)) 127 { 128 // Display the edit page for a new pooled item (should be opened in a popup) 129 if (!sc.hasPermission(Permission.CREATE, itemType)) 130 { 131 throw new PermissionDeniedException(Permission.CREATE, itemType.toString()); 132 } 133 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 134 cc.setId(0); 135 forward = editPage+"&pooled="+true; 136 } 126 137 else if ("UpdateItem".equals(cmd)) 127 138 { -
trunk/www/biomaterials/samples/list_samples.jsp
r2437 r2472 108 108 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true); 109 109 } 110 function newPooledItem() 111 { 112 Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPooledItem'); 113 } 110 114 function editItem(itemId) 111 115 { … … 350 354 title="New…" 351 355 tooltip="<%=createPermission ? "Create new sample" : "You do not have permission to create samples"%>" 356 /> 357 <tbl:button 358 disabled="<%=createPermission ? false : true%>" 359 image="<%=createPermission ? "new_pooled.gif" : "new_pooled_disabled.gif"%>" 360 onclick="newPooledItem()" 361 title="Pool…" 362 tooltip="<%=createPermission ? "Create new pooled sample" : "You do not have permission to create samples"%>" 352 363 /> 353 364 <tbl:button -
trunk/www/include/scripts/table.js
r2368 r2472 189 189 if (extraParameters) url += '&'+extraParameters; 190 190 Main.openPopup(url, 'Export'+tableId, 600, 460); 191 } 192 193 this.poolItems = function(submitPage, ID, tableId, itemType, cmd, regexp) 194 { 195 var frm = document.forms[tableId]; 196 if (Forms.numChecked(frm) < 2) 197 { 198 alert('Please select at least two items in the list'); 199 return; 200 } 201 var oldAction = frm.action; 202 var oldCmd = frm.cmd.value; 203 frm.action = submitPage; 204 frm.cmd.value = cmd ? cmd : "NewPooledItem"; 205 frm.target = 'NewPooledItem'+tableId; 206 Main.openPopup('', 'NewPooledItem'+tableId, 800, 500); 207 frm.submit(); 208 frm.target = window.name; 209 frm.action = oldAction; 210 frm.cmd.value = oldCmd; 191 211 } 192 212
Note: See TracChangeset
for help on using the changeset viewer.