actual file
This commit is contained in:
parent
cc428c8a05
commit
55ff114d00
@ -155,15 +155,15 @@ if ($_SESSION['id'] && ((isset($_GET['id']) && is_numeric($_GET['id']) && $_GET[
|
||||
// если смотрит руководитель - показываем все
|
||||
// if ($_SESSION['agency'] || $_SESSION['manager'] || $_SESSION['users_admin']) {
|
||||
|
||||
$sql = "SELECT e.id, e.comment, e.name, e.create_date, IF ((mango<>1 AND megafon<>1 AND telphin<>1 AND beeline<>1 AND mts<>1 AND tele2<>1 AND allo<>1), DATE_ADD(create_date, {$time_zone_sql}), create_date) as date_sort, e.checklist, e.type, e.user_id, e.partner_id, e.record, e.client_id, e.document_id, e.schedule_date, e.schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, `e`.`mango`, `e`.`megafon`, e.telphin,e.beeline, e.mts, e.tele2, e.allo, e.tracking, e.cancel, e.open_step "
|
||||
$sql = "SELECT e.id, e.comment, e.name, e.create_date, IF ((mango<>1 AND megafon<>1 AND telphin<>1 AND beeline<>1 AND mts<>1 AND tele2<>1 AND allo<>1), DATE_ADD(create_date, {$time_zone_sql}), create_date) as date_sort, e.checklist, e.type, e.type_call, e.user_id, e.partner_id, e.record, e.client_id, e.document_id, e.schedule_date, e.schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, `e`.`mango`, `e`.`megafon`, e.telphin,e.beeline, e.mts, e.tele2, e.allo, e.tracking, e.cancel, e.open_step "
|
||||
. "FROM user_client_events as e WHERE e.client_id = $get[id] union
|
||||
SELECT ev.id, '' as comment, '' as name, ev.date as create_date, ev.date as date_sort, 0 as checklist, 'partner' as `type`, ev.user_id, 0 AS partner_id, '' as record, ev.client_id, '' as document_id, ev.date as schedule_date, '' as schedule_date_to, '' as address, '' as `sum`, ev.from_id, '' as calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, 0 as cancel, 0 as open_step from events_clients as ev WHERE ev.client_id = $get[id] and event = 'transmitted_parallel'
|
||||
SELECT ev.id, '' as comment, '' as name, ev.date as create_date, ev.date as date_sort, 0 as checklist, 'partner' as `type`, NULL as type_call, ev.user_id, 0 AS partner_id, '' as record, ev.client_id, '' as document_id, ev.date as schedule_date, '' as schedule_date_to, '' as address, '' as `sum`, ev.from_id, '' as calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, 0 as cancel, 0 as open_step from events_clients as ev WHERE ev.client_id = $get[id] and event = 'transmitted_parallel'
|
||||
ORDER BY date_sort ASC";
|
||||
|
||||
if(isset($get['req_id']) && $get['req_id'] > 0){
|
||||
$sql = "SELECT e.id, e.comment, e.name, e.create_date, IF ((mango<>1 AND megafon<>1 AND telphin<>1 AND beeline<>1 AND mts<>1 AND tele2<>1 AND allo<>1), DATE_ADD(create_date, {$time_zone_sql}), create_date) as date_sort, e.checklist, e.type, e.user_id, e.partner_id, e.record, e.client_id, e.document_id, e.req_id, e.old_req_id, e.schedule_date, e.schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, `e`.`mango`, `e`.`megafon`, e.telphin,e.beeline, e.mts, e.tele2, e.allo, e.tracking, e.cancel, e.open_step "
|
||||
$sql = "SELECT e.id, e.comment, e.name, e.create_date, IF ((mango<>1 AND megafon<>1 AND telphin<>1 AND beeline<>1 AND mts<>1 AND tele2<>1 AND allo<>1), DATE_ADD(create_date, {$time_zone_sql}), create_date) as date_sort, e.checklist, e.type, e.type_call, e.user_id, e.partner_id, e.record, e.client_id, e.document_id, e.req_id, e.old_req_id, e.schedule_date, e.schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, `e`.`mango`, `e`.`megafon`, e.telphin,e.beeline, e.mts, e.tele2, e.allo, e.tracking, e.cancel, e.open_step "
|
||||
. "FROM user_client_events as e WHERE e.req_id = $get[req_id] union
|
||||
SELECT ev.id, '' as comment, '' as name, ev.date as create_date, ev.date as date_sort, 0 as checklist, 'partner' as `type`, ev.user_id, 0 AS partner_id, '' as record, ev.client_id, '' as document_id, ev.req_id, 0 as old_req_id, ev.date as schedule_date, '' as schedule_date_to, '' as address, '' as `sum`, ev.from_id, '' as calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, 0 as cancel, 0 as open_step
|
||||
SELECT ev.id, '' as comment, '' as name, ev.date as create_date, ev.date as date_sort, 0 as checklist, 'partner' as `type`, NULL as type_call, ev.user_id, 0 AS partner_id, '' as record, ev.client_id, '' as document_id, ev.req_id, 0 as old_req_id, ev.date as schedule_date, '' as schedule_date_to, '' as address, '' as `sum`, ev.from_id, '' as calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, 0 as cancel, 0 as open_step
|
||||
from events_clients as ev WHERE ev.req_id = $get[req_id] and event = 'transmitted_parallel'
|
||||
ORDER BY date_sort ASC";
|
||||
|
||||
@ -174,11 +174,11 @@ ORDER BY date_sort ASC";
|
||||
$arrSin[] = $r_obj_sin['object_id'];
|
||||
}
|
||||
if(!empty($arrSin)){
|
||||
$sql = "SELECT e.id, e.comment, e.name, e.create_date, IF ((mango<>1 AND megafon<>1 AND telphin<>1 AND beeline<>1 AND mts<>1 AND tele2<>1 AND allo<>1), DATE_ADD(create_date, {$time_zone_sql}), create_date) as date_sort, e.checklist, e.type, e.user_id, e.partner_id, e.record, e.client_id, e.document_id, e.req_id, e.old_req_id, e.schedule_date, e.schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, `e`.`mango`, `e`.`megafon`, e.telphin,e.beeline, e.mts, e.tele2, e.allo, e.tracking, e.cancel, e.open_step "
|
||||
$sql = "SELECT e.id, e.comment, e.name, e.create_date, IF ((mango<>1 AND megafon<>1 AND telphin<>1 AND beeline<>1 AND mts<>1 AND tele2<>1 AND allo<>1), DATE_ADD(create_date, {$time_zone_sql}), create_date) as date_sort, e.checklist, e.type, e.type_call, e.user_id, e.partner_id, e.record, e.client_id, e.document_id, e.req_id, e.old_req_id, e.schedule_date, e.schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, `e`.`mango`, `e`.`megafon`, e.telphin,e.beeline, e.mts, e.tele2, e.allo, e.tracking, e.cancel, e.open_step "
|
||||
. "FROM user_client_events as e WHERE e.req_id = $get[req_id] union
|
||||
SELECT ev.id, '' as comment, '' as name, ev.date as create_date, ev.date as date_sort, 0 as checklist, 'partner' as `type`, ev.user_id, 0 AS partner_id, '' as record, ev.client_id, '' as document_id, ev.req_id, 0 as old_req_id, ev.date as schedule_date, '' as schedule_date_to, '' as address, '' as `sum`, ev.from_id, '' as calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, 0 as cancel, 0 as open_step from events_clients as ev WHERE ev.req_id = $get[req_id] and event = 'transmitted_parallel'
|
||||
SELECT ev.id, '' as comment, '' as name, ev.date as create_date, ev.date as date_sort, 0 as checklist, 'partner' as `type`, NULL as type_call, ev.user_id, 0 AS partner_id, '' as record, ev.client_id, '' as document_id, ev.req_id, 0 as old_req_id, ev.date as schedule_date, '' as schedule_date_to, '' as address, '' as `sum`, ev.from_id, '' as calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, 0 as cancel, 0 as open_step from events_clients as ev WHERE ev.req_id = $get[req_id] and event = 'transmitted_parallel'
|
||||
union
|
||||
SELECT e.id, e.comment, '' as name, e.create_date, e.create_date as date_sort, '0' as checklist, 'show_object' as type, e.user_id, '' as record, e.object_id, 0 as client_id, e.document_id, e.req_id, 0 as old_req_id, e.schedule_date, '' as schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, e.cancel, 0 as open_step "
|
||||
SELECT e.id, e.comment, '' as name, e.create_date, e.create_date as date_sort, '0' as checklist, 'show_object' as type, NULL as type_call, e.user_id, '' as record, e.object_id, 0 as client_id, e.document_id, e.req_id, 0 as old_req_id, e.schedule_date, '' as schedule_date_to, e.address, e.sum, e.from_id, e.calendar_view, '' as `mango`, '' as `megafon`, '' as telphin, '' as beeline, '' as mts, '' as tele2, '' as allo, '' as tracking, e.cancel, 0 as open_step "
|
||||
. "FROM user_object_events as e WHERE e.req_id={$get['req_id']} AND e.object_id in (".implode(',', $arrSin).") AND e.type='show'
|
||||
ORDER BY date_sort ASC";
|
||||
//echo $sql;
|
||||
@ -512,8 +512,29 @@ ORDER BY date_sort ASC";
|
||||
<?php if($event['comment']){
|
||||
$pattern = '/(https?:\/\/\S+)/i';
|
||||
$comment = preg_replace($pattern, '<a target="_blank" href="$1">ссылка</a>', $event['comment']);
|
||||
|
||||
if(!empty($event['type_call'])){
|
||||
switch($event['type_call']){
|
||||
case 1:{
|
||||
$comment = '<img class="type_call" src="/images/call_in_on.svg"/><img class="type_call" src="/images/call_on.svg"/><span>'.$comment.'</span>';
|
||||
break;
|
||||
}
|
||||
case 2:{
|
||||
$comment = '<img class="type_call" src="/images/call_out_on.svg"/><img class="type_call" src="/images/call_on.svg"/><span>'.$comment.'</span>';
|
||||
break;
|
||||
}
|
||||
case 3:{
|
||||
$comment = '<img class="type_call" src="/images/call_in_off.svg"/><img class="type_call" src="/images/call_off.svg"/><span>'.$comment.'</span>';
|
||||
break;
|
||||
}
|
||||
case 4:{
|
||||
$comment = '<img class="type_call" src="/images/call_out_off.svg"/><img class="type_call" src="/images/call_off.svg"/><span>'.$comment.'</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="message">Комментарий: <?=$comment?></div>
|
||||
<div class="message"><span>Комментарий: </span><?=$comment?></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
@ -1086,7 +1107,7 @@ ORDER BY date_sort ASC";
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-content" id="chat_content_<?=$event['id']?>">
|
||||
<div class="head" style="display:flex;align-items:center;gap:8px;">
|
||||
<div class="head">
|
||||
<span>Сделка</span>
|
||||
<?php
|
||||
$deal_id_for_edit = null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user