5048 |
17 Aug 09 |
nicklas |
1 |
<%-- $Id$ |
5048 |
17 Aug 09 |
nicklas |
2 |
------------------------------------------------------------------ |
5048 |
17 Aug 09 |
nicklas |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Gregory Vincic |
5048 |
17 Aug 09 |
nicklas |
Copyright (C) 2007 Nicklas Nordborg |
5048 |
17 Aug 09 |
nicklas |
6 |
|
5048 |
17 Aug 09 |
nicklas |
7 |
This file is part of BASE - BioArray Software Environment. |
5048 |
17 Aug 09 |
nicklas |
8 |
Available at http://base.thep.lu.se/ |
5048 |
17 Aug 09 |
nicklas |
9 |
|
5048 |
17 Aug 09 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
5048 |
17 Aug 09 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
5048 |
17 Aug 09 |
nicklas |
12 |
as published by the Free Software Foundation; either version 3 |
5048 |
17 Aug 09 |
nicklas |
13 |
of the License, or (at your option) any later version. |
5048 |
17 Aug 09 |
nicklas |
14 |
|
5048 |
17 Aug 09 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
5048 |
17 Aug 09 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5048 |
17 Aug 09 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5048 |
17 Aug 09 |
nicklas |
18 |
GNU General Public License for more details. |
5048 |
17 Aug 09 |
nicklas |
19 |
|
5048 |
17 Aug 09 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
5048 |
17 Aug 09 |
nicklas |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5048 |
17 Aug 09 |
nicklas |
22 |
------------------------------------------------------------------ |
5048 |
17 Aug 09 |
nicklas |
23 |
|
5048 |
17 Aug 09 |
nicklas |
24 |
@author Nicklas |
5048 |
17 Aug 09 |
nicklas |
25 |
@version 2.0 |
5048 |
17 Aug 09 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
5048 |
17 Aug 09 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
5048 |
17 Aug 09 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
5048 |
17 Aug 09 |
nicklas |
30 |
import="net.sf.basedb.core.SystemItems" |
5048 |
17 Aug 09 |
nicklas |
31 |
import="net.sf.basedb.core.Item" |
5048 |
17 Aug 09 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
5048 |
17 Aug 09 |
nicklas |
33 |
import="net.sf.basedb.core.Permission" |
5048 |
17 Aug 09 |
nicklas |
34 |
import="net.sf.basedb.core.ChangeHistory" |
5048 |
17 Aug 09 |
nicklas |
35 |
import="net.sf.basedb.core.BasicItem" |
5048 |
17 Aug 09 |
nicklas |
36 |
import="net.sf.basedb.core.Nameable" |
5048 |
17 Aug 09 |
nicklas |
37 |
import="net.sf.basedb.core.plugin.GuiContext" |
5048 |
17 Aug 09 |
nicklas |
38 |
import="net.sf.basedb.plugins.util.Parameters" |
5048 |
17 Aug 09 |
nicklas |
39 |
import="net.sf.basedb.clients.web.Base" |
5048 |
17 Aug 09 |
nicklas |
40 |
import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
5048 |
17 Aug 09 |
nicklas |
41 |
import="net.sf.basedb.clients.web.util.HTML" |
5048 |
17 Aug 09 |
nicklas |
42 |
import="net.sf.basedb.util.Values" |
5048 |
17 Aug 09 |
nicklas |
43 |
import="net.sf.basedb.util.formatter.Formatter" |
5048 |
17 Aug 09 |
nicklas |
44 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5048 |
17 Aug 09 |
nicklas |
45 |
import="java.util.Date" |
5048 |
17 Aug 09 |
nicklas |
46 |
%> |
5048 |
17 Aug 09 |
nicklas |
47 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
5048 |
17 Aug 09 |
nicklas |
48 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
5048 |
17 Aug 09 |
nicklas |
49 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
5048 |
17 Aug 09 |
nicklas |
50 |
<%! |
5048 |
17 Aug 09 |
nicklas |
51 |
private static final Item itemType = Item.CHANGEHISTORY; |
5048 |
17 Aug 09 |
nicklas |
52 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
5048 |
17 Aug 09 |
nicklas |
53 |
%> |
5048 |
17 Aug 09 |
nicklas |
54 |
<% |
5048 |
17 Aug 09 |
nicklas |
55 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
5048 |
17 Aug 09 |
nicklas |
56 |
final String ID = sc.getId(); |
5048 |
17 Aug 09 |
nicklas |
57 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
5048 |
17 Aug 09 |
nicklas |
58 |
final int itemId = cc.getId(); |
5048 |
17 Aug 09 |
nicklas |
59 |
final String tab = Values.getString(request.getParameter("tab"), "properties"); |
5048 |
17 Aug 09 |
nicklas |
60 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
61 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
5048 |
17 Aug 09 |
nicklas |
62 |
try |
5048 |
17 Aug 09 |
nicklas |
63 |
{ |
5048 |
17 Aug 09 |
nicklas |
64 |
final Formatter<Date> timeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
5048 |
17 Aug 09 |
nicklas |
65 |
|
5048 |
17 Aug 09 |
nicklas |
66 |
final ChangeHistory history = ChangeHistory.getById(dc, itemId); |
5048 |
17 Aug 09 |
nicklas |
67 |
final BasicItem changedItem = history.getItem(null); |
5048 |
17 Aug 09 |
nicklas |
68 |
final String itemTitle = HTML.encodeTags(changedItem instanceof Nameable ? |
5048 |
17 Aug 09 |
nicklas |
69 |
((Nameable)changedItem).getName() : changedItem.toString()); |
5048 |
17 Aug 09 |
nicklas |
70 |
|
5048 |
17 Aug 09 |
nicklas |
71 |
final String changeTime = timeFormatter.format(history.getTime()); |
7166 |
07 Jun 16 |
nicklas |
72 |
final String title = "History -- " + itemTitle + " (" + changeTime + ")"; |
5048 |
17 Aug 09 |
nicklas |
73 |
%> |
5048 |
17 Aug 09 |
nicklas |
74 |
|
6244 |
25 Feb 13 |
nicklas |
75 |
<base:page type="popup" title="<%=title%>" id="view-history"> |
6181 |
22 Oct 12 |
nicklas |
76 |
<base:head scripts="~history.js" /> |
5048 |
17 Aug 09 |
nicklas |
77 |
<base:body> |
5923 |
11 Jan 12 |
nicklas |
78 |
<h1><%=title%> <base:help helpid="changehistory.view.properties" /></h1> |
5048 |
17 Aug 09 |
nicklas |
79 |
|
5923 |
11 Jan 12 |
nicklas |
80 |
<div class="content bottomborder"> |
5923 |
11 Jan 12 |
nicklas |
81 |
<table class="fullform outlined"> |
5048 |
17 Aug 09 |
nicklas |
82 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
83 |
<th>Item</th> |
5048 |
17 Aug 09 |
nicklas |
84 |
<td><%=title%></td> |
5048 |
17 Aug 09 |
nicklas |
85 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
86 |
<tr> |
7948 |
10 May 21 |
nicklas |
87 |
<th>Transaction</th> |
7948 |
10 May 21 |
nicklas |
88 |
<td><%=HTML.encodeTags(history.getName())%></td> |
7948 |
10 May 21 |
nicklas |
89 |
</tr> |
7948 |
10 May 21 |
nicklas |
90 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
91 |
<th>Time</th> |
5048 |
17 Aug 09 |
nicklas |
92 |
<td><%=changeTime%></td> |
5048 |
17 Aug 09 |
nicklas |
93 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
94 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
95 |
<th>Type</th> |
5048 |
17 Aug 09 |
nicklas |
96 |
<td><%=history.getChangeType()%></td> |
5048 |
17 Aug 09 |
nicklas |
97 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
98 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
99 |
<th>Change info</th> |
5048 |
17 Aug 09 |
nicklas |
100 |
<td><%=HTML.niceFormat(history.getChangeInfo())%></td> |
5048 |
17 Aug 09 |
nicklas |
101 |
</tr> |
6355 |
26 Nov 13 |
nicklas |
102 |
<% |
6355 |
26 Nov 13 |
nicklas |
103 |
if (sc.hasPermission(Permission.READ, Item.CHANGEHISTORY_VALUES)) |
6355 |
26 Nov 13 |
nicklas |
104 |
{ |
6355 |
26 Nov 13 |
nicklas |
105 |
%> |
6355 |
26 Nov 13 |
nicklas |
106 |
<tr> |
6355 |
26 Nov 13 |
nicklas |
107 |
<th class="subprompt">-old value</th> |
6355 |
26 Nov 13 |
nicklas |
108 |
<td><%=HTML.niceFormat(history.getOldValue())%></td> |
6355 |
26 Nov 13 |
nicklas |
109 |
</tr> |
6355 |
26 Nov 13 |
nicklas |
110 |
<tr> |
6355 |
26 Nov 13 |
nicklas |
111 |
<th class="subprompt">-new value</th> |
6355 |
26 Nov 13 |
nicklas |
112 |
<td><%=HTML.niceFormat(history.getNewValue())%></td> |
6355 |
26 Nov 13 |
nicklas |
113 |
</tr> |
6355 |
26 Nov 13 |
nicklas |
114 |
<% |
6355 |
26 Nov 13 |
nicklas |
115 |
} |
6355 |
26 Nov 13 |
nicklas |
116 |
%> |
5048 |
17 Aug 09 |
nicklas |
117 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
118 |
<th>Changed by</th> |
5048 |
17 Aug 09 |
nicklas |
119 |
<td><%=ChangeHistoryUtil.getUser(dc, history, false, false)%></td> |
5048 |
17 Aug 09 |
nicklas |
120 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
121 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
122 |
<th>Plug-in</th> |
5048 |
17 Aug 09 |
nicklas |
123 |
<td><%=ChangeHistoryUtil.getPlugin(dc, history, false, false)%></td> |
5048 |
17 Aug 09 |
nicklas |
124 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
125 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
126 |
<th>Active project</th> |
5048 |
17 Aug 09 |
nicklas |
127 |
<td><%=ChangeHistoryUtil.getProject(dc, history, false, false)%></td> |
5048 |
17 Aug 09 |
nicklas |
128 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
129 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
130 |
<th>Job</th> |
5048 |
17 Aug 09 |
nicklas |
131 |
<td><%=ChangeHistoryUtil.getJob(dc, history, false, false)%></td> |
5048 |
17 Aug 09 |
nicklas |
132 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
133 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
134 |
<th>Client application</th> |
5048 |
17 Aug 09 |
nicklas |
135 |
<td><%=ChangeHistoryUtil.getClient(dc, history, false, false)%></td> |
5048 |
17 Aug 09 |
nicklas |
136 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
137 |
<tr> |
5923 |
11 Jan 12 |
nicklas |
138 |
<th>Session</th> |
5048 |
17 Aug 09 |
nicklas |
139 |
<td><%=ChangeHistoryUtil.getSession(dc, history, false, false)%></td> |
5048 |
17 Aug 09 |
nicklas |
140 |
</tr> |
5923 |
11 Jan 12 |
nicklas |
141 |
<tr class="dynamic"> |
5923 |
11 Jan 12 |
nicklas |
142 |
<th></th> |
5923 |
11 Jan 12 |
nicklas |
143 |
<td></td> |
5923 |
11 Jan 12 |
nicklas |
144 |
</tr> |
5048 |
17 Aug 09 |
nicklas |
145 |
</table> |
5923 |
11 Jan 12 |
nicklas |
146 |
</div> |
5048 |
17 Aug 09 |
nicklas |
147 |
|
5923 |
11 Jan 12 |
nicklas |
148 |
<base:buttongroup subclass="dialogbuttons"> |
6181 |
22 Oct 12 |
nicklas |
149 |
<base:button id="close" title="Close" /> |
5048 |
17 Aug 09 |
nicklas |
150 |
</base:buttongroup> |
5048 |
17 Aug 09 |
nicklas |
151 |
|
5048 |
17 Aug 09 |
nicklas |
152 |
</base:body> |
5048 |
17 Aug 09 |
nicklas |
153 |
</base:page> |
5048 |
17 Aug 09 |
nicklas |
154 |
<% |
5048 |
17 Aug 09 |
nicklas |
155 |
} |
5048 |
17 Aug 09 |
nicklas |
156 |
finally |
5048 |
17 Aug 09 |
nicklas |
157 |
{ |
5048 |
17 Aug 09 |
nicklas |
158 |
if (dc != null) dc.close(); |
5048 |
17 Aug 09 |
nicklas |
159 |
} |
5048 |
17 Aug 09 |
nicklas |
160 |
|
5048 |
17 Aug 09 |
nicklas |
161 |
%> |