4567 |
07 Oct 08 |
nicklas |
1 |
<%-- $Id$ |
4567 |
07 Oct 08 |
nicklas |
2 |
------------------------------------------------------------------ |
4567 |
07 Oct 08 |
nicklas |
Copyright (C) 2008 Nicklas Nordborg |
4567 |
07 Oct 08 |
nicklas |
4 |
|
4567 |
07 Oct 08 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
4567 |
07 Oct 08 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
4567 |
07 Oct 08 |
nicklas |
7 |
|
4567 |
07 Oct 08 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
4567 |
07 Oct 08 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
4567 |
07 Oct 08 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
4567 |
07 Oct 08 |
nicklas |
11 |
of the License, or (at your option) any later version. |
4567 |
07 Oct 08 |
nicklas |
12 |
|
4567 |
07 Oct 08 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
4567 |
07 Oct 08 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4567 |
07 Oct 08 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4567 |
07 Oct 08 |
nicklas |
16 |
GNU General Public License for more details. |
4567 |
07 Oct 08 |
nicklas |
17 |
|
4567 |
07 Oct 08 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4567 |
07 Oct 08 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4567 |
07 Oct 08 |
nicklas |
20 |
------------------------------------------------------------------ |
4567 |
07 Oct 08 |
nicklas |
21 |
|
4567 |
07 Oct 08 |
nicklas |
22 |
@author Nicklas |
4567 |
07 Oct 08 |
nicklas |
23 |
--%> |
5426 |
24 Sep 10 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
4567 |
07 Oct 08 |
nicklas |
25 |
import="net.sf.basedb.core.SessionControl" |
4567 |
07 Oct 08 |
nicklas |
26 |
import="net.sf.basedb.core.DbControl" |
4567 |
07 Oct 08 |
nicklas |
27 |
import="net.sf.basedb.core.Client" |
4567 |
07 Oct 08 |
nicklas |
28 |
import="net.sf.basedb.core.User" |
4567 |
07 Oct 08 |
nicklas |
29 |
import="net.sf.basedb.core.ClientDefaultSetting" |
4567 |
07 Oct 08 |
nicklas |
30 |
import="net.sf.basedb.core.Permission" |
4567 |
07 Oct 08 |
nicklas |
31 |
import="net.sf.basedb.clients.web.util.HTML" |
4567 |
07 Oct 08 |
nicklas |
32 |
import="net.sf.basedb.util.Values" |
4567 |
07 Oct 08 |
nicklas |
33 |
import="net.sf.basedb.clients.web.Base" |
4567 |
07 Oct 08 |
nicklas |
34 |
%> |
4567 |
07 Oct 08 |
nicklas |
35 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4567 |
07 Oct 08 |
nicklas |
36 |
|
4567 |
07 Oct 08 |
nicklas |
37 |
<% |
4567 |
07 Oct 08 |
nicklas |
38 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4567 |
07 Oct 08 |
nicklas |
39 |
final String ID = sc.getId(); |
4567 |
07 Oct 08 |
nicklas |
40 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
41 |
final DbControl dc = sc.newDbControl(":Edit broadcast message"); |
4567 |
07 Oct 08 |
nicklas |
42 |
|
4567 |
07 Oct 08 |
nicklas |
43 |
try |
4567 |
07 Oct 08 |
nicklas |
44 |
{ |
4567 |
07 Oct 08 |
nicklas |
45 |
final Client server = Client.getById(dc, sc.getClientId()); |
4567 |
07 Oct 08 |
nicklas |
46 |
final boolean writePermission = server.hasPermission(Permission.WRITE); |
4567 |
07 Oct 08 |
nicklas |
47 |
|
4567 |
07 Oct 08 |
nicklas |
48 |
String title = (String)application.getAttribute("broadcast.title"); |
4567 |
07 Oct 08 |
nicklas |
49 |
String message = (String)application.getAttribute("broadcast.message"); |
4567 |
07 Oct 08 |
nicklas |
50 |
Boolean denyLogin = (Boolean)application.getAttribute("broadcast.deny-login"); |
4567 |
07 Oct 08 |
nicklas |
51 |
%> |
4567 |
07 Oct 08 |
nicklas |
52 |
<base:page type="popup" title="Broadcast message"> |
6169 |
15 Oct 12 |
nicklas |
53 |
<base:head scripts="~broadcast.js" /> |
6169 |
15 Oct 12 |
nicklas |
54 |
<base:body> |
5902 |
08 Dec 11 |
nicklas |
55 |
<h1>Broadcast message <base:help helpid="broadcast.message"/></h1> |
6162 |
10 Oct 12 |
nicklas |
56 |
<form name="broadcast" action="submit_server.jsp" method="post"> |
4567 |
07 Oct 08 |
nicklas |
57 |
<input type="hidden" name="ID" value="<%=ID%>"> |
4567 |
07 Oct 08 |
nicklas |
58 |
<input type="hidden" name="cmd" value="SetBroadcastMessage"> |
4567 |
07 Oct 08 |
nicklas |
59 |
|
6607 |
19 Nov 14 |
nicklas |
60 |
<div class="content bottomborder"> |
4567 |
07 Oct 08 |
nicklas |
61 |
<% |
4567 |
07 Oct 08 |
nicklas |
62 |
if (!writePermission) |
4567 |
07 Oct 08 |
nicklas |
63 |
{ |
4567 |
07 Oct 08 |
nicklas |
64 |
%> |
6607 |
19 Nov 14 |
nicklas |
65 |
<table class="fullcc bg-filled-50"><tr><td> |
6607 |
19 Nov 14 |
nicklas |
66 |
<div class="messagecontainer error">You do not have permission to broadcast messages to users.</div> |
5902 |
08 Dec 11 |
nicklas |
67 |
</td></tr></table> |
4567 |
07 Oct 08 |
nicklas |
68 |
<% |
4567 |
07 Oct 08 |
nicklas |
69 |
} |
4567 |
07 Oct 08 |
nicklas |
70 |
else |
4567 |
07 Oct 08 |
nicklas |
71 |
{ |
4567 |
07 Oct 08 |
nicklas |
72 |
%> |
6607 |
19 Nov 14 |
nicklas |
73 |
<table class="fullform smaller input100"> |
4567 |
07 Oct 08 |
nicklas |
74 |
<tr> |
6140 |
20 Sep 12 |
nicklas |
75 |
<th>Title</th> |
4567 |
07 Oct 08 |
nicklas |
76 |
<td> |
6169 |
15 Oct 12 |
nicklas |
77 |
<input class="text auto-init" data-auto-init="focus" |
5902 |
08 Dec 11 |
nicklas |
78 |
type="text" name="title" value="<%=HTML.encodeTags(title)%>" maxlength="255"> |
4567 |
07 Oct 08 |
nicklas |
79 |
</td> |
5902 |
08 Dec 11 |
nicklas |
80 |
<td></td> |
4567 |
07 Oct 08 |
nicklas |
81 |
</tr> |
5902 |
08 Dec 11 |
nicklas |
82 |
<tr> |
6140 |
20 Sep 12 |
nicklas |
83 |
<th>Disable login</th> |
4567 |
07 Oct 08 |
nicklas |
84 |
<td> |
4567 |
07 Oct 08 |
nicklas |
85 |
<input type="checkbox" name="denyLogin" <%=Boolean.TRUE.equals(denyLogin) ? "checked": ""%> value="1"> |
4567 |
07 Oct 08 |
nicklas |
86 |
</td> |
5902 |
08 Dec 11 |
nicklas |
87 |
<td></td> |
4567 |
07 Oct 08 |
nicklas |
88 |
</tr> |
5903 |
09 Dec 11 |
nicklas |
89 |
<tr class="dynamic"> |
6140 |
20 Sep 12 |
nicklas |
90 |
<th>Message</th> |
4567 |
07 Oct 08 |
nicklas |
91 |
<td> |
6169 |
15 Oct 12 |
nicklas |
92 |
<textarea class="text" rows="15" name="message" id="message"><%=HTML.encodeTags(message)%></textarea> |
5902 |
08 Dec 11 |
nicklas |
93 |
</td> |
5902 |
08 Dec 11 |
nicklas |
94 |
<td style="width: 20px;"> |
6169 |
15 Oct 12 |
nicklas |
95 |
<base:zoom textarea="message" title="Message" /> |
4567 |
07 Oct 08 |
nicklas |
96 |
</td> |
4567 |
07 Oct 08 |
nicklas |
97 |
</tr> |
4567 |
07 Oct 08 |
nicklas |
98 |
</table> |
4567 |
07 Oct 08 |
nicklas |
99 |
<% |
4567 |
07 Oct 08 |
nicklas |
100 |
} |
4567 |
07 Oct 08 |
nicklas |
101 |
%> |
4567 |
07 Oct 08 |
nicklas |
102 |
</div> |
4567 |
07 Oct 08 |
nicklas |
103 |
|
4567 |
07 Oct 08 |
nicklas |
104 |
</form> |
5902 |
08 Dec 11 |
nicklas |
105 |
<base:buttongroup subclass="dialogbuttons"> |
6169 |
15 Oct 12 |
nicklas |
106 |
<base:button id="btnClear" image="remove.png" title="Clear message" /> |
6169 |
15 Oct 12 |
nicklas |
107 |
<base:button id="btnSave" title="Ok" visible="<%=writePermission%>"/> |
6169 |
15 Oct 12 |
nicklas |
108 |
<base:button id="close" title="Cancel" /> |
4567 |
07 Oct 08 |
nicklas |
109 |
</base:buttongroup> |
4567 |
07 Oct 08 |
nicklas |
110 |
</base:body> |
4567 |
07 Oct 08 |
nicklas |
111 |
</base:page> |
4567 |
07 Oct 08 |
nicklas |
112 |
<% |
4567 |
07 Oct 08 |
nicklas |
113 |
} |
4567 |
07 Oct 08 |
nicklas |
114 |
finally |
4567 |
07 Oct 08 |
nicklas |
115 |
{ |
4567 |
07 Oct 08 |
nicklas |
116 |
if (dc != null) dc.close(); |
4567 |
07 Oct 08 |
nicklas |
117 |
} |
4567 |
07 Oct 08 |
nicklas |
118 |
%> |
4567 |
07 Oct 08 |
nicklas |
119 |
|