Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7536 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
4
Response.Expires = 0   ' always load the page, dont store
5
%>
6
<%
7
'=====================================================
8
'   _wform_change_eref.asp
9
'=====================================================
10
%>
11
<!--#include file="common/conf.asp"-->
12
<!--#include file="common/globals.asp"-->
13
<!--#include file="common/qstr.asp"-->
14
<!--#include file="common/common_subs.asp"-->
15
<!--#include file="common/common_dbedit.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_login.asp"-->
21
<!--#include file="_access_control_general.asp"-->
22
<!--#include file="_access_control_project.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim parPv_id
26
Dim sMessage, sMessageType
27
'------------ Constants Declaration -----------
28
'------------ Variable Init -------------------
29
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
30
parPv_id = QStrPar("pv_id")
31
sMessage = NULL
32
sMessageType = 3
33
'----------------------------------------------
34
%>
35
<%
36
'------------------------------------------------------------------------------------------------------------------------------------------
37
'
38
' Add a line of text to the System Message
39
'   eLevel - 1 == Critical, 2==Warning, 3==Note
40
Sub sMessageAdd(eLevel, text)
41
    If NOT isNull(sMessage) Then
42
        sMessage = sMessage & "<br>"
43
    End If
44
    sMessage = sMessage & text
45
 
46
    If eLevel < sMessageType  Then
47
        sMessageType = eLevel
48
    End If
49
End Sub
50
 
51
Sub Get_Pkg_Info_With_Eref ( NNpv_id )
52
   Dim rsTemp, Query_String
53
 
54
   Query_String = _
55
   " SELECT pkg.pkg_name, pv.pkg_version, pe.eref"&_
56
   "   FROM packages pkg, package_versions pv, package_eref pe"&_
57
   "  WHERE pkg.pkg_id = pv.pkg_id"&_
58
   "    AND pv.pv_id = "& NNpv_id &_
59
   "    AND pe.pv_id(+) = pv.pv_id"
60
 
61
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
62
 
63
   If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
64
      pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
65
      pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
66
      pkgInfoHash.Add "eref", (rsTemp.Fields("eref"))
67
   End If
68
 
69
   rsTemp.Close
70
   Set rsTemp = nothing
71
End Sub
72
 
73
 
74
Sub Update_Eref ( NNpv_id, erefText )
75
   Dim rsTemp, Query_String, sComments
76
 
77
   'If the entry is empty then delete the table element
78
   If erefText = "" Then
79
       Delete_Eref(NNpv_id)
80
       Exit Sub
81
   End If
82
 
83
   '-- Update database to change the eRef
84
   objEH.TryORA ( OraSession )
85
   On Error Resume Next
86
 
87
   Query_String = _
88
        "MERGE INTO PACKAGE_EREF pe" &_
89
        " USING (SELECT "& NNpv_id & " pv_id, '"& erefText & "' eref from dual) s" &_
90
        " ON (pe.pv_id = s.pv_id)" &_
91
        " WHEN MATCHED THEN UPDATE SET pe.eref = s.eref" &_
92
        " WHEN NOT MATCHED THEN INSERT (pv_id, eref) VALUES (s.pv_id, s.eref)"
93
 
94
   OraDatabase.ExecuteSQL Query_String
95
 
96
   objEH.CatchORA ( OraSession )
97
 
98
   If objEH.LastOraFailed = FALSE Then
99
        '-- Log the change
100
        sComments = "Set: "& erefText
101
        call Log_Action ( NNpv_id, "eref_change", sComments )
102
   End If
103
 
104
   rsTemp.Close
105
   Set rsTemp = nothing
106
End Sub
107
 
108
'-------------------------------------------------
109
' Function:     Delete_Eref
110
' Description:  Delete a Package external Reference
111
'
112
Sub Delete_Eref ( NNpv_id )
113
   Dim rsTemp, Query_String, sComments
114
 
115
   '-- Update database to change the eRef
116
   objEH.TryORA ( OraSession )
117
   On Error Resume Next
118
 
119
   Query_String = _
120
        "DELETE FROM PACKAGE_EREF pe" &_
121
        " WHERE PV_ID = " & NNpv_id
122
 
123
   OraDatabase.ExecuteSQL Query_String
124
 
125
   objEH.CatchORA ( OraSession )
126
 
127
   If objEH.LastOraFailed = FALSE Then
128
        '-- Log the change
129
        sComments = "Deleted"
130
        call Log_Action ( NNpv_id, "eref_change", sComments )
131
    Else
132
        bOraError = TRUE
133
   End If
134
 
135
   rsTemp.Close
136
   Set rsTemp = nothing
137
End Sub
138
 
139
%>
140
<%
141
'Process submition
142
If CBool(QStrPar("action")) AND objAccessControl.UserLogedIn Then
143
   Call Update_Eref ( parPv_id, Request("eref") )
144
   If isNULL(sMessage) AND NOT objEH.LastOraFailed Then
145
       Call ReloadParentWindow
146
       Call CloseWindow
147
   End If
148
End If
149
%>
150
<%
151
Call Get_Pkg_Info_With_Eref ( parPv_id )
152
%>
153
<html>
154
<head>
155
<title>Release Manager</title>
156
<link rel="shortcut icon" href="<%=FavIcon%>"/>
157
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
158
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
159
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
160
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
161
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
162
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
163
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
164
</head>
165
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
166
<form name="chowner" method="post" action="<%=scriptName%>" class="form_tight">
167
  <table border="0" cellspacing="0" cellpadding="2" width="100%">
168
    <tr>
169
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
170
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
171
         <%Call Messenger ( sMessage , sMessageType, "100%" )%>
172
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
173
         <!--#include file="messages/_msg_inline.asp"-->
174
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
175
          <tr>
176
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
177
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
178
              <%=pkgInfoHash.Item ("pkg_name") &" "& pkgInfoHash.Item ("pkg_version")%></td>
179
          </tr>
180
          <tr>
181
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">External Reference</td>
182
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
183
            <input type="text" name="eref" value='<%=pkgInfoHash.Item ("eref")%>' size='60' max=500>
184
            <input type="hidden" name="pv_id" value="<%=parPv_id%>">
185
            <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
186
            <input type="hidden" name="action" value="true">
187
            </td>
188
          </tr>
189
        </table>
190
      </td>
191
    </tr>
192
    <tr>
193
      <td align="right">
194
        <input type="submit" name="btn" value="Update" class="form_btn_comp">
195
        <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
196
      </td>
197
    </tr>
198
  </table>
199
</form>
200
</body>
201
</html>
202
<!-- DESTRUCTOR ------->
203
<!--#include file="common/destructor.asp"-->