Beispiel #1
0
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') {
                $APPLICATION->ThrowException(GetMessage('ACRIT_EXPORTPRO_REQUIRED_FIELD_FAIL', array('#CODE#' => $field['CODE'], '#NAME#' => $field['NAME'])));
                return false;
            }
        }
    }
    return true;
}
 public static function StartExport($profileId)
 {
     $export = new CAcritExportproExport(intval($profileId));
     $export->Export("cron");
 }
<?php

require_once dirname(__DIR__) . "/classes/general/threads.php";
set_time_limit(0);
if ($params = Threads::getParams()) {
    $_SERVER["DOCUMENT_ROOT"] = $DOCUMENT_ROOT = $params["documentRoot"];
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
    Cmodule::IncludeModule("acrit.exportpro");
    $export = new CAcritExportproExport(intval($params["profileId"]));
    $export->Export("cron", $params["cronPage"]);
}
<?php

require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php";
global $ID;
$ID = intval($ID);
$moduleId = 'acrit.exportpro';
$POST_RIGHT = $APPLICATION->GetGroupRight($moduleId);
if ($POST_RIGHT >= 'R') {
    CModule::IncludeModule($moduleId);
    $acritExport = new CAcritExportproExport($ID);
    $acritExport->Export();
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php";