aboutsummaryrefslogtreecommitdiffstats
path: root/ecomp-sdk-app/src/main/webapp/WEB-INF/fusion/raptor/custom_header_include.jsp
blob: 0bd373b754a14e22a8f3db2ac22fc4b5d4bcc1f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<%--
  ================================================================================
  eCOMP Portal SDK
  ================================================================================
  Copyright (C) 2017 AT&T Intellectual Property
  ================================================================================
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  ================================================================================
  --%>
<%@ page import="org.openecomp.portalsdk.analytics.model.runtime.*" %>
<%@ page import="org.openecomp.portalsdk.analytics.system.*" %>
<%@ page import="org.openecomp.portalsdk.analytics.util.*" %>

<%@ page import="java.net.*" %>


<script src='dwr/engine.js'></script>
<script src='dwr/util.js'></script>
<script src='dwr/interface/fusionAjax.js'></script>

<%@ include file="/WEB-INF/fusion/jsp/include.jsp" %>

<%
   String url = request.getParameter("returnUrl");

   if (url != null) {
     request.setAttribute("returnUrl", URLDecoder.decode(url, "UTF-8"));
   }

%>

<BODY height="100%">
<form name="listForm" action="<%=request.getAttribute("returnUrl")%>" method="POST" target="_parent">
  <input type="hidden" name="selected" value=""/>
</form>


<!-- Submit record action functionality -->
<script type="text/javascript">
  function submitAction(actionUrl, task, actionUrlParameters) {

   var formFieldParameters = "";	  
   var actionUrlHtml       = actionUrl;
   
   <!-- Keep track of form field params to ensure the refreshed list matches  -->
   <c:if test="${(param['reset_action'] ne 'Y') && (param['reset_action'] ne 'y')}">
     <c:forEach items="${param}" var="request_param">
 	  <c:if test="${fn:startsWith(request_param.key,\"ff\")}">   
	    <c:if test="${!empty request_param.value}">
	      formFieldParameters += "&${request_param.key}=${v:decodeUrl(request_param.value)}";
	    </c:if>   
	  </c:if> 
   </c:forEach>
 </c:if>   

   if (task != null) {
     actionUrlHtml += "?task=" + task;
   }	     

   if (actionUrlParameters != null) {
    actionUrlHtml += "&" + actionUrlParameters; 
   }	     

   
   document.listForm.action = actionUrlHtml + formFieldParameters; 
   document.listForm.submit();	  
  }
</script>
  
<!-- Select Profile functionality -->
<script type="text/javascript">
  function submitSelection() {
    var selectedProfiles = document.listForm.selected;
    var      allProfiles = document.formd.selected;
    var          numRows = null;

    if (allProfiles) {
      numRows = allProfiles.length;

      if (numRows) {
        for (i=0; i < numRows; i++) {
          if (allProfiles[i].checked) {
            selectedProfiles.value += allProfiles[i].value + ",";
          }
        }

        if (selectedProfiles.value != '') {
          selectedProfiles.value = selectedProfiles.value.substring(0, selectedProfiles.value.length-1);
        }
      }
      else {
        if (allProfiles.checked) {
          selectedProfiles.value += allProfiles.value;
        }
      }
    }

    //alert(selectedProfiles.value);
    document.listForm.submit();
  }
</script>


<!-- Profile Search activation/deactivation functionality -->
<script type="text/javascript">
  function toggleUserActive(element, userId) {
    var user_id = "'"+${user.id}+"'";
	if(user_id.length == 0) user_id = 1;
	else
    fusionAjax.toggleUserActive(${user.id}, userId, toggleUserActiveCB);
    return false;
  }

  function toggleUserActiveCB(data) {
    var element = document.getElementById('user_active_' + data);
    if(element.alt == "Activate") {
      element.src = "static/fusion/images/active.gif";
      element.alt = "Inactivate";
    }
    else {
      element.src = "static/fusion/images/inactive.gif";
      element.alt = "Activate";
    }
  }
</script>