| 7022 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
Option explicit
|
|
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'=====================================================
|
|
|
8 |
' Change Group
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/qstr.asp"-->
|
|
|
14 |
<!--#include file="common/common_subs.asp"-->
|
|
|
15 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
16 |
<!--#include file="common/_popup_window_common.asp"-->
|
|
|
17 |
<!--#include file="common/daemon_instructions.asp"-->
|
|
|
18 |
<%
|
|
|
19 |
'------------ ACCESS CONTROL ------------------
|
|
|
20 |
%>
|
|
|
21 |
<!--#include file="_access_control_login_optional.asp"-->
|
|
|
22 |
<!--#include file="_access_control_general.asp"-->
|
|
|
23 |
<!--#include file="_access_control_project.asp"-->
|
|
|
24 |
<%
|
|
|
25 |
'------------ Variable Definition -------------
|
|
|
26 |
Dim sMessage, sMessageType
|
|
|
27 |
'------------ Constants Declaration -----------
|
|
|
28 |
'------------ Variable Init -------------------
|
|
|
29 |
sMessage = NULL
|
|
|
30 |
sMessageType = 3
|
|
|
31 |
'----------------------------------------------
|
|
|
32 |
%>
|
|
|
33 |
<%
|
|
|
34 |
'------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
35 |
' Add a line of text to the System Message
|
|
|
36 |
'
|
|
|
37 |
Sub sMessageAdd(eLevel, text)
|
|
|
38 |
If NOT isNull(sMessage) Then
|
|
|
39 |
sMessage = sMessage & "<br>"
|
|
|
40 |
End If
|
|
|
41 |
sMessage = sMessage & text
|
|
|
42 |
|
|
|
43 |
If eLevel < sMessageType Then
|
|
|
44 |
sMessageType = eLevel
|
|
|
45 |
End If
|
|
|
46 |
End Sub
|
|
|
47 |
'------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
48 |
'Call sMessageAdd(1,"Just a Test")
|
|
|
49 |
%>
|
|
|
50 |
<script src="jquery/jquery-ui-timepicker-addon.js?ver=<%=VixVerNum%>"></script>
|
|
|
51 |
<link rel="stylesheet" href="jquery/jquery-ui-timepicker-addon.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
52 |
<script type="text/javascript" charset="utf-8">
|
|
|
53 |
// This function will be called by vixDialog() when the dialoag has been loaded
|
|
|
54 |
// Intended use: Init the javascript items
|
|
|
55 |
function buildPkgInit () {
|
|
|
56 |
var myDateTimePicker = null;
|
|
|
57 |
|
|
|
58 |
$('#cancel').click(function(){
|
|
|
59 |
closeIFrame();
|
|
|
60 |
});
|
|
|
61 |
|
|
|
62 |
$('#release').click(function(){
|
|
|
63 |
var data = getScheduledTime();
|
|
|
64 |
console.log("Scheduled Date:", data);
|
|
|
65 |
debugger;
|
|
|
66 |
displayError();
|
|
|
67 |
if ( data && data.delta <=0 ) {
|
|
|
68 |
displayError('Scheduled time is now in the past');
|
|
|
69 |
return false;
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
$("#progressBar").css('visibility', 'visible');
|
|
|
73 |
window.location.href = '_make_approved.asp?' + jQuery.param({
|
|
|
74 |
pv_id : '<%=Request("pv_id")%>',
|
|
|
75 |
rtag_id : '<%=Request("rtag_id")%>',
|
|
|
76 |
rfile : '<%=RequestDefault("rfile", "dependencies.asp")%>',
|
|
|
77 |
sched : data ? data.txt : null
|
|
|
78 |
}) ;
|
|
|
79 |
}).focus();
|
|
|
80 |
|
|
|
81 |
function displayError(txt, detail) {
|
|
|
82 |
if ( txt ) {
|
|
|
83 |
if ( detail ) {
|
|
|
84 |
txt += ": " + detail;
|
|
|
85 |
}
|
|
|
86 |
$('#errorPane').removeClass('display-none').html(txt);
|
|
|
87 |
} else {
|
|
|
88 |
$('#errorPane').addClass('display-none').html('');
|
|
|
89 |
}
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
$('#schedule').click(function(){
|
|
|
93 |
if ( $(this).prop('checked') ) {
|
|
|
94 |
$('#showdate').removeClass('display-none');
|
|
|
95 |
myDateTimePicker = $('#datetime').datetimepicker(
|
|
|
96 |
{
|
|
|
97 |
timeFormat: "HH:mm z",
|
|
|
98 |
//dateFormat: "D dd-M-yy",
|
|
|
99 |
controlType: 'select',
|
|
|
100 |
closeText: 'Done',
|
|
|
101 |
oneLine: true,
|
|
|
102 |
timeInput: true,
|
|
|
103 |
showTimezone : true,
|
|
|
104 |
constrainInput: true,
|
|
|
105 |
showOn: 'both',
|
|
|
106 |
buttonImageOnly : true,
|
|
|
107 |
buttonImage: "images/cal.gif",
|
|
|
108 |
buttonText: "Select Date and Time",
|
|
|
109 |
minDate : 0,
|
|
|
110 |
maxDate : 3,
|
|
|
111 |
onClose : function(p1,p2){
|
|
|
112 |
console.log("Close", p1 );
|
|
|
113 |
},
|
|
|
114 |
onSelect : function(p1,p2){
|
|
|
115 |
console.log("Select", p1 );
|
|
|
116 |
getScheduledTime();
|
|
|
117 |
},
|
|
|
118 |
});
|
|
|
119 |
myDateTimePicker.datetimepicker('setDate', (new Date()));
|
|
|
120 |
getScheduledTime();
|
|
|
121 |
|
|
|
122 |
} else {
|
|
|
123 |
$('#datetime').datepicker( "destroy" );
|
|
|
124 |
$('#showdate').addClass('display-none');
|
|
|
125 |
myDateTimePicker = null;
|
|
|
126 |
}
|
|
|
127 |
});
|
|
|
128 |
|
|
|
129 |
function getScheduledTime() {
|
|
|
130 |
if ( myDateTimePicker ) {
|
|
|
131 |
// Convert to Perth timezime 8 hours ahead of GMT
|
|
|
132 |
// Then pick the essential bits out of the structure
|
|
|
133 |
var myTZO = 480;
|
|
|
134 |
tpDate = new Date(myDateTimePicker.datetimepicker('getDate'));
|
|
|
135 |
//var perthTime=new Date(tpDate.getTime() + (60000*(tpDate.getTimezoneOffset() + myTZO)));
|
|
|
136 |
var perthTime=new Date(tpDate.getTime() + (60000* myTZO));
|
|
|
137 |
console.log('new', perthTime);
|
|
|
138 |
var txt = perthTime.toISOString().substr(0, 19).replace('T', ' ');
|
|
|
139 |
|
|
|
140 |
// Calculate distance ino the future for display purposes
|
|
|
141 |
var now = new Date();
|
|
|
142 |
var delta = 60 * Math.trunc((tpDate / 1000 / 60) - (now / 1000 / 60));
|
|
|
143 |
|
|
|
144 |
var seconds = delta;
|
|
|
145 |
var days = Math.floor(seconds / (3600*24));
|
|
|
146 |
seconds -= days*3600*24;
|
|
|
147 |
var hrs = Math.floor(seconds / 3600);
|
|
|
148 |
seconds -= hrs*3600;
|
|
|
149 |
var mnts = Math.floor(seconds / 60);
|
|
|
150 |
seconds -= mnts*60;
|
|
|
151 |
var result = days +"d "+hrs+"h "+mnts+"m";
|
|
|
152 |
|
|
|
153 |
|
|
|
154 |
$('#otime').text(txt);
|
|
|
155 |
$('#ofuture').text(result);
|
|
|
156 |
return {txt: txt, delta: delta};
|
|
|
157 |
}
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
}
|
|
|
161 |
</script>
|
|
|
162 |
<div class='Panel tight' style="width:100%">
|
|
|
163 |
<div class=PanelPad>
|
|
|
164 |
<!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
165 |
<%Call Messenger ( sMessage , sMessageType, "100%" )%>
|
|
|
166 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
167 |
<!--#include file="messages/_msg_inline.asp"-->
|
|
|
168 |
</div>
|
|
|
169 |
<div class='textPanel PanelPad'>
|
|
|
170 |
<img src="images/i_warning.gif" style="float:left; margin:0 7px 20px 0;">
|
|
|
171 |
<span>Approve this package for autobuild</span>
|
|
|
172 |
</div>
|
|
|
173 |
<div id=showdate class=display-none>
|
|
|
174 |
<div class='textPanel PanelPad' id=datetime></div>
|
|
|
175 |
<div>Perth Time: <span id=otime></span></div>
|
|
|
176 |
<div>In: <span id=ofuture></span></div>
|
|
|
177 |
</div>
|
|
|
178 |
<div class='buttonPanelWhite ui-widget-content ui-dialog-buttonpane'>
|
|
|
179 |
<span class=fleft><input type=checkbox id=schedule>Schedule</span>
|
|
|
180 |
<span id='progressBar' style='visibility:hidden;'><img src='icons/i_processing.gif' width='79' height='14'></span>
|
|
|
181 |
<button id=release>Release</button>
|
|
|
182 |
<button id=cancel>Cancel</button>
|
|
|
183 |
</div>
|
|
|
184 |
<div id=errorPane class='display-none errorPanel PanelPadTop'></div>
|
|
|
185 |
</div>
|
|
|
186 |
<!-- DESTRUCTOR ------->
|
|
|
187 |
<!--#include file="common/destructor.asp"-->
|