/// <reference path="~/Scripts/_references.js" />

function Ticket_Create() {

}

function Ticket_List(status, myTicket) {
    var link = "<img src='http://www.gravatar.com/avatar/[6]?s=40' class='pull-left' />&nbsp;&nbsp;[DATA]</a><br/> <a href='" + ZB_Relative_Path + "ZBAdmin/Ticket/Edit/[5]'>&nbsp;&nbsp;\"[1]\"</a>";

    var columns = [
        { "targets": 1, "visible": false }
    ];

    var endPointList = "List";
    if (status != "" && status != null)
    {
        endPointList = endPointList+ "/" + status;
    }
    if (myTicket != "" && myTicket != null)
    {
        endPointList = endPointList + "?myTicket=true";
    }

    Generic_List_LoadDataTable("ListTicketDataTable", 2, 5, "Ticket", "Edit", "Delete", endPointList, true, true, false, null, true, true, link, columns, false, null, false);
}

function Ticket_Edit(modelId, ticketStatus)
{
  
    Generic_Forms_SelectTab();

    if (ticketStatus == 4) //4 == closed
    {
        $("#form1 :input").attr("disabled", true);
    } else {
        tinymce.init({
            height: 150,
            plugins: "paste,autoresize",
            mode: "exact",
            elements: "Message",
            menubar: false,
            statusbar: false,
            force_p_newlines: false,
            force_br_newlines: true,
            convert_newlines_to_brs: false,
            remove_linebreaks: true,
            theme: "modern",
            convert_urls: false,
            paste_auto_cleanup_on_paste: true,
            plugins: [
                "advlist autolink lists link image charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars code fullscreen",
                "insertdatetime media nonbreaking save table contextmenu directionality",
                "emoticons template paste textcolor colorpicker textpattern imagetools"
            ],
            toolbar1: "undo redo | bold italic | alignleft aligncenter alignright alignjustify |  outdent indent | link image | print | forecolor backcolor",

        });
    }

}

