<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Details.aspx.cs" Inherits="eDocument.Server.Administrator.WorkFlow.Details" MasterPageFile="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="divNoLicense" runat="server" style="border: 2px; border-style: solid; border-color: red">
        OBS: organisasjonen har ikke lisens for bruk av arbeidsflyt. Du vil få konfigurere og teste ut funksjonaliteten.
        Du vil imidlertid IKKE få sendt inn et skjema med arbeidsflyt før lisensen for bruk av arbeidsflyt er aktivert. 
        <asp:HyperLink runat="server" NavigateUrl="~/Consumer/RequestNewLicense.aspx?focus=edoc-workflow">Gå hit for å be om endringer i lisensen.</asp:HyperLink>
    </div>

    <h1 class="skjema-admin__page-title">
        Detaljer for arbeidsflyt
    </h1>

    <div>
    </div>
    <h2 class="skjema-admin__section-title">
        Detaljer
    </h2>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label1" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Navn
        </asp:Label>
        <asp:Label ID="lblName" runat="server"></asp:Label>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label2" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Organisasjon
        </asp:Label>

        <asp:Label ID="lblConsumer" runat="server"></asp:Label>
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Start rolle
        </label>
        <asp:Label runat="server" ID="lblStartEndpoint" />
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Start status
        </label>
        <asp:Label runat="server" ID="lblStartStatus" />
    </div>
    
    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Bruk GDPR innstillinger for sletting
        </label>
        <asp:Label runat="server" ID="lblIncludeInDeleteProfile" />
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Meldingsfunksjonalitet
        </label>
        <asp:Label runat="server" ID="lblEnableMessageFeature" />
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Notatfunksjonalitet
        </label>
        <asp:Label runat="server" ID="lblEnableSectionNoteFeature" />
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label3" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Beskrivelse
        </asp:Label>
        <asp:Label ID="lblDescription" runat="server"></asp:Label>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label4" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Autorisasjonstype
        </asp:Label>
        <asp:Label ID="lblAuthorizationType" runat="server"></asp:Label>
    </div>

    <asp:Button 
        ID="btnEdit" 
        CssClass="skjema-admin__button mb-5"
        runat="server" 
        Text="Rediger" 
        OnClick="btnEdit_Click">
    </asp:Button>

    <div>
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    </div>

    <h2 class="skjema-admin__section-title mt-5 mb-5">
        Skjemaer
    </h2>

    <div class="mb-4">
        <asp:Button 
            ID="btnCreateTemplateOnFlowProcess" 
            CssClass="skjema-admin__button mb-3"
            runat="server" 
            Text="Legg til skjema" 
            OnClick="btnCreateTemplateOnFlowProcess_Click">
        </asp:Button>
    </div>

    <asp:GridView 
        ID="dgTemplates2" 
        runat="server" 
        AutoGenerateColumns="False" 
        Width="100%" 
        CssClass="skjema-admin__table"
        Border="0"
        HeaderStyle-CssClass="HeaderStyle"
        ItemStyle-CssClass="ItemStyle" 
        AlternatingItemStyle-CssClass="AlternatingItemStyle" 
        AllowSorting="False">
        <Columns>
            <asp:BoundField HeaderText="Skjema-ID" DataField="TemplateId" Visible="False"></asp:BoundField>
            <asp:BoundField HeaderText="ID" DataField="SubscriptionId" Visible="False"></asp:BoundField>
            <asp:BoundField HeaderText="Form ID" DataField="ShortName" SortExpression="ShortName ASC"></asp:BoundField>
            <asp:BoundField HeaderText="Navn" DataField="Name" ItemStyle-Width="20%" SortExpression="Name ASC"></asp:BoundField>
            <%--<asp:BoundColumn HeaderText="Kommentar" DataField="Comment" ItemStyle-Width="50%"></asp:BoundColumn>--%>
            <%--					<asp:ButtonField Text="Detaljer for skjema" CommandName="Details"></asp:ButtonField>
					<asp:ButtonField Text="Rediger knytning" CommandName="Edit"></asp:ButtonField>--%>
            <%--<asp:ButtonField Text="Fjern" CommandName="Delete"></asp:ButtonField>--%>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton runat="server" CommandName="Action" ID="btnRemoveBox" Text="Fjern" OnCommand="btnRemoveTemplate_OnCommand" CommandArgument='<%#Bind("TemplateId") %>'>Fjern</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

    <div>
        <asp:Label 
            ID="lblNoEDocumentTemplatesMessage" 
            runat="server" 
            Visible="False">
            Ingen skjemaer
        </asp:Label>
    </div>

    <h2 class="skjema-admin__section-title mt-5 mb-5">
        Roller
    </h2>

    <div class="mb-4">
        <asp:Button 
            ID="btnCreateEndpointOnFlowProcess" 
            CssClass="skjema-admin__button mb-3"
            runat="server" 
            Text="Opprett ny rolle" 
            OnClick="btnCreateEndpointOnFlowProcess_Click">
        </asp:Button>
    </div>
 
    <asp:DataGrid 
        ID="dgFlowEndpoints" 
        runat="server" 
        AutoGenerateColumns="False" 
        Width="100%" 
        CssClass="skjema-admin__table"
        Border="0"
        HeaderStyle-CssClass="HeaderStyle"
        ItemStyle-CssClass="ItemStyle" AlternatingItemStyle-CssClass="AlternatingItemStyle" 
        AllowSorting="False">
        <Columns>
            <asp:BoundColumn HeaderText="ID" DataField="FlowEndpointID" ItemStyle-Width="30%" Visible="False"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Navn" DataField="Name" ItemStyle-Width="" SortExpression="Name ASC"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Beskrivelse" DataField="Description" ItemStyle-Width=""></asp:BoundColumn>
            <asp:ButtonColumn Text="Detaljer" CommandName="Details"></asp:ButtonColumn>
            <asp:ButtonColumn Text="Rediger" CommandName="Edit"></asp:ButtonColumn>
            <asp:ButtonColumn Text="Slett" CommandName="Delete"></asp:ButtonColumn>
        </Columns>
    </asp:DataGrid>

    <div class="mb-4">
        <asp:Label ID="lblNoFlowEndpointsMessage" 
            runat="server" 
            Visible="False">
            Ingen roller
        </asp:Label>
    </div>

    <h2 class="skjema-admin__section-title mt-5 mb-5">
        Statuser
    </h2>

    <div class="mb-4">
        <asp:Button 
            ID="btnCreateStatusOnFlowProcess" 
            CssClass="skjema-admin__button mb-3"
            runat="server" 
            Text="Opprett ny status" 
            OnClick="btnCreateStatusOnFlowProcess_Click">
        </asp:Button>
    </div>

    <asp:DataGrid 
        ID="dgStatuses" 
        runat="server" 
        AutoGenerateColumns="False" 
        Width="100%" 
        CssClass="skjema-admin__table"
        Border="0"
        HeaderStyle-CssClass="HeaderStyle"
        ItemStyle-CssClass="ItemStyle" 
        AlternatingItemStyle-CssClass="AlternatingItemStyle" 
        AllowSorting="False">
        <Columns>
            <asp:BoundColumn HeaderText="ID" DataField="FlowStatusID" ItemStyle-Width="30%" Visible="False"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Navn" DataField="Name" ItemStyle-Width="" SortExpression="Name ASC"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Rolle" DataField="FlowEndpointName" ItemStyle-Width="" SortExpression="Name ASC"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Arkivert" DataField="IsLocked"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Beskrivelse" DataField="Description" ItemStyle-Width=""></asp:BoundColumn>
            <asp:ButtonColumn Text="Detaljer" CommandName="Details"></asp:ButtonColumn>
            <asp:ButtonColumn Text="Rediger" CommandName="Edit"></asp:ButtonColumn>
            <asp:ButtonColumn Text="Slett" CommandName="Delete"></asp:ButtonColumn>
        </Columns>
    </asp:DataGrid>

    <div class="mb-4">
        <asp:Label ID="lblNoStatusesMessage" runat="server" Visible="False">Ingen statuser</asp:Label>
    </div>

    <h2 class="skjema-admin__section-title mt-5 mb-5">
        Regler
    </h2>

    <div class="mb-4">
        <asp:Button 
            ID="btnCreateRuleOnFlowProcess" 
            CssClass="skjema-admin__button mb-3"
            runat="server" 
            Text="Opprett ny regel" 
            OnClick="btnCreateRuleOnFlowProcess_Click">
        </asp:Button>
    </div>

    <asp:DataGrid 
        ID="dgFlowRules" 
        runat="server" 
        AutoGenerateColumns="False" 
        Width="100%" 
        CssClass="skjema-admin__table"
        Border="0"
        HeaderStyle-CssClass="HeaderStyle"
        ItemStyle-CssClass="ItemStyle" 
        AlternatingItemStyle-CssClass="AlternatingItemStyle" 
        AllowSorting="False">
        <Columns>
            <asp:BoundColumn HeaderText="ID" DataField="FlowRuleID" ItemStyle-Width="30%" Visible="False"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Navn" DataField="Name" ItemStyle-Width="" SortExpression="Name ASC"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Type" DataField="RuleType"></asp:BoundColumn>
            <asp:BoundColumn HeaderText="Fra rolle" DataField="FromFlowEndpointName" />
            <asp:BoundColumn HeaderText="Fra status" DataField="FromFlowStatusName" />
            <asp:BoundColumn HeaderText="Til rolle" DataField="ToFlowEndpointName" />
            <asp:BoundColumn HeaderText="Til status" DataField="ToFlowStatusName" />
            <asp:BoundColumn HeaderText="Arkivert" DataField="ToFlowStatusIsLocked" />
            <asp:ButtonColumn Text="Detaljer" CommandName="Details"></asp:ButtonColumn>
            <asp:ButtonColumn Text="Rediger" CommandName="Edit"></asp:ButtonColumn>
            <asp:ButtonColumn Text="Slett" CommandName="Delete"></asp:ButtonColumn>
        </Columns>
    </asp:DataGrid>

    <div class="mb-5">
        <asp:Label ID="lblNoFlowRulesMessage" runat="server" Visible="False">
            Ingen regler
        </asp:Label>
    </div>
</asp:Content>
