Пример #1
0
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML(WIZARD_SERVICE_RELATIVE_PATH . "/xml/" . LANGUAGE_ID . "/vacancy.xml", "vacancy_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("office", "department");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_property_id"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_property_id"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_VACANCY_TAB1") . $office_property_id . GetMessage("W_IB_VACANCY_TAB2") . $department_property_id . GetMessage("W_IB_VACANCY_TAB3")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'html'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => GetMessage("W_IB_VACANCY_TEXT")), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
Пример #2
0
$iblockCode = "idea_" . WIZARD_SITE_ID;
$iblockType = "services";
$rsIBlock = CIBlock::GetList(array(), array("CODE" => $iblockCode, "TYPE" => $iblockType));
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, 'idea', $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    //Iblock Section form settings
    $aFormOptions = array('tabs' => "edit1--#--" . GetMessage("IDEA_CATEGORY_EDIT_FORM_TAB_TITLE") . "--,--ID--#--ID--,--ACTIVE--#--" . GetMessage("IDEA_CATEGORY_EDIT_FORM_P_ACTIVE") . "--,--NAME--#--" . GetMessage("IDEA_CATEGORY_EDIT_FORM_P_NAME") . "--,--CODE--#--" . GetMessage("IDEA_CATEGORY_EDIT_FORM_P_CODE") . "--,--IBLOCK_SECTION_ID--#--" . GetMessage("IDEA_CATEGORY_EDIT_FORM_P_IBLOCK_SECTION_ID") . "--,--SORT--#--" . GetMessage("IDEA_CATEGORY_EDIT_FORM_P_SORT") . "--;--");
    WizardServices::SetUserOption("form", "form_section_" . $iblockID, $aFormOptions, $common = true);
    WizardServices::SetIBlockFormSettings($iblockID, $aFormOptions);
    //IBlock fields settings
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array("SECTION_CODE" => array("IS_REQUIRED" => "Y", "DEFAULT_VALUE" => array("UNIQUE" => "Y", "TRANSLITERATION" => "Y", "TRANS_LEN" => 50, "TRANS_CASE" => "L", "TRANS_SPACE" => "_", "TRANS_OTHER" => "_", "TRANS_EAT" => "Y", "USE_GOOGLE" => "Y"))), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
Пример #3
0
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "master_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_SUPPORT_GROUP => "X"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("type", "values");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_property_id"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_property_id"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_MASTER_TAB1") . $type_property_id . GetMessage("W_IB_MASTER_TAB2") . $values_property_id . GetMessage("W_IB_MASTER_TAB3")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
Пример #4
0
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "sales_files_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "D", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_DIRECTION_GROUP => "W", WIZARD_MARKETING_AND_SALES_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("FILE");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_SALES_FILES_TAB1") . $FILE_PROPERTY_ID . GetMessage("W_IB_SALES_FILES_TAB2")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "BIZPROC" => "N", "WORKFLOW" => "N", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode, "RIGHTS_MODE" => "E", "GROUP_ID" => CIBlock::GetGroupPermissions($iblockID));
    $iblock->Update($iblockID, $arFields);
    if (CModule::IncludeModule("bizproc") && false) {
        $documentType = array("webdav", "CIBlockDocumentWebdav", "iblock_" . $iblockID);
        if (!function_exists("__wd_replace_user_and_groups")) {
            function __wd_replace_user_and_groups(&$val, $key)
            {
                if ($key == "MailText") {
                    $val = str_replace("/company/personal/bizproc/{=Workflow:id}/", "/docs/sale/webdav_bizproc_view/{=Document:ID}/", $val);
                }
                return true;
            }
        }
Пример #5
0
                if (strlen(trim($userName)) > 0) {
                    $arFields["NAME"] = $userName;
                }
            }
        }
        $ibSection->Update($arSection["ID"], $arFields);
    }
    $arProperties = array("APPROVE_ELEMENT", "REAL_PICTURE", "PUBLIC_ELEMENT", "FORUM_TOPIC_ID", "FORUM_MESSAGE_CNT", "vote_count", "vote_sum", "rating");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_USER_PHOTOG_TAB1") . $REAL_PICTURE_PROPERTY_ID . GetMessage("W_IB_USER_PHOTOG_TAB2") . $rating_PROPERTY_ID . GetMessage("W_IB_USER_PHOTOG_TAB3") . $vote_count_PROPERTY_ID . GetMessage("W_IB_USER_PHOTOG_TAB4") . $vote_sum_PROPERTY_ID . GetMessage("W_IB_USER_PHOTOG_TAB5") . $APPROVE_ELEMENT_PROPERTY_ID . GetMessage("W_IB_USER_PHOTOG_TAB6") . $PUBLIC_ELEMENT_PROPERTY_ID . GetMessage("W_IB_USER_PHOTOG_TAB7")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "INDEX_ELEMENT" => "N", "INDEX_SECTION" => "N", "CODE" => $iblockCode, "XML_ID" => $iblockCode, "NAME" => "[" . WIZARD_SITE_ID . "] " . $iblock->GetArrayByID($iblockID, "NAME"));
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
Пример #6
0
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false && WIZARD_SITE_ID == "s1") {
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "faq", "TYPE" => $iblockType));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $iblockID = $arIBlock["ID"];
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "faq_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_FAQ_TAB1")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
Пример #7
0
$iblockID = false;
if ($arIBlock = $rsIBlock->Fetch()) {
    $iblockID = $arIBlock["ID"];
}
if ($iblockID == false && WIZARD_SITE_ID == "s1") {
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "clients", "TYPE" => $iblockType));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $iblockID = $arIBlock["ID"];
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "clients_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X"));
    if ($iblockID < 1) {
        return;
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_CLIENTS_TAB1", array("PROPERTY_PERSON" => "PROPERTY_" . $PERSON_PROPERTY_ID, "PROPERTY_PHONE" => "PROPERTY_" . $PHONE_PROPERTY_ID))));
    $arProperties = array("PERSON", "PHONE");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
    $obIBlock = new CIBlock();
    $obIBlock->Update($iblockID, array("BIZPROC" => "Y", "CODE" => $iblockCode, "XML_ID" => $iblockCode));
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
Пример #8
0
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "board_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X"));
    if ($iblockID < 1) {
        return;
    }
    $arProperties = array("E_MAIL", "URL", "PHONE", "USER_ID");
    foreach ($arProperties as $propertyName) {
        ${$propertyName . "_PROPERTY_ID"} = 0;
        $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => $propertyName));
        if ($arProperty = $properties->Fetch()) {
            ${$propertyName . "_PROPERTY_ID"} = $arProperty["ID"];
        }
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_BOARD_TAB1") . $E_MAIL_PROPERTY_ID . '--#--  E-mail--,--PROPERTY_' . $URL_PROPERTY_ID . GetMessage("W_IB_BOARD_TAB2") . $PHONE_PROPERTY_ID . GetMessage("W_IB_BOARD_TAB3") . $USER_ID_PROPERTY_ID . GetMessage("W_IB_BOARD_TAB4")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '=today'), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'N', 'WIDTH' => '', 'HEIGHT' => '', 'IGNORE_ERRORS' => 'N')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }
Пример #9
0
    $rsIBlock = CIBlock::GetList(array(), array("CODE" => "official_news", "TYPE" => $iblockType));
    if ($arIBlock = $rsIBlock->Fetch()) {
        $iblockID = $arIBlock["ID"];
    }
}
if ($iblockID == false) {
    $iblockID = WizardServices::ImportIBlockFromXML($iblockXMLFile, "official_news_temp", $iblockType, WIZARD_SITE_ID, $permissions = array("1" => "X", "2" => "R", WIZARD_PORTAL_ADMINISTRATION_GROUP => "X", WIZARD_PERSONNEL_DEPARTMENT_GROUP => "W"));
    if ($iblockID < 1) {
        return;
    }
    $typePropertyID = 0;
    $properties = CIBlockProperty::GetList(array(), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockID, "CODE" => "DOC_TYPE"));
    if ($arProperty = $properties->Fetch()) {
        $typePropertyID = $arProperty["ID"];
    }
    WizardServices::SetIBlockFormSettings($iblockID, array('tabs' => GetMessage("W_IB_OFFICIAL_NEWS_TAB1") . $typePropertyID . GetMessage("W_IB_OFFICIAL_NEWS_TAB2")));
    //IBlock fields
    $iblock = new CIBlock();
    $arFields = array("ACTIVE" => "Y", "FIELDS" => array('LOG_SECTION_ADD' => array('IS_REQUIRED' => "Y"), 'LOG_SECTION_EDIT' => array('IS_REQUIRED' => "Y"), 'LOG_SECTION_DELETE' => array('IS_REQUIRED' => "Y"), 'LOG_ELEMENT_ADD' => array('IS_REQUIRED' => "Y"), 'LOG_ELEMENT_EDIT' => array('IS_REQUIRED' => "Y"), 'LOG_ELEMENT_DELETE' => array('IS_REQUIRED' => "Y"), 'IBLOCK_SECTION' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'ACTIVE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'Y'), 'ACTIVE_FROM' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '=today'), 'ACTIVE_TO' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'SORT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'NAME' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => ''), 'PREVIEW_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('FROM_DETAIL' => 'N', 'SCALE' => 'N', 'WIDTH' => 50, 'HEIGHT' => 50, 'IGNORE_ERRORS' => 'N')), 'PREVIEW_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'text'), 'PREVIEW_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'DETAIL_PICTURE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => array('SCALE' => 'Y', 'WIDTH' => 300, 'HEIGHT' => 300, 'IGNORE_ERRORS' => 'Y')), 'DETAIL_TEXT_TYPE' => array('IS_REQUIRED' => 'Y', 'DEFAULT_VALUE' => 'html'), 'DETAIL_TEXT' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'XML_ID' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'CODE' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => ''), 'TAGS' => array('IS_REQUIRED' => 'N', 'DEFAULT_VALUE' => '')), "CODE" => $iblockCode, "XML_ID" => $iblockCode);
    $iblock->Update($iblockID, $arFields);
} else {
    $arSites = array();
    $db_res = CIBlock::GetSite($iblockID);
    while ($res = $db_res->Fetch()) {
        $arSites[] = $res["LID"];
    }
    if (!in_array(WIZARD_SITE_ID, $arSites)) {
        $arSites[] = WIZARD_SITE_ID;
        $iblock = new CIBlock();
        $iblock->Update($iblockID, array("LID" => $arSites));
    }