Rev 121 | Rev 3896 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='| |'| EDIT |'| DEPENDENCIES |'| |'=====================================================%><%Option explicit' Good idea to set when using redirectResponse.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"--><%' Make sure rtag_id is always presentIf Request("pv_id") = "" ThenResponse.Redirect("index.asp")End If%><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_login.asp"--><!--#include file="_access_control_general.asp"--><!--#include file="_access_control_project.asp"--><%'------------ Variable Definition -------------Dim parPv_idDim rsPkgsDim HTML_pkg_listDim JSrequirementsSTR'------------ Constants Declaration -----------'------------ Variable Init -------------------parPv_id = Request("pv_id")Set pkgInfoHash = CreateObject("Scripting.Dictionary")Sub Generate_Dependencies_List ( NNpv_id, nRtag_id, SShtml_pkg_list, SSJSreq )Dim rsDeps, Query_String, LatestVisible, disabledQuery_String = ReadFile( rootPath & "queries\edit_dependencies.sql" )OraDatabase.Parameters.Add "RTAG_ID", nRtag_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBERSet rsDeps = OraDatabase.DbCreateDynaset( Query_String, cint(0))While ((NOT rsDeps.BOF) AND (NOT rsDeps.EOF))disabled = FALSE'If IsNull(rsDeps("lpv_id")) Then' disabled = TRUE'End IfIf NOT disabled ThenSShtml_pkg_list = SShtml_pkg_list &"<tr> "SShtml_pkg_list = SShtml_pkg_list &" <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>"& rsDeps("pkg_name") &"<input name='bt"& rsDeps("pv_id") &"' type='hidden' value='"& rsDeps("build_type") &"'></td>"SShtml_pkg_list = SShtml_pkg_list &" <td background='images/bg_form_lightgray.gif'><input type='text' id='pkgn"& rsDeps("pv_id") &"' name='pkgn"& rsDeps("pv_id") &"' class='form_item' size='12' value='"& rsDeps("pkg_version") &"' onBlur='Compare_Version ( """& rsDeps("pv_id") &""" );' onFocus='Compare_Version ( """& rsDeps("pv_id") &""" );'> "SShtml_pkg_list = SShtml_pkg_list &" <a href='javascript:;' onClick='MM_openBrWindow(""_wform_get_version.asp?pkg_id="& rsDeps("pkg_id") &"&pkg_name="& rsDeps("pkg_name") &"&pv_id="& rsDeps("pv_id") &""",""GetVersion"",""resizable=yes,width=350,height=150"")'><img src='images/i_get.gif' width='16' height='16' align='absmiddle' hspace='5' border='0' alt='Get package version from the list' title='Get package version from the list'></a> "SShtml_pkg_list = SShtml_pkg_list &" </td>"ElseSShtml_pkg_list = SShtml_pkg_list &"<tr> "SShtml_pkg_list = SShtml_pkg_list &" <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>"& rsDeps("pkg_name") &"<input name='bt"& rsDeps("pv_id") &"' type='hidden' value='"& rsDeps("build_type") &"'></td>"SShtml_pkg_list = SShtml_pkg_list &" <td background='images/bg_form_lightgray.gif'><input disabled type='text' class='form_item' size='12' value='"& rsDeps("pkg_version") &"'>"SShtml_pkg_list = SShtml_pkg_list &" </td>"End If' Latest VersionsLatestVisible = "style='display:none;'"If ( rsDeps("pv_id") <> rsDeps("lpv_id") ) AND ( NOT disabled ) ThenLatestVisible = ""End IfSShtml_pkg_list = SShtml_pkg_list &" <td background='images/bg_form_lightgray.gif' class='sublbox_hitem'><DIV id='divLPV"& rsDeps("pv_id") &"' name='divLPV"& rsDeps("pv_id") &"' "& LatestVisible &">"&_"<a href='javascript:;' onClick='Merge_Version ( ""pkgn"& rsDeps("pv_id") &""", """& rsDeps("lpkg_version") &""", ""divLPV"& rsDeps("pv_id") &""" );'>"&_"<img src='images/bt_move_left.gif' border='0' alt='Bring over this latest version' hspace='2' align='absmiddle'>"&_"</a>"& rsDeps("lpkg_version") &"<input name='lp"& rsDeps("pv_id") &"' type='hidden' value='"& rsDeps("lpkg_version") &"'></DIV></td> "SShtml_pkg_list = SShtml_pkg_list &"</tr>"If disabled Then' Store not found dependency as hidden field.' NOTE: This is not safe as the client can temper with hidden value but it will do for now.SShtml_pkg_list = SShtml_pkg_list &"<input type='hidden' name='pkgn"& rsDeps("pv_id") &"' value='"& rsDeps("pkg_version") &"'>"ElseSSJSreq = SSJSreq & ",'pkgn"& rsDeps("pv_id") &"','"& rsDeps("pkg_name") &" Version','RisVersionStr'"End IfrsDeps.MoveNextWEndIf SSJSreq <> "" Then SSJSreq = Right( SSJSreq, Len(SSJSreq)-1 ) ' Remove first commaOraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Remove "PV_ID"End Sub%><%If parPv_id <> "" ThenCall Get_Pkg_Info ( parPv_id, NULL )End If%><%'=================== MAIN LINE =====================Call Generate_Dependencies_List ( parPv_id, parRtag_id, HTML_pkg_list, JSrequirementsSTR )If JSrequirementsSTR = "" Then'Edit button clicked on empty dependency list. Redirect user to Add DependenciesResponse.Redirect ("form_search_pkgs.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&add_type="& enum_ADD_DEPENDENCIES)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><!-- DROPDOWN MENUS --><!--#include file="_menu_def.asp"--><script language="JavaScript1.2" src="images/popup_menu.js"></script><script language="JavaScript" type="text/JavaScript"><!--function Merge_Version ( pkgtxt_name, lpkg_version, lpkg_div ) {MM_findObj( pkgtxt_name ).value = lpkg_version;MM_findObj( lpkg_div ).style.display = "none";}function Compare_Version ( pv_id ) {var cv, lv;cv = MM_findObj( "pkgn" + pv_id ).value;lv = MM_findObj( "lp" + pv_id ).value;if ( cv != lv ) {MM_findObj( "divLPV"+ pv_id ).style.display = "block";} else {MM_findObj( "divLPV"+ pv_id ).style.display = "none";}}//-----------------------------------------------------------------------------------------------------------------------------// Javascript Function: updateFields//// Purpose: This is a function that is called by external javascript to update fields in form//// Arguments: myPv_id (integer) - Package version number// myPkgId (integer) - Package number (not used in form_edit_deps.asp implementation of this function)// newVersion (string) - output value of the external javascript. This is the new version// cancelled (boolean) - true if user cancelled popup, else false//// Returns: nothing//// Notes: this is called by the popup window coded in _wform_get_version.asp when the user clicks 'submit' in that popup window. An equivalent function also// exists in form_add_pkg_versions.asp for when it activates the code in _wform_get_version.asp.function updateFields( myPv_id, myPkgId, newVersion, cancelled ){// if user is cancelling the popup, or if the version we have got from the popup is empty...if (cancelled || newVersion == ""){// do nothing}else{// Note here we use myPv_id as the pkgn input field of the 'editdep' form is associated with a pv_id rather than a pkg_iddocument.getElementById("pkgn" + myPv_id).value = newVersion;document.getElementById("pkgn" + myPv_id).focus();}}// --></script></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0"><!-- MENU LAYERS --------------------------------------><div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"></div><!-- TIPS LAYERS --------------------------------------><div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10"> </div><!-----------------------------------------------------><!-- HEADER --><!--#include file="_header.asp"--><!-- BODY ----><table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="top" background="images/bg_lght_gray.gif"><!-- MIDDLE ----------------------------------------><table width="650" border="0" cellspacing="0" cellpadding="0"><tr><td> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="1%"></td><td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td><td width="1%"></td></tr><tr><td width="1%"></td><td> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap class="form_ttl">EDIT dependencies</td><td align="right" valign="bottom"></td></tr></table></td><td width="1%"></td></tr><tr><td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td><td background="images/lbox_bg_blue.gif" align="right"><!-- Heading --><img src="images/h_trsp_dot.gif" width="1" height="20"><!-- END Heading --></td><td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></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"><!-- Body --><table width="100%" border="0" cellspacing="1" cellpadding="2"><form name="editdep" method="post" action="_update_dependencies.asp" onSubmit="MM_validateForm(<%=JSrequirementsSTR%>);return document.MM_returnValue"><tr><td colspan="2" width="1%" nowrap class="form_field"><%=pkgInfoHash.Item ("pkg_name")%> <%=pkgInfoHash.Item ("pkg_version")%></td></tr><tr><td colspan="2" width="1%" nowrap class="form_field"><table width="100%" border="0" cellspacing="1" cellpadding="2"><tr><td background="images/bg_form_lightbluedark.gif" nowrap width="1%" class="form_field">Package Name<img src="images/h_trsp_dot.gif" width="1" height="20" align="absmiddle"></td><td background="images/bg_form_lightbluedark.gif" nowrap width="50%" class="form_field">Version</td><td background="images/bg_form_lightbluedark.gif" nowrap width="50%" class="form_field">Released</td></tr><%=HTML_pkg_list%><tr><td nowrap><img src="images/h_trsp_dot.gif" width="120" height="1"></td><td></td><td></td></tr></table></td></tr><tr><td colspan="2" nowrap><input type="submit" name="btn" value="Update" class="form_btn"><input type="reset" name="btn" value="Cancel" class="form_btn" onClick="history.back();"><SPAN id="ProgressBar" name="ProgressBar" style="visibility:hidden;" class="body_scol"><img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...</SPAN><br> <br> </td></tr><input type="hidden" name="update_type" value="edit_custom"><input type="hidden" name="pv_id" value="<%=parPv_id%>"><input type="hidden" name="rtag_id" value="<%=parRtag_id%>"></form></table><!-- END Body--></td><td width="1%" background="images/lbox_bgside_white.gif"> </td></tr><tr><td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td><td background="images/lbox_bg_blue.gif"></td><td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td></tr></table></td></tr></table><!--------------------------------------------------></td></tr><tr><td valign="bottom" background="images/bg_lght_gray.gif"><!-- FOOTER --><!--#include file="_footer.asp"--></td></tr></table></body></html><%Call Destroy_All_Objects%>