Subversion Repositories DevTools

Rev

Rev 7225 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                  ADMIN Page                           |
'|                 Package Properties                    |
'|                                                               |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0    ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="_action_buttons.asp"-->

<!--#include file="class/classActionButtonControl.asp"-->

<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login_optional.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim objBtnControl
Dim rsPkg
Dim SCRIPT_NAME
Dim peg_checked
Dim adr_checked
Dim parPkgId
Dim editMode
Dim SqlStr
Dim canEdit
Dim rowClass, rowBorder
'------------ Constants Declaration -----------
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'>"
Const LIMG_ROW_CANCEL = "<img src='icons/bi_cancel.gif' width='16' height='16' border='0' hspace='2' title='Cancel'>"
'------------ Variable Init -------------------
Set objBtnControl = New ActionButtonControl
SCRIPT_NAME = Mid(Request.ServerVariables("SCRIPT_NAME"), InStrRev(Request.ServerVariables("SCRIPT_NAME"), "/") + 1 )
parPkgId = Request("PkgId")
editMode = "none"
canEdit = false
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------
' Function:     Get_Packages
' Description:  Get a list of packages to be displayed
'               Will be either selected by name or only packages with defined defaults
Function Get_Packages
   If Request("pkgFilter") <> "" Then
        Get_Packages = _
        " SELECT * FROM PACKAGES " &_
        " WHERE PKG_NAME LIKE '%"&Request("pkgFilter")&"%'" &_ 
        " ORDER BY pkg_name ASC"
   Else
        Get_Packages = _
        " SELECT * FROM PACKAGES " &_
        " WHERE DEFAULT_PEGGED is not NULL " &_
        "    OR DEFAULT_ADVISORY_RIPPLE is not NULL" &_
        " ORDER BY pkg_name ASC"
    End If
End Function
'-------------Page Access Condition--------------------------------------------
If canActionControlInProject("EditPackageProperties") Then
    canEdit = true
Else
    parPkgId = NULL
End If
'------------- Before Render --------------------------------------------------
'-------------------------------------------------
' Function:         check2Yes   
' Description:      Convert the value of a checkbox into a 'Y" or a empty value
Function check2Yes(val)
    If  val = "on" Then
        check2Yes = "'Y'"
    Else
        check2Yes = "''"
    End If
End Function
'-------------------------------------------------
' Update edited values
If canEdit AND Request("action") = "update" AND parPkgId <> "" Then
    sqlStr = "UPDATE PACKAGES SET" &_
             " WIN_ELECTRONIC_NAME  = '" & Request("WIN_ELECTRONIC_NAME") & "'"&_
             ",SUNOS_ELECTRONIC_NAME  = '" & Request("SUNOS_ELECTRONIC_NAME") & "'"&_
             ",DEFAULT_PEGGED  = " & check2Yes(Request("DEFAULT_PEGGED")) &_
             ",DEFAULT_ADVISORY_RIPPLE  = " & check2Yes(Request("DEFAULT_ADVISORY_RIPPLE")) &_
             " WHERE PKG_ID = '" & parPkgId & "'"
    objEH.TryORA ( OraSession )
        On Error Resume Next
        OraDatabase.ExecuteSQL sqlStr
        objEH.CatchORA ( OraSession )

    If objEH.Finally Then
        Call OpenInWindow ( SCRIPT_NAME + "?pkgFilter=" + Request("pkgFilter") )
    End If
        On Error GoTo 0
End If
%>
<html>
<head>
<title>Package Administration</title>
<link rel="shortcut icon" href="<%=FavIcon%>"/>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
<!--#include file="_jquery_includes.asp"-->
<!-- DROPDOWN MENUS -->
<!--#include file="_menu_def.asp"-->
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
<!-- LOCAL STYLING -->
<style>
.edit {background-color:#FFFFE1}
.display {background-color:white}
.border {background-color:#F2F0E4}
</style>
</head>
<body text="#000000" leftmargin="0" topmargin="0" >
<!-- HEADER -->
<!--#include file="_header.asp"-->
<div class="div_table">
  <%
  '-- FROM START ---------------------------------------------------------------------------------------------------------
  objFormComponent.FormName = "PackageAdmin"
  objFormComponent.Action = ScriptName
  objFormComponent.OnSubmit = "ShowProgress();"
  Call objFormComponent.FormStart()
  %>
    <table class="embedded_table center_table">
      <tr>
        <td>
        <span class="form_item">
            Package Filter: <input type="text" name="pkgFilter" value="<%=Request("pkgFilter")%>">
        </span>
          <table  border="0" cellspacing="1" cellpadding="2" class='stdBrown center_table'>
              <thead>
                <tr>
                  <th nowrap>Package Name </th>
                  <th nowrap>SunOs Name</th>
                  <th nowrap>Windows Name</th>
                  <th nowrap>Default Peg</th>
                  <th nowrap>Default Ripple</th>
                  <th class=tight>Edit</th>
                </tr>
              </thead>
                                          <!-- NORMAL ROW +++++++++++++++++++ -->
                                    <%Set rsPkg = OraDatabase.DbCreateDynaset( Get_Packages, cint(0))
                        While ((NOT rsPkg.BOF) AND (NOT rsPkg.EOF))
                peg_checked = ""
                adr_checked = ""
                If rsPkg.Fields("DEFAULT_PEGGED") = "Y" Then peg_checked = "checked"
                If rsPkg.Fields("DEFAULT_ADVISORY_RIPPLE") = "Y" Then adr_checked = "checked"
                If parPkgId = rsPkg.Fields("PKG_ID") THEN
                    rowClass = "class='edit'"
                    rowBorder = "class='edit tight'"
                    editMode = "update"
                Else
                    rowClass = "class='display'"
                    rowBorder = "class='border tight'"
                End If

                        %>
                  <tr>
                    <td <%=rowClass%> nowrap><%=rsPkg.Fields("PKG_NAME")%></td>
                <%If parPkgId = rsPkg.Fields("PKG_ID") THEN%>
                    <td <%=rowClass%> nowrap>
                      <input type="text" name="SUNOS_ELECTRONIC_NAME" class='form_iname' value="<%=rsPkg.Fields("SUNOS_ELECTRONIC_NAME")%>">
                    </td>
                    <td <%=rowClass%> nowrap>
                      <input type="text" name="WIN_ELECTRONIC_NAME" class='form_iname' value="<%=rsPkg.Fields("WIN_ELECTRONIC_NAME")%>">
                    </td>
                    <td <%=rowClass%>" nowrap>
                      <input type="checkbox" name="DEFAULT_PEGGED" class='form_iname' <%=peg_checked%>>
                    </td>
                    <td <%=rowClass%>" nowrap>
                      <input type="checkbox" name="DEFAULT_ADVISORY_RIPPLE" class='form_iname'<%=adr_checked%>>
                    </td>
                <%ELSE%>
                    <td <%=rowClass%> nowrap><%=rsPkg.Fields("SUNOS_ELECTRONIC_NAME")%></td>
                    <td <%=rowClass%> nowrap><%=rsPkg.Fields("WIN_ELECTRONIC_NAME")%></td>
                    <td <%=rowClass%> nowrap><input type="checkbox" disabled <%=peg_checked%>></td>
                    <td <%=rowClass%> nowrap><input type="checkbox" disabled <%=adr_checked%>></td>
                <%END IF%>

                        <td align="center" nowrap <%=rowBorder%>>
                    <%If parPkgId = rsPkg.Fields("PKG_ID") THEN%>
                        <%=LIMG_ROW_SUBMIT %>
                        <a href="<%=SCRIPT_NAME%>?pkgFilter=<%=Request("pkgFilter")%>"><%=LIMG_ROW_CANCEL%></a>
                    <%ELSEIF parPkgId <> "" OR NOT canEdit THEN%>
                    <%ELSE%>
                        <a href="<%=SCRIPT_NAME%>?action=edit&pkgId=<%=rsPkg.Fields("PKG_ID")%>&pkgFilter=<%=Request("pkgFilter")%>"><span title='Edit'><%=LIMG_EDIT %></span></a>
                    <%END IF%>
                    </td>
                  </tr>
                  <%
                rsPkg.MoveNext
                  WEnd
                        <!-- ++ Error Message Display ++++++++ -->
                      If rsPkg.RecordCount < 1 Then
              %>
                              <tr>
                    <td align=center colspan="5" nowrap class="display err_alert">
                        <b>No packages selected by filters</b>
                    </td>
                  <td class="border"></td> 
                    </tr>
                      <%End If%>
                        </table>
        </td>
        </tr>
                  <%=objPMod.ComposeHiddenTags()%>
                  <input type="hidden" name="action" value=<%=editMode%>>
                  <input type="hidden" name="pkgId" value="<%=parPkgId%>">
                  </form>
                  <%Call objFormComponent.FormEnd()%>
    </table>
  </div>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>