| 5344 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'|
|
|
|
5 |
'| _iframe_pkgs_followed.asp
|
|
|
6 |
'| This page is designed to be called from within an IFRAME
|
|
|
7 |
'|
|
|
|
8 |
'| Follow specified package in one or more projects
|
|
|
9 |
'|
|
|
|
10 |
'=====================================================
|
|
|
11 |
%>
|
|
|
12 |
<%
|
|
|
13 |
Option explicit
|
|
|
14 |
' Good idea to set when using redirect
|
|
|
15 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
16 |
%>
|
|
|
17 |
<!--#include file="common/conf.asp"-->
|
|
|
18 |
<!--#include file="common/globals.asp"-->
|
|
|
19 |
<!--#include file="common/formating.asp"-->
|
|
|
20 |
<!--#include file="common/qstr.asp"-->
|
|
|
21 |
<!--#include file="common/common_subs.asp"-->
|
|
|
22 |
<!--#include file="common/_form_window_common.asp"-->
|
|
|
23 |
<%
|
|
|
24 |
'------------ ACCESS CONTROL ------------------
|
|
|
25 |
%>
|
|
|
26 |
<!--#include file="_access_control_login.asp"-->
|
|
|
27 |
<!--#include file="_access_control_general.asp"-->
|
|
|
28 |
<%
|
|
|
29 |
'------------ Variable Definition -------------
|
|
|
30 |
Dim rsTemp
|
|
|
31 |
Dim parProjId
|
|
|
32 |
Dim parPkgId
|
|
|
33 |
'------------ Constants Declaration -----------
|
|
|
34 |
'------------ Variable Init -------------------
|
|
|
35 |
parProjId = Request("proj_id")
|
|
|
36 |
parPkgId = Request("pkg_id")
|
|
|
37 |
'----------------------------------------------
|
|
|
38 |
|
|
|
39 |
Function Get_My_Interest_Packages ( NNuser_id )
|
|
|
40 |
Get_My_Interest_Packages = _
|
|
|
41 |
"WITH Followed AS" &_
|
|
|
42 |
" (SELECT PRJ.proj_id," &_
|
|
|
43 |
" PRJ.proj_name," &_
|
|
|
44 |
" 1 AS inUse" &_
|
|
|
45 |
" FROM PACKAGE_INTEREST PI," &_
|
|
|
46 |
" PROJECTS PRJ" &_
|
|
|
47 |
" WHERE PI.USER_ID = " & NNuser_id &_
|
|
|
48 |
" AND PI.PKG_ID = " & parPkgId &_
|
|
|
49 |
" AND PI.PROJ_ID = PRJ.PROJ_ID" &_
|
|
|
50 |
" )" &_
|
|
|
51 |
"SELECT prj.proj_id," &_
|
|
|
52 |
" prj.proj_name," &_
|
|
|
53 |
" NVL(Followed.inUse,0) as Followed" &_
|
|
|
54 |
" FROM PROJECTS PRJ," &_
|
|
|
55 |
" Followed" &_
|
|
|
56 |
" WHERE prj.proj_id = Followed.proj_id (+)" &_
|
|
|
57 |
" ORDER BY upper(PRJ.PROJ_NAME)"
|
|
|
58 |
End Function
|
|
|
59 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
60 |
%>
|
|
|
61 |
<html>
|
|
|
62 |
<head>
|
|
|
63 |
<title>Release Manager</title>
|
| 5357 |
dpurdie |
64 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
| 5344 |
dpurdie |
65 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
66 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
67 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
68 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
69 |
<!--#include file="_jquery_includes.asp"-->
|
|
|
70 |
<script language="javascript">
|
|
|
71 |
$(document).ready(function () {
|
|
|
72 |
// Cancel button must close this iFrame using a function provided by the parent
|
|
|
73 |
$('#btn_cancel').on('click', function (e) {parent.closeIFrame()});
|
|
|
74 |
|
|
|
75 |
// Restore the state of the checkboxes
|
|
|
76 |
$('#btn_reset').on('click', function (e) {
|
|
|
77 |
$('input.checkbox1[type="checkbox"]').prop("checked", false);
|
|
|
78 |
$('input.checkbox0[type="checkbox"]').prop("checked", true);
|
|
|
79 |
$('#btn_checkAll').prop("checked", false);
|
|
|
80 |
$('#checktable').trigger('change');
|
|
|
81 |
});
|
|
|
82 |
|
|
|
83 |
// Table all the tick boxes
|
|
|
84 |
$('#btn_checkAll').on('change', function (e){
|
|
|
85 |
var isChecked = $(this).prop("checked");
|
|
|
86 |
$(".checkbox1").prop('checked', isChecked);
|
|
|
87 |
$(".checkbox0").prop('checked', isChecked);
|
|
|
88 |
$('#checktable').trigger('change');
|
|
|
89 |
});
|
|
|
90 |
|
|
|
91 |
// Enable Update/Reset button when there is work to be done
|
|
|
92 |
$('#checktable').on('change', function (e){
|
|
|
93 |
var count = $('input.checkbox1[type="checkbox"]:checked').length;
|
|
|
94 |
count += $('input.checkbox0[type="checkbox"]:not(:checked)').length;
|
|
|
95 |
$('#btn_update').prop('disabled', count <= 0);
|
|
|
96 |
$('#btn_reset').prop('disabled', count <= 0);
|
|
|
97 |
});
|
|
|
98 |
|
|
|
99 |
// Show Hide projects
|
|
|
100 |
$('#btn_checkHide').on('change', function (e) {
|
|
|
101 |
if($(this).prop("checked"))
|
|
|
102 |
{
|
|
|
103 |
$('input.checkbox1[type="checkbox"]').closest('tr').css('display', '');
|
|
|
104 |
$('#eline1').text('Showing All projects');
|
|
|
105 |
}
|
|
|
106 |
else
|
|
|
107 |
{
|
|
|
108 |
$('input.checkbox1[type="checkbox"]').closest('tr').css('display', 'none');
|
|
|
109 |
$('#eline1').text('Showing active projects');
|
|
|
110 |
}
|
|
|
111 |
});
|
|
|
112 |
|
|
|
113 |
// Update checked projects in the watchlist
|
|
|
114 |
$('#btn_update').on('click', function(){
|
|
|
115 |
vixConfirm("Update Notifications to the selected projects.", {ok : updateProjects});
|
|
|
116 |
});
|
|
|
117 |
|
|
|
118 |
// Delete notifications for this package in selected projects
|
|
|
119 |
function updateProjects()
|
|
|
120 |
{
|
|
|
121 |
console.log("updateProjects");
|
|
|
122 |
var projectList = [];
|
|
|
123 |
$('input.checkbox1[type="checkbox"]:checked').each(function(){
|
|
|
124 |
projectList.push($(this).data('proj_id'));
|
|
|
125 |
});
|
|
|
126 |
|
|
|
127 |
var projectRmList = [];
|
|
|
128 |
$('input.checkbox0[type="checkbox"]:not(:checked)').each(function(){
|
|
|
129 |
projectRmList.push($(this).data('proj_id'));
|
|
|
130 |
});
|
|
|
131 |
|
|
|
132 |
console.log('ListAdd:',projectList.join());
|
|
|
133 |
console.log('ListDel:',projectRmList.join());
|
|
|
134 |
$('#eline1').empty();
|
|
|
135 |
$('#eline2').empty();
|
|
|
136 |
$.ajax({
|
|
|
137 |
type : 'POST',
|
|
|
138 |
url : '_json_Notifications.asp',
|
|
|
139 |
data : {Opr : 'updateProjects', pkg_id : '<%=parPkgId%>', alist : projectList.join(), rlist : projectRmList.join()},
|
|
|
140 |
dataType : 'json',
|
|
|
141 |
}).fail(function( jqXHR, textStatus, errorThrown ){
|
|
|
142 |
$('#eline1').text('Ajax Processing Error');
|
|
|
143 |
$('#eline2').text(errorThrown);
|
|
|
144 |
}).done(function( data, textStatus, jqXHR ){
|
|
|
145 |
if (typeof data.result === undefined){
|
|
|
146 |
vixAlert('Ajax Error. Unexpected result');
|
|
|
147 |
$('#eline1').text('Ajax Error. Unexpected result');
|
|
|
148 |
} else if (data.result != 0){
|
|
|
149 |
$('#eline1').text('Processing Error:' + data.emsgSummary);
|
|
|
150 |
$('#eline2').text(data.emsgDetails);
|
|
|
151 |
} else {
|
|
|
152 |
// Delete checked items
|
|
|
153 |
$('input.checkbox1[type="checkbox"]:checked').removeClass("checkbox1").addClass("checkbox0");
|
|
|
154 |
$('input.checkbox0[type="checkbox"]:not(:checked)').removeClass("checkbox0").addClass("checkbox1");
|
|
|
155 |
$('#checktable').trigger('change');
|
|
|
156 |
}
|
|
|
157 |
});
|
|
|
158 |
}
|
|
|
159 |
});
|
|
|
160 |
</script>
|
|
|
161 |
</head>
|
|
|
162 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
|
|
|
163 |
<!----------------------------------------------------->
|
|
|
164 |
<!-- BODY ---->
|
|
|
165 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
166 |
<tr>
|
|
|
167 |
<td bgcolor="#FFFFFF" valign="top" class="form_item">
|
|
|
168 |
<p>You are currently interested in this package in the selected projects.
|
|
|
169 |
<p>NOTE: You will be notified when the package is officially released/autobuild.</p>
|
|
|
170 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
171 |
<tr class="form_field_hdr">
|
|
|
172 |
<td nowrap><input type=checkbox id="btn_checkAll" title='Toggle all projects'></td>
|
|
|
173 |
<td nowrap>Project </td>
|
|
|
174 |
<td nowrap style='text-align:right' title='Show/Hide all projects'><input type=checkbox id="btn_checkHide" checked></td>
|
|
|
175 |
</tr>
|
|
|
176 |
</table>
|
|
|
177 |
<div style="min-height:300px;max-height:500px;overflow:auto;">
|
|
|
178 |
<table id=checktable width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
179 |
<%
|
|
|
180 |
Set rsTemp = OraDatabase.DbCreateDynaset(Get_My_Interest_Packages( objAccessControl.UserId ), cint(0))
|
|
|
181 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
182 |
%>
|
|
|
183 |
<tr class=form_item_grey>
|
|
|
184 |
<%If rsTemp("followed") <> 0 Then %>
|
|
|
185 |
<td nowrap><input type="checkbox" class="checkbox0" data-proj_id="<%=rsTemp("proj_id")%>" checked></td>
|
|
|
186 |
<%Else%>
|
|
|
187 |
<td nowrap><input type="checkbox" class="checkbox1" data-proj_id="<%=rsTemp("proj_id")%>"></td>
|
|
|
188 |
<%End If%>
|
|
|
189 |
<td nowrap><%=rsTemp("proj_name")%></td>
|
|
|
190 |
</tr>
|
|
|
191 |
<%rsTemp.MoveNext
|
|
|
192 |
WEnd%>
|
|
|
193 |
</table>
|
|
|
194 |
</div>
|
|
|
195 |
<%If rsTemp.RecordCount = 0 Then%>
|
|
|
196 |
<div class=form_item_grey>
|
|
|
197 |
You are interested in all current projects
|
|
|
198 |
</div>
|
|
|
199 |
<%End If%>
|
|
|
200 |
<br>
|
|
|
201 |
<%If rsTemp.RecordCount <> 0 Then%>
|
|
|
202 |
<div>
|
|
|
203 |
<button id="btn_update" class="form_btn" disabled>Update</button>
|
|
|
204 |
<button id="btn_reset" class="form_btn" disabled>Reset</button>
|
|
|
205 |
<button id="btn_cancel" class="form_btn">Cancel</button>
|
|
|
206 |
</div>
|
|
|
207 |
<%End If
|
|
|
208 |
rsTemp.Close()
|
|
|
209 |
set rsTemp = nothing
|
|
|
210 |
%>
|
|
|
211 |
<div id='eline1' class=err_alert> </div>
|
|
|
212 |
<div id='eline2' class=err_alert> </div>
|
|
|
213 |
</td>
|
|
|
214 |
</tr>
|
|
|
215 |
</td>
|
|
|
216 |
</tr>
|
|
|
217 |
</table>
|
|
|
218 |
</body>
|
|
|
219 |
</html>
|
|
|
220 |
<%
|
|
|
221 |
Call Destroy_All_Objects
|
|
|
222 |
%>
|