Files
crm.clientright.ru/test/templates_c/v7/cde241c3638f38d7de211144f4f4f76729d5f1fa.file.DetailViewHeaderTitle.tpl.php
Fedor 7e3f0dcede Исправление путей к папкам проектов в Nextcloud + создание файлов из CRM
🔧 Исправления:
- Исправлены пути к папкам проектов: теперь /Documents/Project/{Name}_{Id}
- Исправлена функция openProjectFolder() во всех JS файлах
- Добавлены кнопки создания Word/Excel/PowerPoint из CRM (10 модулей)
- Создание файлов напрямую в S3 с автоиндексацией через Redis
- Исправлена ошибка 'Class Redis not found' (использован Predis)

📁 Изменённые файлы:
- layouts/v7/lib/nextcloud-editor.js
- crm_extensions/nextcloud_editor/js/nextcloud-editor.js
- layouts/v7/lib/nextcloud-editor-v3.js
- crm_extensions/file_storage/api/create_nextcloud_file.php
- layouts/v7/modules/*/DetailViewHeaderTitle.tpl (10 модулей)
- layouts/v7/modules/Documents/*.tpl (кнопки редактирования)

🎯 Результат:
- Кнопка 'Папка в Nextcloud' открывает правильную папку
- Создание файлов работает молниеносно (прямо в S3)
- Redis события публикуются корректно
- OnlyOffice открывается для редактирования

Проект 391552 теперь открывается по правильному пути!
2025-11-01 12:22:12 +03:00

71 lines
7.9 KiB
PHP

<?php /* Smarty version Smarty-3.1.7, created on 2025-11-01 12:20:16
compiled from "/var/www/fastuser/data/www/crm.clientright.ru/includes/runtime/../../layouts/v7/modules/Contacts/DetailViewHeaderTitle.tpl" */ ?>
<?php /*%%SmartyHeaderCode:4059741436905d0d05698b7-90338333%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'cde241c3638f38d7de211144f4f4f76729d5f1fa' =>
array (
0 => '/var/www/fastuser/data/www/crm.clientright.ru/includes/runtime/../../layouts/v7/modules/Contacts/DetailViewHeaderTitle.tpl',
1 => 1761984818,
2 => 'file',
),
),
'nocache_hash' => '4059741436905d0d05698b7-90338333',
'function' =>
array (
),
'variables' =>
array (
'RECORD' => 0,
'IMAGE_DETAILS' => 0,
'IMAGE_INFO' => 0,
'MODULE_MODEL' => 0,
'NAME_FIELD' => 0,
'FIELD_MODEL' => 0,
'COUNTER' => 0,
'MODULE' => 0,
'MODULE_NAME' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_6905d0d05b6b8',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6905d0d05b6b8')) {function content_6905d0d05b6b8($_smarty_tpl) {?>
<div class="col-lg-6 col-md-6 col-sm-6"><div class="record-header clearfix "><div class="hidden-sm hidden-xs recordImage"><?php $_smarty_tpl->tpl_vars['IMAGE_DETAILS'] = new Smarty_variable($_smarty_tpl->tpl_vars['RECORD']->value->getImageDetails(), null, 0);?><?php $_smarty_tpl->tpl_vars['IMAGE_INFO'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['IMAGE_INFO']->_loop = false;
$_smarty_tpl->tpl_vars['ITER'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['IMAGE_DETAILS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['IMAGE_INFO']->key => $_smarty_tpl->tpl_vars['IMAGE_INFO']->value){
$_smarty_tpl->tpl_vars['IMAGE_INFO']->_loop = true;
$_smarty_tpl->tpl_vars['ITER']->value = $_smarty_tpl->tpl_vars['IMAGE_INFO']->key;
?><?php if (!empty($_smarty_tpl->tpl_vars['IMAGE_INFO']->value['url'])){?><img src="<?php echo $_smarty_tpl->tpl_vars['IMAGE_INFO']->value['url'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['IMAGE_INFO']->value['orgname'];?>
" title="<?php echo $_smarty_tpl->tpl_vars['IMAGE_INFO']->value['orgname'];?>
" width="100%" height="100%" align="left"><br><?php }else{ ?><img src="<?php echo vimage_path('summary_Contact.png');?>
" class="summaryImg"/><?php }?><?php } ?><?php if (empty($_smarty_tpl->tpl_vars['IMAGE_DETAILS']->value)){?><div class="name"><span><strong><?php echo $_smarty_tpl->tpl_vars['MODULE_MODEL']->value->getModuleIcon();?>
</strong></span></div><?php }?></div><div class="recordBasicInfo"><div class="info-row"><h4><span class="recordLabel pushDown" title="<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getDisplayValue('salutationtype');?>
&nbsp;<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getName();?>
"><?php $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable(0, null, 0);?><?php $_smarty_tpl->tpl_vars['NAME_FIELD'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['NAME_FIELD']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['MODULE_MODEL']->value->getNameFields(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['NAME_FIELD']->key => $_smarty_tpl->tpl_vars['NAME_FIELD']->value){
$_smarty_tpl->tpl_vars['NAME_FIELD']->_loop = true;
?><?php $_smarty_tpl->tpl_vars['FIELD_MODEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['MODULE_MODEL']->value->getField($_smarty_tpl->tpl_vars['NAME_FIELD']->value), null, 0);?><?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getPermissions()){?><span class="<?php echo $_smarty_tpl->tpl_vars['NAME_FIELD']->value;?>
"><?php if ($_smarty_tpl->tpl_vars['RECORD']->value->getDisplayValue('salutationtype')&&$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getName()=='firstname'){?><?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getDisplayValue('salutationtype');?>
&nbsp;<?php }?><?php echo trim($_smarty_tpl->tpl_vars['RECORD']->value->get($_smarty_tpl->tpl_vars['NAME_FIELD']->value));?>
</span><?php if ($_smarty_tpl->tpl_vars['COUNTER']->value==0&&($_smarty_tpl->tpl_vars['RECORD']->value->get($_smarty_tpl->tpl_vars['NAME_FIELD']->value))){?>&nbsp;<?php $_smarty_tpl->tpl_vars['COUNTER'] = new Smarty_variable($_smarty_tpl->tpl_vars['COUNTER']->value+1, null, 0);?><?php }?><?php }?><?php } ?></span></h4></div><?php echo $_smarty_tpl->getSubTemplate (vtemplate_path("DetailViewHeaderFieldsView.tpl",$_smarty_tpl->tpl_vars['MODULE']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
<div class="info-row" style="margin-top: 10px;"><button type="button" class="btn btn-info btn-sm" onclick="openContactFolder('<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();?>
', '<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("firstname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
', '<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("lastname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
')" title="Открыть папку контакта в Nextcloud"><i class="fa fa-folder-open"></i> Папка в Nextcloud</button><button type="button" class="btn btn-default btn-sm" onclick="createFileInNextcloud('Contacts', '<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();?>
', '<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("firstname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
_<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("lastname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
', 'docx')" title="Создать Word документ в Nextcloud" style="margin-left: 5px;"><i class="fa fa-file-word-o" style="color: #2b579a;"></i></button><button type="button" class="btn btn-default btn-sm" onclick="createFileInNextcloud('Contacts', '<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();?>
', '<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("firstname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
_<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("lastname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
', 'xlsx')" title="Создать Excel таблицу в Nextcloud" style="margin-left: 2px;"><i class="fa fa-file-excel-o" style="color: #217346;"></i></button><button type="button" class="btn btn-default btn-sm" onclick="createFileInNextcloud('Contacts', '<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();?>
', '<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("firstname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
_<?php echo strtr($_smarty_tpl->tpl_vars['RECORD']->value->get("lastname"), array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
', 'pptx')" title="Создать PowerPoint презентацию в Nextcloud" style="margin-left: 2px;"><i class="fa fa-file-powerpoint-o" style="color: #d24726;"></i></button></div><script type="text/javascript" src="crm_extensions/nextcloud_editor/js/nextcloud-editor.js"></script><div class="info-row"><i class="fa fa-map-marker"></i>&nbsp;<a class="showMap" href="javascript:void(0);" onclick='Vtiger_Index_Js.showMap(this);' data-module='<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getModule()->getName();?>
' data-record='<?php echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();?>
'><?php echo vtranslate('LBL_SHOW_MAP',$_smarty_tpl->tpl_vars['MODULE_NAME']->value);?>
</a></div></div></div></div><?php }} ?>