Changeset 5075
- Timestamp:
- Aug 24, 2009, 1:05:40 PM (13 years ago)
- Location:
- trunk/www
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/common/annotations/annotate.jsp
r5074 r5075 89 89 90 90 final Annotatable item = itemId == 0 ? null : (Annotatable)itemType.getById(dc, itemId); 91 final boolean writePermission = item == null ? true : item.hasPermission(Permission.WRITE); 91 92 Protocol protocol = null; 92 93 boolean readProtocol = true; … … 871 872 %> 872 873 </div> 873 <table align="center"> 874 <tr> 875 <td width="50%"><base:button onclick="saveAnnotations()" title="Save" /></td> 876 <td width="50%"><base:button onclick="window.close()" title="Cancel" /></td> 877 </tr> 878 </table> 874 <% 875 if (writePermission) 876 { 877 %> 878 <table align="center"> 879 <tr> 880 <td width="50%"><base:button onclick="saveAnnotations()" title="Save" /></td> 881 <td width="50%"><base:button onclick="window.close()" title="Cancel" /></td> 882 </tr> 883 </table> 884 <% 885 } 886 else 887 { 888 %> 889 <div class="error">You do not have permission to change this information</div> 890 <table align="center"> 891 <tr> 892 <td><base:button onclick="window.close()" title="Close" /></td> 893 </tr> 894 </table> 895 <% 896 } 897 %> 879 898 <form name="modified" method="post" action="index.jsp?ID=<%=ID%>"> 880 899 <input type="hidden" name="cmd" value="SaveAnnotations"> -
trunk/www/common/annotations/index.jsp
r5060 r5075 29 29 import="net.sf.basedb.core.ItemContext" 30 30 import="net.sf.basedb.core.BasicItem" 31 import="net.sf.basedb.core.Annotation" 32 import="net.sf.basedb.core.AnnotationType" 31 33 import="net.sf.basedb.core.Annotatable" 32 34 import="net.sf.basedb.core.BaseException" … … 44 46 final String ID = sc.getId(); 45 47 final String cmd = request.getParameter("cmd"); 46 final Item itemType = Item.valueOf(request.getParameter("item_type"));47 48 final int itemId = Values.getInt(request.getParameter("item_id")); 48 49 … … 54 55 try 55 56 { 56 if (" SaveAnnotations".equals(cmd))57 if ("EditItem".equals(cmd)) 57 58 { 59 newDc = sc.newDbControl(); 60 Annotation a = Annotation.getById(newDc, itemId); 61 AnnotationType at = a.getAnnotationType(); 62 Annotatable item = a.getAnnotationSet().getItem(); 63 64 redirect = "annotate.jsp?ID=" + ID + "&item_id=" + item.getId() + 65 "&item_type=" + item.getType().name() + 66 "&annotationtype_id=" + at.getId() + "&standalone=1"; 67 newDc.close(); 68 } 69 else if ("SaveAnnotations".equals(cmd)) 70 { 71 final Item itemType = Item.valueOf(request.getParameter("item_type")); 58 72 newDc = sc.newDbControl(); 59 73 oldDc = sc.newDbControl(); -
trunk/www/include/scripts/main.js
r5048 r5075 475 475 this.controllers['UNIT'] = { url:'admin/quantities/units/index.jsp', width:600, height:480 }; 476 476 this.controllers['CHANGEHISTORY'] = { url:'common/history/index.jsp', width:600, height:480, edit:false, popup:true }; 477 this.controllers['ANNOTATION'] = { url:'common/annotations/index.jsp', width:700, height:480, edit:true, popup:true }; 477 478 } 478 479
Note: See TracChangeset
for help on using the changeset viewer.