2 app.controller('createNewSIController',['$scope','$http',function ($scope,$http) {
4 $scope.searchCategory = "";
5 $scope.searchString = "";
8 $scope.selectedSubscriber = $scope.tableData[0];
9 $scope.selectedServiceType = "Select Service Type";
10 function escapeRegExp(str) {
11 return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|\&]/g, " ");
13 $scope.serviceTypes=["Select Service Type", "uCPE-VMS", "SDN-L3-BONDING", "SDN-ETHERNET-INTERNET"];
15 $scope.getSubscribers = function(refresh){
17 var refreshTxt = 'refresh_subscribers';
18 var getTxt = 'get_subscribers';
19 var selectedTxt = getTxt;
21 selectedTxt = refreshTxt;
22 $http.get(selectedTxt).
23 then(function(response){
24 var data = JSON.parse(response.data.result);
25 $scope.tableData = data['customer'];
26 $scope.initSubscriberList();
28 .catch(function(data,status){
29 console.log("Error: " + status + " : " + data);
38 $scope.initSubscriberList = function () {
39 //$scope.selectedSubscriber = $scope.selectedSubscriber['subscriber-name'] || $scope.tableData[0]['subscriber-name'];
40 $scope.selectedSubscriber = 'Select Subscriber Name';
43 $scope.initSrvcTypeList = function () {
44 $scope.selectedServiceType = $scope.serviceTypes[0];
47 $scope.getSubscriberDetails = function(selectedSubscriber){
48 if (selectedSubscriber == 'Select Subscriber Name')
50 $http.get('createsubscriber/' + encodeURIComponent(selectedSubscriber)).
51 then(function(response){
52 // window.location.href = 'createsubscriberdetails.htm';
54 .catch(function(data,status){
55 console.log("Error: " + status + " : " + data);
62 $scope.disableSubmitBtn = function (subName, svcType) {
63 return (typeof subName === "undefined") && (svcType == 'Select Service Type');
64 //return (subName == 'Select Subscriber Name') && (svcType == 'Select Service Type');
67 $scope.cancelCreateSI = function(selectedSubscriber){
69 window.location.href = 'welcome.htm';
73 $scope.getSubscribers(false);
74 //$scope.initSubscriberList();
81 <div ng-controller="createNewSIController">
83 <h1 class="heading1"><center>Create New Service Instance</center></h1>
89 <td width="5%" align="left">
90 <!-- <a ng-click="getSubscriberDetails(selectedSubscriber['global-customer-id']);" ng-disabled="disableSubmitBtn(selectedSubscriber['subscriber-name'], selectedServiceType);" ><img src="static/fusion/images/plus.png"></a>-->
91 <input type="image" ng-click="getSubscriberDetails(selectedSubscriber['global-customer-id']);" ng-disabled="disableSubmitBtn(selectedSubscriber['subscriber-name'], selectedServiceType);" src="static/fusion/images/plus.png"/>
94 <td style="width:10%" align="left"><div class="fn-ebz-container">
95 <label class="fn-ebz-text-label">Subscriber:</label>
97 <td style="width:30%"><div class="fn-ebz-container">
98 <select ng-model="selectedSubscriber" ng-options="resultdata['subscriber-name'] for resultdata in tableData" required>
99 <option value="">Select Subscriber Name</option>
102 <td width="5%" align="left">
103 <input type="image" ng-click="getSubscribers(true);" src="static/fusion/images/refresh.jpg"/>
106 <td width="5%"> </td>
107 <td style="width:10%" align="left">
110 <div class="fn-ebz-container">
111 <label class="fn-ebz-text-label">Service Type:</label>
113 <td style="width:32%"><div class="fn-ebz-container">
114 <select ng-model="selectedServiceType" ng-options="sType for sType in serviceTypes" ng-init="initSrvcTypeList();" ></select>
117 <td width="5%"> </td>
123 <button type="cancel" ng-click="cancelCreateSI();" att-button size="small">Cancel</button>
129 <!-- Temporary solution for footer overlapping the men after talking to EComp SDK developer on 06/16/2016 -->