Exemplo n.º 1
0
            </div>
        </div>
        <?php 
        CAdminFileDialog::ShowScript(array("event" => "BtnClick", "arResultDest" => array("FORM_NAME" => 'exportprofile_form', "FORM_ELEMENT_NAME" => "URL_DATA_FILE_IMPORT"), "arPath" => array("SITE" => SITE_ID, "PATH" => "/upload"), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'txt', "allowAllFiles" => true, "SaveConfig" => true));
    } else {
        $profiles = file_get_contents($_SERVER["DOCUMENT_ROOT"] . $_REQUEST['URL_DATA_FILE_IMPORT']);
        $arProfile = Bitrix\Main\Web\Json::decode($profiles);
        $cData = new CExportproProfileDB();
        foreach ($arProfile as $prof) {
            $id = $cData->Add($prof);
            switch ($prof['SETUP']['TYPE_RUN']) {
                case 'cron':
                    CExportproCron::CronRun($id, $prof['SETUP']);
                    break;
                case 'comp':
                    CExportproCron::CronRun($id, $prof['SETUP'], true);
                    break;
            }
            $message[] = "<li>[{$id}] {$prof['NAME']}</li>";
        }
        if (count($message) > 0) {
            $message = GetMessage('ACRIT_EXPORTPRO_PROFILE_LIST_EXPORTED3') . '<ul>' . implode("\r\n", $message) . '</ul>';
            CAdminMessage::ShowMessage(array("MESSAGE" => $message, "TYPE" => 'OK', 'HTML' => true));
        }
        ?>
            <br>
            <a href="/bitrix/admin/acrit_exportpro_list.php" class="adm-btn"><?php 
        echo GetMessage('ACRIT_EXPORTPRO_PROFILE_LIST');
        ?>
</a>
        <?php 
Exemplo n.º 2
0
     } else {
         $ID = $dbProfile->Add($arFields);
     }
     switch ($PROFILE['SETUP']['TYPE_RUN']) {
         //case 'agent':
         //CExportproAgent::AddAgent($ID, $PROFILE['SETUP']['DAT_START'], $PROFILE['SETUP']['PERIOD']);
         //CExportproCron::CronRun($ID, $PROFILE['SETUP'], true);
         //break;
         case 'cron':
             //CExportproAgent::DelAgent($ID);
             CExportproAgent::AddAgent($ID, $PROFILE["SETUP"]);
             //CExportproCron::CronRun( $ID, $PROFILE["SETUP"] );
             break;
         case 'comp':
             CExportproAgent::DelAgent($ID);
             CExportproCron::CronRun($ID, $PROFILE["SETUP"], true);
             break;
     }
     if ($save) {
         LocalRedirect('acrit_exportpro_list.php');
         die;
     } else {
         $query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
         parse_str($query, $arQuery);
         if (!isset($arQuery['ID']) || empty($arQuery['ID'])) {
             $arQuery['ID'] = $ID;
             LocalRedirect('acrit_exportpro_edit.php?' . http_build_query($arQuery));
             die;
         }
     }
 }