Example #1
0
 /**
  * @param array $langId
  * @return mixed|void
  * @throws BimException
  * @internal param array $params
  */
 public function checkParams($langId)
 {
     $lang = new \CLanguage();
     if (!isset($langId) || empty($langId)) {
         throw new BimException('В параметрах не найден langId');
     }
     $this->ownerItemDbData = array();
     $langDbRes = $lang->GetList($by = "lid", $order = "desc", array('LID' => $langId));
     if ($langDbRes === false || !$langDbRes->SelectedRowsCount()) {
         throw new BimException('Не найден язык системы с id = ' . $langId);
     }
     $langData = $langDbRes->Fetch();
     $this->ownerItemDbData = $langData;
 }
Example #2
0
 /**
  * Удаление
  *
  * @param $ID
  * @return array
  * @throws BimException
  */
 public static function Delete($ID)
 {
     $obLang = new \CLanguage();
     if ($ID) {
         $dbLang = $obLang->GetList($by = "lid", $order = "desc", array('ID' => $ID));
         if ($arLang = $dbLang->Fetch()) {
             $res = $obLang->Delete($ID);
             if (!$res) {
                 throw new BimException($obLang->LAST_ERROR);
             }
         }
     } else {
         throw new BimException("Language ID is empty");
     }
 }
Example #3
0
 /**
  * Add
  * @param $arFields
  * @return bool
  * @throws \Exception
  */
 public static function Add($arFields)
 {
     if (!isset($arFields['SECTIONS']) || empty($arFields['SECTIONS'])) {
         $arFields['SECTIONS'] = 'Y';
     }
     if (!isset($arFields['IN_RSS']) || empty($arFields['IN_RSS'])) {
         $arFields['IN_RSS'] = 'N';
     }
     if (isset($arFields['SORT'])) {
         if (!is_int($arFields['SORT'])) {
             if (intval($arFields['SORT'])) {
                 $arFields['SORT'] = intval($arFields['SORT']);
             } else {
                 $arFields['SORT'] = 500;
             }
         }
     } else {
         $arFields['SORT'] = 500;
     }
     if (!isset($arFields['LANG']) || empty($arFields['LANG'])) {
         $langDefaults = array('ru' => array('NAME' => 'Название', 'SECTION_NAME' => 'Разделы', 'ELEMENT_NAME' => 'Элементы'), 'en' => array('NAME' => 'Common', 'SECTION_NAME' => 'Sections', 'ELEMENT_NAME' => 'Elements'));
         $l = \CLanguage::GetList($lby = "sort", $lorder = "asc");
         while ($arIBTLang = $l->GetNext()) {
             if (array_key_exists($arIBTLang["LID"], $langDefaults)) {
                 $arFields["LANG"][$arIBTLang["LID"]] = $langDefaults[$arIBTLang["LID"]];
             }
         }
     }
     $CIblockType = new \CIBlockType();
     if ($CIblockType->Add($arFields)) {
         return true;
     } else {
         throw new BimException($CIblockType->LAST_ERROR);
     }
 }
Example #4
0
	function __wd_check_uf_use_bp_property($iblock_id)
	{
		$iblock_id = intval($iblock_id); 
		$db_res = CUserTypeEntity::GetList(array($by=>$order), array("ENTITY_ID" => "IBLOCK_".$iblock_id."_SECTION", "FIELD_NAME" => "UF_USE_BP"));
		if (!$db_res || !($res = $db_res->GetNext()))
		{
			$arFields = Array(
				"ENTITY_ID" => "IBLOCK_".$iblock_id."_SECTION",
				"FIELD_NAME" => "UF_USE_BP",
				"USER_TYPE_ID" => "string",
				"MULTIPLE" => "N",
				"MANDATORY" => "N", 
				"SETTINGS" => array("DEFAULT_VALUE" => "Y"));
			$arFieldName = array();
			$rsLanguage = CLanguage::GetList($by, $order, array());
			while($arLanguage = $rsLanguage->Fetch()):
//				GetMessage("SONET_UF_USE_BP");
				$dir = str_replace(array("\\", "//"), "/", dirname(__FILE__)); 
				$dirs = explode("/", $dir); 
				array_pop($dirs); 
				$file = trim(implode("/", $dirs)."/lang/".$arLanguage["LID"]."/include/webdav_settings.php");
				$tmp_mess = __IncludeLang($file, true);
				$arFieldName[$arLanguage["LID"]] = (empty($tmp_mess["SONET_UF_USE_BP"]) ? "Use Business Process" : $tmp_mess["SONET_UF_USE_BP"]);
			endwhile;
			$arFields["EDIT_FORM_LABEL"] = $arFieldName;
			$obUserField  = new CUserTypeEntity;
			$obUserField->Add($arFields);
			$GLOBALS["USER_FIELD_MANAGER"]->arFieldsCache = array();
		}
	}
Example #5
0
 /**
  * Creates events for sending e-mail.
  * @return bool
  */
 public static function installEvents()
 {
     $dbEvent = \CEventMessage::GetList($b = "ID", $order = "ASC", array("EVENT_NAME" => "SALE_EBAY_ERROR"));
     if (!$dbEvent->Fetch()) {
         $langs = \CLanguage::GetList($b = "", $o = "");
         while ($lang = $langs->Fetch()) {
             $lid = $lang["LID"];
             $obEventType = new \CEventType();
             $obEventType->Add(array("EVENT_NAME" => "SALE_EBAY_ERROR", "NAME" => Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR"), "LID" => $lid, "DESCRIPTION" => "\n\t\t\t\t\t#ERROR_TYPE# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_TYPE") . "\n\t\t\t\t\t#ERROR_DETAILS# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_DETAIL") . "\n\t\t\t\t\t#EMAIL_FROM# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_FROM") . "\n\t\t\t\t\t#EMAIL_TO# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_TO") . "\n\t\t\t\t\t#BCC# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_BCC")));
             $arSites = array();
             $sites = \CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
             while ($site = $sites->Fetch()) {
                 $arSites[] = $site["LID"];
             }
             if (count($arSites) > 0) {
                 $arr = array();
                 $arr["ACTIVE"] = "Y";
                 $arr["EVENT_NAME"] = "SALE_EBAY_ERROR";
                 $arr["LID"] = $arSites;
                 $arr["EMAIL_FROM"] = "#DEFAULT_EMAIL_FROM#";
                 $arr["EMAIL_TO"] = "#EMAIL_TO#";
                 $arr["BCC"] = "#BCC#";
                 $arr["SUBJECT"] = "#SITE_NAME# " . Loc::getMessage("SALE_EBAY_EVNT_MSG_SBUJ']") . ".";
                 $arr["BODY_TYPE"] = "text";
                 $arr["MESSAGE"] = Loc::getMessage("SALE_EBAY_EVNT_MSG_INFO_SITE") . " #SITE_NAME#.\n\n" . Loc::getMessage("SALE_EBAY_EVNT_MSG") . ":\n\n" . "#ERROR_TYPE#\n\n" . "#ERROR_DETAILS#";
                 $obTemplate = new \CEventMessage();
                 $obTemplate->Add($arr);
             }
         }
     }
     return true;
 }
Example #6
0
function stemming_init($sLang = "ru")
{
    static $arStemFunc = false;
    //Init all languages
    if ($arStemFunc === false) {
        $arStemFunc = array();
        $rsLanguages = CLanguage::GetList($b = "", $o = "");
        while ($arLanguage = $rsLanguages->Fetch()) {
            stemming_init($arLanguage["LID"]);
        }
    }
    //Check if language was not used
    if ($sLang !== false && !isset($arStemFunc[$sLang])) {
        $stemming_function_suf = $sLang;
        if (!function_exists("stemming_" . $sLang)) {
            $strFileName = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . $sLang . "/search/stemming.php";
            if (file_exists($strFileName)) {
                @(include $strFileName);
            }
            if (!function_exists("stemming_" . $sLang)) {
                $strFileName = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/search/tools/" . $sLang . "/stemming.php";
                if (file_exists($strFileName)) {
                    @(include $strFileName);
                }
                if (!function_exists("stemming_" . $sLang)) {
                    $stemming_function_suf = "default";
                }
            }
        }
        $stemming_stop_function = "stemming_stop_" . $sLang;
        if (!function_exists($stemming_stop_function)) {
            $stemming_stop_function = "stemming_stop_default";
        }
        $stemming_upper_function = "stemming_upper_" . $sLang;
        if (!function_exists($stemming_upper_function)) {
            $stemming_upper_function = "stemming_upper_default";
        }
        $letters = stemming_letter_default();
        $stemming_letter_function = "stemming_letter_" . $sLang;
        if (function_exists($stemming_letter_function)) {
            $letters .= $stemming_letter_function();
        }
        $letters .= COption::GetOptionString("search", "letters");
        if (function_exists($stemming_letter_function)) {
            $abc = $stemming_letter_function();
        } else {
            $abc = "";
        }
        if (strlen($abc) <= 0) {
            $abc = stemming_letter_default();
        }
        $arStemFunc[$sLang] = array("stem" => "stemming_" . $stemming_function_suf, "stop" => $stemming_stop_function, "upper" => $stemming_upper_function, "letters" => $letters, "pcre_letters" => str_replace(array("\\", "-", "^", "]", "/"), array("\\\\", "\\-", "\\^", "\\]", "\\/"), $letters), "abc" => $abc, "pcre_abc" => str_replace(array("\\", "-", "^", "]", "/"), array("\\\\", "\\-", "\\^", "\\]", "\\/"), $abc));
    }
    if ($sLang === false) {
        return $arStemFunc;
    } else {
        return $arStemFunc[$sLang];
    }
}
Example #7
0
 protected static function getAllLangIDs()
 {
     if (self::$allLangIDs !== null) {
         return self::$allLangIDs;
     }
     self::$allLangIDs = array();
     $sort = 'sort';
     $order = 'asc';
     $langEntity = new \CLanguage();
     $dbLangs = $langEntity->GetList($sort, $order);
     while ($lang = $dbLangs->Fetch()) {
         if (isset($lang['LID'])) {
             self::$allLangIDs[] = $lang['LID'];
         }
     }
     return self::$allLangIDs;
 }
Example #8
0
 function GetLang($cur_dir = false, $cur_host = false)
 {
     global $DB, $lang, $MAIN_LANGS_CACHE, $MAIN_LANGS_ADMIN_CACHE;
     if ($cur_dir === false) {
         $cur_dir = $this->GetCurDir();
     }
     if ($cur_host === false) {
         $cur_host = $_SERVER["HTTP_HOST"];
     }
     if (strpos($cur_dir, FX_ROOT . "/admin/") === 0 || strpos($cur_dir, FX_ROOT . "/updates/") === 0 || defined("ADMIN_SECTION") && ADMIN_SECTION === true || defined("FX_PUBLIC_TOOLS") && FX_PUBLIC_TOOLS === true) {
         //if admin section
         //lang by global var
         if (strlen($lang) <= 0) {
             $lang = COption::GetOptionString("main", "admin_lid", "ru");
         }
         $R = CLanguage::GetList($o, $b, array("LID" => $lang, "ACTIVE" => "Y"));
         if ($res = $R->Fetch()) {
             $MAIN_LANGS_ADMIN_CACHE[$res["LID"]] = $res;
             return $res;
         }
         //no lang param - get default
         $R = CLanguage::GetList($by = "def", $order = "desc", array("ACTIVE" => "Y"));
         if ($res = $R->Fetch()) {
             $MAIN_LANGS_ADMIN_CACHE[$res["LID"]] = $res;
             return $res;
         }
         //core default
         return array("en", "MM/DD/YYYY", "MM/DD/YYYY HH24:MI:SS");
     } else {
         // all other sections
         $arURL = parse_url("http://" . $cur_host);
         if ($arURL["scheme"] == "" && strlen($arURL["host"]) > 0) {
             $CURR_DOMAIN = $arURL["host"];
         } else {
             $CURR_DOMAIN = $cur_host;
         }
         if (strpos($CURR_DOMAIN, ':') > 0) {
             $CURR_DOMAIN = substr($CURR_DOMAIN, 0, strpos($CURR_DOMAIN, ':'));
         }
         $CURR_DOMAIN = trim($CURR_DOMAIN, "\t\r\n .");
         $strSql = "SELECT L.*, L.LID as ID, L.LID as SITE_ID, " . "\tC.FORMAT_DATE, C.FORMAT_DATETIME, C.FORMAT_NAME, C.WEEK_START, C.CHARSET, C.DIRECTION " . "FROM b_lang L  " . "\tLEFT JOIN b_lang_domain LD ON L.LID=LD.LID AND '" . $DB->ForSql($CURR_DOMAIN, 255) . "' LIKE CONCAT('%', LD.DOMAIN) " . "\tINNER JOIN b_culture C ON C.ID=L.CULTURE_ID " . "WHERE " . "\t('" . $DB->ForSql($cur_dir) . "' LIKE CONCAT(L.DIR, '%') OR LD.LID IS NOT NULL)" . "\tAND L.ACTIVE='Y' " . "ORDER BY " . "\tIF((L.DOMAIN_LIMITED='Y' AND LD.LID IS NOT NULL) OR L.DOMAIN_LIMITED<>'Y', " . "\t\tIF('" . $DB->ForSql($cur_dir) . "' LIKE CONCAT(L.DIR, '%'), 3, 1), " . "\t\tIF('" . $DB->ForSql($cur_dir) . "' LIKE CONCAT(L.DIR, '%'), 2, 0) " . "\t) DESC, " . "\tLENGTH(L.DIR) DESC, " . "\tL.DOMAIN_LIMITED DESC, " . "\tL.SORT, " . "\tLENGTH(LD.DOMAIN) DESC ";
         $R = $DB->Query($strSql, false, "File: " . __FILE__ . " Line:" . __LINE__);
         $res = $R->Fetch();
         if ($res) {
             $MAIN_LANGS_CACHE[$res["LID"]] = $res;
             return $res;
         }
         //get default site
         $strSql = "SELECT L.*, L.LID as ID, L.LID as SITE_ID, " . "\tC.FORMAT_DATE, C.FORMAT_DATETIME, C.FORMAT_NAME, C.WEEK_START, C.CHARSET, C.DIRECTION " . "FROM b_lang L, b_culture C " . "WHERE C.ID=L.CULTURE_ID AND L.ACTIVE='Y' " . "ORDER BY L.DEF DESC, L.SORT";
         $R = $DB->Query($strSql);
         while ($res = $R->Fetch()) {
             $MAIN_LANGS_CACHE[$res["LID"]] = $res;
             return $res;
         }
     }
     return array("en", "MM/DD/YYYY", "MM/DD/YYYY HH24:MI:SS");
 }
Example #9
0
 protected static function CleanCache()
 {
     global $CACHE_MANAGER;
     $by = 'lid';
     $order = 'asc';
     $rsLangs = CLanguage::GetList($by, $order);
     while ($arLang = $rsLangs->Fetch()) {
         $CACHE_MANAGER->Clean("admin_notify_list_" . $arLang['LANGUAGE_ID']);
     }
     $CACHE_MANAGER->Clean("admin_notify_list");
 }
Example #10
0
function __cat_LoadMess($__current_file)
{
    $__current_dir = dirname($__current_file);
    $__current_file = basename($__current_file);
    $arMess = array();
    $dbLang = CLanguage::GetList($by = 'SORT', $order = 'ASC');
    while ($arLang = $dbLang->Fetch()) {
        $arMess[$arLang['LID']] = __IncludeLang($__current_dir . "/lang/" . $arLang['LID'] . '/' . $__current_file, true);
    }
    return $arMess;
}
Example #11
0
function isValidLang($lang)
{
    $rsLang = CLanguage::GetList($by = "sort", $order = "desc");
    $is_valid_lang = false;
    while ($arLang = $rsLang->Fetch()) {
        if ($lang == $arLang["LID"]) {
            $is_valid_lang = true;
            break;
        }
    }
    return $is_valid_lang;
}
 public function getLangs($filter = array())
 {
     $by = 'def';
     $order = 'desc';
     $lids = array();
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     $dbRes = \CLanguage::GetList($by, $order, $filter);
     while ($aItem = $dbRes->Fetch()) {
         $lids[] = $aItem;
     }
     return $lids;
 }
Example #13
0
function CreateForm($arForm, $arFormFields, $langFile)
{
    if (!CModule::IncludeModule("form")) {
        return false;
    }
    // set defaults
    $arFieldDefaults = array("ACTIVE" => "Y", "C_SORT" => 0, "ADDITIONAL" => "N", "TITLE_TYPE" => "text", "IN_RESULTS_TABLE" => "Y", "IN_EXCEL_TABLE" => "Y");
    foreach ($arFormFields as $key => $arField) {
        if ($arFormFields['ADDITIONAL'] == 'Y' && !is_set($arFormFields['C_SORT'])) {
            $arFormFields['C_SORT'] = 5000;
        }
        $arFieldDefaults["C_SORT"] += 100;
        $arFormFields[$key] = array_merge($arFieldDefaults, $arField);
        $arFormFields[$key]["TITLE"] = GetMessage($arField["SID"] . "_QUESTION");
    }
    $rsLanguage = CLanguage::GetList($by, $order, array());
    while ($arLanguage = $rsLanguage->Fetch()) {
        WizardServices::IncludeServiceLang($langFile, $arLanguage["LID"]);
        $arForm["arMENU"][$arLanguage["LID"]] = GetMessage(substr($arForm["SID"], 0, -3) . "_MENU_NAME");
    }
    $dbForm = CForm::GetBySID($arForm["SID"]);
    if ($dbForm->Fetch()) {
        return;
    }
    WizardServices::IncludeServiceLang("status.php");
    if ($formID = CForm::Set($arForm, false, "N")) {
        // setup form fields
        foreach ($arFormFields as $key => $arField) {
            $arField["FORM_ID"] = $formID;
            $fieldID = CFormField::Set($arField, false, "N");
        }
        if ($arTemplates = CForm::SetMailTemplate($formID)) {
            CForm::Set(array('SID' => $arForm['SID'], 'arMAIL_TEMPLATE' => $arTemplates), $formID, 'N');
        }
        $arStatuses = array(array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_NEW"), "C_SORT" => 100, "ACTIVE" => "Y", "DEFAULT_VALUE" => "Y", "CSS" => "statusgray", "arPERMISSION_VIEW" => array(0), "arPERMISSION_MOVE" => array(0), "arPERMISSION_EDIT" => array(0), "arPERMISSION_DELETE" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_RECEIVED"), "C_SORT" => 200, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusblue", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_DONE"), "C_SORT" => 300, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusgreen", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_REFUSE"), "C_SORT" => 400, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusred", "arPERMISSION_VIEW" => array(0)));
        foreach ($arStatuses as $key => $arStatus) {
            if ($STATUS_ID = CFormStatus::Set($arStatus, false, "N")) {
                if ($arStatus['DEFAULT_VALUE'] == 'N' && ($arTemplates = CFormStatus::SetMailTemplate($formID, $STATUS_ID))) {
                    foreach ($arTemplates as $TEMPLATE_ID) {
                        if (null == $em) {
                            $em = new CEventMessage();
                        }
                        $em->Update($TEMPLATE_ID, array('MESSAGE' => GetMessage('STATUS_MESSAGE')));
                    }
                    CFormStatus::Set(array('FORM_ID' => $formID, 'arMAIL_TEMPLATE' => $arTemplates), $STATUS_ID, 'N');
                }
            }
        }
    }
    return $formID;
}
Example #14
0
 public static function GetDefaultCurrencyID()
 {
     if (self::$DEFAULT_CURRENCY_ID !== '') {
         return self::$DEFAULT_CURRENCY_ID;
     }
     self::$DEFAULT_CURRENCY_ID = 'USD';
     $rsLang = CLanguage::GetByID('ru');
     if ($arLang = $rsLang->Fetch()) {
         self::$DEFAULT_CURRENCY_ID = 'RUB';
     } else {
         $rsLang = CLanguage::GetByID('de');
         if ($arLang = $rsLang->Fetch()) {
             self::$DEFAULT_CURRENCY_ID = 'EUR';
         }
     }
     return self::$DEFAULT_CURRENCY_ID;
 }
Example #15
0
 function InstallFiles()
 {
     if ($_ENV["COMPUTERNAME"] != 'BX') {
         CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/admin", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/admin", false);
         CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/images", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/images/controller", true, true);
         CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/themes", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/themes", true, true);
         CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/components", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components", True, True);
         CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/activities", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/activities", True, True);
         if (IsModuleInstalled('bizproc')) {
             CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/bizproc/templates", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/templates", true, true);
             $langs = CLanguage::GetList($b = "", $o = "");
             while ($lang = $langs->Fetch()) {
                 CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/lang/" . $lang["LID"] . "/install/bizproc/templates", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/lang/" . $lang["LID"] . "/templates", true, true);
             }
         }
     }
     return true;
 }
Example #16
0
function CheckIBlockTypeID($strIBlockTypeID, $strNewIBlockTypeID, $strNeedAdd)
{
    $arResult = false;
    $strNeedAdd = 'Y' == $strNeedAdd ? 'Y' : 'N';
    $strNewIBlockTypeID = trim($strNewIBlockTypeID);
    $strIBlockTypeID = trim($strIBlockTypeID);
    if ('Y' == $strNeedAdd) {
        $obIBlockType = new CIBlockType();
        if ('' != $strNewIBlockTypeID) {
            $rsIBlockTypes = CIBlockType::GetByID($strNewIBlockTypeID);
            if ($arIBlockType = $rsIBlockTypes->Fetch()) {
                $arResult = array('RESULT' => 'OK', 'VALUE' => $strNewIBlockTypeID);
            } else {
                $arFields = array('ID' => $strNewIBlockTypeID, 'SECTIONS' => 'N', 'IN_RSS' => 'N', 'SORT' => 500);
                $rsLanguages = CLanguage::GetList($by = "sort", $order = "desc", array('ACTIVE' => 'Y'));
                while ($arLanguage = $rsLanguages->Fetch()) {
                    $arFields['LANG'][$arLanguage['LID']]['NAME'] = $strNewIBlockTypeID;
                }
                $mxOffersType = $obIBlockType->Add($arFields);
                if (false == $mxOffersType) {
                    $arResult = array('RESULT' => 'ERROR', 'MESSAGE' => $obIBlockType->LAST_ERROR);
                } else {
                    $arResult = array('RESULT' => 'OK', 'VALUE' => $strNewIBlockTypeID);
                }
            }
        } else {
            $arResult = array('RESULT' => 'ERROR', 'MESSAGE' => GetMessage('IB_E_OF_ERR_NEW_IBLOCK_TYPE_ABSENT'));
        }
    } else {
        if ('' == $strIBlockTypeID) {
            $arResult = array('RESULT' => 'ERROR', 'MESSAGE' => GetMessage('IB_E_OF_ERR_IBLOCK_TYPE_ABSENT'));
        } else {
            $rsIBlockTypes = CIBlockType::GetByID($strIBlockTypeID);
            if (!($arIBlockType = $rsIBlockTypes->Fetch())) {
                $arResult = array('RESULT' => 'ERROR', 'MESSAGE' => GetMessage('IB_E_OF_ERR_IBLOCK_TYPE_BAD'));
            } else {
                $arResult = array('RESULT' => 'OK', 'VALUE' => $strIBlockTypeID);
            }
        }
    }
    return $arResult;
}
Example #17
0
 public function __construct($arParams)
 {
     $this->SITE_ID = $arParams["SITE_ID"];
     $this->REWRITE = $arParams["REWRITE"];
     $this->ModuleBlogGroup = '[' . $this->SITE_ID . '] ' . GetMessage("IDEA_BLOG_GROUP_NAME");
     $this->ModuleBlogUrl .= "_" . $this->SITE_ID;
     //NULL CACHE
     BXClearCache(True, '/' . $this->SITE_ID . '/idea/');
     BXClearCache(True, '/' . SITE_ID . '/idea/');
     global $CACHE_MANAGER;
     if (CACHED_b_user_field_enum !== false) {
         $CACHE_MANAGER->CleanDir("b_user_field_enum");
     }
     //Statuses List (for demo)
     $this->arResult["SETTINGS"]["STATUS"] = CIdeaManagment::getInstance()->Idea()->GetStatusList();
     foreach ($this->arResult["SETTINGS"]["STATUS"] as $arStatus) {
         $this->arResult["SETTINGS"]["STATUS_ID"][$arStatus["XML_ID"]] = $arStatus["ID"];
     }
     //Lang List
     $l = CLanguage::GetList($by = "sort", $order = "asc");
     while ($r = $l->Fetch()) {
         $this->arResult["SETTINGS"]["LANG"][] = $r;
     }
     //Sites List
     $oSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
     while ($site = $oSites->Fetch()) {
         $this->arResult["SETTINGS"]["SITE"][$site["LID"]] = array("LANGUAGE_ID" => $site["LANGUAGE_ID"], "ABS_DOC_ROOT" => $site["ABS_DOC_ROOT"], "DIR" => $site["DIR"], "SITE_ID" => $site["LID"], "SERVER_NAME" => $site["SERVER_NAME"], "NAME" => $site["NAME"]);
     }
     if (array_key_exists($this->SITE_ID, $this->arResult["SETTINGS"]["SITE"])) {
         $this->PublicDir = str_replace(array("#SITE_DIR#"), array($this->arResult["SETTINGS"]["SITE"][$this->SITE_ID]["DIR"]), $this->PublicDir);
     }
     $site = CFileMan::__CheckSite($this->SITE_ID);
     $this->DOCUMENT_ROOT = CSite::GetSiteDocRoot($site);
     $this->IO = CBXVirtualIo::GetInstance();
     //SetDefault
     $this->arResult["INSTALLATION"]["IBLOCK_TYPE_INSTALL"] = true;
     $this->arResult["INSTALLATION"]["IBLOCK_INSTALL"] = true;
     $this->arResult["INSTALLATION"]["BLOG_GROUP_INSTALL"] = true;
     $this->arResult["INSTALLATION"]["BLOG_INSTALL"] = true;
     $this->CheckParams();
 }
Example #18
0
 function __load_exchange_use_login_messages()
 {
     $arEditFormLabel1 = array();
     $dbLang1 = CLanguage::GetList($b1, $o1, array());
     while ($arLang1 = $dbLang1->Fetch()) {
         $MESS = array();
         $fn1 = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/dav/lang/" . preg_replace("/[^a-z0-9]/i", "", $arLang1["LID"]) . "/options.php";
         $fnDef1 = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/dav/lang/en/options.php";
         if (file_exists($fn1)) {
             include $fn1;
         } elseif (file_exists($fnDef1)) {
             include $fnDef1;
         }
         if (isset($MESS["DAV_EXCHANGE_USER_FIELD"])) {
             $arEditFormLabel1[$arLang1["LID"]] = $MESS["DAV_EXCHANGE_USER_FIELD"];
         } else {
             $arEditFormLabel1[$arLang1["LID"]] = "Exchange mail box";
         }
     }
     return $arEditFormLabel1;
 }
Example #19
0
function CheckIBlockType($ID, $SECTIONS = "Y")
{
    $obType = new CIBlockType();
    $rsType = $obType->GetByID($ID);
    if ($arType = $rsType->Fetch()) {
        return $arType["ID"];
    } else {
        $arFields = array("ID" => $ID, "SECTIONS" => $SECTIONS, "LANG" => array());
        $rsLanguages = CLanguage::GetList($by = "sort", $order = "asc");
        while ($arLanguage = $rsLanguages->Fetch()) {
            $MY_MESS = IncludeModuleLangFile(__FILE__, $arLanguage["LID"], true);
            $arFields["LANG"][$arLanguage["LID"]] = array("NAME" => $MY_MESS["IBLOCK_INSTALL_" . strtoupper($ID) . "_NAME"], "SECTION_NAME" => $MY_MESS["IBLOCK_INSTALL_" . strtoupper($ID) . "_SECTIONS_NAME"], "ELEMENT_NAME" => $MY_MESS["IBLOCK_INSTALL_" . strtoupper($ID) . "_ELEMENTS_NAME"]);
        }
        $result = $obType->Add($arFields);
        if ($result) {
            return $result;
        } else {
            return false;
        }
    }
}
Example #20
0
 function CheckFields($arFields)
 {
     global $APPLICATION;
     $aMsg = array();
     if (is_set($arFields, "NAME") && trim($arFields["NAME"]) == "") {
         $aMsg[] = array("id" => "NAME", "text" => GetMessage("fav_general_err_name"));
     }
     if (is_set($arFields, "URL") && trim($arFields["URL"]) == "") {
         $aMsg[] = array("id" => "URL", "text" => GetMessage("fav_general_err_url"));
     }
     if (is_set($arFields, "USER_ID")) {
         if (intval($arFields["USER_ID"]) > 0) {
             $res = CUser::GetByID(intval($arFields["USER_ID"]));
             if (!$res->Fetch()) {
                 $aMsg[] = array("id" => "USER_ID", "text" => GetMessage("fav_general_err_user"));
             }
         } elseif ($arFields["COMMON"] == "N") {
             $aMsg[] = array("id" => "USER_ID", "text" => GetMessage("fav_general_err_user1"));
         }
     }
     if (is_set($arFields, "LANGUAGE_ID")) {
         if ($arFields["LANGUAGE_ID"] != "") {
             $res = CLanguage::GetByID($arFields["LANGUAGE_ID"]);
             if (!$res->Fetch()) {
                 $aMsg[] = array("id" => "LANGUAGE_ID", "text" => GetMessage("fav_general_err_lang"));
             }
         } else {
             $aMsg[] = array("id" => "LANGUAGE_ID", "text" => GetMessage("fav_general_err_lang1"));
         }
     }
     if (!empty($aMsg)) {
         $e = new CAdminException($aMsg);
         $APPLICATION->ThrowException($e);
         return false;
     }
     return true;
 }
Example #21
0
         CCatalog::Add(array('IBLOCK_ID' => $IBLOCK_OFFERS_ID, 'PRODUCT_IBLOCK_ID' => $IBLOCK_CATALOG_ID, 'SKU_PROPERTY_ID' => $ID_SKU));
     }
     //create facet index
     $index = \Bitrix\Iblock\PropertyIndex\Manager::createIndexer($IBLOCK_CATALOG_ID);
     $index->startIndex();
     $index->continueIndex(0);
     $index->endIndex();
     $index = \Bitrix\Iblock\PropertyIndex\Manager::createIndexer($IBLOCK_OFFERS_ID);
     $index->startIndex();
     $index->continueIndex(0);
     $index->endIndex();
     \Bitrix\Iblock\PropertyIndex\Manager::checkAdminNotification();
 }
 //user fields for sections
 $arLanguages = array();
 $rsLanguage = CLanguage::GetList($by, $order, array());
 while ($arLanguage = $rsLanguage->Fetch()) {
     $arLanguages[] = $arLanguage["LID"];
 }
 $arUserFields = array("UF_BROWSER_TITLE", "UF_KEYWORDS", "UF_META_DESCRIPTION");
 foreach ($arUserFields as $userField) {
     $arLabelNames = array();
     foreach ($arLanguages as $languageID) {
         WizardServices::IncludeServiceLang("property_names.php", $languageID);
         $arLabelNames[$languageID] = GetMessage($userField);
     }
     $arProperty["EDIT_FORM_LABEL"] = $arLabelNames;
     $arProperty["LIST_COLUMN_LABEL"] = $arLabelNames;
     $arProperty["LIST_FILTER_LABEL"] = $arLabelNames;
     $dbRes = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => 'IBLOCK_' . $IBLOCK_CATALOG_ID . '_SECTION', "FIELD_NAME" => $userField));
     if ($arRes = $dbRes->Fetch()) {
Example #22
0
if (isset($arCurrentValues['USE_VOTE_RATING']) && 'Y' == $arCurrentValues['USE_VOTE_RATING']) {
    $arTemplateParameters['VOTE_DISPLAY_AS_RATING'] = array('NAME' => GetMessage('CP_BCE_TPL_VOTE_DISPLAY_AS_RATING'), 'TYPE' => 'LIST', 'VALUES' => array('rating' => GetMessage('CP_BCE_TPL_VDAR_RATING'), 'vote_avg' => GetMessage('CP_BCE_TPL_VDAR_AVERAGE')), 'DEFAULT' => 'rating');
}
$arTemplateParameters['USE_COMMENTS'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_USE_COMMENTS'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
if (isset($arCurrentValues['USE_COMMENTS']) && $arCurrentValues['USE_COMMENTS'] == 'Y') {
    if (ModuleManager::isModuleInstalled("blog")) {
        $arTemplateParameters['BLOG_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
        if (isset($arCurrentValues['BLOG_USE']) && $arCurrentValues['BLOG_USE'] == 'Y') {
            $arTemplateParameters['BLOG_URL'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_URL'), 'TYPE' => 'STRING', 'DEFAULT' => 'catalog_comments');
            $arTemplateParameters['BLOG_EMAIL_NOTIFY'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_BLOG_EMAIL_NOTIFY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N');
        }
    }
    $boolRus = false;
    $langBy = "id";
    $langOrder = "asc";
    $rsLangs = CLanguage::GetList($langBy, $langOrder, array('ID' => 'ru', "ACTIVE" => "Y"));
    if ($arLang = $rsLangs->Fetch()) {
        $boolRus = true;
    }
    if ($boolRus) {
        $arTemplateParameters['VK_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_VK_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
        if (isset($arCurrentValues['VK_USE']) && 'Y' == $arCurrentValues['VK_USE']) {
            $arTemplateParameters['VK_API_ID'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_VK_API_ID'), 'TYPE' => 'STRING', 'DEFAULT' => 'API_ID');
        }
    }
    $arTemplateParameters['FB_USE'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_FB_USE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
    if (isset($arCurrentValues['FB_USE']) && 'Y' == $arCurrentValues['FB_USE']) {
        $arTemplateParameters['FB_APP_ID'] = array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CP_BCE_TPL_FB_APP_ID'), 'TYPE' => 'STRING', 'DEFAULT' => '');
    }
}
if (ModuleManager::isModuleInstalled("highloadblock")) {
Example #23
0
					if ('Y' == $arIBlockInfo['CREATE_OFFERS_NEW_TYPE'])
					{
						$rsIBlockTypes = CIBlockType::GetByID($arIBlockInfo['OFFERS_NEW_TYPE']);
						if ($arIBlockType = $rsIBlockTypes->Fetch())
						{
							$arIBlockInfo['OFFERS_TYPE'] = $arIBlockInfo['OFFERS_NEW_TYPE'];
						}
						else
						{
							$arFields = array(
								'ID' => $arIBlockInfo['OFFERS_NEW_TYPE'],
								'SECTIONS' => 'N',
								'IN_RSS' => 'N',
								'SORT' => 500,
							);
							$rsLanguages = CLanguage::GetList($by="sort", $order="desc",array('ACTIVE' => 'Y'));
							while ($arLanguage = $rsLanguages->Fetch())
							{
								$arFields['LANG'][$arLanguage['LID']]['NAME'] = $arIBlockInfo['OFFERS_NEW_TYPE'];
							}
							$obIBlockType = new CIBlockType();
							$mxOffersType = $obIBlockType->Add($arFields);
							if (!$mxOffersType)
							{
								$boolFlag = false;
								$strWarning .= Loc::getMessage(
									'CAT_IBLOCK_OFFERS_ERR_NEW_IBLOCK_TYPE_NOT_ADD',
									array(
										'#PRODUCT#' => $arCurrentIBlocks[$intIBlockID]['INFO'],
										'#ERROR#' => $obIBlockType->LAST_ERROR
									)
Example #24
0
 /**
  * getLangData
  * @param $iblockTypeId
  * @return array
  */
 private function getLangData($iblockTypeId)
 {
     $CIblockType = new \CIBlockType();
     $lang = new \CLanguage();
     $result = array();
     $langDbRes = $lang->GetList($by = "lid", $order = "desc", array());
     while ($langData = $langDbRes->Fetch()) {
         $typeLangItemTmp = $CIblockType->GetByIDLang($iblockTypeId, $langData['LID']);
         $typeLangItem = array();
         foreach ($typeLangItemTmp as $key => $value) {
             if (strstr($key, '~')) {
                 continue;
             }
             $typeLangItem[$key] = $value;
         }
         $result[$langData['LID']] = $typeLangItem;
     }
     return $result;
 }
Example #25
0
 function __CreateUserProperty()
 {
     if ($this->attachIBlockID < 1) {
         return false;
     }
     $success = true;
     $dbRes = CUserTypeEntity::GetList(array(), array("ENTITY_ID" => "USER", "FIELD_NAME" => $this->userPropertyName));
     if (!$dbRes->Fetch()) {
         $arLabelNames = array();
         $rsLanguage = CLanguage::GetList($by, $order, array());
         while ($arLanguage = $rsLanguage->Fetch()) {
             IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/csv_user_import_labels.php", $arLanguage["LID"]);
             $arLabelNames[$arLanguage["LID"]] = GetMessage("DEPARTMENT_USER_PROPERTY_NAME");
         }
         $arFields = array('ENTITY_ID' => 'USER', 'FIELD_NAME' => $this->userPropertyName, 'USER_TYPE_ID' => 'iblock_section', 'XML_ID' => '', 'SORT' => 100, 'MULTIPLE' => 'Y', 'MANDATORY' => 'N', 'SHOW_FILTER' => 'I', 'SHOW_IN_LIST' => 'Y', 'EDIT_IN_LIST' => 'Y', 'IS_SEARCHABLE' => 'Y', 'SETTINGS' => array('DISPLAY' => 'LIST', 'LIST_HEIGHT' => '8', 'IBLOCK_ID' => $this->attachIBlockID), "EDIT_FORM_LABEL" => $arLabelNames, "LIST_COLUMN_LABEL" => $arLabelNames, "LIST_FILTER_LABEL" => $arLabelNames);
         $userType = new CUserTypeEntity();
         $success = (bool) $userType->Add($arFields);
     }
     return $success;
 }
Example #26
0
 function InstallEvents()
 {
     $arEventTypes = array();
     $langs = CLanguage::GetList($b = "", $o = "");
     while ($language = $langs->Fetch()) {
         $lid = $language["LID"];
         IncludeModuleLangFile(__FILE__, $lid);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "NEW_USER", "NAME" => GetMessage("MAIN_NEW_USER_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_NEW_USER_TYPE_DESC"), "SORT" => 1);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_INFO", "NAME" => GetMessage("MAIN_USER_INFO_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INFO_TYPE_DESC"), "SORT" => 2);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "NEW_USER_CONFIRM", "NAME" => GetMessage("MAIN_NEW_USER_CONFIRM_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_NEW_USER_CONFIRM_TYPE_DESC"), "SORT" => 3);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_PASS_REQUEST", "NAME" => GetMessage("MAIN_USER_PASS_REQUEST_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INFO_TYPE_DESC"), "SORT" => 4);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_PASS_CHANGED", "NAME" => GetMessage("MAIN_USER_PASS_CHANGED_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INFO_TYPE_DESC"), "SORT" => 5);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "USER_INVITE", "NAME" => GetMessage("MAIN_USER_INVITE_TYPE_NAME"), "DESCRIPTION" => GetMessage("MAIN_USER_INVITE_TYPE_DESC"), "SORT" => 6);
         $arEventTypes[] = array("LID" => $lid, "EVENT_NAME" => "FEEDBACK_FORM", "NAME" => GetMessage("MF_EVENT_NAME"), "DESCRIPTION" => GetMessage("MF_EVENT_DESCRIPTION"), "SORT" => 7);
     }
     $type = new CEventType();
     foreach ($arEventTypes as $arEventType) {
         $type->Add($arEventType);
     }
     IncludeModuleLangFile(__FILE__);
     $arMessages = array();
     $arMessages[] = array("EVENT_NAME" => "NEW_USER", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#DEFAULT_EMAIL_FROM#", "SUBJECT" => GetMessage("MAIN_NEW_USER_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_NEW_USER_EVENT_DESC"));
     $arMessages[] = array("EVENT_NAME" => "USER_INFO", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_INFO_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_INFO_EVENT_DESC"));
     $arMessages[] = array("EVENT_NAME" => "USER_PASS_REQUEST", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_PASS_REQUEST_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_PASS_REQUEST_EVENT_DESC"));
     $arMessages[] = array("EVENT_NAME" => "USER_PASS_CHANGED", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_PASS_CHANGED_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_PASS_CHANGED_EVENT_DESC"));
     $arMessages[] = array("EVENT_NAME" => "NEW_USER_CONFIRM", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_NEW_USER_CONFIRM_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_NEW_USER_CONFIRM_EVENT_DESC"));
     $arMessages[] = array("EVENT_NAME" => "USER_INVITE", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => GetMessage("MAIN_USER_INVITE_EVENT_NAME"), "MESSAGE" => GetMessage("MAIN_USER_INVITE_EVENT_DESC"));
     $arMessages[] = array("EVENT_NAME" => "FEEDBACK_FORM", "LID" => "s1", "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("MF_EVENT_SUBJECT"), "MESSAGE" => GetMessage("MF_EVENT_MESSAGE"));
     $message = new CEventMessage();
     foreach ($arMessages as $arMessage) {
         $message->Add($arMessage);
     }
     return true;
 }
Example #27
0
<?php

$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
    $lid = $lang["LID"];
    IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/im/install/events/set_events.php", $lid);
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "IM_NEW_NOTIFY", "NAME" => GetMessage("IM_NEW_NOTIFY_NAME"), "DESCRIPTION" => GetMessage("IM_NEW_NOTIFY_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "IM_NEW_NOTIFY_GROUP", "NAME" => GetMessage("IM_NEW_NOTIFY_GROUP_NAME"), "DESCRIPTION" => GetMessage("IM_NEW_NOTIFY_GROUP_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "IM_NEW_MESSAGE", "NAME" => GetMessage("IM_NEW_MESSAGE_NAME"), "DESCRIPTION" => GetMessage("IM_NEW_MESSAGE_DESC")));
    $et = new CEventType();
    $et->Add(array("LID" => $lid, "EVENT_NAME" => "IM_NEW_MESSAGE_GROUP", "NAME" => GetMessage("IM_NEW_MESSAGE_GROUP_NAME"), "DESCRIPTION" => GetMessage("IM_NEW_MESSAGE_GROUP_DESC")));
    $arSites = array();
    $sites = CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
    while ($site = $sites->Fetch()) {
        $arSites[] = $site["LID"];
    }
    if (count($arSites) > 0) {
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "IM_NEW_NOTIFY", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("IM_NEW_NOTIFY_SUBJECT"), "MESSAGE" => GetMessage("IM_NEW_NOTIFY_MESSAGE"), "BODY_TYPE" => "text"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "IM_NEW_NOTIFY_GROUP", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("IM_NEW_NOTIFY_GROUP_SUBJECT"), "MESSAGE" => GetMessage("IM_NEW_NOTIFY_GROUP_MESSAGE"), "BODY_TYPE" => "text"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "IM_NEW_MESSAGE", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("IM_NEW_MESSAGE_SUBJECT"), "MESSAGE" => GetMessage("IM_NEW_MESSAGE_MESSAGE"), "BODY_TYPE" => "text"));
        $emess = new CEventMessage();
        $emess->Add(array("ACTIVE" => "Y", "EVENT_NAME" => "IM_NEW_MESSAGE_GROUP", "LID" => $arSites, "EMAIL_FROM" => "#DEFAULT_EMAIL_FROM#", "EMAIL_TO" => "#EMAIL_TO#", "SUBJECT" => GetMessage("IM_NEW_MESSAGE_GROUP_SUBJECT"), "MESSAGE" => GetMessage("IM_NEW_MESSAGE_GROUP_MESSAGE"), "BODY_TYPE" => "text"));
    }
}
Example #28
0
IncludeModuleLangFile(__FILE__);
require_once $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/crm/functions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/crm/classes/general/crm_usertypecrmstatus.php';
require_once $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/crm/classes/general/crm_usertypecrm.php';
CModule::AddAutoloadClasses('crm', array('CAllCrmLead' => 'classes/general/crm_lead.php', 'CCrmLead' => 'classes/' . $DBType . '/crm_lead.php', 'CCrmLeadWS' => 'classes/general/ws_lead.php', 'CCRMLeadRest' => 'classes/general/rest_lead.php', 'CAllCrmDeal' => 'classes/general/crm_deal.php', 'CCrmDeal' => 'classes/' . $DBType . '/crm_deal.php', 'CAllCrmCompany' => 'classes/general/crm_company.php', 'CCrmCompany' => 'classes/' . $DBType . '/crm_company.php', 'CAllCrmContact' => 'classes/general/crm_contact.php', 'CCrmContact' => 'classes/' . $DBType . '/crm_contact.php', 'CCrmContactWS' => 'classes/general/ws_contact.php', 'CCrmPerms' => 'classes/general/crm_perms.php', 'CCrmRole' => 'classes/general/crm_role.php', 'CCrmFields' => 'classes/general/crm_fields.php', 'CCrmUserType' => 'classes/general/crm_usertype.php', 'CCrmGridOptions' => 'classes/general/crm_grids.php', 'CCrmStatus' => 'classes/general/crm_status.php', 'CCrmFieldMulti' => 'classes/general/crm_field_multi.php', 'CCrmEvent' => 'classes/general/crm_event.php', 'CCrmEMail' => 'classes/general/crm_email.php', 'CCrmVCard' => 'classes/general/crm_vcard.php', 'CCrmActivityTask' => 'classes/general/crm_activity_task.php', 'CCrmActivityCalendar' => 'classes/general/crm_activity_calendar.php', 'CUserTypeCrm' => 'classes/general/crm_usertypecrm.php', 'CUserTypeCrmStatus' => 'classes/general/crm_usertypecrmstatus.php', 'CCrmSearch' => 'classes/general/crm_search.php', 'CCrmBizProc' => 'classes/general/crm_bizproc.php', 'CCrmDocument' => 'classes/general/crm_document.php', 'CCrmDocumentLead' => 'classes/general/crm_document_lead.php', 'CCrmDocumentContact' => 'classes/general/crm_document_contact.php', 'CCrmDocumentCompany' => 'classes/general/crm_document_company.php', 'CCrmDocumentDeal' => 'classes/general/crm_document_deal.php', 'CCrmReportHelper' => 'classes/general/crm_report_helper.php', 'Bitrix\\Crm\\StatusTable' => 'lib/status.php', 'Bitrix\\Crm\\EventTable' => 'lib/event.php', 'Bitrix\\Crm\\EventRelationsTable' => 'lib/event.php', 'Bitrix\\Crm\\DealTable' => 'lib/deal.php', 'Bitrix\\Crm\\LeadTable' => 'lib/lead.php', 'Bitrix\\Crm\\ContactTable' => 'lib/contact.php', 'Bitrix\\Crm\\CompanyTable' => 'lib/company.php', '\\Bitrix\\Crm\\StatusTable' => 'lib/status.php', '\\Bitrix\\Crm\\EventTable' => 'lib/event.php', '\\Bitrix\\Crm\\EventRelationsTable' => 'lib/event.php', '\\Bitrix\\Crm\\DealTable' => 'lib/deal.php', '\\Bitrix\\Crm\\LeadTable' => 'lib/lead.php', '\\Bitrix\\Crm\\ContactTable' => 'lib/contact.php', '\\Bitrix\\Crm\\CompanyTable' => 'lib/company.php', 'CCrmExternalSale' => 'classes/general/crm_external_sale.php', 'CCrmExternalSaleProxy' => 'classes/general/crm_external_sale_proxy.php', 'CCrmExternalSaleImport' => 'classes/general/crm_external_sale_import.php', 'CCrmUtils' => 'classes/general/crm_utils.php', 'CCrmEntityHelper' => 'classes/general/entity_helper.php', 'CAllCrmCatalog' => 'classes/general/crm_catalog.php', 'CCrmCatalog' => 'classes/' . $DBType . '/crm_catalog.php', 'CCrmCurrency' => 'classes/general/crm_currency.php', 'CCrmCurrencyHelper' => 'classes/general/crm_currency_helper.php', 'CCrmProductResult' => 'classes/general/crm_product_result.php', 'CCrmProduct' => 'classes/general/crm_product.php', 'CCrmProductHelper' => 'classes/general/crm_product_helper.php', 'CAllCrmProductRow' => 'classes/general/crm_product_row.php', 'CCrmProductRow' => 'classes/' . $DBType . '/crm_product_row.php', 'CAllCrmInvoice' => 'classes/general/crm_invoice.php', 'CCrmInvoice' => 'classes/' . $DBType . '/crm_invoice.php', 'CAllCrmQuote' => 'classes/general/crm_quote.php', 'CCrmQuote' => 'classes/' . $DBType . '/crm_quote.php', 'CCrmOwnerType' => 'classes/general/crm_owner_type.php', 'CCrmOwnerTypeAbbr' => 'classes/general/crm_owner_type.php', 'Bitrix\\Crm\\ProductTable' => 'lib/product.php', 'Bitrix\\Crm\\ProductRowTable' => 'lib/productrow.php', 'Bitrix\\Crm\\IBlockElementProxyTable' => 'lib/iblockelementproxy.php', 'Bitrix\\Crm\\IBlockElementGrcProxyTable' => 'lib/iblockelementproxy.php', '\\Bitrix\\Crm\\ProductTable' => 'lib/product.php', '\\Bitrix\\Crm\\ProductRowTable' => 'lib/productrow.php', '\\Bitrix\\Crm\\IBlockElementProxyTable' => 'lib/iblockelementproxy.php', '\\Bitrix\\Crm\\IBlockElementGrcProxyTable' => 'lib/iblockelementproxy.php', 'CCrmAccountingHelper' => 'classes/general/crm_accounting_helper.php', 'Bitrix\\Crm\\ExternalSaleTable' => 'lib/externalsale.php', '\\Bitrix\\Crm\\ExternalSaleTable' => 'lib/externalsale.php', 'CCrmExternalSaleHelper' => 'classes/general/crm_external_sale_helper.php', 'CCrmEntityListBuilder' => 'classes/general/crm_entity_list_builder.php', 'CCrmComponentHelper' => 'classes/general/crm_component_helper.php', 'CCrmInstantEditorHelper' => 'classes/general/crm_component_helper.php', 'CAllCrmActivity' => 'classes/general/crm_activity.php', 'CCrmActivity' => 'classes/' . $DBType . '/crm_activity.php', 'CCrmActivityType' => 'classes/general/crm_activity.php', 'CCrmActivityStatus' => 'classes/general/crm_activity.php', 'CCrmActivityPriority' => 'classes/general/crm_activity.php', 'CCrmActivityNotifyType' => 'classes/general/crm_activity.php', 'CCrmActivityStorageType' => 'classes/general/crm_activity.php', 'CCrmContentType' => 'classes/general/crm_activity.php', 'CCrmEnumeration' => 'classes/general/crm_enumeration.php', 'CCrmEntitySelectorHelper' => 'classes/general/crm_entity_selector_helper.php', 'CCrmBizProcHelper' => 'classes/general/crm_bizproc_helper.php', 'CCrmBizProcEventType' => 'classes/general/crm_bizproc_helper.php', 'CCrmUrlUtil' => 'classes/general/crm_url_util.php', 'CCrmAuthorizationHelper' => 'classes/general/crm_authorization_helper.php', 'CCrmWebDavHelper' => 'classes/general/crm_webdav_helper.php', 'CCrmActivityDirection' => 'classes/general/crm_activity.php', 'CCrmViewHelper' => 'classes/general/crm_view_helper.php', 'CCrmSecurityHelper' => 'classes/general/crm_security_helper.php', 'CCrmMailHelper' => 'classes/general/crm_mail_helper.php', 'CCrmNotifier' => 'classes/general/crm_notifier.php', 'CCrmNotifierSchemeType' => 'classes/general/crm_notifier.php', 'CCrmActivityConverter' => 'classes/general/crm_activity_converter.php', 'CCrmDateTimeHelper' => 'classes/general/datetime_helper.php', 'CCrmEMailCodeAllocation' => 'classes/general/crm_email.php', 'CCrmActivityCalendarSettings' => 'classes/general/crm_activity.php', 'CCrmActivityCalendarSettings' => 'classes/general/crm_activity.php', 'CCrmProductReportHelper' => 'classes/general/crm_report_helper.php', 'CCrmReportManager' => 'classes/general/crm_report_helper.php', 'CCrmCallToUrl' => 'classes/general/crm_url_util.php', 'CCrmUrlTemplate' => 'classes/general/crm_url_util.php', 'CCrmFileProxy' => 'classes/general/file_proxy.php', 'CAllCrmMailTemplate' => 'classes/general/mail_template.php', 'CCrmMailTemplate' => 'classes/' . $DBType . '/mail_template.php', 'CCrmMailTemplateScope' => 'classes/general/mail_template.php', 'CCrmTemplateAdapter' => 'classes/general/template_adapter.php', 'CCrmTemplateMapper' => 'classes/general/template_mapper.php', 'CCrmTemplateManager' => 'classes/general/template_manager.php', 'CCrmGridContext' => 'classes/general/crm_grids.php', 'CCrmUserCounter' => 'classes/general/user_counter.php', 'CCrmUserCounterSettings' => 'classes/general/user_counter.php', 'CCrmMobileHelper' => 'classes/general/mobile_helper.php', 'CCrmStatusInvoice' => 'classes/general/crm_status_invoice.php', 'CCrmTax' => 'classes/general/crm_tax.php', 'CCrmVat' => 'classes/general/crm_vat.php', 'CCrmLocations' => 'classes/general/crm_locations.php', 'CCrmPaySystem' => 'classes/general/crm_pay_system.php', 'CCrmRestService' => 'classes/general/restservice.php', 'CCrmFieldInfo' => 'classes/general/field_info.php', 'CCrmFieldInfoAttr' => 'classes/general/field_info.php', 'CCrmActivityEmailSender' => 'classes/general/crm_activity.php', 'CCrmProductSection' => 'classes/general/crm_product_section.php', 'CCrmProductSectionDbResult' => 'classes/general/crm_product_section.php', 'CCrmActivityDbResult' => 'classes/general/crm_activity.php', 'CCrmInvoiceRestService' => 'classes/general/restservice_invoice.php', 'CCrmInvoiceEvent' => 'classes/general/crm_invoice_event.php', 'CCrmInvoiceEventFormat' => 'classes/general/crm_invoice_event.php', 'CCrmLeadReportHelper' => 'classes/general/crm_report_helper.php', 'CCrmInvoiceReportHelper' => 'classes/general/crm_report_helper.php', 'CCrmActivityReportHelper' => 'classes/general/crm_report_helper.php', 'CCrmLiveFeed' => 'classes/general/livefeed.php', 'CCrmLiveFeedMessageRestProxy' => 'classes/general/restservice.php', 'CCrmLiveFeedEntity' => 'classes/general/livefeed.php', 'CCrmLiveFeedEvent' => 'classes/general/livefeed.php', 'CCrmLiveFeedFilter' => 'classes/general/livefeed.php', 'CCrmLiveFeedComponent' => 'classes/general/livefeed.php', 'CAllCrmSonetRelation' => 'classes/general/sonet_relation.php', 'CCrmSonetRelationType' => 'classes/general/sonet_relation.php', 'CCrmSonetRelation' => 'classes/' . $DBType . '/sonet_relation.php', 'CAllCrmSonetSubscription' => 'classes/general/sonet_subscription.php', 'CCrmSonetSubscriptionType' => 'classes/general/sonet_subscription.php', 'CCrmSonetSubscription' => 'classes/' . $DBType . '/sonet_subscription.php', 'CCrmSipHelper' => 'classes/general/sip_helper.php', 'CCrmSaleHelper' => 'classes/general/sale_helper.php', 'CCrmProductFile' => 'classes/general/crm_product_file.php', 'CCrmProductFileControl' => 'classes/general/crm_product_file.php', 'CCrmProductPropsHelper' => 'classes/general/crm_productprops_helper.php', 'CCrmProductSectionHelper' => 'classes/general/crm_product_section_helper.php', '\\Bitrix\\Crm\\Honorific' => 'lib/honorific.php', '\\Bitrix\\Crm\\Conversion\\LeadConverter' => 'lib/conversion/leadconverter.php', '\\Bitrix\\Crm\\Conversion\\EntityConversionConfigItem' => 'lib/conversion/entityconversionconfigitem.php', '\\Bitrix\\Crm\\Conversion\\EntityConversionMapItem' => 'lib/conversion/entityconversionmapitem.php', '\\Bitrix\\Crm\\Conversion\\EntityConversionMap' => 'lib/conversion/entityconversionmap.php', '\\Bitrix\\Crm\\Conversion\\LeadConversionMapper' => 'lib/conversion/leadconversionmapper.php', '\\Bitrix\\Crm\\Conversion\\LeadConversionWizard' => 'lib/conversion/leadconversionwizard.php', '\\Bitrix\\Crm\\Conversion\\LeadConversionPhase' => 'lib/conversion/leadconversionphase.php', '\\Bitrix\\Crm\\Conversion\\LeadConversionConfig' => 'lib/conversion/leadconversionconfig.php', '\\Bitrix\\Crm\\Conversion\\LeadConversionScheme' => 'lib/conversion/leadconversionscheme.php', '\\Bitrix\\Crm\\Conversion\\DealConversionConfig' => 'lib/conversion/dealconversionconfig.php', '\\Bitrix\\Crm\\Conversion\\DealConversionScheme' => 'lib/conversion/dealconversionscheme.php', '\\Bitrix\\Crm\\Conversion\\EntityConversionFileViewer' => 'lib/conversion/entityconversionfileviewer.php', '\\Bitrix\\Crm\\Conversion\\Entity\\EntityConversionMapTable' => 'lib/conversion/entity/entityconversionmap.php', '\\Bitrix\\Crm\\Conversion\\ConversionWizardStep' => 'lib/conversion/conversionwizardstep.php', '\\Bitrix\\Crm\\Conversion\\ConversionWizard' => 'lib/conversion/conversionwizard.php', '\\Bitrix\\Crm\\Synchronization\\UserFieldSynchronizer' => 'lib/synchronization/userfieldsynchronizer.php', '\\Bitrix\\Crm\\Synchronization\\UserFieldSynchronizationException' => 'lib/synchronization/userfieldsynchronizationexception.php', '\\Bitrix\\Crm\\UserField\\UserFieldHistory' => 'lib/userfield/userfieldhistory.php', '\\Bitrix\\Crm\\UserField\\FileViewer' => 'lib/userfield/fileviewer.php', '\\Bitrix\\Crm\\Restriction\\ClientRestriction' => 'lib/restriction/clientrestriction.php', '\\Bitrix\\Crm\\Restriction\\ClientRestrictionManager' => 'lib/restriction/clientrestrictionmanager.php', '\\Bitrix\\Crm\\Restriction\\SelectRestriction' => 'lib/restriction/selectrestriction.php'));
CModule::AddAutoloadClasses('', array('CAdminCalendar' => BX_ROOT . '/modules/main/interface/admin_lib.php'));
//Disable data initialization under agent context
if (CCrmSecurityHelper::GetCurrentUserID() > 0) {
    // Convert LEAD & DEAL PRODUCT  -->
    if (COption::GetOptionString('crm', '~crm_11_0_6_convertion', 'N') !== 'Y') {
        $baseCurrencyID = "USD";
        $rsLang = CLanguage::GetByID("ru");
        if ($arLang = $rsLang->Fetch()) {
            $baseCurrencyID = "RUB";
        } else {
            $rsLang = CLanguage::GetByID("de");
            if ($arLang = $rsLang->Fetch()) {
                $baseCurrencyID = "EUR";
            }
        }
        $arProducts = CCrmStatus::GetStatusList('PRODUCT', true);
        foreach ($arProducts as $prodCode => $prodName) {
            CCrmProduct::Add(array('NAME' => $prodName, 'ACTIVE' => 'Y', 'CURRENCY_ID' => $baseCurrencyID, 'PRICE' => 1, 'ORIGIN_ID' => 'CRM_PROD_' . $prodCode, 'ORIGINATOR_ID' => 'CRM_PRODUCT_REFERENCE'));
        }
        $rsDeals = CCrmDeal::GetListEx(array('ID' => 'ASC'), array("CHECK_PERMISSIONS" => "N"), false, false, array('ID', 'PRODUCT_ID', 'OPPORTUNITY', 'CURRENCY_ID'));
        while ($arDeal = $rsDeals->Fetch()) {
            $ID = isset($arDeal['ID']) ? intval($arDeal['ID']) : 0;
            if ($ID <= 0) {
                continue;
            }
            $productID = isset($arDeal['PRODUCT_ID']) ? $arDeal['PRODUCT_ID'] : '';
Example #29
0
            }
        }
        if (isset($arIBlock['FIELDS']['SECTION_CODE']['DEFAULT_VALUE'])) {
            if ('Y' == $arIBlock['FIELDS']['SECTION_CODE']['DEFAULT_VALUE']['TRANSLITERATION'] && 'Y' == $arIBlock['FIELDS']['SECTION_CODE']['DEFAULT_VALUE']['USE_GOOGLE']) {
                $boolOutTranslit = true;
            }
        }
        if ($boolOutTranslit) {
            $USE_TRANSLIT = 'N';
            $strImportErrorMessage .= GetMessage("CATI_USE_CODE_TRANSLIT_OUT") . "<br>";
        }
    }
    if ('Y' == $USE_TRANSLIT) {
        $TRANSLIT_LANG = isset($TRANSLIT_LANG) ? strval($TRANSLIT_LANG) : '';
        if (!empty($TRANSLIT_LANG)) {
            $rsTransLangs = CLanguage::GetByID($TRANSLIT_LANG);
            if (!($arTransLang = $rsTransLangs->Fetch())) {
                $TRANSLIT_LANG = '';
            }
        }
        if (empty($TRANSLIT_LANG)) {
            $USE_TRANSLIT = 'N';
            $strImportErrorMessage .= GetMessage("CATI_CODE_TRANSLIT_LANG_ERR") . "<br>";
        }
    }
}
$IMAGE_RESIZE = isset($IMAGE_RESIZE) && 'Y' == $IMAGE_RESIZE ? 'Y' : 'N';
$CLEAR_EMPTY_PRICE = isset($CLEAR_EMPTY_PRICE) && 'Y' == $CLEAR_EMPTY_PRICE ? 'Y' : 'N';
$CML2_LINK_IS_XML = isset($CML2_LINK_IS_XML) && 'Y' == $CML2_LINK_IS_XML ? 'Y' : 'N';
if (empty($arSku)) {
    $CML2_LINK_IS_XML = 'N';
Example #30
0
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
IncludeModuleLangFile(__FILE__);
$forumPermissions = $APPLICATION->GetGroupRight("forum");
if ($forumPermissions == "D") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/forum/prolog.php";
/********************************************************************
				Input params
********************************************************************/
/***************** BASE ********************************************/
$ID = intVal($ID);
$arError = $arSmile = $arFields = $arLang = array();
$arLangTitle = array("reference_id" => array(), "reference" => array());
$db_res = CLanguage::GetList($b = "sort", $o = "asc");
while ($res = $db_res->Fetch()) {
    $arLang[$res["LID"]] = $res;
    $arLangTitle["reference_id"][] = $res["LID"];
    $arLangTitle["reference"][] = htmlspecialcharsbx($res["NAME"]);
}
$bInitVars = false;
/********************************************************************
				/Input params
********************************************************************/
$APPLICATION->SetTitle($ID > 0 ? GetMessage("FORUM_EDIT_RECORD", array("#ID#" => $ID)) : GetMessage("FORUM_NEW_RECORD"));
/********************************************************************
				Action
********************************************************************/
$fileName = '';
if ($REQUEST_METHOD == "POST" && $forumPermissions >= "W" && (strlen($save) > 0 || strlen($apply) > 0)) {