Subversion Repositories DevTools

Rev

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

Rev 4028 Rev 4240
Line 60... Line 60...
60
    Else
60
    Else
61
        makeButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>" & result
61
        makeButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>" & result
62
    End If
62
    End If
63
End Function
63
End Function
64
 
64
 
-
 
65
Function makeAjaxButton( text, script )
-
 
66
    If active Then
-
 
67
        makeAjaxButton = "&nbsp;&nbsp;<a id="""&script &""" class=""form_btn"" title=""" &text& """ onclick="""&script&"();return false;"">"&text&"</a>"
-
 
68
    Else
-
 
69
        makeAjaxButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>" & result
-
 
70
    End If
-
 
71
End Function
-
 
72
 
65
'-------------------------------------------
73
'-------------------------------------------
66
' Perform tests on request
74
' Perform tests on request
67
'
75
'
68
If parTest = "email" Then
76
If parTest = "email" Then
69
    Call Send_Email ( "Release Manager Notification", adminEmail, objAccessControl.UserEmail, "Test Email", "This is a Test Email generated by the Release Manager Test.", Null )
77
    Call Send_Email ( "Release Manager Notification", adminEmail, objAccessControl.UserEmail, "Test Email", "This is a Test Email generated by the Release Manager Test.", Null )
Line 84... Line 92...
84
        remExecRv = "Error ("&rv&")"
92
        remExecRv = "Error ("&rv&")"
85
    End IF
93
    End IF
86
End If
94
End If
87
 
95
 
88
%>
96
%>
-
 
97
<script type="text/javascript" src="scripts/json2.js"></script>
-
 
98
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
-
 
99
<script type="text/javascript" charset="utf-8">
-
 
100
///////////////////////////////////////////////
-
 
101
//  Function:    ajaxOpr
-
 
102
//  Description: Perform an ajax operation
-
 
103
//  Args       :    args - Part of URL to pass to script
-
 
104
//                  callback    - Callback on success
-
 
105
//                  ecall       - Callback on error            
-
 
106
//
-
 
107
function ajaxOpr(args, callback, ecall)
-
 
108
{
-
 
109
    xmlHttp=GetXmlHttpObject(function(){ ajaxOprCallback(callback, ecall);});
-
 
110
    if (xmlHttp==null)
-
 
111
    {
-
 
112
      alert ("Your browser does not support AJAX!");
-
 
113
      return;
-
 
114
    }
-
 
115
 
-
 
116
    var url = "_json_jiraIssues.asp?" + args;
-
 
117
 
-
 
118
    // Use async request, otherwise the spinner will not work
-
 
119
    xmlHttp.open("GET",url,true);  // `false` makes the request synchronous
-
 
120
    xmlHttp.send(null);
-
 
121
}
-
 
122
///////////////////////////////////////////////
-
 
123
//  Function:    ajaxOprCallback
-
 
124
//  Description: Perform an Ajax operation generic error handling
-
 
125
//  Args       : callback - Function to process json results
-
 
126
//                          Json has been decoded and is a javascript object
-
 
127
//                          Handle errors for the user
-
 
128
//
-
 
129
function ajaxOprCallback(callback, ecall)
-
 
130
{
-
 
131
    //readyState of 4 or 'complete' represents that data has been returned
-
 
132
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
-
 
133
    {
-
 
134
        // alert("Got to getAllProjectKeysDone"+ xmlHttp.responseText);
-
 
135
        if (xmlHttp.status !== 200) {
-
 
136
            ecall('Bad Status');
-
 
137
            alert("Internal AJAX error: " + xmlHttp.status);
-
 
138
        }
-
 
139
        else
-
 
140
        {
-
 
141
            // Gather the results from the callback
-
 
142
            var str = xmlHttp.responseText;
-
 
143
            try {
-
 
144
                var myJson = JSON.parse(str);
-
 
145
                //alert("ajaxOprCallback:" + str);
-
 
146
                if (myJson.result != 0) {
-
 
147
                    ecall('Error');
-
 
148
                    alert("AJAX request error: " + myJson.emsgSummary);
-
 
149
                }
-
 
150
                else {
-
 
151
                    callback(myJson);
-
 
152
                }
-
 
153
            }
-
 
154
            catch(e) {
-
 
155
            }
-
 
156
        }
-
 
157
    }
-
 
158
}
-
 
159
 
-
 
160
///////////////////////////////////////////////
-
 
161
//  Function:       jiraTest   
-
 
162
//  Description:    Get the list of projects from the Jira Server
-
 
163
//
-
 
164
function jiraTest()
-
 
165
{
-
 
166
    //  Show that testing has started
-
 
167
    var el = document.getElementById("jiraTest");
-
 
168
    el.innerText = 'Testing';
89
 
169
 
-
 
170
    ajaxOpr('Opr=getAllKeys', 
-
 
171
            function(myJson){ el.innerText = 'Test OK'; },
-
 
172
            function(txt){ el.innerText = "Test Failed:" + txt}
-
 
173
           );
-
 
174
    
-
 
175
}
-
 
176
</script>
90
<html>
177
<html>
91
<head>
178
<head>
92
 
179
 
93
<title>Admin Test Page</title>
180
<title>Admin Test Page</title>
94
 
181
 
Line 225... Line 312...
225
                    <%=makeButton("eMail", "email1",rvEmail1)%>
312
                    <%=makeButton("eMail", "email1",rvEmail1)%>
226
            </tr>
313
            </tr>
227
 
314
 
228
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
315
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
229
            <tr>
316
            <tr>
-
 
317
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Jira Server</td>
-
 
318
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=JIRA_URL%></td>
-
 
319
            </tr>
-
 
320
            <tr>
-
 
321
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Jira Test</td>
-
 
322
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">
-
 
323
                    <%=makeAjaxButton("Test", "jiraTest")%>
-
 
324
              </td>
-
 
325
            </tr>
-
 
326
 
-
 
327
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
 
328
            <tr>
230
               <td valign="top" nowrap class="body_col">End of Tests</td>
329
               <td valign="top" nowrap class="body_col">End of Tests</td>
231
               <td><a class="form_btn" href="admin_build_test_page.asp" title="Refresh Page">Refresh</a></td>
330
               <td><a class="form_btn" href="admin_build_test_page.asp" title="Refresh Page">Refresh</a></td>
232
            </tr>
331
            </tr>
233
            
332
            
234
         </table>
333
         </table>