Changeset 6306
- Timestamp:
- Aug 13, 2013, 3:15:33 PM (9 years ago)
- Location:
- trunk/www
- Files:
-
- 5 added
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/admin/clients/help/help.js
r6295 r6306 78 78 var clientId = frm.client_id.value; 79 79 var url = '../index.jsp?ID='+App.getSessionId(); 80 url += '&cmd=ViewItem& client_id='+clientId;80 url += '&cmd=ViewItem&item_id='+clientId; 81 81 url += '&tab=properties'; 82 82 location.replace(url); -
trunk/www/admin/clients/help/list_help.jsp
r6289 r6306 373 373 </tbl:table> 374 374 <base:buttongroup> 375 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />376 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />377 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />375 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 376 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 377 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 378 378 </base:buttongroup> 379 379 </t:tab> -
trunk/www/biomaterials/bioplateeventtypes/bioplateeventtypes.js
r6261 r6306 35 35 if (pageId == 'edit-page') 36 36 { 37 // TODO 37 // Save + Close buttons 38 Buttons.addClickHandler('btnSave', bioplateeventtypes.save); 39 Buttons.addClickHandler('close', App.closeWindow); 40 41 // Tab validation 42 TabControl.addTabValidator('settings.info', bioplateeventtypes.validateBioPlateEventType); 38 43 } 39 44 else if (pageId == 'view-page') … … 67 72 } 68 73 74 bioplateeventtypes.validateBioPlateEventType = function() 75 { 76 var frm = document.forms['bioPlateEventType']; 77 if (Main.trimString(frm.name.value) == '') 78 { 79 Forms.showNotification(frm.name, 'You must enter a name'); 80 return false; 81 } 82 if (frm.system_id && Main.trimString(frm.system_id.value) == '') 83 { 84 Forms.showNotification(frm.system_id, 'You must enter a system id'); 85 return false; 86 } 87 return true; 88 } 89 90 // Submit the form 91 bioplateeventtypes.save = function() 92 { 93 var frm = document.forms['bioPlateEventType']; 94 if (TabControl.validateActiveTab('settings')) 95 { 96 frm.submit(); 97 } 98 } 99 100 69 101 return bioplateeventtypes; 70 102 }(); -
trunk/www/biomaterials/bioplateeventtypes/edit_eventtype.jsp
r6217 r6306 83 83 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 84 84 %> 85 <base:page type="popup" title="<%=title%>" >86 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">85 <base:page type="popup" title="<%=title%>" id="edit-page"> 86 <base:head scripts="tabcontrol-2.js,~bioplateeventtypes.js" styles="tabcontrol.css"> 87 87 <ext:scripts context="<%=jspContext%>" /> 88 88 <ext:stylesheets context="<%=jspContext%>" /> 89 <script>90 // Validate the "BioPlateEventType" tab91 function validateBioPlateEventType()92 {93 var frm = document.forms['bioPlateEventType'];94 if (Main.trimString(frm.name.value) == '')95 {96 Forms.showNotification(frm.name, 'You must enter a name');97 return false;98 }99 if (frm.system_id && Main.trimString(frm.system_id.value) == '')100 {101 Forms.showNotification(frm.system_id, 'You must enter a system id');102 return false;103 }104 return true;105 }106 107 // Submit the form108 function saveSettings()109 {110 var frm = document.forms['bioPlateEventType'];111 if (TabControl.validateActiveTab('settings'))112 {113 frm.submit();114 }115 }116 117 function init()118 {119 var frm = document.forms['bioPlateEventType'];120 <%121 if (eventType == null)122 {123 %>124 frm.name.focus();125 frm.name.select();126 <%127 }128 %>129 }130 </script>131 89 </base:head> 132 <base:body onload="init()">90 <base:body> 133 91 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 134 92 <form action="index.jsp?ID=<%=ID%>" method="post" name="bioPlateEventType"> … … 139 97 position="bottom" remember="<%=eventType != null%>" 140 98 extensions="<%=invoker%>"> 141 <t:tab id="info" title="Bioplate event type" validate="validateBioPlateEventType()"helpid="bioplateeventtype.edit">99 <t:tab id="info" title="Bioplate event type" helpid="bioplateeventtype.edit"> 142 100 <table class="fullform input100"> 143 101 <tr> 144 102 <th>Name</th> 145 <td><input class="text required" type="text" name="name" 103 <td><input class="text required auto-init" data-auto-init="<%=eventType == null ? "focus-select" : "focus" %>" 104 type="text" name="name" 146 105 value="<%=HTML.encodeTags(eventType == null ? Values.getString(cc.getPropertyValue("name"), "New bioplate event type") : eventType.getName())%>" 147 106 maxlength="<%=BioPlateEventType.MAX_NAME_LENGTH%>"></td> … … 187 146 188 147 <base:buttongroup subclass="dialogbuttons"> 189 <base:button onclick="saveSettings()" title="Save" />190 <base:button onclick="window.close()" title="Cancel" />148 <base:button id="btnSave" title="Save" /> 149 <base:button id="close" title="Cancel" /> 191 150 </base:buttongroup> 192 151 </base:body> -
trunk/www/biomaterials/bioplates/bioplates.js
r6261 r6306 36 36 if (pageId == 'edit-page') 37 37 { 38 // TODO 38 Buttons.addClickHandler('btnSave', bioplates.save); 39 Buttons.addClickHandler('close', App.closeWindow); 40 41 // Tab validation 42 TabControl.addTabActivateListener('settings.annotations', Annotations.autoLoadEditFrame); 43 TabControl.addTabValidator('settings.info', bioplates.validateBioPlate); 44 45 // Plate geometry 46 if (Doc.element('plategeometry_id')) 47 { 48 Buttons.addClickHandler('plategeometry_id.select', bioplates.selectPlateGeometry); 49 Events.addEventHandler('plategeometry_id', 'base-selected', bioplates.setPlateGeometryCallback); 50 51 // Bioplate type 52 Buttons.addClickHandler('bioplatetype_id.select', bioplates.selectBioPlateType); 53 Events.addEventHandler('bioplatetype_id', 'base-selected', bioplates.setBioPlateTypeCallback); 54 Events.addEventHandler('bioplatetype_id', 'change', bioplates.bioPlateTypeOnChange); 55 bioplates.bioPlateTypeOnChange(); 56 } 57 58 // Storage location 59 Buttons.addClickHandler('storage_id.select', bioplates.selectStorageLocation); 60 Events.addEventHandler('storage_id', 'base-selected', bioplates.setStorageLocationCallback); 39 61 } 40 62 else if (pageId == 'view-page') … … 219 241 } 220 242 243 244 bioplates.validateBioPlate = function() 245 { 246 var frm = document.forms['bioplate']; 247 if (Main.trimString(frm.name.value) == '') 248 { 249 Forms.showNotification(frm.name, 'You must enter a name'); 250 return false; 251 } 252 if (frm.bioplatetype_id && frm.bioplatetype_id.length == 0) 253 { 254 Forms.showNotification('bioplatetype_id.select', 'You must select a bioplate type'); 255 return false; 256 } 257 if (frm.plategeometry_id && frm.plategeometry_id.length == 0) 258 { 259 Forms.showNotification('plategeometry_id.select', 'You must select a plate geometry'); 260 return false; 261 } 262 return true; 263 } 264 265 // Submit the form 266 bioplates.save = function() 267 { 268 var frm = document.forms['bioplate']; 269 if (TabControl.validateActiveTab('settings')) 270 { 271 Annotations.saveModifiedAnnotationsToForm(frm); 272 frm.submit(); 273 } 274 } 275 276 bioplates.selectPlateGeometry = function() 277 { 278 var frm = document.forms['bioplate']; 279 var url = ''; 280 if (frm.plategeometry_id.length > 0) 281 { 282 url += '&item_id='+frm.plategeometry_id[0].value; 283 } 284 Dialogs.selectItem('PLATEGEOMETRY', 'plategeometry_id', 0, url); 285 } 286 287 bioplates.setPlateGeometryCallback = function(event) 288 { 289 var frm = document.forms['bioplate']; 290 var list = frm.plategeometry_id; 291 if (list.length < 1 || list[0].disabled) 292 { 293 Forms.addListOption(list, 0, new Option()); 294 } 295 list[0].value = event.detail.id; 296 list[0].text = event.detail.name; 297 list.selectedIndex = 0; 298 } 299 300 bioplates.selectBioPlateType = function() 301 { 302 var frm = document.forms['bioplate']; 303 var url = ''; 304 if (frm.bioplatetype_id.length > 0) 305 { 306 url += '&item_id='+frm.bioplatetype_id[0].value; 307 } 308 Dialogs.selectItem('BIOPLATETYPE', 'bioplatetype_id', 0, url); 309 } 310 311 bioplates.setBioPlateTypeCallback = function(event) 312 { 313 314 var frm = document.forms['bioplate']; 315 var list = frm.bioplatetype_id; 316 if (list.length < 1 || list[0].disabled) 317 { 318 Forms.addListOption(list, 0, new Option()); 319 } 320 list[0].value = event.detail.id; 321 list[0].text = event.detail.name; 322 list.selectedIndex = 0; 323 bioplates.bioPlateTypeOnChange(); 324 } 325 326 bioplates.bioPlateTypeOnChange = function() 327 { 328 var frm = document.forms['bioplate']; 329 if (frm.bioplatetype_id.selectedIndex < 0) return; 330 331 var bioPlateTypeInfo = bioplates.getBioPlateTypeInfo(frm.bioplatetype_id.value); 332 var freezerTypeId = Data.get('storage_id', 'freezer-id'); 333 var storageTypeId = bioPlateTypeInfo.storageType ? bioPlateTypeInfo.storageType.id : freezerTypeId; 334 Data.set('storage_id', 'storage-type-id', storageTypeId); 335 var recentInfo = ItemSubtype.getProjectDefaultAndRecentItems('BIOPLATE', storageTypeId); 336 ItemSubtype.updateSelectionList(frm.storage_id, recentInfo['recent'], recentInfo['default']); 337 } 338 339 340 bioplates.getBioPlateTypeInfo = function(bioPlateTypeId) 341 { 342 var request = Ajax.getXmlHttpRequest(); 343 var url = '../bioplatetypes/ajax.jsp?ID=' + getSessionId(); 344 url += '&cmd=GetPlateTypeInfo'; 345 url += '&item_id='+bioPlateTypeId; 346 request.open("GET", url, false); 347 request.send(null); 348 return JSON.parse(request.responseText); 349 } 350 351 bioplates.selectStorageLocation = function() 352 { 353 var frm = document.forms['bioplate']; 354 var url = ''; 355 if (frm.storage_id.length > 1) 356 { 357 var id = Math.abs(parseInt(frm.storage_id[1].value)); 358 url += '&item_id='+id; 359 } 360 var storageTypeId = Data.get('storage_id', 'storage-type-id', Data.get('storage_id', 'freezer-id')); 361 url += '&resetTemporary=1&tmpfilter:INT:itemSubtype='+storageTypeId; 362 Dialogs.selectItem('HARDWARE', 'storage_id', 0, url); 363 } 364 365 bioplates.setStorageLocationCallback = function(event) 366 { 367 var frm = document.forms['bioplate']; 368 if (frm.storage_id.length < 1) 369 { 370 frm.storage_id[frm.storage_id.length] = new Option(); 371 } 372 frm.storage_id[0].value = event.detail.id; 373 frm.storage_id[0].text = event.detail.name; 374 frm.storage_id.selectedIndex = 0; 375 } 376 221 377 return bioplates; 222 378 }(); -
trunk/www/biomaterials/bioplates/edit_bioplate.jsp
r6297 r6306 125 125 { 126 126 bioplate = BioPlate.getById(dc, itemId); 127 bioplate.checkPermission(Permission.WRITE); 127 128 cc.setObject("item", bioplate); 128 129 title = "Edit bioplate -- " + HTML.encodeTags(bioplate.getName()); … … 153 154 readCurrentFreezer = false; 154 155 } 155 }156 if (bioplate != null && !bioplate.hasPermission(Permission.WRITE))157 {158 throw new PermissionDeniedException(Permission.WRITE, itemType.toString());159 156 } 160 157 … … 179 176 String htmlDateFormat = HTML.encodeTags(dateFormat); 180 177 181 182 178 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioplate); 183 179 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 184 180 %> 185 <base:page type="popup" title="<%=title%>" >186 <base:head scripts="tabcontrol .js,subtypes.js" styles="tabcontrol.css">181 <base:page type="popup" title="<%=title%>" id="edit-page"> 182 <base:head scripts="tabcontrol-2.js,subtypes.js,~bioplates.js" styles="tabcontrol.css"> 187 183 <ext:scripts context="<%=jspContext%>" /> 188 184 <ext:stylesheets context="<%=jspContext%>" /> 189 <script>190 // Validate the "BioPlate" tab191 function validateBioPlate()192 {193 var frm = document.forms['bioplate'];194 if (Main.trimString(frm.name.value) == '')195 {196 Forms.showNotification(frm.name, 'You must enter a name');197 return false;198 }199 if (frm.bioplatetype_id && frm.bioplatetype_id.length == 0)200 {201 Forms.showNotification('bioplatetype_id.select', 'You must select a bio plate type');202 return false;203 }204 if (frm.plategeometry_id && frm.plategeometry_id.length == 0)205 {206 Forms.showNotification('plategeometry_id.select', 'You must select a plate geometry');207 return false;208 }209 return true;210 }211 212 // Submit the form213 function saveSettings()214 {215 var frm = document.forms['bioplate'];216 if (TabControl.validateActiveTab('settings'))217 {218 Annotations.saveModifiedAnnotationsToForm(frm);219 frm.submit();220 }221 }222 223 function loadAnnotationsFrame()224 {225 Annotations.autoLoadEditFrame();226 }227 228 function selectPlateGeometryOnClick()229 {230 var frm = document.forms['bioplate'];231 var url = '../../lims/geometries/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setPlateGeometryCallback';232 if (frm.plategeometry_id.length > 0) url += '&item_id='+frm.plategeometry_id[0].value;233 Main.openPopup(url, 'SelectPlateGeometry', 1050, 700);234 }235 function setPlateGeometryCallback(plateGeometryId, name)236 {237 var frm = document.forms['bioplate'];238 var list = frm.plategeometry_id;239 if (list.length < 1 || list[0].disabled) // >240 {241 Forms.addListOption(list, 0, new Option());242 }243 list[0].value = plateGeometryId;244 list[0].text = name;245 list.selectedIndex = 0;246 }247 function selectBioPlateTypeOnClick()248 {249 var frm = document.forms['bioplate'];250 var url = '../bioplatetypes/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setBioPlateTypeCallback';251 if (frm.bioplatetype_id.length > 0) url += '&item_id='+frm.bioplatetype_id[0].value;252 Main.openPopup(url, 'SelectBioPlateType', 1050, 700);253 }254 function setBioPlateTypeCallback(bioPlateTypeId, name)255 {256 var frm = document.forms['bioplate'];257 var list = frm.bioplatetype_id;258 if (list.length < 1 || list[0].disabled) // >259 {260 Forms.addListOption(list, 0, new Option());261 }262 list[0].value = bioPlateTypeId;263 list[0].text = name;264 list.selectedIndex = 0;265 bioPlateTypeOnChange();266 }267 function bioPlateTypeOnChange()268 {269 var frm = document.forms['bioplate'];270 if (frm.bioplatetype_id.selectedIndex < 0) return;271 var bioPlateTypeInfo = getBioPlateTypeInfo(frm.bioplatetype_id[frm.bioplatetype_id.selectedIndex].value);272 var subtypeId = bioPlateTypeInfo.storageType ? bioPlateTypeInfo.storageType.id : <%=SystemItems.getId(Hardware.FREEZER)%>;273 var recentInfo = ItemSubtype.getProjectDefaultAndRecentItems('BIOPLATE', subtypeId);274 ItemSubtype.updateSelectionList(frm.freezer_id, recentInfo['recent'], recentInfo['default']);275 }276 277 function getBioPlateTypeInfo(bioPlateTypeId)278 {279 var request = Ajax.getXmlHttpRequest();280 var url = '../bioplatetypes/ajax.jsp?ID=' + getSessionId();281 url += '&cmd=GetPlateTypeInfo';282 url += '&item_id='+bioPlateTypeId;283 request.open("GET", url, false);284 request.send(null);285 return JSON.parse(request.responseText);286 }287 288 function selectFreezerOnClick()289 {290 var frm = document.forms['bioplate'];291 var url = '../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setFreezerCallback';292 if (frm.freezer_id.length > 1)293 {294 var id = Math.abs(parseInt(frm.freezer_id[1].value));295 url += '&item_id='+id;296 }297 url += '&resetTemporary=1&tmpfilter:INT:itemSubtype=<%=SystemItems.getId(Hardware.FREEZER)%>';298 Main.openPopup(url, 'SelectFreezer', 1050, 700);299 }300 function setFreezerCallback(freezerId, name)301 {302 var frm = document.forms['bioplate'];303 if (frm.freezer_id.length < 1) // >304 {305 frm.freezer_id[frm.freezer_id.length] = new Option();306 }307 frm.freezer_id[0].value = freezerId;308 frm.freezer_id[0].text = name;309 frm.freezer_id.selectedIndex = 0;310 }311 312 function init()313 {314 var frm = document.forms['bioplate'];315 <%316 if (bioplate == null)317 {318 %>319 frm.name.focus();320 frm.name.select();321 bioPlateTypeOnChange();322 <%323 }324 %>325 }326 </script>327 185 </base:head> 328 <base:body onload="init()">186 <base:body> 329 187 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 330 188 … … 336 194 position="bottom" remember="<%=bioplate != null%>" 337 195 extensions="<%=invoker%>"> 338 <t:tab id="info" title="Plate" validate="validateBioPlate()"helpid="bioplate.edit">196 <t:tab id="info" title="Plate" helpid="bioplate.edit"> 339 197 <table class="fullform input100"> 340 198 <tr> 341 199 <th>Name</th> 342 <td><input class="text required" type="text" name="name" 200 <td><input class="text required auto-init" data-auto-init="<%=bioplate == null ? "focus-select" : "focus" %>" 201 type="text" name="name" 343 202 value="<%=HTML.encodeTags(bioplate == null ? Values.getString(cc.getPropertyValue("name"), "New bioplate") : bioplate.getName())%>" 344 203 maxlength="<%=BioPlate.MAX_NAME_LENGTH%>"></td> … … 396 255 recent="<%=recentPlateGeometry%>" 397 256 newitem="true" 398 onselect="selectPlateGeometryOnClick()"399 257 /> 400 258 <% … … 408 266 <td> 409 267 <base:select 410 id=" freezer_id"268 id="storage_id" 411 269 clazz="selectionlist" 412 270 required="false" 271 data-freezer-id="<%=SystemItems.getId(Hardware.FREEZER)%>" 272 data-storage-type-id="<%=currentStorageType == null ? "" : currentStorageType.getId() %>" 413 273 current="<%=currentFreezer%>" 414 274 denied="<%=!readCurrentFreezer%>" … … 416 276 defaultitems="<%=defaultFreezers %>" 417 277 newitem="<%=bioplate == null%>" 418 onselect="selectFreezerOnClick()"419 onchange="freezerOnChange()"420 278 /> 421 279 </td> … … 494 352 </t:tab> 495 353 496 <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">354 <t:tab id="annotations" title="Annotations" helpid="annotations.edit"> 497 355 <jsp:include page="../../common/annotations/annotate_frameset.jsp"> 498 356 <jsp:param name="item_type" value="<%=itemType.name()%>" /> 499 357 <jsp:param name="item_id" value="<%=itemId%>" /> 500 358 <jsp:param name="ID" value="<%=ID%>" /> 501 </jsp:include> 359 </jsp:include> 360 </t:tab> 502 361 503 </t:tab>504 362 </t:tabcontrol> 505 363 </form> … … 513 371 514 372 <base:buttongroup subclass="dialogbuttons"> 515 <base:button onclick="saveSettings()" title="Save" />516 <base:button onclick="window.close()" title="Cancel" />373 <base:button id="btnSave" title="Save" /> 374 <base:button id="close" title="Cancel" /> 517 375 </base:buttongroup> 518 376 </base:body> -
trunk/www/biomaterials/bioplates/events/edit_event.jsp
r6217 r6306 101 101 } 102 102 103 104 105 103 final Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 106 104 final String dateFormat = FormatterSettings.getDateFormat(sc); … … 111 109 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 112 110 %> 113 <base:page type="popup" title="<%=title%>" >114 <base:head scripts="tabcontrol .js,annotations.js" styles="tabcontrol.css">111 <base:page type="popup" title="<%=title%>" id="edit-page"> 112 <base:head scripts="tabcontrol-2.js,~events.js" styles="tabcontrol.css"> 115 113 <ext:scripts context="<%=jspContext%>" /> 116 114 <ext:stylesheets context="<%=jspContext%>" /> 117 <script>118 // Validate the "BioPlateEvent" tab119 function validateBioPlateEvent()120 {121 var frm = document.forms['event'];122 if (Main.trimString(frm.name.value) == '')123 {124 Forms.showNotification(frm.name, 'You must enter a name');125 return false;126 }127 return true;128 }129 130 // Submit the form131 function saveSettings()132 {133 var frm = document.forms['event'];134 if (TabControl.validateActiveTab('settings'))135 {136 frm.submit();137 }138 }139 140 function selectHardwareOnClick()141 {142 var frm = document.forms['event'];143 var url = '../../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setHardwareCallback';144 if (frm.hardware_id.length > 1)145 {146 var id = Math.abs(parseInt(frm.hardware_id[1].value));147 url += '&item_id='+id;148 }149 url += '&resetTemporary=1';150 Main.openPopup(url, 'SelectHardware', 1050, 700);151 }152 function setHardwareCallback(id, name)153 {154 var frm = document.forms['event'];155 var list = frm.hardware_id;156 if (list.length < 2 || list[1].value == '0') // >157 {158 Forms.addListOption(list, 1, new Option());159 }160 list[1].value = id;161 list[1].text = name;162 list.selectedIndex = 1;163 }164 165 function selectProtocolOnClick()166 {167 var frm = document.forms['event'];168 var url = '../../../admin/protocols/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setProtocolCallback';169 if (frm.protocol_id.length > 1)170 {171 var id = Math.abs(parseInt(frm.protocol_id[1].value));172 url += '&item_id='+id;173 }174 url += '&resetTemporary=1';175 Main.openPopup(url, 'SelectProtocol', 1050, 700);176 }177 function setProtocolCallback(id, name)178 {179 var frm = document.forms['event'];180 var list = frm.protocol_id;181 if (list.length < 2 || list[1].value == '0') // >182 {183 Forms.addListOption(list, 1, new Option());184 }185 list[1].value = id;186 list[1].text = name;187 list.selectedIndex = 1;188 }189 190 191 function init()192 {193 }194 </script>195 115 </base:head> 196 <base:body onload="init()">116 <base:body> 197 117 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 198 118 <form action="index.jsp?ID=<%=ID%>" method="post" name="event"> … … 203 123 position="bottom" remember="<%=event != null%>" 204 124 extensions="<%=invoker%>"> 205 <t:tab id="info" title="Bioplate event" validate="validateBioPlateEvent()"helpid="bioplateevent.edit">125 <t:tab id="info" title="Bioplate event" helpid="bioplateevent.edit"> 206 126 <table class="fullform input100"> 207 127 <tr> 208 128 <th>Name</th> 209 <td><input class="text required" type="text" name="name" 129 <td><input class="text required auto-init" data-auto-init="<%=event == null ? "focus-select" : "focus" %>" 130 type="text" name="name" 210 131 value="<%=HTML.encodeTags(event.getName())%>" 211 132 maxlength="<%=BioPlateEvent.MAX_NAME_LENGTH%>"></td> … … 240 161 denied="<%=!readCurrentProtocol%>" 241 162 recent="<%=recentProtocols%>" 242 onselect="selectProtocolOnClick()"243 163 /> 244 164 </td> … … 255 175 denied="<%=!readCurrentHardware%>" 256 176 recent="<%=recentHardware%>" 257 onselect="selectHardwareOnClick()"258 177 /> 259 178 </td> … … 280 199 281 200 <base:buttongroup subclass="dialogbuttons"> 282 <base:button onclick="saveSettings()" title="Save" />283 <base:button onclick="window.close()" title="Cancel" />201 <base:button id="btnSave" title="Save" /> 202 <base:button id="close" title="Cancel" /> 284 203 </base:buttongroup> 285 204 </base:body> -
trunk/www/biomaterials/bioplates/events/events.js
r6261 r6306 35 35 if (pageId == 'edit-page') 36 36 { 37 // TODO 37 Buttons.addClickHandler('btnSave', plateevents.save); 38 Buttons.addClickHandler('close', App.closeWindow); 39 40 // Tab validation 41 TabControl.addTabValidator('settings.info', plateevents.validateBioPlateEvent); 42 43 // Hardware 44 Buttons.addClickHandler('hardware_id.select', plateevents.selectHardware); 45 Events.addEventHandler('hardware_id', 'base-selected', plateevents.setHardwareCallback); 46 47 // Protocol 48 Buttons.addClickHandler('protocol_id.select', plateevents.selectProtocol); 49 Events.addEventHandler('protocol_id', 'base-selected', plateevents.setProtocolCallback); 38 50 } 39 51 else if (pageId == 'view-page') … … 95 107 } 96 108 109 110 plateevents.validateBioPlateEvent = function() 111 { 112 var frm = document.forms['event']; 113 if (Main.trimString(frm.name.value) == '') 114 { 115 Forms.showNotification(frm.name, 'You must enter a name'); 116 return false; 117 } 118 return true; 119 } 120 121 // Submit the form 122 plateevents.save = function() 123 { 124 var frm = document.forms['event']; 125 if (TabControl.validateActiveTab('settings')) 126 { 127 frm.submit(); 128 } 129 } 130 131 plateevents.selectHardware = function() 132 { 133 var frm = document.forms['event']; 134 url = '&resetTemporary=1'; 135 if (frm.hardware_id.length > 1) 136 { 137 var id = Math.abs(parseInt(frm.hardware_id[1].value)); 138 url += '&item_id='+id; 139 } 140 Dialogs.selectItem('HARDWARE', 'hardware_id', 0, url); 141 } 142 143 plateevents.setHardwareCallback = function(event) 144 { 145 var frm = document.forms['event']; 146 var list = frm.hardware_id; 147 if (list.length < 2 || list[1].value == '0') 148 { 149 Forms.addListOption(list, 1, new Option()); 150 } 151 list[1].value = event.detail.id; 152 list[1].text = event.detail.name; 153 list.selectedIndex = 1; 154 } 155 156 plateevents.selectProtocol = function() 157 { 158 var frm = document.forms['event']; 159 url = '&resetTemporary=1'; 160 if (frm.protocol_id.length > 1) 161 { 162 var id = Math.abs(parseInt(frm.protocol_id[1].value)); 163 url += '&item_id='+id; 164 } 165 Dialogs.selectItem('PROTOCOL', 'protocol_id', 0, url); 166 } 167 168 plateevents.setProtocolCallback = function(event) 169 { 170 var frm = document.forms['event']; 171 var list = frm.protocol_id; 172 if (list.length < 2 || list[1].value == '0') 173 { 174 Forms.addListOption(list, 1, new Option()); 175 } 176 list[1].value = event.detail.id; 177 list[1].text = event.detail.name; 178 list.selectedIndex = 1; 179 } 180 181 97 182 return plateevents; 98 183 }(); -
trunk/www/biomaterials/bioplates/events/view_event.jsp
r6261 r6306 128 128 <ext:scripts context="<%=jspContext%>" /> 129 129 <ext:stylesheets context="<%=jspContext%>" /> 130 <script>131 function editItem()132 {133 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);134 }135 function shareItem()136 {137 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareEvent', 600, 400);138 }139 function deleteItem()140 {141 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>&bioplate_id=<%=bioPlateId%>');142 }143 function restoreItem()144 {145 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>&bioplate_id=<%=bioPlateId%>');146 }147 function deleteItemPermanently()148 {149 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');150 }151 function itemDeleted()152 {153 Main.listItems('<%=ID%>', '<%=itemType.name()%>', '&bioplate_id=<%=bioPlateId%>');154 }155 function showUsingItems()156 {157 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);158 }159 function setOwner()160 {161 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 300);162 }163 function runPlugin(cmd)164 {165 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);166 }167 </script>168 130 </base:head> 169 131 <base:body> … … 214 176 id="btnUsingItems" 215 177 image="used.png" 216 onclick="showUsingItems()"217 178 tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" 218 179 visible="<%=isRemoved && isUsed%>" /> -
trunk/www/biomaterials/bioplates/index.jsp
r6192 r6306 161 161 bioPlate.setBarcode(Values.getStringOrNull(request.getParameter("barcode"))); 162 162 bioPlate.setDestroyed(Values.getBoolean(request.getParameter("destroyed"))); 163 int freezerId = Values.getInt(request.getParameter("freezer_id"));164 if ( freezerId >= 0)163 int storageId = Values.getInt(request.getParameter("storage_id")); 164 if (storageId >= 0) 165 165 { 166 Hardware fz = freezerId == 0 ? null : Hardware.getById(dc, freezerId);166 Hardware fz = storageId == 0 ? null : Hardware.getById(dc, storageId); 167 167 bioPlate.setFreezer(fz); 168 168 if (fz != null) cc.setRecent(fz, fz.getItemSubtype(), maxRecent); -
trunk/www/biomaterials/bioplates/wells/biowells.js
r6260 r6306 35 35 if (pageId == 'edit-page') 36 36 { 37 // TODO 38 } 39 else if (pageId == 'view-page') 40 { 41 // TODO 37 Buttons.addClickHandler('btnSave', biowells.save); 38 Buttons.addClickHandler('close', App.closeWindow); 39 40 // Biomaterial type 41 Events.addEventHandler('biomaterial_type', 'change', biowells.bioMaterialTypeOnChange); 42 43 // Biomaterial 44 Buttons.addClickHandler('biomaterial_id.select', biowells.selectBioMaterial); 45 Events.addEventHandler('biomaterial_id', 'base-selected', biowells.setBioMaterialCallback); 42 46 } 43 47 else if (pageId == 'list-page') … … 80 84 } 81 85 86 biowells.validateBioWell = function() 87 { 88 return true; 89 } 90 91 biowells.save = function() 92 { 93 var frm = document.forms['biowell']; 94 if (biowells.validateBioWell()) 95 { 96 frm.biomaterial_type.disabled = false; 97 frm.submit(); 98 } 99 } 100 101 biowells.bioMaterialTypeOnChange = function() 102 { 103 var frm = document.forms['biowell']; 104 var list = frm.biomaterial_id; 105 list.selectedIndex = 0; 106 list.remove(1); 107 } 108 109 biowells.selectBioMaterial = function() 110 { 111 var frm = document.forms['biowell']; 112 var type = frm.biomaterial_type.value; 113 if (!type) 114 { 115 Forms.showNotification(frm.biomaterial_type, 'You must first select what type of biomaterial'); 116 return; 117 } 118 var url = ''; 119 if (frm.biomaterial_id.length > 1) 120 { 121 var id = Math.abs(parseInt(frm.biomaterial_id[1].value)); 122 url += '&item_id='+id; 123 } 124 url += '&resetTemporary=1&tmpfilter:STRING:bioWell='+escape('='); 125 var bioMaterialSubtype = Data.get('biomaterial_id', 'biomaterial-subtype'); 126 if (bioMaterialSubtype) 127 { 128 url += '&tmpfilter:INT:itemSubtype='+bioMaterialSubtype; 129 } 130 Dialogs.selectItem(type, 'biomaterial_id', 0, url); 131 } 132 133 biowells.setBioMaterialCallback = function(event) 134 { 135 var frm = document.forms['biowell']; 136 var list = frm.biomaterial_id; 137 if (list.length < 2 || list[1].value == '0') 138 { 139 Forms.addListOption(list, 1, new Option()); 140 } 141 list[1].value = event.detail.id; 142 list[1].text = event.detail.name; 143 list.selectedIndex = 1; 144 } 145 146 82 147 return biowells; 83 148 }(); -
trunk/www/biomaterials/bioplates/wells/edit_biowell.jsp
r6217 r6306 73 73 title = "Edit biowell -- " + rowFormatter.format(bioWell.getRow()) + columnFormatter.format(bioWell.getColumn()) + " on " + HTML.encodeTags(bioPlate.getName()); 74 74 75 76 77 78 75 boolean readCurrentBioMaterial = true; 79 76 MeasuredBioMaterial currentBioMaterial = null; … … 92 89 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 93 90 %> 94 <base:page type="popup" title="<%=title%>" >95 <base:head scripts=" tabcontrol.js" styles="tabcontrol.css">91 <base:page type="popup" title="<%=title%>" id="edit-page"> 92 <base:head scripts="~biowells.js" styles="tabcontrol.css"> 96 93 <ext:scripts context="<%=jspContext%>" /> 97 94 <ext:stylesheets context="<%=jspContext%>" /> 98 <script>99 // Validate the "BioWell" tab100 function validateBioWell()101 {102 return true;103 }104 105 // Submit the form106 function saveSettings()107 {108 var frm = document.forms['biowell'];109 if (validateBioWell())110 {111 frm.biomaterial_type.disabled = false;112 frm.submit();113 }114 }115 116 // Biomaterial selection117 function selectBioMaterialOnClick()118 {119 var frm = document.forms['biowell'];120 var typelist = frm.biomaterial_type;121 if (typelist.selectedIndex == 0)122 {123 Forms.showNotification(frm.biomaterial_type, 'You must first select what type of biomaterial');124 return;125 }126 var type = typelist[typelist.selectedIndex].value;127 var folder = type.toLowerCase();128 var controller = Main.getController(type);129 var url = getRoot() + controller.url + '?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setBioMaterialCallback';130 if (frm.biomaterial_id.length > 1)131 {132 var id = Math.abs(parseInt(frm.biomaterial_id[1].value));133 url += '&item_id='+id;134 }135 url += '&resetTemporary=1&tmpfilter:STRING:bioWell='+escape('=');136 <%137 if (bioMaterialSubType != null)138 {139 %>140 url += '&tmpfilter:INT:itemSubtype=<%=bioMaterialSubType.getId()%>';141 <%142 }143 %>144 Main.openPopup(url, 'Select'+type, 1050, 700);145 }146 function setBioMaterialCallback(id, name)147 {148 var frm = document.forms['biowell'];149 var list = frm.biomaterial_id;150 if (list.length < 2 || list[1].value == '0') // >151 {152 Forms.addListOption(list, 1, new Option());153 }154 list[1].value = id;155 list[1].text = name;156 list.selectedIndex = 1;157 }158 function bioMaterialTypeOnChange()159 {160 var frm = document.forms['biowell'];161 var list = frm.biomaterial_id;162 list.selectedIndex = 0;163 list.remove(1);164 }165 </script>166 95 </base:head> 167 96 <base:body> … … 184 113 <th>Biomaterial type</th> 185 114 <td> 186 <select name="biomaterial_type" onchange="bioMaterialTypeOnChange()"<%=bioMaterialType != null ? "disabled": ""%>>115 <select name="biomaterial_type" <%=bioMaterialType != null ? "disabled": ""%>> 187 116 <% 188 117 if (!readCurrentBioMaterial) … … 219 148 recent="<%=null%>" 220 149 newitem="<%=false%>" 221 onselect="<%=canAddBioMaterial ? "selectBioMaterialOnClick()" : null%>"150 data-biomaterial-subtype="<%=bioMaterialSubType == null ? "" : bioMaterialSubType.getId() %>" 222 151 /> 223 152 </td> … … 248 177 249 178 <base:buttongroup subclass="dialogbuttons"> 250 <base:button onclick="saveSettings()" title="Save" />251 <base:button onclick="window.close()" title="Cancel" />179 <base:button id="btnSave" title="Save" /> 180 <base:button id="close" title="Cancel" /> 252 181 </base:buttongroup> 253 182 </base:body> -
trunk/www/biomaterials/bioplatetypes/bioplatetypes.js
r6261 r6306 26 26 { 27 27 var bioplatetypes = {}; 28 var subtypes; 28 29 29 30 /** … … 35 36 if (pageId == 'edit-page') 36 37 { 37 // TODO 38 // Save + Close buttons 39 Buttons.addClickHandler('btnSave', bioplatetypes.save); 40 Buttons.addClickHandler('close', App.closeWindow); 41 42 // Tab validation 43 TabControl.addTabValidator('settings.info', bioplatetypes.validateBioPlateType); 44 45 // Biomaterial type 46 subtypes = Data.json('page-data', 'subtypes'); 47 Events.addEventHandler('bioMaterialType', 'change', bioplatetypes.bioMaterialTypeOnChange); 48 bioplatetypes.bioMaterialTypeOnChange(); 38 49 } 39 50 else if (pageId == 'view-page') … … 67 78 } 68 79 80 bioplatetypes.validateBioPlateType = function() 81 { 82 var frm = document.forms['bioPlateType']; 83 if (Main.trimString(frm.name.value) == '') 84 { 85 Forms.showNotification(frm.name, 'You must enter a name'); 86 return false; 87 } 88 return true; 89 } 90 91 // Submit the form 92 bioplatetypes.save = function() 93 { 94 var frm = document.forms['bioPlateType']; 95 if (TabControl.validateActiveTab('settings')) 96 { 97 frm.submit(); 98 } 99 } 100 101 bioplatetypes.bioMaterialTypeOnChange = function() 102 { 103 var frm = document.forms['bioPlateType']; 104 var bmType = frm.bioMaterialType ? frm.bioMaterialType.value : Data.get('page-data', 'current-bm-type'); 105 106 var currentSubtypeId = Data.int('page-data', 'current-subtype'); 107 frm.subtype_id.length = 0; 108 frm.subtype_id[0] = new Option('-any-', 0); 109 110 for (var i = 0; i < subtypes.length; i++) 111 { 112 var subtype = subtypes[i]; 113 if (subtype.bmType == bmType) 114 { 115 var opt = new Option(subtype.name, subtype.id, currentSubtypeId == subtype.id); 116 if (subtype.description) opt.title = subtype.description; 117 frm.subtype_id[frm.subtype_id.length] = opt; 118 } 119 } 120 } 121 122 69 123 return bioplatetypes; 70 124 }(); -
trunk/www/biomaterials/bioplatetypes/edit_platetype.jsp
r6217 r6306 24 24 @version 2.0 25 25 --%> 26 <%@page import="org.json.simple.JSONObject"%> 27 <%@page import="org.json.simple.JSONArray"%> 26 28 <%@ page pageEncoding="UTF-8" session="false" 27 29 import="net.sf.basedb.core.SessionControl" … … 122 124 } 123 125 126 JSONArray jsonSubtypes = new JSONArray(); 127 if (subtypesQuery != null) 128 { 129 for (ItemSubtype subtype : subtypesQuery.list(dc)) 130 { 131 JSONObject jsonSubtype = new JSONObject(); 132 jsonSubtype.put("id", subtype.getId()); 133 jsonSubtype.put("name", subtype.getName()); 134 jsonSubtype.put("description", subtype.getDescription()); 135 jsonSubtype.put("bmType", subtype.getMainItemType().name()); 136 jsonSubtypes.add(jsonSubtype); 137 } 138 } 124 139 125 140 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioPlateType); 126 141 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 127 128 142 %> 129 <base:page type="popup" title="<%=title%>" >130 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">143 <base:page type="popup" title="<%=title%>" id="edit-page"> 144 <base:head scripts="tabcontrol-2.js,~bioplatetypes.js" styles="tabcontrol.css"> 131 145 <ext:scripts context="<%=jspContext%>" /> 132 146 <ext:stylesheets context="<%=jspContext%>" /> 133 <script>134 // Validate the "BioPlateType" tab135 function validateBioPlateType()136 {137 var frm = document.forms['bioPlateType'];138 if (Main.trimString(frm.name.value) == '')139 {140 Forms.showNotification(frm.name, 'You must enter a name');141 return false;142 }143 return true;144 }145 146 // Submit the form147 function saveSettings()148 {149 var frm = document.forms['bioPlateType'];150 if (TabControl.validateActiveTab('settings'))151 {152 frm.submit();153 }154 }155 156 function init()157 {158 var frm = document.forms['bioPlateType'];159 <%160 if (bioPlateType == null)161 {162 %>163 frm.name.focus();164 frm.name.select();165 bioMaterialTypeOnChange();166 <%167 }168 %>169 }170 171 var subtypeOptions = null;172 function bioMaterialTypeOnChange()173 {174 var frm = document.forms['bioPlateType'];175 if (subtypeOptions == null)176 {177 // Cache all options in the list178 subtypeOptions = new Array();179 for (var i = 1; i < frm.subtype_id.length; i++)180 {181 var opt = frm.subtype_id[i];182 subtypeOptions[subtypeOptions.length] = frm.subtype_id[i];183 }184 }185 186 var bmType = frm.bioMaterialType[frm.bioMaterialType.selectedIndex].value;187 188 frm.subtype_id.selectedIndex = 0;189 if (bmType == '')190 {191 frm.subtype_id.disabled = true;192 }193 else194 {195 frm.subtype_id.disabled = false;196 // Clean the list...197 frm.subtype_id.length = 1;198 // ...and re-populate from the cache199 for (var i = 0; i < subtypeOptions.length; i++)200 {201 if (subtypeOptions[i].attributes['data-bmtype'].value == bmType)202 {203 frm.subtype_id[frm.subtype_id.length] = subtypeOptions[i];204 }205 }206 }207 }208 </script>209 147 </base:head> 210 <base:body onload="init()">148 <base:body> 211 149 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 212 150 <form action="index.jsp?ID=<%=ID%>" method="post" name="bioPlateType"> 213 151 <input type="hidden" name="cmd" value="UpdateItem"> 214 152 153 <div id="page-data" class="datacontainer" 154 data-subtypes="<%=HTML.encodeTags(jsonSubtypes.toJSONString())%>" 155 data-current-subtype="<%=currentSubtype == null ? 0 : currentSubtype.getId() %>" 156 data-current-bm-type="<%=bioPlateType == null ? "" : bioPlateType.getBioMaterialType().name() %>" 157 ></div> 158 215 159 <t:tabcontrol id="settings" 216 160 subclass="content dialogtabcontrol" 217 161 position="bottom" remember="<%=bioPlateType != null%>" 218 162 extensions="<%=invoker%>"> 219 <t:tab id="info" title="Bioplate type" validate="validateBioPlateType()"helpid="bioplatetype.edit">163 <t:tab id="info" title="Bioplate type" helpid="bioplatetype.edit"> 220 164 <table class="fullform input100"> 221 165 <tr> 222 166 <th>Name</th> 223 <td><input class="text required" type="text" name="name" 167 <td><input class="text required auto-init" data-auto-init="<%=bioPlateType == null ? "focus-select" : "focus" %>" 168 type="text" name="name" 224 169 value="<%=HTML.encodeTags(bioPlateType == null ? Values.getString(cc.getPropertyValue("name"), "New bioplate type") : bioPlateType.getName())%>" 225 170 maxlength="<%=BioPlateType.MAX_NAME_LENGTH%>"></td> … … 233 178 %> 234 179 <td> 235 <select name="bioMaterialType" class="required unchangeable" onchange="bioMaterialTypeOnChange()">180 <select name="bioMaterialType" id="bioMaterialType" class="required unchangeable"> 236 181 <option value="">- any - 237 182 <option value="<%=Item.SAMPLE.name()%>">Sample … … 257 202 <th>Biomaterial subtype</th> 258 203 <td> 259 <select name="subtype_id" 260 <%=!readCurrentSubtype ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%> 261 onchange="subtypeOnChange()" 262 > 204 <select name="subtype_id" id="subtype_id" 205 <%=!readCurrentSubtype ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%>> 263 206 <% 264 207 if (!readCurrentSubtype) … … 267 210 <option value="-1">- denied - 268 211 <% 269 }270 else271 {272 %>273 <option value="0">-any-274 <%275 int currentSubtypeId = currentSubtype == null ? 0 : currentSubtype.getId();276 for (ItemSubtype subtype : subtypesQuery.list(dc))277 {278 int id = subtype.getId();279 if (id != currentSubtypeId && subtype.isRemoved()) continue;280 %>281 <option value="<%=id == currentSubtypeId && bioPlateType != null ? -id : id%>"282 <%=id == currentSubtypeId ? "selected" : ""%>283 title="<%=HTML.encodeTags(subtype.getDescription()) %>"284 data-bmtype="<%=subtype.getMainItemType().name() %>"285 ><%=HTML.encodeTags(subtype.getName())%>286 <%287 }288 212 } 289 213 %> … … 298 222 <th>Storage type</th> 299 223 <td> 300 <select name="storagetype_id" 301 <%=!readCurrentStorageType ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%> 302 onchange="storageTypeOnChange()" 303 > 224 <select name="storagetype_id" id="storeagetype_id" 225 <%=!readCurrentStorageType ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%>> 304 226 <% 305 227 if (!readCurrentStorageType) … … 372 294 373 295 <base:buttongroup subclass="dialogbuttons"> 374 <base:button onclick="saveSettings()" title="Save" />375 <base:button onclick="window.close()" title="Cancel" />296 <base:button id="btnSave" title="Save" /> 297 <base:button id="close" title="Cancel" /> 376 298 </base:buttongroup> 377 299 </base:body> -
trunk/www/biomaterials/biosources/biosources.js
r6297 r6306 26 26 { 27 27 var biosources = {}; 28 var annotationsLoaded = false;29 28 30 29 /** -
trunk/www/biomaterials/events/edit_event.jsp
r6217 r6306 84 84 { 85 85 event = BioMaterialEvent.getById(dc, itemId); 86 event.checkPermission(Permission.WRITE); 86 87 eventDate = event.getEventDate(); 87 88 title = "Edit event"; … … 97 98 } 98 99 } 99 if (event != null && !event.hasPermission(Permission.WRITE))100 {101 throw new PermissionDeniedException(Permission.WRITE, itemType.toString());102 }103 104 100 105 101 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); … … 110 106 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 111 107 %> 112 <base:page type="popup" title="<%=title%>" >113 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">108 <base:page type="popup" title="<%=title%>" id="edit-page"> 109 <base:head scripts="tabcontrol-2.js,~events.js" styles="tabcontrol.css"> 114 110 <ext:scripts context="<%=jspContext%>" /> 115 111 <ext:stylesheets context="<%=jspContext%>" /> 116 <script>117 // Validate the "Event" tab118 function validateEvent()119 {120 var frm = document.forms['event'];121 return true;122 }123 124 // Submit the form125 function saveSettings()126 {127 var frm = document.forms['event'];128 if (TabControl.validateActiveTab('settings'))129 {130 frm.submit();131 }132 }133 134 function selectProtocolOnClick()135 {136 var frm = document.forms['event'];137 var url = '../../admin/protocols/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setProtocolCallback';138 if (frm.protocol_id.length > 1)139 {140 var id = Math.abs(parseInt(frm.protocol_id[1].value));141 url += '&item_id='+id;142 }143 Main.openPopup(url, 'SelectProtocol', 1050, 700);144 }145 function setProtocolCallback(id, name)146 {147 var frm = document.forms['event'];148 var list = frm.protocol_id;149 if (list.length < 2 || list[1].value == '0') // >150 {151 Forms.addListOption(list, 1, new Option());152 }153 list[1].value = id;154 list[1].text = name;155 list.selectedIndex = 1;156 }157 158 function init()159 {160 <%161 if (event == null)162 {163 %>164 var frm = document.forms['event'];165 frm.event_date.focus();166 frm.event_date.select();167 <%168 }169 %>170 }171 </script>172 112 </base:head> 173 <base:body onload="init()">113 <base:body> 174 114 <h1><%=title%></h1> 175 115 <form action="index.jsp?ID=<%=ID%>" method="post" name="event"> … … 182 122 position="bottom" remember="<%=event != null%>" 183 123 extensions="<%=invoker%>"> 184 <t:tab id="info" title="Event" validate="validateEvent()">124 <t:tab id="info" title="Event"> 185 125 <table class="fullform input100"> 186 126 <tr> … … 190 130 <tr> 191 131 <td> 192 <input class="text" style="width: 15em;" type="text" name="event_date" id="event_date" 132 <input class="text auto-init" data-auto-init="<%=event == null ? "focus-select" : "focus" %>" 133 style="width: 15em;" type="text" name="event_date" id="event_date" 193 134 value="<%=HTML.encodeTags(dateFormatter.format(eventDate == null ? new Date() : eventDate))%>" 194 135 maxlength="20" title="Enter date in format: <%=htmlDateFormat%>"> … … 206 147 <th>Used quantity</th> 207 148 <td><input class="text" style="width: 15em;" type="text" name="used_quantity" 149 id="usedQuantity" 208 150 value="<%=Values.formatNumber(event == null ? null : event.getUsedQuantity(), -1)%>" 209 maxlength="10" onkeypress="return Numbers.numberOnly(event)"> (µg)</td>151 maxlength="10"> (µg)</td> 210 152 <td></td> 211 153 </tr> … … 221 163 recent="<%=recentProtocols%>" 222 164 newitem="<%=event == null%>" 223 onselect="selectProtocolOnClick()"224 165 /> 225 166 </td> … … 242 183 243 184 <base:buttongroup subclass="dialogbuttons"> 244 <base:button onclick="saveSettings()" title="Save" />245 <base:button onclick="window.close()" title="Cancel" />185 <base:button id="btnSave" title="Save" /> 186 <base:button id="close" title="Cancel" /> 246 187 </base:buttongroup> 247 188 </base:body> -
trunk/www/biomaterials/events/events.js
r6261 r6306 35 35 if (pageId == 'edit-page') 36 36 { 37 // TODO 37 // Save + Close buttons 38 Buttons.addClickHandler('btnSave', biomaterialevents.save); 39 Buttons.addClickHandler('close', App.closeWindow); 40 41 // Tab validation 42 TabControl.addTabValidator('settings.info', biomaterialevents.validateEvent); 43 44 // Protocol 45 Buttons.addClickHandler('protocol_id.select', biomaterialevents.selectProtocol); 46 Events.addEventHandler('protocol_id', 'base-selected', biomaterialevents.setProtocolCallback); 47 48 // Used quantity 49 Events.addEventHandler('usedQuantity', 'keypress', Events.numberOnly); 38 50 } 39 51 else if (pageId == 'view-page') … … 80 92 } 81 93 94 biomaterialevents.validateEvent = function() 95 { 96 var frm = document.forms['event']; 97 return true; 98 } 99 100 // Submit the form 101 biomaterialevents.save = function() 102 { 103 var frm = document.forms['event']; 104 if (TabControl.validateActiveTab('settings')) 105 { 106 frm.submit(); 107 } 108 } 109 110 biomaterialevents.selectProtocol = function() 111 { 112 var frm = document.forms['event']; 113 var url = ''; 114 if (frm.protocol_id.length > 1) 115 { 116 var id = Math.abs(parseInt(frm.protocol_id[1].value)); 117 url += '&item_id='+id; 118 } 119 Dialogs.selectItem('PROTOCOL', 'protocol_id', 0, url); 120 } 121 122 biomaterialevents.setProtocolCallback = function(event) 123 { 124 var id = event.detail.id; 125 var name = event.detail.name; 126 var frm = document.forms['event']; 127 var list = frm.protocol_id; 128 if (list.length < 2 || list[1].value == '0') 129 { 130 Forms.addListOption(list, 1, new Option()); 131 } 132 list[1].value = id; 133 list[1].text = name; 134 list.selectedIndex = 1; 135 } 136 137 82 138 return biomaterialevents; 83 139 }(); -
trunk/www/biomaterials/events/view_event.jsp
r6268 r6306 139 139 <ext:scripts context="<%=jspContext%>" /> 140 140 <ext:stylesheets context="<%=jspContext%>" /> 141 <script>142 function editItem()143 {144 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true, '&biomaterial_type=<%=bioMaterialType.name()%>&biomaterial_id=<%=bioMaterial.getId()%>');145 }146 function deleteItem()147 {148 if (confirm('This can\'t be undone. Continue?'))149 {150 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&&biomaterial_id=<%=bioMaterialId%>&biomaterial_type=<%=bioMaterialType.name()%>&item_id=<%=itemId%>');151 }152 }153 function runPlugin(cmd)154 {155 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&biomaterial_id=<%=bioMaterialId%>&biomaterial_type=<%=bioMaterialType.name()%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);156 }157 </script>158 141 </base:head> 159 142 <base:body> -
trunk/www/biomaterials/lists/edit_list.jsp
r6217 r6306 94 94 { 95 95 list = BioMaterialList.getById(dc, itemId); 96 list.checkPermission(Permission.WRITE); 96 97 memberType = list.getMemberType(); 97 98 cc.setObject("item", list); 98 99 title = "Edit biomaterial list -- " + HTML.encodeTags(list.getName()); 99 list.checkPermission(Permission.WRITE);100 100 } 101 102 103 101 104 102 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), list); 105 103 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 106 104 %> 107 <base:page type="popup" title="<%=title%>" >108 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">105 <base:page type="popup" title="<%=title%>" id="edit-page"> 106 <base:head scripts="tabcontrol-2.js,~lists.js" styles="tabcontrol.css"> 109 107 <ext:scripts context="<%=jspContext%>" /> 110 108 <ext:stylesheets context="<%=jspContext%>" /> 111 <script>112 // Validate the "Biomaterial list" tab113 function validateList()114 {115 var frm = document.forms['list'];116 if (Main.trimString(frm.name.value) == '')117 {118 Forms.showNotification(frm.name, 'You must enter a name');119 return false;120 }121 return true;122 }123 124 // Submit the form125 function saveSettings()126 {127 var frm = document.forms['list'];128 if (TabControl.validateActiveTab('settings'))129 {130 if (frm.source) Forms.createHidden(frm, 'items', getSelectedItems().join(','));131 frm.memberType.disabled = false;132 frm.submit();133 }134 }135 136 function init()137 {138 var frm = document.forms['list'];139 <%140 if (list == null)141 {142 %>143 frm.name.focus();144 frm.name.select();145 <%146 }147 %>148 if (frm.source)149 {150 if (getSelectedItems().length == 0)151 {152 frm.source[0].disabled = true;153 var lblSelected = document.getElementById('lblSelected');154 //aSelected.href = 'javascript:void(0)';155 lblSelected.disabled = true;156 Main.addClass(lblSelected, 'disabled');157 }158 else159 {160 Forms.checkRadio(frm.source, 'selected');161 }162 }163 }164 function checkRadio(radio, name)165 {166 Forms.checkRadio(radio, name);167 }168 169 // Get the ID:s of all selected items170 var selectedItems = new Array();171 var hasCheckSelectedItems = false;172 function getSelectedItems()173 {174 <%175 if (formId != null)176 {177 %>178 if (!hasCheckSelectedItems)179 {180 selectedItems = window.opener.Table.getSelected('<%=formId%>');181 hasCheckedSelectedItems = true;182 }183 <%184 }185 %>186 return selectedItems;187 }188 189 </script>190 109 </base:head> 191 <base:body onload="init()">110 <base:body> 192 111 <h1><%=title%> <base:help tabcontrol="settings"/></h1> 193 112 <form action="index.jsp?ID=<%=ID%>" method="post" name="list"> … … 206 125 position="bottom" remember="<%=list != null%>" 207 126 extensions="<%=invoker%>"> 208 <t:tab id="info" title="Biomaterial list" validate="validateList()"helpid="biomateriallist.edit">127 <t:tab id="info" title="Biomaterial list" helpid="biomateriallist.edit"> 209 128 <table class="fullform input100"> 210 129 <tr> 211 130 <th>Name</th> 212 <td><input class="text required" type="text" name="name" 131 <td><input class="text required auto-init" data-auto-init="<%=list == null ? "focus-select" : "focus" %>" 132 type="text" name="name" 213 133 value="<%=HTML.encodeTags(list == null ? Values.getString(cc.getPropertyValue("name"), "New list") : list.getName())%>" 214 134 maxlength="<%=BioMaterialList.MAX_NAME_LENGTH%>"></td> … … 234 154 <td> 235 155 <input type="radio" name="source" id="sourceSelected" value="selected" 156 data-parent-form="<%=formId%>" 236 157 ><label for="sourceSelected" id="lblSelected">Selected items</label><br> 237 158 <input type="radio" name="source" id="sourcePage" value="page" … … 266 187 <input type="radio" name="create" id="createCount" value="count" 267 188 ><label for="createCount" title="The new list contains only items that are present in some of selected lists">Present in at least</label> 268 <input type="text" class="text" name="minCount" style="width: 3em;" maxlength="2" 269 value="1" 270 onkeypress="return Numbers.integerOnly(event)" 271 onfocus="checkRadio(document.forms['list'].create, 'count');"> 189 <input type="text" class="text" name="minCount" id="minCount" style="width: 3em;" maxlength="2" 190 value="1"> 272 191 of the selected lists (1-<%=numSelectedLists%>). 273 192 <br> … … 305 224 306 225 <base:buttongroup subclass="dialogbuttons"> 307 <base:button onclick="saveSettings()" title="Save" />308 <base:button onclick="window.close()" title="Cancel" />226 <base:button id="btnSave" title="Save" /> 227 <base:button id="close" title="Cancel" /> 309 228 </base:buttongroup> 310 229 </base:body> -
trunk/www/biomaterials/lists/index.jsp
r6192 r6306 399 399 String sourceMerge = request.getParameter("sourceMerge"); 400 400 401 String[] sourceListIds = Values.getString(request.getParameter(" sourceLists")).split(",");401 String[] sourceListIds = Values.getString(request.getParameter("+BIOMATERIALLIST")).split(","); 402 402 List<BioMaterialList> sourceLists = new ArrayList<BioMaterialList>(sourceListIds.length); 403 403 for (int i = 0; i < sourceListIds.length; ++i) -
trunk/www/biomaterials/lists/lists.js
r6261 r6306 26 26 { 27 27 var biomateriallists = {}; 28 var selectedItemsInParentForm; 28 29 29 30 /** … … 35 36 if (pageId == 'edit-page') 36 37 { 37 // TODO 38 // Save + Close buttons 39 Buttons.addClickHandler('btnSave', biomateriallists.save); 40 Buttons.addClickHandler('close', App.closeWindow); 41 42 // Tab validation 43 TabControl.addTabValidator('settings.info', biomateriallists.validateList); 44 45 var frm = document.forms['list']; 46 if (frm.source) 47 { 48 // Create biomaterial list from selection of biomaterials 49 var parentForm = Data.get('sourceSelected', 'parent-form'); 50 selectedItemsInParentForm = window.opener.Table.getSelected(parentForm) 51 var lblSelected = Doc.element('lblSelected'); 52 if (selectedItemsInParentForm.length == 0) 53 { 54 frm.source[0].disabled = true; 55 lblSelected.disabled = true; 56 Main.addClass(lblSelected, 'disabled'); 57 } 58 else 59 { 60 Forms.checkRadio(frm.source, 'selected'); 61 lblSelected.innerHTML += ' ['+selectedItemsInParentForm.length+']'; 62 } 63 } 64 65 if (Doc.element('minCount')) 66 { 67 Events.addEventHandler('minCount', 'keypress', Events.integerOnly); 68 Events.addEventHandler('minCount', 'focus', biomateriallists.selectCreateCount); 69 } 70 38 71 } 39 72 else if (pageId == 'view-page') … … 63 96 var attributes = {'item-type': 'BIOMATERIALLIST'}; 64 97 var tableAttributes = {'table-id': 'lists'}; 65 Buttons.addClickHandler('btnNewItem', Buttons.newItem, attributes);98 Buttons.addClickHandler('btnNewItem', biomateriallists.newItem, attributes); 66 99 Buttons.addClickHandler('btnDeleteItems', Buttons.deleteItems, tableAttributes); 67 100 Buttons.addClickHandler('btnRestoreItems', Buttons.restoreItems, tableAttributes); … … 76 109 Buttons.addClickHandler('btnOk', Buttons.returnSelected, tableAttributes); 77 110 } 111 } 112 113 biomateriallists.newItem = function() 114 { 115 var controller = Main.getController('BIOMATERIALLIST'); 116 Table.submitToPopup('lists', 'NewItem', controller.width, controller.height); 78 117 } 79 118 … … 107 146 } 108 147 148 biomateriallists.validateList = function() 149 { 150 var frm = document.forms['list']; 151 if (Main.trimString(frm.name.value) == '') 152 { 153 Forms.showNotification(frm.name, 'You must enter a name'); 154 return false; 155 } 156 return true; 157 } 158 159 // Submit the form 160 biomateriallists.save = function() 161 { 162 var frm = document.forms['list']; 163 if (TabControl.validateActiveTab('settings')) 164 { 165 if (selectedItemsInParentForm) 166 { 167 Forms.createHidden(frm, 'items', selectedItemsInParentForm.join(',')); 168 } 169 frm.memberType.disabled = false; 170 frm.submit(); 171 } 172 } 173 174 biomateriallists.selectCreateCount = function() 175 { 176 var frm = document.forms['list']; 177 Forms.checkRadio(frm.create, 'count'); 178 } 179 109 180 110 181 return biomateriallists; -
trunk/www/biomaterials/lists/members/add_members_frameset.jsp
r6176 r6306 63 63 %> 64 64 <base:page type="popup" title="Select biomaterial"> 65 <base:head> 66 <script> 67 function addSelected() 68 { 69 var selected = top['members'].Table.getSelected(0); 70 if (selected.length == 0) 71 { 72 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left'); 73 return; 74 } 75 var frm = document.forms['addMembers']; 76 frm.which.value = 'selected'; 77 Forms.createHidden(frm, 'items', selected.join(',')); 78 frm.submit(); 79 } 80 function addCurrentPage() 81 { 82 var frm = document.forms['addMembers']; 83 frm.which.value = 'page'; 84 frm.submit(); 85 } 86 function addAll() 87 { 88 var frm = document.forms['addMembers']; 89 frm.which.value = 'all'; 90 frm.submit(); 91 } 92 </script> 93 </base:head> 65 <base:head scripts="~add_members.js" /> 94 66 <base:body> 95 67 <h1>Select biomaterial</h1> … … 100 72 101 73 <base:buttongroup subclass="dialogbuttons topborder"> 102 <base:button title="Add selected" onclick="addSelected()" />103 <base:button title="Add current page" onclick="addCurrentPage()" />104 <base:button title="Add all" onclick="addAll()" />105 <base:button title="Close" onclick="window.top.close()" />74 <base:button id="btnAddSelected" title="Add selected" /> 75 <base:button id="btnAddPage" title="Add current page" /> 76 <base:button id="btnAddAll" title="Add all" /> 77 <base:button id="close" title="Close" /> 106 78 </base:buttongroup> 107 79 -
trunk/www/biomaterials/lists/members/list_members.jsp
r6278 r6306 199 199 <ext:scripts context="<%=jspContext%>" /> 200 200 <ext:stylesheets context="<%=jspContext%>" /> 201 <script>202 203 function placeOnPlate()204 {205 Table.submitToPopup(formId, 'PlaceOnPlate', 900, 600);206 }207 </script>208 201 </base:head> 209 202 -
trunk/www/biomaterials/lists/merge.jsp
r6217 r6306 53 53 String title = "Add/keep/remove items: " + HTML.encodeTags(bmList.getName()); 54 54 bmList.checkPermission(Permission.WRITE); 55 56 57 58 55 %> 59 56 60 57 <base:page type="popup" title="<%=title%>"> 61 <base:head scripts="linkitems.js"> 62 <script> 63 // Validate the "Biomaterial list" tab 64 function validateForm() 65 { 66 var frm = document.forms['merge']; 67 if (frm.bioMaterialLists.length == 0) 68 { 69 Forms.showNotification('btnAddBioMaterialLists', 'You must select at least one other biomaterial list'); 70 return false; 71 } 72 return true; 73 } 74 75 // Submit the form 76 function saveSettings() 77 { 78 var frm = document.forms['merge']; 79 if (validateForm()) 80 { 81 frm.sourceLists.value = Link.getActionIds(1, 'B').join(','); 82 frm.submit(); 83 } 84 } 85 86 function addBioMaterialListsOnClick() 87 { 88 var frm = document.forms['merge']; 89 var ids = Link.getListIds(frm.bioMaterialLists, 'B'); 90 ids[ids.length] = <%=itemId%>; 91 var excludes = ids.join(','); 92 var url = 'index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectmultiple&callback=addBioMaterialListsCallback'; 93 url += "&exclude="+excludes; 94 url += '&resetTemporary=1&tmpfilter:INT:memberType=<%=bmList.getMemberType().getValue()%>'; 95 Main.openPopup(url, 'AddBioMaterialLists', 1050, 700); 96 } 97 function addBioMaterialListsCallback(bioMaterialListId, name) 98 { 99 var item = Link.getItem('B', bioMaterialListId); 100 if (!item) item = new Item('B', bioMaterialListId, name); 101 Link.addItem(document.forms['merge'].bioMaterialLists, item); 102 } 103 function removeBioMaterialListsOnClick() 104 { 105 Link.removeSelected(document.forms['merge'].bioMaterialLists); 106 } 107 108 function updateImage() 109 { 110 var frm = document.forms['merge']; 111 var img = document.getElementById('mergeImage'); 112 var mergeType = frm.mergeType[frm.mergeType.selectedIndex].value; 113 var sourceMerge = frm.sourceMerge[frm.sourceMerge.selectedIndex].value; 114 var url = '../../images/set_operations/'+mergeType+'_'+sourceMerge+'.png'; 115 img.src = url; 116 } 117 function mergeTypeOnChange() 118 { 119 updateImage(); 120 } 121 function sourceMergeOnChange() 122 { 123 updateImage(); 124 } 125 function init() 126 { 127 updateImage(); 128 } 129 </script> 130 </base:head> 131 <base:body onload="init()"> 58 <base:head scripts="linkitems-2.js,~merge.js" /> 59 <base:body> 132 60 <h1><%=title%> <base:help helpid="biomateriallist.merge" /></h1> 133 61 <form action="index.jsp?ID=<%=ID%>" method="post" name="merge"> … … 146 74 <th>What to do</th> 147 75 <td> 148 <select name="mergeType" onchange="mergeTypeOnChange()">76 <select name="mergeType" id="mergeType"> 149 77 <option value="union" <%="union".equals(mergeType) ? "selected" : ""%> 150 78 >Add items to … … 156 84 this list that are present in 157 85 <br> 158 <select name="sourceMerge" onchange="sourceMergeOnChange()">86 <select name="sourceMerge" id="sourceMerge"> 159 87 <option value="union" <%="intersection".equals(mergeType) ? "" : "selected"%> 160 88 >some of … … 175 103 <tr> 176 104 <td> 177 <select name="bioMaterialLists" size="10" multiple> 105 <select name="bioMaterialLists" id="bioMaterialLists" 106 class="auto-init" data-auto-init="link-container" 107 size="10" multiple> 178 108 </select> 179 109 </td> … … 183 113 <base:button 184 114 id="btnAddBioMaterialLists" 185 subclass="leftaligned" 115 subclass="leftaligned auto-init" 116 data-auto-init="add-link" 117 data-list-id="bioMaterialLists" 118 data-item-type="BIOMATERIALLIST" 119 data-exclude="<%=itemId %>" 120 data-filter="<%="&resetTemporary=1&tmpfilter:INT:memberType="+bmList.getMemberType().getValue()%>" 186 121 style="width: 15em;" 187 onclick="addBioMaterialListsOnClick()"188 122 title="Add biomaterial lists…" 189 123 tooltip="Add biomaterial lists" 190 124 /> 191 125 <base:button 192 subclass="leftaligned" 126 id="btnRemoveBioMaterialLists" 127 subclass="leftaligned auto-init" 128 data-auto-init="remove-link" 129 data-list-id="bioMaterialLists" 193 130 style="width: 15em;" 194 onclick="removeBioMaterialListsOnClick()"195 131 title="Remove" 196 132 tooltip="Remove the selected lists" 197 133 /> 198 134 </base:buttongroup> 199 <input type="hidden" name="sourceLists" value="">200 135 </td> 201 136 </tr> … … 210 145 211 146 <base:buttongroup subclass="dialogbuttons"> 212 <base:button onclick="saveSettings()" title="Ok" />213 <base:button onclick="window.close()" title="Cancel" />147 <base:button id="btnSave" title="Ok" /> 148 <base:button id="close" title="Cancel" /> 214 149 </base:buttongroup> 215 150 </base:body> -
trunk/www/biomaterials/tags/edit_tag.jsp
r6217 r6306 97 97 tagTypeQuery.include(Include.ALL); 98 98 tagTypeQuery.order(Orders.asc(Hql.property("name"))); 99 100 101 99 102 100 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), tag); 103 101 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 104 102 %> 105 <base:page type="popup" title="<%=title%>" >106 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">103 <base:page type="popup" title="<%=title%>" id="edit-page"> 104 <base:head scripts="tabcontrol-2.js,~tags.js" styles="tabcontrol.css"> 107 105 <ext:scripts context="<%=jspContext%>" /> 108 106 <ext:stylesheets context="<%=jspContext%>" /> 109 <script>110 // Validate the "Tag" tab111 function validateTag()112 {113 var frm = document.forms['tag'];114 if (Main.trimString(frm.name.value) == '')115 {116 Forms.showNotification(frm.name, 'You must enter a name');117 return false;118 }119 return true;120 }121 122 // Submit the form123 function saveSettings()124 {125 var frm = document.forms['tag'];126 if (TabControl.validateActiveTab('settings'))127 {128 frm.submit();129 }130 }131 132 function init()133 {134 <%135 if (tag == null)136 {137 %>138 var frm = document.forms['tag'];139 frm.name.focus();140 frm.name.select();141 <%142 }143 %>144 }145 </script>146 107 </base:head> 147 <base:body onload="init()">108 <base:body> 148 109 <h1><%=title%> <base:help tabcontrol="settings"/></h1> 149 110 <form action="index.jsp?ID=<%=ID%>" method="post" name="tag"> … … 154 115 position="bottom" remember="<%=tag != null%>" 155 116 extensions="<%=invoker%>"> 156 <t:tab id="info" title="Tag" validate="validateTag()"helpid="tag.edit">117 <t:tab id="info" title="Tag" helpid="tag.edit"> 157 118 <table class="fullform input100 smaller"> 158 119 <tr> 159 120 <th>Name</th> 160 <td><input class="text required" type="text" name="name" 121 <td><input class="text required auto-init" data-auto-init="<%=tag == null ? "focus-select" : "focus" %>" 122 type="text" name="name" 161 123 value="<%=HTML.encodeTags(tag == null ? Values.getString(cc.getPropertyValue("name"), "New tag") : tag.getName())%>" 162 124 maxlength="<%=Tag.MAX_NAME_LENGTH%>"></td> … … 213 175 214 176 <base:buttongroup subclass="dialogbuttons"> 215 <base:button onclick="saveSettings()" title="Save" />216 <base:button onclick="window.close()" title="Cancel" />177 <base:button id="btnSave" title="Save" /> 178 <base:button id="close" title="Cancel" /> 217 179 </base:buttongroup> 218 180 </base:body> -
trunk/www/biomaterials/tags/tags.js
r6261 r6306 35 35 if (pageId == 'edit-page') 36 36 { 37 // TODO 37 // Save + Close buttons 38 Buttons.addClickHandler('btnSave', tags.save); 39 Buttons.addClickHandler('close', App.closeWindow); 40 41 // Tab validation 42 TabControl.addTabValidator('settings.info', tags.validateTag); 38 43 } 39 44 else if (pageId == 'view-page') … … 48 53 Buttons.addClickHandler('btnShare', Buttons.shareItem, attributes); 49 54 Buttons.addClickHandler('btnSetOwner', Buttons.setOwner, attributes); 50 Buttons.addClickHandler('btnNewSample', biosources.newSample, attributes);51 55 Buttons.addClickHandler('btnExport', Buttons.runPlugin, attributes); 52 56 Buttons.addClickHandler('btnImport', Buttons.runPlugin, attributes); … … 72 76 } 73 77 78 79 tags.validateTag = function() 80 { 81 var frm = document.forms['tag']; 82 if (Main.trimString(frm.name.value) == '') 83 { 84 Forms.showNotification(frm.name, 'You must enter a name'); 85 return false; 86 } 87 return true; 88 } 89 90 // Submit the form 91 tags.save = function() 92 { 93 var frm = document.forms['tag']; 94 if (TabControl.validateActiveTab('settings')) 95 { 96 frm.submit(); 97 } 98 } 99 74 100 return tags; 75 101 }(); -
trunk/www/common/ownership/ownership.js
r6223 r6306 46 46 { 47 47 var frm = document.forms['ownership']; 48 var url ;48 var url = ''; 49 49 if (frm.owner_id.value > 0) 50 50 { -
trunk/www/include/scripts/linkitems-2.js
r6305 r6306 213 213 var itemType = Data.get(event.currentTarget, 'item-type'); 214 214 var exclude = Data.get(event.currentTarget, 'exclude'); 215 var filter = Data.get(event.currentTarget, 'filter'); 215 216 216 217 var listItems = link.getIdsInList(listId, itemType); 217 218 if (exclude) listItems[listItems.length] = exclude; 218 219 var url = '&exclude='+listItems.join(','); 220 if (filter) url += filter; 219 221 Dialogs.selectItem(itemType, listId, 1, url); 220 222 } -
trunk/www/lims/geometries/edit_geometry.jsp
r6217 r6306 77 77 { 78 78 geometry = PlateGeometry.getById(dc, itemId); 79 geometry.checkPermission(Permission.WRITE); 79 80 cc.setObject("item", geometry); 80 81 title = "Edit plate geometry -- " + HTML.encodeTags(geometry.getName()); 81 } 82 if (geometry != null && !geometry.hasPermission(Permission.WRITE)) 83 { 84 throw new PermissionDeniedException(Permission.WRITE, itemType.toString()); 85 } 86 82 } 87 83 88 84 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), geometry); 89 85 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 90 86 %> 91 <base:page type="popup" title="<%=title%>" >92 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">87 <base:page type="popup" title="<%=title%>" id="edit-page"> 88 <base:head scripts="tabcontrol-2.js,~geometries.js" styles="tabcontrol.css"> 93 89 <ext:scripts context="<%=jspContext%>" /> 94 90 <ext:stylesheets context="<%=jspContext%>" /> 95 <script>96 // Validate the "PlateGeoemtry" tab97 function validatePlateGeometry()98 {99 var frm = document.forms['geometry'];100 if (Main.trimString(frm.name.value) == '')101 {102 Forms.showNotification(frm.name, 'You must enter a name');103 return false;104 }105 else if (frm.rows && frm.rows.value == '')106 {107 Forms.showNotification(frm.rows, 'You must enter the number of rows');108 return false;109 }110 else if (frm.columns && frm.columns.value == '')111 {112 Forms.showNotification(frm.columns, 'You must enter the number of columns');113 return false;114 }115 return true;116 }117 118 // Submit the form119 function saveSettings()120 {121 var frm = document.forms['geometry'];122 if (TabControl.validateActiveTab('settings'))123 {124 frm.submit();125 }126 }127 128 function init()129 {130 var frm = document.forms['geometry'];131 <%132 if (geometry == null)133 {134 %>135 frm.name.focus();136 frm.name.select();137 <%138 }139 %>140 }141 </script>142 91 </base:head> 143 <base:body onload="init()">92 <base:body> 144 93 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 145 94 … … 151 100 position="bottom" remember="<%=geometry != null%>" 152 101 extensions="<%=invoker%>"> 153 <t:tab id="info" title="Plate geometry" validate="validatePlateGeometry()"helpid="plategeometry.edit">102 <t:tab id="info" title="Plate geometry" helpid="plategeometry.edit"> 154 103 <table class="fullform input100 smaller"> 155 104 <tr> 156 105 <th>Name</th> 157 <td><input class="text required" type="text" name="name" 106 <td><input class="text required auto-init" data-auto-init="<%=geometry == null ? "focus-select" : "focus" %>" 107 type="text" name="name" 158 108 value="<%=HTML.encodeTags(geometry == null ? Values.getString(cc.getPropertyValue("name"), "New plate geometry") : geometry.getName())%>" 159 109 maxlength="<%=PlateGeometry.MAX_NAME_LENGTH%>"></td> … … 173 123 { 174 124 %> 175 <input class="unchangeable" type="text" name="rows" style="width: 15em;"125 <input class="unchangeable" type="text" name="rows" id="rows" style="width: 15em;" 176 126 value="<%=cc.getPropertyValue("rows") == null ? "" : Values.getInt(cc.getPropertyValue("rows"))%>" 177 maxlength="10" onkeypress="return Numbers.integerOnly(event)">127 maxlength="10"> 178 128 <% 179 129 } … … 195 145 { 196 146 %> 197 <input class="unchangeable" type="text" name="columns" style="width: 15em;"147 <input class="unchangeable" type="text" name="columns" id="columns" style="width: 15em;" 198 148 value="<%=cc.getPropertyValue("columns") == null ? "" : Values.getInt(cc.getPropertyValue("columns"))%>" 199 maxlength="10" onkeypress="return Numbers.integerOnly(event)">149 maxlength="10"> 200 150 <% 201 151 } … … 227 177 228 178 <base:buttongroup subclass="dialogbuttons"> 229 <base:button onclick="saveSettings()" title="Save" />230 <base:button onclick="window.close()" title="Cancel" />179 <base:button id="btnSave" title="Save" /> 180 <base:button id="close" title="Cancel" /> 231 181 </base:buttongroup> 232 182 </base:body> -
trunk/www/lims/geometries/list_geometries.jsp
r6221 r6306 107 107 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 108 108 %> 109 <base:page title="<%=title==null ? "Plate geometries" : title%>" type="<%=mode.getPageType()%>" >110 <base:head scripts="table.js " styles="table.css,toolbar.css">109 <base:page title="<%=title==null ? "Plate geometries" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 110 <base:head scripts="table.js,~geometries.js" styles="table.css,toolbar.css"> 111 111 <ext:scripts context="<%=jspContext%>" /> 112 112 <ext:stylesheets context="<%=jspContext%>" /> 113 <script>114 var submitPage = 'index.jsp';115 var formId = 'geometries';116 function newItem()117 {118 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);119 }120 function editItem(itemId)121 {122 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);123 }124 function viewItem(itemId)125 {126 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);127 }128 function itemOnClick(evt, itemId)129 {130 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);131 }132 function deleteItems()133 {134 var frm = document.forms[formId];135 if (Forms.numChecked(frm) == 0)136 {137 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');138 return;139 }140 frm.action = submitPage;141 frm.cmd.value = 'DeleteItems';142 frm.submit();143 }144 function restoreItems()145 {146 var frm = document.forms[formId];147 if (Forms.numChecked(frm) == 0)148 {149 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');150 return;151 }152 frm.action = submitPage;153 frm.cmd.value = 'RestoreItems';154 frm.submit();155 }156 function configureColumns()157 {158 Table.configureColumns(formId);159 }160 function runPlugin(cmd)161 {162 Table.submitToPopup(formId, cmd, 750, 500);163 }164 function returnSelected()165 {166 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);167 window.close();168 }169 function newPlateType(geometryId)170 {171 Main.viewOrEditItem('<%=ID%>', 'PLATETYPE', 0, true, '&plategeometry_id='+geometryId);172 }173 </script>174 113 </base:head> 175 114 … … 272 211 > 273 212 <tbl:button 213 id="btnNewItem" 274 214 disabled="<%=!createPermission%>" 275 215 image="new.png" 276 onclick="newItem()"277 216 title="New…" 278 217 tooltip="<%=createPermission ? "Create new plate geometry" : "You do not have permission to create plate geometries"%>" 279 218 /> 280 219 <tbl:button 220 id="btnDeleteItems" 281 221 image="delete.png" 282 onclick="deleteItems()"283 222 title="Delete" 284 223 tooltip="Delete the selected items" 285 224 /> 286 225 <tbl:button 226 id="btnRestoreItems" 287 227 image="restore.png" 288 onclick="restoreItems()"289 228 title="Restore" 290 229 tooltip="Restore the selected (deleted) items" 291 230 /> 292 231 <tbl:button 232 id="btnColumns" 293 233 image="columns.png" 294 onclick="configureColumns()"295 234 title="Columns…" 296 235 tooltip="Show, hide and re-order columns" 297 236 /> 298 237 <tbl:button 238 id="btnImport" 239 data-plugin-type="IMPORT" 299 240 image="import.png" 300 onclick="runPlugin('ImportItems')"301 241 title="Import…" 302 242 tooltip="Import data" … … 304 244 /> 305 245 <tbl:button 246 id="btnExport" 247 data-plugin-type="EXPORT" 306 248 image="export.png" 307 onclick="runPlugin('ExportItems')"308 249 title="Export…" 309 250 tooltip="Export data" … … 311 252 /> 312 253 <tbl:button 254 id="btnRunPlugin" 255 data-plugin-type="OTHER" 313 256 image="runplugin.png" 314 onclick="runPlugin('RunListPlugin')"315 257 title="Run plugin…" 316 258 tooltip="Run a plugin" … … 421 363 visible="<%=item.isRemoved()%>" 422 364 /> </tbl:header> 423 <tbl:cell column="name"><div class="link" 424 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 365 <tbl:cell column="name"><div 366 class="link table-item" 367 data-item-id="<%=itemId%>" 368 data-no-edit="<%=writePermission ? 0 : 1 %>" 369 tabindex="0" 425 370 title="<%=tooltip%>"><%=name%></div></tbl:cell> 426 371 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 456 401 %> 457 402 <base:icon 403 id="<%="newplatetype."+itemId%>" 458 404 image="add.png" 459 onclick="<%="newPlateType("+itemId+")"%>" 405 subclass="auto-init" 406 data-auto-init="new-plate-type" 407 data-item-id="<%=itemId %>" 460 408 tooltip="Create new plate type" 461 409 visible="<%=mode.hasEditLink() && createPlateTypePermission && usePermission %>" … … 487 435 488 436 <base:buttongroup subclass="dialogbuttons"> 489 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />490 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />491 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />437 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 438 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 439 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 492 440 </base:buttongroup> 493 441 -
trunk/www/lims/geometries/view_geometry.jsp
r6136 r6306 91 91 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 92 92 %> 93 <base:page title="<%=title%>" >94 <base:head scripts="table.js,tabcontrol .js" styles="toolbar.css,table.css,headertabcontrol.css,path.css">93 <base:page title="<%=title%>" id="view-page"> 94 <base:head scripts="table.js,tabcontrol-2.js,~geometries.js" styles="toolbar.css,table.css,headertabcontrol.css,path.css"> 95 95 <ext:scripts context="<%=jspContext%>" /> 96 96 <ext:stylesheets context="<%=jspContext%>" /> 97 <script>98 function editItem()99 {100 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);101 }102 function deleteItem()103 {104 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>');105 }106 function restoreItem()107 {108 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');109 }110 function deleteItemPermanently()111 {112 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');113 }114 function itemDeleted()115 {116 Main.listItems('<%=ID%>', '<%=itemType.name()%>');117 }118 function showUsingItems()119 {120 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);121 }122 function runPlugin(cmd)123 {124 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);125 }126 function newPlateType()127 {128 Main.viewOrEditItem('<%=ID%>', 'PLATETYPE', 0, true, '&plategeometry_id=<%=itemId%>');129 }130 </script>131 97 </base:head> 132 98 <base:body> … … 135 101 /><p:pathelement title="<%=HTML.encodeTags(geometry.getName())%>" 136 102 /></p:path> 103 <div id="page-data" data-item-id="<%=itemId%>"></div> 137 104 138 105 <t:tabcontrol … … 146 113 <th class="itemstatus"> 147 114 <base:icon 115 id="btnDeletePermanently" 148 116 image="deleted.png" 149 onclick="deleteItemPermanently()"150 117 tooltip="This item has been flagged for deletion. Click to delete it now." 151 118 enabled="<%=deletePermanentlyPermission %>" 152 119 visible="<%=isRemoved%>" 153 120 /> 154 <base:icon image="used.png" 155 onclick="showUsingItems()" 121 <base:icon 122 id="btnUsingItems" 123 image="used.png" 156 124 tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" 157 125 visible="<%=isRemoved && isUsed%>" /> … … 160 128 <tbl:toolbar subclass="bottomborder"> 161 129 <tbl:button 130 id="btnEdit" 162 131 disabled="<%=!writePermission%>" 163 132 image="edit.png" 164 onclick="editItem()"165 133 title="Edit…" 166 134 tooltip="<%=writePermission ? "Edit this plate geometry" : "You do not have permission to edit this plate geometry"%>" 167 135 /> 168 136 <tbl:button 137 id="btnDelete" 169 138 disabled="<%=!deletePermission%>" 170 139 image="delete.png" 171 onclick="deleteItem()"172 140 title="Delete" 173 141 visible="<%=!geometry.isRemoved()%>" … … 175 143 /> 176 144 <tbl:button 145 id="btnRestore" 177 146 disabled="<%=!writePermission%>" 178 147 image="restore.png" 179 onclick="restoreItem()"180 148 title="Restore" 181 149 visible="<%=geometry.isRemoved()%>" … … 183 151 /> 184 152 <tbl:button 153 id="btnNewPlateType" 185 154 image="add.png" 186 onclick="newPlateType()"187 155 title="New plate type…" 188 156 tooltip="Create a new plate type with this geometry" … … 190 158 /> 191 159 <tbl:button 160 id="btnImport" 192 161 image="import.png" 193 onclick="runPlugin('ImportItem')"162 data-plugin-type="IMPORT" 194 163 title="Import…" 195 164 tooltip="Import data" … … 197 166 /> 198 167 <tbl:button 199 image="export.png" 200 onclick="runPlugin('ExportItem')" 168 id="btnExport" 169 image="export.png" 170 data-plugin-type="EXPORT" 201 171 title="Export…" 202 172 tooltip="Export data" … … 204 174 /> 205 175 <tbl:button 206 image="runplugin.png" 207 onclick="runPlugin('RunPlugin')" 176 id="btnRunPlugin" 177 image="runplugin.png" 178 data-plugin-type="OTHER" 208 179 title="Run plugin…" 209 180 tooltip="Run a plugin" … … 214 185 <tbl:button 215 186 image="help.png" 216 onclick="<%="Main.openHelp('" + ID +"', 'plategeometry.view.properties')"%>" 187 subclass="auto-init" 188 data-auto-init="help" 189 data-help-id="plategeometry.view.properties" 217 190 title="Help…" 218 191 tooltip="Get help about this page" -
trunk/www/lims/platetypes/edit_platetype.jsp
r6217 r6306 94 94 { 95 95 plateType = PlateType.getById(dc, itemId); 96 plateType.checkPermission(Permission.WRITE); 96 97 cc.setObject("item", plateType); 97 98 title = "Edit plate type -- " + HTML.encodeTags(plateType.getName()); … … 105 106 } 106 107 } 107 if (plateType != null && !plateType.hasPermission(Permission.WRITE))108 {109 throw new PermissionDeniedException(Permission.WRITE, itemType.toString());110 }111 112 108 113 109 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), plateType); 114 110 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 115 111 %> 116 <base:page type="popup" title="<%=title%>" >117 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">112 <base:page type="popup" title="<%=title%>" id="edit-page"> 113 <base:head scripts="tabcontrol-2.js,~platetypes.js" styles="tabcontrol.css"> 118 114 <ext:scripts context="<%=jspContext%>" /> 119 115 <ext:stylesheets context="<%=jspContext%>" /> 120 <script>121 // Validate the "PlateType" tab122 function validatePlateType()123 {124 var frm = document.forms['platetype'];125 if (Main.trimString(frm.name.value) == '')126 {127 Forms.showNotification(frm.name, 'You must enter a name');128 return false;129 }130 return true;131 }132 133 // Submit the form134 function saveSettings()135 {136 var frm = document.forms['platetype'];137 if (TabControl.validateActiveTab('settings'))138 {139 frm.submit();140 }141 }142 143 function init()144 {145 var frm = document.forms['platetype'];146 <%147 if (plateType == null)148 {149 %>150 frm.name.focus();151 frm.name.select();152 <%153 }154 %>155 }156 </script>157 116 </base:head> 158 <base:body onload="init()">117 <base:body> 159 118 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 160 119 <form action="index.jsp?ID=<%=ID%>" method="post" name="platetype"> … … 165 124 position="bottom" remember="<%=plateType != null%>" 166 125 extensions="<%=invoker%>"> 167 <t:tab id="info" title="Plate type" validate="validatePlateType()"helpid="platetype.edit">126 <t:tab id="info" title="Plate type" helpid="platetype.edit"> 168 127 <table class="fullform input100 smaller"> 169 128 <tr> 170 129 <th>Name</th> 171 <td><input class="text required" type="text" name="name" 130 <td><input class="text required auto-init" data-auto-init="<%=plateType == null ? "focus-select" : "focus" %>" 131 type="text" name="name" 172 132 value="<%=HTML.encodeTags(plateType == null ? Values.getString(cc.getPropertyValue("name"), "New plate type") : plateType.getName())%>" 173 133 maxlength="<%=PlateType.MAX_NAME_LENGTH%>"></td> … … 227 187 228 188 <base:buttongroup subclass="dialogbuttons"> 229 <base:button onclick="saveSettings()" title="Save" />230 <base:button onclick="window.close()" title="Cancel" />189 <base:button id="btnSave" title="Save" /> 190 <base:button id="close" title="Cancel" /> 231 191 </base:buttongroup> 232 192 </base:body> -
trunk/www/lims/platetypes/eventtypes/edit_eventtype.jsp
r6217 r6306 93 93 { 94 94 eventType = PlateEventType.getById(dc, itemId); 95 eventType.checkPermission(Permission.WRITE); 95 96 plateType = eventType.getPlateType(); 96 97 cc.setObject("item", eventType); … … 105 106 } 106 107 } 107 if (eventType != null && !eventType.hasPermission(Permission.WRITE))108 {109 throw new PermissionDeniedException(Permission.WRITE, itemType.toString());110 }111 112 108 113 109 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), eventType); 114 110 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 115 111 %> 116 <base:page type="popup" title="<%=title%>" >117 <base:head scripts="tabcontrol .js" styles="tabcontrol.css">112 <base:page type="popup" title="<%=title%>" id="edit-page"> 113 <base:head scripts="tabcontrol-2.js,~eventtypes.js" styles="tabcontrol.css"> 118 114 <ext:scripts context="<%=jspContext%>" /> 119 115 <ext:stylesheets context="<%=jspContext%>" /> 120 <script>121 // Validate the "EventType" tab122 function validateEventType()123 {124 var frm = document.forms['eventtype'];125 if (Main.trimString(frm.name.value) == '')126 {127 Forms.showNotification(frm.name, 'You must enter a name');128 return false;129 }130 else if (Main.trimString(frm.ordinal.value) == '')131 {132 Forms.showNotification(frm.ordinal, 'You must enter an ordinal');133 return false;134 }135 return true;136 }137 138 // Submit the form139 function saveSettings()140 {141 var frm = document.forms['eventtype'];142 if (TabControl.validateActiveTab('settings'))143 {144 frm.submit();145 }146 }147 148 function selectProtocolTypeOnClick()149 {150 var frm = document.forms['eventtype'];151 var url = '../../../admin/itemsubtypes/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setProtocolTypeCallback';152 url += '&resetTemporary=1&tmpfilter:INT:itemType=<%=Item.PROTOCOL.getValue()%>';153 if (frm.protocoltype_id.length > 1)154 {155 var id = Math.abs(parseInt(frm.protocoltype_id[1].value));156 url += '&item_id='+id;157 }158 Main.openPopup(url, 'SelectProtocolType', 1050, 700);159 }160 function setProtocolTypeCallback(id, name)161 {162 var frm = document.forms['eventtype'];163 var list = frm.protocoltype_id;164 if (list.length < 2 || list[1].value == '0') // >165 {166 Forms.addListOption(list, 1, new Option());167 }168 list[1].value = id;169 list[1].text = name;170 list.selectedIndex = 1;171 }172 173 function init()174 {175 var frm = document.forms['eventtype'];176 <%177 if (eventType == null)178 {179 %>180 frm.name.focus();181 frm.name.select();182 <%183 }184 %>185 }186 </script>187 116 </base:head> 188 <base:body onload="init()">117 <base:body> 189 118 <h1><%=title%> <base:help tabcontrol="settings" /></h1> 190 119 … … 197 126 position="bottom" remember="<%=eventType != null%>" 198 127 extensions="<%=invoker%>"> 199 <t:tab id="info" title="Event type" validate="validateEventType()"helpid="plateeventtype.edit">128 <t:tab id="info" title="Event type" helpid="plateeventtype.edit"> 200 129 <table class="fullform input100 smaller"> 201 130 <tr> 202 131 <th>Name</th> 203 <td><input class="text required" type="text" name="name" 132 <td><input class="text required auto-init" data-auto-init="<%=eventType == null ? "focus-select" : "focus" %>" 133 type="text" name="name" 204 134 value="<%=HTML.encodeTags(eventType == null ? Values.getString(cc.getPropertyValue("name"), "New event type") : eventType.getName())%>" 205 135 maxlength="<%=PlateEventType.MAX_NAME_LENGTH%>"></td> … … 208 138 <tr> 209 139 <th>Ordinal</th> 210 <td><input class="text required" type="text" name="ordinal" style="width: 15em;" 140 <td><input class="text required" type="text" name="ordinal" id="ordinal" 141 style="width: 15em;" 211 142 value="<%=eventType == null ? Values.getInt(cc.getPropertyValue("ordinal"), maxOrdinal+1) : eventType.getOrdinal()%>" 212 maxlength="10" onkeypress="return Numbers.integerOnly(event)"></td>143 maxlength="10"></td> 213 144 <td></td> 214 145 </tr> … … 219 150 id="protocoltype_id" 220 151 clazz="selectionlist" 152 data-protocol-type-filter="<%=Item.PROTOCOL.getValue()%>" 221 153 required="false" 222 154 current="<%=currentProtocolType%>" … … 224 156 recent="<%=recentProtocolTypes%>" 225 157 newitem="<%=eventType == null%>" 226 onselect="selectProtocolTypeOnClick()"227 158 /> 228 159 </td> … … 249 180 250 181 <base:buttongroup subclass="dialogbuttons"> 251 <base:button onclick="saveSettings()" title="Save" />252 <base:button onclick="window.close()" title="Cancel" />182 <base:button id="btnSave" title="Save" /> 183 <base:button id="close" title="Cancel" /> 253 184 </base:buttongroup> 254 185 </base:body> -
trunk/www/lims/platetypes/eventtypes/index.jsp
r6192 r6306 179 179 RemovableUtil.delete(dc, itemType, Collections.singleton(cc.getId())); 180 180 dc.commit(); 181 redirect = viewPage;181 redirect = listPage; 182 182 } 183 183 else if ("DeleteItems".equals(cmd)) -
trunk/www/lims/platetypes/eventtypes/list_eventtypes.jsp
r6221 r6306 97 97 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 98 98 %> 99 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" >100 <base:head scripts="table.js,tabcontrol .js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">99 <base:page title="<%=title%>" type="<%=mode.getPageType()%>" id="list-page"> 100 <base:head scripts="table.js,tabcontrol-2.js,~eventtypes.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> 101 101 <ext:scripts context="<%=jspContext%>" /> 102 102 <ext:stylesheets context="<%=jspContext%>" /> 103 <script>104 var submitPage = 'index.jsp';105 var formId = 'eventtypes';106 function newItem()107 {108 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true, '&platetype_id=<%=plateTypeId%>');109 }110 function editItem(itemId)111 {112 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);113 }114 function viewItem(itemId)115 {116 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);117 }118 function itemOnClick(evt, itemId)119 {120 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);121 }122 function deleteItems()123 {124 var frm = document.forms[formId];125 var numChecked = Forms.numChecked(frm);126 if (numChecked == 0)127 {128 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');129 return;130 }131 else132 {133 var rep = numChecked == 1 ? 'event type' : 'event type';134 if (!confirm('You are about to delete '+numChecked+' '+rep+'. This can\'t be undone. Continue?'))135 {136 return;137 }138 }139 frm.action = submitPage;140 frm.cmd.value = 'DeleteItems';141 frm.submit();142 }143 function configureColumns()144 {145 Table.configureColumns(formId);146 }147 function runPlugin(cmd)148 {149 Table.submitToPopup(formId, cmd, 750, 500);150 }151 function returnSelected()152 {153 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);154 window.close();155 }156 function switchTab(tabControlId, tabId)157 {158 if (tabId == 'properties')159 {160 location.href = '../index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=plateTypeId%>';161 }162 else163 {164 TabControl.setActiveTab(tabControlId, tabId);165 }166 }167 </script>168 103 </base:head> 169 104 <base:body> … … 176 111 id="main" 177 112 subclass="content mastertabcontrol" 178 active="events" switch="switchTab">113 active="events"> 179 114 <t:tab id="properties" title="Properties" /> 180 115 <t:tab id="events" title="Event types"> … … 261 196 > 262 197 <tbl:button 198 id="btnNewItem" 199 data-extra-url="<%="&platetype_id="+plateTypeId%>" 263 200 disabled="<%=!createPermission%>" 264 201 image="new.png" 265 onclick="newItem()"266 202 title="New…" 267 203 tooltip="<%=createPermission ? "Create new event type" : "You do not have permission to create event types"%>" 268 204 /> 269 205 <tbl:button 206 id="btnDeleteItems" 270 207 disabled="<%=!deletePermission%>" 271 208 image="delete.png" 209 data-confirm="1" 272 210 title="Delete…" 273 onclick="deleteItems()"274 211 tooltip="<%=deletePermission ? "Delete the selected event types" : "You do not have permission to delete event types"%>" 275 212 /> 276 213 <tbl:button 214 id="btnColumns" 277 215 image="columns.png" 278 onclick="configureColumns()"279 216 title="Columns…" 280 217 tooltip="Show, hide and re-order columns" 281 218 /> 282 219 <tbl:button 220 id="btnImport" 221 data-plugin-type="IMPORT" 283 222 image="import.png" 284 onclick="runPlugin('ImportItems')"285 223 title="Import…" 286 224 tooltip="Import data" … … 288 226 /> 289 227 <tbl:button 228 id="btnExport" 229 data-plugin-type="EXPORT" 290 230 image="export.png" 291 onclick="runPlugin('ExportItems')"292 231 title="Export…" 293 232 tooltip="Export data" … … 295 234 /> 296 235 <tbl:button 236 id="btnRunPlugin" 237 data-plugin-type="OTHER" 297 238 image="runplugin.png" 298 onclick="runPlugin('RunListPlugin')"299 239 title="Run plugin…" 300 240 tooltip="Run a plugin" … … 396 336 visible="<%=mode.hasIcons()%>" 397 337 > </tbl:header> 398 <tbl:cell column="name"><div class="link" 399 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 338 <tbl:cell column="name"><div 339 class="link table-item" 340 data-item-id="<%=itemId%>" 341 data-no-edit="<%=writePermission ? 0 : 1 %>" 342 data-extra-url="&platetype_id=<%=plateTypeId%>" 343 tabindex="0" 400 344 title="<%=tooltip%>"><%=name%></div></tbl:cell> 401 345 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 435 379 436 380 <base:buttongroup> 437 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />438 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />439 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />381 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 382 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 383 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 440 384 </base:buttongroup> 441 385 -
trunk/www/lims/platetypes/eventtypes/view_eventtype.jsp
r6146 r6306 80 80 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 81 81 %> 82 <base:page title="<%=title%>" >83 <base:head scripts="table.js,tabcontrol .js" styles="toolbar.css,table.css,headertabcontrol.css,path.css">82 <base:page title="<%=title%>" id="view-page"> 83 <base:head scripts="table.js,tabcontrol-2.js,~eventtypes.js" styles="toolbar.css,table.css,headertabcontrol.css,path.css"> 84 84 <ext:scripts context="<%=jspContext%>" /> 85 85 <ext:stylesheets context="<%=jspContext%>" /> 86 <script>87 function editItem()88 {89 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);90 }91 function deleteItem()92 {93 if (confirm('This can\'t be undone. Continue?'))94 {95 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&platetype_id=<%=plateTypeId%>&item_id=<%=itemId%>');96 }97 }98 function runPlugin(cmd)99 {100 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&platetype_id=<%=plateTypeId%>&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);101 }102 </script>103 86 </base:head> 104 87 <base:body> … … 110 93 /><p:pathelement title="<%=HTML.encodeTags(eventType.getName())%>" 111 94 /></p:path> 95 <div id="page-data" data-item-id="<%=itemId%>" data-platetype-id="<%=plateTypeId%>"></div> 112 96 113 97 <t:tabcontrol … … 123 107 <tbl:toolbar subclass="bottomborder"> 124 108 <tbl:button 109 id="btnEdit" 125 110 disabled="<%=!writePermission%>" 126 111 image="edit.png" 127 onclick="editItem()"128 112 title="Edit…" 129 113 tooltip="<%=writePermission ? "Edit this event type" : "You do not have permission to edit this event type"%>" 130 114 /> 131 115 <tbl:button 116 id="btnDelete" 117 data-confirm="1" 132 118 disabled="<%=!deletePermission%>" 133 119 image="delete.png" 134 onclick="deleteItem()"135 120 title="Delete" 136 121 tooltip="<%=deletePermission ? "Delete this event type" : "You do not have permission to event this plate type"%>" 137 122 /> 138 123 <tbl:button 124 id="btnImport" 139 125 image="import.png" 140 onclick="runPlugin('ImportItem')"126 data-plugin-type="IMPORT" 141 127 title="Import…" 142 128 tooltip="Import data" … … 144 130 /> 145 131 <tbl:button 146 image="export.png" 147 onclick="runPlugin('ExportItem')" 132 id="btnExport" 133 image="export.png" 134 data-plugin-type="EXPORT" 148 135 title="Export…" 149 136 tooltip="Export data" … … 151 138 /> 152 139 <tbl:button 153 image="runplugin.png" 154 onclick="runPlugin('RunPlugin')" 140 id="btnRunPlugin" 141 image="runplugin.png" 142 data-plugin-type="OTHER" 155 143 title="Run plugin…" 156 144 tooltip="Run a plugin" … … 161 149 <tbl:button 162 150 image="help.png" 163 onclick="<%="Main.openHelp('" + ID +"', 'plateeventtype.view.properties')"%>" 151 subclass="auto-init" 152 data-auto-init="help" 153 data-help-id="plateeventtype.view.properties" 164 154 title="Help…" 165 155 tooltip="Get help about this page" -
trunk/www/lims/platetypes/list_platetypes.jsp
r6221 r6306 115 115 ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); 116 116 %> 117 <base:page title="<%=title==null ? "Plate types" : title%>" type="<%=mode.getPageType()%>" >118 <base:head scripts="table.js " styles="table.css,toolbar.css">117 <base:page title="<%=title==null ? "Plate types" : title%>" type="<%=mode.getPageType()%>" id="list-page"> 118 <base:head scripts="table.js,~platetypes.js" styles="table.css,toolbar.css"> 119 119 <ext:scripts context="<%=jspContext%>" /> 120 120 <ext:stylesheets context="<%=jspContext%>" /> 121 <script>122 var submitPage = 'index.jsp';123 var formId = 'platetypes';124 function newItem()125 {126 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', 0, true);127 }128 function editItem(itemId)129 {130 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, true);131 }132 function viewItem(itemId)133 {134 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', itemId, false);135 }136 function itemOnClick(evt, itemId)137 {138 Table.itemOnClick(formId, evt, itemId, '<%=mode.getName()%>', viewItem, editItem, returnSelected);139 }140 function deleteItems()141 {142 var frm = document.forms[formId];143 if (Forms.numChecked(frm) == 0)144 {145 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');146 return;147 }148 frm.action = submitPage;149 frm.cmd.value = 'DeleteItems';150 frm.submit();151 }152 function restoreItems()153 {154 var frm = document.forms[formId];155 if (Forms.numChecked(frm) == 0)156 {157 Forms.showNotification('check.uncheck', 'Please select at least one item in the list', null, 'pointer-left');158 return;159 }160 frm.action = submitPage;161 frm.cmd.value = 'RestoreItems';162 frm.submit();163 }164 function setOwner()165 {166 Table.setOwnerOfItems(formId);167 }168 function shareItems()169 {170 Table.shareItems(formId);171 }172 function configureColumns()173 {174 Table.configureColumns(formId);175 }176 function runPlugin(cmd)177 {178 Table.submitToPopup(formId, cmd, 750, 500);179 }180 function returnSelected()181 {182 Table.returnSelected(formId, <%=callback != null ? "window.opener."+callback : "null" %>);183 window.close();184 }185 </script>186 121 </base:head> 187 122 … … 302 237 > 303 238 <tbl:button 239 id="btnNewItem" 304 240 disabled="<%=!createPermission%>" 305 241 image="new.png" 306 onclick="newItem()"307 242 title="New…" 308 243 tooltip="<%=createPermission ? "Create new plate type" : "You do not have permission to create plate types"%>" 309 244 /> 310 245 <tbl:button 246 id="btnDeleteItems" 311 247 image="delete.png" 312 onclick="deleteItems()"313 248 title="Delete" 314 249 tooltip="Delete the selected items" 315 250 /> 316 251 <tbl:button 252 id="btnRestoreItems" 317 253 image="restore.png" 318 onclick="restoreItems()"319 254 title="Restore" 320 255 tooltip="Restore the selected (deleted) items" 321 256 /> 322 257 <tbl:button 258 id="btnShareItems" 323 259 image="share.png" 324 onclick="shareItems()"325 260 title="Share…" 326 261 tooltip="Share the selected items" 327 262 /> 328 263 <tbl:button 264 id="btnSetOwner" 329 265 image="take_ownership.png" 330 onclick="setOwner()"331 266 title="Set owner…" 332 267 tooltip="Change owner of the selected items" 333 268 /> 334 269 <tbl:button 270 id="btnColumns" 335 271 image="columns.png" 336 onclick="configureColumns()"337 272 title="Columns…" 338 273 tooltip="Show, hide and re-order columns" 339 274 /> 340 275 <tbl:button 276 id="btnImport" 277 data-plugin-type="IMPORT" 341 278 image="import.png" 342 onclick="runPlugin('ImportItems')"343 279 title="Import…" 344 280 tooltip="Import data" … … 346 282 /> 347 283 <tbl:button 284 id="btnExport" 285 data-plugin-type="EXPORT" 348 286 image="export.png" 349 onclick="runPlugin('ExportItems')"350 287 title="Export…" 351 288 tooltip="Export data" … … 353 290 /> 354 291 <tbl:button 292 id="btnRunPlugin" 293 data-plugin-type="OTHER" 355 294 image="runplugin.png" 356 onclick="runPlugin('RunListPlugin')"357 295 title="Run plugin…" 358 296 tooltip="Run a plugin" … … 473 411 visible="<%=item.isShared()%>" 474 412 /> </tbl:header> 475 <tbl:cell column="name"><div class="link" 476 onclick="itemOnClick(<%=writePermission ? "event" : null%>, <%=itemId%>)" 413 <tbl:cell column="name"><div 414 class="link table-item" 415 data-item-id="<%=itemId%>" 416 data-no-edit="<%=writePermission ? 0 : 1 %>" 417 tabindex="0" 477 418 title="<%=tooltip%>"><%=name%></div></tbl:cell> 478 419 <tbl:cell column="id"><%=item.getId()%></tbl:cell> … … 563 504 564 505 <base:buttongroup subclass="dialogbuttons"> 565 <base:button onclick="returnSelected();" title="Ok" visible="<%=mode.hasOkButton()%>" />566 <base:button onclick="window.close();" title="Cancel" visible="<%=mode.hasCancelButton()%>" />567 <base:button onclick="window.close();" title="Close" visible="<%=mode.hasCloseButton()%>" />506 <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> 507 <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> 508 <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> 568 509 </base:buttongroup> 569 510 -
trunk/www/lims/platetypes/view_platetype.jsp
r6136 r6306 100 100 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 101 101 %> 102 <base:page title="<%=title%>" >103 <base:head scripts="table.js,tabcontrol .js" styles="toolbar.css,headertabcontrol.css,path.css,table.css">102 <base:page title="<%=title%>" id="view-page"> 103 <base:head scripts="table.js,tabcontrol-2.js,~platetypes.js" styles="toolbar.css,headertabcontrol.css,path.css,table.css"> 104 104 <ext:scripts context="<%=jspContext%>" /> 105 105 <ext:stylesheets context="<%=jspContext%>" /> 106 <script>107 function editItem()108 {109 Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true);110 }111 function shareItem()112 {113 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'SharePlateType', 600, 400);114 }115 function deleteItem()116 {117 location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>');118 }119 function restoreItem()120 {121 location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>');122 }123 function deleteItemPermanently()124 {125 Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted');126 }127 function itemDeleted()128 {129 Main.listItems('<%=ID%>', '<%=itemType.name()%>');130 }131 function showUsingItems()132 {133 Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);134 }135 function setOwner()136 {137 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 300);138 }139 function runPlugin(cmd)140 {141 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 750, 500);142 }143 function viewEventTypes()144 {145 location.href = 'eventtypes/index.jsp?ID=<%=ID%>&cmd=List&platetype_id=<%=itemId%>';146 }147 function switchTab(tabControlId, tabId)148 {149 if (tabId == 'events')150 {151 viewEventTypes();152 }153 else154 {155 TabControl.setActiveTab(tabControlId, tabId);156 }157 }158 </script>159 106 </base:head> 160 107 <base:body> … … 163 110 /><p:pathelement title="<%=HTML.encodeTags(plateType.getName())%>" 164 111 /></p:path> 112 <div id="page-data" data-item-id="<%=itemId%>"></div> 165 113 166 114 <t:tabcontrol 167 115 id="main" 168 116 subclass="content mastertabcontrol" 169 active="properties" switch="switchTab">117 active="properties"> 170 118 <t:tab id="properties" title="Properties"> 171 119 <div> … … 179 127 /> 180 128 <base:icon 129 id="btnDeletePermanently" 181 130 image="deleted.png" 182 onclick="deleteItemPermanently()"183 131 tooltip="This item has been flagged for deletion. Click to delete it now." 184 132 enabled="<%=deletePermanentlyPermission %>" 185 133 visible="<%=isRemoved%>" 186 134 /> 187 <base:icon image="used.png" 188 onclick="showUsingItems()" 135 <base:icon 136 id="btnUsingItems" 137 image="used.png" 189 138 tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" 190 139 visible="<%=isRemoved && isUsed%>" /> … … 193 142 <tbl:toolbar subclass="bottomborder"> 194 143 <tbl:button 144 id="btnEdit" 195 145 disabled="<%=!writePermission%>" 196 146 image="edit.png" 197 onclick="editItem()"198 147 title="Edit…" 199 148 tooltip="<%=writePermission ? "Edit this plate type" : "You do not have permission to edit this plate type"%>" 200 149 /> 201 150 <tbl:button 151 id="btnDelete" 202 152 disabled="<%=!deletePermission%>" 203 153 image="delete.png" 204 onclick="deleteItem()"205 154 title="Delete" 206 155 visible="<%=!plateType.isRemoved()%>" … … 208 157 /> 209 158 <tbl:button 159 id="btnRestore" 210 160 disabled="<%=!writePermission%>" 211 161 image="restore.png" 212 onclick="restoreItem()"213 162 title="Restore" 214 163 visible="<%=plateType.isRemoved()%>" … … 216 165 /> 217 166 <tbl:button 167 id="btnShare" 218 168 disabled="<%=!sharePermission%>" 219 169 image="share.png" 220 onclick="shareItem()"221 170 title="Share…" 222 171 tooltip="<%=sharePermission ? "Share this plate type to other user, groups and projects" : "You do not have permission to share this plate type"%>" 223 172 /> 224 173 <tbl:button 174 id="btnSetOwner" 225 175 disabled="<%=!setOwnerPermission%>" 226 176 image="take_ownership.png" 227 onclick="setOwner()"228 177 title="Set owner…" 229 178 tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" 230 179 /> 231 180 <tbl:button 181 id="btnImport" 232 182 image="import.png" 233 onclick="runPlugin('ImportItem')"183 data-plugin-type="IMPORT" 234 184 title="Import…" 235 185 tooltip="Import data" … … 237 187 /> 238 188 <tbl:button 239 image="export.png" 240 onclick="runPlugin('ExportItem')" 189 id="btnExport" 190 image="export.png" 191 data-plugin-type="EXPORT" 241 192 title="Export…" 242 193 tooltip="Export data" … … 244 195 /> 245 196 <tbl:button 246 image="runplugin.png" 247 onclick="runPlugin('RunPlugin')" 197 id="btnRunPlugin" 198 image="runplugin.png" 199 data-plugin-type="OTHER" 248 200 title="Run plugin…" 249 201 tooltip="Run a plugin" … … 254 206 <tbl:button 255 207 image="help.png" 256 onclick="<%="Main.openHelp('" + ID +"', 'platetype.view.properties')"%>" 208 subclass="auto-init" 209 data-auto-init="help" 210 data-help-id="platetype.view.properties" 257 211 title="Help…" 258 212 tooltip="Get help about this page"
Note: See TracChangeset
for help on using the changeset viewer.