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="org.openecomp.portalsdk.core.web.support.UserUtils" %>
21 <%@ page import="org.openecomp.portalsdk.core.web.support.ControllerProperties" %>
22 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %>
24 <%-- <%@ include file="/WEB-INF/fusion/jsp/include.jsp" %> --%>
25 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
26 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
27 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
28 <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
30 <c:set var="clustered" value="<%=(\"true\".equals(SystemProperties.getProperty(SystemProperties.CLUSTERED)))%>"/>
32 <script src="static/fusion/js/moment.min.js"></script>
34 <div class="pageTitle">
37 <c:when test="${!empty param.message_id}">
38 <h1 class="heading1" style="margin-top:20px;">Broadcast Message Edit</h1>
41 <h1 class="heading1" style="margin-top:20px;">Broadcast Message Create</h1>
47 <div ng-controller="broadcastController" >
48 Please edit the broadcast message details below: <br><br>
49 <div class="fn-ebz-container" >
50 <label class="fn-ebz-text-label"><sup><b>*</b></sup>Message Text:</label><BR>
51 <textarea name="comment" ng-model="broadcastMessage.messageText" rows="5" cols="200" style="height:100px"></textarea>
54 <div class="fn-ebz-container" >
55 <label class="fn-ebz-text-label"><sup><b>*</b></sup>Start Date:</label><BR>
56 <input style="display:none" name="startDateHidden" ng-model="broadcastMessage.startDate">
57 <input type="text" class="fn-ebz-text" id="startDatepicker" />
60 <div class="fn-ebz-container" style="margin-left:3em" >
61 <label class="fn-ebz-text-label"><sup><b>*</b></sup>End Date:</label><BR>
62 <input style="display:none" name="endDateHidden" ng-model="broadcastMessage.endDate">
63 <input type="text" class="fn-ebz-text" id="endDatepicker" />
66 <div class="fn-ebz-container" style="margin-left:3em" >
67 <label class="fn-ebz-text-label"><sup><b>*</b></sup>Sort Order:</label><BR>
68 <input type="text" class="fn-ebz-text" ng-model="broadcastMessage.sortOrder"
72 <c:if test="${clustered}">
73 <div class="fn-ebz-container" style="margin-left:1em" >
74 <label class="fn-ebz-text-label">Server:</label><BR>
75 <div class="form-field" att-select="broadcastSites" ng-model="broadcastMessage.siteCd"></div>
80 <button type="submit" ng-click="save();" att-button
81 btn-type="primary" size="small">Save</button>
85 app.controller('broadcastController', function ($scope, modalService, $modal){
86 $scope.broadcastMessage=${broadcastMessage};
87 $scope.broadcastSites=${broadcastSites};
88 console.log($scope.broadcastMessage);
90 $scope.save = function() {
91 var uuu = "broadcast/save";
92 var postData={broadcastMessage: $scope.broadcastMessage};
97 contentType: 'application/json',
98 data: JSON.stringify(postData),
99 success : function(data){
101 window.location.href = "broadcast_list";
103 error : function(data){
104 alert("Error while saving.");
110 $( "#startDatepicker" ).datepicker();
111 $( "#endDatepicker" ).datepicker();
113 var startDateLong = $scope.broadcastMessage.startDate;
114 var tempStartDate = new Date(startDateLong);
115 tempStartDate = moment(tempStartDate).format('MM/DD/YY');//03 Jun 2013 04:15PM EDT
116 console.log(tempStartDate.toString());
117 $( "#startDatepicker" ).val(tempStartDate.toString());
119 var endDateLong = $scope.broadcastMessage.endDate;
120 var tempendDate = new Date(endDateLong);
121 tempendDate = moment(tempendDate).format('MM/DD/YY');//03 Jun 2013 04:15PM EDT
122 console.log(tempendDate.toString());
123 $( "#endDatepicker" ).val(tempendDate.toString());
125 $( "#startDatepicker" ).change(function() {
126 var tempStartDate = moment($( "#startDatepicker" ).val()).format('YYYY-MM-DD hh:mm:ss.S');
127 $scope.broadcastMessage.startDate = new Date(tempStartDate.toString());
129 $( "#endDatepicker" ).change(function() {
130 var tempEndDate = moment($( "#endDatepicker" ).val()).format('YYYY-MM-DD hh:mm:ss.S');
131 $scope.broadcastMessage.endDate = new Date(tempEndDate.toString());