AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.216.192
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/leo/application/plugins/module_imobles/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/leo/application/plugins/module_imobles/assets/js/dealskanban.js
var _url = $("#_url").val();
$(function () {

    // findDataSelect("#sdr_id", 'module_imobles/ajax/sellers', 'Selecione um Responsável');
    // findDataSelect("#crm_account_id", 'module_imobles/ajax/accounts/true', 'Selecione um cliente');
    // $('body').find('[data-toggle="tooltip"]').tooltip();

    $('body').find(".popoverTask").popover({
        trigger: 'manual',
        placement: 'top',
        container: 'body',
        html: true
    });

    $('body').find(".popoverTask").click(function(){
        var deal_id = $(this).data("id");
        $('body').find(".popoverTask").not("[data-id="+deal_id+"]").popover('hide');
        $(this).popover('toggle');
    });


    $(document).keyup(function (event) {
        if (event.which === 27) {
            $('.popoverTask').popover('hide');
        }
    });
    
    $('#crm_account_id').select2({
        theme: "bootstrap",
        placeholder:'Selecione um Cliente',
        allowClear: true,
        ajax: {
                url: $("#_url").val()+'module_imobles/ajax/accounts/true',
                dataType: "json",
                delay: 100,
                method: "POST",
                data: function (params) {
                    var queryParameters = {
                            term: params.term
                    };
                    return queryParameters;
                },
                processResults: function (data) {
                    return {
                        results: $.map(data, function (item) {
                            return {
                                text: item.text,
                                id: item.id
                            }
                        })
                    };
                },
                cache: true,   
        }
    });

    $('.responsible_id').select2({
        theme: "bootstrap",
        placeholder:'Selecione um Responsável',
        allowClear: true,
        ajax: {
                url: $("#_url").val()+'module_imobles/ajax/sellers',
                dataType: "json",
                delay: 100,
                method: "POST",
                data: function (params) {
                    var queryParameters = {
                            term: params.term
                    };
                    return queryParameters;
                },
                processResults: function (data) {
                    return {
                        results: $.map(data, function (item) {
                            return {
                                text: item.text,
                                id: item.id
                            }
                        })
                    };
                },
                cache: true,   
        }
    });
    
    $('#filter-clear').on('click', function (event) {
        event.preventDefault();
        $("#priority").val('');
        // $("#type").val('');
        $("#sdr_id").val('');
        $("#seller_id").val('');
        $("#status_id").val('');
        $("#temperature").val('');
        $("#crm_account_id").val('');
        $("#clear_filter").val('1');
        $('#form-filter').submit();
    });
    $('body').on('click', '#filter-post', function (event) {
        event.preventDefault();
        $('#form-filter').submit();
    });
    $('body').on('click', '.client_redirect', function (event) {
        localStorage.setItem('guia_client_lead_control', 'tab_crm_deals');
        window.open (_url + "contacts/view/" + $(this).data('crm_account_id') + "/module_imobles_leads_control/" + $(this).data('deal-id'), "_blank" );  
    });

    //evento de troca de posicção do item do dashboard    
    $(".grid-stack-item.column").sortable({
        connectWith: ".grid-stack-item.column",
        placeholder: "highlight",
        cursor: "move",
        update: function (event, ui) {
            ui.item.block({ message: block_msg });
            if (ui.sender !== null) {
                $("#qtd" + ui.sender.attr('data-id')).html((parseInt($("#qtd" + ui.sender.attr('data-id')).html()) - 1));
                $("#qtd" + $(this).attr('data-id')).html((parseInt($("#qtd" + $(this).attr('data-id')).html()) + 1));
                var id = ui.item.attr('data-id');
                $.post(_url + "module_imobles/deals/saveKanbanStage",
                {
                    id: id, 
                    stage_id: $(this).attr('data-id')
                })
                .done(function (data) {
                    var e = JSON.parse(data);
                    var status = e.status;
                    if (status == "OK") {
                        toastr.success(e.msg);
                        ui.item.unblock();
                    } else {
                        var $modal = $('#ajax-modal');
                        $modal.load(_url + 'module_imobles/deals/kanbanClosingJourney/' + e.stage_id + "/" + id, function () {
                            $modal.modal();
                            $modal.on('hidden.bs.modal', function (m) {
                                ui.item.unblock();
                                if($('#revert_stage_changing').val() == 1){
                                    $(".grid-stack-item.column" ).sortable( "cancel" );
                                }
                            });
                            $("#emsg-comment").hide();
                        });
                    }
                });
            }
        }
    });
    $(".sortable").disableSelection();


    $("body").on('click', '#submit_closing_journey', function (e,ui) {
        $('#ajax-modal').block({ message: block_msg });
        e.preventDefault();
        var id = $(this).data("id");
        var stage_id = $(this).data("stage-id");
        $.post(_url + "module_imobles/deals/saveKanbanStage",
        {
            id: id, 
            stage_id: stage_id,
            closing_journey: $('#closing_journey').val()
        })
        .done(function (data) {
            var e = JSON.parse(data);
            var status = e.status;
            if (status == "OK") {
                toastr.success(e.msg);
                $('#revert_stage_changing').val(0);
                $('#ajax-modal').modal('hide');
            } else {
                $('#ajax-modal').modal('hide');
                toastr.error(e.msg);
            }
        });
    });



    var tamanho = 500;
    $(".draggable .column.painel").each(function (index) {
        if (tamanho < $(this).height()) {
            tamanho = $(this).height();
        }
    });
    $(".draggable .column.painel").css('height', tamanho + 100);

    $('#filter-period a').on('click', function(event) {
		event.preventDefault();

		var period = $(this).data('val');
		$("input[name=period]").val(period);

		$('#form-filter').submit();
	});

});
            

Anon7 - 2022
AnonSec Team