Ignore:
Timestamp:
Aug 19, 2009, 2:42:25 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #108: Logging the change history of an item

  • Added "Change history" tab to file and formula view pages
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/formulas/view_formula.jsp

    r5045 r5065  
    4545  import="net.sf.basedb.util.Values"
    4646  import="net.sf.basedb.clients.web.Base"
     47  import="net.sf.basedb.clients.web.ChangeHistoryUtil"
    4748  import="net.sf.basedb.clients.web.PermissionUtil"
    4849  import="net.sf.basedb.clients.web.util.HTML"
     
    7475final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
    7576final int itemId = cc.getId();
     77final String tab = Values.getString(request.getParameter("tab"), "properties");
    7678final float scale = Base.getScale(sc);
    7779final DbControl dc = sc.newDbControl();
     
    139141      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    140142    }
     143    function switchTab(tabControlId, tabId)
     144    {
     145      if (TabControl.isActive(tabControlId, tabId)) return;
     146      if (tabId == 'history' && tabId != '<%=tab%>')
     147      {
     148        location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId;
     149      }
     150      else
     151      {
     152        TabControl.setActiveTab(tabControlId, tabId);
     153      }
     154    }
    141155    </script>
    142156  </base:head>
     
    148162    </p:path>
    149163   
    150     <t:tabcontrol id="main" active="properties">
     164    <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false">
    151165    <t:tab id="properties" title="Properties">
    152166    <tbl:toolbar
     
    427441    </div>
    428442    </t:tab>
     443    <t:tab id="history" title="Change history"
     444      tooltip="Displays a log of all modifications made to this item"
     445      visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>">
     446      <%
     447      if ("history".equals(tab))
     448      {
     449        %>
     450        <jsp:include page="../../common/history/frameset.jsp">
     451          <jsp:param name="source_type" value="<%=itemType.name()%>" />
     452          <jsp:param name="source_id" value="<%=itemId%>" />
     453          <jsp:param name="ID" value="<%=ID%>" />
     454        </jsp:include>
     455        <%
     456      }
     457      %>
     458    </t:tab>
    429459    </t:tabcontrol>
    430460
Note: See TracChangeset for help on using the changeset viewer.