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 ================================================================================
20 <%@ page import="java.util.*" %>
21 <%@ page import="com.fasterxml.jackson.databind.ObjectMapper" %>
22 <%@ page import="org.json.JSONObject" %>
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" %>
26 <%@ include file="/WEB-INF/fusion/jsp/popup_modal.html" %>
27 <%@ include file="/WEB-INF/fusion/jsp/popup_modal_rolefunction.html" %>
28 <%@ include file="/WEB-INF/fusion/jsp/popup_modal_role.html" %>
29 <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
31 <div ng-controller="postSearchController" >
33 <h1 class="heading1" style="margin-top:20px;">WEBPHONE Search</h1>
35 Please enter search criteria below:<br/>
37 <div class="fn-ebz-container">
39 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.lastName" value="" size="25">
42 <div class="fn-ebz-container">
44 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.firstName" value="" size="25">
47 <div class="fn-ebz-container">
49 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.orgUserId" value="" size="25">
52 <div class="fn-ebz-container">
53 Manager OrgUserId:<br/>
54 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.orgManagerUserId" value="" size="25">
57 <div class="fn-ebz-container">
59 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.orgCode" value="" size="25">
62 <div class="fn-ebz-container">
64 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.email" value="" size="25">
68 <div class="fn-ebz-container" >
70 <div class="fn-ebz-container">
71 <div class="form-field" att-select="sortByList" ng-model="postSearchBean.sortBy1"></div>
78 <div class="fn-ebz-container" >
82 <div class="fn-ebz-container">
83 <div class="form-field" att-select="sortByList" ng-model="postSearchBean.sortBy2"></div>
88 <div class="fn-ebz-container" >
91 <div class="fn-ebz-container">
92 <div class="form-field" att-select="sortByList" ng-model="postSearchBean.sortBy3"></div>
96 <input att-button btn-type="primary" size="small" class="button" type="submit" value="Search" ng-click="search(postSearchBean);" />
98 <input att-button btn-type="primary" size="small" class="button" type="submit" value="Reset" ng-click="reset();"/>
102 <div ng-if="profileList.length != 0">
103 <table att-table table-data="profileList" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
104 <thead att-table-row type="header" >
106 <th att-table-header width="5%" align="left">No</th>
107 <th att-table-header width="30%" key="lastName" align="left">Name</th>
108 <th att-table-header width="5%" key="orgUserId" align="left">OrgUserId</th>
109 <th att-table-header width="10%" key="orgCode" align="left">Organization</th>
110 <th att-table-header width="20%" align="left">Phone</th>
111 <th att-table-header width="20%" key="email" align="left">Email</th>
112 <th att-table-header width="10%" align="left">Import?</th>
116 <tbody att-table-row type="body" row-repeat="profile in profileList" style="max-height: 980px;" ><!-- background colors will alternate not properly with multiple tbody-->
118 <td att-table-body width="5%" align="left">
121 <td att-table-body width="30%" align="left">
122 <div ng-if="ngexistingUsers[profile.orgUserId] == null">
123 {{profile.lastName}}, {{profile.firstName}}
125 <div ng-if="ngexistingUsers[profile.orgUserId] != null">
126 <a href="profile.htm?profile_id={{ngexistingUsers[profile.orgUserId]}}" alt="View/Edit Profile">
127 {{profile.lastName}}, {{profile.firstName}}
132 <td att-table-body width="5%" align="left">
133 {{profile.orgUserId}}
135 <td att-table-body width="10%" align="left">
138 <td att-table-body width="20%" align="left">
141 <td att-table-body width="20%" align="left">
145 <td att-table-body width="10%" align="left">
146 <div ng-if="ngexistingUsers[profile.orgUserId] == null">
147 <div ng-click="toggleSelection(profile);">
148 <input name="selected" type="checkbox" ng-model="profile.selected" att-checkbox/>
151 <div ng-if="ngexistingUsers[profile.orgUserId] != null">
158 <div class="fn-ebz-container">
160 <input class="fn-ebz-text" type="text" ng-model="viewPerPage" size="5" style="width: 47px;">
162 <div class="fn-ebz-container">
164 <input class="fn-ebz-text" type="text" ng-model="currentPage" size="5" style="width: 47px;">
166 <div class="fn-ebz-container">
168 <input class="fn-ebz-text" type="text" ng-model="totalPage" size="5" readonly="true" style="width: 47px;">
171 <div ng-if="profileList.length != 0">
172 <input att-button btn-type="primary" size="small" class="button" type="submit" value="Import" ng-click="process();"/>
182 app.controller('postSearchController', function ($scope,modalService){
184 $scope.viewPerPage = 200;
185 $scope.currentPage = 1;
187 $scope.searchCategory = "";
188 $scope.searchString = "";
190 $scope.noResultsString = "";
192 $scope.postSearchBean=${postSearchBean};
193 $scope.profileList=${profileList};
194 //console.log($scope.postSearchBean);
196 $scope.ngexistingUsers=${existingUsers};
197 console.log($scope.ngexistingUsers);
199 $scope.ocisortByList=${sortByList};
200 $scope.sortByList = [];
201 if($scope.ocisortByList)
202 $.each($scope.ocisortByList, function(i, a){
203 var sortBy = {"index":i, "value":a.value, "title":a.label};
204 $scope.sortByList.push(sortBy);
208 $scope.search = function(postSearchBean) {
209 console.log(postSearchBean);
210 var uuu = "post_search/search";
211 var postData={postSearchBean:postSearchBean};
216 contentType: 'application/json',
217 data: JSON.stringify(postData),
218 success : function(data){
219 $scope.$apply(function(){
220 $scope.profileList=data.postSearchBean.searchResult;
221 //$scope.postSearchBean={};
222 console.log($scope.profileList);
223 if($scope.profileList.length == 0)
224 $scope.noResultsString = "There is currently no one in WEBPHONE matching your search criteria.";
226 $scope.noResultsString = "";
229 error : function(data){
231 modalService.showFailure("Fail","Error while searching: "+ data.responseText);
237 $scope.reset = function() {
238 $scope.postSearchBean={};
239 $scope.profileList=[];
240 $scope.noResultsString = "";
241 //console.log($scope.postSearchBean);
244 $scope.process = function() {
245 $scope.prepareProfileSelection();
246 var uuu = "post_search/process";
247 var postData={postSearchBean:$scope.postSearchBean};
252 contentType: 'application/json',
253 data: JSON.stringify(postData),
254 success : function(data){
255 $scope.$apply(function(){
256 $scope.profileList=data.postSearchBean.searchResult;
257 //$scope.postSearchBean={};
258 $scope.ngexistingUsers=data.existingUsers;
259 $scope.postSearchBean.selected=null;
262 error : function(data){
264 modalService.showFailure("Fail","Error while searching: "+ data.responseText);
269 $scope.importProfileList=[];
270 $scope.toggleSelection = function(profile) {
272 $scope.importProfileList.push(profile);
274 var index = $scope.importProfileList.indexOf(profile);
276 $scope.importProfileList.splice(index, 1);
280 $scope.prepareProfileSelection = function() {
281 if($scope.importProfileList)
282 $.each($scope.importProfileList, function(i, profile){
283 $scope.preparePostSearchBean(profile);
288 $scope.preparePostSearchBean = function(profile) {
289 //console.log('Importing: '+profile.orgUserId);
290 //console.log('ngexistinguser:'+$scope.ngexistingUsers[profile.orgUserId])
291 if($scope.postSearchBean.selected==null){
292 $scope.postSearchBean.selected=[];
293 $scope.postSearchBean.postOrgUserId=[];
294 $scope.postSearchBean.postHrid=[];
295 $scope.postSearchBean.postFirstName=[];
296 $scope.postSearchBean.postLastName=[];
297 $scope.postSearchBean.postOrgCode=[];
298 $scope.postSearchBean.postPhone=[];
299 $scope.postSearchBean.postEmail=[];
300 $scope.postSearchBean.postAddress1=[];
301 $scope.postSearchBean.postAddress2=[];
302 $scope.postSearchBean.postCity=[];
303 $scope.postSearchBean.postState=[];
304 $scope.postSearchBean.postZipCode=[];
305 $scope.postSearchBean.postLocationClli=[];
306 $scope.postSearchBean.postBusinessCountryCode=[];
307 $scope.postSearchBean.postBusinessCountryName=[];
308 $scope.postSearchBean.postDepartment=[];
309 $scope.postSearchBean.postDepartmentName=[];
310 $scope.postSearchBean.postBusinessUnit=[];
311 $scope.postSearchBean.postBusinessUnitName=[];
312 $scope.postSearchBean.postJobTitle=[];
313 $scope.postSearchBean.postOrgManagerUserId=[];
314 $scope.postSearchBean.postCommandChain=[];
315 $scope.postSearchBean.postCompanyCode=[];
316 $scope.postSearchBean.postCompany=[];
317 $scope.postSearchBean.postCostCenter=[];
318 $scope.postSearchBean.postSiloStatus=[];
319 $scope.postSearchBean.postFinancialLocCode=[];
322 $scope.postSearchBean.selected.push(profile.orgUserId);
323 $scope.postSearchBean.postOrgUserId.push(profile.orgUserId);
324 $scope.postSearchBean.postHrid.push(profile.hrid);
325 $scope.postSearchBean.postFirstName.push(profile.firstName);
326 $scope.postSearchBean.postLastName.push(profile.lastName);
327 $scope.postSearchBean.postOrgCode.push(profile.orgCode);
328 $scope.postSearchBean.postPhone.push(profile.phone);
329 $scope.postSearchBean.postEmail.push(profile.email);
330 $scope.postSearchBean.postAddress1.push(profile.address1);
331 $scope.postSearchBean.postAddress2.push(profile.address2);
332 $scope.postSearchBean.postCity.push(profile.city);
333 $scope.postSearchBean.postState.push(profile.state);
334 if(profile.zipCodeSuffix==null)
335 $scope.postSearchBean.postZipCode.push(profile.zipCode);
337 $scope.postSearchBean.postZipCode.push(profile.zipCode+'-'+profile.zipCodeSuffix);
338 $scope.postSearchBean.postLocationClli.push(profile.locationClli);
339 $scope.postSearchBean.postBusinessCountryCode.push(profile.businessCountryCode);
340 $scope.postSearchBean.postBusinessCountryName.push(profile.businessCountryName);
341 $scope.postSearchBean.postDepartment.push(profile.department);
342 $scope.postSearchBean.postDepartmentName.push(profile.departmentName);
343 $scope.postSearchBean.postBusinessUnit.push(profile.businessUnit);
344 $scope.postSearchBean.postBusinessUnitName.push(profile.businessUnitName);
345 $scope.postSearchBean.postJobTitle.push(profile.jobTitle);
346 $scope.postSearchBean.postOrgManagerUserId.push(profile.orgManagerUserId);
347 $scope.postSearchBean.postCommandChain.push(profile.commandChain);
348 $scope.postSearchBean.postCompanyCode.push(profile.companyCode);
349 $scope.postSearchBean.postCompany.push(profile.company);
350 $scope.postSearchBean.postCostCenter.push(profile.costCenter);
351 $scope.postSearchBean.postSiloStatus.push(profile.siloStatus);
352 $scope.postSearchBean.postFinancialLocCode.push(profile.financialLocCode);