Exemple #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;
}
Exemple #2
0
 public static function SendAgent()
 {
     global $DB;
     if (!CPullOptions::GetPushStatus()) {
         return false;
     }
     $count = 0;
     $maxId = 0;
     $pushLimit = 70;
     $arPush = array();
     $sqlDate = "";
     $dbType = strtolower($DB->type);
     if ($dbType == "mysql") {
         $sqlDate = " WHERE DATE_CREATE < DATE_SUB(NOW(), INTERVAL 15 SECOND) ";
     } else {
         if ($dbType == "mssql") {
             $sqlDate = " WHERE DATE_CREATE < dateadd(SECOND, -15, getdate()) ";
         } else {
             if ($dbType == "oracle") {
                 $sqlDate = " WHERE DATE_CREATE < SYSDATE-(1/24/60/60*15) ";
             }
         }
     }
     $strSql = $DB->TopSql("SELECT ID, USER_ID, MESSAGE, PARAMS, ADVANCED_PARAMS, BADGE, APP_ID FROM b_pull_push_queue" . $sqlDate, 280);
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     while ($arRes = $dbRes->Fetch()) {
         if ($arRes['BADGE'] == '') {
             unset($arRes['BADGE']);
         }
         $arRes['PARAMS'] = $arRes['PARAMS'] ? Bitrix\Main\Web\Json::decode($arRes['PARAMS']) : "";
         if (is_array($arRes['PARAMS'])) {
             if (isset($arRes['PARAMS']['CATEGORY'])) {
                 $arRes['CATEGORY'] = $arRes['PARAMS']['CATEGORY'];
                 unset($arRes['PARAMS']['CATEGORY']);
             }
             $arRes['PARAMS'] = Bitrix\Main\Web\Json::encode($arRes['PARAMS']);
         }
         $arRes['ADVANCED_PARAMS'] = strlen($arRes['ADVANCED_PARAMS']) > 0 ? Bitrix\Main\Web\Json::decode($arRes['ADVANCED_PARAMS']) : array();
         $arPush[$count][] = $arRes;
         if ($pushLimit <= count($arPush[$count])) {
             $count++;
         }
         $maxId = $maxId < $arRes['ID'] ? $arRes['ID'] : $maxId;
     }
     if ($maxId > 0) {
         $strSql = "DELETE FROM b_pull_push_queue WHERE ID <= " . $maxId;
         $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     }
     $CPushManager = new CPushManager();
     foreach ($arPush as $arStack) {
         $CPushManager->SendMessage($arStack);
     }
     $strSql = "SELECT COUNT(ID) CNT FROM b_pull_push_queue";
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($arRes = $dbRes->Fetch()) {
         global $pPERIOD;
         if ($arRes['CNT'] > 280) {
             $pPERIOD = 10;
             return "CPushManager::SendAgent();";
         } else {
             if ($arRes['CNT'] > 0) {
                 $pPERIOD = 30;
                 return "CPushManager::SendAgent();";
             }
         }
     }
     return false;
 }
Exemple #3
0
        echo GetMessage('ACRIT_EXPORTPRO_PROFILE_LIST_PROCESS');
        ?>
">
                                </form>
                                <br><br>
                            </td>
                        </tr>
                    </table>
                </div>
            </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>';
Exemple #4
0
        }
    }
    ?>

				<div style="position: relative; padding: 25px; border: 1px solid #859f4a; border-radius: 4px; margin-top: 40px;">
					<div style="font-size: 18px; line-height: 28px; position: absolute; top: -14px; left: 14px; display: block; height: 28px; margin: 0; padding: 0; padding: 0 10px; vertical-align: middle; color: #859f4a; background: #fff; font-weight: bold;"><?php 
    echo GetMessage("BUY_SUP_TOBUY");
    ?>
</div>
					<?php 
    $ht = new Bitrix\Main\Web\HttpClient(array("socketTimeout" => 30));
    $arF = array("license_key" => $lkeySign, "lang" => LANGUAGE_ID);
    $buyUrl = "";
    if ($res = $ht->post("https://www.1c-bitrix.ru/buy_tmp/key_update.php", $arF)) {
        if ($ht->getStatus() == "200") {
            $res = Bitrix\Main\Web\Json::decode($res);
            if ($res["result"] == "ok") {
                ?>
								<div style="font-size: 16px; padding-top: 10px;"><?php 
                $lkid = $res["lkid"];
                if (count($res["toBuy"]) == 1) {
                    foreach ($res["toBuy"] as $v) {
                        echo $v["NAME"] . " &mdash; <b>" . $res["price"] . "</b>";
                    }
                } else {
                    foreach ($res["toBuy"] as $v) {
                        echo $v["NAME"];
                        if (IntVal($v["CNT"]) > 0) {
                            echo " - " . $v["CNT"] . " " . GetMessage("BUY_SUP_SHT");
                        }
                        echo "<br />";
Exemple #5
0
				}
			}
		},
		isBitrix24: <?php 
echo $arResult['IS_BITRIX24'] ? 'true' : 'false';
?>
,
		grid: bxGrid_<?php 
echo $arResult['GRID']['ID'];
?>
,
		gridGroupActionButton: 'folder-list-action-all-btn',
		gridShowTreeButton: 'folder-list-action-show-tree',
		infoPanelContainer: 'disk_info_panel',
		errors: <?php 
echo Bitrix\Main\Web\Json::encode($arResult['ERRORS_IN_GRID_ACTIONS']);
?>
,
		queryUrl: ''
	});

	BX.bind(
		BX('sort_by_column'),
		'click',
		function(){
			BX.PopupMenu.show(
				'sort_by_column_menu',
				BX('sort_by_column'),
				<?php 
echo CUtil::PhpToJSObject($jsDropdown);
?>