This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
архивирование файлов с исключением папок, файлов: | |
tar -zcpvf site.tar.gz --exclude={upload/video,bitrix/backup,bitrix/cache,bitrix/managed_cache,/.git,/upload} | |
zip -r apps.zip ../apps -x "**/vendor/*" -x "**/logs/*" -x "**/log/*" -x "**/.idea/*" -x "**/upload/*" -x "**/uploads/*" -x "**/.git/*" -x "**/cache/*" -x "**/bundles/*" -x "**/bundle/*" -x "*.sqlite" -x "*.tar" -x "*.zip" -x "*.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$hlbl = 6; | |
$hlblock = HL\HighloadBlockTable::getById($hlbl)->fetch(); | |
$entity = HL\HighloadBlockTable::compileEntity($hlblock); | |
$entity_data_class = $entity->getDataClass(); | |
$rsData = $entity_data_class::getList(array( | |
"select" => array( | |
"*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$options = new \Bitrix\Main\Grid\Options('catering_events'); | |
$options->deleteView("default"); | |
$options = new \Bitrix\Main\Grid\Options('catering_events'); | |
$options->setAdditionalPresetFields($arFilterFields); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# Подключаем модуль: | |
\Bitrix\Main\Loader::includeModule('iblock'); | |
# Делаем запрос в таблицу элементов инфоблока | |
$dbItems = \Bitrix\Iblock\ElementTable::getList(array( | |
'order' => array('SORT' => 'ASC'), // сортировка | |
'select' => array('ID', 'NAME', 'IBLOCK_ID', 'SORT', 'TAGS'), // выбираемые поля, без свойств. Свойства можно получать на старом ядре \CIBlockElement::getProperty | |
'filter' => array('IBLOCK_ID' => 4), // фильтр только по полям элемента, свойства (PROPERTY) использовать нельзя |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let originalBxOnCustomEvent = BX.onCustomEvent; | |
BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) | |
{ | |
let realEventName = BX.type.isString(eventName) ? | |
eventName : BX.type.isString(eventObject) ? eventObject : null; | |
let i = 0; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); | |
} | |
use Bitrix\Main\UserTable; | |
CModule::IncludeModule("timeman"); | |
$obImport = new Bitrix\Timeman\Monitor\Utils\Department; | |
$tsokDepartmentList = $obImport->getSubordinateDepartments("20"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
CModule::IncludeModule("crm"); | |
$companyIds = [76885,76951,77060]; | |
$res = Bitrix\Crm\Integration\Sender\Segment::uploadAction( | |
$segmentId = null, | |
'COMPANY', | |
$entities = $companyIds, | |
$gridId = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$trace_id = \Bitrix\Crm\Tracking\Internals\TraceTable::add(['SOURCE_ID'=>123]); // сначала необходимо создать трейс. SOURCE_ID - это id источники сквозной аналитики. не путать с обычным SOURCE_ID | |
$result = \Bitrix\Crm\Tracking\Internals\TraceEntityTable::add(['TRACE_ID' => $trace_id->getID(), 'ENTITY_TYPE_ID' => \CCrmOwnerType::Lead, 'ENTITY_ID' => '__LEAD_ID__']); // привязываем трейс к сущности |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A simple PHP BBCode Parser function | |
* | |
* @author Afsal Rahim | |
* @link http://digitcodes.com/create-simple-php-bbcode-parser-function/ | |
**/ | |
//BBCode Parser function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true){ | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); | |
} | |
// 1. получаем заказ | |
$order = \Bitrix\Sale\Order::load($order_id); | |
// 2. получаем корзину заказа |