function createContact_run($args) { global $config; $input = getOption('input-file', $args); define('CONTACT_TYPE', getOption('contact-type', $args)); define('CONTACT_SUB_TYPE', getOption('contact-sub-type', $args)); define('PHONE_TYPE', array_key_exists("phone_type", $config) ? $config['phone_type'] : "Main"); define('WORK_PHONE_TYPE', array_key_exists("work_phone_type", $config) ? $config['work_phone_type'] : "Work"); define('OTHER_PHONE_TYPE', array_key_exists("other_phone_type", $config) ? $config['other_phone_type'] : "Other"); define('EMAIL_TYPE', array_key_exists("email_type", $config) ? $config['email_type'] : "Main"); define('WORK_EMAIL_TYPE', array_key_exists("work_email_type", $config) ? $config['work_email_type'] : "Work"); define('OTHER_EMAIL_TYPE', array_key_exists("other_email_type", $config) ? $config['other_email_type'] : "Other"); define('ADDRESS_TYPE', array_key_exists("address_type", $config) ? $config['address_type'] : "Main"); $main = 'processContactsForImport'; withFile($input, $main); }
function trash_run($args) { define('ID_COLUMN', getOption('id-col', $args)); $input = getOption('input-file', $args); $jobDate = shell('date +"%F %R"'); if ($args['undelete']) { define('UNDELETE', TRUE); $apiTag = createJobTag($jobDate, 'UNDelete CiviCRM Contacts'); } else { define('UNDELETE', FALSE); $apiTag = createJobTag($jobDate, 'Delete CiviCRM Contacts'); } define('TAG_ID', $apiTag->id); $main = 'processContacts'; withFile($input, $main); }