<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Desktop.aspx.cs" Inherits="APC.Forms.Desktop" EnableSessionState="True" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>APC Web Administration System</title>
    <script src="../Scripts/script.js" type="text/javascript"></script>
    <script type="text/javascript">
        function Logoff() 
        {
            Ext.Msg.confirm('Log-Off', 'Are you sure you wish to log off', function (btn) 
            {
                if (btn == 'yes') 
                {
                    document.location = '../Default.aspx';
                    return true;
                }
                return false;
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager runat="server"  Theme="Gray" SubmitDisabled="True" />
    <ext:Viewport runat="server" Layout="BorderLayout">
        <Items>
        <ext:Panel runat=server Region=Center Header=false Layout=BorderLayout>
        <DockedItems>

           <ext:Toolbar ID="Toolbar2" runat="server" Dock="Top">
            <Items>
                <ext:ToolbarTextItem ID="tItemWelcome" runat="server" StyleSpec="font-weight:bold;" />
                  <ext:ToolbarFill />
                      
                        <ext:Button ID="Button2" runat="server" Text="Out of Office" Icon="Basket"  />
                        <ext:ToolbarSeparator ID="ToolbarSeparator3" runat="server" />
                        <ext:Button ID="Button3" runat="server" Text="Calendar" Icon="Calendar">
                        <DirectEvents>
                            <Click OnEvent="OpenCalendar">
                                <EventMask ShowMask="true"/>
                           </Click>
                           </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator ID="ToolbarSeparator5" runat="server" />
                        <ext:Button ID="Button5" runat="server" Text="Documents" Icon="Folder"  />

                        <ext:ToolbarSeparator ID="ToolbarSeparator4" runat="server" />
                        <ext:Button ID="Button4" runat="server" Text="Logout" Icon="Lock">
                        <Listeners>
                            <Click Handler="Logoff();"></Click>
                        </Listeners>
                        </ext:Button>
             </Items>
            </ext:Toolbar>
             <ext:Toolbar ID="Toolbar1" runat="server" Dock="Top">
                    <Items>
                                                    <ext:SplitButton ID="SplitButton1" runat="server" Text="Administration">
                                    <Menu>
                                        <ext:Menu ID="Menu1" runat="server">
                                            <Items>
                                                <ext:MenuItem ID="MenuItem1" runat="server" Text="User Maintenance" />
                                            </Items>
                                        </ext:Menu>
                                    </Menu>
                                </ext:SplitButton>
                                <ext:SplitButton ID=btnPastel runat="server" Text="Pastel Integration" Visible=false>
                                    <Menu>
                                        <ext:Menu ID="mnuPastel" runat="server">
                                            <Items>
                                                <ext:MenuItem ID="miPastelPayExport" runat="server" Text="Payment Request Exports">
                                                <Listeners>
                                                    <Click Handler="loadTab('PaymentReqPastel','Outstanding Pastel Exports', '../Forms/Workflow/PaymentRequestPastel.aspx');" />
                                                    </Listeners>
                                                </ext:MenuItem>
                                            </Items>
                                        </ext:Menu>
                                    </Menu>
                                </ext:SplitButton>


                    </Items>
                </ext:Toolbar>
            </DockedItems>
                    <BottomBar>
                <ext:StatusBar ID="StatusBar4" CtCls="word-status" runat="server" DefaultText="Ready">
                    <Items>
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                        <ext:ToolbarTextItem ID="tItemVersion" runat="server" Text="Version 1.0.0" />
                        <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
                        <ext:ToolbarTextItem ID="tItemCompany" runat="server" Text="MQAttach" />
                    </Items>
                </ext:StatusBar>
            </BottomBar>            

        <Items>
            <ext:Panel ID="Panel2" 
                runat="server" 
                Title="Filter Panel" 
                Region="West"
                Layout="AccordionLayout"
                Width="300" 
                MinWidth="300" 
                MaxWidth="400" 
                Split="true" 
                Collapsible="true" Icon="Find">
                <Items>
                    <ext:Panel ID="Panel4" 
                        runat="server" 
                        Title="Payment Request Filter" 
                        Border="false" 
                        BodyPadding="6"
                        Icon="Money"
                        >
                        <Items>
                            <ext:UserControlLoader Path="~/Forms/Filters/PaymentRequestTaskFilter.ascx" runat="server" ID="PaymentFilter" />
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Panel>
            <ext:TabPanel ID="tabPanel" runat="server" Region="Center">
                <Items>
                      <ext:Panel ID="Panel5" 
                        runat="server" 
                        Title="Task List" 
                        Border="false" 
                        BodyPadding="6"
                        Icon="Tab" Closable=false Layout="AnchorLayout">
                     <Items>
                     <ext:UserControlLoader Path="~/Forms/BaseUserControls/TaskList.ascx" ID="TaskList" runat="server" />
                     </Items>
                    </ext:Panel>

                    <ext:Panel ID="Panel6" 
                        runat="server" 
                        Title="Reporting" 
                        Closable="true" 
                        Border="false" 
                        BodyPadding="6"
                        Html="Closeable Tab"
                        />
                </Items>
            </ext:TabPanel>
        </Items>
        
        </ext:Panel>
        </Items>
    </ext:Viewport>
    <ext:Window ID="taskWin" Height="600" Width="1000" Title="Window Title" Closable="true" CloseAction="Hide" Layout="BorderLayout" Plain=true runat="server" AutoRender=false Hidden=true Modal=true>
    <Listeners>
        <BeforeShow Handler="#{TaskManager1}.stopAll();" />
        <Close Handler="#{TaskManager1}.startAll(); #{TaskPanel}.store.reload();evalLastResult();" />
    </Listeners>
    <Loader Mode="Frame" AutoLoad="false" runat="server"/>
        </ext:Window>
        <ext:TaskManager ID="TaskManager1" runat="server">
            <Tasks>
                <ext:Task TaskID="updateTasks" Interval="60000">                   
                    <Listeners>
                        <Update Handler="#{TaskPanel}.store.reload();" />
                    </Listeners>    
                </ext:Task>
            </Tasks>
        </ext:TaskManager>

    </form>
</body>
</html>
