Files
crm.clientright.ru/test/templates_c/v7/480d7bafdb8cc941a7de2b9b431aa1c13f091004.file.FormGenerator.tpl.php
Fedor cd90b0d58a feat: Добавлен инструмент генерации документов для AI Ассистента
- Создан API create_document_with_text.php для создания DOCX/XLSX/PPTX с текстом от AI
- Поддержка Markdown форматирования (заголовки, жирный, курсив, списки, код)
- Установлен PHPWord для красивого форматирования документов
- Исправлены пути сохранения (crm2/CRM_Active_Files/... без /crm/ в начале)
- Замена пробелов на подчеркивания в именах папок
- Создана документация для AI и разработчиков
- Добавлены API для работы с шаблонами Nextcloud
2025-11-12 19:46:06 +03:00

140 lines
8.6 KiB
PHP

<?php /* Smarty version Smarty-3.1.7, created on 2025-11-10 22:07:46
compiled from "/var/www/fastuser/data/www/crm.clientright.ru/includes/runtime/../../layouts/v7/modules/Settings/Workflow2/helpers/FormGenerator.tpl" */ ?>
<?php /*%%SmartyHeaderCode:160884121869123802dbd236-81705653%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'480d7bafdb8cc941a7de2b9b431aa1c13f091004' =>
array (
0 => '/var/www/fastuser/data/www/crm.clientright.ru/includes/runtime/../../layouts/v7/modules/Settings/Workflow2/helpers/FormGenerator.tpl',
1 => 1711810494,
2 => 'file',
),
),
'nocache_hash' => '160884121869123802dbd236-81705653',
'function' =>
array (
),
'variables' =>
array (
'field' => 0,
'fieldTypes' => 0,
'formFields' => 0,
'fields' => 0,
'fieldConfig' => 0,
'config' => 0,
'variable' => 0,
'width' => 0,
'value' => 0,
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.7',
'unifunc' => 'content_69123802dd3b6',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_69123802dd3b6')) {function content_69123802dd3b6($_smarty_tpl) {?><?php if (!is_callable('smarty_function_html_options')) include '/var/www/fastuser/data/www/crm.clientright.ru/libraries/Smarty/libs/plugins/function.html_options.php';
?><input type="hidden" name="task[<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_version]" value="2" />
<div id="formgenerator"></div>
<script type="text/javascript">
var FGDAT = {};
var fieldTypes = <?php echo json_encode($_smarty_tpl->tpl_vars['fieldTypes']->value);?>
;
jQuery(function() {
initFormGenerator('formgenerator', '<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
', <?php echo json_encode($_smarty_tpl->tpl_vars['formFields']->value);?>
);
});
</script>
<?php $_smarty_tpl->tpl_vars['fieldConfig'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['fieldConfig']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['fields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['fieldConfig']->key => $_smarty_tpl->tpl_vars['fieldConfig']->value){
$_smarty_tpl->tpl_vars['fieldConfig']->_loop = true;
?>
<script type="text/template" id="fieldtemplate_<?php echo strtolower($_smarty_tpl->tpl_vars['fieldConfig']->value['id']);?>
">
<?php $_smarty_tpl->tpl_vars['config'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['config']->_loop = false;
$_smarty_tpl->tpl_vars['variable'] = new Smarty_Variable;
$_from = $_smarty_tpl->tpl_vars['fieldConfig']->value['config']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['config']->key => $_smarty_tpl->tpl_vars['config']->value){
$_smarty_tpl->tpl_vars['config']->_loop = true;
$_smarty_tpl->tpl_vars['variable']->value = $_smarty_tpl->tpl_vars['config']->key;
?>
<div style="clear:both;">
<?php if ($_smarty_tpl->tpl_vars['config']->value['type']=='checkbox'){?>
<div style="float:left;padding-right:10px;">
<input class="configField rcSwitch doInit" type="checkbox" data-type="<?php echo $_smarty_tpl->tpl_vars['config']->value['type'];?>
" data-variable="<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" name="task[<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
][##FIELDNAME##][config][<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
]" data-id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['config']->value['value'];?>
">
</div>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['config']->value['type']!='condition'){?>
<div style='padding:0;padding-right:5px;line-height:<?php if ($_smarty_tpl->tpl_vars['config']->value['type']!='checkbox'){?>20<?php }else{ ?>30<?php }?>px;font-size:11px;<?php if ($_smarty_tpl->tpl_vars['config']->value['type']!='label'){?>font-weight:bold;<?php }else{ ?>font-style:italic;<?php }?>'><?php echo vtranslate($_smarty_tpl->tpl_vars['config']->value['label'],'Settings:Workflow2');?>
</div>
<?php }?>
<?php if ($_smarty_tpl->tpl_vars['config']->value['type']!='label'){?>
<div style="<?php if ($_smarty_tpl->tpl_vars['variable']->value=='mandatory'){?>display:inline;<?php }?>">
<?php if ($_smarty_tpl->tpl_vars['config']->value['type']=='templatefield'){?>
<div class="configField insertTextfield" data-style="width:<?php echo $_smarty_tpl->tpl_vars['width']->value;?>
px;" data-type="<?php echo $_smarty_tpl->tpl_vars['config']->value['type'];?>
" data-name="task[<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
][##FIELDNAME##][config][<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
]" data-id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" data-placeholder="<?php echo $_smarty_tpl->tpl_vars['config']->value['placeholder'];?>
"></div>
<?php }elseif($_smarty_tpl->tpl_vars['config']->value['type']=='templatearea'){?>
<div class="configField insertTextarea" data-type="<?php echo $_smarty_tpl->tpl_vars['config']->value['type'];?>
" data-name="task[<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
][##FIELDNAME##][config][<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
]" data-placeholder="<?php echo $_smarty_tpl->tpl_vars['config']->value['placeholder'];?>
" data-id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" data-options='{"height":"100px"}'><?php echo $_smarty_tpl->tpl_vars['value']->value;?>
</div>
<?php }elseif($_smarty_tpl->tpl_vars['config']->value['type']=='picklist'){?>
<select name="task[<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
][##FIELDNAME##][config][<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
]" data-nomodify="<?php echo $_smarty_tpl->tpl_vars['config']->value['nomodify'];?>
" data-variable="<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" data-id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" data-type="<?php echo $_smarty_tpl->tpl_vars['config']->value['type'];?>
" style="width:100%;height:30px;" class="configField MakeSelect2" >
<?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['config']->value['options']),$_smarty_tpl);?>
</select>
<?php }elseif($_smarty_tpl->tpl_vars['config']->value['type']=='condition'){?>
<input type="hidden" class="configField" name="task[<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
][##FIELDNAME##][config][<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
]" data-variable="<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" data-id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" id="task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
" data-type="hidden" />
<button class="btn btn-primary" type="button" onclick="ConditionPopup.open('#task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['variable']->value;?>
', '#task_<?php echo $_smarty_tpl->tpl_vars['field']->value;?>
_##FIELDNAME##_config_<?php echo $_smarty_tpl->tpl_vars['config']->value['moduleField'];?>
', 'LBL_FILTER_RECORDS_2_SELECT');"><?php echo vtranslate($_smarty_tpl->tpl_vars['config']->value['label'],'Settings:Workflow2');?>
</button>
<?php }?>
</div>
<?php }?>
</div>
<?php } ?>
</script>
<?php } ?><?php }} ?>