Subversion Repositories DevTools

Rev

Rev 6783 | Rev 7225 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|				    ADMIN Page	     	        	 |
6
'|                 Package Properties              	 |
7
'|                                        			 |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
13
Response.Expires = 0	' always load the page, dont store
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="sec/Crypt.asp"-->
21
<!--#include file="common/_form_window_common.asp"-->
22
<!--#include file="_action_buttons.asp"-->
23
 
24
<!--#include file="class/classActionButtonControl.asp"-->
25
 
26
<%
27
'------------ ACCESS CONTROL ------------------
28
%>
6181 dpurdie 29
<!--#include file="_access_control_login_optional.asp"-->
5357 dpurdie 30
<!--#include file="_access_control_general.asp"-->
31
<%
32
'------------ Variable Definition -------------
33
Dim objBtnControl
34
Dim rsPkg
35
Dim SCRIPT_NAME
36
Dim peg_checked
37
Dim adr_checked
38
Dim parPkgId
39
Dim editMode
40
Dim SqlStr
41
Dim canEdit
42
Dim rowClass, rowBorder
43
'------------ Constants Declaration -----------
44
Const LIMG_ROW_SUBMIT = "<input name='btn' type='image' src='icons/btn_row_submit.gif' width='53' height='16' hspace='2' border='0' title='Submit this entry'>"
45
Const LIMG_ROW_CANCEL = "<img src='icons/bi_cancel.gif' width='16' height='16' border='0' hspace='2' title='Cancel'>"
46
'------------ Variable Init -------------------
47
Set objBtnControl = New ActionButtonControl
48
SCRIPT_NAME = Mid(Request.ServerVariables("SCRIPT_NAME"), InStrRev(Request.ServerVariables("SCRIPT_NAME"), "/") + 1 )
49
parPkgId = Request("PkgId")
50
editMode = "none"
51
canEdit = false
52
'----------------------------------------------
53
%>
54
<%
55
'------------------------------------------------------------------------------
56
' Function:     Get_Packages
57
' Description:  Get a list of packages to be displayed
58
'               Will be either selected by name or only packages with defined defaults
59
Function Get_Packages
60
   If Request("pkgFilter") <> "" Then
61
    	Get_Packages = _
62
    	" SELECT * FROM PACKAGES " &_
63
        " WHERE PKG_NAME LIKE '%"&Request("pkgFilter")&"%'" &_ 
64
        " ORDER BY pkg_name ASC"
65
   Else
66
    	Get_Packages = _
67
    	" SELECT * FROM PACKAGES " &_
68
        " WHERE DEFAULT_PEGGED is not NULL " &_
69
        "    OR DEFAULT_ADVISORY_RIPPLE is not NULL" &_
70
        " ORDER BY pkg_name ASC"
71
    End If
72
End Function
73
'-------------Page Access Condition--------------------------------------------
74
If canActionControlInProject("EditPackageProperties") Then
75
    canEdit = true
76
Else
77
    parPkgId = NULL
78
End If
79
'------------- Before Render --------------------------------------------------
80
'-------------------------------------------------
81
' Function:         check2Yes   
82
' Description:      Convert the value of a checkbox into a 'Y" or a empty value
83
Function check2Yes(val)
84
    If  val = "on" Then
85
        check2Yes = "'Y'"
86
    Else
87
        check2Yes = "''"
88
    End If
89
End Function
90
'-------------------------------------------------
91
' Update edited values
92
If canEdit AND Request("action") = "update" AND parPkgId <> "" Then
93
    sqlStr = "UPDATE PACKAGES SET" &_
94
             " WIN_ELECTRONIC_NAME  = '" & Request("WIN_ELECTRONIC_NAME") & "'"&_
95
             ",SUNOS_ELECTRONIC_NAME  = '" & Request("SUNOS_ELECTRONIC_NAME") & "'"&_
96
             ",DEFAULT_PEGGED  = " & check2Yes(Request("DEFAULT_PEGGED")) &_
97
             ",DEFAULT_ADVISORY_RIPPLE  = " & check2Yes(Request("DEFAULT_ADVISORY_RIPPLE")) &_
98
             " WHERE PKG_ID = '" & parPkgId & "'"
99
    objEH.TryORA ( OraSession )
5963 dpurdie 100
	On Error Resume Next
5357 dpurdie 101
	OraDatabase.ExecuteSQL sqlStr
102
	objEH.CatchORA ( OraSession )
103
 
104
    If objEH.Finally Then
105
        Call OpenInWindow ( SCRIPT_NAME + "?pkgFilter=" + Request("pkgFilter") )
106
    End If
5963 dpurdie 107
	On Error GoTo 0
5357 dpurdie 108
End If
109
%>
110
<html>
111
<head>
112
<title>Package Administration</title>
113
<link rel="shortcut icon" href="<%=FavIcon%>"/>
114
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
115
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 116
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
117
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
118
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5983 dpurdie 119
<!--#include file="_jquery_includes.asp"-->
5357 dpurdie 120
<!-- DROPDOWN MENUS -->
121
<!--#include file="_menu_def.asp"-->
6579 dpurdie 122
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 123
<!-- LOCAL STYLING -->
124
<style>
125
.edit {background-color:#FFFFE1}
126
.display {background-color:white}
127
.border {background-color:#F2F0E4}
128
</style>
129
</head>
130
<body text="#000000" leftmargin="0" topmargin="0" >
131
<!-- HEADER -->
132
<!--#include file="_header.asp"-->
133
<div class="div_table">
134
  <%
135
  '-- FROM START ---------------------------------------------------------------------------------------------------------
136
  objFormComponent.FormName = "PackageAdmin"
137
  objFormComponent.Action = ScriptName
138
  objFormComponent.OnSubmit = "ShowProgress();"
139
  Call objFormComponent.FormStart()
140
  %>
6793 dpurdie 141
    <table class="embedded_table center_table">
5357 dpurdie 142
      <tr>
6793 dpurdie 143
        <td>
144
        <span class="form_item">
145
            Package Filter: <input type="text" name="pkgFilter" value="<%=Request("pkgFilter")%>">
146
        </span>
147
          <table  border="0" cellspacing="1" cellpadding="2" class='stdBrown center_table'>
148
              <thead>
149
                <tr>
150
                  <th nowrap>Package Name </th>
151
                  <th nowrap>SunOs Name</th>
152
                  <th nowrap>Windows Name</th>
153
                  <th nowrap>Default Peg</th>
154
                  <th nowrap>Default Ripple</th>
155
                  <th >Edit</th>
156
                </tr>
157
              </thead>
5357 dpurdie 158
					  <!-- NORMAL ROW +++++++++++++++++++ -->
159
				    <%Set rsPkg = OraDatabase.DbCreateDynaset( Get_Packages, cint(0))
160
		        While ((NOT rsPkg.BOF) AND (NOT rsPkg.EOF))
161
                peg_checked = ""
162
                adr_checked = ""
163
                If rsPkg.Fields("DEFAULT_PEGGED") = "Y" Then peg_checked = "checked"
164
                If rsPkg.Fields("DEFAULT_ADVISORY_RIPPLE") = "Y" Then adr_checked = "checked"
165
                If parPkgId = rsPkg.Fields("PKG_ID") THEN
6793 dpurdie 166
                    rowClass = "class='edit'"
5357 dpurdie 167
                    rowBorder = "class='edit'"
168
                    editMode = "update"
169
                Else
6793 dpurdie 170
                    rowClass = "class='display'"
5357 dpurdie 171
                    rowBorder = "class='border'"
172
                End If
173
 
174
		        %>
175
	          <tr>
176
	            <td <%=rowClass%> nowrap><%=rsPkg.Fields("PKG_NAME")%></td>
177
                <%If parPkgId = rsPkg.Fields("PKG_ID") THEN%>
178
    	            <td <%=rowClass%> nowrap>
179
                      <input type="text" name="SUNOS_ELECTRONIC_NAME" class='form_iname' value="<%=rsPkg.Fields("SUNOS_ELECTRONIC_NAME")%>">
180
                    </td>
181
    	            <td <%=rowClass%> nowrap>
182
                      <input type="text" name="WIN_ELECTRONIC_NAME" class='form_iname' value="<%=rsPkg.Fields("WIN_ELECTRONIC_NAME")%>">
183
                    </td>
184
    	            <td <%=rowClass%>" nowrap>
185
                      <input type="checkbox" name="DEFAULT_PEGGED" class='form_iname' <%=peg_checked%>>
186
                    </td>
187
    	            <td <%=rowClass%>" nowrap>
188
                      <input type="checkbox" name="DEFAULT_ADVISORY_RIPPLE" class='form_iname'<%=adr_checked%>>
189
                    </td>
190
                <%ELSE%>
191
    	            <td <%=rowClass%> nowrap><%=rsPkg.Fields("SUNOS_ELECTRONIC_NAME")%></td>
192
    	            <td <%=rowClass%> nowrap><%=rsPkg.Fields("WIN_ELECTRONIC_NAME")%></td>
193
    	            <td <%=rowClass%> nowrap><input type="checkbox" disabled <%=peg_checked%>></td>
194
    	            <td <%=rowClass%> nowrap><input type="checkbox" disabled <%=adr_checked%>></td>
195
                <%END IF%>
196
 
197
	                <td align="center" nowrap <%=rowBorder%>>
198
                    <%If parPkgId = rsPkg.Fields("PKG_ID") THEN%>
199
                        <%=LIMG_ROW_SUBMIT %>
200
                        <a href="<%=SCRIPT_NAME%>?pkgFilter=<%=Request("pkgFilter")%>"><%=LIMG_ROW_CANCEL%></a>
201
                    <%ELSEIF parPkgId <> "" OR NOT canEdit THEN%>
202
                    <%ELSE%>
6783 dpurdie 203
                        <a href="<%=SCRIPT_NAME%>?action=edit&pkgId=<%=rsPkg.Fields("PKG_ID")%>&pkgFilter=<%=Request("pkgFilter")%>"><span title='Edit'><%=LIMG_EDIT %></span></a>
5357 dpurdie 204
                    <%END IF%>
205
                    </td>
206
	          </tr>
207
	          <%
208
                rsPkg.MoveNext
209
	          WEnd
210
			<!-- ++ Error Message Display ++++++++ -->
211
		      If rsPkg.RecordCount < 1 Then
212
              %>
213
			      <tr>
6793 dpurdie 214
    	            <td align=center colspan="5" nowrap class="display err_alert">
5357 dpurdie 215
                        <b>No packages selected by filters</b>
216
                    </td>
217
                  <td class="border"></td> 
218
	            </tr>
219
		      <%End If%>
220
			</table>
221
        </td>
222
        </tr>
223
		  <%=objPMod.ComposeHiddenTags()%>
224
		  <input type="hidden" name="action" value=<%=editMode%>>
225
		  <input type="hidden" name="pkgId" value="<%=parPkgId%>">
226
		  </form>
227
		  <%Call objFormComponent.FormEnd()%>
228
    </table>
229
  </div>
5957 dpurdie 230
<!-- FOOTER -->
231
<!--#include file="_footer.asp"-->
5357 dpurdie 232
</body>
233
</html>