Subversion Repositories DevTools

Rev

Rev 4236 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4236 Rev 4237
Line 27... Line 27...
27
'------------ Variable Definition -------------
27
'------------ Variable Definition -------------
28
Dim parPv_id
28
Dim parPv_id
29
Dim parFRiss_id
29
Dim parFRiss_id
30
Dim parFRiss_num
30
Dim parFRiss_num
31
Dim parFRpkey
31
Dim parFRpkey
32
Dim rsCQ
-
 
33
Dim rspPage         ' current page number for multiple page results
-
 
34
Dim rspTotal        ' total number of records
-
 
35
Dim rspCount        ' Record counter
-
 
36
Dim rspTotalPages   ' Total number of pages required to display results
-
 
37
Dim imported
-
 
38
Dim retVal
-
 
39
Dim SQLstr
-
 
40
Dim parIStates
32
Dim parIStates
41
'------------ Constants Declaration -----------
33
'------------ Constants Declaration -----------
42
Const rspMax = 15   ' maximum number of records displayed
-
 
43
Const LENUM_ALL = "ALL"
34
Const LENUM_ALL = "ALL"
44
'------------ Variable Init -------------------
35
'------------ Variable Init -------------------
45
parPv_id = Request("pv_id")
36
parPv_id = Request("pv_id")
46
parRtag_id = Request("rtag_id")
37
parRtag_id = Request("rtag_id")
47
rspPage = Request("rpg")
-
 
48
parFRiss_id = Request("FRiss_id")
38
parFRiss_id = Request("FRiss_id")
49
parFRiss_num = Request("FRiss_num")
39
parFRiss_num = Request("FRiss_num")
50
parIStates = Request("istates")
40
parIStates = Request("istates")
51
parFRpkey = Request("FRpkey")
41
parFRpkey = Request("FRpkey")
52
 
42
 
53
Set rsCQ = Server.CreateObject("ADODB.Recordset")
-
 
54
 
-
 
55
imported = FALSE
-
 
56
'-- CONDITIONS --------------------------------
43
'-- CONDITIONS --------------------------------
57
If rspPage = "" Then rspPage = 1
-
 
58
if InStr(1, Request("btn"), "Find",1) Then rspPage = 1
-
 
59
If (parFRiss_num = "") Then parFRiss_num = LENUM_ALL
44
If (parFRiss_num = "") Then parFRiss_num = LENUM_ALL
60
 
45
 
61
If (parFRpkey = "") Then
46
If (parFRpkey = "") Then
62
  parFRpkey = GetDefaultProjectKey(Request("rtag_id"))
47
  parFRpkey = GetDefaultProjectKey(Request("rtag_id"))
63
  if parFRpkey="" OR IsNull(parFRpkey) Then parFRpkey = LENUM_ALL
48
  if parFRpkey="" OR IsNull(parFRpkey) Then parFRpkey = LENUM_ALL
64
End If
49
End If
65
 
50
 
66
'----------------------------------------------
-
 
67
'Response.write "btn="& Request("btn") & "rspPage=" &rspPage&"<br>"
-
 
68
'Response.write "parPackage="& parPackage &", parProject="& parProject &", parProduct="& parProduct &", parSkipOpen="& parSkipOpen &"<br>"
-
 
69
'Response.write "parPv_id="& parPv_id &", parRtag_id="& parRtag_id &", rspPage="& rspPage &", parFRiss_id="& parFRiss_id &", parFRiss_num="& parFRiss_num
-
 
70
'Response.write "parIStates="& parIStates &", parSkipOpen="& parSkipOpen
-
 
71
%>
51
%>
-
 
52
<script type="text/javascript" src="scripts/json2.js"></script>
-
 
53
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
-
 
54
<script type="text/javascript" charset="utf-8">
-
 
55
////////////////////////////////////////////////
-
 
56
//  Global script variables
-
 
57
var currentIssueIndex = 0;
-
 
58
var pageSize = 15;
-
 
59
var totalIssues = -1;
-
 
60
 
-
 
61
///////////////////////////////////////////////
-
 
62
//  Function:    ajaxOpr
-
 
63
//  Description: Perform an ajax operation
-
 
64
//
-
 
65
function ajaxOpr(args, callback)
-
 
66
{
-
 
67
    xmlHttp=GetXmlHttpObject(function(){ ajaxOprCallback(callback);});
-
 
68
    if (xmlHttp==null)
-
 
69
    {
-
 
70
      alert ("Your browser does not support AJAX!");
-
 
71
      return;
-
 
72
    }
-
 
73
 
-
 
74
    var url = "_json_jiraIssues.asp?" + args;
-
 
75
 
-
 
76
    // Show spinner
-
 
77
    var el = document.getElementById("keyListLoader");
-
 
78
    if (el)
-
 
79
    {
-
 
80
        el.style.display = 'inline';
-
 
81
    }
-
 
82
 
-
 
83
    // Use async request, otherwise the spinner will not work
-
 
84
    xmlHttp.open("GET",url,true);  // `false` makes the request synchronous
-
 
85
    xmlHttp.send(null);
-
 
86
}
-
 
87
///////////////////////////////////////////////
-
 
88
//  Function:    ajaxOprCallback
-
 
89
//  Description: Perform an Ajax operation generic error handling
-
 
90
//  Args       : callback - Function to process json results
-
 
91
//                          Json has been decoded and is a javascript object
-
 
92
//                          Handle errors for the user
-
 
93
//
-
 
94
function ajaxOprCallback(callback)
-
 
95
{
-
 
96
    //readyState of 4 or 'complete' represents that data has been returned
-
 
97
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
-
 
98
    {
-
 
99
        // Hide spinner
-
 
100
        var el = document.getElementById("keyListLoader");
-
 
101
        if (el) {
-
 
102
            el.style.display = 'none';
-
 
103
        }
-
 
104
 
-
 
105
        // alert("Got to getAllProjectKeysDone"+ xmlHttp.responseText);
-
 
106
        if (xmlHttp.status !== 200) {
-
 
107
            alert("Internal AJAX error: " + xmlHttp.status);
-
 
108
        }
-
 
109
        else
-
 
110
        {
-
 
111
            // Gather the results from the callback
-
 
112
            var str = xmlHttp.responseText;
-
 
113
            try {
-
 
114
                var myJson = JSON.parse(str);
-
 
115
                //alert("ajaxOprCallback:" + str);
-
 
116
                if (myJson.result != 0) {
-
 
117
                    alert("AJAX request error: " + myJson.emsgSummary);
-
 
118
                }
-
 
119
                else {
-
 
120
                    callback(myJson);
-
 
121
                }
-
 
122
            }
-
 
123
            catch(e) {
-
 
124
            }
-
 
125
        }
-
 
126
    }
-
 
127
}
-
 
128
 
-
 
129
///////////////////////////////////////////////
-
 
130
// Function: getAllProjectKeys
-
 
131
//           Populate a dropdown box of all project keys
-
 
132
//           This may take some time so its not done during
-
 
133
//           the page load. Only on user request
-
 
134
function getAllProjectKeys()
-
 
135
{
-
 
136
    var el = document.getElementById("keyList")
-
 
137
    if (el)
-
 
138
    {
-
 
139
        ajaxOpr('Opr=getAllKeys', getAllProjectKeysDone);
-
 
140
    }
-
 
141
}
-
 
142
///////////////////////////////////////////////
-
 
143
//  Function:       getAllProjectKeysDone   
-
 
144
//  Description:    Populate the keyList with a selection list
-
 
145
//
-
 
146
function getAllProjectKeysDone(myJson)
-
 
147
{
-
 
148
    if (typeof myJson.keyList != "undefined")
-
 
149
    {
-
 
150
        var el = document.getElementById("keyList");
-
 
151
        if (el)
-
 
152
        {
-
 
153
            var data;
-
 
154
            data = document.createElement("span");
-
 
155
            data.innerHTML=myJson.keyList;
-
 
156
            var a = el.parentNode.replaceChild(data, el);
-
 
157
 
-
 
158
            // Insert nice class information
-
 
159
            el = document.getElementById("keyListSelect");
-
 
160
            if (el)
-
 
161
            {
-
 
162
                el.className = el.className + " form_item";
-
 
163
                el.onchange = useProjectKey;
-
 
164
            }
-
 
165
        }
-
 
166
    }
-
 
167
}
-
 
168
////////////////////////////////////////
-
 
169
//  Function:       useProjectKey
-
 
170
//  Description:    Update the Project Key from the Selection box
-
 
171
//
-
 
172
function useProjectKey()
-
 
173
{
-
 
174
    var el = document.getElementById("keyListSelect");
-
 
175
    var pk = document.getElementById("FRpkey");
-
 
176
    if (el && pk)
-
 
177
    {
-
 
178
        pk.value = el.value;
-
 
179
    }
-
 
180
}
-
 
181
///////////////////////////////////////////////
-
 
182
//  Function:    findNewIssues, firstPage, nextPage, previousPage, lastPage
-
 
183
//  Description: Navigate through the pages
-
 
184
//
-
 
185
function findNewIssues()
-
 
186
{
-
 
187
    currentIssueIndex = 0;
-
 
188
    totalIssues = -1;
-
 
189
    findIssues();
-
 
190
}
-
 
191
function firstPage()
-
 
192
{
-
 
193
    currentIssueIndex = 0;
-
 
194
    findIssues();
-
 
195
}
-
 
196
function nextPage()
-
 
197
{
-
 
198
    currentIssueIndex += pageSize;
-
 
199
    if (totalIssues > 0 && currentIssueIndex > totalIssues)
-
 
200
    {
-
 
201
        currentIssueIndex = totalIssues - pageSize; 
-
 
202
    }
-
 
203
    findIssues();
-
 
204
}
-
 
205
function previousPage()
-
 
206
{
-
 
207
    currentIssueIndex -= pageSize;
-
 
208
    if (currentIssueIndex < 0)
-
 
209
    {
-
 
210
        currentIssueIndex = 0;
-
 
211
    }
-
 
212
    findIssues();
-
 
213
}
-
 
214
function lastPage()
-
 
215
{
-
 
216
    if (totalIssues > 0)
-
 
217
    {
-
 
218
        currentIssueIndex = totalIssues - pageSize; 
-
 
219
    }
-
 
220
    findIssues();
-
 
221
}
-
 
222
 
-
 
223
///////////////////////////////////////////////
-
 
224
//  Function:    findIssues
-
 
225
//  Description: Find issues that match the users search criteria
-
 
226
//               Will populate the page via AJAX
-
 
227
//
-
 
228
function findIssues()
-
 
229
{
-
 
230
    // Ensure that the user is not about to discard any required work
-
 
231
    if (checkOutstanding()) {
-
 
232
        return;
-
 
233
    }
-
 
234
    var is = document.getElementById("FRiss_num");
-
 
235
    var pk = document.getElementById("FRpkey");
-
 
236
    var cm = document.getElementById("checkMaster");
-
 
237
    if (cm) cm.checked = false;
-
 
238
    if (is && pk)
-
 
239
    {
-
 
240
        ajaxOpr('Opr=getIssues&Project=' + pk.value
-
 
241
                + '&Issue=' + is.value 
-
 
242
                + "&StartAt=" + currentIssueIndex 
-
 
243
                + "&Count=" + pageSize
-
 
244
                + '&pv_id=' + <%=parPv_id%> ,
-
 
245
                findIssueDone);
-
 
246
    }
-
 
247
}
-
 
248
///////////////////////////////////////////////
-
 
249
//  Function:    findIssueDone
-
 
250
//  Description: Called when Issue list has been collected
-
 
251
//               Will be called if there has been an error
-
 
252
//
-
 
253
function findIssueDone(myJson)
-
 
254
{
-
 
255
    //  Save total issues on the page
-
 
256
    totalIssues = myJson.issueCount;
-
 
257
 
-
 
258
    // Delete existing table entries
-
 
259
    // Retain the header and foot - these have IDs
-
 
260
    var table = document.getElementById("issueTable");
-
 
261
    var rowCount = table.rows.length;
-
 
262
    for (var i = rowCount - 1; i >= 0 ; i--)
-
 
263
    {
-
 
264
        if (! table.rows[i].id)
-
 
265
        {
-
 
266
            table.deleteRow(i);
-
 
267
        }
-
 
268
    }
-
 
269
 
-
 
270
    //  Create entries that look like these:
-
 
271
    //  <td><input type="checkbox" name="iss_id" value='dummyValue'></td>
-
 
272
    //  <td nowrap class="form_item"><a href="dummyValue" target="_blank">key/a></td>
-
 
273
    //  <td class="form_item">State</td>
-
 
274
    //  <td class="form_item">Summary</td>
-
 
275
 
-
 
276
    for (var id in myJson.issues)
-
 
277
    {
-
 
278
        var obj = myJson.issues[id];
-
 
279
        var row = table.insertRow(table.rows.length - 1);
-
 
280
        var cell1 = row.insertCell(0);
-
 
281
        var cell2 = row.insertCell(1);
-
 
282
        var cell3 = row.insertCell(2);
-
 
283
        var cell4 = row.insertCell(3);
-
 
284
 
-
 
285
        var x = document.createElement("INPUT");
-
 
286
        x.setAttribute('type', 'checkbox');
-
 
287
        x.setAttribute('name', obj.key);
-
 
288
        x.setAttribute('value', obj.key);
-
 
289
        if (obj.inuse)
-
 
290
        {
-
 
291
            x.disabled=true;
-
 
292
            x.checked=true;
-
 
293
        }
-
 
294
        cell1.appendChild(x);
-
 
295
 
-
 
296
        cell2.className = 'form_item';
-
 
297
        cell2.style.whiteSpace="nowrap";
-
 
298
        var t = document.createTextNode(obj.key);
-
 
299
        x = document.createElement("A");
-
 
300
        x.href = obj.url;
-
 
301
        x.target = "_blank";
-
 
302
        x.appendChild(t);
-
 
303
        cell2.appendChild(x);
-
 
304
 
-
 
305
        cell3.className = 'form_item';
-
 
306
        cell3.innerHTML = obj.status;
-
 
307
 
-
 
308
        cell4.className = 'form_item';
-
 
309
        cell4.innerHTML = obj.summary;
-
 
310
    }
-
 
311
 
-
 
312
    // Create the footer information
-
 
313
    // ie: Found 70860 records, showing 1 - 15
-
 
314
    var footer = document.getElementById("issueFooterCell");
-
 
315
    if (footer)
-
 
316
    {
-
 
317
        footer.innerHTML="Found "+ 
-
 
318
                          myJson.issueCount +
-
 
319
                          " records. Showing " + 
-
 
320
                          myJson.startAt + " - " + 
-
 
321
                          (myJson.startAt + myJson.issues.length);
-
 
322
    }
-
 
323
}
-
 
324
///////////////////////////////////////////////
-
 
325
//  Function:    checkAll
-
 
326
//  Description: check all tick boxes in the table
-
 
327
//
-
 
328
function checkAll(state)
-
 
329
{
-
 
330
    var table = document.getElementById("issueTable");
-
 
331
    var rowCount = table.rows.length;
-
 
332
    for (var i = rowCount - 1; i >= 0 ; i--)
-
 
333
    {
-
 
334
        if (! table.rows[i].id)
-
 
335
        {
-
 
336
            var cell = table.rows[i].cells[0].children[0];
-
 
337
            if (! cell.disabled)
-
 
338
            {
-
 
339
                cell.checked = state;
-
 
340
            }
-
 
341
        }
-
 
342
    }
-
 
343
}
-
 
344
///////////////////////////////////////////////
-
 
345
//  Function:       disableChecked
-
 
346
//  Description:    Disable all items that are checked 
-
 
347
//                  Used after items have been inserted
-
 
348
//
-
 
349
function disableChecked()
-
 
350
{
-
 
351
    var table = document.getElementById("issueTable");
-
 
352
    var rowCount = table.rows.length;
-
 
353
    for (var i = rowCount - 1; i >= 1 ; i--)
-
 
354
    {
-
 
355
        if (! table.rows[i].id)
-
 
356
        {
-
 
357
            var cell = table.rows[i].cells[0].children[0];
-
 
358
            if (cell.checked)
-
 
359
            {
-
 
360
                cell.disabled = true;
-
 
361
            }
-
 
362
        }
-
 
363
    }
-
 
364
}
-
 
365
///////////////////////////////////////////////
-
 
366
//  Function:       checkOutstanding
-
 
367
//  Description:    Check if user has checked items that have not yet been actioned
-
 
368
//                  Generate alert if so
-
 
369
//  Returns:        False - OK to proceed
-
 
370
//
-
 
371
function checkOutstanding()
-
 
372
{
-
 
373
    var table = document.getElementById("issueTable");
-
 
374
    var rowCount = table.rows.length;
-
 
375
    var found = 0
-
 
376
    for (var i = rowCount - 1; i >= 1 ; i--)
-
 
377
    {
-
 
378
        if (! table.rows[i].id)
-
 
379
        {
-
 
380
            var cell = table.rows[i].cells[0].children[0];
-
 
381
            if (cell.checked && ! cell.disabled)
-
 
382
            {
-
 
383
                found++;
-
 
384
            }
-
 
385
        }
-
 
386
    }
-
 
387
    if (found)
-
 
388
    {
-
 
389
        if (confirm("Issues have been selected but not actioned. Do you want to discard selection?") == true ) {
-
 
390
            found = 0
-
 
391
        }
-
 
392
    }
-
 
393
    return found != 0;
-
 
394
}
-
 
395
 
-
 
396
///////////////////////////////////////////////
-
 
397
//  Function:    addIssues
-
 
398
//  Description: Scan for checked buttons and add issues to package-version
-
 
399
//
-
 
400
function addIssues()
-
 
401
{
-
 
402
    // Create an array of issues to be added
-
 
403
    var table = document.getElementById("issueTable");
-
 
404
    var rowCount = table.rows.length;
-
 
405
    var list = [];
-
 
406
    for (var i = 1; i < rowCount; i++)
-
 
407
    {
-
 
408
        if (! table.rows[i].id)
-
 
409
        {
-
 
410
            var cell = table.rows[i].cells[0].children[0];
-
 
411
            if (cell && cell.type === "checkbox" && ! cell.disabled && cell.checked)
-
 
412
            {
-
 
413
                list.push(cell.value);
-
 
414
            }
-
 
415
        }
-
 
416
    }
-
 
417
    if (list.length > 0)
-
 
418
    {
-
 
419
    //  Call backend AJAX script to do the hardwork
-
 
420
 
-
 
421
    ajaxOpr('Opr=insertIssues&pv_id=' + <%=parPv_id%>
-
 
422
            + '&Issue=' + list.join(","), function(myJson){
-
 
423
                window.opener.document.location='fixed_issues.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>';
-
 
424
                disableChecked();
-
 
425
            });
-
 
426
    }
-
 
427
}
-
 
428
///////////////////////////////////////////////
-
 
429
//  Function:    closePage
-
 
430
//  Description: close this page, unless there is workk to be done
-
 
431
//
-
 
432
function closePage()
-
 
433
{
-
 
434
    if (checkOutstanding()) {
-
 
435
        return;
-
 
436
    }
-
 
437
    self.close();
-
 
438
}
-
 
439
///////////////////////////////////////////////
-
 
440
//  Function:       Window Onload
-
 
441
//  Description:    Init the page, in a browser independent manner
-
 
442
//
-
 
443
if (window.addEventListener) { // W3C standard
-
 
444
  window.addEventListener('load', initPage, false);
-
 
445
} else if (window.attachEvent) { // Microsoft
-
 
446
  window.attachEvent('onload', initPage);
-
 
447
}
-
 
448
function initPage(){
-
 
449
    // Hide spinner
-
 
450
    var el = document.getElementById("keyListLoader");
-
 
451
    if (el) {
-
 
452
        el.style.display = 'none';
-
 
453
    }
-
 
454
 
-
 
455
    <% If parFRpkey <> LENUM_ALL Then %>
-
 
456
    // Populate the display
-
 
457
    findNewIssues();
-
 
458
    <%End If %>
-
 
459
};
-
 
460
</script>
72
<%
461
<%
73
'------------------------------------------------------------------------------------------------------------------------------------
462
'------------------------------------------------------------------------------------------------------------------------------------
74
Function Get_Issues ( NNiss_num, NNrecordCount, OOrsCQ, apkey)
-
 
75
   Dim SQLstr, issARR, iss_num, col_name, Title
-
 
76
 
-
 
77
      SQLstr = _
-
 
78
      "SELECT project.pkey as project, I.issuenum AS iss_num, I.summary as summary, ISS.pname AS state "&_
-
 
79
      "FROM jiraissue I, project, issuestatus ISS "&_
-
 
80
      "WHERE I.project=project.id "
-
 
81
	  
-
 
82
      If ( apkey <> LENUM_ALL ) Then
-
 
83
         SQLstr = SQLstr & "AND project.pkey='"& apkey &"' "
-
 
84
      End If
-
 
85
      SQLstr = SQLstr & "AND I.issuestatus = ISS.ID "
-
 
86
 
-
 
87
   '-- Keyword search --
-
 
88
   If ( NNiss_num <> LENUM_ALL ) Then
-
 
89
      issARR = Split( Replace( NNiss_num, " ", ""), "," )
-
 
90
 
-
 
91
      col_name = "I.issuenum"
-
 
92
      SQLstr = SQLstr & " AND ( "
-
 
93
      for Each iss_num IN issARR
-
 
94
         SQLstr = SQLstr &" ("& col_name &" LIKE '%"& iss_num &"%') OR"
-
 
95
      Next
-
 
96
 
-
 
97
      SQLstr = Left( SQLstr, Len(SQLstr) - 2 )   ' Remove last 'OR'
-
 
98
 
-
 
99
      SQLstr = SQLstr & "     ) "
-
 
100
 
-
 
101
   End If
-
 
102
 
-
 
103
   '-- Get record count ---  MAYBE MORE SPEED HERE?!??!
-
 
104
   NNrecordCount = Get_Record_Count( SQLstr )
-
 
105
 
-
 
106
	DIM objConnection
-
 
107
	
-
 
108
	'ADDED BY RICHO 6th August 2012 - Increase Speed
-
 
109
	Set objConnection = Server.CreateObject ("ADODB.Connection")
-
 
110
	objConnection.Open JIRA_conn
-
 
111
   
-
 
112
	On Error Resume Next
-
 
113
'Response.Write(SQLstr)
-
 
114
 
-
 
115
	OOrsCQ.Open SQLstr, objConnection
-
 
116
 
-
 
117
    Get_Issues = Err.Number
-
 
118
 
-
 
119
End Function
-
 
120
'------------------------------------------------------------------------------------------------------------------------------------
-
 
121
Function Get_Record_Count ( SSsql )
-
 
122
   Dim rsTemp
-
 
123
   Set rsTemp = Server.CreateObject("ADODB.Recordset")
-
 
124
   rsTemp.ActiveConnection = JIRA_conn
-
 
125
   'Response.Write(rsTemp.ActiveConnection)
-
 
126
 
-
 
127
   rsTemp.Source = _
-
 
128
   " SELECT COUNT(*) as record_count "&_
-
 
129
   "   FROM ("& SSsql &") ct"
-
 
130
 
-
 
131
   rsTemp.CursorType = 0
-
 
132
   rsTemp.CursorLocation = 2
-
 
133
   rsTemp.LockType = 3
-
 
134
   rsTemp.Open()
-
 
135
 
-
 
136
   If (NOT rsTemp.BOF) AND (NOT rsTemp.EOF) Then
-
 
137
      Get_Record_Count = rsTemp("record_count")
-
 
138
   Else
-
 
139
      Get_Record_Count = 0
-
 
140
   End If
-
 
141
 
-
 
142
   rsTemp.Close
-
 
143
   Set rsTemp = nothing
-
 
144
End Function
-
 
145
'------------------------------------------------------------------------------------------------------------------------------------
-
 
146
Sub Import_Issues ( NNpv_id, NNiss_id_list )
-
 
147
   Dim issArr , iss_id
-
 
148
   If NNiss_id_list = "" Then Exit Sub
-
 
149
 
-
 
150
   issArr = Split ( NNiss_id_list, ",")
-
 
151
   'Response.Write("Import_Issues" & NNiss_id_list)
-
 
152
 
-
 
153
   objEH.TryORA ( OraSession )
-
 
154
   On Error Resume Next
-
 
155
 
-
 
156
   For Each iss_id In issArr
-
 
157
 
-
 
158
      If Err.Number = 0 Then
-
 
159
         OraDatabase.ExecuteSQL _
-
 
160
            " INSERT INTO JIRA_ISSUES ( pv_id, iss_key, date_time_stamp )"&_
-
 
161
            " VALUES ( "& NNpv_id &", '"& LTrim(iss_id) &"', "& ORA_SYSDATETIME &")"
-
 
162
 
-
 
163
         If Err.Number = 0 Then
-
 
164
            OraDatabase.ExecuteSQL _
-
 
165
               "BEGIN  Log_Action ( "& NNpv_id &", 'jira_issue_added', "& objAccessControl.UserId &", 'Issue number: "& LTrim(iss_id) &"' );  END;"
-
 
166
         End If
-
 
167
 
-
 
168
      End If
-
 
169
   Next
-
 
170
 
-
 
171
   objEH.CatchORA ( OraSession )
-
 
172
End Sub
-
 
173
'------------------------------------------------------------------------------------------------------------------------------------
-
 
174
Function GetDefaultProjectKey(artag_id)
463
Function GetDefaultProjectKey(artag_id)
175
   Dim rsProjId
464
   Dim rsProjId
176
   Set rsProjId = OraDatabase.DbCreateDynaset("SELECT PRJ.JIRA_KEY FROM RELEASE_TAGS RLT, PROJECTS PRJ WHERE RLT.RTAG_ID ="& artag_id &" AND RLT.PROJ_ID = PRJ.PROJ_ID", cint(0))
465
   Set rsProjId = OraDatabase.DbCreateDynaset("SELECT PRJ.JIRA_KEY FROM RELEASE_TAGS RLT, PROJECTS PRJ WHERE RLT.RTAG_ID ="& artag_id &" AND RLT.PROJ_ID = PRJ.PROJ_ID", cint(0))
177
   GetDefaultProjectKey = rsProjId("jira_key")
466
   GetDefaultProjectKey = rsProjId("jira_key")
178
   Set rsProjId = Nothing
467
   Set rsProjId = Nothing
179
End Function
468
End Function
180
'------------------------------------------------------------------------------------------------------------------------------------
469
'------------------------------------------------------------------------------------------------------------------------------------
181
%>
470
%>
182
<%
471
<%
183
'Process submition
-
 
184
If CBool(Request("action")) AND (Request("btn") = "Import")  AND objAccessControl.UserLogedIn Then
-
 
185
   Call Import_Issues ( parPv_id, parFRiss_id )
-
 
186
   imported = TRUE
-
 
187
   Call OpenInParentWindow ("fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id)
-
 
188
End If
-
 
189
%>
-
 
190
<%
-
 
191
'-------------- Main Line ---------------
472
'-------------- Main Line ---------------
192
 
-
 
193
retVal = Get_Issues ( parFRiss_num, rspTotal, rsCQ, parFRpkey)
-
 
194
 
-
 
195
' total number of pages required
-
 
196
rspTotalPages = rspTotal \ rspMax
-
 
197
If (rspTotal Mod rspMax) > 0 Then rspTotalPages = rspTotalPages + 1
-
 
198
%>
473
%>
199
<html>
474
<html>
200
<head>
475
<head>
201
<title>Release Manager</title>
476
<title>Release Manager</title>
202
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
477
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
Line 204... Line 479...
204
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
479
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
205
<link rel="stylesheet" href="images/navigation.css" type="text/css">
480
<link rel="stylesheet" href="images/navigation.css" type="text/css">
206
<script language="JavaScript" src="images/common.js"></script>
481
<script language="JavaScript" src="images/common.js"></script>
207
</head>
482
</head>
208
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
483
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
209
<%If retVal = 0 Then%>
484
<form name="importform">
210
<form name="importform" method="post" action="<%=scriptName%>">
485
    <!-- First button is the default button. Control its operation -->
-
 
486
    <input type="hidden" name="dummy" value="dummy" onclick="findNewIssues(); return false;"/>
211
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="2">
487
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="2">
212
    <!-- Form Body -->
488
    <!-- Form Body -->
213
    <tr height="1%">
489
    <tr height="1%">
214
      <td nowrap class="wform_ttl" background="images/bg_admin_dark.gif">
490
      <td nowrap class="wform_ttl" background="images/bg_admin_dark.gif">
215
        <table border="0" cellspacing="5" cellpadding="0">
491
        <table border="0" cellspacing="5" cellpadding="0">
Line 218... Line 494...
218
              <td nowrap><input name="FRiss_num" type="text" class="form_item" id="FRiss_num" value="<%=parFRiss_num%>" size="30" > <span class="form_wtxt_link">Example: ALL, 123, or a list</span></td>
494
              <td nowrap><input name="FRiss_num" type="text" class="form_item" id="FRiss_num" value="<%=parFRiss_num%>" size="30" > <span class="form_wtxt_link">Example: ALL, 123, or a list</span></td>
219
            </tr>
495
            </tr>
220
            <tr>
496
            <tr>
221
              <td align="left" class="wform_ttl">Project&nbsp;Key</td>
497
              <td align="left" class="wform_ttl">Project&nbsp;Key</td>
222
              <td nowrap><input name="FRpkey" type="text" class="form_item" id="FRpkey" value="<%=parFRpkey%>" size="30" > <span class="form_wtxt_link">Example: ALL, SLSCM </span></td>
498
              <td nowrap><input name="FRpkey" type="text" class="form_item" id="FRpkey" value="<%=parFRpkey%>" size="30" > <span class="form_wtxt_link">Example: ALL, SLSCM </span></td>
-
 
499
              <td><button id="keyList" class="form_item" onclick="getAllProjectKeys(); return false;">Get All Project Keys</button>
223
            </tr>
500
            </tr>
224
            <tr>
501
            <tr>
225
              <td align="left" class="wform_ttl">Database</td>
502
              <td align="left" class="wform_ttl">Jira</td>
-
 
503
              <td><span class="form_item">
226
              <td><span class="form_item"><%=JIRA_DATABASE%>: <%=JIRA_URL%></span></td>
504
                <a href="<%=JIRA_URL%>" target="_blank"><%=JIRA_URL%></a>
-
 
505
              </span></td>
227
            </tr>
506
            </tr>
228
        </table>
507
        </table>
229
      </tr>
508
      </tr>
230
    <!-- Find, Import and Close Buttons -->
509
    <!-- Find, Import and Close Buttons -->
231
    <tr height="1%">
510
    <tr height="1%">
232
        <td background="images/lbox_bg_blue.gif" >
511
        <td background="images/lbox_bg_blue.gif" >
233
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
512
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
234
            <tr>
513
            <tr>
235
            <td width="1">&nbsp;
514
            <td width="1">&nbsp;
236
            <td>
515
            <td>
237
                <input type="submit" name="btn" value="Find &raquo;" class="form_btn_comp"></td>
516
                <input type="submit" name="btn" value="Find &raquo;" class="form_btn_comp" onclick="findNewIssues(); return false;">
-
 
517
            </td>
-
 
518
                <td align="center">
-
 
519
                <img id="keyListLoader" valign="middle" src="images/ajax-loader-bar.gif">
-
 
520
            </td>
238
            <td align="right">
521
            <td align="right">
239
                <input type="submit" name="btn" value="Import" class="form_btn_comp">
522
                <input type="submit" name="btn" value="Import" class="form_btn_comp" onclick="addIssues(); return false;">
240
                <input type="reset" name="btn" value="Close" class="form_btn_comp" onclick="self.close()">
523
                <input type="reset"  name="btn" value="Close"  class="form_btn_comp" onclick="closePage(); return false;">
241
            </td>
524
            </td>
242
        </table>
525
        </table>
243
        </tr>
526
        </tr>
244
    <!-- Post Import Message Area -->
-
 
245
    <%If imported Then%>
-
 
246
    <tr height="1%">
-
 
247
        <td>
-
 
248
                <%Call DisplayInfo ( "ISSUES_IMPORTED", "300" )%>
-
 
249
        </td>
-
 
250
        </tr>
-
 
251
    <%End If%>
-
 
252
    <!-- Table of issues wrapper -->
527
    <!-- Table of issues wrapper -->
253
    <tr height="100%"  valign="top">
528
    <tr height="100%"  valign="top">
254
        <td>
529
        <td>
255
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
530
            <table id="issueTable" width="100%" border="0" cellspacing="1" cellpadding="2">
256
                <tr>
531
                <tr id="issueheader">
257
                    <td width="1%" background="images/bg_form_lightbluedark.gif">&nbsp;</td>
532
                    <td width="1%" background="images/bg_form_lightbluedark.gif"><input id="checkMaster" type="checkbox" onclick="checkAll(this.checked);"></td>
258
                    <td width="1%" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Issue Key</td>
533
                    <td width="1%" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Issue Key</td>
259
                    <td width="1%" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">State</td>
534
                    <td width="1%" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">State</td>
260
                    <td width="100%" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Summary</td>
535
                    <td width="100%" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Summary</td>
261
                    </tr>
536
                </tr>
262
                    <%rspCount = 0
-
 
263
                     If (NOT rsCQ.BOF) AND (NOT rsCQ.EOF) Then
-
 
264
                       rsCQ.Move( rspMax * (rspPage - 1))
-
 
265
                       while ((NOT rsCQ.BOF) AND (NOT rsCQ.EOF) AND (rspCount < rspMax))
-
 
266
                           dim jiraIssue, jiraText
-
 
267
                           jiraIssue = rsCQ("project") & "-" & rsCQ("iss_num")
-
 
268
                           jiraText = jiraIssue
-
 
269
                   %>
537
<%
270
                <tr>
538
//              <tr>
271
                    <td><input type="checkbox" name="FRiss_id" value='<%=jiraIssue%>'></td>
539
//                  <td><input type="checkbox" name="FRiss_id" value='dummyValue'></td>
272
                    <td nowrap class="form_item">
-
 
273
                    <%If parFRiss_num <> LENUM_ALL and parFRpkey = LENUM_ALL Then
-
 
274
                        jiraText = Highlight_Substring( jiraIssue, parFRiss_num )
-
 
275
                    End If%>
-
 
276
                    <a href="<%=JIRA_URL%>/browse/<%=jiraIssue%>" target="_blank"><%=jiraText%></a>
540
//                  <td nowrap class="form_item"><a href="dummyValue" target="_blank">dummyValue</a></td>
277
                    </td>
-
 
278
                    <td class="form_item"><%=rsCQ("state")%></td>
541
//                  <td class="form_item">dummyValueState</td>
279
                    <td class="form_item"><%=rsCQ("summary")%></td>
542
//                  <td class="form_item">dummyValueSummary</td>
280
                    </tr>
543
//              </tr>
281
                    <%rspCount = rspCount + 1
-
 
282
                      rsCQ.MoveNext
-
 
283
                      WEnd
-
 
-
 
544
%>
284
                      rsCQ.Close
545
                <tr id="issuefooter">
285
                      Set rsCQ = nothing%>
-
 
286
                    <%End If%>
-
 
287
                <tr>
-
 
288
                <!-- Number of issues found -->
546
                <!-- Number of issues found -->
289
                    <td background="images/bg_form_lightbluedark.gif">&nbsp;</td>
547
                    <td background="images/bg_form_lightbluedark.gif">&nbsp;</td>
290
                    <td colspan="3" nowrap background="images/bg_form_lightbluedark.gif" class="form_step">
548
                    <td id="issueFooterCell" colspan="3" nowrap background="images/bg_form_lightbluedark.gif" class="form_step">Issue List not yet populated</td>
291
                    <%If rspTotal > rspMax Then
-
 
292
                         If CInt(rspPage) = CInt(rspTotalPages) Then
-
 
293
                            Response.write "Found "& rspTotal &" records, showing "& (rspMax * rspPage) - rspMax + 1 &" - "& rspTotal
-
 
294
                         Else
-
 
295
                            Response.write "Found "& rspTotal &" records, showing "& (rspMax * rspPage) - rspMax + 1 &" - "& (rspCount * rspPage)
-
 
296
                         End If
-
 
297
                      Else
-
 
298
                         Response.write "Found "& rspTotal &" records"
-
 
299
                      End If
-
 
300
                   %>
-
 
301
                   </td>
549
                </tr>
302
            </table>
550
            </table>
303
        <!-- Next and Previous Buttons -->
551
        <!-- Next and Previous Buttons -->
304
        <tr height="1%">
552
        <tr height="1%">
305
            <td>
553
            <td>
306
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
554
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
307
              <tr>
555
              <tr>
308
                <td align="center">
556
                <td align="center">
-
 
557
                <a id="first" href="javascript:;" onClick="firstPage();" class="txt_linked">&lt;first</a>
-
 
558
                &nbsp;
309
               <%If CInt(rspPage) > 1 Then%><a href="javascript:;" onClick="importform.rpg.value = parseInt(importform.rpg.value) - 1; importform.submit();" class="txt_linked">&lt;previous</a><%End If%>&nbsp;
559
                <a id="prev" href="javascript:;" onClick="previousPage();" class="txt_linked">&lt;previous</a>
-
 
560
                &nbsp;&nbsp;
310
                  <%If CInt(rspPage) < CInt(rspTotalPages) Then%><a href="javascript:void(document.importform.submit())" onClick="importform.rpg.value = parseInt(importform.rpg.value) + 1; importform.btn.value='next';" class="txt_linked">next &gt;</a><%End If%></td>
561
                <a id="next" href="javascript:;" onClick="nextPage();" class="txt_linked">next &gt;</a>
-
 
562
                &nbsp;
-
 
563
                <a id="last" href="javascript:;" onClick="lastPage();" class="txt_linked">last &gt;</a>
311
              </tr>
564
              </tr>
312
            </table>
565
            </table>
313
            </td>
566
            </td>
314
            </tr>
567
            </tr>
315
        <!-- Bottom Line -->
568
        <!-- Bottom Line -->
Line 318... Line 571...
318
            <td>
571
            <td>
319
                <img src="images/lbox_bg_blue.gif" width="100%" height="5">
572
                <img src="images/lbox_bg_blue.gif" width="100%" height="5">
320
            </td>
573
            </td>
321
        </tr>
574
        </tr>
322
    </table>
575
    </table>
323
    <input name="rpg" type="hidden" value="<%=rspPage%>">
-
 
324
    <input name="pv_id" type="hidden" value="<%=parPv_id%>">
576
    <input name="pv_id" type="hidden" value="<%=parPv_id%>">
325
    <input name="rtag_id" type="hidden" value="<%=parRtag_id%>">
577
    <input name="rtag_id" type="hidden" value="<%=parRtag_id%>">
326
    <input name="action" type="hidden" value="true">
578
    <input name="action" type="hidden" value="true">
327
</form>
579
</form>
328
<%Else%>
-
 
329
<%=enumMSSQL_ERROR%>
-
 
330
<%End If%>
-
 
331
</body>
580
</body>
332
</html>
581
</html>
333
<!-- DESTRUCTOR ------->
582
<!-- DESTRUCTOR ------->
334
<!--#include file="common/destructor.asp"-->
583
<!--#include file="common/destructor.asp"-->