Skip to content

Instantly share code, notes, and snippets.

View alexey-kar's full-sized avatar

Alexey Karchevskii alexey-kar

View GitHub Profile
<div class="modal fade" id="modal-order_additional" tabindex="-1" role="dialog" aria-labelledby="modal-order_addition-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modal-order_additional-label">Оставить предварительную заявку на дополнение</h4>
</div>
<div class="modal-body">
<form id="get-additional-form">
<input type="hidden" name="get-additional-form" value="">
<div class="modal fade" id="modal-createbill" tabindex="-1" role="dialog" aria-labelledby="modal-createbill-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="modal-createbill-label"></h4>
</div>
<div class="modal-body">
<form action="" method="POST" id="form_get_invoice">
<input type="text" class="hidden solution-type" name="form-title" value="" data-solutiontype="">
public function Task($messageId, $date = '')
{
if (!CModule::IncludeModule("tasks"))
return false;
$CIMMessage = new CIMMessage($this->user_id);
$message = $CIMMessage->GetMessage($messageId, true);
if (!$message)
return false;
$arSelect = array('ID', 'IBLOCK_ID', 'NAME', 'PROPERTY_*');
$arFilter = array(
'IBLOCK_ID' => $iblock_id,
/*'ACTIVE_DATE'=>'Y',*/
'ACTIVE' => 'Y',
'CHECK_PERMISSIONS' => 'Y',
'MIN_PERMISSION' => 'R',
'PERMISSIONS_BY' => $USER->GetID(),
);
@alexey-kar
alexey-kar / Сортировка поля строка как число
Last active January 17, 2018 19:04
При стандартной сортировке если свойство типа Строка, то сортировка по нему производится как по строке, даже если там число, этот код даёт возможность сортировать поле Строка как Число
<?
$iblockId = 173;
$entityPropsSingle = \Bitrix\Main\Entity\Base::compileEntity(
sprintf('PROPS_SINGLE_%s', $iblockId),
[
'IBLOCK_ELEMENT_ID' => ['data_type' => 'integer'],
'PROPERTY_661' => ['data_type' => 'integer'],
],
[
@alexey-kar
alexey-kar / mcart.myintegration->install->index.php
Created January 22, 2018 22:37
Create recovery agent for module agents
<?
IncludeModuleLangFile(__FILE__);
if (class_exists('mcart_myintegration'))
return;
class mcart_myintegration extends CModule
{
public $MODULE_ID = 'mcart.myintegration';
<?
namespace MCArt\Olap;
use Bitrix\Main\Entity;
IncludeModuleLangFile(__FILE__);
/*
https://dev.1c-bitrix.ru/support/forum/forum6/topic60926/
@alexey-kar
alexey-kar / olap
Last active January 23, 2018 18:14
SELECT * FROM OPENQUERY([SSAS_DashboardCRM_MCART],
'SELECT
NON EMPTY [Сотрудники].[Сотрудник].[Сотрудник] ON ROWS,
{[Measures].[Оборот план], [Measures].[Оборот факт]} ON COLUMNS
FROM [DashboardCRM]
WHERE ([Даты].[ГМ].[Месяц].&[2017411], [UserLogin].[Parent Login].&[\\RUSKLIMAT\\varivoda_i])')
SELECT * FROM OPENQUERY([SSAS_DashboardCRM_MCART],
'SELECT
{[Measures].[Долг Руб], [Measures].[Долг Руб Проср]} ON COLUMNS
FROM [DashboardCRM]
WHERE ([UserLogin].[Parent Login].&[\\RUSKLIMAT\varivoda_i])
')
http://php.net/manual/ru/function.register-shutdown-function.php - создать хэндлер по завершению скрипта, внутри посмотреть ошибку
внутри него код
function shutdown()
{
if(!is_null($e = error_get_last()))
{
header('content-type: text/plain');
print "this is not html:\n\n". print_r($e,true);