|
|
@ -416,6 +416,7 @@ class ModuleImport |
|
|
|
$message = $AVE_Template->get_config_vars('saved'); |
|
|
|
$message = $AVE_Template->get_config_vars('saved'); |
|
|
|
$header = $AVE_Template->get_config_vars('success'); |
|
|
|
$header = $AVE_Template->get_config_vars('success'); |
|
|
|
$theme = 'accept'; |
|
|
|
$theme = 'accept'; |
|
|
|
|
|
|
|
|
|
|
|
echo json_encode(array('message' => $message, 'header' => $header, 'theme' => $theme)); |
|
|
|
echo json_encode(array('message' => $message, 'header' => $header, 'theme' => $theme)); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
@ -584,12 +585,11 @@ class ModuleImport |
|
|
|
|
|
|
|
|
|
|
|
$i = 0; |
|
|
|
$i = 0; |
|
|
|
|
|
|
|
|
|
|
|
$log = |
|
|
|
$log = array( |
|
|
|
[ |
|
|
|
|
|
|
|
'updated' => array(), |
|
|
|
'updated' => array(), |
|
|
|
'created' => array(), |
|
|
|
'created' => array(), |
|
|
|
'notfound' => array() |
|
|
|
'notfound' => array() |
|
|
|
]; |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Обрабатываем по очереди каждый объект |
|
|
|
// Обрабатываем по очереди каждый объект |
|
|
|
foreach($import_data['rows'] as $item) |
|
|
|
foreach($import_data['rows'] as $item) |
|
|
@ -601,6 +601,7 @@ class ModuleImport |
|
|
|
|
|
|
|
|
|
|
|
// парсим шаблоны |
|
|
|
// парсим шаблоны |
|
|
|
$item_fields = $fields; |
|
|
|
$item_fields = $fields; |
|
|
|
|
|
|
|
|
|
|
|
array_walk_recursive($item_fields, array($this, '_parse_tpl'), $replace); |
|
|
|
array_walk_recursive($item_fields, array($this, '_parse_tpl'), $replace); |
|
|
|
|
|
|
|
|
|
|
|
// чистим память |
|
|
|
// чистим память |
|
|
@ -618,7 +619,8 @@ class ModuleImport |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (! $pass) continue; |
|
|
|
if (! $pass) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
// проверяем обязательные поля в теле документа |
|
|
|
// проверяем обязательные поля в теле документа |
|
|
|
foreach ($fields_oblig['body'] as $field_id) |
|
|
|
foreach ($fields_oblig['body'] as $field_id) |
|
|
@ -630,7 +632,8 @@ class ModuleImport |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (! $pass) continue; |
|
|
|
if (! $pass) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
// находим документ по ключевым полям |
|
|
|
// находим документ по ключевым полям |
|
|
|
$docids = $this->_docs_find($fields_key, $fields_comp, $item_fields, $import->rub_id); |
|
|
|
$docids = $this->_docs_find($fields_key, $fields_comp, $item_fields, $import->rub_id); |
|
|
|