Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                   MEMBERS                         |
'|                 PUBLIC VIEW                       |
'=====================================================
%>
<%
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"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim rsTemp
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
'----------------------------------------------
%>
<%
Function Get_Public_Views ( NNuser_id )
   Get_Public_Views = ReadFile( rootPath & "queries\public_views_list.qry" )
   Get_Public_Views = Replace( Get_Public_Views, "$USER_ID$", NNuser_id)
End Function

Sub Remove_View_Settings ( NNuser_id )
   objEH.TryORA ( OraSession )
   On Error Resume Next
   OraDatabase.ExecuteSQL " DELETE FROM view_settings vis WHERE vis.user_id = "& NNuser_id &" AND vis.view_id IN (SELECT vi.view_id FROM views vi WHERE vi.owner_id = 0 OR vi.public_read = 'Y')"
   objEH.CatchORA ( OraSession )
End Sub

Sub Insert_View_Settings ( NNuser_id, SSpublicshow )
   If SSpublicshow <> "" Then
      objEH.TryORA ( OraSession )
      On Error Resume Next
      OraDatabase.ExecuteSQL " INSERT INTO view_settings"&_
                             " SELECT TO_NUMBER('"& NNuser_id &"') AS user_id, vi.view_id FROM views vi WHERE vi.view_id IN ("& SSpublicshow &")"
      objEH.CatchORA ( OraSession )
   End If
End Sub

Function Owner_Format( NNuser_id, SSemail, SSname )
   If CInt(NNuser_id) = 0 Then
      Response.write "public"
   Else
      Response.write "<a href='mailto:"& SSemail &"' class='txt_linked'>"& SSname &"</a>"
   End If
End Function
%>
<%
'--- Process submition ---
If (QStrPar("action") <> "") Then
   ' All mandatory parameters FOUND
   Call Remove_View_Settings ( objAccessControl.UserId )
   Call Insert_View_Settings ( objAccessControl.UserId, Request("FRpublicshow") )
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" >
<!-- 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( "views" )%>
      <!--  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">Public View</span><br>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <form name="publicview" method="post" action="members_public_view.asp?done=done<%=QSTR%>">
        <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"><a href="#" onClick="MM_openBrWindow('members_new_public_view.asp','ReleaseManager','scrollbars=yes,resizable=yes,width=400,height=500')" class="wform_ttl"><img src="images/i_add_view.gif" width="32" height="18" border="0" align="absmiddle" hspace="2" vspace="10" alt="Create new public view">New View</a></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>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td background="images/bg_form_lightbluedark.gif" nowrap class="form_field" width="1%">Show</td>
                <td background="images/bg_form_lightbluedark.gif" nowrap class="form_field" width="100%">View Name</td>
            <td background="images/bg_form_lightbluedark.gif" nowrap class="form_field" width="1%">Package Count</td>
            <td background="images/bg_form_lightbluedark.gif" nowrap class="form_field" width="1%">Owner</td>
                <td background="images/bg_form_lightbluedark.gif" class="form_field" width="1%">&nbsp;</td>
                <td background="images/bg_form_lightbluedark.gif" class="form_field" width="1%">&nbsp;</td>
              </tr>
         <%Set rsTemp = OraDatabase.DbCreateDynaset( Get_Public_Views( objAccessControl.UserId ), cint(0))
           While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))%>
              <tr>
                <td background="images/bg_form_lightgray.gif" align="center"><input type="checkbox" name="FRpublicshow" value="<%=rsTemp.Fields("view_id")%>" <%If CBool(rsTemp.Fields("show")) Then Response.write "checked"%>></td>
            <%If rsTemp.Fields("base_view") = "Y" Then%>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item"><%=rsTemp.Fields("view_name")%></td>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item" align="center">base view</td>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item"><%=Owner_Format( rsTemp.Fields("owner_id"), rsTemp.Fields("owner_email"), rsTemp.Fields("owner_name") )%></td>
                   <td background="images/bg_form_lightgray.gif"><img src="images/i_edit_disable.gif" width="12" height="12" hspace="5" ></td>
                   <td background="images/bg_form_lightgray.gif"><img src="images/i_delete_disable.gif" width="13" height="12" hspace="5" ></td>
            <%Else%>
               <%If (Cint(rsTemp.Fields("owner_id")) = Cint(objAccessControl.UserId)) OR (Cint(rsTemp.Fields("owner_id")) = 0) Then%>
               <td background="images/bg_form_lightgray.gif" nowrap><a href="#" onClick="MM_openBrWindow('members_edit_public_view.asp?FRview_id=<%=rsTemp.Fields("view_id")%>','ReleaseManager','scrollbars=yes,resizable=yes,width=400,height=500')" class="form_item"><%=rsTemp.Fields("view_name")%></a></td>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item" align="center"><%=rsTemp.Fields("pkg_count")%></td>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item"><%=Owner_Format( rsTemp.Fields("owner_id"), rsTemp.Fields("owner_email"), rsTemp.Fields("owner_name") )%></td>
                   <td background="images/bg_form_lightgray.gif"><a href="#" onClick="MM_openBrWindow('members_edit_public_view.asp?FRview_id=<%=rsTemp.Fields("view_id")%>','ReleaseManager','scrollbars=yes,resizable=yes,width=400,height=500')"><img src="images/i_edit.gif" width="12" height="12" hspace="5" border="0" alt="Edit view" title="Edit view"></a></td>
                   <td background="images/bg_form_lightgray.gif"><a href="_remove_public_view.asp?FRview_id=<%=rsTemp.Fields("view_id")%>"><img src="images/i_delete.gif" width="13" height="12" hspace="5" border="0" alt="Delete view permanently" title="Delete view permanently"></a></td>
               <%Else%>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item"><%=rsTemp.Fields("view_name")%></td>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item" align="center"><%=rsTemp.Fields("pkg_count")%></td>
               <td background="images/bg_form_lightgray.gif" nowrap class="form_item"><%=Owner_Format( rsTemp.Fields("owner_id"), rsTemp.Fields("owner_email"), rsTemp.Fields("owner_name") )%></td>
               <td background="images/bg_form_lightgray.gif"><img src="images/i_edit_disable.gif" width="12" height="12" hspace="5" ></td>
                   <td background="images/bg_form_lightgray.gif"><img src="images/i_delete_disable.gif" width="13" height="12" hspace="5" ></td>
               <%End If%>
            <%End If%>
              </tr>
         <%rsTemp.MoveNext
          WEnd%>
            </table>
            <br>
         <input type="hidden" name="action" value="true">
            <input type="submit" name="btn" value=" Apply " class="form_btn">
            <input type="reset" name="btn" value="Reset" class="form_btn"><%If (QStrPar("action") <> "") Then Response.write "&nbsp;&nbsp;Changes applied!"%>
         <br><br>
          </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>
      </form>
      </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
%>