| 171 |
brianf |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
Option explicit
|
|
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'=====================================================
|
|
|
8 |
' Update a Project's Code Review Base URL and Jira Key
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/formating.asp"-->
|
|
|
14 |
<!--#include file="common/qstr.asp"-->
|
|
|
15 |
<!--#include file="common/common_subs.asp"-->
|
|
|
16 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
17 |
<!--#include file="common/_popup_window_common.asp"-->
|
|
|
18 |
<%
|
|
|
19 |
' Set rfile parameter. This is a return page after Login
|
|
|
20 |
Call objPMod.StoreParameter ( "rfile", "fixed_issues.asp" )
|
|
|
21 |
'------------ ACCESS CONTROL ------------------
|
|
|
22 |
%>
|
|
|
23 |
<!--#include file="_access_control_login.asp"-->
|
|
|
24 |
<!--#include file="_access_control_general.asp"-->
|
|
|
25 |
<!--#include file="_access_control_project.asp"-->
|
|
|
26 |
<%
|
|
|
27 |
'------------ Variable Definition -------------
|
|
|
28 |
Dim parProj_id
|
|
|
29 |
Dim baseURL
|
|
|
30 |
Dim jiraKey
|
|
|
31 |
'------------ Constants Declaration -----------
|
|
|
32 |
'------------ Variable Init -------------------
|
|
|
33 |
parProj_id = Request("proj_id")
|
|
|
34 |
'----------------------------------------------
|
|
|
35 |
%>
|
|
|
36 |
<%
|
|
|
37 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
38 |
Sub Get_Project_Config ( NNproj_id, out_base_url, out_jira_key )
|
|
|
39 |
Dim rsTemp, Query_String
|
|
|
40 |
|
|
|
41 |
Query_String = _
|
|
|
42 |
" SELECT base_url, jira_key "&_
|
|
|
43 |
" FROM projects pr "&_
|
|
|
44 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
45 |
|
|
|
46 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
47 |
|
|
|
48 |
out_base_url = rsTemp("base_url")
|
|
|
49 |
out_jira_key = rsTemp("jira_key")
|
|
|
50 |
|
|
|
51 |
rsTemp.Close()
|
|
|
52 |
Set rsTemp = nothing
|
|
|
53 |
End Sub
|
|
|
54 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
55 |
Sub Update_Project_Config ( nProj_id, sBaseURL, sJiraKey)
|
|
|
56 |
|
|
|
57 |
Dim sTempURL
|
|
|
58 |
sTempURL = sBaseURL
|
|
|
59 |
|
|
|
60 |
If (sTempURL <> "") and (Right(sTempURL, 1) <> "/") Then sTempURL = sTempURL & "/"
|
|
|
61 |
|
|
|
62 |
OraDatabase.Parameters.Add "PROJ_ID", nProj_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
63 |
OraDatabase.Parameters.Add "BASE_URL", sTempURL, ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
64 |
OraDatabase.Parameters.Add "JIRA_KEY", sJiraKey, ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
65 |
|
|
|
66 |
objEH.TryORA ( OraSession )
|
|
|
67 |
On Error Resume Next
|
|
|
68 |
|
|
|
69 |
OraDatabase.ExecuteSQL _
|
|
|
70 |
"BEGIN PK_PROJECT.Update_Project_Config ( :PROJ_ID, :BASE_URL, :JIRA_KEY ); END;"
|
|
|
71 |
|
|
|
72 |
objEH.CatchORA ( OraSession )
|
|
|
73 |
|
|
|
74 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
75 |
OraDatabase.Parameters.Remove "BASE_URL"
|
|
|
76 |
OraDatabase.Parameters.Remove "JIRA_KEY"
|
|
|
77 |
|
|
|
78 |
End Sub
|
|
|
79 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
80 |
%>
|
|
|
81 |
<%
|
|
|
82 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
83 |
Function ValidateURL ( sBaseURL )
|
|
|
84 |
|
|
|
85 |
Dim oExp
|
|
|
86 |
Set oExp = new RegExp
|
|
|
87 |
|
|
|
88 |
oExp.Global = False
|
|
|
89 |
oExp.Pattern = "(^https?:\/\/[a-z1-9])|(^$)"
|
|
|
90 |
|
|
|
91 |
ValidateURL = oExp.Test(sBaseURL)
|
|
|
92 |
End Function
|
|
|
93 |
|
|
|
94 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
95 |
Function ValidateJiraKey ( sJiraKey )
|
|
|
96 |
|
|
|
97 |
Dim oExp
|
|
|
98 |
Set oExp = new RegExp
|
|
|
99 |
|
|
|
100 |
oExp.Global = False
|
|
|
101 |
oExp.Pattern = "^[A-Za-z0-9]*$"
|
|
|
102 |
|
|
|
103 |
ValidateJiraKey = oExp.Test(sJiraKey)
|
|
|
104 |
End Function
|
|
|
105 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
106 |
%>
|
|
|
107 |
<%
|
|
|
108 |
'------------ Action Requirements -------------------
|
|
|
109 |
'Process submition
|
|
|
110 |
If CBool(Request("action")) AND objAccessControl.UserLogedIn Then
|
|
|
111 |
If ValidateURL (Request("base_url")) and ValidateJiraKey (Request("jira_key")) Then
|
|
|
112 |
Call Update_Project_Config ( parProj_id, Request("base_url"), Request("jira_key") )
|
|
|
113 |
Call OpenInParentWindow ("admin_projects.asp" )
|
|
|
114 |
Call CloseWindow
|
|
|
115 |
End If
|
|
|
116 |
End If
|
|
|
117 |
|
|
|
118 |
Call Get_Project_Config ( parProj_id, baseURL, jiraKey )
|
|
|
119 |
|
|
|
120 |
%>
|
|
|
121 |
<html>
|
|
|
122 |
<head>
|
|
|
123 |
<title>Release Manager</title>
|
|
|
124 |
<meta http-equiv="Pragma" content="no-cache">
|
|
|
125 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
126 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
127 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
128 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
129 |
<!-- TIPS -->
|
|
|
130 |
<script language="JavaScript" src="images/tipster.js"></script>
|
|
|
131 |
<script language="JavaScript" src="images/_help_tips.js"></script>
|
|
|
132 |
</head>
|
|
|
133 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
|
|
134 |
<!-- TIPS LAYERS -------------------------------------->
|
|
|
135 |
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10"> </div>
|
|
|
136 |
<!----------------------------------------------------->
|
|
|
137 |
<form action="_wform_edit_projects.asp" method="post" name="baseurl" onsubmit="MM_validateForm('base_url','Base URL','isURL','jira_key','JIRA Key','isAlphaNum');return document.MM_returnValue;">
|
|
|
138 |
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
|
|
|
139 |
<tr>
|
|
|
140 |
<td width="1%" background="images/lbox_bg_orange.gif"><img src="images/s_code_review_off.gif" width="21" height="23" hspace="5" border="0"></td>
|
|
|
141 |
<td width="50%" background="images/lbox_bg_blue.gif" nowrap class="wform_ttl"> Project Configuration for
|
|
|
142 |
<%=Get_Proj_Name(parProj_id)%>
|
|
|
143 |
</td>
|
|
|
144 |
<td width="50%" background="images/lbox_bg_blue.gif" align="right" nowrap class="wform_ttl">
|
|
|
145 |
<input type="submit" name="btn" value="Save" class="form_btn"> <input type="reset" name="btn" value="Close" class="form_btn" onclick="self.close()">
|
|
|
146 |
</td>
|
|
|
147 |
<td background="images/lbox_bg_blue.gif" align="right" width="1%" nowrap><img src="images/h_trsp_dot.gif" width="5" height="22"></td>
|
|
|
148 |
</tr>
|
|
|
149 |
<tr>
|
|
|
150 |
<td height="100%" width="1%"> </td>
|
|
|
151 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
|
|
152 |
<br>
|
|
|
153 |
<br>
|
|
|
154 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
155 |
<tr>
|
|
|
156 |
<td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
|
|
|
157 |
<td width="100%">
|
|
|
158 |
<table width="100%" border="0" cellspacing="1" cellpadding="4">
|
|
|
159 |
<tr>
|
|
|
160 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Code
|
|
|
161 |
Review Base URL</td>
|
|
|
162 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_item" colspan="3" width="100%">
|
|
|
163 |
<input name="base_url" type="text" size="78" maxlength="200" class="form_item" value='<%=baseURL%>'></td>
|
|
|
164 |
</tr>
|
|
|
165 |
<tr>
|
|
|
166 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">JIRA Key</td>
|
|
|
167 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_item" colspan="3" width="100%">
|
|
|
168 |
<input name="jira_key" type="text" size="78" maxlength="200" class="form_item" value='<%=jiraKey%>'></td>
|
|
|
169 |
</tr>
|
|
|
170 |
</table>
|
|
|
171 |
</td>
|
|
|
172 |
</tr>
|
|
|
173 |
</table>
|
|
|
174 |
<input type="hidden" name="action" value="true">
|
|
|
175 |
<input type="hidden" name="proj_id" value="<%=parProj_id%>">
|
|
|
176 |
<br>
|
|
|
177 |
<br>
|
|
|
178 |
</td>
|
|
|
179 |
</tr>
|
|
|
180 |
<tr>
|
|
|
181 |
<td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
|
|
|
182 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
|
|
|
183 |
</tr>
|
|
|
184 |
</table>
|
|
|
185 |
</form>
|
|
|
186 |
</body>
|
|
|
187 |
</html>
|
|
|
188 |
<!-- DESTRUCTOR ------->
|
|
|
189 |
<!--#include file="common/destructor.asp"-->
|