<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LinkMetadata.aspx.cs" Inherits="ProcessDefinition.LinkMetadata" Theme="LinkMetrics" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <dp:JQuery ID="jq" runat="server"  JQueryScriptLocation="~/scripts/jquery-1.6.3.min.js"/>
</head>
<body>
    <form id="form1" runat="server">
    <ajax:ToolkitScriptManager ID="scriptMan" runat="server" />
    <div>
        <asp:ObjectDataSource ID="odsSectionMetadata" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetProjectPlanTaskSectionMetrics" TypeName="DevProcess.ProcessDefinitionService.ProcessDefinitionManager">
            <SelectParameters>
                <asp:SessionParameter Name="userId" Type="Int32" SessionField="UserId" />
                <asp:Parameter Name="taskId" Type="Int32" />
                <asp:QueryStringParameter Name="sectionName" Type="String" QueryStringField="section" />
            </SelectParameters>
        </asp:ObjectDataSource>

        <asp:Repeater runat="server" ID="rptLinks" DataSourceID="odsSectionMetadata" OnItemDataBound="rptLinks_ItemDatabound">
            <ItemTemplate>
                <h3><%# Eval("LinkText") %></h3>
                <dp:Metadata ID="commonMetadata" runat="server" MetadataForeignId='<%# Eval("LinksToTFid") %>' ForeignType="14" MetadataForeignType="18" 
                    ShowEditButtons="false" StoreHistory="true"  MetadataName="data" />
                <dp:Metadata ID="metadata" runat="server" MetadataForeignId='<%# Eval("LinksToSFid") %>' ForeignType="14" MetadataForeignType="16" 
                    ShowEditButtons="true"  ShowEmptyButtonBar="true" UserData='<%# Eval("ProjectPlanTaskLinkId") %>' StoreHistory="true"  MetadataName="data"
                    OnPreSave="OnMetadataPreSave" OnSave="OnMetadataSave" OnPostSave="OnMetadataPostSave" OnModeSwitch="OnMetadataModeSwitch"   />   
                
                <dp:MetadataHistory ID="metadataHistory" runat="server" ForeignType="14" MetadataForeignId='<%# Eval("LinksToSFid") %>' MetadataForeignType="16"
                    HistoryToggleText="Show history..."  />         
                
            </ItemTemplate>
            <SeparatorTemplate>
                <br />
            </SeparatorTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>
