| 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 : |
var _url = $("#_url").val();
function filter() {
findDataSelect("#crm_account_id", 'module_imobles/ajax/accounts/1', '');
$('#module_imobles_task_category_id').select2({
theme: "bootstrap",
placeholder: _L['Select'],
ajax: {
url: $("#_url").val() + 'module_imobles/ajax/task_category',
dataType: "json",
delay: 250,
method: "POST",
data: function (params) {
var queryParameters = {
term: params.term,
type: returnFields('#type')
};
return queryParameters;
},
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.text,
id: item.id
}
})
};
},
cache: true,
}
});
$('.finished_button').on('change', function (e) {
var t = $(this);
bootbox.confirm(_L['module_imobles task confirm finished alteration'] + " " + ($(this).prop("checked") == true ? "Sim" : "Não") + "?", function (result) {
if (result)
{
$.ajax({
type: 'POST',
url: $("#_url").val() + "module_imobles/taskcustomer/alterFinished/",
data: "id=" + t.data('id'),
dataType: 'html'
}).done(function (data) {
toastr.success("Alteração realizada com sucesso");
});
} else {
location.reload();
}
});
});
$('#module_imobles_tasks_id').select2({
theme: "bootstrap",
placeholder: _L['Select'],
ajax: {
url: $("#_url").val() + 'module_imobles/ajax/task',
dataType: "json",
delay: 250,
method: "POST",
data: function (params) {
var queryParameters = {
term: params.term,
module_imobles_task_category_id: returnFields('#module_imobles_task_category_id')
};
return queryParameters;
},
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.text,
id: item.id
}
})
};
},
cache: true,
}
});
// Advanced
$('#items_per_page').on('change', function (event) {
event.preventDefault();
var items = $(this).find('option:selected').val();
$("input[name=items_per_page]").val(items);
$('#form-filter').submit();
});
// Clear
$('#filter-clear').on('click', function (event) {
event.preventDefault();
$("#module_imobles_task_category_id").val('');
$("#type").val('');
$("#module_imobles_tasks_id").val('');
$("#crm_account_id").val('');
$('#form-filter').submit();
});
$('body').on('click', '#filter-post', function (event) {
event.preventDefault();
$('#form-filter').submit();
});
$('.select_filter').on('change', function (event) {
event.preventDefault();
$('#form-filter').submit();
});
$('body').on('click', ".alter_enable", function (event) {
event.preventDefault();
var id = $(this).data("id");
$.post(_url + "module_imobles/enterprise_taskcustomers/alterenable", {id: $(this).data("id"), value: $(this).data("value")})
.done(function (result) {
var data = JSON.parse(result);
if (data.status == "OK") {
toastr.success(data.msg);
$(".alter_table_" + id).toggleClass("hide");
} else {
var body = $("html, body");
body.animate({scrollTop: 0}, '1000', 'swing');
$("#emsgbody").html(data.msg);
$("#emsg").show("slow");
}
});
});
$('body').on('click', ".alter_disponible", function (event) {
event.preventDefault();
var id = $(this).data("id");
var value = $(this).data("value");
var msg = $(this).data("msg");
bootbox.dialog({
message: msg,
buttons: {
'cancel': {
label: "Cancelar"
},
'confirm': {
label: "Enviar",
callback: function () {
$.post(_url + "module_imobles/taskcustomer/alterdisponible", {id: id, value: value})
.done(function (result) {
var data = JSON.parse(result);
if (data.status == "OK") {
toastr.success(data.msg);
$(".alter_disponible_" + id + "_0").addClass("hide");
$(".alter_disponible_" + id + "_1").addClass("hide");
$(".alter_disponible_" + id + "_" + value).removeClass("hide");
} else {
var body = $("html, body");
body.animate({scrollTop: 0}, '1000', 'swing');
$("#emsgbody").html(data.msg);
$("#emsg").show("slow");
}
});
}}}});
});
var bottom_find = true;
$("#system-bottom-bar").addClass('systembar-closed');
datatableSearch = $('#list_search_view').DataTable({
"paging": true,
"ordering": false,
"info": true,
"filter": false,
pageLength: 100,
"sDom": '<"top"iflpr>t<"bottom"p><"clear">',
"language": {
"url": $("#app_url").val() + "/ui/lib/dataTables/" + $("#_lan").val() + "_1.json"
},
// "aLengthMenu": [[10, 25, 50, 100, 500, 1000, -1], [10, 25, 50, 100, 500, 1000, "Todos"]],
"bProcessing": true,
"bServerSide": true,
"pagingType": "full_numbers_theme",
"fnDrawCallback": function () {
$('#list_search_view').find('.bxslider').bxSlider({
mode: 'horizontal',
moveSlides: 1,
slideMargin: 10,
infiniteLoop: true,
slideWidth: 215,
minSlides: 1,
maxSlides: 1,
speed: 800,
});
$(".popoverDetail").each(
function () {
var td = $(this).closest("td");
console.log(td);
td.attr("class", "popoverDetail");
$(this).closest("td").attr("data-content", $(this).data("content"));
$(this).removeClass("popoverDetail");
});
$(".popoverDetail").popover({
trigger: 'hover',
placement: 'auto',
container: 'body',
html: true
});
}
});
$('#list_search_view').on("click", 'td', function (event) {
if (event.target.tagName != 'INPUT' && $(this).find(".select_listing")) {
if ($(this).find(".select_listing").prop("checked") == true) {
$(this).find(".select_listing").prop("checked", false);
} else {
$(this).find(".select_listing").prop("checked", true);
}
}
});
$('body').on('click', ".multiply_order", function (event) {
event.preventDefault();
var value = $(this).data("value");
var item = $(this).data("item");
var td = $(this);
td.removeClass("desc asc");
$.post(_url + "module_imobles/taskcustomer/search_order/", {
campo: item, value: $(this).data("value")})
.done(function (result) {
td.addClass(result);
td.data('value', result);
location.reload();
}
);
});
}
$(function () {
filter();
});