2 ================================================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property
6 ================================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ================================================================================
21 <%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp" %> --%>
23 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
24 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
25 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
27 <link rel="stylesheet" type="text/css" href="static/ebz/sandbox.css" >
28 <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
30 <script src= "static/ebz/angular_js/angular.js"></script>
31 <script src= "static/ebz/angular_js/angular-sanitize.js"></script>
32 <script src= "static/ebz/angular_js/att_abs_tpls.js"></script>
33 <script src= "static/ebz/angular_js/app.js"></script>
34 <script src= "static/ebz/angular_js/gestures.js"></script>
36 <script src="static/js/jquery-1.10.2.js"></script>
37 <script src="static/js/modalService.js"></script>
38 <script src="static/js/jquery.mask.min.js" type="text/javascript"></script>
39 <script src="static/js/jquery-ui.js" type="text/javascript"></script>
40 <%@ include file="/WEB-INF/fusion/jsp/popup_modal_rolefunction.html" %>
41 <div ng-controller="roleFunctionListController" >
42 <div class="pageTitle">
44 <h1 class="heading1" style="margin-top:20px;">Role Functions</h1>
46 <a ng-click="addNewRoleFunctionModalPopup();" class="icon-add" size="small" ></a>
52 Click on the edit icon to update a role function, the plus icon to add additional role functions, or the delete icon to remove them.
54 <div id="rolesTable" title="Role Functions">
55 <table att-table table-data="availableRoleFunctions" current-page="1">
56 <thead att-table-row type="header">
58 <th att-table-header width="70%">Name</th>
59 <th att-table-header width="10%">Code</th>
60 <th att-table-header width="10%">Edit?</th>
61 <th att-table-header width="10%">Delete?</th>
64 <tbody att-table-row type="body" row-repeat="availableRoleFunction in availableRoleFunctions" style="max-height: 980px;" ><!-- background colors will alternate not properly with multiple tbody-->
66 <td att-table-body width="70%">{{ availableRoleFunction.name }}</td>
67 <td att-table-body width="10%">{{ availableRoleFunction.code }}</td>
68 <td att-table-body width="10%">
69 <!-- <a ng-click="editRoleFunctionPopup(availableRoleFunction);" >
70 <img src="static/fusion/images/editicon.gif">
72 <div ng-click="editRoleFunctionModalPopup(availableRoleFunction);" style="font-size:20px;"><a href="javascript:void(0)" class="icon-edit"></a></div>
74 <td att-table-body width="10%">
75 <!-- <a ng-click="removeRole(availableRoleFunction);" ><img src="static/fusion/images/deleteicon.gif"></a> -->
76 <div ng-click="removeRole(availableRoleFunction);" style="font-size:20px;"><a href="javascript:void(0)" class="icon-trash"></a></div>
83 <!-- <div align="left" style="marin-bottom: 50px;"> -->
84 <!-- <button type="submit" onClick="window.location='role_function.htm';" att-button -->
85 <!-- btn-type="primary" size="small">Create</button> -->
88 <div id="dialog" title="Add Role Function">
90 <div class="fn-ebz-container" >
91 <label class="fn-ebz-text-label"><sup><b>*</b></sup>Name:</label><br>
92 <input type="text" class="fn-ebz-text" ng-model="editRoleFunction.name"
96 <div class="fn-ebz-container" >
97 <label class="fn-ebz-text-label"><sup><b>*</b></sup>Code:</label><br>
98 <input type="text" class="fn-ebz-text" ng-model="editRoleFunction.code" ng-disabled="editRoleFunction.code!=null"
102 <button type="submit" ng-click="saveRoleFunction(editRoleFunction);" att-button
103 btn-type="primary" size="small">Save</button>
113 app.controller('roleFunctionListController', function ($scope, modalService, $modal){
114 $( "#dialog" ).hide();
115 $scope.availableRoleFunctions=${availableRoleFunctions};
118 $scope.editRoleFunction = null;
120 $scope.editRoleFunctionPopup = function(availableRoleFunction) {
121 $scope.editRoleFunction = availableRoleFunction;
122 $( "#dialog" ).dialog({
127 $scope.editRoleFunctionModalPopup = function(availableRoleFunction) {
128 $scope.editRoleFunction = availableRoleFunction;
129 var modalInstance = $modal.open({
130 templateUrl: 'edit_role_function_popup.html',
131 controller: 'rolefunctionpopupController',
133 message: function () {
135 availableRoleFunction: $scope.editRoleFunction
141 modalInstance.result.then(function(response){
142 console.log('response', response);
143 $scope.availableRoleFunctions=response.availableRoleFunctions;
147 $scope.addNewRoleFunctionModalPopup = function(availableRoleFunction) {
148 $scope.editRoleFunction = null;
149 var modalInstance = $modal.open({
150 templateUrl: 'edit_role_function_popup.html',
151 controller: 'rolefunctionpopupController',
153 message: function () {
155 availableRoleFunction: $scope.editRoleFunction
161 modalInstance.result.then(function(response){
162 console.log('response', response);
163 $scope.availableRoleFunctions=response.availableRoleFunctions;
167 $scope.addNewRoleFunctionPopup = function() {
168 $scope.editRoleFunction = null;
169 $( "#dialog" ).dialog({
174 $scope.saveRoleFunction = function(availableRoleFunction) {
175 var uuu = "role_function_list/saveRoleFunction.htm";
176 var postData={availableRoleFunction: availableRoleFunction};
181 contentType: 'application/json',
182 data: JSON.stringify(postData),
183 success : function(data){
184 $scope.$apply(function(){
185 $scope.availableRoleFunctions=[];$scope.$apply();
186 $scope.availableRoleFunctions=data.availableRoleFunctions;});
187 //alert("Update Successful.") ;
188 console.log($scope.availableRoleFunctions);
190 $scope.editRoleFunction = null;
191 $( "#dialog" ).dialog("close");
193 error : function(data){
194 alert("Error while saving.");
200 $scope.removeRole = function(availableRoleFunction) {
201 if (confirm("You are about to delete the role function "+availableRoleFunction.name+". Do you want to continue?")) {
202 //alert('deleted'+roleFunction.name);
203 var uuu = "role_function_list/removeRoleFunction.htm";
204 var postData={availableRoleFunction: availableRoleFunction};
209 contentType: 'application/json',
210 data: JSON.stringify(postData),
211 success : function(data){
212 $scope.$apply(function(){$scope.availableRoleFunctions=data.availableRoleFunctions;});
214 error : function(data){
216 alert("Error while deleting: "+ data.responseText);