Files
crm.clientright.ru/test/templates_c/v7/697b6e5c33f184d5794c621d6d65fbbb493fecb4.file.DetailViewActions.tpl.php
Fedor 840acca51a feat(documents): дедупликация documents_meta и исправление field_label
- Исправлен N8N_CODE_PROCESS_UPLOADED_FILES_FIXED.js: использовать uploads_field_labels[0] вместо [grp]
- Создан SQL_CLAIMSAVE_FIXED_NEW_FLOW_DEDUP.sql с дедупликацией documents_meta
- Создан SQL_CLEANUP_DOCUMENTS_META_DUPLICATES.sql для очистки существующих дубликатов
- Создан полный уникальный индекс idx_document_texts_hash_unique на document_texts(file_hash)
- Добавлен SESSION_LOG_2025-11-28_documents_dedup.md с описанием всех изменений

Fixes:
- field_label теперь корректно отображает 'Переписка' вместо 'group-2'
- documents_meta не накапливает дубликаты при повторных сохранениях
- ON CONFLICT (file_hash) теперь работает для document_texts
2025-11-28 18:16:53 +03:00

123 lines
14 KiB
PHP

<?php /* Smarty version Smarty-3.1.7, created on 2025-11-24 18:20:23
compiled from "/var/www/fastuser/data/www/crm.clientright.ru/includes/runtime/../../layouts/v7/modules/ITS4YouReports/DetailViewActions.tpl" */ ?>
<?php /*%%SmartyHeaderCode:72252607692477b7678d01-89848909%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'697b6e5c33f184d5794c621d6d65fbbb493fecb4' =>
array (
0 => '/var/www/fastuser/data/www/crm.clientright.ru/includes/runtime/../../layouts/v7/modules/ITS4YouReports/DetailViewActions.tpl',
1 => 1711810496,
2 => 'file',
),
),
'nocache_hash' => '72252607692477b7678d01-89848909',
'function' =>
array (
),
'variables' =>
array (
'DETAILVIEW_ACTIONS' => 0,
'DETAILVIEW_LINK' => 0,
'LINK_ICON_CLASS' => 0,
'LINK_URL' => 0,
'DASHBOARD_TABS' => 0,
'REPORT_MODEL' => 0,
'MODULE' => 0,
'BTN_I' => 0,
'LINK_NAME' => 0,
'TAB_INFO' => 0,
'COUNT' => 0,
'COLUMNS_LIMIT' => 0,
'SUMMARIES_LIMIT' => 0,
'PDFMakerActive' => 0,
'IS_TEST_WRITE_ABLE' => 0,
'DETAILVIEW_LINKS' => 0,
'LINKNAME' => 0,
'ICON_CLASS' => 0,
'MODULENAME' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_692477b76a1cb',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_692477b76a1cb')) {function content_692477b76a1cb($_smarty_tpl) {?>
<div class="listViewPageDiv"><div class="reportHeader"><div class="row"><div class="col-lg-3"><div class="btn-toolbar"><div class="btn-group"><?php $_smarty_tpl->tpl_vars['BTN_I'] = new Smarty_variable('0', null, 0);?><?php $_smarty_tpl->tpl_vars['DETAILVIEW_LINK'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['DETAILVIEW_ACTIONS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->key => $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value){
$_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = true;
?><?php $_smarty_tpl->tpl_vars['LINK_URL'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl(), null, 0);?><?php $_smarty_tpl->tpl_vars['LINK_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getLabel(), null, 0);?><?php $_smarty_tpl->tpl_vars['LINK_ICON_CLASS'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkiconclass'), null, 0);?><?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'){?><div class="btn-group"><?php }?><button <?php if ($_smarty_tpl->tpl_vars['LINK_URL']->value){?> onclick='window.location.href = "<?php echo $_smarty_tpl->tpl_vars['LINK_URL']->value;?>
"' <?php }?> type="button"class="cursorPointer btn btn-default <?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('customclass');?>
<?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'&&ITS4YouReports_Functions_Helper::count($_smarty_tpl->tpl_vars['DASHBOARD_TABS']->value)>1){?> dropdown-toggle<?php }?>"title="<?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'){?><?php if ($_smarty_tpl->tpl_vars['REPORT_MODEL']->value->isPinnedToDashboard()){?><?php echo vtranslate('LBL_UNPIN_CHART_FROM_DASHBOARD',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php }else{ ?><?php echo vtranslate('LBL_PIN_CHART_TO_DASHBOARD',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php }?><?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linktitle');?>
<?php }?>" <?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'&&ITS4YouReports_Functions_Helper::count($_smarty_tpl->tpl_vars['DASHBOARD_TABS']->value)>1){?>data-toggle="dropdown"<?php }?><?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'){?>data-dashboard-tab-count='<?php echo ITS4YouReports_Functions_Helper::count($_smarty_tpl->tpl_vars['DASHBOARD_TABS']->value);?>
'<?php }?>style="<?php if (0<$_smarty_tpl->tpl_vars['BTN_I']->value){?>margin-left:5px;<?php }?>"><?php if ($_smarty_tpl->tpl_vars['LINK_NAME']->value){?> <?php echo $_smarty_tpl->tpl_vars['LINK_NAME']->value;?>
<?php }?><?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value){?><?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='icon-pencil'){?>&nbsp;&nbsp;&nbsp;<?php }?><i class="fa <?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='icon-pencil'){?>fa-pencil<?php }elseif($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'){?><?php if ($_smarty_tpl->tpl_vars['REPORT_MODEL']->value->isPinnedToDashboard()){?>vicon-unpin<?php }else{ ?>vicon-pin<?php }?><?php }?>" style="font-size: 13px;"></i><?php }?></button><?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'){?><ul class='dropdown-menu dashBoardTabMenu'><li class="dropdown-header popover-title"><?php echo vtranslate('LBL_DASHBOARD',$_smarty_tpl->tpl_vars['MODULE']->value);?>
</li><?php $_smarty_tpl->tpl_vars['TAB_INFO'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['TAB_INFO']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['DASHBOARD_TABS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['TAB_INFO']->key => $_smarty_tpl->tpl_vars['TAB_INFO']->value){
$_smarty_tpl->tpl_vars['TAB_INFO']->_loop = true;
?><li class='dashBoardTab' data-tab-id='<?php echo $_smarty_tpl->tpl_vars['TAB_INFO']->value['id'];?>
'><a href='javascript:void(0)'> <?php echo $_smarty_tpl->tpl_vars['TAB_INFO']->value['tabname'];?>
</a></li><?php } ?></ul><?php }?><?php if ($_smarty_tpl->tpl_vars['LINK_ICON_CLASS']->value=='vtGlyph vticon-attach'){?></div><?php }?><?php $_smarty_tpl->tpl_vars['BTN_I'] = new Smarty_variable($_smarty_tpl->tpl_vars['BTN_I']->value+1, null, 0);?><?php } ?></div></div></div><div class="col-lg-6 textAlignCenter"><h3 class="marginTop0px"><?php echo $_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getName();?>
</h3><div id="noOfRecords"><?php echo vtranslate('LBL_NO_OF_RECORDS',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<span id="countValue"><?php echo $_smarty_tpl->tpl_vars['COUNT']->value;?>
</span><?php if ($_smarty_tpl->tpl_vars['COUNT']->value>1000){?><span class="redColor" id="moreRecordsText"> (<?php echo vtranslate('LBL_MORE_RECORDS_TXT',$_smarty_tpl->tpl_vars['MODULE']->value);?>
)</span><?php }else{ ?><span class="redColor hide" id="moreRecordsText"> (<?php echo vtranslate('LBL_MORE_RECORDS_TXT',$_smarty_tpl->tpl_vars['MODULE']->value);?>
)</span><?php }?></div><?php if ('custom_report'!=$_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType()){?><div class="limitsAreaInfoColored" id="limitOfRecords"><?php echo vtranslate('LBL_LIMITED',$_smarty_tpl->tpl_vars['MODULE']->value);?>
: (<?php if ($_smarty_tpl->tpl_vars['COLUMNS_LIMIT']->value>0){?><?php echo vtranslate('SET_LIMIT',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php echo $_smarty_tpl->tpl_vars['COLUMNS_LIMIT']->value;?>
<?php }?><?php if ($_smarty_tpl->tpl_vars['COLUMNS_LIMIT']->value>0&&$_smarty_tpl->tpl_vars['SUMMARIES_LIMIT']->value>0){?>, <?php }elseif($_smarty_tpl->tpl_vars['COLUMNS_LIMIT']->value==0&&$_smarty_tpl->tpl_vars['SUMMARIES_LIMIT']->value==0){?><?php echo vtranslate('LBL_ALL_RECORDS',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php }?><?php if ($_smarty_tpl->tpl_vars['SUMMARIES_LIMIT']->value>0){?><?php echo vtranslate('SUMMARIES_LIMIT',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php echo $_smarty_tpl->tpl_vars['SUMMARIES_LIMIT']->value;?>
<?php }?>)</div><?php }?><div id='activate_pdfmaker' class="fieldValue" style="display:block;"><span class="value"><?php if ($_smarty_tpl->tpl_vars['PDFMakerActive']->value!==true){?><?php echo vtranslate('Please_Install_PDFMaker',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php }?><?php if ($_smarty_tpl->tpl_vars['IS_TEST_WRITE_ABLE']->value!==true){?><?php echo vtranslate('Test_Not_WriteAble',$_smarty_tpl->tpl_vars['MODULE']->value);?>
<?php }?></span></div></div><div class='col-lg-3'><span class="pull-right"><div class="btn-toolbar"><div class="btn-group"><?php if ('tabular'==$_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType()){?><?php $_smarty_tpl->tpl_vars['DETAILVIEW_LINK'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['DETAILVIEW_LINKS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->key => $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value){
$_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = true;
?><?php $_smarty_tpl->tpl_vars['LINKNAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getLabel(), null, 0);?><span class="btn-group"><?php if ('custom_report'==$_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType()){?><button class="btn btn-default reportActions" data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
&source=<?php echo $_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType();?>
"style="margin-left:5px;" type="button" data-toggle="dropdown" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
" ><?php echo $_smarty_tpl->tpl_vars['LINKNAME']->value;?>
</button><?php }else{ ?><ul class="nav navbar-nav navbar-right"><li><button class="btn btn-default dropdown-toggle"style="margin-left:5px;" type="button" data-toggle="dropdown" ><?php echo $_smarty_tpl->tpl_vars['LINKNAME']->value;?>
&nbsp;<span class="caret"></span></button><ul class="dropdown-menu"><li><a href="javascript:void(0);" data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
&data=base" data-type="base" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
" class="reportActions" ><i class='<?php echo $_smarty_tpl->tpl_vars['ICON_CLASS']->value;?>
' style="font-size:13px;"></i>&nbsp; <?php echo vtranslate('LBL_EXPORT_REPORTED_RECORDS','ITS4YouReports');?>
</a></li><li><a href="javascript:void(0);" data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
&data=all" data-type="all" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
" class="reportActions" ><i class='<?php echo $_smarty_tpl->tpl_vars['ICON_CLASS']->value;?>
' style="font-size:13px;"></i>&nbsp; <?php echo vtranslate('LBL_ALL',$_smarty_tpl->tpl_vars['MODULENAME']->value);?>
</a></li><li><a href="javascript:void(0);" data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
" data-type="all" data-background-export="true" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
" class="reportActions" ><i class='<?php echo $_smarty_tpl->tpl_vars['ICON_CLASS']->value;?>
' style="font-size:13px;"></i>&nbsp; <?php echo vtranslate('LBL_BACKGROUND_EXPORT','ITS4YouReports');?>
</a></li></ul></li></ul><?php }?></span><?php } ?><?php }elseif('custom_report'!=$_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType()){?><?php $_smarty_tpl->tpl_vars['DETAILVIEW_LINK'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['DETAILVIEW_LINKS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->key => $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value){
$_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = true;
?><?php $_smarty_tpl->tpl_vars['LINKNAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getLabel(), null, 0);?><?php if ('generateMap'!=$_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('id')){?><ul class="nav navbar-nav navbar-right"><li><button class="btn btn-default dropdown-toggle"style="margin-left:5px;" type="button" data-toggle="dropdown" ><?php echo $_smarty_tpl->tpl_vars['LINKNAME']->value;?>
&nbsp;<span class="caret"></span></button><ul class="dropdown-menu"><li><a href="javascript:void(0);" data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
&data=base" data-type="base" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
" class="reportActions" ><i class='<?php echo $_smarty_tpl->tpl_vars['ICON_CLASS']->value;?>
' style="font-size:13px;"></i>&nbsp; <?php echo vtranslate('LBL_EXPORT_REPORTED_RECORDS','ITS4YouReports');?>
</a></li><li><a href="javascript:void(0);" data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
" data-type="all" data-background-export="true" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
" class="reportActions" ><i class='<?php echo $_smarty_tpl->tpl_vars['ICON_CLASS']->value;?>
' style="font-size:13px;"></i>&nbsp; <?php echo vtranslate('LBL_BACKGROUND_EXPORT','ITS4YouReports');?>
</a></li></ul></li></ul><?php }else{ ?><?php $_smarty_tpl->tpl_vars['LINKNAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getLabel(), null, 0);?><button class="btn btn-default reportActions" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
"data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
&source=<?php echo $_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType();?>
"style="margin-left:5px;"><?php echo $_smarty_tpl->tpl_vars['LINKNAME']->value;?>
</button><?php }?><?php } ?><?php }else{ ?><?php $_smarty_tpl->tpl_vars['DETAILVIEW_LINK'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['DETAILVIEW_LINKS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->key => $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value){
$_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->_loop = true;
?><?php $_smarty_tpl->tpl_vars['LINKNAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getLabel(), null, 0);?><button class="btn btn-default reportActions" name="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->get('linkname');?>
"data-href="<?php echo $_smarty_tpl->tpl_vars['DETAILVIEW_LINK']->value->getUrl();?>
&source=<?php echo $_smarty_tpl->tpl_vars['REPORT_MODEL']->value->getReportType();?>
"style="margin-left:5px;"><?php echo $_smarty_tpl->tpl_vars['LINKNAME']->value;?>
</button><?php } ?><?php }?></div></div></span></div></div></div></div>
<?php }} ?>