Ignore:
Timestamp:
Aug 20, 2009, 10:53:16 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #108: Logging the change history of an item

  • Enabled logging for experiments
  • Added "Change history" tab to experiments, plugin configuration and protocol
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/admin/protocols/view_protocol.jsp

    r5042 r5069  
    4949  import="net.sf.basedb.core.query.Hql"
    5050  import="net.sf.basedb.clients.web.Base"
     51  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
    5152  import="net.sf.basedb.clients.web.PermissionUtil"
    5253  import="net.sf.basedb.clients.web.util.HTML"
     
    7879final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
    7980final int itemId = cc.getId();
     81final String tab = Values.getString(request.getParameter("tab"), "properties");
    8082final float scale = Base.getScale(sc);
    8183final DbControl dc = sc.newDbControl();
     
    140142      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    141143    }
     144    function switchTab(tabControlId, tabId)
     145    {
     146      if (TabControl.isActive(tabControlId, tabId)) return;
     147      if (tabId == 'history' && tabId != '<%=tab%>')
     148      {
     149        location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId;
     150      }
     151      else
     152      {
     153        TabControl.setActiveTab(tabControlId, tabId);
     154      }
     155    }
    142156    </script>
    143157  </base:head>
     
    149163    </p:path>
    150164   
    151     <t:tabcontrol id="main" active="properties">
     165    <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false">
    152166    <t:tab id="properties" title="Properties">
    153167   
     
    455469      </div>
    456470    </t:tab>
    457      
     471    <t:tab id="history" title="Change history"
     472      tooltip="Displays a log of all modifications made to this item"
     473      visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>">
     474      <%
     475      if ("history".equals(tab))
     476      {
     477        %>
     478        <jsp:include page="../../common/history/frameset.jsp">
     479          <jsp:param name="source_type" value="<%=itemType.name()%>" />
     480          <jsp:param name="source_id" value="<%=itemId%>" />
     481          <jsp:param name="ID" value="<%=ID%>" />
     482        </jsp:include>
     483        <%
     484      }
     485      %>
     486    </t:tab>
    458487    </t:tabcontrol>
    459488
Note: See TracChangeset for help on using the changeset viewer.