Ejemplo n.º 1
0
 public function update($id, $params)
 {
     $status = Response::STATUS_BAD_REQUEST;
     $data = array();
     unset($params['status_id']);
     $lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
     $status_data = fn_get_status_by_id($id, $lang_code);
     if (empty($status_data)) {
         $status = Response::STATUS_NOT_FOUND;
     } else {
         $params['status'] = $status_data['status'];
         $status_name = fn_update_status($status_data['status'], $params, $status_data['type']);
         if ($status_name) {
             $status = Response::STATUS_OK;
             $data = array('status_id' => $id);
         }
     }
     return array('status' => $status, 'data' => $data);
 }
Ejemplo n.º 2
0
function fn_rus_payments_install()
{
    $payments = fn_get_schema('rus_payments', 'processors', 'php', true);
    if (!empty($payments)) {
        foreach ($payments as $payment) {
            $processor_id = db_get_field("SELECT processor_id FROM ?:payment_processors WHERE admin_template = ?s", $payment['admin_template']);
            if (empty($processor_id)) {
                db_query('INSERT INTO ?:payment_processors ?e', $payment);
            } else {
                db_query("UPDATE ?:payment_processors SET ?u WHERE processor_id = ?i", $payment, $processor_id);
            }
        }
    }
    $statuses = fn_get_schema('rus_payments', 'statuses', 'php', true);
    if (!empty($statuses)) {
        foreach ($statuses as $status_name => $status_data) {
            $status = fn_update_status('', $status_data, $status_data['type']);
            fn_set_storage_data($status_name, $status);
        }
    }
}
Ejemplo n.º 3
0
function fn_call_requests_addon_install()
{
    // Order statuses
    $exists = db_get_field("SELECT status_id FROM ?:statuses WHERE status = ?s AND type = ?s", 'Y', STATUSES_ORDER);
    if (!$exists) {
        fn_update_status('', array('status' => 'Y', 'is_default' => 'Y', 'description' => __('call_requests.awaiting_call'), 'email_subj' => __('call_requests.awaiting_call'), 'email_header' => __('call_requests.awaiting_call'), 'params' => array('color' => '#cc4125', 'notify' => 'Y', 'notify_department' => 'Y', 'repay' => 'Y', 'inventory' => 'D')), STATUSES_ORDER);
    }
}
Ejemplo n.º 4
0
function fn_anti_fraud_add_status()
{
    $status_data = array('type' => 'O', 'description' => 'Fraud checking', 'params' => array('notify' => 'Y', 'notify_department' => 'Y', 'inventory' => 'D', 'remove_cc_info' => 'Y', 'repay' => 'N', 'appearance_type' => 'D', 'allow_return' => 'N'));
    Settings::instance()->updateValue('antifraud_order_status', fn_update_status('', $status_data, 'O'), 'anti_fraud');
}
Ejemplo n.º 5
0
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    fn_trusted_vars('status_data');
    if ($mode == 'update') {
        fn_update_status($_REQUEST['status'], $_REQUEST['status_data'], $_REQUEST['type']);
    }
    if ($mode == 'delete') {
        if (!empty($_REQUEST['status'])) {
            if (fn_delete_status($_REQUEST['status'], $_REQUEST['type'])) {
                $count = db_get_field("SELECT COUNT(*) FROM ?:statuses");
                if (empty($count)) {
                    Tygh::$app['view']->display('views/statuses/manage.tpl');
                }
            }
        }
        exit;
    }
    return array(CONTROLLER_STATUS_OK, 'statuses.manage?type=' . $_REQUEST['type']);
}
if ($mode == 'update') {
Ejemplo n.º 6
0
function fn_call_requests_addon_install()
{
    // Order statuses
    $existing_status_id = fn_get_status_id('Y', STATUSES_ORDER);
    if (!$existing_status_id) {
        fn_update_status('', array('status' => 'Y', 'is_default' => 'Y', 'description' => __('call_requests.awaiting_call'), 'email_subj' => __('call_requests.awaiting_call'), 'email_header' => __('call_requests.awaiting_call'), 'params' => array('color' => '#cc4125', 'notify' => 'Y', 'notify_department' => 'Y', 'repay' => 'Y', 'inventory' => 'D')), STATUSES_ORDER);
    }
}
Ejemplo n.º 7
0
/**
 * Functions
 */
function fn_yandex_market_addon_install()
{
    // Order statuses
    $statuses = array(array('status' => 'X', 'is_default' => 'N', 'description' => __('yml_status_pickup'), 'email_subj' => __('yml_status_pickup'), 'email_header' => __('yml_status_pickup'), 'params' => array('color' => '#6aa84f', 'notify' => 'Y', 'notify_department' => 'N', 'repay' => 'N', 'inventory' => 'D')), array('status' => 'W', 'is_default' => 'N', 'description' => __('yml_status_delivered'), 'email_subj' => __('yml_status_delivered'), 'email_header' => __('yml_status_delivered'), 'params' => array('color' => '#76a5af', 'notify' => 'N', 'notify_department' => 'N', 'repay' => 'N', 'inventory' => 'D')));
    foreach ($statuses as $status) {
        $exists = db_get_field("SELECT status_id FROM ?:statuses WHERE status = ?s AND type = ?s", $status['status'], STATUSES_ORDER);
        if (!$exists) {
            fn_update_status('', $status, STATUSES_ORDER);
        }
    }
}