Ignore:
Timestamp:
Aug 24, 2009, 1:05:40 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1361: Unhandled item: ANNOTATION

The only "issue" is that there is no "view" page for annotations. So the "edit" page is used for that as well. The "Save" button will be disabled if the current user doesn't have write permission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/annotations/annotate.jsp

    r5074 r5075  
    8989
    9090  final Annotatable item = itemId == 0 ? null : (Annotatable)itemType.getById(dc, itemId);
     91  final boolean writePermission = item == null ? true : item.hasPermission(Permission.WRITE);
    9192  Protocol protocol = null;
    9293  boolean readProtocol = true;
     
    871872      %>
    872873      </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      %>
    879898      <form name="modified" method="post" action="index.jsp?ID=<%=ID%>">
    880899        <input type="hidden" name="cmd" value="SaveAnnotations">
Note: See TracChangeset for help on using the changeset viewer.