modifygroup.jsp
来自「opennms得相关源码 请大家看看」· JSP 代码 · 共 470 行 · 第 1/2 页
JSP
470 行
<!--//// This file is part of the OpenNMS(R) Application.//// OpenNMS(R) is Copyright (C) 2002-2003 The OpenNMS Group, Inc. All rights reserved.// OpenNMS(R) is a derivative work, containing both original code, included code and modified// code that was published under the GNU General Public License. Copyrights for modified // and included code are below.//// OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.//// Modifications://// 2003 Feb 07: Fixed URLEncoder issues.// 2002 Nov 26: Fixed breadcrumbs issue.// // Original code base Copyright (C) 1999-2001 Oculan Corp. All rights reserved.//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.//// For more information contact:// OpenNMS Licensing <license@opennms.org>// http://www.opennms.org/// http://www.opennms.com///--><%@page language="java" contentType = "text/html" session = "true" import="org.opennms.netmgt.config.*, java.util.*,java.text.*,org.opennms.netmgt.config.groups.*,org.opennms.netmgt.config.users.*"%><% HttpSession userSession = request.getSession(false); Group group = null; if (userSession != null) { group = (Group)userSession.getAttribute("group.modifyGroup.jsp"); }%><html><head><title>Modify Group | User Admin | OpenNMS Web Console</title><base HREF="<%=org.opennms.web.Util.calculateUrlBase( request )%>" /><link rel="stylesheet" type="text/css" href="includes/styles.css" /></head><script language="Javascript" type="text/javascript" > function validate() { for (var c = 0; c < document.modifyGroup.dutySchedules.value; c++) { var beginName= "duty" + c + "Begin"; var endName = "duty" + c + "End"; var beginValue = new Number(document.modifyGroup.elements[beginName].value); var endValue = new Number(document.modifyGroup.elements[endName].value); if (!document.modifyGroup.elements["deleteDuty"+c].checked) { if (isNaN(beginValue)) { alert("The begin time of duty schedule " + (c+1) + " must be expressed in military time with no other characters, such as 800, not 8:00"); return false; } if (isNaN(endValue)) { alert("The end time of duty schedule " + (c+1) + " must be expressed in military time with no other characters, such as 800, not 8:00"); return false; } if (beginValue > endValue) { alert("The begin value for duty schedule " + (c+1) + " must be less than the end value."); return false; } if (beginValue < 0 || beginValue > 2359) { alert("The begin value for duty schedule " + (c+1) + " must be greater than 0 and less than 2400"); return false; } if (endValue < 0 || endValue > 2359) { alert("The end value for duty schedule " + (c+1) + " must be greater than 0 and less than 2400"); return false; } } } return true; } function addUsers() { m1len = m1.length ; for ( i=0; i<m1len ; i++) { if (m1.options[i].selected == true ) { m2len = m2.length; m2.options[m2len]= new Option(m1.options[i].text); } } for ( i = (m1len -1); i>=0; i--) { if (m1.options[i].selected == true ) { m1.options[i] = null; } } } function removeUsers() { m2len = m2.length ; for ( i=0; i<m2len ; i++) { if (m2.options[i].selected == true ) { m1len = m1.length; m1.options[m1len]= new Option(m2.options[i].text); } } for ( i=(m2len-1); i>=0; i--) { if (m2.options[i].selected == true ) { m2.options[i] = null; } } } function selectAllAvailable() { for (i=0; i < m1.length; i++) { m1.options[i].selected = true; } } function selectAllSelected() { for (i=0; i < m2.length; i++) { m2.options[i].selected = true; } } function move(incr) { var i = m2.selectedIndex; // current selection if( i < 0 ) return; var j = i + incr; // where it will move to if( j < 0 || j >= m2.length ) return; var temp = m2.options[i].text; // swap them m2.options[i].text = m2.options[j].text; m2.options[j].text = temp; m2.selectedIndex = j; // make new location selected } function addGroupDutySchedules() { var ok = validate(); if(ok) { selectAllSelected(); document.modifyGroup.redirect.value="/admin/userGroupView/groups/addGroupDutySchedules"; document.modifyGroup.action="admin/userGroupView/groups/updateGroup"; document.modifyGroup.submit(); } } function removeGroupDutySchedules() { var ok = validate(); if(ok) { selectAllSelected(); document.modifyGroup.redirect.value="/admin/userGroupView/groups/modifyGroup.jsp"; document.modifyGroup.action="admin/userGroupView/groups/updateGroup"; document.modifyGroup.submit(); } } function saveGroup() { var ok = validate(); if(ok) { //we need to select all the users in the selectedUsers select list so the //request object will have all the users selectAllSelected(); document.modifyGroup.redirect.value="/admin/userGroupView/groups/saveGroup"; document.modifyGroup.action="admin/userGroupView/groups/updateGroup"; document.modifyGroup.submit(); } } function cancelGroup() { document.modifyGroup.action="admin/userGroupView/groups/list.jsp"; document.modifyGroup.submit(); }</script><body marginwidth="0" marginheight="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0"><% String breadcrumb1 = "<a href='admin/index.jsp'>Admin</a>"; %><% String breadcrumb2 = "<a href='admin/userGroupView/index.jsp'>Users and Groups</a>"; %><% String breadcrumb3 = "<a href='admin/userGroupView/groups/list.jsp'>Group List</a>"; %><% String breadcrumb4 = "Modify Group"; %><jsp:include page="/includes/header.jsp" flush="false" > <jsp:param name="title" value="Modify Group" /> <jsp:param name="breadcrumb" value="<%=breadcrumb1%>" /> <jsp:param name="breadcrumb" value="<%=breadcrumb2%>" /> <jsp:param name="breadcrumb" value="<%=breadcrumb3%>" /> <jsp:param name="breadcrumb" value="<%=breadcrumb4%>" /></jsp:include>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?