Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0   ' always load the page, dont store
%>
<%
'=====================================================
'               New Category
'=====================================================
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim NEWBase_view_id

Dim parPv_id
Dim parPPv_id
Dim parAdd_type
Dim parPkg_list
Dim parRFile
Dim parMovePkg
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parPv_id = Request("pv_id")
parPPv_id = Request("ppv_id")
parAdd_type = Request("add_type")
parPkg_list = Request("pkg_list")
parRFile = Request("rfile")
parMovePkg = Request("movepkg")
'----------------------------------------------
%>
<%
Function Create_New_Base_View( SSvname )
   ' Return new Base View
   Dim SEQ_view_id
   SEQ_view_id = Get_From_DUAL("SEQ_VIEW_ID.nextval")

   objEH.TryORA ( OraSession )
   On Error Resume Next

   OraDatabase.ExecuteSQL _
      " INSERT INTO views (view_id, view_name, owner_id, base_view, public_read)"&_
      " VALUES ("& SEQ_view_id &", '"& UCase(SSvname) &"', 0,'Y','Y')"

   objEH.CatchORA ( OraSession )
   Create_New_Base_View = SEQ_view_id
End Function


Function BaseViewExists ( SSbname )
   ' RETURN -1 if baseview not found, else return VIEW_ID
   Dim rsTemp, Query_String
   Query_String = _
   " SELECT view_id FROM views"&_
   " WHERE view_name ='"& UCase(SSbname)&"'"&_
   " AND owner_id = 0  AND base_view = 'Y'  AND public_read = 'Y'"
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   If rsTemp.RecordCount > 0 Then
      BaseViewExists = rsTemp.Fields("view_id")
   Else
      BaseViewExists = -1
   End If

   rsTemp.Close
   Set rsTemp = nothing
End Function
%>
<%
'Process submition
If CBool(QStrPar("action")) AND  objAccessControl.UserLogedIn Then
   NEWBase_view_id = BaseViewExists ( Request("base_view_name") )
   If NEWBase_view_id = -1 Then
      'Group not found i.e. create it
      NEWBase_view_id = Create_New_Base_View( Request("base_view_name") )
   End If

   If parMovePkg = "true" Then
      ' Call is comming from dependencies page to move package to other base view
      Call Update_Pkg_Category ( parRtag_id, parPv_id, NEWBase_view_id )
      Call OpenInParentWindow ("dependencies.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id)
      Call CloseWindow
   Else
      Call OpenInParentWindow ( parRFile &"?base_view_id="& NEWBase_view_id &_
                                "&pkg_list="& parPkg_list &_
                          "&add_type="& parAdd_type &_
                          "&pv_id="& parPv_id &_
                          "&ppv_id="& parPPv_id &_
                          "&rtag_id="& parRtag_id )
      Call CloseWindow
   End If
End If
%>
<html>
<head>
<title>Release Manager</title>
<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" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();window.document.newbaseview.base_view_name.focus();">
<form name="newbaseview" method="post" action="<%=scriptName%>" onSubmit="MM_validateForm('base_view_name','Base View','RisCleanStr');return document.MM_returnValue">
  <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
    <tr>
      <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_change_group_off.gif" width="22" height="25" hspace="5"></td>
      <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Create NEW Base View</td>
      <td background="images/lbox_bg_blue.gif" align="right" width="50%">
        <input type="submit" name="btn" value="Create" class="form_btn_comp">
        <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
      </td>
      <td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
        <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
    </tr>
    <tr>
      <td height="100%" width="1%">&nbsp;</td>
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
          <tr>
            <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
            <td width="1%" nowrap class="form_group" valign="bottom"></td>
            <td nowrap width="100%">&nbsp; </td>
          </tr>
          <tr>
            <td width="1%">&nbsp;</td>
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Base View</td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
              <input type="text" name="base_view_name" maxlength="30" class="form_item">
            </td>
          </tr>
          <tr>
            <td width="1%">&nbsp;</td>
            <td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
            <td nowrap width="100%">
              <p>&nbsp;</p>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
    </tr>
  </table>
   <input type="hidden" name="rfile" value="<%=parRFile%>">
   <input type="hidden" name="movepkg" value="<%=parMovePkg%>">
   <input type="hidden" name="add_type" value="<%=parAdd_type%>">
   <input type="hidden" name="pv_id" value="<%=parPv_id%>">
   <input type="hidden" name="ppv_id" value="<%=parPPv_id%>">
   <input type="hidden" name="pkg_list" value="<%=parPkg_list%>">
   <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
   <input type="hidden" name="action" value="true">
</form>
</body>
</html>


<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->