# --
# AdminProcessManagement.dtl - provides HTML for AdminProcessManagement
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AdminProcessManagement.dtl,v 1.17 2012/12/14 08:49:32 cr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

<div class="MainBox ARIARoleMain LayoutFixedSidebar SidebarFirst">
    <h1>$Text{"Process Management"}</h1>

    <div class="SidebarColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2><label for="Filter">$Text{"Filter for Processes"}</label></h2>
            </div>
            <div class="Content">
                <input type="text" id="Filter" class="W95pc" name="Filter" value="" title="$Text{"Filter"}" placeholder="$Text{"Process Name"}" />
            </div>
        </div>
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Actions"}</h2>
            </div>
            <div class="Content">
                <ul class="ActionList">
                    <li>
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=ProcessNew" class="CallForAction Fullsize Center Plus"><span>$Text{"Create New Process"}</span></a>
                    </li>
                    <li>
                        <a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=ProcessSync" class="CallForAction Fullsize Center Refresh"><span>$Text{"Synchronize All Processes"}</span></a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Configuration import"}</h2>
            </div>
            <div class="Content">
                <p class="FieldExplanation">
                    $Text{"Here you can upload a configuration file to import a process to your system. The file needs to be in .yml format as exported by process management module."}
                </p>
                <ul class="ActionList">
                    <li>
                        <form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" class="Validate PreventMultipleSubmits">
                            <input type="hidden" name="Action" value="$Env{"Action"}"/>
                            <input type="hidden" name="Subaction" value="ProcessImport"/>
                            <input type="hidden" name="FormID" value="$QData{"FormID"}"/>
                            <input name="FileUpload" id="FileUpload" type="file" size="18" class="Fixed W100pc Validate_Required $QData{"FileUploadInvalid"}"/>
                            <div id="FileUploadError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                            <div id="FileUploadServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                            <br /><br />
                            <button class="CallForAction Plus Fullsize Center" type="submit" value="$Text{"Upload process configuration"}">
                                <span>$Text{"Import process configuration"}</span>
                            </button>
                        </form>
                    </li>
                </ul>
            </div>
        </div>

        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Description"}</h2>
            </div>
            <div class="Content">
                <p class="FieldExplanation">
                    $Text{"To create a new Process you can either import a Process that was exported from another system or create a complete new one."}
                </p>
                <p class="FieldExplanation">
                    $Text{"Changes to the Processes here only affect the behavior of the system, if you synchronize the Process data. By synchronizing the Processes, the newly made changes will be written to the Configuration."}
                </p>

            </div>
        </div>
    </div>

    <div class="ContentColumn">
        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Processes"}</h2>
            </div>
            <div class="Content">
                <table class="DataTable" id="Processes">
                    <thead>
                        <tr>
                            <th>$Text{"Process name"}</th>
                            <th>$Text{"Description"}</th>
                            <th>$Text{"State"}</th>
                            <th>$Text{"Export"}</th>
                            <th>$Text{"Copy"}</th>
                        </tr>
                    </thead>
                    <tbody>
<!-- dtl:block:ProcessRow -->
                        <tr>
                            <td><a class="AsBlock" href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=ProcessEdit;ID=$QData{"ID"};EntityID=$QData{"EntityID"}">$QData{"Name"}</a></td>
                            <td>$QData{"Description"}</td>
                            <td>$Text{"$Data{"State"}"}</td>
                            <td><a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=ProcessExport;ID=$QData{"ID"}" class="Export AsBlock">$Text{"Export Process Configuration"}</a></td>
                            <td><a href="$Env{"Baselink"}Action=$Env{"Action"};Subaction=ProcessCopy;ID=$QData{"ID"};$QEnv{"ChallengeTokenParam"}" class="Copy AsBlock">$Text{"Copy Process"}</a></td>
                        </tr>
<!-- dtl:block:ProcessRow -->
<!-- dtl:block:ProcessNoDataRow -->
                        <tr>
                            <td colspan="4">
                                $Text{"No data found."}
                            </td>
                        </tr>
<!-- dtl:block:ProcessNoDataRow -->
                    </tbody>
                </table>
            </div>

        </div>
    </div>
    <div class="Clear"></div>
</div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
Core.UI.Table.InitTableFilter($('#Filter'), $('#Processes'), 0);
//]]></script>
<!--dtl:js_on_document_complete-->
