Changeset 6260
- Timestamp:
- Mar 27, 2013, 9:22:17 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/TabControl.java
r6164 r6260 311 311 { 312 312 numTabs++; 313 if (( (active == null) && (numTabs == 1)) || (active != null) && active.equals(tab.getId()))313 if ((active != null) && active.equals(tab.getId())) 314 314 { 315 315 initialTab = tab.getId(); -
trunk/www/biomaterials/bioplateeventtypes/list_eventtypes.jsp
r6221 r6260 96 96 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 97 97 %> 98 <base:page title="<%=title==null ? "Bioplate event types" : title%>" type="<%=mode.getPageType()%>" >99 <base:head scripts="table.js " styles="table.css,toolbar.css">98 <base:page title="<%=title==null ? "Bioplate event types" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 99 <base:head scripts="table.js,~bioplateeventtypes.js" styles="table.css,toolbar.css"> 100 100 <ext:scripts context="<%=jspContext%>" /> 101 101 <ext:stylesheets context="<%=jspContext%>" /> 102 <script>103 var submitPage = 'index.jsp';104 var formId = 'bioPlateEventTypes';105 function newItem()106 {107 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);108 }109 function editItem(itemId)110 {111 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);112 }113 function viewItem(itemId)114 {115 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);116 }117 function itemOnClick(evt, itemId)118 {119 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);120 }121 function deleteItems()122 {123 var frm = document.forms[formId];124 if (Forms.numChecked(frm) == 0)125 {126 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');127 return;128 }129 frm.action = submitPage;130 frm.cmd.value = 'DeleteItems';131 frm.submit();132 }133 function restoreItems()134 {135 var frm = document.forms[formId];136 if (Forms.numChecked(frm) == 0)137 {138 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');139 return;140 }141 frm.action = submitPage;142 frm.cmd.value = 'RestoreItems';143 frm.submit();144 }145 function configureColumns()146 {147 Table.configureColumns(formId);148 }149 function runPlugin(cmd)150 {151 Table.submitToPopup(formId, cmd, 750, 500);152 }153 function returnSelected()154 {155 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);156 window.close();157 }158 </script>159 102 </base:head> 160 103 … … 162 105 <h1><%=title==null ? "Bioplate event types" : title%></h1> 163 106 <div class="content"> 164 165 107 <tbl:table 166 id="bio PlateEventTypes"108 id="bioplateeventtypes" 167 109 columns="<%=cc.getSetting("columns")%>" 168 110 sortby="<%=cc.getSortProperty()%>" … … 232 174 > 233 175 <tbl:button 176 id="btnNewItem" 234 177 disabled="<%=!createPermission%>" 235 178 image="new.png" 236 onclick="newItem()"237 179 title="New…" 238 180 tooltip="<%=createPermission ? "Create new bioplate event type" : "You do not have permission to create bioplate event types"%>" 239 181 /> 240 182 <tbl:button 183 id="btnDeleteItems" 241 184 image="delete.png" 242 onclick="deleteItems()"243 185 title="Delete" 244 186 tooltip="Delete the selected items" 245 187 /> 246 188 <tbl:button 189 id="btnRestoreItems" 247 190 image="restore.png" 248 onclick="restoreItems()"249 191 title="Restore" 250 192 tooltip="Restore the selected (deleted) items" 251 193 /> 252 194 <tbl:button 195 id="btnColumns" 253 196 image="columns.png" 254 onclick="configureColumns()"255 197 title="Columns…" 256 198 tooltip="Show, hide and re-order columns" 257 199 /> 258 200 <tbl:button 201 id="btnImport" 202 data-plugin-type="IMPORT" 259 203 image="import.png" 260 onclick="runPlugin('ImportItems')"261 204 title="Import…" 262 205 tooltip="Import data" … … 264 207 /> 265 208 <tbl:button 209 id="btnExport" 210 data-plugin-type="EXPORT" 266 211 image="export.png" 267 onclick="runPlugin('ExportItems')"268 212 title="Export…" 269 213 tooltip="Export data" … … 271 215 /> 272 216 <tbl:button 217 id="btnRunPlugin" 218 data-plugin-type="OTHER" 273 219 image="runplugin.png" 274 onclick="runPlugin('RunListPlugin')"275 220 title="Run plugin…" 276 221 tooltip="Run a plugin" … … 381 326 visible="<%=item.isRemoved()%>" 382 327 /> </tbl:header> 383 <tbl:cell column="name"><div class="link" 384 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 328 <tbl:cell column="name"><div 329 class="link table-item" 330 data-item-id="<%=itemId%>" 331 data-no-edit="<%=writePermission ? 0 : 1 %>" 332 tabindex="0" 385 333 title="<%=tooltip%>"><%=name%></div></tbl:cell> 386 334 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 411 359 412 360 <base:buttongroup subclass="dialogbuttons"> 413 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />414 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />415 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />361 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 362 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 363 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 416 364 </base:buttongroup> 417 365 -
trunk/www/biomaterials/bioplates/events/list_events.jsp
r6221 r6260 109 109 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 110 110 %> 111 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" >112 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">111 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> 112 <base:head scripts="table.js,tabcontrol-2.js,~events.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 113 113 <ext:scripts context="<%=jspContext%>" /> 114 114 <ext:stylesheets context="<%=jspContext%>" /> 115 <script>116 var submitPage = 'index.jsp';117 var formId = 'events';118 function editItem(itemId)119 {120 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);121 }122 function viewItem(itemId)123 {124 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false, '&bioplate_id=<%=bioPlateId%>');125 }126 function itemOnClick(evt, itemId)127 {128 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);129 }130 function deleteItems()131 {132 var frm = document.forms[formId];133 if (Forms.numChecked(frm) == 0)134 {135 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');136 return;137 }138 frm.action = submitPage;139 frm.cmd.value = 'DeleteItems';140 frm.submit();141 }142 function restoreItems()143 {144 var frm = document.forms[formId];145 if (Forms.numChecked(frm) == 0)146 {147 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');148 return;149 }150 frm.action = submitPage;151 frm.cmd.value = 'RestoreItems';152 frm.submit();153 }154 function setOwner()155 {156 Table.setOwnerOfItems(formId);157 }158 function shareItems()159 {160 Table.shareItems(formId);161 }162 function configureColumns()163 {164 Table.configureColumns(formId);165 }166 function runPlugin(cmd)167 {168 Table.submitToPopup(formId, cmd, 750, 500);169 }170 function returnSelected()171 {172 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);173 window.close();174 }175 function switchTab(tabControlId, tabId)176 {177 if (tabId == 'properties' || tabId == 'annotations' || tabId == 'overview' || tabId == 'history')178 {179 location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioPlateId%>&tab='+tabId;180 }181 else if (tabId == 'biowells')182 {183 location.href = '../wells/index.jsp?ID=<%=ID%>&bioplate_id=<%=bioPlateId%>';184 }185 else186 {187 TabControl.setActiveTab(tabControlId, tabId);188 }189 }190 </script>191 115 </base:head> 192 193 116 <base:body> 194 117 <% … … 214 137 subclass="content mastertabcontrol" 215 138 notabs="<%=mode.isSelectionMode() %>" 216 active="events" switch="switchTab">139 active="events"> 217 140 <t:tab id="properties" title="Properties" /> 218 141 <t:tab id="annotations" title="Annotations" /> … … 366 289 > 367 290 <tbl:button 291 id="btnDeleteItems" 368 292 image="delete.png" 369 onclick="deleteItems()"370 293 title="Delete" 371 294 tooltip="Delete the selected items" 372 295 /> 373 296 <tbl:button 297 id="btnRestoreItems" 374 298 image="restore.png" 375 onclick="restoreItems()"376 299 title="Restore" 377 300 tooltip="Restore the selected (deleted) items" 378 301 /> 379 302 <tbl:button 303 id="btnShareItems" 380 304 image="share.png" 381 onclick="shareItems()"382 305 title="Share…" 383 306 tooltip="Share the selected items" 384 307 /> 385 308 <tbl:button 309 id="btnSetOwner" 386 310 image="take_ownership.png" 387 onclick="setOwner()"388 311 title="Set owner…" 389 312 tooltip="Change owner of the selected items" 390 313 /> 391 314 <tbl:button 315 id="btnColumns" 392 316 image="columns.png" 393 onclick="configureColumns()"394 317 title="Columns…" 395 318 tooltip="Show, hide and re-order columns" 396 319 /> 397 320 <tbl:button 321 id="btnImport" 322 data-plugin-type="IMPORT" 398 323 image="import.png" 399 onclick="runPlugin('ImportItems')"400 324 title="Import…" 401 325 tooltip="Import data" … … 403 327 /> 404 328 <tbl:button 329 id="btnExport" 330 data-plugin-type="EXPORT" 405 331 image="export.png" 406 onclick="runPlugin('ExportItems')"407 332 title="Export…" 408 333 tooltip="Export data" … … 410 335 /> 411 336 <tbl:button 337 id="btnRunPlugin" 338 data-plugin-type="OTHER" 412 339 image="runplugin.png" 413 onclick="runPlugin('RunListPlugin')"414 340 title="Run plugin…" 415 341 tooltip="Run a plugin" … … 530 456 visible="<%=item.isShared()%>" 531 457 /> </tbl:header> 532 <tbl:cell column="name"><div class="link" 533 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 458 <tbl:cell column="name"><div 459 class="link table-item" 460 data-item-id="<%=itemId%>" 461 data-no-edit="<%=writePermission ? 0 : 1 %>" 462 data-extra-url="&bioplate_id=<%=bioPlateId%>" 463 tabindex="0" 534 464 title="<%=tooltip%>"><%=name%></div></tbl:cell> 535 465 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 635 565 636 566 <base:buttongroup subclass="dialogbuttons"> 637 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />638 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />639 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />567 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 568 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 569 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 640 570 </base:buttongroup> 641 571 -
trunk/www/biomaterials/bioplates/list_bioplates.jsp
r6221 r6260 133 133 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 134 134 %> 135 <base:page title="<%=title==null ? "Bioplates" : title%>" type="<%=mode.getPageType()%>" >136 <base:head scripts="table.js " styles="table.css,toolbar.css">135 <base:page title="<%=title==null ? "Bioplates" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 136 <base:head scripts="table.js,~bioplates.js" styles="table.css,toolbar.css"> 137 137 <ext:scripts context="<%=jspContext%>" /> 138 138 <ext:stylesheets context="<%=jspContext%>" /> 139 <script>140 var submitPage = 'index.jsp';141 var formId = 'bioplates';142 function newItem()143 {144 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);145 }146 function editItem(itemId)147 {148 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);149 }150 function viewItem(itemId)151 {152 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);153 }154 function itemOnClick(evt, itemId)155 {156 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);157 }158 function deleteItems()159 {160 var frm = document.forms[formId];161 if (Forms.numChecked(frm) == 0)162 {163 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');164 return;165 }166 frm.action = submitPage;167 frm.cmd.value = 'DeleteItems';168 frm.submit();169 }170 function restoreItems()171 {172 var frm = document.forms[formId];173 if (Forms.numChecked(frm) == 0)174 {175 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');176 return;177 }178 frm.action = submitPage;179 frm.cmd.value = 'RestoreItems';180 frm.submit();181 }182 function setOwner()183 {184 Table.setOwnerOfItems(formId);185 }186 function shareItems()187 {188 Table.shareItems(formId);189 }190 function configureColumns()191 {192 Table.configureColumns(formId);193 }194 function runPlugin(cmd)195 {196 Table.submitToPopup(formId, cmd, 750, 500);197 }198 function returnSelected()199 {200 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);201 window.close();202 }203 </script>204 139 </base:head> 205 140 <base:body> … … 452 387 > 453 388 <tbl:button 389 id="btnNewItem" 454 390 disabled="<%=!createPermission%>" 455 391 image="new.png" 456 onclick="newItem()"457 392 title="New…" 458 393 tooltip="<%=createPermission ? "Create new bioplate" : "You do not have permission to create bioplate"%>" 459 394 /> 460 395 <tbl:button 396 id="btnDeleteItems" 461 397 image="delete.png" 462 onclick="deleteItems()"463 398 title="Delete" 464 399 tooltip="Delete the selected items" 465 400 /> 466 401 <tbl:button 402 id="btnRestoreItems" 467 403 image="restore.png" 468 onclick="restoreItems()"469 404 title="Restore" 470 405 tooltip="Restore the selected (deleted) items" 471 406 /> 472 407 <tbl:button 408 id="btnShareItems" 473 409 image="share.png" 474 onclick="shareItems()"475 410 title="Share…" 476 411 tooltip="Share the selected items" 477 412 /> 478 413 <tbl:button 414 id="btnSetOwner" 479 415 image="take_ownership.png" 480 onclick="setOwner()"481 416 title="Set owner…" 482 417 tooltip="Change owner of the selected items" 483 418 /> 484 419 <tbl:button 420 id="btnColumns" 485 421 image="columns.png" 486 onclick="configureColumns()"487 422 title="Columns…" 488 423 tooltip="Show, hide and re-order columns" 489 424 /> 490 425 <tbl:button 426 id="btnImport" 427 data-plugin-type="IMPORT" 491 428 image="import.png" 492 onclick="runPlugin('ImportItems')"493 429 title="Import…" 494 430 tooltip="Import data" … … 496 432 /> 497 433 <tbl:button 434 id="btnExport" 435 data-plugin-type="EXPORT" 498 436 image="export.png" 499 onclick="runPlugin('ExportItems')"500 437 title="Export…" 501 438 tooltip="Export data" … … 503 440 /> 504 441 <tbl:button 442 id="btnRunPlugin" 443 data-plugin-type="OTHER" 505 444 image="runplugin.png" 506 onclick="runPlugin('RunListPlugin')"507 445 title="Run plugin…" 508 446 tooltip="Run a plugin" … … 622 560 visible="<%=item.isShared()%>" 623 561 /> </tbl:header> 624 <tbl:cell column="name"><div class="link" 625 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 562 <tbl:cell column="name"><div 563 class="link table-item" 564 data-item-id="<%=itemId%>" 565 data-no-edit="<%=writePermission ? 0 : 1 %>" 566 tabindex="0" 626 567 title="<%=tooltip%>"><%=name%></div></tbl:cell> 627 568 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 741 682 742 683 <base:buttongroup subclass="dialogbuttons"> 743 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />744 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />745 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />684 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 685 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 686 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 746 687 </base:buttongroup> 747 688 </base:body> -
trunk/www/biomaterials/bioplates/wells/list_biowells.jsp
r6221 r6260 130 130 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 131 131 %> 132 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" >133 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">132 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> 133 <base:head scripts="table.js,tabcontrol-2.js,~biowells.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 134 134 <ext:scripts context="<%=jspContext%>" /> 135 135 <ext:stylesheets context="<%=jspContext%>" /> 136 <script>137 var submitPage = 'index.jsp';138 var formId = 'biowells';139 140 function editItem(itemId)141 {142 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);143 }144 function itemOnClick(itemId)145 {146 Table.itemOnClick(formId, null, itemId, '<%=mode.getName()%>', null, null, returnSelected);147 }148 function configureColumns()149 {150 Table.configureColumns(formId);151 }152 function runPlugin(cmd)153 {154 Table.submitToPopup(formId, cmd, 750, 500);155 }156 function returnSelected()157 {158 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);159 window.close();160 }161 function switchTab(tabControlId, tabId)162 {163 if (tabId == 'properties' || tabId == 'annotations' || tabId == 'overview' || tabId == 'history')164 {165 location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioPlateId%>&tab='+tabId;166 }167 else if (tabId == 'events')168 {169 location.href = '../events/index.jsp?ID=<%=ID%>&bioplate_id=<%=bioPlateId%>';170 }171 else172 {173 TabControl.setActiveTab(tabControlId, tabId);174 }175 }176 </script>177 136 </base:head> 178 179 137 <base:body> 180 138 <% … … 195 153 } 196 154 %> 197 198 155 <t:tabcontrol 199 156 id="main" 200 157 subclass="content mastertabcontrol" 201 active="biowells" switch="switchTab"158 active="biowells" 202 159 notabs="<%=mode.isSelectionMode()%>" 203 160 > … … 325 282 > 326 283 <tbl:button 284 id="btnColumns" 327 285 image="columns.png" 328 onclick="configureColumns()"329 286 title="Columns…" 330 287 tooltip="Show, hide and re-order columns" 331 288 /> 332 289 <tbl:button 290 id="btnImport" 291 data-plugin-type="IMPORT" 333 292 image="import.png" 334 onclick="runPlugin('ImportItems')"335 293 title="Import…" 336 294 tooltip="Import data" … … 338 296 /> 339 297 <tbl:button 298 id="btnExport" 299 data-plugin-type="EXPORT" 340 300 image="export.png" 341 onclick="runPlugin('ExportItems')"342 301 title="Export…" 343 302 tooltip="Export data" … … 345 304 /> 346 305 <tbl:button 306 id="btnRunPlugin" 307 data-plugin-type="OTHER" 347 308 image="runplugin.png" 348 onclick="runPlugin('RunListPlugin')"349 309 title="Run plugin…" 350 310 tooltip="Run a plugin" … … 470 430 { 471 431 %> 472 <div class="link" onclick="itemOnClick(<%=itemId%>)" title="Select this item"> 432 <div 433 class="link table-item" 434 data-item-id="<%=itemId%>" 435 tabindex="0" 436 title="Select this item"> 473 437 <tbl:cellvalue value="<%=item.getRow()%>" /> 474 438 </div> … … 491 455 <base:icon 492 456 visible="<%=editWellPermission%>" 457 subclass="link auto-init" 458 data-auto-init="item-link" 459 data-item-type="BIOWELL" 460 data-item-id="<%=itemId %>" 493 461 image="edit.png" 494 462 tooltip="<%=bioMaterial == null ? "Add biomaterial to this well" : "Change the biomaterial in this well"%>" 495 onclick="<%="editItem("+item.getId()+")"%>"496 463 /> 497 464 <base:icon … … 537 504 538 505 <base:buttongroup subclass="dialogbuttons"> 539 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />540 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />541 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />506 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 507 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 508 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 542 509 </base:buttongroup> 543 510 544 545 511 </base:body> 546 512 </base:page> -
trunk/www/biomaterials/bioplatetypes/list_platetypes.jsp
r6221 r6260 123 123 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 124 124 %> 125 <base:page title="<%=title==null ? "Bioplate types" : title%>" type="<%=mode.getPageType()%>" >126 <base:head scripts="table.js " styles="table.css,toolbar.css">125 <base:page title="<%=title==null ? "Bioplate types" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 126 <base:head scripts="table.js,~bioplatetypes.js" styles="table.css,toolbar.css"> 127 127 <ext:scripts context="<%=jspContext%>" /> 128 128 <ext:stylesheets context="<%=jspContext%>" /> 129 <script>130 var submitPage = 'index.jsp';131 var formId = 'bioPlateTypes';132 function newItem()133 {134 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);135 }136 function editItem(itemId)137 {138 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);139 }140 function viewItem(itemId)141 {142 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);143 }144 function itemOnClick(evt, itemId)145 {146 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);147 }148 function deleteItems()149 {150 var frm = document.forms[formId];151 if (Forms.numChecked(frm) == 0)152 {153 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');154 return;155 }156 frm.action = submitPage;157 frm.cmd.value = 'DeleteItems';158 frm.submit();159 }160 function restoreItems()161 {162 var frm = document.forms[formId];163 if (Forms.numChecked(frm) == 0)164 {165 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');166 return;167 }168 frm.action = submitPage;169 frm.cmd.value = 'RestoreItems';170 frm.submit();171 }172 function configureColumns()173 {174 Table.configureColumns(formId);175 }176 function runPlugin(cmd)177 {178 Table.submitToPopup(formId, cmd, 750, 500);179 }180 function returnSelected()181 {182 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);183 window.close();184 }185 </script>186 129 </base:head> 187 130 … … 191 134 <div class="content"> 192 135 <tbl:table 193 id="bio PlateTypes"136 id="bioplatetypes" 194 137 columns="<%=cc.getSetting("columns")%>" 195 138 sortby="<%=cc.getSortProperty()%>" … … 293 236 > 294 237 <tbl:button 238 id="btnNewItem" 295 239 disabled="<%=!createPermission%>" 296 240 image="new.png" 297 onclick="newItem()"298 241 title="New…" 299 242 tooltip="<%=createPermission ? "Create new bioplate type" : "You do not have permission to create bioplate types"%>" 300 243 /> 301 244 <tbl:button 245 id="btnDeleteItems" 302 246 image="delete.png" 303 onclick="deleteItems()"304 247 title="Delete" 305 248 tooltip="Delete the selected items" 306 249 /> 307 250 <tbl:button 251 id="btnRestoreItems" 308 252 image="restore.png" 309 onclick="restoreItems()"310 253 title="Restore" 311 254 tooltip="Restore the selected (deleted) items" 312 255 /> 313 256 <tbl:button 257 id="btnColumns" 314 258 image="columns.png" 315 onclick="configureColumns()"316 259 title="Columns…" 317 260 tooltip="Show, hide and re-order columns" 318 261 /> 319 262 <tbl:button 263 id="btnImport" 264 data-plugin-type="IMPORT" 320 265 image="import.png" 321 onclick="runPlugin('ImportItems')"322 266 title="Import…" 323 267 tooltip="Import data" … … 325 269 /> 326 270 <tbl:button 271 id="btnExport" 272 data-plugin-type="EXPORT" 327 273 image="export.png" 328 onclick="runPlugin('ExportItems')"329 274 title="Export…" 330 275 tooltip="Export data" … … 332 277 /> 333 278 <tbl:button 279 id="btnRunPlugin" 280 data-plugin-type="OTHER" 334 281 image="runplugin.png" 335 onclick="runPlugin('RunListPlugin')"336 282 title="Run plugin…" 337 283 tooltip="Run a plugin" … … 442 388 visible="<%=item.isRemoved()%>" 443 389 /> </tbl:header> 444 <tbl:cell column="name"><div class="link" 445 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 390 <tbl:cell column="name"><div 391 class="link table-item" 392 data-item-id="<%=itemId%>" 393 data-no-edit="<%=writePermission ? 0 : 1 %>" 394 tabindex="0" 446 395 title="<%=tooltip%>"><%=name%></div></tbl:cell> 447 396 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 485 434 486 435 <base:buttongroup subclass="dialogbuttons"> 487 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />488 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />489 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />436 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 437 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 438 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 490 439 </base:buttongroup> 491 440 -
trunk/www/biomaterials/events/list_events.jsp
r6221 r6260 126 126 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 127 127 %> 128 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" >129 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">128 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> 129 <base:head scripts="table.js,tabcontrol-2.js,~events.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 130 130 <ext:scripts context="<%=jspContext%>" /> 131 131 <ext:stylesheets context="<%=jspContext%>" /> 132 <script>133 var submitPage = 'index.jsp';134 var formId = 'events';135 function newItem()136 {137 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true, '&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterial.getId()%>');138 }139 function editItem(itemId)140 {141 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true, '&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterial.getId()%>');142 }143 function viewItem(itemId)144 {145 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false, '&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterial.getId()%>');146 }147 function itemOnClick(evt, itemId)148 {149 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);150 }151 function deleteItems()152 {153 var frm = document.forms[formId];154 var numChecked = Forms.numChecked(frm);155 if (numChecked == 0)156 {157 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');158 return;159 }160 else161 {162 var rep = numChecked == 1 ? 'event' : 'events';163 if (!confirm('You are about to delete '+numChecked+' '+rep+'. This can\'t be undone. Continue?'))164 {165 return;166 }167 }168 frm.action = submitPage;169 frm.cmd.value = 'DeleteItems';170 frm.submit();171 }172 function configureColumns()173 {174 Table.configureColumns(formId);175 }176 function runPlugin(cmd)177 {178 Table.submitToPopup(formId, cmd, 750, 500);179 }180 function returnSelected()181 {182 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);183 window.close();184 }185 function switchTab(tabControlId, tabId)186 {187 if (tabId == 'properties' || tabId == 'annotations' || tabId == 'overview' || tabId == 'history')188 {189 location.href = '<%=viewPage%>?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioMaterialId%>&tab='+tabId;190 }191 else192 {193 TabControl.setActiveTab(tabControlId, tabId);194 }195 }196 </script>197 132 </base:head> 198 133 … … 206 141 id="main" 207 142 subclass="mastertabcontrol content" 208 active="events" switch="switchTab">143 active="events"> 209 144 <t:tab id="properties" title="Properties" /> 210 145 <t:tab id="annotations" title="Annotations & parameters" … … 347 282 > 348 283 <tbl:button 284 id="btnNewItem" 285 data-extra-url="<%="&biomaterial_type="+bioMaterialType.name()+"&biomaterial_id="+bioMaterialId%>" 349 286 disabled="<%=!createPermission%>" 350 287 image="new.png" 351 onclick="newItem()"352 288 title="New…" 353 289 tooltip="<%=createPermission ? "Create new event" : "You do not have permission to create events"%>" 354 290 /> 355 291 <tbl:button 292 id="btnDeleteItems" 356 293 disabled="<%=!deletePermission%>" 357 294 image="delete.png" 358 295 title="Delete…" 359 onclick="deleteItems()"296 data-confirm="1" 360 297 tooltip="<%=deletePermission ? "Delete the selected events" : "You do not have permission to delete events"%>" 361 298 /> 362 299 <tbl:button 300 id="btnColumns" 363 301 image="columns.png" 364 onclick="configureColumns()"365 302 title="Columns…" 366 303 tooltip="Show, hide and re-order columns" 367 304 /> 368 305 <tbl:button 306 id="btnImport" 307 data-plugin-type="IMPORT" 369 308 image="import.png" 370 onclick="runPlugin('ImportItems')"371 309 title="Import…" 372 310 tooltip="Import data" … … 374 312 /> 375 313 <tbl:button 314 id="btnExport" 315 data-plugin-type="EXPORT" 376 316 image="export.png" 377 onclick="runPlugin('ExportItems')"378 317 title="Export…" 379 318 tooltip="Export data" … … 381 320 /> 382 321 <tbl:button 322 id="btnRunPlugin" 323 data-plugin-type="OTHER" 383 324 image="runplugin.png" 384 onclick="runPlugin('RunListPlugin')"385 325 title="Run plugin…" 386 326 tooltip="Run a plugin" … … 448 388 BioMaterialEvent.Type eventType = item.getEventType(); 449 389 int itemId = item.getId(); 390 boolean writePermission = item.hasPermission(Permission.WRITE); 391 String tooltip = mode.isSelectionMode() ? 392 "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); 450 393 String name = "TODO"; 451 394 index++; … … 484 427 if (eventType == BioMaterialEvent.Type.OTHER) 485 428 { 486 if (item.hasPermission(Permission.WRITE)) 487 { 488 %> 489 <div class="link" onclick="itemOnClick(event, <%=itemId%>)"><%=eventType%></div> 490 <% 491 } 492 else 493 { 494 %> 495 <div class="link" onclick="viewItem(<%=itemId%>)"><%=eventType%></div> 496 <% 497 } 429 %> 430 <div 431 class="link table-item" 432 data-item-id="<%=itemId%>" 433 data-no-edit="<%=writePermission ? 0 : 1 %>" 434 data-extra-url="&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterialId%>" 435 tabindex="0" 436 title="<%=tooltip%>"><%=eventType%></div> 437 <% 498 438 } 499 439 else if (eventType == BioMaterialEvent.Type.CREATION) … … 502 442 { 503 443 %> 504 <div class="link" onclick="viewItem(<%=itemId%>)"> 505 Created 506 </div> 444 <div 445 class="link table-item" 446 data-item-id="<%=itemId%>" 447 data-no-edit="1" 448 data-extra-url="&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterialId%>" 449 tabindex="0" 450 title="View this item">Created</div> 507 451 <% 508 452 } … … 517 461 {} 518 462 %> 519 <div class="link" onclick="viewItem(<%=itemId%>)"> 520 Created <%=child == null ? "child" : child.getType().toString().toLowerCase() %>: <base:propertyvalue 463 <div 464 class="link table-item" 465 data-item-id="<%=itemId%>" 466 data-no-edit="1" 467 data-extra-url="&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterialId%>" 468 tabindex="0" 469 title="View this item"> 470 Created <%=child == null ? "child" : child.getType().toString().toLowerCase() %>: <base:propertyvalue 521 471 item="<%=item%>" 522 472 property="bioMaterial" … … 524 474 enablePropertyLink="<%=false%>" 525 475 /> 526 </div>476 </div> 527 477 <% 528 478 } … … 531 481 { 532 482 %> 533 <div class="link" onclick="viewItem(<%=itemId%>)"> 534 Bioassay: <base:propertyvalue 535 item="<%=item%>" 536 property="physicalBioAssay" 537 enableEditLink="<%=false%>" 538 enablePropertyLink="<%=false%>" 539 /> 483 <div 484 class="link table-item" 485 data-item-id="<%=itemId%>" 486 data-no-edit="1" 487 data-extra-url="&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterialId%>" 488 tabindex="0" 489 title="View this item"> 490 Bioassay: <base:propertyvalue 491 item="<%=item%>" 492 property="physicalBioAssay" 493 enableEditLink="<%=false%>" 494 enablePropertyLink="<%=false%>" 495 /> 540 496 </div> 541 497 <% -
trunk/www/biomaterials/extracts/list_extracts.jsp
r6221 r6260 168 168 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 169 169 %> 170 <base:page title="<%=title==null ? "Extracts" : title%>" type="<%=mode.getPageType()%>" >171 <base:head scripts="table.js " styles="table.css,toolbar.css">170 <base:page title="<%=title==null ? "Extracts" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 171 <base:head scripts="table.js,~extracts.js" styles="table.css,toolbar.css"> 172 172 <ext:scripts context="<%=jspContext%>" /> 173 173 <ext:stylesheets context="<%=jspContext%>" /> 174 174 <script> 175 /* 175 176 var submitPage = 'index.jsp'; 176 177 var formId = 'extracts'; … … 261 262 Table.submitToPopup(formId, 'PlaceOnPlate', 900, 600); 262 263 } 264 */ 263 265 </script> 264 266 </base:head> … … 555 557 > 556 558 <tbl:button 559 id="btnNewItem" 557 560 disabled="<%=!createPermission%>" 558 561 image="new.png" 559 onclick="newItem()"560 562 title="New…" 561 563 tooltip="<%=createPermission ? "Create new extract" : "You do not have permission to create extracts"%>" 562 564 /> 563 565 <tbl:button 566 id="btnNewPooledItem" 564 567 disabled="<%=!createPermission%>" 565 568 image="new_pooled.png" 566 onclick="newPooledItem()"567 569 title="Pool…" 568 570 tooltip="<%=createPermission ? "Create new pooled extract" : "You do not have permission to create extracts"%>" 569 571 /> 570 572 <tbl:button 573 id="btnNewPhysicalBioAssay" 571 574 disabled="<%=createBioAssayPermission ? false : true%>" 572 575 image="add.png" 573 onclick="newPhysicalBioAssay()"574 576 title="New physical bioassay…" 575 577 tooltip="<%=createBioAssayPermission ? "Create new bioassay with the selected extracts" : "You do not have permission to create bioassays"%>" 576 578 /> 577 579 <tbl:button 580 id="btnDeleteItems" 578 581 image="delete.png" 579 onclick="deleteItems()"580 582 title="Delete" 581 583 tooltip="Delete the selected items" 582 584 /> 583 585 <tbl:button 586 id="btnRestoreItems" 584 587 image="restore.png" 585 onclick="restoreItems()"586 588 title="Restore" 587 589 tooltip="Restore the selected (deleted) items" 588 590 /> 589 591 <tbl:button 592 id="btnShareItems" 590 593 image="share.png" 591 onclick="shareItems()"592 594 title="Share…" 593 595 tooltip="Share the selected items" 594 596 /> 595 597 <tbl:button 598 id="btnSetOwner" 596 599 image="take_ownership.png" 597 onclick="setOwner()"598 600 title="Set owner…" 599 601 tooltip="Change owner of the selected items" 600 602 /> 601 603 <tbl:button 604 id="btnColumns" 602 605 image="columns.png" 603 onclick="configureColumns()"604 606 title="Columns…" 605 607 tooltip="Show, hide and re-order columns" 606 608 /> 607 609 <tbl:button 610 id="btnNewBioMaterialList" 608 611 image="add.png" 609 onclick="newBioMaterialList()"610 612 title="New biomaterial list…" 611 613 tooltip="Create a new biomaterial list from matching extracts" … … 613 615 /> 614 616 <tbl:button 617 id="btnPlaceOnPlate" 615 618 image="place_on_plate.png" 616 onclick="placeOnPlate()"617 619 title="Place on plate…" 618 620 tooltip="Place the selected/matching extracts on a bioplate" 619 621 /> 620 622 <tbl:button 623 id="btnImport" 624 data-plugin-type="IMPORT" 621 625 image="import.png" 622 onclick="runPlugin('ImportItems')"623 626 title="Import…" 624 627 tooltip="Import data" … … 626 629 /> 627 630 <tbl:button 631 id="btnExport" 632 data-plugin-type="EXPORT" 628 633 image="export.png" 629 onclick="runPlugin('ExportItems')"630 634 title="Export…" 631 635 tooltip="Export data" … … 633 637 /> 634 638 <tbl:button 639 id="btnRunPlugin" 640 data-plugin-type="OTHER" 635 641 image="runplugin.png" 636 onclick="runPlugin('RunListPlugin')"637 642 title="Run plugin…" 638 643 tooltip="Run a plugin" … … 755 760 visible="<%=item.isShared()%>" 756 761 /> </tbl:header> 757 <tbl:cell column="name"><div class="link" 758 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 762 <tbl:cell column="name"><div 763 class="link table-item" 764 data-item-id="<%=itemId%>" 765 data-no-edit="<%=writePermission ? 0 : 1 %>" 766 tabindex="0" 759 767 title="<%=tooltip%>"><%=name%></div></tbl:cell> 760 768 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 849 857 %> 850 858 <base:icon 859 id="<%="newextract."+itemId%>" 851 860 image="add.png" 852 onclick="<%="newExtract("+itemId+")"%>" 861 subclass="auto-init" 862 data-auto-init="new-extract" 863 data-item-id="<%=itemId %>" 853 864 tooltip="Create new child extract" 854 865 visible="<%=mode.hasEditLink() && createPermission && usePermission %>" … … 911 922 %> 912 923 <base:icon 924 id="<%="newRawBioAssay."+itemId%>" 913 925 image="add.png" 914 onclick="<%="newRawBioAssay("+itemId+")"%>" 926 subclass="auto-init" 927 data-auto-init="new-raw-bioassay" 928 data-item-id="<%=itemId %>" 915 929 tooltip="Create new raw bioassay from this extract" 916 930 visible="<%=mode.hasEditLink() && createRawBioAssayPermission && usePermission %>" … … 1031 1045 </div> 1032 1046 <base:buttongroup subclass="dialogbuttons"> 1033 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />1034 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />1035 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />1047 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 1048 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 1049 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 1036 1050 </base:buttongroup> 1037 1051 -
trunk/www/biomaterials/lists/list_lists.jsp
r6221 r6260 98 98 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 99 99 %> 100 <base:page title="<%=title==null ? "Biomaterial lists" : title%>" type="<%=mode.getPageType()%>" >101 <base:head scripts="table.js " styles="table.css,toolbar.css">100 <base:page title="<%=title==null ? "Biomaterial lists" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 101 <base:head scripts="table.js,~lists.js" styles="table.css,toolbar.css"> 102 102 <ext:scripts context="<%=jspContext%>" /> 103 103 <ext:stylesheets context="<%=jspContext%>" /> 104 <script>105 var submitPage = 'index.jsp';106 var formId = 'lists';107 function newItem()108 {109 var controller = Main.getController('BIOMATERIALLIST');110 Table.submitToPopup(formId, 'NewItem', controller.width, controller.height);111 }112 function editItem(itemId)113 {114 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);115 }116 function viewItem(itemId)117 {118 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);119 }120 function itemOnClick(evt, itemId)121 {122 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);123 }124 function deleteItems()125 {126 var frm = document.forms[formId];127 if (Forms.numChecked(frm) == 0)128 {129 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');130 return;131 }132 frm.action = submitPage;133 frm.cmd.value = 'DeleteItems';134 frm.submit();135 }136 function restoreItems()137 {138 var frm = document.forms[formId];139 if (Forms.numChecked(frm) == 0)140 {141 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');142 return;143 }144 frm.action = submitPage;145 frm.cmd.value = 'RestoreItems';146 frm.submit();147 }148 function setOwner()149 {150 Table.setOwnerOfItems(formId);151 }152 function shareItems()153 {154 Table.shareItems(formId);155 }156 function configureColumns()157 {158 Table.configureColumns(formId);159 }160 function runPlugin(cmd)161 {162 Table.submitToPopup(formId, cmd, 750, 500);163 }164 function returnSelected()165 {166 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);167 window.close();168 }169 </script>170 104 </base:head> 171 105 … … 280 214 > 281 215 <tbl:button 216 id="btnNewItem" 282 217 disabled="<%=!createPermission%>" 283 218 image="new.png" 284 onclick="newItem()"285 219 title="New…" 286 220 tooltip="<%=createPermission ? "Create new biomaterial list" : "You do not have permission to create biomaterial lists"%>" 287 221 /> 288 222 <tbl:button 223 id="btnDeleteItems" 289 224 image="delete.png" 290 onclick="deleteItems()"291 225 title="Delete" 292 226 tooltip="Delete the selected items" 293 227 /> 294 228 <tbl:button 229 id="btnRestoreItems" 295 230 image="restore.png" 296 onclick="restoreItems()"297 231 title="Restore" 298 232 tooltip="Restore the selected (deleted) items" 299 233 /> 300 234 <tbl:button 235 id="btnShareItems" 301 236 image="share.png" 302 onclick="shareItems()"303 237 title="Share…" 304 238 tooltip="Share the selected items" 305 239 /> 306 240 <tbl:button 241 id="btnSetOwner" 307 242 image="take_ownership.png" 308 onclick="setOwner()"309 243 title="Set owner…" 310 244 tooltip="Change owner of the selected items" 311 245 /> 312 246 <tbl:button 247 id="btnColumns" 313 248 image="columns.png" 314 onclick="configureColumns()"315 249 title="Columns…" 316 250 tooltip="Show, hide and re-order columns" 317 251 /> 318 252 <tbl:button 253 id="btnImport" 254 data-plugin-type="IMPORT" 319 255 image="import.png" 320 onclick="runPlugin('ImportItems')"321 256 title="Import…" 322 257 tooltip="Import data" … … 324 259 /> 325 260 <tbl:button 261 id="btnExport" 262 data-plugin-type="EXPORT" 326 263 image="export.png" 327 onclick="runPlugin('ExportItems')"328 264 title="Export…" 329 265 tooltip="Export data" … … 331 267 /> 332 268 <tbl:button 269 id="btnRunPlugin" 270 data-plugin-type="OTHER" 333 271 image="runplugin.png" 334 onclick="runPlugin('RunListPlugin')"335 272 title="Run plugin…" 336 273 tooltip="Run a plugin" … … 451 388 visible="<%=item.isShared()%>" 452 389 /> </tbl:header> 453 <tbl:cell column="name"><div class="link" 454 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 390 <tbl:cell column="name"><div 391 class="link table-item" 392 data-item-id="<%=itemId%>" 393 data-no-edit="<%=writePermission ? 0 : 1 %>" 394 tabindex="0" 455 395 title="<%=tooltip%>"><%=name%></div></tbl:cell> 456 396 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 509 449 510 450 <base:buttongroup subclass="dialogbuttons"> 511 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />512 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />513 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />451 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 452 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 453 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 514 454 </base:buttongroup> 515 455 -
trunk/www/biomaterials/lists/members/list_members.jsp
r6221 r6260 110 110 %> 111 111 <base:page title="<%=title%>" type="<%=mode.getPageType()%>"> 112 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">112 <base:head scripts="table.js,tabcontrol-2.js,~members.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 113 113 <ext:scripts context="<%=jspContext%>" /> 114 114 <ext:stylesheets context="<%=jspContext%>" /> 115 115 <script> 116 var submitPage = 'index.jsp'; 117 var formId = 'members'; 118 function editItem(itemId) 119 { 120 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true); 121 } 122 function viewItem(itemId) 123 { 124 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false); 125 } 126 function itemOnClick(evt, itemId) 127 { 128 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected); 129 } 130 function addItems() 131 { 132 Main.openPopup('add_members_frameset.jsp?ID=<%=ID%>&list_id=<%=bioMaterialListId%>', 'AddMembers', 1050, 700); 133 } 134 function removeItems() 135 { 136 var frm = document.forms[formId]; 137 var numChecked = Forms.numChecked(frm); 138 if (numChecked == 0) 139 { 140 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 141 return; 142 } 143 else 144 { 145 if (!confirm('You are about to remove '+numChecked+' item(s) from the list. Continue?')) 146 { 147 return; 148 } 149 } 150 frm.action = submitPage; 151 frm.cmd.value = 'RemoveMembers'; 152 frm.submit(); 153 } 154 function deleteItems() 155 { 156 var frm = document.forms[formId]; 157 if (Forms.numChecked(frm) == 0) 158 { 159 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 160 return; 161 } 162 frm.action = submitPage; 163 frm.cmd.value = 'DeleteItems'; 164 frm.submit(); 165 } 166 function restoreItems() 167 { 168 var frm = document.forms[formId]; 169 if (Forms.numChecked(frm) == 0) 170 { 171 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 172 return; 173 } 174 frm.action = submitPage; 175 frm.cmd.value = 'RestoreItems'; 176 frm.submit(); 177 } 178 function configureColumns() 179 { 180 Table.configureColumns(formId); 181 } 182 function setOwner() 183 { 184 Table.setOwnerOfItems(formId); 185 } 186 function shareItems() 187 { 188 Table.shareItems(formId); 189 } 190 function runPlugin(cmd) 191 { 192 Table.submitToPopup(formId, cmd, 750, 500); 193 } 194 function returnSelected() 195 { 196 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>); 197 window.close(); 198 } 199 function switchTab(tabControlId, tabId) 200 { 201 if (tabId == 'properties' || tabId == 'overview') 202 { 203 location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=bioMaterialListId%>&tab='+tabId; 204 } 205 else 206 { 207 TabControl.setActiveTab(tabControlId, tabId); 208 } 209 } 116 210 117 function placeOnPlate() 211 118 { … … 220 127 /><p:pathelement title="<%=HTML.encodeTags(list.getName())%>" 221 128 /></p:path> 222 129 <div id="page-data" class="datacontainer" 130 data-item-type="<%=itemType.name()%>" 131 ></div> 223 132 <t:tabcontrol 224 133 id="main" 225 134 subclass="content mastertabcontrol" 226 active="members" switch="switchTab">135 active="members"> 227 136 <t:tab id="properties" title="Properties" /> 228 137 … … 355 264 > 356 265 <tbl:button 266 id="btnAddMembers" 357 267 disabled="<%=addPermission ? false : true%>" 358 268 image="add.png" 359 onclick="addItems()"360 269 title="Add…" 361 270 tooltip="<%=addPermission ? "Add more biomaterials to this list" : "You do not have permission to add biomaterial" %>" 362 271 /> 363 272 <tbl:button 273 id="btnRemoveMembers" 364 274 disabled="<%=removePermission ? false : true%>" 365 275 image="remove.png" 366 onclick="removeItems()"367 276 title="Remove…" 368 277 tooltip="<%=removePermission ? "Remove the selected items from this list" : "You do not have permission to remove items" %>" 369 278 /> 370 279 <tbl:button 280 id="btnDeleteItems" 371 281 image="delete.png" 372 onclick="deleteItems()"373 282 title="Delete" 374 283 tooltip="Delete the selected items" 375 284 /> 376 285 <tbl:button 286 id="btnRestoreItems" 377 287 image="restore.png" 378 onclick="restoreItems()"379 288 title="Restore" 380 289 tooltip="Restore the selected (deleted) items" 381 290 /> 382 291 <tbl:button 292 id="btnShareItems" 383 293 image="share.png" 384 onclick="shareItems()"385 294 title="Share…" 386 295 tooltip="Share the selected items" 387 296 /> 388 297 <tbl:button 298 id="btnSetOwner" 389 299 image="take_ownership.png" 390 onclick="setOwner()"391 300 title="Set owner…" 392 301 tooltip="Change owner of the selected items" 393 302 /> 394 303 <tbl:button 304 id="btnColumns" 395 305 image="columns.png" 396 onclick="configureColumns()"397 306 title="Columns…" 398 307 tooltip="Show, hide and re-order columns" 399 308 /> 400 309 <tbl:button 310 id="btnPlaceOnPlate" 401 311 image="place_on_plate.png" 402 onclick="placeOnPlate()"403 312 title="Place on plate…" 404 313 tooltip="Place the selected/matching biomaterial on a bioplate" … … 406 315 /> 407 316 <tbl:button 317 id="btnImport" 318 data-plugin-type="IMPORT" 408 319 image="import.png" 409 onclick="runPlugin('ImportItems')"410 320 title="Import…" 411 321 tooltip="Import data" … … 413 323 /> 414 324 <tbl:button 325 id="btnExport" 326 data-plugin-type="EXPORT" 415 327 image="export.png" 416 onclick="runPlugin('ExportItems')"417 328 title="Export…" 418 329 tooltip="Export data" … … 420 331 /> 421 332 <tbl:button 333 id="btnRunPlugin" 334 data-plugin-type="OTHER" 422 335 image="runplugin.png" 423 onclick="runPlugin('RunListPlugin')"424 336 title="Run plugin…" 425 337 tooltip="Run a plugin" … … 539 451 visible="<%=item.isShared()%>" 540 452 /> </tbl:header> 541 <tbl:cell column="name"><div class="link" 542 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 453 <tbl:cell column="name"><div 454 class="link table-item" 455 data-item-id="<%=itemId%>" 456 data-no-edit="<%=writePermission ? 0 : 1 %>" 457 tabindex="0" 543 458 title="<%=tooltip%>"><%=name%></div></tbl:cell> 544 459 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 621 536 622 537 <base:buttongroup subclass="dialogbuttons"> 623 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />624 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />625 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />538 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 539 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 540 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 626 541 </base:buttongroup> 627 542 -
trunk/www/biomaterials/samples/edit_sample.jsp
r6246 r6260 263 263 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 264 264 %> 265 <base:page type="popup" title="<%=title%>" >266 <base:head scripts="tabcontrol .js,linkitems.js,subtypes.js" styles="tabcontrol.css">265 <base:page type="popup" title="<%=title%>" id="edit-page"> 266 <base:head scripts="tabcontrol-2.js,linkitems.js,subtypes.js,~samples.js" styles="tabcontrol.css"> 267 267 <ext:scripts context="<%=jspContext%>" /> 268 268 <ext:stylesheets context="<%=jspContext%>" /> 269 269 <script> 270 // Validate the "Sample" tab 271 function validateSample() 272 { 273 var frm = document.forms['sample']; 274 if (Main.trimString(frm.name.value) == '') 275 { 276 Forms.showNotification(frm.name, 'You must enter a name'); 277 return false; 278 } 279 if (Main.trimString(frm.bioplate_id.value) != 0 && Main.trimString(frm.biowell_id.value) == 0) 280 { 281 Forms.showNotification('biowell_id.select', 'You must choose a biowell from the bioplate'); 282 return false; 283 } 284 return true; 285 } 286 287 // Submit the form 288 function saveSettings() 289 { 290 var frm = document.forms['sample']; 291 if (TabControl.validateActiveTab('settings')) 292 { 293 Annotations.saveModifiedAnnotationsToForm(frm); 294 Annotations.saveInheritedAnnotationsToForm(frm); 295 frm.modifiedSamples.value = Link.exportModified(frm, 'S', true).join(','); 296 frm.removedSamples.value = Link.getActionIds(-1, 'S').join(','); 297 frm.submit(); 298 } 299 } 300 301 function loadAnnotationsFrame() 302 { 303 Annotations.autoLoadEditFrame(getProtocolId(), ItemSubtype.getSubtypeId('sample')); 304 } 305 306 function loadInheritedAnnotationsFrame() 307 { 308 Annotations.autoLoadInheritFrame(getParents()); 309 } 310 311 function getProtocolId() 312 { 313 var frm = document.forms['sample']; 314 var protocolId = 0; 315 if (frm.protocol_id.length > 0 && !frm.protocol_id.disabled) 316 { 317 protocolId = Math.abs(parseInt(frm.protocol_id[frm.protocol_id.selectedIndex].value)); 318 } 319 return protocolId; 320 } 270 321 271 322 272 function getParents() … … 340 290 } 341 291 342 function subtypeOnChange() 343 { 344 var frm = document.forms['sample']; 345 var subtypeId = ItemSubtype.getSubtypeId('sample'); 346 var recentInfo = ItemSubtype.getRecentAndRelatedInfo(subtypeId, 'SAMPLE', ['PROTOCOL', 'BIOPLATE', 'BIOSOURCE', 'SAMPLE']); 347 ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']); 348 ItemSubtype.updateSelectionList(frm.bioplate_id, recentInfo.BIOPLATE['recent']); 349 } 350 351 function selectProtocolOnClick() 352 { 353 var frm = document.forms['sample']; 354 var url = '../../admin/protocols/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone'; 355 url += '&callback=setProtocolCallback&resetTemporary=1'; 356 url += ItemSubtype.createRelatedFilter('sample', 'PROTOCOL', <%=SystemItems.getId(Protocol.SAMPLING)%>); 357 if (frm.protocol_id.length > 1) 358 { 359 var id = Math.abs(parseInt(frm.protocol_id[1].value)); 360 url += '&item_id='+id; 361 } 362 Main.openPopup(url, 'SelectProtocol', 1050, 700); 363 } 364 function setProtocolCallback(id, name) 365 { 366 var frm = document.forms['sample']; 367 var list = frm.protocol_id; 368 if (list.length < 2 || list[1].value == '0') // > 369 { 370 Forms.addListOption(list, 1, new Option()); 371 } 372 list[1].value = id; 373 list[1].text = name; 374 list.selectedIndex = 1; 375 } 376 377 function selectBioPlateOnClick() 378 { 379 var frm = document.forms['sample']; 380 var url = '../bioplates/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setBioPlateCallback'; 381 if (frm.bioplate_id.length > 1) 382 { 383 var id = Math.abs(parseInt(frm.bioplate_id[1].value)); 384 url += '&item_id='+id; 385 } 386 url += '&resetTemporary=1&tmpfilter:INT:bioPlateType.lockMode=<><%=BioWell.LockMode.LOCKED_AFTER_CREATE.getValue()%>'; 387 // Restrict to plates that can holds samples 388 url += '&tmpfilter:INT:bioPlateType.bioMaterialType=|<%=itemType.getValue()%>'; 389 var subtypeId = ItemSubtype.getSubtypeId('sample'); 390 // Restrict to plates with the given subtype 391 url += '&tmpfilter:INT:bioPlateType.itemSubtype='+(subtypeId ? '|' + subtypeId : '='); 392 url += '&tmpfilter:BOOLEAN:destroyed=false'; 393 Main.openPopup(url, 'SelectBioplate', 1050, 700); 394 } 395 function setBioPlateCallback(id, name) 396 { 397 var frm = document.forms['sample']; 398 var list = frm.bioplate_id; 399 if (list.length < 2 || list[1].value == '0') // > 400 { 401 Forms.addListOption(list, 1, new Option()); 402 } 403 list[1].value = id; 404 list[1].text = name; 405 list.selectedIndex = 1; 406 frm.biowell_id.remove(1); 407 frm.biowell_id.disabled = false; 408 } 292 409 293 function bioPlateOnChange() 410 294 { … … 611 495 <input type="hidden" name="cmd" value="UpdateItem"> 612 496 497 <div id="page-data" class="datacontainer" 498 data-sampling-protocoltype-id="<%=SystemItems.getId(Protocol.SAMPLING)%>" 499 ></div> 500 613 501 <t:tabcontrol id="settings" 614 502 subclass="content dialogtabcontrol" 615 503 position="bottom" remember="<%=sample != null%>" 616 504 extensions="<%=invoker%>"> 617 <t:tab id="info" title="Sample" validate="validateSample()"helpid="sample.edit">505 <t:tab id="info" title="Sample" helpid="sample.edit"> 618 506 <table class="fullform input100"> 619 507 <tr> 620 508 <th>Name</th> 621 <td><input class="text required" type="text" name="name" 509 <td><input class="text required auto-init" data-auto-init="<%=sample == null ? "focus-select" : "focus" %>" 510 type="text" name="name" 622 511 value="<%=HTML.encodeTags(name)%>" 623 512 maxlength="<%=Sample.MAX_NAME_LENGTH%>"></td> … … 627 516 <th>Type</th> 628 517 <td> 629 <select name="subtype_id" 518 <select name="subtype_id" id="subtype_id" 630 519 <%=!readCurrentSubtype ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%> 631 onchange="subtypeOnChange()"632 520 > 633 521 <% … … 713 601 defaultitems="<%=defaultProtocols%>" 714 602 newitem="<%=sample == null%>" 715 onselect="selectProtocolOnClick()"716 603 disabled="<%=lockEventProperties %>" 717 604 /> … … 730 617 recent="<%=recentBioPlates%>" 731 618 newitem="<%=sample == null%>" 732 onselect="selectBioPlateOnClick()"733 619 onchange="bioPlateOnChange()" 734 620 disabled="<%=lockedWell%>" … … 853 739 </t:tab> 854 740 855 <t:tab id="annotations" title="Annotations & parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">741 <t:tab id="annotations" title="Annotations & parameters" helpid="annotations.edit"> 856 742 <jsp:include page="../../common/annotations/annotate_frameset.jsp"> 857 743 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 862 748 863 749 <t:tab id="inheritedAnnotations" title="Inherited annotations" 864 helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">750 helpid="annotations.edit.inherited"> 865 751 <jsp:include page="../../common/annotations/inherit_frameset.jsp"> 866 752 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 877 763 878 764 <base:buttongroup subclass="dialogbuttons"> 879 <base:button onclick="saveSettings()" title="Save" />880 <base:button onclick="window.close()" title="Cancel" />765 <base:button id="btnSave" title="Save" /> 766 <base:button id="close" title="Cancel" /> 881 767 </base:buttongroup> 882 768 -
trunk/www/biomaterials/samples/list_samples.jsp
r6221 r6260 157 157 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 158 158 %> 159 <base:page title="<%=title==null ? "Samples" : title%>" type="<%=mode.getPageType()%>" >160 <base:head scripts="table.js " styles="table.css,toolbar.css,toolbar.css">159 <base:page title="<%=title==null ? "Samples" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 160 <base:head scripts="table.js,~samples.js" styles="table.css,toolbar.css,toolbar.css"> 161 161 <ext:scripts context="<%=jspContext%>" /> 162 162 <ext:stylesheets context="<%=jspContext%>" /> 163 <script>164 var submitPage = 'index.jsp';165 var formId = 'samples';166 function newItem()167 {168 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);169 }170 function newPooledItem()171 {172 Table.poolItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'NewPooledItem');173 }174 function editItem(itemId)175 {176 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);177 }178 function viewItem(itemId)179 {180 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);181 }182 function itemOnClick(evt, itemId)183 {184 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);185 }186 function newSample(sampleId)187 {188 Main.viewOrEditItem('<%=ID%>', 'SAMPLE', 0, true, '&sample_id='+sampleId);189 }190 function newExtract(sampleId)191 {192 Main.viewOrEditItem('<%=ID%>', 'EXTRACT', 0, true, '&sample_id='+sampleId);193 }194 function deleteItems()195 {196 var frm = document.forms[formId];197 if (Forms.numChecked(frm) == 0)198 {199 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');200 return;201 }202 frm.action = submitPage;203 frm.cmd.value = 'DeleteItems';204 frm.submit();205 }206 function restoreItems()207 {208 var frm = document.forms[formId];209 if (Forms.numChecked(frm) == 0)210 {211 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');212 return;213 }214 frm.action = submitPage;215 frm.cmd.value = 'RestoreItems';216 frm.submit();217 }218 function setOwner()219 {220 Table.setOwnerOfItems(formId);221 }222 function shareItems()223 {224 Table.shareItems(formId);225 }226 function configureColumns()227 {228 Table.configureColumns(formId);229 }230 function runPlugin(cmd)231 {232 Table.submitToPopup(formId, cmd, 750, 500);233 }234 function returnSelected()235 {236 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);237 window.close();238 }239 function newBioMaterialList()240 {241 var controller = Main.getController('BIOMATERIALLIST');242 Table.submitToPopup(formId, 'CreateBioMaterialList', controller.width, controller.height);243 }244 function placeOnPlate()245 {246 Table.submitToPopup(formId, 'PlaceOnPlate', 900, 600);247 }248 </script>249 163 </base:head> 250 164 … … 524 438 > 525 439 <tbl:button 440 id="btnNewItem" 526 441 disabled="<%=!createPermission%>" 527 442 image="new.png" 528 onclick="newItem()"529 443 title="New…" 530 444 tooltip="<%=createPermission ? "Create new sample" : "You do not have permission to create samples"%>" 531 445 /> 532 446 <tbl:button 447 id="btnNewPooledItem" 533 448 disabled="<%=!createPermission%>" 534 449 image="new_pooled.png" 535 onclick="newPooledItem()"536 450 title="Pool…" 537 451 tooltip="<%=createPermission ? "Create new pooled sample" : "You do not have permission to create samples"%>" 538 452 /> 539 453 <tbl:button 454 id="btnDeleteItems" 540 455 image="delete.png" 541 onclick="deleteItems()"542 456 title="Delete" 543 457 tooltip="Delete the selected items" 544 458 /> 545 459 <tbl:button 460 id="btnRestoreItems" 546 461 image="restore.png" 547 onclick="restoreItems()"548 462 title="Restore" 549 463 tooltip="Restore the selected (deleted) items" 550 464 /> 551 465 <tbl:button 466 id="btnShareItems" 552 467 image="share.png" 553 onclick="shareItems()"554 468 title="Share…" 555 469 tooltip="Share the selected items" 556 470 /> 557 471 <tbl:button 472 id="btnSetOwner" 558 473 image="take_ownership.png" 559 onclick="setOwner()"560 474 title="Set owner…" 561 475 tooltip="Change owner of the selected items" 562 476 /> 563 477 <tbl:button 478 id="btnColumns" 564 479 image="columns.png" 565 onclick="configureColumns()"566 480 title="Columns…" 567 481 tooltip="Show, hide and re-order columns" 568 482 /> 569 483 <tbl:button 484 id="btnNewBioMaterialList" 570 485 image="add.png" 571 onclick="newBioMaterialList()"572 486 title="New biomaterial list…" 573 487 tooltip="Create a new biomaterial list from matching samples" … … 575 489 /> 576 490 <tbl:button 491 id="btnPlaceOnPlate" 577 492 image="place_on_plate.png" 578 onclick="placeOnPlate()"579 493 title="Place on plate…" 580 494 tooltip="Place the selected/matching samples on a bioplate" 581 495 /> 582 496 <tbl:button 497 id="btnImport" 498 data-plugin-type="IMPORT" 583 499 image="import.png" 584 onclick="runPlugin('ImportItems')"585 500 title="Import…" 586 501 tooltip="Import data" … … 588 503 /> 589 504 <tbl:button 505 id="btnExport" 506 data-plugin-type="EXPORT" 590 507 image="export.png" 591 onclick="runPlugin('ExportItems')"592 508 title="Export…" 593 509 tooltip="Export data" … … 595 511 /> 596 512 <tbl:button 513 id="btnRunPlugin" 514 data-plugin-type="OTHER" 597 515 image="runplugin.png" 598 onclick="runPlugin('RunListPlugin')"599 516 title="Run plugin…" 600 517 tooltip="Run a plugin" … … 717 634 visible="<%=item.isShared()%>" 718 635 /> </tbl:header> 719 <tbl:cell column="name"><div class="link" 720 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 636 <tbl:cell column="name"><div 637 class="link table-item" 638 data-item-id="<%=itemId%>" 639 data-no-edit="<%=writePermission ? 0 : 1 %>" 640 tabindex="0" 721 641 title="<%=tooltip%>"><%=name%></div></tbl:cell> 722 642 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 845 765 %> 846 766 <base:icon 767 id="<%="newsample."+itemId%>" 847 768 image="add.png" 848 onclick="<%="newSample("+itemId+")"%>" 769 subclass="auto-init" 770 data-auto-init="new-sample" 771 data-item-id="<%=itemId %>" 849 772 tooltip="Create new child sample" 850 773 visible="<%=mode.hasEditLink() && createPermission && usePermission %>" … … 879 802 %> 880 803 <base:icon 804 id="<%="newsample."+itemId%>" 881 805 image="add.png" 882 onclick="<%="newExtract("+itemId+")"%>" 806 subclass="auto-init" 807 data-auto-init="new-extract" 808 data-item-id="<%=itemId %>" 883 809 tooltip="Create new extract" 884 810 visible="<%=mode.hasEditLink() && createExtractPermission && usePermission %>" … … 959 885 960 886 <base:buttongroup subclass="dialogbuttons"> 961 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />962 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />963 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />887 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 888 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 889 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 964 890 </base:buttongroup> 965 891 </base:body> -
trunk/www/biomaterials/samples/view_sample.jsp
r6255 r6260 90 90 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); 91 91 final int itemId = cc.getId(); 92 final String tab = Values.getString (request.getParameter("tab"), "properties");92 final String tab = Values.getStringOrNull(request.getParameter("tab")); 93 93 final float scale = Base.getScale(sc); 94 94 final DbControl dc = sc.newDbControl(); … … 117 117 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 118 118 %> 119 <base:page title="<%=title%>"> 120 <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 119 <base:page title="<%=title%>" id="view-page"> 120 <base:head scripts="table.js,tabcontrol-2.js,~samples.js" 121 styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 121 122 <ext:scripts context="<%=jspContext%>" /> 122 123 <ext:stylesheets context="<%=jspContext%>" /> 123 <script>124 function editItem()125 {126 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);127 }128 function shareItem()129 {130 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareSample', 600, 400);131 }132 function newExtract()133 {134 Main.viewOrEditItem('<%=ID%>', 'EXTRACT', 0, true, '&sample_id=<%=itemId%>');135 }136 function newSample()137 {138 Main.viewOrEditItem('<%=ID%>', 'SAMPLE', 0, true, '&sample_id=<%=itemId%>');139 }140 function deleteItem()141 {142 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>');143 }144 function restoreItem()145 {146 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');147 }148 function deleteItemPermanently()149 {150 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');151 }152 function itemDeleted()153 {154 Main.listItems('<%=ID%>', '<%=itemType.name()%>');155 }156 function showUsingItems()157 {158 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);159 }160 function setOwner()161 {162 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 300);163 }164 function runPlugin(cmd)165 {166 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);167 }168 function viewEvents()169 {170 location.href = '../events/index.jsp?ID=<%=ID%>&cmd=List&biomaterial_id=<%=itemId%>&biomaterial_type=<%=itemType.name()%>';171 }172 function switchTab(tabControlId, tabId)173 {174 if (TabControl.isActive(tabControlId, tabId)) return;175 if (tabId == 'events')176 {177 viewEvents();178 }179 else180 {181 TabControl.setActiveTab(tabControlId, tabId);182 }183 }184 </script>185 124 </base:head> 186 125 <base:body> 187 <p:path><p:pathelement 188 title="Samples" href="<%="index.jsp?ID="+ID%>" /><p:pathelement 189 title="<%=HTML.encodeTags(sample.getName())%>" /></p:path> 190 191 <t:tabcontrol id="main" 192 subclass="content mastertabcontrol" 193 active="<%=tab%>" switch="switchTab" remember="false"> 126 <p:path><p:pathelement title="Samples" href="<%="index.jsp?ID="+ID%>" 127 /><p:pathelement title="<%=HTML.encodeTags(sample.getName())%>" /></p:path> 128 129 <div id="page-data" data-item-id="<%=itemId%>"></div> 130 131 <t:tabcontrol id="main" subclass="content mastertabcontrol" active="<%=tab%>"> 194 132 <t:tab id="properties" title="Properties"> 195 196 133 <div> 197 134 <table class="fullform bottomborder"> 198 135 <tr> 199 136 <th class="itemstatus"> 200 <base:icon 201 image="shared.png" 137 <base:icon image="shared.png" 202 138 visible="<%=sample.isShared()%>" 203 tooltip="This item is shared to other users, groups and/or projects" 139 tooltip="This item is shared to other users, groups and/or projects" 204 140 /> 205 141 <base:icon 206 i mage="deleted.png"207 onclick="deleteItemPermanently()"142 id="btnDeletePermanently" 143 image="deleted.png" 208 144 tooltip="This item has been flagged for deletion. Click to delete it now." 209 145 enabled="<%=deletePermanentlyPermission %>" 210 146 visible="<%=isRemoved%>" 211 147 /> 212 <base:icon image="used.png" 213 onclick="showUsingItems()" 148 <base:icon 149 id="btnUsingItems" 150 image="used.png" 214 151 tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" 215 visible="<%=isRemoved && isUsed%>" /> 152 visible="<%=isRemoved && isUsed%>" 153 /> 216 154 </th> 217 155 <td style="padding: 0px;"> 218 219 <tbl:toolbar subclass="bottomborder"> 220 <tbl:button 221 disabled="<%=!writePermission%>" 222 image="edit.png" 223 onclick="editItem()" 224 title="Edit…" 225 tooltip="<%=writePermission ? "Edit this sample" : "You do not have permission to edit this sample"%>" 226 /> 227 <tbl:button 228 disabled="<%=!deletePermission%>" 229 image="delete.png" 230 onclick="deleteItem()" 231 title="Delete" 232 visible="<%=!sample.isRemoved()%>" 233 tooltip="<%=deletePermission ? "Delete this sample" : "You do not have permission to delete this sample"%>" 234 /> 235 <tbl:button 236 disabled="<%=!writePermission%>" 237 image="restore.png" 238 onclick="restoreItem()" 239 title="Restore" 240 visible="<%=sample.isRemoved()%>" 241 tooltip="<%=writePermission ? "Restore this sample" : "You do not have permission to restore this sample"%>" 242 /> 243 <tbl:button 244 disabled="<%=!sharePermission%>" 245 image="share.png" 246 onclick="shareItem()" 247 title="Share…" 248 tooltip="<%=sharePermission ? "Share this sample to other user, groups and projects" : "You do not have permission to share this sample"%>" 249 /> 250 <tbl:button 251 disabled="<%=!setOwnerPermission%>" 252 image="take_ownership.png" 253 onclick="setOwner()" 254 title="Set owner…" 255 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 256 /> 257 <tbl:button 258 image="add.png" 259 onclick="newSample()" 260 title="New child sample…" 261 tooltip="Create a new child sample from this sample" 262 visible="<%=sc.hasPermission(Permission.CREATE, Item.SAMPLE) && usePermission%>" 263 /> 264 <tbl:button 265 image="add.png" 266 onclick="newExtract()" 267 title="New child extract…" 268 tooltip="Create a new extract from this sample" 269 visible="<%=sc.hasPermission(Permission.CREATE, Item.EXTRACT) && usePermission%>" 270 /> 271 <tbl:button 272 image="import.png" 273 onclick="runPlugin('ImportItem')" 274 title="Import…" 275 tooltip="Import data" 276 visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" 277 /> 278 <tbl:button 279 image="export.png" 280 onclick="runPlugin('ExportItem')" 281 title="Export…" 282 tooltip="Export data" 283 visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" 284 /> 285 <tbl:button 286 image="runplugin.png" 287 onclick="runPlugin('RunPlugin')" 288 title="Run plugin…" 289 tooltip="Run a plugin" 290 visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" 291 /> 292 <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 293 wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> 294 <tbl:button 295 image="help.png" 296 onclick="<%="Main.openHelp('" + ID +"', 'sample.view.properties')"%>" 297 title="Help…" 298 tooltip="Get help about this page" 299 /> 156 <tbl:toolbar subclass="bottomborder"> 157 <tbl:button 158 id="btnEdit" 159 disabled="<%=!writePermission%>" 160 image="edit.png" 161 title="Edit…" 162 tooltip="<%=writePermission ? "Edit this sample" : "You do not have permission to edit this sample"%>" 163 /> 164 <tbl:button 165 id="btnDelete" 166 disabled="<%=!deletePermission%>" 167 image="delete.png" 168 title="Delete" 169 visible="<%=!sample.isRemoved()%>" 170 tooltip="<%=deletePermission ? "Delete this sample" : "You do not have permission to delete this sample"%>" 171 /> 172 <tbl:button 173 id="btnRestore" 174 disabled="<%=!writePermission%>" 175 image="restore.png" 176 title="Restore" 177 visible="<%=sample.isRemoved()%>" 178 tooltip="<%=writePermission ? "Restore this sample" : "You do not have permission to restore this sample"%>" 179 /> 180 <tbl:button 181 id="btnShare" 182 disabled="<%=!sharePermission%>" 183 image="share.png" 184 title="Share…" 185 tooltip="<%=sharePermission ? "Share this sample to other user, groups and projects" : "You do not have permission to share this sample"%>" 186 /> 187 <tbl:button 188 id="btnSetOwner" 189 disabled="<%=!setOwnerPermission%>" 190 image="take_ownership.png" 191 title="Set owner…" 192 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 193 /> 194 <tbl:button 195 id="btnNewSample" 196 image="add.png" 197 title="New child sample…" 198 tooltip="Create a new child sample from this sample" 199 visible="<%=sc.hasPermission(Permission.CREATE, Item.SAMPLE) && usePermission%>" 200 /> 201 <tbl:button 202 id="btnNewExtract" 203 image="add.png" 204 title="New child extract…" 205 tooltip="Create a new extract from this sample" 206 visible="<%=sc.hasPermission(Permission.CREATE, Item.EXTRACT) && usePermission%>" 207 /> 208 <tbl:button 209 id="btnImport" 210 image="import.png" 211 data-plugin-type="IMPORT" 212 title="Import…" 213 tooltip="Import data" 214 visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" 215 /> 216 <tbl:button 217 id="btnExport" 218 image="export.png" 219 data-plugin-type="EXPORT" 220 title="Export…" 221 tooltip="Export data" 222 visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" 223 /> 224 <tbl:button 225 id="btnRunPlugin" 226 image="runplugin.png" 227 data-plugin-type="OTHER" 228 title="Run plugin…" 229 tooltip="Run a plugin" 230 visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" 231 /> 232 <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 233 wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>" /> 234 <tbl:button 235 image="help.png" 236 subclass="auto-init" 237 data-auto-init="help" 238 data-help-id="sample.view.properties" 239 title="Help…" 240 tooltip="Get help about this page" 241 /> 300 242 </tbl:toolbar> 301 243 </td> … … 307 249 <tr> 308 250 <th>Type</th> 309 <td><base:propertyvalue item="<%=sample%>" property="itemSubtype" /></td> 251 <td><base:propertyvalue item="<%=sample%>" 252 property="itemSubtype" /></td> 310 253 </tr> 311 254 <tr> … … 323 266 <tr> 324 267 <th>Protocol</th> 325 <td><base:propertyvalue item="<%=creationEvent%>" property="protocol" /></td> 268 <td><base:propertyvalue item="<%=creationEvent%>" 269 property="protocol" /></td> 326 270 </tr> 327 271 <tr> … … 335 279 <tr> 336 280 <th>Bioplate</th> 337 <td> 338 <base:propertyvalue item="<%=sample%>" property="bioWell.bioPlate" /> 339 <% 281 <td><base:propertyvalue item="<%=sample%>" 282 property="bioWell.bioPlate" /> <% 340 283 try 341 284 { … … 343 286 if (well != null) 344 287 { 345 %> 346 [<%=rowFormatter.format(well.getRow())%><%=columnFormatter.format(well.getColumn())%>] 347 <base:icon image="locked.png" visible="<%=sample.isLockedInWell()%>"/> 348 <% 288 %> [<%=rowFormatter.format(well.getRow())%><%=columnFormatter.format(well.getColumn())%>] 289 <base:icon image="locked.png" 290 visible="<%=sample.isLockedInWell()%>" /> <% 349 291 } 350 292 } … … 366 308 <td><%=HTML.niceFormat(sample.getDescription())%></td> 367 309 </tr> 368 </table> 369 </div> 370 371 <% 372 SpecialQuery<BioMaterialEventSource> sourceQuery = creationEvent.getEventSources(); 373 sourceQuery.order(Orders.asc(Hql.property("bioMaterial.name"))); 374 ResultList<BioMaterialEventSource> sources = sourceQuery.list(dc); 375 %> 376 <base:section 377 id="parentsSection" 378 title="<%="Parent items (" + sources.size() + ")"%>" 379 context="<%=cc%>" 380 > 381 <% 310 </table> 311 </div> 312 313 <% 314 SpecialQuery<BioMaterialEventSource> sourceQuery = creationEvent.getEventSources(); 315 sourceQuery.order(Orders.asc(Hql.property("bioMaterial.name"))); 316 ResultList<BioMaterialEventSource> sources = sourceQuery.list(dc); 317 %> 318 <base:section id="parentsSection" 319 title="<%="Parent items (" + sources.size() + ")"%>" 320 context="<%=cc%>"> 321 <% 382 322 if (sources.size() == 0) 383 323 { 384 324 %> 385 <div class="messagecontainer note"> 386 This sample doesn't have any parent items 387 (or, you don't have permission to view them). 388 </div> 325 <div class="messagecontainer note">This sample doesn't have 326 any parent items (or, you don't have permission to view them).</div> 389 327 <% 390 328 } … … 392 330 { 393 331 %> 394 <tbl:table 395 id="parents" 396 columns="all" 397 > 398 <tbl:columndef 399 id="name" 400 title="Name" 401 /> 402 <tbl:columndef 403 id="type" 404 title="Type" 405 /> 406 <tbl:columndef 407 id="quantity" 408 title="Used quantity (µg)" 409 /> 410 <tbl:columndef 411 id="description" 412 title="Description" 413 /> 414 <tbl:data> 415 <tbl:headers> 416 <tbl:headerrow> 417 <tbl:columnheaders /> 418 </tbl:headerrow> 419 </tbl:headers> 420 <tbl:rows> 421 <% 332 <tbl:table id="parents" columns="all"> 333 <tbl:columndef id="name" title="Name" /> 334 <tbl:columndef id="type" title="Type" /> 335 <tbl:columndef id="quantity" title="Used quantity (µg)" /> 336 <tbl:columndef id="description" title="Description" /> 337 <tbl:data> 338 <tbl:headers> 339 <tbl:headerrow> 340 <tbl:columnheaders /> 341 </tbl:headerrow> 342 </tbl:headers> 343 <tbl:rows> 344 <% 422 345 for (BioMaterialEventSource item : sources) 423 346 { … … 432 355 {} 433 356 %> 434 <tbl:row> 435 <tbl:cell column="name"><base:icon 436 image="deleted.png" 437 tooltip="This item has been scheduled for deletion" 438 visible="<%=bm != null && bm.isRemoved()%>" 439 /><%=Base.getLinkedName(ID, bm, bm == null, true)%></tbl:cell> 440 <tbl:cell column="type"> 441 <% 357 <tbl:row> 358 <tbl:cell column="name"> 359 <base:icon image="deleted.png" 360 tooltip="This item has been scheduled for deletion" 361 visible="<%=bm != null && bm.isRemoved()%>" /><%=Base.getLinkedName(ID, bm, bm == null, true)%></tbl:cell> 362 <tbl:cell column="type"> 363 <% 442 364 if (subtype != null) 443 365 { 444 366 %> 445 <%=Base.getLinkedName(ID, subtype, false, true)%> <span class="itemsubtype">(<%=bm.getType() %>)</span> 367 <%=Base.getLinkedName(ID, subtype, false, true)%> 368 <span class="itemsubtype">(<%=bm.getType() %>) 369 </span> 446 370 <% 447 371 } … … 453 377 } 454 378 %> 455 </tbl:cell>456 <tbl:cell column="quantity"><%=Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>457 <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell>458 </tbl:row>459 <%379 </tbl:cell> 380 <tbl:cell column="quantity"><%=Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell> 381 <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell> 382 </tbl:row> 383 <% 460 384 } 461 385 %> 462 </tbl:rows>463 </tbl:data>386 </tbl:rows> 387 </tbl:data> 464 388 </tbl:table> 465 389 <% 466 390 } 467 391 %> 468 </base:section>469 <%392 </base:section> 393 <% 470 394 SpecialQuery<BioMaterialEventSource> childQuery = sample.getChildCreationEvents(); 471 395 childQuery.join(Hql.innerJoin("es", "event", "evt", true)); … … 474 398 ResultList<BioMaterialEventSource> children = childQuery.list(dc); 475 399 %> 476 <base:section 477 id="childSection" 478 title="<%="Child items (" + children.size() + ")"%>" 479 context="<%=cc%>" 480 > 481 <% 400 <base:section id="childSection" 401 title="<%="Child items (" + children.size() + ")"%>" 402 context="<%=cc%>"> 403 <% 482 404 if (children.size() == 0) 483 405 { 484 406 %> 485 <div class="messagecontainer help"> 486 No child items have been created from this sample 487 (or, you don't have permission to view them). 488 </div> 407 <div class="messagecontainer help">No child items have been 408 created from this sample (or, you don't have permission to view 409 them).</div> 489 410 <% 490 411 } … … 492 413 { 493 414 %> 494 <tbl:table 495 id="children" 496 497 columns="all" 498 > 499 <tbl:columndef 500 id="name" 501 title="Name" 502 /> 503 <tbl:columndef 504 id="type" 505 title="Type" 506 /> 507 <tbl:columndef 508 id="quantity" 509 title="Used quantity (µg)" 510 /> 511 <tbl:columndef 512 id="description" 513 title="Description" 514 /> 415 <tbl:table id="children" columns="all"> 416 <tbl:columndef id="name" title="Name" /> 417 <tbl:columndef id="type" title="Type" /> 418 <tbl:columndef id="quantity" title="Used quantity (µg)" /> 419 <tbl:columndef id="description" title="Description" /> 515 420 <tbl:data> 516 421 <tbl:headers> … … 520 425 </tbl:headers> 521 426 <tbl:rows> 522 <%427 <% 523 428 for (BioMaterialEventSource item : children) 524 429 { … … 534 439 %> 535 440 <tbl:row> 536 <tbl:cell column="name"><base:icon 537 image="deleted.png" 538 tooltip="This item has been scheduled for deletion" 539 visible="<%=bm != null && bm.isRemoved()%>" 540 /><%=Base.getLinkedName(ID, bm, bm == null, true)%></tbl:cell> 441 <tbl:cell column="name"> 442 <base:icon image="deleted.png" 443 tooltip="This item has been scheduled for deletion" 444 visible="<%=bm != null && bm.isRemoved()%>" /><%=Base.getLinkedName(ID, bm, bm == null, true)%></tbl:cell> 541 445 <tbl:cell column="type"> 542 446 <% … … 544 448 { 545 449 %> 546 <%=Base.getLinkedName(ID, subtype, false, true)%> <span class="itemsubtype">(<%=bm.getType() %>)</span> 547 <% 450 <%=Base.getLinkedName(ID, subtype, false, true)%> 451 <span class="itemsubtype">(<%=bm.getType() %>) 452 </span> 453 <% 548 454 } 549 455 else 550 456 { 551 457 %> 552 553 458 <%=bm != null ? bm.getType() : "" %> 459 <% 554 460 } 555 461 %> … … 560 466 <% 561 467 } 562 %> 468 %> 563 469 </tbl:rows> 564 470 </tbl:data> … … 567 473 } 568 474 %> 569 </base:section>570 571 <jsp:include page="../../common/anytoany/list_anytoany.jsp">572 <jsp:param name="ID" value="<%=ID%>" />573 <jsp:param name="item_type" value="<%=itemType.name()%>" />574 <jsp:param name="item_id" value="<%=itemId%>" />575 <jsp:param name="title" value="Other items related to this sample" />576 </jsp:include>577 578 <jsp:include page="../../common/share/list_share.jsp">579 <jsp:param name="ID" value="<%=ID%>" />580 <jsp:param name="item_type" value="<%=itemType.name()%>" />581 <jsp:param name="item_id" value="<%=itemId%>" />582 <jsp:param name="title" value="Shared to" />583 </jsp:include>475 </base:section> 476 477 <jsp:include page="../../common/anytoany/list_anytoany.jsp"> 478 <jsp:param name="ID" value="<%=ID%>" /> 479 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 480 <jsp:param name="item_id" value="<%=itemId%>" /> 481 <jsp:param name="title" value="Other items related to this sample" /> 482 </jsp:include> 483 484 <jsp:include page="../../common/share/list_share.jsp"> 485 <jsp:param name="ID" value="<%=ID%>" /> 486 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 487 <jsp:param name="item_id" value="<%=itemId%>" /> 488 <jsp:param name="title" value="Shared to" /> 489 </jsp:include> 584 490 </t:tab> 585 586 <t:tab id="annotations" title="Annotations & parameters" 587 tooltip="View annotation values and protocol parameters" clazz="white" 588 activate="AnnotationsList.loadOnce()"> 491 492 <t:tab id="annotations" title="Annotations & parameters" 493 tooltip="View annotation values and protocol parameters" clazz="white"> 589 494 <jsp:include page="../../common/annotations/list_frameset.jsp"> 590 495 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 594 499 </t:tab> 595 500 <t:tab id="events" title="Events" /> 596 <t:tab id="overview" title="Overview" 597 tooltip="Display a tree overview of related items" 598 activate="Overview.loadOnce()"> 501 <t:tab id="overview" title="Overview" 502 tooltip="Display a tree overview of related items"> 599 503 <jsp:include page="../../common/overview/overview.jsp"> 600 504 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 602 506 <jsp:param name="ID" value="<%=ID%>" /> 603 507 </jsp:include> 604 </t:tab> 605 <t:tab id="history" title="Change history" 508 </t:tab> 509 <t:tab id="history" title="Change history" 606 510 tooltip="Displays a log of all modifications made to this item" 607 visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>" 608 activate="History.loadOnce()"> 511 visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>"> 609 512 <jsp:include page="../../common/history/frameset.jsp"> 610 513 <jsp:param name="item_type" value="<%=itemType.name()%>" /> … … 612 515 <jsp:param name="ID" value="<%=ID%>" /> 613 516 </jsp:include> 614 </t:tab> 615 517 </t:tab> 518 </t:tabcontrol> 616 519 617 520 </base:body> 618 619 521 </base:page> 522 <% 620 523 } 621 524 finally -
trunk/www/biomaterials/tags/list_tags.jsp
r6221 r6260 101 101 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 102 102 %> 103 <base:page title="<%=title==null ? "Tags" : title%>" type="<%=mode.getPageType()%>" >104 <base:head scripts="table.js " styles="table.css,toolbar.css">103 <base:page title="<%=title==null ? "Tags" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 104 <base:head scripts="table.js,~tags.js" styles="table.css,toolbar.css"> 105 105 <ext:scripts context="<%=jspContext%>" /> 106 106 <ext:stylesheets context="<%=jspContext%>" /> 107 <script>108 var submitPage = 'index.jsp';109 var formId = 'taglist';110 function newItem()111 {112 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);113 }114 function editItem(itemId)115 {116 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);117 }118 function viewItem(itemId)119 {120 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);121 }122 function itemOnClick(evt, itemId)123 {124 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);125 }126 function deleteItems()127 {128 var frm = document.forms[formId];129 if (Forms.numChecked(frm) == 0)130 {131 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');132 return;133 }134 frm.action = submitPage;135 frm.cmd.value = 'DeleteItems';136 frm.submit();137 }138 function restoreItems()139 {140 var frm = document.forms[formId];141 if (Forms.numChecked(frm) == 0)142 {143 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');144 return;145 }146 frm.action = submitPage;147 frm.cmd.value = 'RestoreItems';148 frm.submit();149 }150 function setOwner()151 {152 Table.setOwnerOfItems(formId);153 }154 function shareItems()155 {156 Table.shareItems(formId);157 }158 function configureColumns()159 {160 Table.configureColumns(formId);161 }162 function runPlugin(cmd)163 {164 Table.submitToPopup(formId, cmd, 750, 500);165 }166 function returnSelected()167 {168 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);169 window.close();170 }171 function newLabeledExtract(tagId)172 {173 Main.viewOrEditItem('<%=ID%>', 'LABELEDEXTRACT', 0, true, '&label_id='+tagId);174 }175 </script>176 107 </base:head> 177 108 … … 287 218 > 288 219 <tbl:button 220 id="btnNewItem" 289 221 disabled="<%=!createPermission%>" 290 222 image="new.png" 291 onclick="newItem()"292 223 title="New…" 293 224 tooltip="<%=createPermission ? "Create new tag" : "You do not have permission to create tags"%>" 294 225 /> 295 226 <tbl:button 227 id="btnDeleteItems" 296 228 image="delete.png" 297 onclick="deleteItems()"298 229 title="Delete" 299 230 tooltip="Delete the selected items" 300 231 /> 301 232 <tbl:button 233 id="btnRestoreItems" 302 234 image="restore.png" 303 onclick="restoreItems()"304 235 title="Restore" 305 236 tooltip="Restore the selected (deleted) items" 306 237 /> 307 238 <tbl:button 239 id="btnShareItems" 308 240 image="share.png" 309 onclick="shareItems()"310 241 title="Share…" 311 242 tooltip="Share the selected items" 312 243 /> 313 244 <tbl:button 245 id="btnSetOwner" 314 246 image="take_ownership.png" 315 onclick="setOwner()"316 247 title="Set owner…" 317 248 tooltip="Change owner of the selected items" 318 249 /> 319 250 <tbl:button 251 id="btnColumns" 320 252 image="columns.png" 321 onclick="configureColumns()"322 253 title="Columns…" 323 254 tooltip="Show, hide and re-order columns" 324 255 /> 325 256 <tbl:button 257 id="btnImport" 258 data-plugin-type="IMPORT" 326 259 image="import.png" 327 onclick="runPlugin('ImportItems')"328 260 title="Import…" 329 261 tooltip="Import data" … … 331 263 /> 332 264 <tbl:button 265 id="btnExport" 266 data-plugin-type="EXPORT" 333 267 image="export.png" 334 onclick="runPlugin('ExportItems')"335 268 title="Export…" 336 269 tooltip="Export data" … … 338 271 /> 339 272 <tbl:button 273 id="btnRunPlugin" 274 data-plugin-type="OTHER" 340 275 image="runplugin.png" 341 onclick="runPlugin('RunListPlugin')"342 276 title="Run plugin…" 343 277 tooltip="Run a plugin" … … 458 392 visible="<%=item.isShared()%>" 459 393 /> </tbl:header> 460 <tbl:cell column="name"><div class="link" 461 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 394 <tbl:cell column="name"><div 395 class="link table-item" 396 data-item-id="<%=itemId%>" 397 data-no-edit="<%=writePermission ? 0 : 1 %>" 398 tabindex="0" 462 399 title="<%=tooltip%>"><%=name%></div></tbl:cell> 463 400 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 520 457 </div> 521 458 <base:buttongroup subclass="dialogbuttons"> 522 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />523 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />524 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />459 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 460 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 461 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 525 462 </base:buttongroup> 526 463 </base:body> -
trunk/www/include/scripts/main-2.js
r6256 r6260 702 702 var itemType = Data.get(target, 'item-type'); 703 703 var itemId = Data.get(target, 'item-id'); 704 Main.viewOrEditItem(App.getSessionId(), itemType, itemId, true); 704 var extraUrl = Data.get(target, 'extra-url'); 705 Main.viewOrEditItem(App.getSessionId(), itemType, itemId, true, extraUrl); 705 706 } 706 707 … … 714 715 var target = event.currentTarget; 715 716 var itemType = Data.get(target, 'item-type'); 716 Main.viewOrEditItem(App.getSessionId(), itemType, 0, true); 717 var extraUrl = Data.get(target, 'extra-url'); 718 Main.viewOrEditItem(App.getSessionId(), itemType, 0, true, extraUrl); 717 719 } 718 720 … … 1381 1383 var itemId = Data.int(element, 'item-id'); 1382 1384 var noEdit = Data.int(element, 'no-edit', 0); 1385 var extraUrl = Data.get(element, 'extra-url'); 1383 1386 var specialKey = event.altKey || event.ctrlKey || event.shiftKey; 1384 1387 if (noEdit || !specialKey) 1385 1388 { 1386 Main.viewOrEditItem(App.getSessionId(), itemType, itemId, false );1389 Main.viewOrEditItem(App.getSessionId(), itemType, itemId, false, extraUrl); 1387 1390 } 1388 1391 else 1389 1392 { 1390 Main.viewOrEditItem(App.getSessionId(), itemType, itemId, true );1393 Main.viewOrEditItem(App.getSessionId(), itemType, itemId, true, extraUrl); 1391 1394 } 1392 1395 } -
trunk/www/include/scripts/main.js
r6256 r6260 497 497 this.controllers['BIOPLATETYPE'] = { url:'biomaterials/bioplatetypes/index.jsp', width:600, height:400 }; 498 498 this.controllers['BIOSOURCE'] = { url:'biomaterials/biosources/index.jsp', width:750, height:500 }; 499 this.controllers['BIOWELL'] = { url:'biomaterials/bioplates/wells/index.jsp', width:450, height:300 };499 this.controllers['BIOWELL'] = { url:'biomaterials/bioplates/wells/index.jsp', width:450, height:300, edit: true }; 500 500 this.controllers['CLIENT'] = { url:'admin/clients/index.jsp', width:450, height:300 }; 501 501 this.controllers['CHANGEHISTORY'] = { url:'common/history/index.jsp', width:600, height:400, edit:false, popup:true }; -
trunk/www/include/scripts/tabcontrol-2.js
r6161 r6260 219 219 { 220 220 if (autoInit != 'tabcontrol') return; 221 var initialTab = tabControl.id + '.' +Data.get(tabControl, 'initial-tab');221 var initialTab = Data.get(tabControl, 'initial-tab'); 222 222 var checkRemembered = Data.int(tabControl, 'remember-last'); 223 if (checkRemembered) 223 if (initialTab) 224 { 225 // Prepend the tabcontrol id 226 initialTab = tabControl.id + '.' + initialTab; 227 } 228 else if (checkRemembered) 224 229 { 225 230 var remembered = Data.getPageValue('last-tab.'+tabControl.id); 226 231 if (remembered) initialTab = remembered; 232 } 233 if (!initialTab) 234 { 235 // Locate the ID of the first defined tab and make that the initial tab 236 var tabs = tabControl.getElementsByClassName('tab'); 237 if (tabs.length > 0) initialTab = tabs[0].id; 227 238 } 228 239 Doc.addFinalizer(function() -
trunk/www/include/scripts/tabcontrol.js
r6172 r6260 37 37 this.setInitialTab = function(tabControlId, tabId, checkRemembered, switchFunction) 38 38 { 39 var tabControl = document.getElementById(tabControlId); 39 40 if (checkRemembered) 40 41 { 41 var tabControl = document.getElementById(tabControlId);42 42 if (!tabControl.activeTab) 43 43 { … … 46 46 if (rememberedTabId) tabId = rememberedTabId 47 47 } 48 } 49 if (!tabId) 50 { 51 var tabs = tabControl.getElementsByClassName('tab'); 52 if (tabs.length > 0) tabId = tabs[0].id.substring(tabControlId.length+1); 48 53 } 49 54 if (switchFunction) -
trunk/www/include/scripts/table.js
r6222 r6260 504 504 @param regexp A regular expression to use for matching checkboxes in the table, 505 505 if not specified all checkboxes with a numeric name are used 506 @param confirm If set, ask for confirmation before deleting the items 507 */ 508 table.deleteItems = function(tableDiv, regexp, confirm) 509 { 510 tableDiv = Doc.element(tableDiv); 511 var frm = document.forms[tableDiv.id]; 512 var numSelected = Forms.numChecked(frm, regexp); 513 if (numSelected == 0) 514 { 515 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 516 return; 517 } 518 if (confirm) 506 @param confirmFirst If set, ask for confirmation before deleting the items 507 */ 508 table.deleteItems = function(tableDiv, regexp, confirmFirst) 509 { 510 tableDiv = Doc.element(tableDiv); 511 var frm = document.forms[tableDiv.id]; 512 var numSelected = table.checkIfSelected(tableDiv, regexp); 513 if (numSelected == 0) return; 514 if (confirmFirst) 519 515 { 520 516 if (!confirm('You are about to delete '+numSelected+' items. This can\'t be undone. Continue?')) … … 538 534 tableDiv = Doc.element(tableDiv); 539 535 var frm = document.forms[tableDiv.id]; 540 var numSelected = Forms.numChecked(frm, regexp); 541 if (numSelected == 0) 542 { 543 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 544 return; 536 if (!table.checkIfSelected(tableDiv, regexp)) 537 { 538 return; 545 539 } 546 540 frm.cmd.value = 'RestoreItems'; … … 561 555 { 562 556 tableDiv = Doc.element(tableDiv); 563 var frm = document.forms[tableDiv.id]; 564 if (Forms.numChecked(frm, regexp) == 0) 565 { 566 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 567 return; 557 if (!table.checkIfSelected(tableDiv, regexp)) 558 { 559 return; 568 560 } 569 561 table.submitToPopup(tableDiv, 'SetOwnerOfItems', 450, 300); … … 582 574 { 583 575 tableDiv = Doc.element(tableDiv); 584 var frm = document.forms[tableDiv.id]; 585 if (Forms.numChecked(frm, regexp) == 0) 586 { 587 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 588 return; 576 if (!table.checkIfSelected(tableDiv, regexp)) 577 { 578 return; 589 579 } 590 580 table.submitToPopup(tableDiv, 'ShareItems', 600, 400); … … 677 667 } 678 668 669 table.checkIfSelected = function(tableDiv, regexp, messageIfNoneSelected) 670 { 671 tableDiv = Doc.element(tableDiv); 672 var frm = document.forms[tableDiv.id]; 673 var numSelected = Forms.numChecked(frm, regexp); 674 if (numSelected == 0) 675 { 676 if (!messageIfNoneSelected) 677 { 678 messageIfNoneSelected = 'Please select at least one item in the list'; 679 } 680 Forms.showNotification('check.uncheck', messageIfNoneSelected, null, 'pointer-left'); 681 } 682 return numSelected; 683 } 679 684 680 685 // ------- OLD CODE BELOW ------------------
Note: See TracChangeset
for help on using the changeset viewer.