Commits

Anonymous committed 67cac25

Added the ability to manage remedy tt

The opennms is able to set the remedy
group and urgency directly from the alarm page
when openning a ticket

Comments (0)

Files changed (1)

opennms-webapp/src/main/webapp/WEB-INF/jsp/alarm/detail.jsp

         org.opennms.web.alarm.*,
         org.opennms.netmgt.model.OnmsAcknowledgment,
         org.opennms.netmgt.model.OnmsSeverity,
-        org.opennms.web.springframework.security.Authentication"
+        org.opennms.web.springframework.security.Authentication,
+		org.apache.commons.configuration.Configuration,
+            org.apache.commons.configuration.ConfigurationException,
+            org.apache.commons.configuration.PropertiesConfiguration"
         %>
 
 <%@page import="org.opennms.web.alarm.Alarm" %>
     <input type="hidden" name="alarm" value="<%=alarm.getId()%>"/>
     <input type="hidden" name="redirect" value="<%="/alarm/detail.htm" + "?" + request.getQueryString()%>" />
     <form:input type="submit" value="Create Ticket" disabled="${(!empty alarm.troubleTicketState) && (alarm.troubleTicketState != 'CREATE_FAILED')}" />
+<% if ("org.opennms.netmgt.ticketer.remedy.RemedyTicketerPlugin".equalsIgnoreCase(Vault.getProperty("opennms.ticketer.plugin")) && (alarm.getTroubleTicketState() == null || alarm.getTroubleTicketState().toString().equals("CREATE_FAILED") )) { %>
+	<input type="hidden" name="nodelabel" value="<%=alarm.getNodeLabel()%>"/>
+    <input type="text" name="remedy.user.comment" value="Add a Comment here"/>
+    <select name="remedy.urgency">
+    <option value="1-Critical">1-Critical</option>
+    <option value="2-High">2-High</option>
+    <option value="3-Medium">3-Medium</option>
+    <option value="4-Low" selected="selected">4-Low</option>
+    </select>
+    <select name="remedy.assignedgroup">
+    <% 		String propsFile = new String(Vault.getProperty("opennms.home") + "/etc/remedy.properties");
+
+		Configuration remedyConfig = null;
+		try {
+			remedyConfig = new PropertiesConfiguration(propsFile);
+		} catch (final ConfigurationException e) {
+		}
+		for (String group: 	remedyConfig.getString("remedy.targetgroups").split(":")) { %>
+     %>
+           <option value="<%=group%>"><%=group%></option>
+    <%	        }  %>
+    </select>
+    <% } //Remedy Specific Trouble Ticket %>
 </form>
 
 <form method="post" action="alarm/ticket/update.htm">
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.