Exemplo n.º 1
0
function change_iblock($changeType = false)
{
    global $APPLICATION;
    global $PROFILE;
    $profile = new CExportproProfile();
    $sections = $profile->GetSections($PROFILE['IBLOCK_ID'], $PROFILE['CHECK_INCLUDE'] == 'Y');
    ob_start();
    ?>
           
    <select multiple="multiple" name="PROFILE[CATEGORY][]" class="category_select">
        <?php 
    if (!empty($sections)) {
        foreach ($sections as $depth) {
            foreach ($depth as $id => $section) {
                $sect[$id] = $section;
            }
        }
        asort($sect);
        ?>
            <?php 
        foreach ($sect as $id => $section) {
            ?>
                <?php 
            $selected = isset($PROFILE['CATEGORY']) && in_array($id, $PROFILE['CATEGORY']) ? 'selected="selected"' : '';
            ?>
                <?php 
            $selected = isset($PROFILE['CATEGORY']) && in_array($section['PARENT_1'], $PROFILE['CATEGORY']) && $changeType ? 'selected="selected"' : $selected;
            ?>
                <option value="<?php 
            echo $id;
            ?>
" <?php 
            echo $selected;
            ?>
><?php 
            echo $section['NAME'];
            ?>
</option>  
            <?php 
        }
    }
    ?>
    </select>
    <?php 
    $data = ob_get_clean();
    $APPLICATION->RestartBuffer();
    echo Bitrix\Main\Web\Json::encode(array('result' => 'ok', 'blocks' => array(array('id' => '#section_select_block', 'html' => $data))));
    die;
}
Exemplo n.º 2
0
<?php

$moduleId = 'acrit.exportpro';
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/{$moduleId}/include.php";
IncludeModuleLangFile(__FILE__);
global $ID, $PROFILE, $save, $apply, $copy;
$dbProfile = new CExportproProfileDB();
$profileUtils = new CExportproProfile();
$siteEncoding = array('utf-8' => 'utf8', 'UTF8' => 'utf8', 'UTF-8' => 'utf8', 'WINDOWS-1251' => 'cp1251', 'windows-1251' => 'cp1251', 'CP1251' => 'cp1251');
CModule::IncludeModule('catalog');
function CheckFields()
{
    global $PROFILE, $APPLICATION, $ID;
    if (intval($ID) > 0) {
        $export = new CAcritExportproExport($ID);
        if ($export->isLock()) {
            $APPLICATION->ThrowException(GetMessage('ACRIT_EXPORTPRO_EXPORT_RUN'));
            return false;
        }
    }
    $requiredFields = array('NAME', 'CODE', 'SHOPNAME', 'COMPANY', 'DOMAIN_NAME');
    foreach ($requiredFields as $field) {
        if (!$PROFILE[$field]) {
            $APPLICATION->ThrowException(GetMessage('ACRIT_EXPORTPRO_REQUIRED_FIELD_FAIL') . '"' . GetMessage('ACRIT_EXPORTPRO_STEP1_' . $field) . '"');
            return false;
        }
    }
    foreach ($PROFILE['XMLDATA'] as $id => $field) {
        if ($field['REQUIRED'] == 'Y') {
            if ($field['TYPE'] == 'field' && !$field['VALUE'] || $field['TYPE'] == 'const' && !$field['CONTVALUE_TRUE'] || $field['TYPE'] == 'none') {
Exemplo n.º 3
0
<?php

IncludeModuleLangFile(__FILE__);
if (CModule::IncludeModule('currency')) {
    $arCurrencyList = array();
    $dbRes = CCurrency::GetList($by = 'sort', $order = 'asc', LANGUAGE_ID);
    while ($arRes = $dbRes->Fetch()) {
        $arCurrencyList[$arRes['CURRENCY']] = $arRes['FULL_NAME'];
    }
} else {
    $arCurrencyList = array('RUB' => GetMessage("ACRIT_EXPORTPRO_CURRENCU_RUB"), 'USD' => GetMessage("ACRIT_EXPORTPRO_CURRENCU_USD"), 'EUR' => GetMessage("ACRIT_EXPORTPRO_CURRENCU_EUR"), 'UAH' => GetMessage("ACRIT_EXPORTPRO_CURRENCU_UAH"), 'BYR' => GetMessage("ACRIT_EXPORTPRO_CURRENCU_BYR"), 'KZT' => GetMessage("ACRIT_EXPORTPRO_CURRENCU_KZH"));
}
$convertCurrency = $arProfile['CURRENCY']['CONVERT_CURRENCY'] == 'Y' ? 'checked="checked"' : '';
$convertTable = $convertCurrency ? '' : 'display:none;';
$correctTable = $convertTable ? '' : 'display:none;';
$currencyRates = CExportproProfile::LoadCurrencyRates();
$currencyRates = array_intersect($currencyRates['CBRF'], $currencyRates['NBU'], $currencyRates['NBK'], $currencyRates['NBB']);
ksort($currencyRates);
?>
<tr align="center">
    <td colspan="2">
        <?php 
echo BeginNote();
?>
        <?php 
echo GetMessage('ACRIT_EXPORTPRO_MARKET_CURRENCY_DESCRIPTION');
?>
        <?php 
echo EndNote();
?>
    </td>
 function GetTypes()
 {
     $typeFiles = scandir(__DIR__ . $this->typeLocation);
     $typeFiles = CExportproProfile::PathFilter($typeFiles);
     foreach ($typeFiles as $file) {
         require __DIR__ . $this->typeLocation . "/" . $file;
     }
     return $profileTypes;
 }