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" %>
24 <%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp"%> --%>
26 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
27 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
28 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
30 <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
32 <script src= "static/ebz/angular_js/angular.js"></script>
33 <script src= "static/ebz/angular_js/angular-sanitize.js"></script>
34 <script src="static/ebz/sandbox/att-abs-tpls.js" type="text/javascript"></script>
35 <script src= "static/ebz/angular_js/app.js"></script>
36 <script src= "static/ebz/angular_js/gestures.js"></script>
37 <script src="static/js/jquery-1.10.2.js"></script>
38 <script src="static/js/modalService.js"></script>
39 <script src="static/js/jquery.mask.min.js" type="text/javascript"></script>
40 <script src="static/js/jquery-ui.js" type="text/javascript"></script>
42 <div ng-controller="postSearchController" >
44 <h1 class="heading1" style="margin-top:20px;">WEBPHONE Search</h1>
46 <div class="pageTitle"><fmt:message key="post-search.title"/></div>
49 Please enter search criteria below:<br/>
51 <div class="fn-ebz-container">
53 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.lastName" value="" size="25">
56 <div class="fn-ebz-container">
58 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.firstName" value="" size="25">
61 <div class="fn-ebz-container">
63 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.sbcid" value="" size="25">
66 <div class="fn-ebz-container">
68 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.managerAttuid" value="" size="25">
71 <div class="fn-ebz-container">
73 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.orgCode" value="" size="25">
76 <div class="fn-ebz-container">
78 <input class="fn-ebz-text" type="text" ng-model="postSearchBean.email" value="" size="25">
82 <div class="fn-ebz-container" >
84 <div class="fn-ebz-container">
85 <div class="form-field" att-select="sortByList" ng-model="postSearchBean.sortBy1"></div>
92 <div class="fn-ebz-container" >
96 <div class="fn-ebz-container">
97 <div class="form-field" att-select="sortByList" ng-model="postSearchBean.sortBy2"></div>
102 <div class="fn-ebz-container" >
105 <div class="fn-ebz-container">
106 <div class="form-field" att-select="sortByList" ng-model="postSearchBean.sortBy3"></div>
110 <input att-button btn-type="primary" size="small" class="button" type="submit" value="Search" ng-click="search(postSearchBean);" />
112 <input att-button btn-type="primary" size="small" class="button" type="submit" value="Reset" ng-click="reset();"/>
116 <div ng-if="profileList.length != 0">
117 <table att-table table-data="profileList" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
118 <thead att-table-row type="header" >
120 <th att-table-header width="5%" align="left">No</th>
121 <th att-table-header width="30%" key="lastName" align="left">Name</th>
122 <th att-table-header width="5%" key="sbcid" align="left">ATTUID</th>
123 <th att-table-header width="10%" key="orgCode" align="left">Organization</th>
124 <th att-table-header width="20%" align="left">Phone</th>
125 <th att-table-header width="20%" key="email" align="left">Email</th>
126 <th att-table-header width="10%" align="left">Import?</th>
130 <tbody att-table-row type="body" row-repeat="profile in profileList" style="max-height: 980px;" ><!-- background colors will alternate not properly with multiple tbody-->
132 <td att-table-body width="5%" align="left">
135 <td att-table-body width="30%" align="left">
136 <div ng-if="ngexistingUsers[profile.sbcid] == null">
137 {{profile.lastName}}, {{profile.firstName}}
139 <div ng-if="ngexistingUsers[profile.sbcid] != null">
140 <a href="profile.htm?profile_id={{ngexistingUsers[profile.sbcid]}}" alt="View/Edit Profile">
141 {{profile.lastName}}, {{profile.firstName}}
146 <td att-table-body width="5%" align="left">
149 <td att-table-body width="10%" align="left">
152 <td att-table-body width="20%" align="left">
155 <td att-table-body width="20%" align="left">
159 <td att-table-body width="10%" align="left">
160 <div ng-if="ngexistingUsers[profile.sbcid] == null">
161 <div ng-click="toggleSelection(profile);">
162 <input name="selected" type="checkbox" ng-model="profile.selected" att-checkbox/>
165 <div ng-if="ngexistingUsers[profile.sbcid] != null">
172 <div class="fn-ebz-container">
174 <input class="fn-ebz-text" type="text" ng-model="viewPerPage" size="5" style="width: 47px;">
176 <div class="fn-ebz-container">
178 <input class="fn-ebz-text" type="text" ng-model="currentPage" size="5" style="width: 47px;">
180 <div class="fn-ebz-container">
182 <input class="fn-ebz-text" type="text" ng-model="totalPage" size="5" readonly="true" style="width: 47px;">
185 <div ng-if="profileList.length != 0">
186 <input att-button btn-type="primary" size="small" class="button" type="submit" value="Import" ng-click="process();"/>
196 app.controller('postSearchController', function ($scope){
198 $scope.viewPerPage = 200;
199 $scope.currentPage = 1;
201 $scope.searchCategory = "";
202 $scope.searchString = "";
204 $scope.noResultsString = "";
206 $scope.postSearchBean=${postSearchBean};
207 $scope.profileList=${profileList};
208 //console.log($scope.postSearchBean);
210 $scope.ngexistingUsers=${existingUsers};
211 console.log($scope.ngexistingUsers);
213 $scope.ocisortByList=${sortByList};
214 $scope.sortByList = [];
215 if($scope.ocisortByList)
216 $.each($scope.ocisortByList, function(i, a){
217 var sortBy = {"index":i, "value":a.value, "title":a.label};
218 $scope.sortByList.push(sortBy);
222 $scope.search = function(postSearchBean) {
223 console.log(postSearchBean);
224 var uuu = "post_search/search";
225 var postData={postSearchBean:postSearchBean};
230 contentType: 'application/json',
231 data: JSON.stringify(postData),
232 success : function(data){
233 $scope.$apply(function(){
234 $scope.profileList=data.postSearchBean.searchResult;
235 //$scope.postSearchBean={};
236 console.log($scope.profileList);
237 if($scope.profileList.length == 0)
238 $scope.noResultsString = "There is currently no one matching your search criteria.";
240 $scope.noResultsString = "";
243 error : function(data){
245 alert("Error while searching: "+ data.responseText);
251 $scope.reset = function() {
252 $scope.postSearchBean={};
253 $scope.profileList=[];
254 $scope.noResultsString = "";
255 //console.log($scope.postSearchBean);
258 $scope.process = function() {
259 $scope.prepareProfileSelection();
260 var uuu = "post_search/process";
261 var postData={postSearchBean:$scope.postSearchBean};
266 contentType: 'application/json',
267 data: JSON.stringify(postData),
268 success : function(data){
269 $scope.$apply(function(){
270 $scope.profileList=data.postSearchBean.searchResult;
271 //$scope.postSearchBean={};
272 $scope.ngexistingUsers=data.existingUsers;
273 $scope.postSearchBean.selected=null;
276 error : function(data){
278 alert("Error while searching: "+ data.responseText);
283 $scope.importProfileList=[];
284 $scope.toggleSelection = function(profile) {
286 $scope.importProfileList.push(profile);
288 var index = $scope.importProfileList.indexOf(profile);
290 $scope.importProfileList.splice(index, 1);
294 $scope.prepareProfileSelection = function() {
295 if($scope.importProfileList)
296 $.each($scope.importProfileList, function(i, profile){
297 $scope.preparePostSearchBean(profile);
302 $scope.preparePostSearchBean = function(profile) {
303 //console.log('Importing: '+profile.sbcid);
304 //console.log('ngexistinguser:'+$scope.ngexistingUsers[profile.sbcid])
305 if($scope.postSearchBean.selected==null){
306 $scope.postSearchBean.selected=[];
307 $scope.postSearchBean.postSbcid=[];
308 $scope.postSearchBean.postHrid=[];
309 $scope.postSearchBean.postFirstName=[];
310 $scope.postSearchBean.postLastName=[];
311 $scope.postSearchBean.postOrgCode=[];
312 $scope.postSearchBean.postPhone=[];
313 $scope.postSearchBean.postEmail=[];
314 $scope.postSearchBean.postAddress1=[];
315 $scope.postSearchBean.postAddress2=[];
316 $scope.postSearchBean.postCity=[];
317 $scope.postSearchBean.postState=[];
318 $scope.postSearchBean.postZipCode=[];
319 $scope.postSearchBean.postLocationClli=[];
320 $scope.postSearchBean.postBusinessCountryCode=[];
321 $scope.postSearchBean.postBusinessCountryName=[];
322 $scope.postSearchBean.postDepartment=[];
323 $scope.postSearchBean.postDepartmentName=[];
324 $scope.postSearchBean.postBusinessUnit=[];
325 $scope.postSearchBean.postBusinessUnitName=[];
326 $scope.postSearchBean.postJobTitle=[];
327 $scope.postSearchBean.postManagerAttuid=[];
328 $scope.postSearchBean.postCommandChain=[];
329 $scope.postSearchBean.postCompanyCode=[];
330 $scope.postSearchBean.postCompany=[];
331 $scope.postSearchBean.postCostCenter=[];
332 $scope.postSearchBean.postSiloStatus=[];
333 $scope.postSearchBean.postFinancialLocCode=[];
336 $scope.postSearchBean.selected.push(profile.sbcid);
337 $scope.postSearchBean.postSbcid.push(profile.sbcid);
338 $scope.postSearchBean.postHrid.push(profile.hrid);
339 $scope.postSearchBean.postFirstName.push(profile.firstName);
340 $scope.postSearchBean.postLastName.push(profile.lastName);
341 $scope.postSearchBean.postOrgCode.push(profile.orgCode);
342 $scope.postSearchBean.postPhone.push(profile.phone);
343 $scope.postSearchBean.postEmail.push(profile.email);
344 $scope.postSearchBean.postAddress1.push(profile.address1);
345 $scope.postSearchBean.postAddress2.push(profile.address2);
346 $scope.postSearchBean.postCity.push(profile.city);
347 $scope.postSearchBean.postState.push(profile.state);
348 if(profile.zipCodeSuffix==null)
349 $scope.postSearchBean.postZipCode.push(profile.zipCode);
351 $scope.postSearchBean.postZipCode.push(profile.zipCode+'-'+profile.zipCodeSuffix);
352 $scope.postSearchBean.postLocationClli.push(profile.locationClli);
353 $scope.postSearchBean.postBusinessCountryCode.push(profile.businessCountryCode);
354 $scope.postSearchBean.postBusinessCountryName.push(profile.businessCountryName);
355 $scope.postSearchBean.postDepartment.push(profile.department);
356 $scope.postSearchBean.postDepartmentName.push(profile.departmentName);
357 $scope.postSearchBean.postBusinessUnit.push(profile.businessUnit);
358 $scope.postSearchBean.postBusinessUnitName.push(profile.businessUnitName);
359 $scope.postSearchBean.postJobTitle.push(profile.jobTitle);
360 $scope.postSearchBean.postManagerAttuid.push(profile.managerAttuid);
361 $scope.postSearchBean.postCommandChain.push(profile.commandChain);
362 $scope.postSearchBean.postCompanyCode.push(profile.companyCode);
363 $scope.postSearchBean.postCompany.push(profile.company);
364 $scope.postSearchBean.postCostCenter.push(profile.costCenter);
365 $scope.postSearchBean.postSiloStatus.push(profile.siloStatus);
366 $scope.postSearchBean.postFinancialLocCode.push(profile.financialLocCode);