# --
# AdminProcessManagementProcessEdit.dtl - provides HTML for AdminProcessManagement
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AdminProcessManagementProcessEdit.dtl,v 1.45 2012/12/10 16:29:37 mab 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{"Edit Process"} "$QData{"Name"}"</h1>

    <div class="SidebarColumn">
        <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"}" class="CallForAction Center Fullsize Back"><span>$Text{"Go to overview"}</span></a>
                    </li>
<!-- dtl:block:ProcessDeleteAction -->
                    <li>
                        <a href="#" id="ProcessDelete" class="CallForAction Trash" data-dialog-element="DeleteProcessConfirmationDialog" data-dialog-title="$Text{"Delete Process"}" data-id="$QData{"ID"}"><span>$Text{"Delete Inactive Process"}</span></a>
                    </li>
<!-- dtl:block:ProcessDeleteAction -->
                </ul>
            </div>
        </div>

        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Available Process Elements"}</h2>
            </div>
            <div class="Content">
                <ul id="ProcessElements">
                    <li class="AccordionElement Active">
                        <h2><a href="#" class="AsBlock">$Text{"Activities"}</a></h2>
                        <div class="Content">
                            <input type="text" id="ActivityFilter" class="ProcessElementFilter W75pc" placeholder="$Text{"Filter Activities..."}" title="$Text{"Filter Activities..."}" />
                            <ul class="Tablelike" id="Activities">
<!-- dtl:block:ActivityRow -->
                                <li title="$QData{"Name"} ($QData{"EntityID"})" data-entity="$QData{"EntityID"}" data-id="$QData{"ID"}">
                                    $QData{"Name","30"}
                                    <span>
                                        <a href="#" title="$Text{"Delete"}" class="DeleteEntity DeleteActivity Icon Icon_Delete"></a>
                                        <a href="$Env{"Baselink"}Action=AdminProcessManagementActivity;Subaction=ActivityEdit;ID=$LQData{"ID"};EntityID=$LQData{"EntityID"}" title="$Text{"Edit"}" class="AsPopup PopupType_Activity Icon Icon_Edit"></a>
                                    </span>
                                </li>
<!-- dtl:block:ActivityRow -->
<!-- dtl:block:ActivityNoDataRow -->
                                <li title="$QData{"Name"}">
                                    $Text{"No data found."}
                                </li>
<!-- dtl:block:ActivityNoDataRow -->
                            </ul>
                            <a href="$Env{"Baselink"}Action=AdminProcessManagementActivity;Subaction=ActivityNew;" class="CallForAction Plus AsPopup PopupType_Activity Center ProcessElementButton" ><span>$Text{"Create New Activity"}</span></a>
                        </div>
                    </li>
                    <li class="AccordionElement">
                        <h2><a href="#" class="AsBlock">$Text{"Activity Dialogs"}</a></h2>
                        <div class="Content">
                            <input type="text" id="ActivityDialogFilter" class="ProcessElementFilter W75pc" placeholder="$Text{"Filter Activity Dialogs..."}" title="$Text{"Filter Activity Dialogs..."}" />
                            <ul class="Tablelike" id="ActivityDialogs">
<!-- dtl:block:ActivityDialogRow -->
                                <li title="$QData{"Name"} ($QData{"EntityID"})" data-entity="$QData{"EntityID"}" data-id="$QData{"ID"}">
                                    $QData{"Name","30"}
                                    <span>
                                        <a href="#" title="$Text{"Delete"}"  class="DeleteEntity DeleteActivityDialog Icon Icon_Delete"></a>
                                        <a href="$Env{"Baselink"}Action=AdminProcessManagementActivityDialog;Subaction=ActivityDialogEdit;ID=$LQData{"ID"};EntityID=$LQData{"EntityID"}" title="$Text{"Edit"}" class="AsPopup PopupType_ActivityDialog Icon Icon_Edit"></a>
                                        <span class="AvailableIn">$Text{"$Data{"AvailableIn"}"}</span>
                                    </span>
                                </li>
<!-- dtl:block:ActivityDialogRow -->
<!-- dtl:block:ActivityDialogNoDataRow -->
                                <li title="$QData{"Name"}">
                                    $Text{"No data found."}
                                </li>
<!-- dtl:block:ActivityDialogNoDataRow -->
                            </ul>
                            <a href="$Env{"Baselink"}Action=AdminProcessManagementActivityDialog;Subaction=ActivityDialogNew;" class="CallForAction Plus AsPopup PopupType_ActivityDialog Center ProcessElementButton" ><span>$Text{"Create New Activity Dialog"}</span></a>
                        </div>
                    </li>
                    <li class="AccordionElement">
                        <h2><a href="#" class="AsBlock">$Text{"Transitions"}</a></h2>
                        <div class="Content">
                            <input type="text" id="TransitionFilter" class="ProcessElementFilter W75pc" placeholder="$Text{"Filter Transitions..."}" title="$Text{"Filter Transitions..."}" />
                            <ul class="Tablelike" id="Transitions">
<!-- dtl:block:TransitionRow -->
                                <li title="$QData{"Name"} *$QData{"EntityID"})" data-entity="$QData{"EntityID"}" data-id="$QData{"ID"}">
                                    $QData{"Name","30"}
                                    <span>
                                        <a href="#" title="$Text{"Delete"}" class="DeleteEntity DeleteTransition Icon Icon_Delete"></a>
                                        <a href="$Env{"Baselink"}Action=AdminProcessManagementTransition;Subaction=TransitionEdit;ID=$LQData{"ID"};EntityID=$LQData{"EntityID"}" title="$Text{"Edit"}" class="AsPopup PopupType_Transition Icon Icon_Edit"></a>
                                    </span>
                                </li>
<!-- dtl:block:TransitionRow -->
<!-- dtl:block:TransitionNoDataRow -->
                                <li title="$QData{"Name"}">
                                    $Text{"No data found."}
                                </li>
<!-- dtl:block:TransitionNoDataRow -->
                            </ul>
                            <a href="$Env{"Baselink"}Action=AdminProcessManagementTransition;Subaction=TransitionNew;" class="CallForAction Plus AsPopup PopupType_Transition Center ProcessElementButton" ><span>$Text{"Create New Transition"}</span></a>
                        </div>
                    </li>
                    <li class="AccordionElement">
                        <h2><a href="#" class="AsBlock">$Text{"Transition Actions"}</a></h2>
                        <div class="Content">
                            <input type="text" id="TransitionActionFilter" class="ProcessElementFilter W75pc" placeholder="$Text{"Filter Transition Actions..."}" title="$Text{"Filter Transition Actions..."}" />
                            <ul class="Tablelike" id="TransitionActions">
<!-- dtl:block:TransitionActionRow -->
                                <li title="$QData{"Name"} ($QData{"EntityID"})" data-entity="$QData{"EntityID"}" data-id="$QData{"ID"}">
                                    $QData{"Name","30"}
                                    <span>
                                        <a href="#" title="$Text{"Delete"}" class="DeleteEntity DeleteTransitionAction Icon Icon_Delete"></a>
                                        <a href="$Env{"Baselink"}Action=AdminProcessManagementTransitionAction;Subaction=TransitionActionEdit;ID=$LQData{"ID"};EntityID=$LQData{"EntityID"}" title="$Text{"Edit"}" class="AsPopup PopupType_TransitionAction Icon Icon_Edit"></a>
                                    </span>
                                </li>
<!-- dtl:block:TransitionActionRow -->
<!-- dtl:block:TransitionActionNoDataRow -->
                                <li title="$QData{"Name"}">
                                    $Text{"No data found."}
                                </li>
<!-- dtl:block:TransitionActionNoDataRow -->
                            </ul>
                            <a href="$Env{"Baselink"}Action=AdminProcessManagementTransitionAction;Subaction=TransitionActionNew;" class="CallForAction Plus AsPopup PopupType_TransitionAction Center ProcessElementButton" ><span>$Text{"Create New Transition Action"}</span></a>
                        </div>
                    </li>
                </ul>
            </div>
        </div>

        <div class="WidgetSimple">
            <div class="Header">
                <h2>$Text{"Description"}</h2>
            </div>
            <div class="Content">
                <p class="FieldExplanation">
                    $Text{"The Elements listed above in this sidebar can be moved to the canvas area on the right by using drag'n'drop."}
                </p>
                <p class="FieldExplanation">
                    <strong>$Text{"Activities"}:</strong> $Text{"You can place Activities on the canvas area to assign this Activity to the Process."}
                </p>
                <p class="FieldExplanation">
                    <strong>$Text{"Activity Dialogs"}:</strong> $Text{"To assign an Activity Dialog to an Activity drop the Activity Dialog element from this sidebar over the Activity placed in the canvas area."}
                </p>
                <p class="FieldExplanation">
                    <strong>$Text{"Transitions"}:</strong> $Text{"You can start a connection between to Activities by dropping the Transition element over the Start Activity of the connection. After that you can move the loose end of the arrow to the End Activity."}
                </p>
                <p class="FieldExplanation">
                    <strong>$Text{"Transition Actions"}:</strong> $Text{"Actions can be assigned to a Transition by dropping the Action Element onto the label of a Transition."}
                </p>
            </div>
        </div>
    </div>

    <div class="ContentColumn">
        <form action="$Env{"CGIHandle"}" method="post" id="ProcessForm" class="Validate PreventMultipleSubmits">
            <div class="WidgetSimple Expanded">
                <div class="Header">
                    <div class="WidgetAction Toggle">
                        <a href="#" title="$Text{"Show or hide the content"}"></a>
                    </div>
                    <h2>$Text{"Edit Process Information"}</h2>
                </div>
                <div class="Content">
                    <input type="hidden" name="Action" value="$Env{"Action"}"/>
                    <input type="hidden" name="Subaction" value="ProcessEditAction"/>
                    <input type="hidden" name="ContinueAfterSave" id="ContinueAfterSave" value=""/>
                    <input type="hidden" name="ProcessLayout" value=""/>
                    <input type="hidden" name="Path" value=""/>
                    <input type="hidden" name="StartActivity" value=""/>
                    <input type="hidden" name="StartActivityDialog" value=""/>
                    <input type="hidden" name="EntityID" id="ProcessEntityID" value="$QData{"EntityID"}"/>
                    <input type="hidden" name="ID" value="$QData{"ID"}"/>
                    <fieldset class="TableLike">
                        <label class="Mandatory" for="Name"><span class="Marker">*</span> $Text{"Process Name"}:</label>
                        <div class="Field">
                            <input type="text" name="Name" id="Name" value="$QData{"Name"}" class="W50pc Validate_Required $QData{"NameServerError"}" maxlength="70"/>
                            <div id="NameError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="NameServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label class="Mandatory" for="Description"><span class="Marker">*</span> $Text{"Description"}:</label>
                        <div class="Field">
                            <textarea name="Description" id="Description" class="W50pc Validate_Required $QData{"DescriptionServerError"}" rows="5" cols="20">$QData{"Description"}</textarea>
                            <div id="DescriptionError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                            <div id="DescriptionServerError" class="TooltipErrorMessage">
                                <p>$Text{"This field is required."}</p>
                            </div>
                        </div>
                        <div class="Clear"></div>

                        <label for="StateEntityID">$Text{"State"}:</label>
                        <div class="Field">
                            $Data{"StateSelection"}
                        </div>
                        <div id="StateEntityIDServerError" class="TooltipErrorMessage">
                            <p>$Text{"The selected state does not exist."}</p>
                        </div>
                        <div class="Clear"></div>
                    </fieldset>
                </div>
            </div>

            <div class="WidgetSimple">
                <div class="Header Expanded">
                    <div class="WidgetAction Toggle">
                        <a href="#" title="$Text{"Show or hide the content"}"></a>
                    </div>
                    <h2>$Text{"Add and Edit Activities, Activity Dialogs and Transitions"}</h2>
                    <div class="CanvasActions">
                        <a href="#" id="ShowEntityIDs">$Text{"Show EntityIDs"}</a>
                        <a href="#" id="ExtendCanvasWidth" title="$Text{"Extend the width of the Canvas"}"></a>
                        <a href="#" id="ExtendCanvasHeight" title="$Text{"Extend the height of the Canvas"}"></a>
                    </div>
                </div>
                <div class="Content">
                    <div id="Canvas">
                    </div>
                    <div class="DiagramDeleteLink"><a href="#" title="$Text{"Remove the Activity from this Process"}">X</a></div>

                    <fieldset class="TableLike">
                        <div class="Field SpacingTop SaveButtons">
                            <button class="Primary" id="SubmitAndContinue" type="submit" value="$Text{"Save"}">$Text{"Save"}</button>
                            $Text{"or"}
                            <button class="Primary" id="Submit" type="submit" value="$Text{"Save"}">$Text{"Save and finish"}</button>
                            $Text{"or"}
                            <a href="$Env{"Baselink"}Action=$Env{"Action"}"><span>$Text{"Cancel"}</span></a>
                        </div>
                        <div class="Clear"></div>
                    </fieldset>
                </div>
            </div>
        </form>
    </div>
    <div class="Clear"></div>
</div>

<div id="Dialogs" class="Hidden">
    <div id="DeleteProcessConfirmationDialog">
        <p>$Text{"Do you really want to delete this Process?"}</p>
        <p class="SpacingTop"><strong>$QData{"Name"}</strong></p>
    </div>
    <div id="DeleteActivityConfirmationDialog">
        <p>$Text{"Do you really want to delete this Activity?"}</p>
        <p class="SpacingTop"><strong><span class="EntityName"></span></strong></p>
    </div>
    <div id="DeleteActivityDialogConfirmationDialog">
        <p>$Text{"Do you really want to delete this Activity Dialog?"}</p>
        <p class="SpacingTop"><strong><span class="EntityName"></span></strong></p>
    </div>
    <div id="DeleteTransitionConfirmationDialog">
        <p>$Text{"Do you really want to delete this Transition?"}</p>
        <p class="SpacingTop"><strong><span class="EntityName"></span></strong></p>
    </div>
    <div id="DeleteTransitionActionConfirmationDialog">
        <p>$Text{"Do you really want to delete this Transition Action?"}</p>
        <p class="SpacingTop"><strong><span class="EntityName"></span></strong></p>
    </div>
</div>

<!-- dtl:block:ConfigSet -->
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Config.Set('Config.Process', $Data{"ProcessConfig"} );
    Core.Config.Set('Config.ProcessLayout', $Data{"ProcessLayout"} );
    Core.Config.Set('Config.Activity', $Data{"ActivityConfig"} );
    Core.Config.Set('Config.ActivityDialog', $Data{"ActivityDialogConfig"} );
    Core.Config.Set('Config.Transition', $Data{"TransitionConfig"} );
    Core.Config.Set('Config.TransitionAction', $Data{"TransitionActionConfig"} );

    Core.Config.Set('Config.ImagePath', "$Config{"Frontend::ImagePath"}");
    Core.Config.Set('Config.PopupPathActivity', "$Env{"Baselink"}Action=AdminProcessManagementActivity;Subaction=ActivityEdit;");
    Core.Config.Set('Config.PopupPathPath', "$Env{"Baselink"}Action=AdminProcessManagementPath;Subaction=PathEdit;");
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:ConfigSet -->

<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
Core.Agent.Admin.ProcessManagement.InitProcessEdit();

//Localizations
Core.Agent.Admin.ProcessManagement.Localization = {
        CancelMsg: "$Text{"Cancel"}",
        ShowEntityIDs: "$Text{"Show EntityIDs"}",
        HideEntityIDs: "$Text{"Hide EntityIDs"}",
        DeleteMsg: "$Text{"Delete"}",
        DeleteEntityTitle: "$Text{"Delete Entity"}",
        ActivityAlreadyPlaced: "$Text{"This Activity is already used in the Process. You cannot add it twice!"}",
        ActivityCannotBeDeleted: "$Text{"This Activity cannot be deleted because it is the Start Activity."}",
        TransitionAlreadyPlaced: "$Text{"This Transition is already used for this Activity. You cannot use it twice!"}",
        TransitionActionAlreadyPlaced: "$Text{"This TransitionAction is already used in this Path. You cannot use it twice!"}",
        StartEventCapChange: "$Text{"The Start Event cannot loose the Start Transition!"}",
        RemoveActivityMsg: "$Text{"Do you really want to remove this activity from the canvas? This can only be undone by leaving this screen without saving."}",
        RemoveTransitionMsg: "$Text{"Do you really want to remove this transition from the canvas? This can only be undone by leaving this screen without saving."}",
        NoDialogsAssigned: "$Text{"No dialogs assigned yet. Just pick an activity dialog from the list on the left and drag it here."}"
};
//]]></script>
<!-- dtl:js_on_document_complete -->
