• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/businessvalue.php
  • Класс: BitrixSaleBusinessValueConsumer1C
  • Вызов: BusinessValueConsumer1C::getJavaScript
static function getJavaScript()
{
	return '
		var bizvalAdd1CRekv = (function (personMaxIndex) {
			"use strict";
			return function(anchor, personTypeId, sample)
			{
				var myRow  = anchor.parentNode.parentNode,
					table  = myRow.parentNode,
					newRow = document.createElement("tr");

				if (typeof personMaxIndex[personTypeId] === "undefined")
					personMaxIndex[personTypeId] = 0;
				else
					personMaxIndex[personTypeId] ++;

				newRow.innerHTML = sample.replace(/##CODE_INDEX##/g, personMaxIndex[personTypeId]);

				table.insertBefore(newRow, myRow);
			};
		})('.(self::$personMaxIndex ? CUtil::PhpToJSObject(self::$personMaxIndex) : '{}').');
	';
}