Rev 1310 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
214 | jmachado | 1 | <%@ page import="jomm.utils.MyCalendar" %> |
2 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
3 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
4 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
5 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
6 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
7 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
9 | |||
10 | <jsp:useBean id="AnnouncementsForm" type="pt.estgp.estgweb.web.form.announcements.AnnouncementsForm" scope="request"/> |
||
11 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
||
1312 | jmachado | 12 | |
214 | jmachado | 13 | <% |
14 | String fromAction = ""; |
||
15 | String from = ""; |
||
16 | String user = ""; |
||
17 | if (request.getParameter("from") != null) |
||
18 | { |
||
19 | user = "/user"; |
||
20 | fromAction = "From" + request.getParameter("from"); |
||
21 | from = "?from=" + request.getParameter("from"); |
||
22 | } |
||
23 | request.setAttribute("from", from); |
||
24 | request.setAttribute("user", user); |
||
25 | request.setAttribute("fromAction", fromAction); |
||
26 | |||
27 | MyCalendar calendar = new MyCalendar(); |
||
28 | calendar.setYear(calendar.getYear()+1); |
||
29 | %> |
||
30 | |||
1312 | jmachado | 31 | |
32 | <div class="panel panel-default"> |
||
33 | <div class="panel-heading"><bean:message key="courseunit.menu.put.announcement"/></div> |
||
34 | <div class="panel-body"> |
||
35 | |||
36 | <jomm:messages/> |
||
37 | <html:errors/> |
||
38 | <html:form action="${user}/submitAnnouncement${fromAction}${from}" enctype="multipart/form-data"> |
||
39 | <html:hidden property="courseUnitView.id" value="${AnnouncementsForm.announcementView.courseUnitView.id}"/> |
||
40 | <html:hidden property="role"/> |
||
41 | <html:hidden property="announcementView.id"/> |
||
42 | <html:hidden property="smallImageStr"/> |
||
43 | <html:hidden property="bigImageStr"/> |
||
44 | <html:hidden property="announcementView.internal" value="true"/> |
||
45 | <html:hidden property="announcementView.courseUnitView.id"/> |
||
46 | <html:hidden property="announcementView.courseUnitView.name"/> |
||
47 | <html:hidden property="announcementView.courseUnitView.importYear"/> |
||
48 | <input type="hidden" name="expireDate" value="<%=calendar.getWebDateString()%>"/> |
||
49 | <html:hidden property="announcementView.courseUnitView.courseName"/> |
||
50 | <html:hidden property="targetRolesStr" value="all"/> |
||
51 | <baco:hasRole role="student"> |
||
52 | <html:hidden property="announcementView.choosedOwnerRole" value="student"/> |
||
53 | </baco:hasRole> |
||
54 | <baco:hasRole role="teacher"> |
||
55 | <html:hidden property="announcementView.choosedOwnerRole" value="teacher"/> |
||
56 | </baco:hasRole> |
||
57 | <input type="hidden" name="dispatch" value="removeRole"> |
||
58 | |||
59 | <baco:isAdmin> |
||
60 | <div class="form-group row"> |
||
61 | <div class="control-label col-sm-2" for="status"><bean:message key="announcement.status"/></div> |
||
62 | <div class="col-sm-10"> |
||
63 | <%--<input type="email" class="form-control" id="email">--%> |
||
64 | <html:select styleId="status" styleClass="form-control" property="announcementView.status"> |
||
65 | <html:option value="true"> |
||
66 | <bean:message key="yes"/> |
||
67 | </html:option> |
||
68 | <html:option value="false"> |
||
69 | <bean:message key="no"/> |
||
70 | </html:option> |
||
71 | </html:select> |
||
72 | </div> |
||
73 | </div> |
||
74 | </baco:isAdmin> |
||
75 | |||
76 | <div class="form-group row"> |
||
77 | <label class="control-label col-sm-2" for="internal2"><bean:message key="announcement.courseunit.internal"/></label> |
||
78 | <div class="col-sm-10"> |
||
79 | <%--<input type="email" class="form-control" id="email">--%> |
||
80 | <html:select styleId="internal2" styleClass="form-control" property="announcementView.courseUnitInternal"> |
||
81 | <html:option value="true" key="announcement.internal.yes"/> |
||
82 | <html:option value="false" key="announcement.internal.no"/> |
||
83 | </html:select> |
||
84 | </div> |
||
85 | </div> |
||
86 | |||
87 | <div class="form-group row"> |
||
88 | <label class="control-label col-sm-2" for="title2"><bean:message key="announcement.title"/> * </label> |
||
89 | <div class="col-sm-10"> |
||
90 | <html:text styleId="title2" styleClass="form-control" property="announcementView.title" maxlength="250"></html:text> |
||
91 | </div> |
||
92 | </div> |
||
93 | |||
94 | <div class="form-group row"> |
||
95 | <label class="control-label col-sm-2" for="text"><bean:message key="announcement.text"/> *</label> |
||
96 | <div class="col-sm-10"> |
||
97 | <html:textarea styleId="text" styleClass="form-control" property="announcementView.text"/> |
||
98 | </div> |
||
99 | </div> |
||
100 | |||
101 | <button type="button" class="btn btn-success" onclick="set(this.form,'save');this.form.submit()"><bean:message key="confirm"/></button> |
||
102 | </html:form> |
||
103 | |||
214 | jmachado | 104 | </div> |
1312 | jmachado | 105 | </div> |
106 |