This file contains hidden or 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 | |
| // Получить список товаров у сделки или лида bitrix 24 коробка | |
| // D = Deal, L = Lead; | |
| if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true){ | |
| require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); | |
| } | |
| CModule::IncludeModule("crm"); | |
| CCrmProductRow::LoadRows($ownerType = 'D', $ownerID = $deal_id, $assoc = false); |
This file contains hidden or 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
| <script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| var tableToExcel = (function () { | |
| // Define your style class template. | |
| var style = "<style>.title{font-size:18px;}.smetaTable{box-sizing: border-box;width: 100%;}.green{background-color: #31869B; color: #ffffff;}.brown{background-color:#FABF8F;font-weight:bold;font-size:13px;}.leftimg{position: absolute;margin-top:-20px}" | |
| +".rightimg{position: absolute;}" | |
| +".relative{position: relative;height:40px;}</style>"; | |
| var uri = 'data:application/vnd.ms-excel;base64,' | |
| , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook |
This file contains hidden or 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 (!empty($productID)) { | |
| $rows[] = [ | |
| 'PRODUCT_ID' => $productID, //id товара | |
| 'QUANTITY' => 1, //количество | |
| ]; | |
| if ( CCrmProductRow::SaveRows('D', $deal_id, $rows) ) { | |
| writeToLog('Success', 'add to deal'); | |
| }else { |
This file contains hidden or 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 | |
| require_once (__DIR__.'/settings.php'); // define('C_REST_WEB_HOOK_URL','https://domain.bitrix24.ru/rest/_userId_/_token_/'); | |
| /** | |
| * @version 1.36 | |
| * define: | |
| * C_REST_WEB_HOOK_URL = 'https://rest-api.bitrix24.com/rest/1/doutwqkjxgc3mgc1/' //url on creat Webhook | |
| * or | |
| * C_REST_CLIENT_ID = 'local.5c8bb1b0891cf2.87252039' //Application ID |
This file contains hidden or 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"); | |
| } | |
| $order = \Bitrix\Sale\Order::load($order_id); | |
| $collection = $order->getShipmentCollection(); | |
| $shipment = $collection->getItemById($shipmentID); | |
| $statusId = $shipment->getField('ALLOW_DELIVERY'); |
This file contains hidden or 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. получаем корзину заказа |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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"); | |