Пример #1
0
 public static function getMap()
 {
     IncludeModuleLangFile(__FILE__);
     $sqlHelper = Application::getConnection()->getSqlHelper();
     $fieldsMap = array('ID' => array('data_type' => 'integer', 'primary' => true, 'autocomplete' => true), 'NAME' => array('data_type' => 'string', 'required' => true, 'validation' => array(__CLASS__, 'validateName')), 'TABLE_NAME' => array('data_type' => 'string', 'required' => true, 'validation' => array(__CLASS__, 'validateTableName')), 'FIELDS_COUNT' => array('data_type' => 'integer', 'expression' => array('(SELECT COUNT(ID) FROM b_user_field WHERE b_user_field.ENTITY_ID = ' . $sqlHelper->getConcatFunction("'HLBLOCK_'", 'CAST(%s as char)') . ')', 'ID')));
     return $fieldsMap;
 }
Пример #2
0
    public static function Show()
    {
        IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/interface/prolog_main_admin.php');
        $supportFinishDate = COption::GetOptionString('main', '~support_finish_date', '');
        if ($supportFinishDate != '' && is_array($aSupportFinishDate = ParseDate($supportFinishDate, 'ymd'))) {
            $aGlobalOpt = CUserOptions::GetOption("global", "settings", array());
            if ($aGlobalOpt['messages']['support'] != 'N') {
                $supportFinishStamp = mktime(0, 0, 0, $aSupportFinishDate[1], $aSupportFinishDate[0], $aSupportFinishDate[2]);
                $supportDateDiff = ceil(($supportFinishStamp - time()) / 86400);
                $sSupportMess = '';
                $sSupWIT = " (<span onclick=\"BX.toggle(BX('supdescr'))\" style='border-bottom: 1px dashed #1c91e7; color: #1c91e7; cursor: pointer;'>" . GetMessage("prolog_main_support_wit") . "</span>)";
                if ($supportDateDiff >= 0 && $supportDateDiff <= 30) {
                    $sSupportMess = GetMessage("prolog_main_support11", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => $supportDateDiff == 0 ? GetMessage("prolog_main_today") : GetMessage('prolog_main_support_days', array('#N_DAYS_AGO#' => $supportDateDiff)), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
                } elseif ($supportDateDiff < 0 && $supportDateDiff >= -30) {
                    $sSupportMess = GetMessage("prolog_main_support21", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => -$supportDateDiff, '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
                } elseif ($supportDateDiff < -30) {
                    $sSupportMess = GetMessage("prolog_main_support31", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT));
                }
                if ($sSupportMess != '') {
                    $sSupportMess .= GetMessage('ACRIT_EXPORTPRO_BUY_LICENCE');
                    $userOption = CUserOptions::GetOption("main", "admSupInf");
                    if (mktime() > $userOption["showInformerDate"]) {
                        $prolongUrl = "/bitrix/admin/buy_support.php?lang=" . LANGUAGE_ID;
                        if (!in_array(LANGUAGE_ID, array("ru", "ua")) || IntVal(COption::GetOptionString("main", "~PARAM_PARTNER_ID")) <= 0) {
                            require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/update_client.php";
                            $prolongUrl = "http://www.acrit-studio.ru/shop/list/lupd/";
                        }
                        echo BeginNote('style="position: relative; top: -15px;"');
                        ?>
                        
                        <div style="float: right; padding-left: 50px; margin-top: -5px; text-align: center;">
                            <a href="<?php 
                        echo $prolongUrl;
                        ?>
" target="_blank" class="adm-btn adm-btn-save" style="margin-bottom: 4px;"><?php 
                        echo GetMessage("prolog_main_support_button_prolong");
                        ?>
</a><br />
                            <a href="http://www.acrit-studio.ru/market/" target="_blank"><?php 
                        echo GetMessage("prolog_main_support_button_prolong_modules");
                        ?>
</a>
                        </div>
                        <?php 
                        echo $sSupportMess;
                        ?>
                        <div id="supdescr" style="display: none;"><br /><br /><b><?php 
                        echo GetMessage("prolog_main_support_wit_descr1");
                        ?>
</b><hr><?php 
                        echo GetMessage("prolog_main_support_wit_descr2");
                        ?>
</div>
                        <?php 
                        echo EndNote();
                    }
                }
            }
        }
    }
Пример #3
0
 public function __construct()
 {
     IncludeModuleLangFile(__FILE__);
     $this->MODULE_ID = get_class($this);
     $this->MODULE_NAME = GetMessage(strtoupper($this->MODULE_ID) . '_MODULE_NAME');
     $this->MODULE_DESCRIPTION = GetMessage(strtoupper($this->MODULE_ID) . '_MODULE_DESCRIPTION');
 }
Пример #4
0
    private function ShowForm($type, $message, $buttonName = '')
    {
        $keys = array_keys($GLOBALS);
        for ($i = 0; $i < count($keys); $i++) {
            if ($keys[$i] != 'i' && $keys[$i] != 'GLOBALS' && $keys[$i] != 'strTitle' && $keys[$i] != 'filepath') {
                global ${$keys[$i]};
            }
        }
        $PathInstall = str_replace('\\', '/', __FILE__);
        $PathInstall = substr($PathInstall, 0, strlen($PathInstall) - strlen('/index.php'));
        IncludeModuleLangFile($PathInstall . '/install.php');
        $APPLICATION->SetTitle(GetMessage('ASD_MODULE_MONEY_NAME'));
        include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_after.php';
        echo CAdminMessage::ShowMessage(array('MESSAGE' => $message, 'TYPE' => $type));
        ?>
		<form action="<?php 
        echo $APPLICATION->GetCurPage();
        ?>
" method="get">
		<p>
			<input type="hidden" name="lang" value="<?php 
        echo LANG;
        ?>
" />
			<input type="submit" value="<?php 
        echo strlen($buttonName) ? $buttonName : GetMessage('MOD_BACK');
        ?>
" />
		</p>
		</form>
		<?php 
        include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php';
        die;
    }
Пример #5
0
 public static function departmentFields($arParams)
 {
     IncludeModuleLangFile(__FILE__);
     $arFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields('IBLOCK_' . self::getDeptIblock() . '_SECTION', 0, LANGUAGE_ID);
     $res = array("ID" => "ID", "NAME" => GetMessage('INTR_STRUCTURE_NAME'), 'SORT' => GetMessage('INTR_STRUCTURE_SORT'), 'PARENT' => GetMessage('INTR_STRUCTURE_DEPARTMENT'), 'UF_HEAD' => $arFields['UF_HEAD']['EDIT_FORM_LABEL']);
     return $res;
 }
Пример #6
0
	function Show($WEB_FORM_VARNAME, $arrVALUES=false, $SHOW_TEMPLATE=false, $PREVIEW="N")
	{
		global $DB, $MESS, $APPLICATION, $USER, $_REQUEST, $HTTP_POST_VARS, $HTTP_GET_VARS, $arrFIELDS;
		$err_mess = (CAllForm::err_mess())."<br>Function: Show<br>Line: ";
		if ($arrVALUES===false) $arrVALUES = $_REQUEST;

		$z = CForm::GetBySID($WEB_FORM_VARNAME);
		$zr = $z->Fetch();
		$WEB_FORM_ID = $FORM_ID = intval($zr["ID"]);
		$WEB_FORM_ID = CForm::GetDataByID($WEB_FORM_ID, $arForm, $arQuestions, $arAnswers, $arDropDown, $arMultiSelect);
		if (intval($WEB_FORM_ID)>0)
		{
			$F_RIGHT = CForm::GetPermission($WEB_FORM_ID);
			if (intval($F_RIGHT)>=10)
			{
				if (strlen(trim($SHOW_TEMPLATE))>0) $template = $SHOW_TEMPLATE;
				else
				{
					if (strlen(trim($arForm["SHOW_TEMPLATE"]))<=0) $template = "default.php";
					else $template = $arForm["SHOW_TEMPLATE"];
				}
				$path = COption::GetOptionString("form","SHOW_TEMPLATE_PATH");
				IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/form/include.php");
				include(GetLangFileName($_SERVER["DOCUMENT_ROOT"].$path."lang/", "/".$template));
				if ($APPLICATION->GetShowIncludeAreas())
				{
					$arIcons = Array();
					if (CModule::IncludeModule("fileman"))
					{
						$arIcons[] =
								Array(
									"URL" => "/freetrix/admin/fileman_file_edit.php?lang=".LANGUAGE_ID."&site=".SITE_ID."&full_src=Y&path=". urlencode($path.$template),
									"SRC" => "/freetrix/images/form/panel/edit_template.gif",
									"ALT" => GetMessage("FORM_PUBLIC_ICON_TEMPLATE")
								);
						$arrUrl = parse_url($_SERVER["REQUEST_URI"]);
						$arIcons[] =
								Array(
									"URL" => "/freetrix/admin/fileman_file_edit.php?lang=".LANGUAGE_ID."&site=".SITE_ID."&full_src=Y&path=". urlencode($arrUrl["path"]),
									"SRC" => "/freetrix/images/form/panel/edit_file.gif",
									"ALT" => GetMessage("FORM_PUBLIC_ICON_HANDLER")
								);
					}
					$arIcons[] =
							Array(
								"URL" => "/freetrix/admin/form_edit.php?lang=".LANGUAGE_ID."&ID=".$WEB_FORM_ID,
								"SRC" => "/freetrix/images/form/panel/edit_form.gif",
								"ALT" => GetMessage("FORM_PUBLIC_ICON_SETTINGS")
							);
					echo $APPLICATION->IncludeStringBefore($arIcons);
				}
				include($_SERVER["DOCUMENT_ROOT"].$path.$template);
				if ($APPLICATION->GetShowIncludeAreas())
				{
					echo $APPLICATION->IncludeStringAfter();
				}
			}
		}
	}
Пример #7
0
 public static function getAllDescriptions()
 {
     if (!self::$allDescriptions) {
         IncludeModuleLangFile(__FILE__);
         self::$allDescriptions = array(self::Dflt => GetMessage('CRM_PRSN_NM_FRMT_DEFAULT'), self::FirstLast => GetMessage('CRM_PRSN_NM_FRMT_FIRST_LAST'), self::FirstSecondLast => GetMessage('CRM_PRSN_NM_FRMT_FIRST_SECOND_LAST'), self::LastFirst => GetMessage('CRM_PRSN_NM_FRMT_LAST_FIRST'), self::LastFirstSecond => GetMessage('CRM_PRSN_NM_FRMT_LAST_FIRST_SECOND'));
     }
     return self::$allDescriptions;
 }
Пример #8
0
 /**
  *
  */
 public function __construct()
 {
     // Magic... Don't works, if in top of file.
     IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . '/modules/' . $this->MODULE_ID . '/install/index.php');
     $this->MODULE_NAME = GetMessage('MAILTRANSPORT_MODULE_NAME');
     $this->MODULE_DESCRIPTION = GetMessage('MAILTRANSPORT_MODULE_DESCRIPTION');
     // Fail.
     $this->PARTNER_NAME = "Alexey Shockov";
     $this->PARTNER_URI = "http://alexey.shockov.com/";
 }
Пример #9
0
    function thelikers_painkiller(){
        include dirname( __FILE__ ) . '/version.php';
        IncludeModuleLangFile(__FILE__);

        $this->MODULE_VERSION = $arModuleVersion["VERSION"];
        $this->MODULE_VERSION_DATE = $arModuleVersion["VERSION_DATE"];
        $this->MODULE_NAME = GetMessage('PAINKILLER_MODULE_NAME');
        $this->MODULE_DESCRIPTION = GetMessage('PAINKILLER_DESCRIPTION');
        $this->PARTNER_NAME = GetMessage('PAINKILLER_PARTNER_NAME');
        $this->PARTNER_URI = "http://1c-bitrix.ru/partners/310515.php";
    }
Пример #10
0
 public function __construct()
 {
     IncludeModuleLangFile(__FILE__);
     $this->savedMaxExecutionTime = ini_get("max_execution_time");
     if ($this->savedMaxExecutionTime <= 0) {
         $phpMaxExecutionTime = 30;
     } else {
         $phpMaxExecutionTime = $this->savedMaxExecutionTime - 2;
     }
     $this->maximumExecutionTime = time() + $phpMaxExecutionTime;
     set_time_limit(0);
 }
Пример #11
0
 protected static function loadMessages(&$class)
 {
     if (array_key_exists($class, self::$_arLangMessages)) {
         return;
     }
     if (static::FILE === null) {
         throw new \ErrorException('You must redeclare ' . $class . '::FILE constant exactly: const FILE = __FILE__;');
     }
     if (static::ID === null) {
         throw new \ErrorException('You must redeclare ' . $class . '::ID constant exactly: const ID = "YOUR_LANG_MESSAGES_PREFIX";');
     }
     self::$_arLangMessages[$class] = IncludeModuleLangFile(static::FILE, false, true);
 }
Пример #12
0
 public function __construct()
 {
     IncludeModuleLangFile(__FILE__);
     $arModuleVersion = [];
     include __DIR__ . '/version.php';
     if (is_array($arModuleVersion) && array_key_exists('VERSION', $arModuleVersion)) {
         $this->MODULE_VERSION = $arModuleVersion['VERSION'];
         $this->MODULE_VERSION_DATE = $arModuleVersion['VERSION_DATE'];
     }
     $this->MODULE_NAME = GetMessage('NOTAMEDIA_AGENT_MODULE_NAME');
     $this->MODULE_DESCRIPTION = GetMessage('NOTAMEDIA_AGENT_MODULE_DESCRIPTION');
     $this->PARTNER_NAME = GetMessage('NOTAMEDIA_AGENT_PARTNER_NAME');
     $this->PARTNER_URI = GetMessage('NOTAMEDIA_AGENT_PARTNER_URI');
 }
Пример #13
0
 function GetTasks()
 {
     IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/fileman/admin/task_description.php");
     $arTasks = array();
     $res = CTask::GetList(array('LETTER' => 'asc'), array('MODULE_ID' => 'fileman', 'BINDING' => 'stickers'));
     while ($arRes = $res->Fetch()) {
         $name = '';
         if ($arRes['SYS']) {
             $name = GetMessage('TASK_NAME_' . strtoupper($arRes['NAME']));
         }
         if (strlen($name) == 0) {
             $name = $arRes['NAME'];
         }
         $arTasks[$arRes['ID']] = array('title' => $name, 'letter' => $arRes['LETTER']);
     }
     return $arTasks;
 }
Пример #14
0
 /**
  * @param AError $class
  * @param $path
  * @dataProvider getClassList
  */
 public function testExceptions($class, $path)
 {
     $arErrMsg = IncludeModuleLangFile(static::$_modulesDir . $path, false, true);
     $this->assertTrue(is_array($arErrMsg));
     $this->assertNotEmpty($arErrMsg);
     $Reflection = new \ReflectionClass($class);
     $arConstants = $Reflection->getConstants();
     foreach ($arConstants as $constantName => $constantValue) {
         if (substr($constantName, 0, 2) !== 'E_') {
             continue;
         }
         $errCode = $class::ID . $constantValue;
         $this->assertArrayHasKey($errCode, $arErrMsg);
         /** @noinspection PhpUndefinedMethodInspection */
         $this->assertEquals($arErrMsg[$errCode], $class::getLangMessage($constantValue));
     }
 }
Пример #15
0
 public function checkHeaders(array &$messages)
 {
     IncludeModuleLangFile(__FILE__);
     $map = $this->headerMap !== null ? $this->headerMap : array();
     if ($map === null) {
         throw new Main\SystemException("Invalid operation. HeaderMap is not assigned.");
     }
     $hasName = isset($map['First']) || isset($map['Last']);
     if (!$hasName) {
         $messages[] = GetMessage('CRM_IMPORT_YAHOO_ERROR_FIELDS_NOT_FOUND', array('#FIELD_LIST#' => "'First', 'Last'"));
     }
     $hasEmail = isset($map['Email']) || isset($map['Alternate Email 1']);
     $hasPhone = isset($map['Home']) || isset($map['Work']) || isset($map['Mobile']) || isset($map['Other']);
     if (!$hasName && !$hasEmail && !$hasPhone) {
         $messages[] = GetMessage('CRM_IMPORT_YAHOO_REQUIREMENTS');
     }
     return $hasName || $hasEmail || $hasPhone;
 }
Пример #16
0
 public function checkHeaders(array &$messages)
 {
     IncludeModuleLangFile(__FILE__);
     $map = $this->headerMap;
     if ($map === null) {
         throw new Main\SystemException("Invalid operation. HeaderMap is not assigned.");
     }
     $hasName = isset($map['Given Name']) || isset($map['Family Name']);
     if (!$hasName) {
         $messages[] = GetMessage('CRM_IMPORT_GMAIL_ERROR_FIELDS_NOT_FOUND', array('#FIELD_LIST#' => "'Given Name', 'Family Name'"));
     }
     $hasEmail = isset($map['E-mail 1 - Value']);
     $hasPhone = isset($map['Phone 1 - Value']);
     if (!$hasName && !$hasEmail && !$hasPhone) {
         $messages[] = GetMessage('CRM_IMPORT_GMAIL_REQUIREMENTS');
     }
     return $hasName || $hasEmail || $hasPhone;
 }
Пример #17
0
 public static function Create($catalogID = 0, $currencyID = '')
 {
     IncludeModuleLangFile(__FILE__);
     $catalogID = intval($catalogID);
     if ($catalogID <= 0) {
         $catalogID = CCrmCatalog::EnsureDefaultExists();
     }
     $currencyID = strval($currencyID);
     if ($currencyID === '') {
         $currencyID = CCrmCurrency::GetBaseCurrencyID();
     }
     $sectionID = self::EnsureProductSection('CRM_DEMO_SECTION_PRODUCTS', $catalogID, array('NAME' => GetMessage('CRM_DEMO_SECTION_PRODUCTS')));
     self::EnsureProduct('CRM_DEMO_PRODUCT_BX_CMS', $catalogID, array('CATALOG_ID' => $catalogID, 'SECTION_ID' => $sectionID, 'NAME' => GetMessage('CRM_DEMO_PRODUCT_BX_CMS'), 'CURRENCY_ID' => $currencyID, 'PRICE' => self::ConvertMoney(10000, 'RUB', $currencyID), 'ACTIVE' => 'Y', 'SORT' => 100));
     self::EnsureProduct('CRM_DEMO_PRODUCT_BX_CP', $catalogID, array('CATALOG_ID' => $catalogID, 'SECTION_ID' => $sectionID, 'NAME' => GetMessage('CRM_DEMO_PRODUCT_BX_CP'), 'CURRENCY_ID' => $currencyID, 'PRICE' => self::ConvertMoney(25000, 'RUB', $currencyID), 'ACTIVE' => 'Y', 'SORT' => 110));
     self::EnsureProduct('CRM_DEMO_PRODUCT_BX_TEAM', $catalogID, array('CATALOG_ID' => $catalogID, 'SECTION_ID' => $sectionID, 'NAME' => GetMessage('CRM_DEMO_PRODUCT_BX_TEAM'), 'CURRENCY_ID' => $currencyID, 'PRICE' => self::ConvertMoney(5000, 'RUB', $currencyID), 'ACTIVE' => 'Y', 'SORT' => 120));
     $sectionID = self::EnsureProductSection('CRM_DEMO_SECTION_SERVICES', $catalogID, array('NAME' => GetMessage('CRM_DEMO_SECTION_SERVICES')));
     self::EnsureProduct('CRM_DEMO_SERVICE_SITE_DISIGN', $catalogID, array('CATALOG_ID' => $catalogID, 'SECTION_ID' => $sectionID, 'NAME' => GetMessage('CRM_DEMO_SERVICE_SITE_DISIGN'), 'CURRENCY_ID' => $currencyID, 'PRICE' => self::ConvertMoney(15000, 'RUB', $currencyID), 'ACTIVE' => 'Y', 'SORT' => 130));
     self::EnsureProduct('CRM_DEMO_SERVICE_SITE_TUNING', $catalogID, array('CATALOG_ID' => $catalogID, 'SECTION_ID' => $sectionID, 'NAME' => GetMessage('CRM_DEMO_SERVICE_SITE_TUNING'), 'CURRENCY_ID' => $currencyID, 'PRICE' => self::ConvertMoney(20000, 'RUB', $currencyID), 'ACTIVE' => 'Y', 'SORT' => 140));
     self::EnsureProduct('CRM_DEMO_SERVICE_MANAGER_TRAINING', $catalogID, array('CATALOG_ID' => $catalogID, 'SECTION_ID' => $sectionID, 'NAME' => GetMessage('CRM_DEMO_SERVICE_MANAGER_TRAINING'), 'CURRENCY_ID' => $currencyID, 'PRICE' => self::ConvertMoney(5000, 'RUB', $currencyID), 'ACTIVE' => 'Y', 'SORT' => 150));
 }
Пример #18
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;
        }
    }
}
Пример #19
0
 public static function installDefault()
 {
     $items = array();
     $langIDs = self::getAllLangIDs();
     foreach ($langIDs as $langID) {
         IncludeModuleLangFile(__FILE__, $langID);
         $s = trim(GetMessage('CRM_HONORIFIC_DEFAULT'));
         if ($s === '' || $s === '-') {
             //Skip stub
             continue;
         }
         $slugs = explode('|', $s);
         $slugCount = count($slugs);
         for ($i = 0; $i < $slugCount; $i++) {
             $ary = explode(';', $slugs[$i]);
             $count = count($ary);
             if ($count >= 2) {
                 $name = trim($ary[1]);
                 $statusID = trim($ary[0]);
             } else {
                 $name = trim($ary[0]);
                 $statusID = '';
             }
             if ($statusID === '') {
                 $statusID = 'HNR_' . strtoupper($langID) . '_' . ($i + 1);
             }
             if ($name === '' || isset($items[$statusID])) {
                 continue;
             }
             $items[$statusID] = array('STATUS_ID' => $statusID, 'NAME' => $name, 'SORT' => ($i + 1) * 10, 'SYSTEM' => 'N');
         }
     }
     $statusEntity = new \CCrmStatus('HONORIFIC');
     $presentItems = \CCrmStatus::GetStatusList('HONORIFIC');
     foreach ($items as $item) {
         if (!isset($presentItems[$item['STATUS_ID']])) {
             $statusEntity->Add($item);
         }
     }
 }
Пример #20
0
 function InstallUserFields()
 {
     $ImportantUserFields = $this->GetIdeaUserFields();
     $messages = array();
     $db_res = \Bitrix\Main\Localization\LanguageTable::getList(array('order' => array('SORT' => 'ASC')));
     while ($ar = $db_res->fetch()) {
         $messages[$ar["LID"]] = IncludeModuleLangFile(__FILE__, $ar["LID"], true);
     }
     foreach ($ImportantUserFields as $UserFieldName => $Exists) {
         if (!$Exists) {
             $EDIT_FORM_LABEL = array();
             foreach ($messages as $lid => $mess) {
                 $EDIT_FORM_LABEL[$lid] = $mess["IDEA_" . $UserFieldName . "_DESCRIPTION"];
             }
             $UserType = new CUserTypeEntity();
             switch ($UserFieldName) {
                 case "UF_CATEGORY_CODE":
                     GetMessage("IDEA_UF_CATEGORY_CODE_DESCRIPTION");
                     $UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "string", "IS_SEARCHABLE" => "N", "EDIT_FORM_LABEL" => $EDIT_FORM_LABEL));
                     break;
                 case "UF_ANSWER_ID":
                     GetMessage("IDEA_UF_ANSWER_ID_DESCRIPTION");
                     $UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "integer", "IS_SEARCHABLE" => "N", "MULTIPLE" => "Y", "EDIT_FORM_LABEL" => $EDIT_FORM_LABEL));
                     break;
                 case "UF_ORIGINAL_ID":
                     GetMessage("IDEA_UF_ORIGINAL_ID_DESCRIPTION");
                     $UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "string", "IS_SEARCHABLE" => "N", "EDIT_FORM_LABEL" => $EDIT_FORM_LABEL));
                     break;
                 case "UF_STATUS":
                     GetMessage("IDEA_UF_STATUS_DESCRIPTION");
                     $ID = $UserType->Add(array("ENTITY_ID" => "BLOG_POST", "FIELD_NAME" => $UserFieldName, "USER_TYPE_ID" => "enumeration", "IS_SEARCHABLE" => "N", "EDIT_FORM_LABEL" => $EDIT_FORM_LABEL));
                     if (intval($ID) > 0) {
                         $UserTypeEnum = new CUserFieldEnum();
                         $UserTypeEnum->SetEnumValues($ID, array("n0" => array("SORT" => 100, "XML_ID" => "NEW", "VALUE" => GetMessage("IDEA_UF_STATUS_NEW_TITLE"), "DEF" => "Y"), "n1" => array("SORT" => 200, "XML_ID" => "PROCESSING", "VALUE" => GetMessage("IDEA_UF_STATUS_PROCESSING_TITLE"), "DEF" => "N"), "n2" => array("SORT" => 300, "XML_ID" => "COMPLETED", "VALUE" => GetMessage("IDEA_UF_STATUS_COMPLETED_TITLE"), "DEF" => "N")));
                     }
                     break;
             }
         }
     }
 }
Пример #21
0
 public static function installDefault()
 {
     $langIDs = self::getAllLangIDs();
     foreach ($langIDs as $langID) {
         IncludeModuleLangFile(__FILE__, $langID);
         $bizTypeStr = trim(GetMessage('CRM_BIZ_TYPE_DEFAULT'));
         if ($bizTypeStr === '' || $bizTypeStr === '-') {
             //Skip stub
             continue;
         }
         foreach (explode('|', $bizTypeStr) as $slug) {
             $ary = explode(';', $slug);
             if (count($ary) < 2) {
                 continue;
             }
             $fields = array('CODE' => $ary[0], 'NAME' => $ary[1]);
             if (isset($ary[2])) {
                 $fields['LANG'] = $ary[2];
             }
             self::add($fields);
         }
     }
 }
Пример #22
0
 public static function GetZones()
 {
     IncludeModuleLangFile(__FILE__);
     $aTZ = array();
     static $aExcept = array("Etc/", "GMT", "UTC", "UCT", "HST", "PST", "MST", "CST", "EST", "CET", "MET", "WET", "EET", "PRC", "ROC", "ROK", "W-SU");
     foreach (DateTimeZone::listIdentifiers() as $tz) {
         foreach ($aExcept as $ex) {
             if (strpos($tz, $ex) === 0) {
                 continue 2;
             }
         }
         try {
             $oTz = new DateTimeZone($tz);
             $aTZ[$tz] = array('timezone_id' => $tz, 'offset' => $oTz->getOffset(new DateTime("now", $oTz)));
         } catch (Exception $e) {
         }
     }
     uasort($aTZ, array('CTimeZone', '__tzsort'));
     $aZones = array("" => GetMessage("tz_local_time"));
     foreach ($aTZ as $z) {
         $aZones[$z['timezone_id']] = '(UTC' . ($z['offset'] != 0 ? ' ' . ($z['offset'] < 0 ? '-' : '+') . sprintf("%02d", $h = floor(abs($z['offset']) / 3600)) . ':' . sprintf("%02d", abs($z['offset']) / 60 - $h * 60) : '') . ') ' . $z['timezone_id'];
     }
     return $aZones;
 }
Пример #23
0
 public function GetTypeMap($typeID)
 {
     $typeID = intval($typeID);
     if (!CCrmOwnerType::IsDefined($typeID)) {
         return null;
     }
     if (!isset(self::$MAP_BY_LANG[LANGUAGE_ID])) {
         self::$MAP_BY_LANG[LANGUAGE_ID] = array();
     }
     if (isset(self::$MAP_BY_LANG[LANGUAGE_ID][$typeID])) {
         return self::$MAP_BY_LANG[LANGUAGE_ID][$typeID];
     }
     IncludeModuleLangFile(__FILE__);
     if ($typeID === CCrmOwnerType::Lead) {
         return self::$MAP_BY_LANG[LANGUAGE_ID][CCrmOwnerType::Lead] = array('typeId' => CCrmOwnerType::Lead, 'typeName' => CCrmOwnerType::ResolveName(CCrmOwnerType::Lead), 'fields' => array(array('id' => 'ID', 'name' => 'ID'), array('id' => 'TITLE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_TITLE')), array('id' => 'LAST_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_LAST_NAME')), array('id' => 'NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_NAME')), array('id' => 'SECOND_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_SECOND_NAME')), array('id' => 'FORMATTED_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_FORMATTED_NAME')), array('id' => 'COMPANY_TITLE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMPANY_TITLE')), array('id' => 'SOURCE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_SOURCE')), array('id' => 'SOURCE_DESCRIPTION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_SOURCE_DESCRIPTION')), array('id' => 'STATUS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_STATUS')), array('id' => 'STATUS_DESCRIPTION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_STATUS_DESCRIPTION')), array('id' => 'POST', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_POST')), array('id' => 'ADDRESS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ADDRESS')), array('id' => 'CURRENCY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CURRENCY')), array('id' => 'OPPORTUNITY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_OPPORTUNITY')), array('id' => 'OPPORTUNITY_FORMATTED', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_OPPORTUNITY_FORMATTED')), array('id' => 'ASSIGNED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_FULL_NAME')), array('id' => 'ASSIGNED_BY_WORK_POSITION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_POST')), array('id' => 'CREATED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CREATED_BY_FULL_NAME')), array('id' => 'MODIFY_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_MODIFY_BY_FULL_NAME')), array('id' => 'DATE_CREATE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_CREATE')), array('id' => 'DATE_MODIFY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_MODIFY')), array('id' => 'COMMENTS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMMENTS'))));
     } elseif ($typeID === CCrmOwnerType::Deal) {
         return self::$MAP_BY_LANG[LANGUAGE_ID][CCrmOwnerType::Deal] = array('typeId' => CCrmOwnerType::Deal, 'typeName' => CCrmOwnerType::ResolveName(CCrmOwnerType::Deal), 'fields' => array(array('id' => 'ID', 'name' => 'ID'), array('id' => 'TITLE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_TITLE')), array('id' => 'TYPE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_TYPE')), array('id' => 'STAGE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_STAGE')), array('id' => 'PROBABILITY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_PROBABILITY')), array('id' => 'CURRENCY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CURRENCY')), array('id' => 'OPPORTUNITY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_OPPORTUNITY')), array('id' => 'OPPORTUNITY_FORMATTED', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_OPPORTUNITY_FORMATTED')), array('id' => 'COMPANY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMPANY'), 'typeId' => CCrmOwnerType::Company), array('id' => 'CONTACT', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CONTACT'), 'typeId' => CCrmOwnerType::Contact), array('id' => 'BEGINDATE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_BEGINDATE')), array('id' => 'CLOSEDATE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CLOSEDATE')), array('id' => 'ASSIGNED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_FULL_NAME')), array('id' => 'ASSIGNED_BY_WORK_POSITION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_POST')), array('id' => 'CREATED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CREATED_BY_FULL_NAME')), array('id' => 'MODIFY_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_MODIFY_BY_FULL_NAME')), array('id' => 'DATE_CREATE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_CREATE')), array('id' => 'DATE_MODIFY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_MODIFY')), array('id' => 'COMMENTS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMMENTS'))));
     } elseif ($typeID === CCrmOwnerType::Contact) {
         return self::$MAP_BY_LANG[LANGUAGE_ID][CCrmOwnerType::Contact] = array('typeId' => CCrmOwnerType::Contact, 'typeName' => CCrmOwnerType::ResolveName(CCrmOwnerType::Contact), 'fields' => array(array('id' => 'ID', 'name' => 'ID'), array('id' => 'LAST_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_LAST_NAME')), array('id' => 'NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_NAME')), array('id' => 'SECOND_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_SECOND_NAME')), array('id' => 'FORMATTED_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_FORMATTED_NAME')), array('id' => 'POST', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_POST')), array('id' => 'ADDRESS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ADDRESS')), array('id' => 'TYPE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_TYPE')), array('id' => 'SOURCE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_SOURCE')), array('id' => 'SOURCE_DESCRIPTION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_STATUS_DESCRIPTION')), array('id' => 'COMPANY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMPANY'), 'typeId' => CCrmOwnerType::Company), array('id' => 'ASSIGNED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_FULL_NAME')), array('id' => 'ASSIGNED_BY_WORK_POSITION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_POST')), array('id' => 'CREATED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CREATED_BY_FULL_NAME')), array('id' => 'MODIFY_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_MODIFY_BY_FULL_NAME')), array('id' => 'DATE_CREATE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_CREATE')), array('id' => 'DATE_MODIFY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_MODIFY')), array('id' => 'COMMENTS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMMENTS'))));
     } elseif ($typeID === CCrmOwnerType::Company) {
         return self::$MAP_BY_LANG[LANGUAGE_ID][CCrmOwnerType::Company] = array('typeId' => CCrmOwnerType::Company, 'typeName' => CCrmOwnerType::ResolveName(CCrmOwnerType::Company), 'fields' => array(array('id' => 'ID', 'name' => 'ID'), array('id' => 'TITLE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_TITLE')), array('id' => 'TYPE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMPANY_TYPE')), array('id' => 'ADDRESS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ACTUAL_ADDRESS')), array('id' => 'ADDRESS_LEGAL', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ADDRESS_LEGAL')), array('id' => 'BANKING_DETAILS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_BANKING_DETAILS')), array('id' => 'INDUSTRY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_INDUSTRY')), array('id' => 'EMPLOYEES', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_EMPLOYEES')), array('id' => 'CURRENCY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CURRENCY')), array('id' => 'REVENUE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_REVENUE')), array('id' => 'REVENUE_FORMATTED', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_REVENUE_FORMATTED')), array('id' => 'ASSIGNED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_FULL_NAME')), array('id' => 'ASSIGNED_BY_WORK_POSITION', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_ASSIGNED_BY_POST')), array('id' => 'CREATED_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_CREATED_BY_FULL_NAME')), array('id' => 'MODIFY_BY_FULL_NAME', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_MODIFY_BY_FULL_NAME')), array('id' => 'DATE_CREATE', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_CREATE')), array('id' => 'DATE_MODIFY', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_DATE_MODIFY')), array('id' => 'COMMENTS', 'name' => GetMessage('CRM_TEMPLATE_ADAPTER_COMMENTS'))));
     }
     return null;
 }
Пример #24
0
<?php

IncludeModuleLangFile(__FILE__);
class CBlogMetaWeblog
{
    function Authorize($user, $password)
    {
        global $USER, $APPLICATION;
        $arAuthResult = $USER->Login($user, $password, "Y");
        $APPLICATION->arAuthResult = $arAuthResult;
        if ($USER->IsAuthorized() && strlen($arAuthResult["MESSAGE"]) <= 0) {
            return true;
        } else {
            return false;
        }
    }
    function DecodeParams($value)
    {
        foreach ($value as $t => $v) {
            if ($t == "base64") {
                return base64_decode($v[0]["#"]);
            } else {
                return $v[0]["#"];
            }
        }
    }
    function GetUsersBlogs($params, $arPath)
    {
        global $USER;
        $blog = CBlogMetaWeblog::DecodeParams($params[0]["#"]["value"][0]["#"]);
        $user = CBlogMetaWeblog::DecodeParams($params[1]["#"]["value"][0]["#"]);
Пример #25
0
	/**
	* Function adds an edit action to some area inside the component.
	*
	* @param string $entryId
	* @param string $editLink
	* @param string $editTitle
	* @param array[string]mixed $arParams
	* @return void
	*
	*/
	final public function addEditAction($entryId, $editLink, $editTitle = false, $arParams = array())
	{
		global $APPLICATION;

		if (!$entryId || !$editLink)
			return;

		if (!$editTitle)
		{
			IncludeModuleLangFile(__FILE__);
			$editTitle = GetMessage('EDIT_ACTION_TITLE_DEFAULT');
		}

		if (!is_array($arParams))
			$arParams = array();

		if (!$arParams['WINDOW'])
			$arParams['WINDOW'] = array(
				"width" => 780,
				"height" => 500,
			);

		if (!$arParams['ICON'] && !$arParams['SRC'] && !$arParams['IMAGE'])
			$arParams['ICON'] = 'bx-context-toolbar-edit-icon';

		$arBtn = array(
			'URL' => 'javascript:'.$APPLICATION->getPopupLink(array(
				'URL' => $editLink,
				"PARAMS" => $arParams['WINDOW'],
			)),
			'TITLE' => $editTitle,
		);

		if ($arParams['ICON'])
			$arBtn['ICON'] = $arParams['ICON'];
		elseif ($arParams['SRC'] || $arParams['IMAGE'])
			$arBtn['SRC'] = $arParams['IMAGE'] ? $arParams['IMAGE'] : $arParams['SRC'];

		$GLOBALS['APPLICATION']->setEditArea($this->getEditAreaId($entryId), array(
			$arBtn,
		));
	}
Пример #26
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/currency/prolog.php";
$CURRENCY_RIGHT = $APPLICATION->GetGroupRight("currency");
if ($CURRENCY_RIGHT == "D") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
CModule::IncludeModule('currency');
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/currency/currencies_rates.php");
$sTableID = "t_currency_rates";
$oSort = new CAdminSorting($sTableID, "date", "desc");
$lAdmin = new CAdminList($sTableID, $oSort);
$arFilterFields = array("filter_period_from", "filter_period_to", "filter_currency");
$lAdmin->InitFilter($arFilterFields);
$filter = new CAdminFilter($sTableID . "_filter", array(GetMessage("curr_rates_curr1")));
$arFilter = array("CURRENCY" => $filter_currency, "DATE_RATE" => $filter_period_from, "!DATE_RATE" => $filter_period_to);
if ($by != "curr" && $by != "rate") {
    $by = "date";
}
$order = strtolower($order);
if ($order != "asc") {
    $order = "desc";
}
if ($CURRENCY_RIGHT == "W" && $lAdmin->EditAction()) {
    foreach ($FIELDS as $ID => $arFields) {
        $ID = (int) $ID;
        if (!$lAdmin->IsUpdated($ID)) {
            continue;
        }
        $arCurR = CCurrencyRates::GetByID($ID);
Пример #27
0
 public static function CreateMailTemplate($ID)
 {
     $ID = trim($ID);
     if ('' == $ID) {
         return false;
     }
     if (!($arStatus = CSaleStatus::GetByID($ID, LANGUAGE_ID))) {
         return false;
     }
     $eventType = new CEventType();
     $eventMessage = new CEventMessage();
     $eventType->Delete("SALE_STATUS_CHANGED_" . $ID);
     $b = 'sort';
     $o = 'asc';
     $dbSiteList = CSite::GetList($b, $o);
     while ($arSiteList = $dbSiteList->Fetch()) {
         IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/general/status.php", $arSiteList["LANGUAGE_ID"]);
         $arStatusLang = CSaleStatus::GetLangByID($ID, $arSiteList["LANGUAGE_ID"]);
         $dbEventType = $eventType->GetList(array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $arSiteList["LANGUAGE_ID"]));
         if (!($arEventType = $dbEventType->Fetch())) {
             $str = "";
             $str .= "#ORDER_ID# - " . GetMessage("SKGS_ORDER_ID") . "\n";
             $str .= "#ORDER_DATE# - " . GetMessage("SKGS_ORDER_DATE") . "\n";
             $str .= "#ORDER_STATUS# - " . GetMessage("SKGS_ORDER_STATUS") . "\n";
             $str .= "#EMAIL# - " . GetMessage("SKGS_ORDER_EMAIL") . "\n";
             $str .= "#ORDER_DESCRIPTION# - " . GetMessage("SKGS_STATUS_DESCR") . "\n";
             $str .= "#TEXT# - " . GetMessage("SKGS_STATUS_TEXT") . "\n";
             $str .= "#SALE_EMAIL# - " . GetMessage("SKGS_SALE_EMAIL") . "\n";
             $eventTypeID = $eventType->Add(array("LID" => $arSiteList["LANGUAGE_ID"], "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "NAME" => GetMessage("SKGS_CHANGING_STATUS_TO") . " \"" . $arStatusLang["NAME"] . "\"", "DESCRIPTION" => $str));
         }
         $dbEventMessage = $eventMessage->GetList($b = "", $o = "", array("EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "SITE_ID" => $arSiteList["LID"]));
         if (!($arEventMessage = $dbEventMessage->Fetch())) {
             $subject = GetMessage("SKGS_STATUS_MAIL_SUBJ");
             $message = GetMessage("SKGS_STATUS_MAIL_BODY1");
             $message .= "------------------------------------------\n\n";
             $message .= GetMessage("SKGS_STATUS_MAIL_BODY2");
             $message .= GetMessage("SKGS_STATUS_MAIL_BODY3");
             $message .= "#ORDER_STATUS#\n";
             $message .= "#ORDER_DESCRIPTION#\n";
             $message .= "#TEXT#\n\n";
             $message .= "#SITE_NAME#\n";
             $arFields = array("ACTIVE" => "Y", "EVENT_NAME" => "SALE_STATUS_CHANGED_" . $ID, "LID" => $arSiteList["LID"], "EMAIL_FROM" => "#SALE_EMAIL#", "EMAIL_TO" => "#EMAIL#", "SUBJECT" => $subject, "MESSAGE" => $message, "BODY_TYPE" => "text");
             $eventMessageID = $eventMessage->Add($arFields);
         }
     }
     return true;
 }
Пример #28
0
<?php

if (!check_bitrix_sessid()) {
    return;
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/install/install.php");
if (is_array($errors) && count($errors) > 0) {
    foreach ($errors as $val) {
        $alErrors .= $val . "<br>";
    }
    echo CAdminMessage::ShowMessage(array("TYPE" => "ERROR", "MESSAGE" => GetMessage("MOD_INST_ERR"), "DETAILS" => $alErrors, "HTML" => true));
} else {
    echo CAdminMessage::ShowNote(GetMessage("MOD_INST_OK"));
}
/*
if (strlen($public_dir)>0) :
?>
<p><?=GetMessage("MOD_DEMO_DIR")?></p>
<table border="0" cellspacing="0" cellpadding="3">
	<tr>
		<td align="center"><p><b><?=GetMessage("MOD_DEMO_SITE")?></b></p></td>
		<td align="center"><p><b><?=GetMessage("MOD_DEMO_LINK")?></b></p></td>
	</tr>
	<?
	$sites = CSite::GetList($by, $order, Array("ACTIVE"=>"Y"));
	while($site = $sites->Fetch())
	{
		?>
		<tr>
			<td width="0%"><p>[<?=$site["ID"]?>] <?=$site["NAME"]?></p></td>
			<td width="0%"><p><a href="<?if(strlen($site["SERVER_NAME"])>0) echo "http://".$site["SERVER_NAME"];?><?=$site["DIR"].$public_dir?>/result_list.php?WEB_FORM_NAME=ANKETA"><?=$site["DIR"].$public_dir?>/result_list.php?WEB_FORM_NAME=ANKETA</a></p></td>
Пример #29
0
	private function ShowDataSaveForm() {
		$keys = array_keys($GLOBALS);
		for($i=0; $i<count($keys); $i++) {
			if($keys[$i]!='i' && $keys[$i]!='GLOBALS' && $keys[$i]!='strTitle' && $keys[$i]!='filepath') {
				global ${$keys[$i]};
			}
		}

		$PathInstall = str_replace('\\', '/', __FILE__);

		$PathInstall = substr($PathInstall, 0, strlen($PathInstall)-strlen('/index.php'));
		IncludeModuleLangFile($PathInstall.'/install.php');

		$APPLICATION->SetTitle(GetMessage('ASD_MODULE_NAME'));
		include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_after.php');
		?>
		<form action="<?= $APPLICATION->GetCurPage()?>" method="get">
			<?= bitrix_sessid_post()?>
			<input type="hidden" name="lang" value="<?= LANG?>" />
			<input type="hidden" name="id" value="<?= $this->MODULE_ID?>" />
			<input type="hidden" name="uninstall" value="Y" />
			<input type="hidden" name="step" value="2" />
			<?CAdminMessage::ShowMessage(GetMessage('MOD_UNINST_WARN'))?>
			<input type="submit" name="inst" value="<?echo GetMessage('MOD_UNINST_DEL')?>" />
		</form>
		<?
		include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_admin.php');
		die();
	}
Пример #30
0
<?php

IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/calendar/classes/general/calendar.php");
class CCalendarEvent
{
    private static $Fields = array(), $lastAttendeesList = array();
    public static $eventUFDescriptions;
    public static $TextParser;
    private static function GetFields()
    {
        CTimeZone::Disable();
        global $DB;
        if (!count(self::$Fields)) {
            self::$Fields = array("ID" => array("FIELD_NAME" => "CE.ID", "FIELD_TYPE" => "int"), "ACTIVE" => array("FIELD_NAME" => "CE.ACTIVE", "FIELD_TYPE" => "string"), "DELETED" => array("FIELD_NAME" => "CE.DELETED", "FIELD_TYPE" => "string"), "CAL_TYPE" => array("FIELD_NAME" => "CE.CAL_TYPE", "FIELD_TYPE" => "string"), "OWNER_ID" => array("FIELD_NAME" => "CE.OWNER_ID", "FIELD_TYPE" => "int"), "CREATED_BY" => array("FIELD_NAME" => "CE.CREATED_BY", "FIELD_TYPE" => "int"), "NAME" => array("FIELD_NAME" => "CE.NAME", "FIELD_TYPE" => "string"), "DESCRIPTION" => array("FIELD_NAME" => "CE.DESCRIPTION", "FIELD_TYPE" => "string"), "TIMESTAMP_X" => array("FIELD_NAME" => $DB->DateToCharFunction("CE.TIMESTAMP_X") . ' as TIMESTAMP_X', "FIELD_TYPE" => "date"), "DATE_CREATE" => array("FIELD_NAME" => $DB->DateToCharFunction("CE.DATE_CREATE") . ' as DATE_CREATE', "FIELD_TYPE" => "date"), "DT_FROM" => array("FIELD_NAME" => $DB->DateToCharFunction("CE.DT_FROM") . ' as DT_FROM', "FIELD_TYPE" => "date"), "DT_TO" => array("FIELD_NAME" => $DB->DateToCharFunction("CE.DT_TO") . ' as DT_TO', "FIELD_TYPE" => "date"), "DT_SKIP_TIME" => array("FIELD_NAME" => "CE.DT_SKIP_TIME", "FIELD_TYPE" => "string"), "DT_LENGTH" => array("FIELD_NAME" => "CE.DT_LENGTH", "FIELD_TYPE" => "int"), "PRIVATE_EVENT" => array("FIELD_NAME" => "CE.PRIVATE_EVENT", "FIELD_TYPE" => "string"), "ACCESSIBILITY" => array("FIELD_NAME" => "CE.ACCESSIBILITY", "FIELD_TYPE" => "string"), "IMPORTANCE" => array("FIELD_NAME" => "CE.IMPORTANCE", "FIELD_TYPE" => "string"), "IS_MEETING" => array("FIELD_NAME" => "CE.IS_MEETING", "FIELD_TYPE" => "string"), "MEETING_HOST" => array("FIELD_NAME" => "CE.MEETING_HOST", "FIELD_TYPE" => "int"), "MEETING" => array("FIELD_NAME" => "CE.MEETING", "FIELD_TYPE" => "string"), "LOCATION" => array("FIELD_NAME" => "CE.LOCATION", "FIELD_TYPE" => "string"), "REMIND" => array("FIELD_NAME" => "CE.REMIND", "FIELD_TYPE" => "string"), "EXTERNAL_ID" => array("FIELD_NAME" => "CE.EXTERNAL_ID", "FIELD_TYPE" => "string"), "COLOR" => array("FIELD_NAME" => "CE.COLOR", "FIELD_TYPE" => "string"), "TEXT_COLOR" => array("FIELD_NAME" => "CE.TEXT_COLOR", "FIELD_TYPE" => "string"), "RRULE" => array("FIELD_NAME" => "CE.RRULE", "FIELD_TYPE" => "string"), "EXRULE" => array("FIELD_NAME" => "CE.EXRULE", "FIELD_TYPE" => "string"), "RDATE" => array("FIELD_NAME" => "CE.RDATE", "FIELD_TYPE" => "string"), "EXDATE" => array("FIELD_NAME" => "CE.EXDATE", "FIELD_TYPE" => "string"), "ATTENDEES_CODES" => array("FIELD_NAME" => "CE.ATTENDEES_CODES", "FIELD_TYPE" => "string"), "DAV_XML_ID" => array("FIELD_NAME" => "CE.DAV_XML_ID", "FIELD_TYPE" => "string"), "DAV_EXCH_LABEL" => array("FIELD_NAME" => "CE.DAV_EXCH_LABEL", "FIELD_TYPE" => "string"), "CAL_DAV_LABEL" => array("FIELD_NAME" => "CE.CAL_DAV_LABEL", "FIELD_TYPE" => "string"), "VERSION" => array("FIELD_NAME" => "CE.VERSION", "FIELD_TYPE" => "string"));
        }
        CTimeZone::Enable();
        return self::$Fields;
    }
    public static function GetList($Params = array())
    {
        global $DB, $USER_FIELD_MANAGER;
        $getUF = $Params['getUserfields'] !== false;
        $checkPermissions = $Params['checkPermissions'] !== false;
        $bCache = CCalendar::CacheTime() > 0;
        $bCache = false;
        $Params['setDefaultLimit'] = $Params['setDefaultLimit'] === true;
        $userId = isset($Params['userId']) ? intVal($Params['userId']) : CCalendar::GetCurUserId();
        CTimeZone::Disable();
        if ($bCache) {
            $cache = new CPHPCache();
            if ($checkPermissions) {