<?php
$sql_query = 'DELETE FROM `' . $config["table_prefix"] . 'calc_template` WHERE id = 9';
run_query($sql_query);
$sql_query = 'INSERT INTO `' . $config["table_prefix"] . 'calc_template`';
$sql_query .= <<<'EOT'
 (`id`, `name`, `calculate_tpl`, `params`, `type`, `tpl_name`, `javascript_tpl`, `tpl_category`, `calc_types`, `calc_num`) VALUES
(9,	'Изменить поле',	'$line[\'{$put_field}\'] = \'{$put_value}\';',	'{\n    \"title\": \"Изменить поле\",\n    \"help\": \"tpl_list_change\",\n    \"parameters\": {\n        \"put_field\": {\n        \"type\": \"Field\",\n            \"name\": \"put_field\",\n            \"description\": \"Выберите поле для замены значения\",\n            \"no_system\": true,\n            \"help\": \"tpl_replace_field\",\n            \"set_value\": \"true\",\n            \"set_value_description\": \"Значение\",\n            \"set_help\": \"tpl_value\"\n        }\n    },\n    \"events\": [\n        {\n            \"type\": 2,\n            \"field\": \"put_field\"\n        }\n    ]\n}',	'calc',	'calc_7.tpl',	'',	1,	'[1]',	2);
EOT;
run_query($sql_query);