Ejemplo n.º 1
0
    $arResult["ERROR"] = 'module "mobileapp" not installed';
}
if ($USER->IsAuthorized() && check_bitrix_sessid() && !isset($arResult["ERROR"])) {
    $action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : '';
    switch ($action) {
        case "get_fields_html":
            $arFields = isset($_REQUEST['fields']) ? $_REQUEST['fields'] : array();
            $filterId = isset($_REQUEST['filter_id']) ? $_REQUEST['filter_id'] : '';
            if (strlen($filterId) > 0 && !empty($arFields)) {
                $arFieldsToSave = array();
                $arFields = $APPLICATION->ConvertCharsetArray($arFields, 'utf-8', SITE_CHARSET);
                foreach ($arFields as $fieldId => $arField) {
                    $arFieldsToSave[$fieldId] = $arField["VALUE"];
                }
                CAdminMobileFilter::setFields($filterId, $arFieldsToSave);
                $arResult["HTML"] = CAdminMobileFilter::getHtml($arFields);
            } else {
                $arResult["ERROR"] = "Insufficient data";
            }
            break;
    }
} else {
    $arResult["ERROR"] = "Access denied";
}
if (isset($arResult["ERROR"])) {
    $arResult["RESULT"] = "ERROR";
} else {
    $arResult["RESULT"] = "OK";
}
$arResult = $APPLICATION->ConvertCharsetArray($arResult, SITE_CHARSET, 'utf-8');
die(json_encode($arResult));
Ejemplo n.º 2
0
        }
        if (isset($arStatNames[$arOrder["STATUS_ID"]])) {
            $arOrder["STATUS_NAME"] = $arStatNames[$arOrder["STATUS_ID"]];
        }
    }
}
if (empty($arResult["ORDERS"]) || $ordersCount < SALE_ORDERS_INIT_COUNT) {
    $arResult['BOTTOM_REACHED'] = true;
} else {
    $arResult['BOTTOM_REACHED'] = false;
}
$arResult["FILTER"] = $arFilter;
$arResult["CURRENT_PAGE"] = $APPLICATION->GetCurPage();
$arResult['AJAX_URL'] = $componentPath . "/ajax.php";
$sitesCount = 0;
$rsSites = CSite::GetList($by = "sort", $order = "asc", array());
while ($arSite = $rsSites->GetNext()) {
    if (COption::GetOptionString("sale", "SHOP_SITE_" . $arSite["ID"], "")) {
        $sitesCount++;
    }
}
$arResult["SHOP_SITES_COUNT"] = $sitesCount;
if (!$arResult['RETURN_AS_ARRAY']) {
    CSaleMobileOrderPull::InitEventHandlers();
}
if ($arResult["ACTION"] == "filter_edit") {
    $arResult["CUSTOM_FILTER"] = CAdminMobileFilter::getFields($arResult["FILTER_ID"]);
    $filterFields = CSaleMobileOrderFilter::setFieldsValues($filterFields, $arResult["CUSTOM_FILTER"]);
    $arResult["FILTER_PARAMS"] = array("TITLE" => GetMessage("SMOL_FILTER_TUNE"), "JS_EVENT_APPLY" => "onAfterFilterApply", "FILTER_ID" => $arResult["FILTER_ID"], "VISIBLE_FIELDS" => $arResult['VISIBLE_FIELDS'], "FIELDS" => $filterFields);
}
$this->IncludeComponentTemplate();
Ejemplo n.º 3
0
    return;
}
if (isset($arParams['FILTER_ID'])) {
    $arResult["FILTER_ID"] = $arParams['FILTER_ID'];
} elseif (isset($_REQUEST['filter_id'])) {
    $arResult["FILTER_ID"] = $_REQUEST['filter_id'];
} else {
    ShowError("Undefined FILTER_ID.");
    return;
}
if (isset($_REQUEST['show_fields_list'])) {
    $arResult["SHOW_FIELDS_LIST"] = $_REQUEST['show_fields_list'] == 'Y' ? true : false;
} else {
    $arResult["SHOW_FIELDS_LIST"] = false;
}
if ($arResult["SHOW_FIELDS_LIST"]) {
    foreach ($arParams["FIELDS"] as $fieldId => $arField) {
        $arResult["FIELDS_LIST"][$fieldId] = $arField["NAME"];
    }
}
$arVisibleFields = CAdminMobileFilter::getFields($arResult["FILTER_ID"]);
if (!empty($arVisibleFields)) {
    $arResult["VISIBLE_FIELDS"] = array_keys($arVisibleFields);
} elseif (isset($arParams["VISIBLE_FIELDS"]) && is_array($arParams["VISIBLE_FIELDS"])) {
    $arResult["VISIBLE_FIELDS"] = $arParams["VISIBLE_FIELDS"];
} else {
    $arResult["VISIBLE_FIELDS"] = array_keys($arParams['FIELDS']);
}
$arResult['AJAX_URL'] = $componentPath . "/ajax.php";
CJSCore::Init('ajax');
$this->IncludeComponentTemplate();
Ejemplo n.º 4
0
if ($arResult["SHOW_FIELDS_LIST"]) {
    require $_SERVER['DOCUMENT_ROOT'] . $templateFolder . '/dialogs/fields.php';
    return;
}
$arData = array();
$arFilteredFields = array();
foreach ($arParams['FIELDS'] as $fieldID => $arField) {
    if (in_array($fieldID, $arResult["VISIBLE_FIELDS"])) {
        $arFilteredFields[$fieldID] = $arField;
    }
}
?>

<div id="mapp_filter_content">
	<?php 
echo CAdminMobileFilter::getHtml($arFilteredFields, isset($arParams["GET_JS"]) ? true : false);
?>
</div>

<script type="text/javascript">

	app.setPageTitle({title: "<?php 
echo GetMessage("MOBILE_APP_FILTER_TITLE");
?>
"});

	BX.message({
		MOBILE_APP_FILTER_SAVING: "<?php 
echo GetMessage("MOBILE_APP_FILTER_SAVING");
?>
"