| Битрикс24 коробка. Используют новые переговорки (которые в календаре) На самой переговорной комнате висит монитор. Задача: выводить занятость переговорной на монитор |
под ним заходим
файл /negotiation.php
<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
CJSCore::Init(['ajax','jquery']);
?>
<style>
.pagetitle-container,
.calendar-view-switcher-list,
.calendar-view-switcher{
display: none;
}
</style>
<?
$APPLICATION->IncludeComponent(
"bitrix:calendar.grid",
"",
Array(
"CALENDAR_TYPE" =>"location",
"ALLOW_RES_MEETING" => "N"
)
);
?>
<script>
$(document).ready(function(){
$('.calendar-view-switcher-list-item:nth-child(2)').trigger("click");
setTimeout(function(){
$('.calendar-day-view').hide();
$('.calendar-month-view').hide();
$('.calendar-list-view').hide();
$('.calendar-week-view').show();
},1000);
});
//чтобы не слетала авторизация
BX.ready(function(){
setInterval(function(){
var postData = {
'sessid': BX.bitrix_sessid(),
'site_id': BX.message('SITE_ID'),
'action': 'prolong_session',
};
BX.ajax({
url: '/ajax/negotiation.php',
method: 'POST',
data: postData,
dataType: 'json',
onsuccess: function(result){
console.log(result);
},
onfailure: function(result){
}
});
}, 10000);
});
</script>
<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?> |
<?define("STOP_STATISTICS", true);
if (array_key_exists('site_id', $_REQUEST) && is_string($_REQUEST['site_id'])){
$siteId = $_REQUEST['site_id'];
if($siteId !== '' && preg_match('/^[a-z0-9_]{2}$/i', $siteId) === 1){
define('SITE_ID', $siteId);
}
}
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
if (!check_bitrix_sessid() || $_SERVER["REQUEST_METHOD"] != "POST") return;
if(!empty($_POST['action']) && ($_POST['action']=="prolong_session")){
echo time();
} |