Beispiel #1
0
function fn_rus_payments_uninstall()
{
    $payments = fn_get_schema('rus_payments', 'processors');
    fn_rus_payments_disable_payments($payments, true);
    foreach ($payments as $payment) {
        db_query("DELETE FROM ?:payment_processors WHERE admin_template = ?s", $payment['admin_template']);
    }
    $statuses = fn_get_schema('rus_payments', 'statuses', 'php', true);
    if (!empty($statuses)) {
        foreach ($statuses as $status_name => $status_data) {
            fn_delete_status(fn_get_storage_data($status_name), 'O');
        }
    }
}
Beispiel #2
0
function fn_anti_fraud_remove_status()
{
    $settings = Registry::get('addons.anti_fraud');
    $o_ids = db_get_fields('SELECT order_id FROM ?:orders WHERE status = ?s', $settings['antifraud_order_status']);
    if (!empty($o_ids)) {
        foreach ($o_ids as $order_id) {
            fn_change_order_status($order_id, 'O');
            // Change order status from "Fraud checking" to "Open"
        }
    }
    fn_delete_status($settings['antifraud_order_status'], 'O');
}
Beispiel #3
0
****************************************************************************
* 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') {
    $status_data = fn_get_status_data($_REQUEST['status'], $_REQUEST['type']);
    Tygh::$app['view']->assign('status_data', $status_data);
    Tygh::$app['view']->assign('type', $_REQUEST['type']);
    Tygh::$app['view']->assign('status_params', fn_get_status_params_definition($_REQUEST['type']));
Beispiel #4
0
 public function delete($id)
 {
     $data = array();
     $status = Response::STATUS_BAD_REQUEST;
     $status_data = fn_get_status_by_id($id, DEFAULT_LANGUAGE);
     if (empty($status_data)) {
         $status = Response::STATUS_NOT_FOUND;
     } else {
         if (fn_delete_status($status_data['status'], $status_data['type'])) {
             $status = Response::STATUS_NO_CONTENT;
         }
     }
     return array('status' => $status, 'data' => $data);
 }