****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'add_selected') { fn_add_users_to_unisender($_REQUEST['user_ids']); } elseif ($mode == 'update') { fn_unisender_update_fields($_REQUEST['unisender_data']['fields']); return array(CONTROLLER_STATUS_OK, 'unisender.manage'); } if ($mode == 'send_sms') { if (isset($_REQUEST['sms_data']) && !empty($_REQUEST['sms_data'])) { $params = $_REQUEST['sms_data']; fn_rus_unisender_send_sms($params['text'], $params['phone']); //user_sms } if (defined('AJAX_REQUEST')) { exit; } elseif (!empty($_REQUEST['return_url'])) { return array(CONTROLLER_STATUS_OK, $_REQUEST['return_url']); } else { return array(CONTROLLER_STATUS_OK, 'profiles.update?user_id=' . $_REQUEST['user_id']); } } return array(CONTROLLER_STATUS_OK, 'profiles.manage?user_type=C'); } if ($mode == 'manage') { // [Page sections] Registry::set('navigation.tabs', array('fields' => array('title' => __('addons.rus_unisender.map_fields'), 'js' => true)));
function fn_rus_unisender_change_order_status($status_to, $status_from, $order_info, $force_notification, $order_statuses, $place_order) { $addon_settings = Registry::get('addons.rus_unisender'); if ($addon_settings['send_sms_user'] == 'Y' && (!empty($force_notification['UC']) && $force_notification['UC'])) { $text = $addon_settings['send_sms_user_text']; $text = str_replace('[order_id]', $order_info['order_id'], $text); fn_rus_unisender_send_sms($text, $order_info['phone'], $order_info['order_id'], $status_to); } }