pluginDescription->name = 'Export in automations'; $this->pluginDescription->category = 'User management'; $this->pluginDescription->description = '- Export the filtered users in the automations'; } protected function initAutomationActions(): void { $this->automationActions['export'] = acym_translation('ACYM_EXPORT_SUBSCRIBERS'); } public function displayActionOptions_export(): void { $fields = acym_getColumns('user'); $fieldClass = new FieldClass(); $customFields = $fieldClass->getAll(); $fields = array_merge($fields, $customFields); $defaultFields = explode(',', $this->config->get('export_fields', 'name,email')); $coreFields = [1, 2, $fieldClass->getLanguageFieldId()]; ?>
name; $fieldValue = $field->id; if ($field->type === 'file' || in_array($field->id, $coreFields)) { continue; } } else { $type = 'core'; $fieldName = $field; $fieldValue = $fieldName; if (in_array($fieldName, ['id', 'automation'])) { continue; } } ?>
id="checkbox__and___" type="checkbox" name="" value="">
id="checkbox__and___subscribe_date" type="checkbox" name="acym_action[actions][__and__][export][special][subscribe_date]" value="subscribe_date">
acym_translation('ACYM_SEMICOLON'), 'comma' => acym_translation('ACYM_COMMA'), ], 'acym_action[actions][__and__][export][separator]', $this->config->get('export_separator', 'comma'), ['class' => 'acym__select'], 'value', 'text', null, false, true ); ?>
charsetField( 'acym_action[actions][__and__][export][charset]', $this->config->get('export_charset', 'UTF-8'), ['class' => 'acym__select'], true ); ?>
getQuery($select); $exportHelper = new ExportHelper(); $realSeparators = ['comma' => ',', 'semicol' => ';']; $error = $exportHelper->exportCSV($query, $action['core'], $action['custom'], $action['special'], $realSeparators[$action['separator']], $action['charset'], $pathtolog); if (empty($error)) { return acym_translationSprintf('ACYM_USERS_EXPORTED', $pathtolog); } else { return '['.acym_translation('ACYM_EXPORT_SUBSCRIBERS').'] '.$error; } } public function onAcymDeclareSummary_actions(&$automation) { if (!empty($automation['export'])) { $automation = acym_translation('ACYM_ALL_SUBSCRIBER_WILL_BE_EXPORTED'); } } }