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