379 lines
15 KiB
PHP
379 lines
15 KiB
PHP
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
<script type="text/javascript" src="/js/bootstrap.js"></script>
|
|||
|
|
<script type="text/javascript" src="/js/jquery.bootgrid.js"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
$("#object_list_table_find").bootgrid({
|
|||
|
|
rowCount: 20,
|
|||
|
|
sorting: false,
|
|||
|
|
ajax: false,
|
|||
|
|
selection: false,
|
|||
|
|
rowSelect: false,
|
|||
|
|
keepSelection: true,
|
|||
|
|
templates: {
|
|||
|
|
search: ""
|
|||
|
|
},
|
|||
|
|
css: {
|
|||
|
|
selected: 'row-selected'
|
|||
|
|
},
|
|||
|
|
formatters: {
|
|||
|
|
"adv_price_formatter" : function(column, row) {
|
|||
|
|
if (row.adv_price && row.adv_price > 0) {
|
|||
|
|
return '<a href="javascript:void();" class="openAdvObjectStats" data-id="' + row.id + '"><span>' + row.adv_price + '</span></a>';
|
|||
|
|
} else {
|
|||
|
|
return row.adv_price;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"clients": function(column, row) {
|
|||
|
|
var result = JSON.parse(row.client);
|
|||
|
|
|
|||
|
|
var html = '';
|
|||
|
|
|
|||
|
|
if (result && result.length > 0) {
|
|||
|
|
for (var i = 0; i < result.length; i++) {
|
|||
|
|
if (html) {
|
|||
|
|
html = html + '<br/>';
|
|||
|
|
}
|
|||
|
|
html = html + '<a href="javascript:void();" class="openClient" data-id="' + result[i].id + '"><span>' + result[i].fio + '</span></a>';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
return html;
|
|||
|
|
},
|
|||
|
|
"request" : function(column, row) {
|
|||
|
|
if (row.requests) {
|
|||
|
|
return '<a target="_blank" href="/clients.php?funnelId=all&of_objects=' + row.id + '"><span>' + row.requests + '</span></a>';
|
|||
|
|
} else {
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"preview": function(column, row) {
|
|||
|
|
if (row.preview) {
|
|||
|
|
return '<image style="width: 40px; height: 40px;" src="' + row.preview + '"></image>';
|
|||
|
|
} else {
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"edit": function(column, row) {
|
|||
|
|
if (row.edit) {
|
|||
|
|
if (row.edit === 'editObjectCan') {
|
|||
|
|
return '<a target="_blank" style="font-size: 18px;padding: 5px 6px;border-bottom: none !important;" href="add-object.php?can=1&id=' + row.id + '" title="Редактировать"><i class="ti-pencil"></i></a>';
|
|||
|
|
} else {
|
|||
|
|
return '<a target="_blank" style="font-size: 18px;padding: 5px 6px;border-bottom: none !important;" href="add-object.php?id=' + row.id + '" title="Редактировать"><i class="ti-pencil"></i></a>';
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"archive": function(column, row) {
|
|||
|
|
if (row.archive) {
|
|||
|
|
if (row.archive === 'archiveMyObject') {
|
|||
|
|
return '<a data-id="' + row.id + '" style="font-size: 18px;padding: 5px 6px;border-bottom: none !important;" href="javascript:void();" title="Поместить в архив" class="archiveMyObject"><i class="ti-folder"></i></a>';
|
|||
|
|
} else {
|
|||
|
|
return '<a data-id="' + row.id + '" style="font-size: 18px;padding: 5px 6px;border-bottom: none !important;" href="javascript:void();" title="Восстановить" class="unArchiveMyObject"><i class="ti-back-right"></i></a>';
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"home": function(column, row){
|
|||
|
|
var findObj = JSON.parse(row.home);
|
|||
|
|
return '<a title="Выбрать" href="javascript:{}" class="itemFindObj" data-user="'+findObj.who_work+'" data-id="'+findObj.id+'" style="margin-right: 20px;"><i class="fas fa-home" style="color: rgb(67, 160, 71); font-size: 24px;"></i></a>';
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
"links": function(column, row) {
|
|||
|
|
if (row.links) {
|
|||
|
|
|
|||
|
|
var actions = row.links.split(";");
|
|||
|
|
|
|||
|
|
var html = '';
|
|||
|
|
|
|||
|
|
for (var i=0; i < actions.length; i++) {
|
|||
|
|
if (actions[i] === 'ad-report') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="ad-report" data-id="' + row.id + '"><span>Отчет по рекламе</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'publish-report') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="publish-report" data-id="' + row.id + '"><span>Отчет о публикации</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'deleteMyObject') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="deleteMyObject" data-id="' + row.id + '"><span>Удалить</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'add_client_new') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="add_client_new" data-object="' + row.id + '"><span>Создать заявку</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'advertisingCosts') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="advertisingCosts" data-id="' + row.id + '"><span>Затраты на рекламу</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'cabinet') {
|
|||
|
|
html = html + '<a target="_blank" style="border-bottom: none !important;" href="/cabinet-edit.php?id=' + row.id + '"><span>Кабинет клиента</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'sendToNewUser') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="sendToNewUser" data-id="' + row.id + '"><span>Передать объект</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'add-event') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="add-event" data-id="' + row.id + '"><span>Задачи</span></a>'
|
|||
|
|
}
|
|||
|
|
if (actions[i] === 'add-note') {
|
|||
|
|
html = html + '<a href="javascript:void();" style="border-bottom: none !important;" class="add-note" data-id="' + row.id + '"><span>Примечания</span></a>'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return '<div class="row-menu-obj">' +
|
|||
|
|
'<div class="object-content__actions" style="padding: 0 0 2px;border-bottom: none;">' +
|
|||
|
|
' <div class="actions-menu__icons">' +
|
|||
|
|
' <span class="jw__small-popup jw-action-icon-more" style="padding: 6px;" data-id="obj' + row.id + '"></span>' +
|
|||
|
|
' <div class="jw__popup actions-menu" style="display:none;right: auto;left: 0;top: auto;bottom: 50px;;" id="popup__obj_find' + row.id + '">' +
|
|||
|
|
' <div class="actions-menu__inner">' + html +
|
|||
|
|
' </div>' +
|
|||
|
|
' </div>' +
|
|||
|
|
' </div>' +
|
|||
|
|
' <div class="clear"></div> ' +
|
|||
|
|
' </div>' +
|
|||
|
|
'</div>';
|
|||
|
|
} else {
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}).on("loaded.rs.jquery.bootgrid", function (e) {
|
|||
|
|
$(".jw__small-popup").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
if ($("#popup__" + id).hasClass("show")) {
|
|||
|
|
$("#popup__" + id).toggleClass("show");
|
|||
|
|
} else {
|
|||
|
|
$(".jw__popup.actions-menu").removeClass("show");
|
|||
|
|
$("#popup__" + id).toggleClass("show");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".ad-report").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
openAdStatsWindow(id);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".openAdvObjectStats").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
openObjectAdvPlacesStatsWindow(id, <?php echo $userInStats;?>);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".openClient").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
editClientNew(id, null);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".publish-report").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
openPublishStatsWindow(id);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".deleteMyObject").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
$.ajax({
|
|||
|
|
url: '/ajax/deleteUserObject.php?objId=' + id,
|
|||
|
|
success:function(data){
|
|||
|
|
window.location.reload(true);
|
|||
|
|
},
|
|||
|
|
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
|||
|
|
console.log("eRROR: " + errorThrown);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".advertisingCosts").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
advertisingCostsWindow(id);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".add_client_new").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-object');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
add_client_new(id);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".archiveMyObject").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$('#archive_table_object_id_obj').val(id);
|
|||
|
|
|
|||
|
|
$("#archive_table_object_bg").fadeIn(500);
|
|||
|
|
$("#archive_table_object").fadeIn(10);
|
|||
|
|
$("body").addClass("lock");
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".unArchiveMyObject").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$('#unarchive_table_object_id_obj').val(id);
|
|||
|
|
|
|||
|
|
$("#unarchive_table_object_bg").fadeIn(500);
|
|||
|
|
$("#unarchive_table_object").fadeIn(10);
|
|||
|
|
$("body").addClass("lock");
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".sendToNewUser").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
openSendToNewUserWindow(id);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".add-event").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
$("#popup__obj" + id).toggleClass("show");
|
|||
|
|
openEventsWindow(id);
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".add-note").click(function(e) {
|
|||
|
|
e.preventDefault();
|
|||
|
|
e.stopPropagation();
|
|||
|
|
var id = $(this).attr('data-id');
|
|||
|
|
openNotesWindow(id);
|
|||
|
|
return false;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".itemFindObj").click(function(e){
|
|||
|
|
var idObj = parseInt($(this).attr('data-id'));
|
|||
|
|
var who_work = parseInt($(this).attr('data-user'));
|
|||
|
|
req_form.objectId = parseInt(idObj);
|
|||
|
|
//req_form.isObject = true;
|
|||
|
|
req_form.getObjectFind(who_work, req_form.objectId);
|
|||
|
|
closeFindObject();
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
/*function archiveTableObject() {
|
|||
|
|
var id = $('#archive_table_object_id_obj').val();
|
|||
|
|
if (id) {
|
|||
|
|
$.ajax({
|
|||
|
|
url: '/ajax/archiveUserObject.php?objId=' + id,
|
|||
|
|
success: function (data) {
|
|||
|
|
window.location.reload(true);
|
|||
|
|
},
|
|||
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|||
|
|
console.log("eRROR: " + errorThrown);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function unarchiveTableObject() {
|
|||
|
|
var id = $('#unarchive_table_object_id_obj').val();
|
|||
|
|
if (id) {
|
|||
|
|
$.ajax({
|
|||
|
|
url: '/ajax/unArchiveUserObject.php?objId=' + id,
|
|||
|
|
success:function(data){
|
|||
|
|
window.location.reload(true);
|
|||
|
|
},
|
|||
|
|
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
|||
|
|
console.log("eRROR: " + errorThrown);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}*/
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<!--<div class="full_modal-bg" id="archive_table_object_bg" style="display: none">
|
|||
|
|
<span class="pseudo-link closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="full_modal edit-modal" id="archive_table_object" style="display: none;">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2 style="text-align: center;">Помещение объекта в архив</h2>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div>
|
|||
|
|
<p style="text-align: center;">Вы действительно хотите поместить объект в архив?</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
<input type="hidden" name="archive_table_object_id_obj" id="archive_table_object_id_obj" value="">
|
|||
|
|
<button type="submit" onclick="archiveTableObject();">Архивировать <i class="ti-angle-right"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="full_modal-bg" id="unarchive_table_object_bg" style="display: none">
|
|||
|
|
<span class="pseudo-link closer"><i class="ti-close"></i></span>
|
|||
|
|
<div class="full_modal edit-modal" id="unarchive_table_object" style="display: none;">
|
|||
|
|
<div class="modal-inner">
|
|||
|
|
<h2 style="text-align: center;">Восстановление объекта из архива</h2>
|
|||
|
|
<div class="form-block">
|
|||
|
|
<div>
|
|||
|
|
<p style="text-align: center;">Вы действительно хотите восстановить объект из архива?</p>
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-submit">
|
|||
|
|
<input type="hidden" name="unarchive_table_object_id_obj" id="unarchive_table_object_id_obj" value="">
|
|||
|
|
<button type="submit" onclick="unarchiveTableObject();">Восстановить <i class="ti-angle-right"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>-->
|
|||
|
|
|