Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                      MEMBERS                                      |
'|      NOTIFICATIONS - Packages Followed            |
'=====================================================
%>
<%
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"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim rsTemp
Dim parProjId
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parProjId = Request("proj_id")
objPMod.PersistInQryString("proj_id")
If parProjId = "" then parProjId = 0
'----------------------------------------------

Function Get_My_Interest_Packages ( NNuser_id )
        Get_My_Interest_Packages = _
        " SELECT * FROM PACKAGE_INTEREST PI, PACKAGES PKG, PROJECTS PRJ WHERE USER_ID = "& NNuser_id &""&_
        " AND PI.PKG_ID = PKG.PKG_ID AND PI.PROJ_ID = PRJ.PROJ_ID order by PRJ.PROJ_ID, pkg.pkg_name"
End Function

'--------------------------------------------------------------------------------------------------------------------------
Sub DeletePackageInterestOwner (projId, pkgId)

        On Error Resume Next

        OraDatabase.Parameters.Add "PROJ_ID",   projId, ORAPARM_INPUT, ORATYPE_NUMBER
        OraDatabase.Parameters.Add "PKG_ID",    pkgId,  ORAPARM_INPUT, ORATYPE_NUMBER
        OraDatabase.Parameters.Add "USER_ID",   objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER

        objEH.TryORA ( OraSession )

        OraDatabase.ExecuteSQL _
        "BEGIN   REMOVE_PACKAGE_INTEREST ( :PROJ_ID, :PKG_ID, :USER_ID );   END;"

        objEH.CatchORA ( OraSession )

        OraDatabase.Parameters.Remove "PROJ_ID"
        OraDatabase.Parameters.Remove "PKG_ID"
        OraDatabase.Parameters.Remove "USER_ID"

End Sub
'--------------------------------------------------------------------------------------------------------------
If Request("btn") = "Remove" Then
        If objForm.IsValidOnPostBack Then
                Dim txt,posComma, posUnderscore, projId, pkgId, value

                txt = Mid(Request("pkg_id_list"), 1, len(Request("pkg_id_list"))-2)
                posComma = InStr(txt, ",")

                While posComma <> 0
                        'Response.Write(txt)
                        value = Mid(txt, 1, posComma-1)
                        posUnderscore = Instr(value, "_")
                        projId = Mid(value, 1, posUnderscore - 1)
                        pkgId = Mid(value, posUnderscore + 1, posComma-1)

                        Call DeletePackageInterestOwner(projId, pkgId)

                        txt = Mid(txt, posComma + 1, Len(txt))
                        posComma = InStr(txt, ",")
                Wend

                If posComma = 0 Then
                        posUnderscore = Instr(txt, "_")
                        projId = Mid(txt, 1, posUnderscore - 1)
                        pkgId = Mid(txt, posUnderscore + 1)

                        Call DeletePackageInterestOwner(projId, pkgId)

                Else
                End if
                ' --- Form is Valid ---
                'Call DeleteViewOwner()
                If objEH.Finally Then
                        Call OpenInWindow ( "members_pkgs_followed.asp" )
                End If
        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>
<script language="javascript">
<!--
function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
         for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall' && theForm[z].disabled != true){
          theForm[z].checked = theElement.checked;
          }
     }
    }
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!----------------------------------------------------->
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- BODY ---->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1%" background="images/bg_member_dark.gif" valign="top">
      <!-- MEMBERS MENU ---------------------------------------------->
          <!--#include file="members_menu_def.asp"-->
          <%Call Member_Menu( "notifications" )%>
      <!--  MEMBERS MENU END ------------------------------------------>
    </td>
    <td width="1%" valign="top" background="images/bg_member_light.gif"><a href="index.asp" class="form_txt_link"><img src="images/i_home.gif" width="13" height="12" border="0" align="absmiddle">Exit</a></td>
    <td rowspan="2" valign="top" width="1%" background="images/bg_member_light.gif" nowrap>
      <!------------------------------------------->
      <br>
      <span class="mmb_ttl">Notifications</span><br>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <%
        '-- FROM START ---------------------------------------------------------
        objFormComponent.FormName = "FormName"
        objFormComponent.Action = ScriptName
        Call objFormComponent.FormStart()
        %>
        <tr>
          <td width="1%">&nbsp;</td>
          <td align="right"><img src="images/h_trsp_dot.gif" width="500" height="30"></td>
          <td width="1%">&nbsp;</td>
        </tr>
        <tr>
          <td align="left" valign="top" width="1%" background="images/bg_member_dark.gif"><img src="images/h_trsp_dot.gif" width="13" height="13"></td>
            <td background="images/bg_member_dark.gif" align="left" class="wform_ttl">&nbsp;</td>
          <td align="right" valign="top" width="1%" background="images/bg_member_dark.gif">&nbsp;</td>
        </tr>

        <tr>
          <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
          <td bgcolor="#FFFFFF" valign="top" class="form_item"> <br>

                        <a name="PACKAGE_INTEREST"></a>
              <p>You are currently interested in the following packages. <br>
  NOTE: You will be notified when the package is officially released/autobuild.</p>
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                  <tr>
                        <td nowrap class="form_iname" valign="top">Select Project </td>
                        <td valign="top" nowrap class="form_iname">
                        <%

                          Dim Query_String, rsQry
                                Query_String = _
                                " SELECT * FROM PROJECTS order by proj_name"


                          Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )

                        Response.write "<select name='FRproj_id' onChange=""Cascaded_Menu('parent','"& scriptName &"?proj_id="&Request("FRproj_id")&"',this,0)"" class='form_item'>"
                        Response.write "<option value='0' selected>--NONE--</option>"
                          %>

                                <%While (NOT rsQry.BOF) AND (NOT rsQry.EOF)

                        If CDbl(Request("proj_id")) = CDbl(rsQry.Fields("proj_id")) Then
                        Response.write "<option value='"& rsQry.Fields("proj_id") &"' selected>"& UCase(rsQry.Fields("proj_name")) &"</option>"
                Else

                                Response.write "<option value='"& rsQry.Fields("proj_id") &"'>"& UCase(rsQry.Fields("proj_name")) &"</option>"
                        End If
                                        rsQry.MoveNext
                                WEnd

                                rsQry.Close()
                                Set rsQry = nothing
                                %>
                          </select>
                          </tr>
                          <%If parProjId > 0  Then %>
                          <tr>
                                <td nowrap class="form_iname" valign="top">Add Interest</td>
                                <td valign="top" nowrap class="form_iname">

                        <a href="javascript:;" class ="form_iname" onClick="MM_openBrWindow('wAddPackageInterest.asp?proj_id=<%=parProjId%>','AddPackageInterest','scrollbars=yes,resizable=yes,width=350,height=800')"><img src="images/email-contact-orange.gif"></a>
                        <%End If%>
                          </tr>
                <tr>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field"><INPUT type=checkbox name="checkall" value="Check All" onClick="checkUncheckAll(this);"></td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Project&nbsp;</td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Package</td>
                </tr>
                <%
                                Dim currProj_id
                                currProj_id = -1


                                Set rsTemp = OraDatabase.DbCreateDynaset(Get_My_Interest_Packages( objAccessControl.UserId ), cint(0))
                            While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
                                %>
                <%If CStr( currProj_id ) <> CStr(rsTemp("proj_id")) Then%>
                <tr>
                  <td nowrap background="images/bg_form_lightgray.gif" class="form_item"></td>
                  <td nowrap background="images/bg_form_lightgray.gif" class="form_item"><b><%=rsTemp("proj_name")%></b></td>
                  <td nowrap background="images/bg_form_lightgray.gif" class="form_item"></td>
                </tr>
                <%currProj_id = rsTemp("proj_id")%>


                <%End If%>
                                <tr>
                  <td nowrap background="images/bg_form_lightgray.gif" class="form_item"><input type="checkbox" name="pkg_id_list" value="<%=rsTemp("proj_id")%>_<%=rsTemp("pkg_id")%>"></td>
                  <td nowrap background="images/bg_form_lightgray.gif" class="form_item"></td>
                  <td nowrap background="images/bg_form_lightgray.gif" class="form_item"><%=rsTemp("pkg_name")%></td>
                </tr>
                <%rsTemp.MoveNext
                    WEnd%>
                <%If rsTemp.RecordCount = 0 Then%>
                <tr>
                  <td background="images/bg_form_lightgray.gif" class="form_item" colspan="3">You are not interested in any packages.</td>
                </tr>
                <%End If%>
              </table>
              <br>
              <%If rsTemp.RecordCount <> 0 Then%>
              <input name="btn" type="submit" class="form_btn" value="Remove">
              <%End If
                          rsTemp.Close()
                          set rsTemp = nothing
                          %>
                        <input type="hidden" name="pkg_id_list" value="<%=Request("pkg_id_list")%>">
                        <input type="hidden" name="action" value="true">
                        </td>
          <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
        </tr>
        <tr>
          <td width="1%" background="images/bg_member_dark.gif" valign="bottom"><img src="images/h_trsp_dot.gif" width="13" height="13"></td>
          <td background="images/bg_member_dark.gif"></td>
          <td width="1%" background="images/bg_member_dark.gif" valign="bottom" align="right"><img src="images/h_trsp_dot.gif" width="13" height="13"></td>
        </tr>
        <%
        Call objFormComponent.FormEnd()
        '-- FROM END -----------------------------------------------------------
        %>
      </table>
      <!-------------------------------------------------------->
    </td>
    <td rowspan="2" valign="bottom" width="100%" background="images/bg_member_light.gif" align="right"><img src="images/bg_img_view.gif" width="249" height="144" vspace="10" hspace="10"></td>
  </tr>
  <tr>
    <td valign="bottom" align="center" background="images/bg_member_dark.gif"><img src="images/img_members.gif" width="81" height="57" vspace="20" hspace="30"></td>
    <td background="images/bg_member_light.gif" valign="top"><img src="images/h_trsp_dot.gif" width="100" height="400"></td>
  </tr>
</table>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>
<%
Call Destroy_All_Objects
%>