Example #1
0
                 unset($data['status']);
             }
             TwigmoOrder::apiUpdateOrder($data, $response);
         } elseif ($action == 'update_status' && !empty($data['status'])) {
             TwigmoOrder::apiUpdateOrder(array('order_id' => $data['order_id'], 'status' => $data['status']), $response);
         } elseif ($action == 'update_info') {
             $order_data = array('order_id' => $data['order_id'], 'details' => $data['details'], 'notes' => $data['notes']);
             TwigmoOrder::apiUpdateOrder($order_data, $response);
         }
         fn_set_notification('N', '', fn_twg_get_lang_var('twgadmin_saved'));
     } elseif ($object == 'products' && $action == 'update') {
         foreach ($data as $product) {
             if (!empty($product['product_id'])) {
                 $_REQUEST['update_all_vendors'] = $product['update_all_vendors'];
                 fn_update_product($product, $product['product_id'], $lang_code);
                 fn_set_notification('N', '', fn_twg_get_lang_var('twgadmin_saved'));
             } else {
                 $response->addError('ERROR_WRONG_OBJECT_DATA', str_replace('[object]', 'products', __('twgadmin_wrong_api_object_data')));
             }
         }
     } elseif ($object == 'images' && $action == 'delete') {
         foreach ($data as $image) {
             if (empty($image['pair_id'])) {
                 $response->addError('ERROR_WRONG_OBJECT_DATA', str_replace('[object]', 'images', __('twgadmin_wrong_api_object_data')));
                 continue;
             }
             fn_delete_image_pair($image['pair_id'], 'product');
         }
     }
     $response->returnResponse();
 }
Example #2
0
<?php

/***************************************************************************
*                                                                          *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* 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.            *
****************************************************************************/
if (!defined('AREA')) {
    die('Access denied');
}
use Twigmo\Core\TwigmoConnector;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($mode == 'send') {
        if (!empty($_REQUEST['push'])) {
            $sent_is_ok = twg_send_mass_push_notification(new TwigmoConnector(), $_REQUEST['push']);
            if ($sent_is_ok) {
                fn_set_notification('N', fn_twg_get_lang_var('notice'), fn_twg_get_lang_var('twgadmin_push_has_uploaded'), 'S');
            } else {
                fn_set_notification('E', fn_twg_get_lang_var('error'), fn_twg_get_lang_var('twgadmin_send_push_error'), 'S');
            }
        }
        die;
    }
}
Example #3
0
/**
 * Get simple statuses description (P - Processed, O - Open)
 * @param string $type One letter status type
 * @param boolean $additional_statuses Flag that determines whether additional (hidden) statuses should be retrieved
 * @param boolean $exclude_parent Flag that determines whether parent statuses should be excluded
 * @param string $lang_code Language code
 * @return array Statuses
 */
function fn_twg_get_simple_statuses($type = STATUSES_ORDER, $additional_statuses = false, $exclude_parent = false, $lang_code = DESCR_SL)
{
    $statuses = db_get_hash_single_array("SELECT a.status, b.description" . " FROM ?:statuses as a" . " LEFT JOIN ?:status_descriptions as b ON b.status = a.status AND b.type = a.type AND b.lang_code = ?s" . " WHERE a.type = ?s", array('status', 'description'), $lang_code, $type);
    if ($type == STATUSES_ORDER && !empty($additional_statuses)) {
        $statuses['N'] = fn_twg_get_lang_var('incompleted', $lang_code);
        if (empty($exclude_parent)) {
            $statuses[STATUS_PARENT_ORDER] = fn_twg_get_lang_var('parent_order', $lang_code);
        }
    }
    return $statuses;
}