Changeset 4578
- Timestamp:
- Oct 13, 2008, 4:38:58 PM (14 years ago)
- Location:
- trunk/www
- Files:
-
- 72 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/admin/hardware/index.jsp
r4510 r4578 219 219 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 220 220 } 221 else if ("TakeOwnershipOfItem".equals(cmd)) 222 { 223 // Take ownership a single item and then return to the view page 224 dc = sc.newDbControl(); 225 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 226 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 227 dc.commit(); 228 redirect = viewPage; 229 } 230 else if ("TakeOwnershipOfItems".equals(cmd)) 231 { 232 // Take ownership all selected items on the list page 233 dc = sc.newDbControl(); 234 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 235 int numTotal = cc.getSelected().size(); 236 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 237 dc.commit(); 238 if (numTotal != numOwned) 239 { 240 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 241 } 242 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 221 else if ("SetOwnerOfItem".equals(cmd)) 222 { 223 // Change owner of items selected on a list page 224 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 225 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 226 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 227 } 228 else if ("SetOwnerOfItems".equals(cmd)) 229 { 230 // Change owner of items selected on a list page 231 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 232 cc.setObject("OwnedItems", cc.getSelected()); 233 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 243 234 } 244 235 else if ("ExportItems".equals(cmd)) -
trunk/www/admin/hardware/list_hardware.jsp
r4510 r4578 138 138 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 139 139 } 140 function takeOwnership() 141 { 142 var frm = document.forms[formId]; 143 if (Forms.numChecked(frm) == 0) 144 { 145 alert('Please select at least one item in the list'); 146 return; 147 } 148 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 149 { 150 frm.action = submitPage; 151 frm.cmd.value = 'TakeOwnershipOfItems'; 152 frm.submit(); 153 } 140 function setOwner() 141 { 142 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 154 143 } 155 144 function shareItem(itemId) … … 315 304 <tbl:button 316 305 image="take_ownership.png" 317 onclick=" takeOwnership()"318 title=" Take ownership…"319 tooltip=" Take ownershipof the selected items"306 onclick="setOwner()" 307 title="Set owner…" 308 tooltip="Change owner of the selected items" 320 309 /> 321 310 <tbl:button -
trunk/www/admin/hardware/view_hardware.jsp
r4510 r4578 112 112 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 113 113 } 114 function takeOwnership() 115 { 116 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 117 { 118 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 119 } 114 function setOwner() 115 { 116 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 120 117 } 121 118 function runPlugin(cmd) … … 170 167 disabled="<%=setOwnerPermission ? false : true%>" 171 168 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 172 onclick="takeOwnership()" 173 title="Take ownership…" 174 visible="<%=!isOwner%>" 175 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 169 onclick="setOwner()" 170 title="Set owner…" 171 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 176 172 /> 177 173 <tbl:button -
trunk/www/admin/jobagents/index.jsp
r4510 r4578 253 253 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 254 254 } 255 else if ("TakeOwnershipOfItem".equals(cmd)) 256 { 257 // Take ownership a single item and then return to the view page 258 dc = sc.newDbControl(); 259 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 260 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 261 dc.commit(); 262 redirect = viewPage; 263 } 264 else if ("TakeOwnershipOfItems".equals(cmd)) 265 { 266 // Take ownership all selected items on the list page 267 dc = sc.newDbControl(); 268 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 269 int numTotal = cc.getSelected().size(); 270 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 271 dc.commit(); 272 if (numTotal != numOwned) 273 { 274 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 275 } 276 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 255 else if ("SetOwnerOfItem".equals(cmd)) 256 { 257 // Change owner of items selected on a list page 258 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 259 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 260 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 261 } 262 else if ("SetOwnerOfItems".equals(cmd)) 263 { 264 // Change owner of items selected on a list page 265 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 266 cc.setObject("OwnedItems", cc.getSelected()); 267 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 277 268 } 278 269 else if ("ExportItems".equals(cmd)) -
trunk/www/admin/jobagents/list_agents.jsp
r4510 r4578 144 144 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 145 145 } 146 function takeOwnership() 147 { 148 var frm = document.forms[formId]; 149 if (Forms.numChecked(frm) == 0) 150 { 151 alert('Please select at least one item in the list'); 152 return; 153 } 154 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 155 { 156 frm.action = submitPage; 157 frm.cmd.value = 'TakeOwnershipOfItems'; 158 frm.submit(); 159 } 146 function setOwner() 147 { 148 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 160 149 } 161 150 function shareItem(itemId) … … 349 338 <tbl:button 350 339 image="take_ownership.png" 351 onclick=" takeOwnership()"352 title=" Take ownership…"353 tooltip=" Take ownershipof the selected items"340 onclick="setOwner()" 341 title="Set owner…" 342 tooltip="Change owner of the selected items" 354 343 /> 355 344 <tbl:button -
trunk/www/admin/jobagents/view_agent.jsp
r4510 r4578 128 128 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 129 129 } 130 function takeOwnership() 131 { 132 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 133 { 134 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 135 } 130 function setOwner() 131 { 132 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 136 133 } 137 134 function configurePlugin(pluginId) … … 190 187 disabled="<%=setOwnerPermission ? false : true%>" 191 188 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 192 onclick="takeOwnership()" 193 title="Take ownership…" 194 visible="<%=!isOwner%>" 195 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 189 onclick="setOwner()" 190 title="Set owner…" 191 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 196 192 /> 197 193 <tbl:button -
trunk/www/admin/pluginconfigurations/index.jsp
r4510 r4578 245 245 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 246 246 } 247 else if ("TakeOwnershipOfItem".equals(cmd)) 248 { 249 // Take ownership a single item and then return to the view page 250 dc = sc.newDbControl(); 251 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 252 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 253 dc.commit(); 254 redirect = viewPage; 255 } 256 else if ("TakeOwnershipOfItems".equals(cmd)) 257 { 258 // Take ownership all selected items on the list page 259 dc = sc.newDbControl(); 260 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 261 int numTotal = cc.getSelected().size(); 262 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 263 dc.commit(); 264 if (numTotal != numOwned) 265 { 266 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 267 } 268 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 247 else if ("SetOwnerOfItem".equals(cmd)) 248 { 249 // Change owner of items selected on a list page 250 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 251 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 252 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 253 } 254 else if ("SetOwnerOfItems".equals(cmd)) 255 { 256 // Change owner of items selected on a list page 257 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 258 cc.setObject("OwnedItems", cc.getSelected()); 259 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 269 260 } 270 261 else if ("ExportItems".equals(cmd)) -
trunk/www/admin/pluginconfigurations/list_configurations.jsp
r4560 r4578 176 176 frm.submit(); 177 177 } 178 function takeOwnership() 179 { 180 var frm = document.forms[formId]; 181 if (Forms.numChecked(frm) == 0) 182 { 183 alert('Please select at least one item in the list'); 184 return; 185 } 186 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 187 { 188 frm.action = submitPage; 189 frm.cmd.value = 'TakeOwnershipOfItems'; 190 frm.submit(); 191 } 178 function setOwner() 179 { 180 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 192 181 } 193 182 function shareItem(itemId) … … 362 351 <tbl:button 363 352 image="take_ownership.png" 364 onclick=" takeOwnership()"365 title=" Take ownership…"366 tooltip=" Take ownershipof the selected items"353 onclick="setOwner()" 354 title="Set owner…" 355 tooltip="Change owner of the selected items" 367 356 /> 368 357 <tbl:button -
trunk/www/admin/pluginconfigurations/view_configuration.jsp
r4510 r4578 149 149 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 150 150 } 151 function takeOwnership() 152 { 153 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 154 { 155 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 156 } 151 function setOwner() 152 { 153 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 157 154 } 158 155 function runPlugin(cmd) … … 217 214 disabled="<%=setOwnerPermission ? false : true%>" 218 215 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 219 onclick="takeOwnership()" 220 title="Take ownership…" 221 visible="<%=!isOwner%>" 222 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 216 onclick="setOwner()" 217 title="Set owner…" 218 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 223 219 /> 224 220 <tbl:button -
trunk/www/admin/plugindefinitions/index.jsp
r4510 r4578 406 406 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 407 407 } 408 else if ("TakeOwnershipOfItem".equals(cmd)) 409 { 410 // Take ownership a single item and then return to the view page 411 dc = sc.newDbControl(); 412 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 413 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 414 dc.commit(); 415 redirect = viewPage; 416 } 417 else if ("TakeOwnershipOfItems".equals(cmd)) 418 { 419 // Take ownership all selected items on the list page 420 dc = sc.newDbControl(); 421 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 422 int numTotal = cc.getSelected().size(); 423 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 424 dc.commit(); 425 if (numTotal != numOwned) 426 { 427 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 428 } 429 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 408 else if ("SetOwnerOfItem".equals(cmd)) 409 { 410 // Change owner of items selected on a list page 411 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 412 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 413 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 414 } 415 else if ("SetOwnerOfItems".equals(cmd)) 416 { 417 // Change owner of items selected on a list page 418 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 419 cc.setObject("OwnedItems", cc.getSelected()); 420 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 430 421 } 431 422 else if ("ExportItems".equals(cmd)) -
trunk/www/admin/plugindefinitions/list_plugins.jsp
r4560 r4578 168 168 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 169 169 } 170 function takeOwnership() 171 { 172 var frm = document.forms[formId]; 173 if (Forms.numChecked(frm) == 0) 174 { 175 alert('Please select at least one item in the list'); 176 return; 177 } 178 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 179 { 180 frm.action = submitPage; 181 frm.cmd.value = 'TakeOwnershipOfItems'; 182 frm.submit(); 183 } 170 function setOwner() 171 { 172 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 184 173 } 185 174 function unloadItems() … … 498 487 <tbl:button 499 488 image="take_ownership.png" 500 onclick=" takeOwnership()"501 title=" Take ownership…"502 tooltip=" Take ownershipof the selected items"489 onclick="setOwner()" 490 title="Set owner…" 491 tooltip="Change owner of the selected items" 503 492 /> 504 493 <tbl:button -
trunk/www/admin/plugindefinitions/view_plugin.jsp
r4510 r4578 155 155 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 156 156 } 157 function takeOwnership() 158 { 159 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 160 { 161 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 162 } 157 function setOwner() 158 { 159 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 163 160 } 164 161 function runPlugin(cmd) … … 228 225 disabled="<%=setOwnerPermission ? false : true%>" 229 226 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 230 onclick="takeOwnership()" 231 title="Take ownership…" 232 visible="<%=!isOwner%>" 233 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 227 onclick="setOwner()" 228 title="Set owner…" 229 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 234 230 /> 235 231 <tbl:button -
trunk/www/admin/protocols/index.jsp
r4510 r4578 241 241 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 242 242 } 243 else if ("TakeOwnershipOfItem".equals(cmd)) 244 { 245 // Take ownership a single item and then return to the view page 246 dc = sc.newDbControl(); 247 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 248 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 249 dc.commit(); 250 redirect = viewPage; 251 } 252 else if ("TakeOwnershipOfItems".equals(cmd)) 253 { 254 // Take ownership all selected items on the list page 255 dc = sc.newDbControl(); 256 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 257 int numTotal = cc.getSelected().size(); 258 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 259 dc.commit(); 260 if (numTotal != numOwned) 261 { 262 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 263 } 264 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 243 else if ("SetOwnerOfItem".equals(cmd)) 244 { 245 // Change owner of items selected on a list page 246 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 247 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 248 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 249 } 250 else if ("SetOwnerOfItems".equals(cmd)) 251 { 252 // Change owner of items selected on a list page 253 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 254 cc.setObject("OwnedItems", cc.getSelected()); 255 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 265 256 } 266 257 else if ("ExportItems".equals(cmd)) -
trunk/www/admin/protocols/list_protocol.jsp
r4510 r4578 138 138 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 139 139 } 140 function takeOwnership() 141 { 142 var frm = document.forms[formId]; 143 if (Forms.numChecked(frm) == 0) 144 { 145 alert('Please select at least one item in the list'); 146 return; 147 } 148 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 149 { 150 frm.action = submitPage; 151 frm.cmd.value = 'TakeOwnershipOfItems'; 152 frm.submit(); 153 } 140 function setOwner() 141 { 142 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 154 143 } 155 144 function shareItem(itemId) … … 315 304 <tbl:button 316 305 image="take_ownership.png" 317 onclick=" takeOwnership()"318 title=" Take ownership…"319 tooltip=" Take ownershipof the selected items"306 onclick="setOwner()" 307 title="Set owner…" 308 tooltip="Change owner of the selected items" 320 309 /> 321 310 <tbl:button -
trunk/www/admin/protocols/view_protocol.jsp
r4510 r4578 119 119 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 120 120 } 121 function takeOwnership() 122 { 123 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 124 { 125 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 126 } 121 function setOwner() 122 { 123 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 127 124 } 128 125 function runPlugin(cmd) … … 177 174 disabled="<%=setOwnerPermission ? false : true%>" 178 175 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 179 onclick="takeOwnership()" 180 title="Take ownership…" 181 visible="<%=!isOwner%>" 182 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 176 onclick="setOwner()" 177 title="Set owner…" 178 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 183 179 /> 184 180 <tbl:button -
trunk/www/admin/software/index.jsp
r4510 r4578 219 219 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 220 220 } 221 else if ("TakeOwnershipOfItem".equals(cmd)) 222 { 223 // Take ownership a single item and then return to the view page 224 dc = sc.newDbControl(); 225 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 226 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 227 dc.commit(); 228 redirect = viewPage; 229 } 230 else if ("TakeOwnershipOfItems".equals(cmd)) 231 { 232 // Take ownership all selected items on the list page 233 dc = sc.newDbControl(); 234 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 235 int numTotal = cc.getSelected().size(); 236 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 237 dc.commit(); 238 if (numTotal != numOwned) 239 { 240 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 241 } 242 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 221 else if ("SetOwnerOfItem".equals(cmd)) 222 { 223 // Change owner of items selected on a list page 224 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 225 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 226 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 227 } 228 else if ("SetOwnerOfItems".equals(cmd)) 229 { 230 // Change owner of items selected on a list page 231 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 232 cc.setObject("OwnedItems", cc.getSelected()); 233 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 243 234 } 244 235 else if ("ExportItems".equals(cmd)) -
trunk/www/admin/software/list_software.jsp
r4510 r4578 138 138 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 139 139 } 140 function takeOwnership() 141 { 142 var frm = document.forms[formId]; 143 if (Forms.numChecked(frm) == 0) 144 { 145 alert('Please select at least one item in the list'); 146 return; 147 } 148 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 149 { 150 frm.action = submitPage; 151 frm.cmd.value = 'TakeOwnershipOfItems'; 152 frm.submit(); 153 } 140 function setOwner() 141 { 142 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 154 143 } 155 144 function shareItem(itemId) … … 315 304 <tbl:button 316 305 image="take_ownership.png" 317 onclick=" takeOwnership()"318 title=" Take ownership…"319 tooltip=" Take ownershipof the selected items"306 onclick="setOwner()" 307 title="Set owner…" 308 tooltip="Change owner of the selected items" 320 309 /> 321 310 <tbl:button -
trunk/www/admin/software/view_software.jsp
r4510 r4578 112 112 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 113 113 } 114 function takeOwnership() 115 { 116 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 117 { 118 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 119 } 114 function setOwner() 115 { 116 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 120 117 } 121 118 function runPlugin(cmd) … … 169 166 disabled="<%=setOwnerPermission ? false : true%>" 170 167 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 171 onclick="takeOwnership()" 172 title="Take ownership…" 173 visible="<%=!isOwner%>" 174 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 168 onclick="setOwner()" 169 title="Set owner…" 170 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 175 171 /> 176 172 <tbl:button -
trunk/www/biomaterials/biosources/index.jsp
r4510 r4578 213 213 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 214 214 } 215 else if ("TakeOwnershipOfItem".equals(cmd)) 216 { 217 // Take ownership a single item and then return to the view page 218 dc = sc.newDbControl(); 219 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 220 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 221 dc.commit(); 222 redirect = viewPage; 223 } 224 else if ("TakeOwnershipOfItems".equals(cmd)) 225 { 226 // Take ownership all selected items on the list page 227 dc = sc.newDbControl(); 228 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 229 int numTotal = cc.getSelected().size(); 230 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 231 dc.commit(); 232 if (numTotal != numOwned) 233 { 234 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 235 } 236 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 215 else if ("SetOwnerOfItem".equals(cmd)) 216 { 217 // Change owner of items selected on a list page 218 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 219 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 220 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 221 } 222 else if ("SetOwnerOfItems".equals(cmd)) 223 { 224 // Change owner of items selected on a list page 225 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 226 cc.setObject("OwnedItems", cc.getSelected()); 227 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 237 228 } 238 229 else if ("ExportItems".equals(cmd)) -
trunk/www/biomaterials/biosources/list_biosources.jsp
r4560 r4578 153 153 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 154 154 } 155 function takeOwnership() 156 { 157 var frm = document.forms[formId]; 158 if (Forms.numChecked(frm) == 0) 159 { 160 alert('Please select at least one item in the list'); 161 return; 162 } 163 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 164 { 165 frm.action = submitPage; 166 frm.cmd.value = 'TakeOwnershipOfItems'; 167 frm.submit(); 168 } 155 function setOwner() 156 { 157 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 169 158 } 170 159 function shareItem(itemId) … … 351 340 <tbl:button 352 341 image="take_ownership.png" 353 onclick=" takeOwnership()"354 title=" Take ownership…"355 tooltip=" Take ownershipof the selected items"342 onclick="setOwner()" 343 title="Set owner…" 344 tooltip="Change owner of the selected items" 356 345 /> 357 346 <tbl:button -
trunk/www/biomaterials/biosources/view_biosource.jsp
r4510 r4578 126 126 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 127 127 } 128 function takeOwnership() 129 { 130 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 131 { 132 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 133 } 128 function setOwner() 129 { 130 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 134 131 } 135 132 function runPlugin(cmd) … … 188 185 disabled="<%=setOwnerPermission ? false : true%>" 189 186 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 190 onclick="takeOwnership()" 191 title="Take ownership…" 192 visible="<%=!isOwner%>" 193 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 187 onclick="setOwner()" 188 title="Set owner…" 189 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 194 190 /> 195 191 <tbl:button -
trunk/www/biomaterials/extracts/index.jsp
r4510 r4578 276 276 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 277 277 } 278 else if ("TakeOwnershipOfItem".equals(cmd)) 279 { 280 // Take ownership a single item and then return to the view page 281 dc = sc.newDbControl(); 282 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 283 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 284 dc.commit(); 285 redirect = viewPage; 286 } 287 else if ("TakeOwnershipOfItems".equals(cmd)) 288 { 289 // Take ownership all selected items on the list page 290 dc = sc.newDbControl(); 291 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 292 int numTotal = cc.getSelected().size(); 293 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 294 dc.commit(); 295 if (numTotal != numOwned) 296 { 297 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 298 } 299 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 278 else if ("SetOwnerOfItem".equals(cmd)) 279 { 280 // Change owner of items selected on a list page 281 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 282 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 283 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 284 } 285 else if ("SetOwnerOfItems".equals(cmd)) 286 { 287 // Change owner of items selected on a list page 288 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 289 cc.setObject("OwnedItems", cc.getSelected()); 290 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 300 291 } 301 292 else if ("ExportItems".equals(cmd)) -
trunk/www/biomaterials/extracts/list_extracts.jsp
r4560 r4578 167 167 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 168 168 } 169 function takeOwnership() 170 { 171 var frm = document.forms[formId]; 172 if (Forms.numChecked(frm) == 0) 173 { 174 alert('Please select at least one item in the list'); 175 return; 176 } 177 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 178 { 179 frm.action = submitPage; 180 frm.cmd.value = 'TakeOwnershipOfItems'; 181 frm.submit(); 182 } 169 function setOwner() 170 { 171 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 183 172 } 184 173 function shareItem(itemId) … … 433 422 <tbl:button 434 423 image="take_ownership.png" 435 onclick=" takeOwnership()"436 title=" Take ownership…"437 tooltip=" Take ownershipof the selected items"424 onclick="setOwner()" 425 title="Set owner…" 426 tooltip="Change owner of the selected items" 438 427 /> 439 428 <tbl:button -
trunk/www/biomaterials/extracts/view_extract.jsp
r4559 r4578 134 134 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 135 135 } 136 function takeOwnership() 137 { 138 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 139 { 140 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 141 } 136 function setOwner() 137 { 138 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 142 139 } 143 140 function runPlugin(cmd) … … 211 208 disabled="<%=setOwnerPermission ? false : true%>" 212 209 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 213 onclick="takeOwnership()" 214 title="Take ownership…" 215 visible="<%=!isOwner%>" 216 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 210 onclick="setOwner()" 211 title="Set owner…" 212 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 217 213 /> 218 214 <tbl:button -
trunk/www/biomaterials/labeledextracts/index.jsp
r4510 r4578 290 290 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 291 291 } 292 else if ("TakeOwnershipOfItem".equals(cmd)) 293 { 294 // Take ownership a single item and then return to the view page 295 dc = sc.newDbControl(); 296 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 297 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 298 dc.commit(); 299 redirect = viewPage; 300 } 301 else if ("TakeOwnershipOfItems".equals(cmd)) 302 { 303 // Take ownership all selected items on the list page 304 dc = sc.newDbControl(); 305 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 306 int numTotal = cc.getSelected().size(); 307 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 308 dc.commit(); 309 if (numTotal != numOwned) 310 { 311 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 312 } 313 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 292 else if ("SetOwnerOfItem".equals(cmd)) 293 { 294 // Change owner of items selected on a list page 295 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 296 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 297 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 298 } 299 else if ("SetOwnerOfItems".equals(cmd)) 300 { 301 // Change owner of items selected on a list page 302 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 303 cc.setObject("OwnedItems", cc.getSelected()); 304 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 314 305 } 315 306 else if ("ExportItems".equals(cmd)) -
trunk/www/biomaterials/labeledextracts/list_labeledextracts.jsp
r4560 r4578 163 163 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 164 164 } 165 function takeOwnership() 166 { 167 var frm = document.forms[formId]; 168 if (Forms.numChecked(frm) == 0) 169 { 170 alert('Please select at least one item in the list'); 171 return; 172 } 173 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 174 { 175 frm.action = submitPage; 176 frm.cmd.value = 'TakeOwnershipOfItems'; 177 frm.submit(); 178 } 165 function setOwner() 166 { 167 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 179 168 } 180 169 function shareItem(itemId) -
trunk/www/biomaterials/labeledextracts/view_labeledextract.jsp
r4559 r4578 133 133 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 134 134 } 135 function takeOwnership() 136 { 137 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 138 { 139 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 140 } 135 function setOwner() 136 { 137 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 141 138 } 142 139 function runPlugin(cmd) … … 210 207 disabled="<%=setOwnerPermission ? false : true%>" 211 208 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 212 onclick="takeOwnership()" 213 title="Take ownership…" 214 visible="<%=!isOwner%>" 215 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 209 onclick="setOwner()" 210 title="Set owner…" 211 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 216 212 /> 217 213 <tbl:button -
trunk/www/biomaterials/labels/index.jsp
r4510 r4578 210 210 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 211 211 } 212 else if ("TakeOwnershipOfItem".equals(cmd)) 213 { 214 // Take ownership a single item and then return to the view page 215 dc = sc.newDbControl(); 216 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 217 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 218 dc.commit(); 219 redirect = viewPage; 220 } 221 else if ("TakeOwnershipOfItems".equals(cmd)) 222 { 223 // Take ownership all selected items on the list page 224 dc = sc.newDbControl(); 225 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 226 int numTotal = cc.getSelected().size(); 227 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 228 dc.commit(); 229 if (numTotal != numOwned) 230 { 231 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 232 } 233 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 212 else if ("SetOwnerOfItem".equals(cmd)) 213 { 214 // Change owner of items selected on a list page 215 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 216 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 217 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 218 } 219 else if ("SetOwnerOfItems".equals(cmd)) 220 { 221 // Change owner of items selected on a list page 222 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 223 cc.setObject("OwnedItems", cc.getSelected()); 224 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 234 225 } 235 226 else if ("ExportItems".equals(cmd)) -
trunk/www/biomaterials/labels/list_labels.jsp
r4510 r4578 131 131 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 132 132 } 133 function takeOwnership() 134 { 135 var frm = document.forms[formId]; 136 if (Forms.numChecked(frm) == 0) 137 { 138 alert('Please select at least one item in the list'); 139 return; 140 } 141 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 142 { 143 frm.action = submitPage; 144 frm.cmd.value = 'TakeOwnershipOfItems'; 145 frm.submit(); 146 } 133 function setOwner() 134 { 135 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 147 136 } 148 137 function shareItem(itemId) … … 284 273 <tbl:button 285 274 image="take_ownership.png" 286 onclick=" takeOwnership()"287 title=" Take ownership…"288 tooltip=" Take ownershipof the selected items"275 onclick="setOwner()" 276 title="Set owner…" 277 tooltip="Change owner of the selected items" 289 278 /> 290 279 <tbl:button -
trunk/www/biomaterials/labels/view_label.jsp
r4510 r4578 118 118 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 119 119 } 120 function takeOwnership() 121 { 122 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 123 { 124 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 125 } 120 function setOwner() 121 { 122 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 126 123 } 127 124 function runPlugin(cmd) … … 179 176 disabled="<%=setOwnerPermission ? false : true%>" 180 177 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 181 onclick="takeOwnership()" 182 title="Take ownership…" 183 visible="<%=!isOwner%>" 184 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 178 onclick="setOwner()" 179 title="Set owner…" 180 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 185 181 /> 186 182 <tbl:button -
trunk/www/biomaterials/samples/index.jsp
r4510 r4578 276 276 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 277 277 } 278 else if ("TakeOwnershipOfItem".equals(cmd)) 279 { 280 // Take ownership a single item and then return to the view page 281 dc = sc.newDbControl(); 282 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 283 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 284 dc.commit(); 285 redirect = viewPage; 286 } 287 else if ("TakeOwnershipOfItems".equals(cmd)) 288 { 289 // Take ownership all selected items on the list page 290 dc = sc.newDbControl(); 291 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 292 int numTotal = cc.getSelected().size(); 293 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 294 dc.commit(); 295 if (numTotal != numOwned) 296 { 297 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 298 } 299 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 278 else if ("SetOwnerOfItem".equals(cmd)) 279 { 280 // Change owner of items selected on a list page 281 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 282 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 283 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 284 } 285 else if ("SetOwnerOfItems".equals(cmd)) 286 { 287 // Change owner of items selected on a list page 288 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 289 cc.setObject("OwnedItems", cc.getSelected()); 290 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 300 291 } 301 292 else if ("ExportItems".equals(cmd)) -
trunk/www/biomaterials/samples/list_samples.jsp
r4555 r4578 168 168 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 169 169 } 170 function takeOwnership() 171 { 172 var frm = document.forms[formId]; 173 if (Forms.numChecked(frm) == 0) 174 { 175 alert('Please select at least one item in the list'); 176 return; 177 } 178 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 179 { 180 frm.action = submitPage; 181 frm.cmd.value = 'TakeOwnershipOfItems'; 182 frm.submit(); 183 } 170 function setOwner() 171 { 172 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 184 173 } 185 174 function shareItem(itemId) … … 434 423 <tbl:button 435 424 image="take_ownership.png" 436 onclick=" takeOwnership()"437 title=" Take ownership…"438 tooltip=" Take ownershipof the selected items"425 onclick="setOwner()" 426 title="Set owner…" 427 tooltip="Change owner of the selected items" 439 428 /> 440 429 <tbl:button -
trunk/www/biomaterials/samples/view_sample.jsp
r4559 r4578 135 135 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 136 136 } 137 function takeOwnership() 138 { 139 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 140 { 141 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 142 } 137 function setOwner() 138 { 139 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 143 140 } 144 141 function runPlugin(cmd) … … 208 205 disabled="<%=setOwnerPermission ? false : true%>" 209 206 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 210 onclick="takeOwnership()" 211 title="Take ownership…" 212 visible="<%=!isOwner%>" 213 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 207 onclick="setOwner()" 208 title="Set owner…" 209 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 214 210 /> 215 211 <tbl:button -
trunk/www/filemanager/directories/index.jsp
r4510 r4578 114 114 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 115 115 } 116 else if (" TakeOwnershipOfItem".equals(cmd))116 else if ("SetOwnerOfItem".equals(cmd)) 117 117 { 118 // Take ownership a single item and then return to the view page 119 dc = sc.newDbControl(); 118 // Change owner of items selected on a list page 120 119 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 121 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 122 dc.commit(); 123 redirect = viewPage; 120 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 121 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 124 122 } 125 123 else if ("UpdateItem".equals(cmd)) -
trunk/www/lims/arraybatches/index.jsp
r4511 r4578 233 233 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 234 234 } 235 else if ("TakeOwnershipOfItem".equals(cmd)) 236 { 237 // Take ownership a single item and then return to the view page 238 dc = sc.newDbControl(); 239 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 240 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 241 dc.commit(); 242 redirect = viewPage; 243 } 244 else if ("TakeOwnershipOfItems".equals(cmd)) 245 { 246 // Take ownership all selected items on the list page 247 dc = sc.newDbControl(); 248 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 249 int numTotal = cc.getSelected().size(); 250 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 251 dc.commit(); 252 if (numTotal != numOwned) 253 { 254 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 255 } 256 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 235 else if ("SetOwnerOfItem".equals(cmd)) 236 { 237 // Change owner of items selected on a list page 238 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 239 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 240 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 241 } 242 else if ("SetOwnerOfItems".equals(cmd)) 243 { 244 // Change owner of items selected on a list page 245 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 246 cc.setObject("OwnedItems", cc.getSelected()); 247 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 257 248 } 258 249 else if ("ExportItems".equals(cmd)) -
trunk/www/lims/arraybatches/list_batches.jsp
r4560 r4578 155 155 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 156 156 } 157 function takeOwnership() 158 { 159 var frm = document.forms[formId]; 160 if (Forms.numChecked(frm) == 0) 161 { 162 alert('Please select at least one item in the list'); 163 return; 164 } 165 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 166 { 167 frm.action = submitPage; 168 frm.cmd.value = 'TakeOwnershipOfItems'; 169 frm.submit(); 170 } 157 function setOwner() 158 { 159 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 171 160 } 172 161 function shareItem(itemId) … … 375 364 <tbl:button 376 365 image="take_ownership.png" 377 onclick=" takeOwnership()"378 title=" Take ownership…"379 tooltip=" Take ownershipof the selected items"366 onclick="setOwner()" 367 title="Set owner…" 368 tooltip="Change owner of the selected items" 380 369 /> 381 370 <tbl:button -
trunk/www/lims/arraybatches/view_batch.jsp
r4511 r4578 127 127 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 128 128 } 129 function takeOwnership() 130 { 131 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 132 { 133 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 134 } 129 function setOwner() 130 { 131 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 135 132 } 136 133 function runPlugin(cmd) … … 206 203 disabled="<%=setOwnerPermission ? false : true%>" 207 204 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 208 onclick="takeOwnership()" 209 title="Take ownership…" 210 visible="<%=!isOwner%>" 211 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 205 onclick="setOwner()" 206 title="Set owner…" 207 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 212 208 /> 213 209 <tbl:button -
trunk/www/lims/arraydesigns/index.jsp
r4511 r4578 252 252 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 253 253 } 254 else if ("TakeOwnershipOfItem".equals(cmd)) 255 { 256 // Take ownership a single item and then return to the view page 257 dc = sc.newDbControl(); 258 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 259 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 260 dc.commit(); 261 redirect = viewPage; 262 } 263 else if ("TakeOwnershipOfItems".equals(cmd)) 264 { 265 // Take ownership all selected items on the list page 266 dc = sc.newDbControl(); 267 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 268 int numTotal = cc.getSelected().size(); 269 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 270 dc.commit(); 271 if (numTotal != numOwned) 272 { 273 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 274 } 275 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 254 else if ("SetOwnerOfItem".equals(cmd)) 255 { 256 // Change owner of items selected on a list page 257 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 258 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 259 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 260 } 261 else if ("SetOwnerOfItems".equals(cmd)) 262 { 263 // Change owner of items selected on a list page 264 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 265 cc.setObject("OwnedItems", cc.getSelected()); 266 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 276 267 } 277 268 else if ("ExportItems".equals(cmd)) -
trunk/www/lims/arraydesigns/list_designs.jsp
r4560 r4578 184 184 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 185 185 } 186 function takeOwnership() 187 { 188 var frm = document.forms[formId]; 189 if (Forms.numChecked(frm) == 0) 190 { 191 alert('Please select at least one item in the list'); 192 return; 193 } 194 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 195 { 196 frm.action = submitPage; 197 frm.cmd.value = 'TakeOwnershipOfItems'; 198 frm.submit(); 199 } 186 function setOwner() 187 { 188 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 200 189 } 201 190 function shareItem(itemId) … … 472 461 <tbl:button 473 462 image="take_ownership.png" 474 onclick=" takeOwnership()"475 title=" Take ownership…"476 tooltip=" Take ownershipof the selected items"463 onclick="setOwner()" 464 title="Set owner…" 465 tooltip="Change owner of the selected items" 477 466 /> 478 467 <tbl:button -
trunk/www/lims/arraydesigns/view_design.jsp
r4511 r4578 147 147 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 148 148 } 149 function takeOwnership() 150 { 151 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 152 { 153 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 154 } 149 function setOwner() 150 { 151 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 155 152 } 156 153 function runPlugin(cmd) … … 231 228 disabled="<%=setOwnerPermission ? false : true%>" 232 229 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 233 onclick="takeOwnership()" 234 title="Take ownership…" 235 visible="<%=!isOwner%>" 236 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 230 onclick="setOwner()" 231 title="Set owner…" 232 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 237 233 /> 238 234 <tbl:button -
trunk/www/lims/arrayslides/index.jsp
r4511 r4578 281 281 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 282 282 } 283 else if ("TakeOwnershipOfItem".equals(cmd)) 284 { 285 // Take ownership a single item and then return to the view page 286 dc = sc.newDbControl(); 287 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 288 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 289 dc.commit(); 290 redirect = viewPage; 291 } 292 else if ("TakeOwnershipOfItems".equals(cmd)) 293 { 294 // Take ownership all selected items on the list page 295 dc = sc.newDbControl(); 296 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 297 int numTotal = cc.getSelected().size(); 298 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 299 dc.commit(); 300 if (numTotal != numOwned) 301 { 302 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 303 } 304 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 283 else if ("SetOwnerOfItem".equals(cmd)) 284 { 285 // Change owner of items selected on a list page 286 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 287 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 288 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 289 } 290 else if ("SetOwnerOfItems".equals(cmd)) 291 { 292 // Change owner of items selected on a list page 293 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 294 cc.setObject("OwnedItems", cc.getSelected()); 295 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 305 296 } 306 297 else if ("ExportItems".equals(cmd)) -
trunk/www/lims/arrayslides/list_slides.jsp
r4560 r4578 148 148 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 149 149 } 150 function takeOwnership() 151 { 152 var frm = document.forms[formId]; 153 if (Forms.numChecked(frm) == 0) 154 { 155 alert('Please select at least one item in the list'); 156 return; 157 } 158 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 159 { 160 frm.action = submitPage; 161 frm.cmd.value = 'TakeOwnershipOfItems'; 162 frm.submit(); 163 } 150 function setOwner() 151 { 152 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 164 153 } 165 154 function shareItem(itemId) … … 390 379 <tbl:button 391 380 image="take_ownership.png" 392 onclick=" takeOwnership()"393 title=" Take ownership…"394 tooltip=" Take ownershipof the selected items"381 onclick="setOwner()" 382 title="Set owner…" 383 tooltip="Change owner of the selected items" 395 384 /> 396 385 <tbl:button -
trunk/www/lims/arrayslides/view_slide.jsp
r4511 r4578 125 125 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 126 126 } 127 function takeOwnership() 128 { 129 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 130 { 131 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 132 } 127 function setOwner() 128 { 129 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 133 130 } 134 131 function runPlugin(cmd) … … 182 179 disabled="<%=setOwnerPermission ? false : true%>" 183 180 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 184 onclick="takeOwnership()" 185 title="Take ownership…" 186 visible="<%=!isOwner%>" 187 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 181 onclick="setOwner()" 182 title="Set owner…" 183 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 188 184 /> 189 185 <tbl:button -
trunk/www/lims/platemappings/index.jsp
r4511 r4578 219 219 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 220 220 } 221 else if ("TakeOwnershipOfItem".equals(cmd)) 222 { 223 // Take ownership a single item and then return to the view page 224 dc = sc.newDbControl(); 225 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 226 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 227 dc.commit(); 228 redirect = viewPage; 229 } 230 else if ("TakeOwnershipOfItems".equals(cmd)) 231 { 232 // Take ownership all selected items on the list page 233 dc = sc.newDbControl(); 234 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 235 int numTotal = cc.getSelected().size(); 236 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 237 dc.commit(); 238 if (numTotal != numOwned) 239 { 240 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 241 } 242 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 221 else if ("SetOwnerOfItem".equals(cmd)) 222 { 223 // Change owner of items selected on a list page 224 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 225 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 226 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 227 } 228 else if ("SetOwnerOfItems".equals(cmd)) 229 { 230 // Change owner of items selected on a list page 231 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 232 cc.setObject("OwnedItems", cc.getSelected()); 233 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 243 234 } 244 235 else if ("ExportItems".equals(cmd)) -
trunk/www/lims/platemappings/list_mappings.jsp
r4511 r4578 141 141 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 142 142 } 143 function takeOwnership() 144 { 145 var frm = document.forms[formId]; 146 if (Forms.numChecked(frm) == 0) 147 { 148 alert('Please select at least one item in the list'); 149 return; 150 } 151 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 152 { 153 frm.action = submitPage; 154 frm.cmd.value = 'TakeOwnershipOfItems'; 155 frm.submit(); 156 } 143 function setOwner() 144 { 145 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 157 146 } 158 147 function shareItem(itemId) … … 342 331 <tbl:button 343 332 image="take_ownership.png" 344 onclick=" takeOwnership()"345 title=" Take ownership…"346 tooltip=" Take ownershipof the selected items"333 onclick="setOwner()" 334 title="Set owner…" 335 tooltip="Change owner of the selected items" 347 336 /> 348 337 <tbl:button -
trunk/www/lims/platemappings/view_mapping.jsp
r4511 r4578 128 128 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 129 129 } 130 function takeOwnership() 131 { 132 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 133 { 134 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 135 } 130 function setOwner() 131 { 132 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 136 133 } 137 134 function runPlugin(cmd) … … 185 182 disabled="<%=setOwnerPermission ? false : true%>" 186 183 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 187 onclick="takeOwnership()" 188 title="Take ownership…" 189 visible="<%=!isOwner%>" 190 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 184 onclick="setOwner()" 185 title="Set owner…" 186 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 191 187 /> 192 188 <tbl:button -
trunk/www/lims/plates/index.jsp
r4511 r4578 216 216 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 217 217 } 218 else if ("TakeOwnershipOfItem".equals(cmd)) 219 { 220 // Take ownership a single item and then return to the view page 221 dc = sc.newDbControl(); 222 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 223 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 224 dc.commit(); 225 redirect = viewPage; 226 } 227 else if ("TakeOwnershipOfItems".equals(cmd)) 228 { 229 // Take ownership all selected items on the list page 230 dc = sc.newDbControl(); 231 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 232 int numTotal = cc.getSelected().size(); 233 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 234 dc.commit(); 235 if (numTotal != numOwned) 236 { 237 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 238 } 239 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 218 else if ("SetOwnerOfItem".equals(cmd)) 219 { 220 // Change owner of items selected on a list page 221 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 222 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 223 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 224 } 225 else if ("SetOwnerOfItems".equals(cmd)) 226 { 227 // Change owner of items selected on a list page 228 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 229 cc.setObject("OwnedItems", cc.getSelected()); 230 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 240 231 } 241 232 else if ("ExportItems".equals(cmd)) -
trunk/www/lims/plates/list_plates.jsp
r4560 r4578 165 165 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 166 166 } 167 function takeOwnership() 168 { 169 var frm = document.forms[formId]; 170 if (Forms.numChecked(frm) == 0) 171 { 172 alert('Please select at least one item in the list'); 173 return; 174 } 175 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 176 { 177 frm.action = submitPage; 178 frm.cmd.value = 'TakeOwnershipOfItems'; 179 frm.submit(); 180 } 167 function setOwner() 168 { 169 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 181 170 } 182 171 function shareItem(itemId) … … 414 403 <tbl:button 415 404 image="take_ownership.png" 416 onclick=" takeOwnership()"417 title=" Take ownership…"418 tooltip=" Take ownershipof the selected items"405 onclick="setOwner()" 406 title="Set owner…" 407 tooltip="Change owner of the selected items" 419 408 /> 420 409 <tbl:button -
trunk/www/lims/plates/view_plate.jsp
r4511 r4578 132 132 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 133 133 } 134 function takeOwnership() 135 { 136 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 137 { 138 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 139 } 134 function setOwner() 135 { 136 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 140 137 } 141 138 function runPlugin(cmd) … … 212 209 disabled="<%=setOwnerPermission ? false : true%>" 213 210 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 214 onclick="takeOwnership()" 215 title="Take ownership…" 216 visible="<%=!isOwner%>" 217 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 211 onclick="setOwner()" 212 title="Set owner…" 213 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 218 214 /> 219 215 <tbl:button -
trunk/www/lims/platetypes/index.jsp
r4511 r4578 215 215 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 216 216 } 217 else if ("TakeOwnershipOfItem".equals(cmd)) 218 { 219 // Take ownership a single item and then return to the view page 220 dc = sc.newDbControl(); 221 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 222 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 223 dc.commit(); 224 redirect = viewPage; 225 } 226 else if ("TakeOwnershipOfItems".equals(cmd)) 227 { 228 // Take ownership all selected items on the list page 229 dc = sc.newDbControl(); 230 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 231 int numTotal = cc.getSelected().size(); 232 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 233 dc.commit(); 234 if (numTotal != numOwned) 235 { 236 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 237 } 238 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 217 else if ("SetOwnerOfItem".equals(cmd)) 218 { 219 // Change owner of items selected on a list page 220 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 221 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 222 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 223 } 224 else if ("SetOwnerOfItems".equals(cmd)) 225 { 226 // Change owner of items selected on a list page 227 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 228 cc.setObject("OwnedItems", cc.getSelected()); 229 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 239 230 } 240 231 else if ("ExportItems".equals(cmd)) -
trunk/www/lims/platetypes/list_platetypes.jsp
r4511 r4578 150 150 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 151 151 } 152 function takeOwnership() 153 { 154 var frm = document.forms[formId]; 155 if (Forms.numChecked(frm) == 0) 156 { 157 alert('Please select at least one item in the list'); 158 return; 159 } 160 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 161 { 162 frm.action = submitPage; 163 frm.cmd.value = 'TakeOwnershipOfItems'; 164 frm.submit(); 165 } 152 function setOwner() 153 { 154 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 166 155 } 167 156 function shareItem(itemId) … … 319 308 <tbl:button 320 309 image="take_ownership.png" 321 onclick=" takeOwnership()"322 title=" Take ownership…"323 tooltip=" Take ownershipof the selected items"310 onclick="setOwner()" 311 title="Set owner…" 312 tooltip="Change owner of the selected items" 324 313 /> 325 314 <tbl:button -
trunk/www/lims/platetypes/view_platetype.jsp
r4511 r4578 122 122 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 123 123 } 124 function takeOwnership() 125 { 126 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 127 { 128 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 129 } 124 function setOwner() 125 { 126 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 130 127 } 131 128 function runPlugin(cmd) … … 195 192 disabled="<%=setOwnerPermission ? false : true%>" 196 193 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 197 onclick="takeOwnership()" 198 title="Take ownership…" 199 visible="<%=!isOwner%>" 200 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 194 onclick="setOwner()" 195 title="Set owner…" 196 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 201 197 /> 202 198 <tbl:button -
trunk/www/my_base/projects/index.jsp
r4511 r4578 254 254 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 255 255 } 256 else if ("TakeOwnershipOfItem".equals(cmd)) 257 { 258 // Take ownership a single item and then return to the view page 259 dc = sc.newDbControl(); 260 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 261 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 262 dc.commit(); 263 redirect = viewPage; 264 } 265 else if ("TakeOwnershipOfItems".equals(cmd)) 266 { 267 // Take ownership all selected items on the list page 268 dc = sc.newDbControl(); 269 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 270 int numTotal = cc.getSelected().size(); 271 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 272 dc.commit(); 273 if (numTotal != numOwned) 274 { 275 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 276 } 277 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 256 else if ("SetOwnerOfItem".equals(cmd)) 257 { 258 // Change owner of items selected on a list page 259 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 260 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 261 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 262 } 263 else if ("SetOwnerOfItems".equals(cmd)) 264 { 265 // Change owner of items selected on a list page 266 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 267 cc.setObject("OwnedItems", cc.getSelected()); 268 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 278 269 } 279 270 else if ("ExportItems".equals(cmd)) -
trunk/www/my_base/projects/list_projects.jsp
r4511 r4578 131 131 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 132 132 } 133 function takeOwnership() 134 { 135 var frm = document.forms[formId]; 136 if (Forms.numChecked(frm) == 0) 137 { 138 alert('Please select at least one item in the list'); 139 return; 140 } 141 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 142 { 143 frm.action = submitPage; 144 frm.cmd.value = 'TakeOwnershipOfItems'; 145 frm.submit(); 146 } 133 function setOwner() 134 { 135 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 147 136 } 148 137 function configureColumns() … … 271 260 <tbl:button 272 261 image="take_ownership.png" 273 onclick="takeOwnership()" 274 title="Take ownership…" 275 tooltip="Take ownership of the selected items" 276 visible="<%=sc.hasPermission(Permission.SET_OWNER, Item.PROJECT)%>" 262 onclick="setOwner()" 263 title="Set owner…" 264 tooltip="Change owner of the selected items" 277 265 /> 278 266 <tbl:button -
trunk/www/my_base/projects/view_project.jsp
r4511 r4578 114 114 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 115 115 } 116 function takeOwnership() 117 { 118 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 119 { 120 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 121 } 116 function setOwner() 117 { 118 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 122 119 } 123 120 function runPlugin(cmd) … … 184 181 disabled="<%=setOwnerPermission ? false : true%>" 185 182 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 186 onclick="takeOwnership()" 187 title="Take ownership…" 188 visible="<%=!isOwner%>" 189 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 183 onclick="setOwner()" 184 title="Set owner…" 185 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 190 186 /> 191 187 <tbl:button -
trunk/www/views/experiments/index.jsp
r4511 r4578 272 272 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 273 273 } 274 else if ("TakeOwnershipOfItem".equals(cmd)) 275 { 276 // Take ownership a single item and then return to the view page 277 dc = sc.newDbControl(); 278 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 279 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 280 dc.commit(); 281 redirect = viewPage; 282 } 283 else if ("TakeOwnershipOfItems".equals(cmd)) 284 { 285 // Take ownership all selected items on the list page 286 dc = sc.newDbControl(); 287 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 288 int numTotal = cc.getSelected().size(); 289 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 290 dc.commit(); 291 if (numTotal != numOwned) 292 { 293 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 294 } 295 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 274 else if ("SetOwnerOfItem".equals(cmd)) 275 { 276 // Change owner of items selected on a list page 277 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 278 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 279 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 280 } 281 else if ("SetOwnerOfItems".equals(cmd)) 282 { 283 // Change owner of items selected on a list page 284 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 285 cc.setObject("OwnedItems", cc.getSelected()); 286 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 296 287 } 297 288 else if ("ExportItems".equals(cmd)) -
trunk/www/views/experiments/list_experiments.jsp
r4511 r4578 135 135 frm.submit(); 136 136 } 137 function takeOwnership() 138 { 139 var frm = document.forms[formId]; 140 if (Forms.numChecked(frm) == 0) 141 { 142 alert('Please select at least one item in the list'); 143 return; 144 } 145 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 146 { 147 frm.action = submitPage; 148 frm.cmd.value = 'TakeOwnershipOfItems'; 149 frm.submit(); 150 } 137 function setOwner() 138 { 139 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 151 140 } 152 141 function deleteItemPermanently(itemId) … … 410 399 <tbl:button 411 400 image="take_ownership.png" 412 onclick=" takeOwnership()"413 title=" Take ownership…"414 tooltip=" Take ownershipof the selected items"401 onclick="setOwner()" 402 title="Set owner…" 403 tooltip="Change owner of the selected items" 415 404 /> 416 405 <tbl:button -
trunk/www/views/experiments/view_experiment.jsp
r4548 r4578 135 135 { 136 136 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 137 } 138 139 function takeOwnership() 140 { 141 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 142 { 143 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 144 } 137 } 138 function setOwner() 139 { 140 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 145 141 } 146 142 function runPlugin(cmd) … … 245 241 disabled="<%=setOwnerPermission ? false : true%>" 246 242 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 247 onclick="takeOwnership()" 248 title="Take ownership…" 249 visible="<%=!isOwner%>" 250 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 243 onclick="setOwner()" 244 title="Set owner…" 245 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 251 246 /> 252 247 <tbl:button -
trunk/www/views/formulas/index.jsp
r4511 r4578 233 233 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 234 234 } 235 else if ("TakeOwnershipOfItem".equals(cmd)) 236 { 237 // Take ownership a single item and then return to the view page 238 dc = sc.newDbControl(); 239 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 240 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 241 dc.commit(); 242 redirect = viewPage; 243 } 244 else if ("TakeOwnershipOfItems".equals(cmd)) 245 { 246 // Take ownership all selected items on the list page 247 dc = sc.newDbControl(); 248 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 249 int numTotal = cc.getSelected().size(); 250 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 251 dc.commit(); 252 if (numTotal != numOwned) 253 { 254 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 255 } 256 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 235 else if ("SetOwnerOfItem".equals(cmd)) 236 { 237 // Change owner of items selected on a list page 238 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 239 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 240 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 241 } 242 else if ("SetOwnerOfItems".equals(cmd)) 243 { 244 // Change owner of items selected on a list page 245 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 246 cc.setObject("OwnedItems", cc.getSelected()); 247 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 257 248 } 258 249 else if ("ExportItems".equals(cmd)) -
trunk/www/views/formulas/list_formulas.jsp
r4511 r4578 156 156 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 157 157 } 158 function takeOwnership() 159 { 160 var frm = document.forms[formId]; 161 if (Forms.numChecked(frm) == 0) 162 { 163 alert('Please select at least one item in the list'); 164 return; 165 } 166 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 167 { 168 frm.action = submitPage; 169 frm.cmd.value = 'TakeOwnershipOfItems'; 170 frm.submit(); 171 } 158 function setOwner() 159 { 160 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 172 161 } 173 162 function shareItem(itemId) … … 408 397 <tbl:button 409 398 image="take_ownership.png" 410 onclick=" takeOwnership()"411 title=" Take ownership…"412 tooltip=" Take ownershipof the selected items"399 onclick="setOwner()" 400 title="Set owner…" 401 tooltip="Change owner of the selected items" 413 402 /> 414 403 <tbl:button -
trunk/www/views/formulas/view_formula.jsp
r4511 r4578 118 118 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 119 119 } 120 function takeOwnership() 121 { 122 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 123 { 124 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 125 } 120 function setOwner() 121 { 122 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 126 123 } 127 124 function runPlugin(cmd) … … 175 172 disabled="<%=setOwnerPermission ? false : true%>" 176 173 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 177 onclick="takeOwnership()" 178 title="Take ownership…" 179 visible="<%=!isOwner%>" 180 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 174 onclick="setOwner()" 175 title="Set owner…" 176 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 181 177 /> 182 178 <tbl:button -
trunk/www/views/hybridizations/index.jsp
r4511 r4578 273 273 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 274 274 } 275 else if ("TakeOwnershipOfItem".equals(cmd)) 276 { 277 // Take ownership a single item and then return to the view page 278 dc = sc.newDbControl(); 279 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 280 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 281 dc.commit(); 282 redirect = viewPage; 283 } 284 else if ("TakeOwnershipOfItems".equals(cmd)) 285 { 286 // Take ownership all selected items on the list page 287 dc = sc.newDbControl(); 288 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 289 int numTotal = cc.getSelected().size(); 290 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 291 dc.commit(); 292 if (numTotal != numOwned) 293 { 294 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 295 } 296 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 275 else if ("SetOwnerOfItem".equals(cmd)) 276 { 277 // Change owner of items selected on a list page 278 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 279 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 280 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 281 } 282 else if ("SetOwnerOfItems".equals(cmd)) 283 { 284 // Change owner of items selected on a list page 285 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 286 cc.setObject("OwnedItems", cc.getSelected()); 287 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 297 288 } 298 289 else if ("ExportItems".equals(cmd)) -
trunk/www/views/hybridizations/list_hybridizations.jsp
r4560 r4578 168 168 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 169 169 } 170 function takeOwnership() 171 { 172 var frm = document.forms[formId]; 173 if (Forms.numChecked(frm) == 0) 174 { 175 alert('Please select at least one item in the list'); 176 return; 177 } 178 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 179 { 180 frm.action = submitPage; 181 frm.cmd.value = 'TakeOwnershipOfItems'; 182 frm.submit(); 183 } 170 function setOwner() 171 { 172 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 184 173 } 185 174 function shareItem(itemId) … … 420 409 <tbl:button 421 410 image="take_ownership.png" 422 onclick=" takeOwnership()"423 title=" Take ownership…"424 tooltip=" Take ownershipof the selected items"411 onclick="setOwner()" 412 title="Set owner…" 413 tooltip="Change owner of the selected items" 425 414 /> 426 415 <tbl:button -
trunk/www/views/hybridizations/view_hybridization.jsp
r4511 r4578 134 134 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 135 135 } 136 function takeOwnership() 137 { 138 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 139 { 140 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 141 } 136 function setOwner() 137 { 138 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 142 139 } 143 140 function runPlugin(cmd) … … 196 193 disabled="<%=setOwnerPermission ? false : true%>" 197 194 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 198 onclick="takeOwnership()" 199 title="Take ownership…" 200 visible="<%=!isOwner%>" 201 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 195 onclick="setOwner()" 196 title="Set owner…" 197 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 202 198 /> 203 199 <tbl:button -
trunk/www/views/jobs/index.jsp
r4511 r4578 160 160 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 161 161 } 162 else if ("TakeOwnershipOfItem".equals(cmd)) 163 { 164 // Take ownership a single item and then return to the view page 165 dc = sc.newDbControl(); 166 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 167 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 168 dc.commit(); 169 redirect = viewPage; 170 } 171 else if ("TakeOwnershipOfItems".equals(cmd)) 172 { 173 // Take ownership all selected items on the list page 174 dc = sc.newDbControl(); 175 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 176 int numTotal = cc.getSelected().size(); 177 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 178 dc.commit(); 179 if (numTotal != numOwned) 180 { 181 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 182 } 183 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 162 else if ("SetOwnerOfItem".equals(cmd)) 163 { 164 // Change owner of items selected on a list page 165 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 166 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 167 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 168 } 169 else if ("SetOwnerOfItems".equals(cmd)) 170 { 171 // Change owner of items selected on a list page 172 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 173 cc.setObject("OwnedItems", cc.getSelected()); 174 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 184 175 } 185 176 else if ("ExportItems".equals(cmd)) -
trunk/www/views/jobs/list_jobs.jsp
r4511 r4578 160 160 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 161 161 } 162 function takeOwnership() 163 { 164 var frm = document.forms[formId]; 165 if (Forms.numChecked(frm) == 0) 166 { 167 alert('Please select at least one item in the list'); 168 return; 169 } 170 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 171 { 172 frm.action = submitPage; 173 frm.cmd.value = 'TakeOwnershipOfItems'; 174 frm.submit(); 175 } 162 function setOwner() 163 { 164 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 176 165 } 177 166 function configureColumns() … … 447 436 <tbl:button 448 437 image="take_ownership.png" 449 onclick="takeOwnership()" 450 title="Take ownership…" 451 tooltip="Take ownership of the selected items" 452 visible="<%=sc.hasPermission(Permission.SET_OWNER, Item.JOB)%>" 438 onclick="setOwner()" 439 title="Set owner…" 440 tooltip="Change owner of the selected items" 453 441 /> 454 442 <tbl:button -
trunk/www/views/reporterlists/index.jsp
r4511 r4578 298 298 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 299 299 } 300 else if ("TakeOwnershipOfItem".equals(cmd)) 301 { 302 // Take ownership a single item and then return to the view page 303 dc = sc.newDbControl(); 304 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 305 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 306 dc.commit(); 307 redirect = viewPage; 308 } 309 else if ("TakeOwnershipOfItems".equals(cmd)) 310 { 311 // Take ownership all selected items on the list page 312 dc = sc.newDbControl(); 313 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 314 int numTotal = cc.getSelected().size(); 315 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 316 dc.commit(); 317 if (numTotal != numOwned) 318 { 319 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 320 } 321 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 300 else if ("SetOwnerOfItem".equals(cmd)) 301 { 302 // Change owner of items selected on a list page 303 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 304 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 305 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 306 } 307 else if ("SetOwnerOfItems".equals(cmd)) 308 { 309 // Change owner of items selected on a list page 310 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 311 cc.setObject("OwnedItems", cc.getSelected()); 312 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 322 313 } 323 314 else if ("ExportItems".equals(cmd)) -
trunk/www/views/reporterlists/list_reporterlists.jsp
r4511 r4578 131 131 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 132 132 } 133 function takeOwnership() 134 { 135 var frm = document.forms[formId]; 136 if (Forms.numChecked(frm) == 0) 137 { 138 alert('Please select at least one item in the list'); 139 return; 140 } 141 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 142 { 143 frm.action = submitPage; 144 frm.cmd.value = 'TakeOwnershipOfItems'; 145 frm.submit(); 146 } 133 function setOwner() 134 { 135 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 147 136 } 148 137 function shareItem(itemId) … … 307 296 <tbl:button 308 297 image="take_ownership.png" 309 onclick=" takeOwnership()"310 title=" Take ownership…"311 tooltip=" Take ownershipof the selected items"298 onclick="setOwner()" 299 title="Set owner…" 300 tooltip="Change owner of the selected items" 312 301 /> 313 302 <tbl:button -
trunk/www/views/reporterlists/view_reporterlist.jsp
r4511 r4578 113 113 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 114 114 } 115 function takeOwnership() 116 { 117 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 118 { 119 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 120 } 115 function setOwner() 116 { 117 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 121 118 } 122 119 function runPlugin(cmd) … … 189 186 disabled="<%=setOwnerPermission ? false : true%>" 190 187 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 191 onclick="takeOwnership()" 192 title="Take ownership…" 193 visible="<%=!isOwner%>" 194 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 188 onclick="setOwner()" 189 title="Set owner…" 190 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 195 191 /> 196 192 <tbl:button -
trunk/www/views/scans/index.jsp
r4511 r4578 237 237 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 238 238 } 239 else if ("TakeOwnershipOfItem".equals(cmd)) 240 { 241 // Take ownership a single item and then return to the view page 242 dc = sc.newDbControl(); 243 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 244 OwnableUtil.setOwner(dc, itemType, Collections.singleton(cc.getId()), null); 245 dc.commit(); 246 redirect = viewPage; 247 } 248 else if ("TakeOwnershipOfItems".equals(cmd)) 249 { 250 // Take ownership all selected items on the list page 251 dc = sc.newDbControl(); 252 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 253 int numTotal = cc.getSelected().size(); 254 int numOwned = OwnableUtil.setOwner(dc, itemType, cc.getSelected(), null); 255 dc.commit(); 256 if (numTotal != numOwned) 257 { 258 message = (numOwned == 0 ? "No" : "Only "+numOwned+" of "+numTotal) + " items could be taken, because you have no SET_OWNER permission"; 259 } 260 redirect = listPage+(message != null ? "&popmessage="+HTML.urlEncode(message) : ""); 239 else if ("SetOwnerOfItem".equals(cmd)) 240 { 241 // Change owner of items selected on a list page 242 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 243 cc.setObject("OwnedItems", Collections.singleton(cc.getId())); 244 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 245 } 246 else if ("SetOwnerOfItems".equals(cmd)) 247 { 248 // Change owner of items selected on a list page 249 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 250 cc.setObject("OwnedItems", cc.getSelected()); 251 redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name(); 261 252 } 262 253 else if ("ExportItems".equals(cmd)) -
trunk/www/views/scans/list_scans.jsp
r4560 r4578 154 154 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', itemId); 155 155 } 156 function takeOwnership() 157 { 158 var frm = document.forms[formId]; 159 if (Forms.numChecked(frm) == 0) 160 { 161 alert('Please select at least one item in the list'); 162 return; 163 } 164 if (confirm('Are you sure that you want to take ownership of the selected items? It can\'t be undone.')) 165 { 166 frm.action = submitPage; 167 frm.cmd.value = 'TakeOwnershipOfItems'; 168 frm.submit(); 169 } 156 function setOwner() 157 { 158 Table.setOwnerOfItems(submitPage, '<%=ID%>', formId, '<%=itemType.name()%>', 'SetOwnerOfItems'); 170 159 } 171 160 function shareItem(itemId) … … 374 363 <tbl:button 375 364 image="take_ownership.png" 376 onclick=" takeOwnership()"377 title=" Take ownership…"378 tooltip=" Take ownershipof the selected items"365 onclick="setOwner()" 366 title="Set owner…" 367 tooltip="Change owner of the selected items" 379 368 /> 380 369 <tbl:button -
trunk/www/views/scans/view_scan.jsp
r4511 r4578 127 127 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); 128 128 } 129 function takeOwnership() 130 { 131 if (confirm('Are you sure that you want to take ownership of this item? It can\'t be undone.')) 132 { 133 location.replace('index.jsp?ID=<%=ID%>&cmd=TakeOwnershipOfItem&item_id=<%=itemId%>'); 134 } 129 function setOwner() 130 { 131 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); 135 132 } 136 133 function runPlugin(cmd) … … 204 201 disabled="<%=setOwnerPermission ? false : true%>" 205 202 image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" 206 onclick="takeOwnership()" 207 title="Take ownership…" 208 visible="<%=!isOwner%>" 209 tooltip="<%=setOwnerPermission ? "Take ownership of this item" : "You do not have permission to take ownership of this item"%>" 203 onclick="setOwner()" 204 title="Set owner…" 205 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 210 206 /> 211 207 <tbl:button
Note: See TracChangeset
for help on using the changeset viewer.