Рубрики
Map Yandex

Удалить только маркеры с карты

myMap = new ymaps.Map («YMapsID», {
center: [55.75, 37.62],
zoom: 10
}),
polygon = new ymaps.GeoObject({
geometry: {
type: «Polygon»,
coordinates: []
}
});

myMap.geoObjects.each(function (obj) {
if (obj.geometry.getType() === ‘Point’) {
myMap.geoObjects.remove(obj);
}
});

Рубрики
Bitrix

Включить возможность генерировать ORM для таблиц битрикс из админки во вкладке Таблицы

добавьте в адресную строку GET-параметр orm=y. Адрес будет выглядеть так: http://_ваш_сайт_/bitrix/admin/perfmon_tables.php?lang=ru&orm=y

После включения генератора таблетов на странице Настройки > Производительность > Таблицы в меню действий станет доступен пункт ORM.

Рубрики
Bitrix centos linux

Nodemon Error: «System limit for number of file watchers reached»

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Источник: https://stackoverflow.com/questions/53930305/nodemon-error-system-limit-for-number-of-file-watchers-reached

Рубрики
Bitrix JS

Битрикс JS

Источник: https://prominado.ru/blog/bitriks-js/

Рубрики
Без рубрики
if(params._id == "UF_TYPE_MALFUNCTION") {
controlTypeMalfunction = BX.Crm.EntityEditor.defaultInstance.getControlById("UF_TYPE_MALFUNCTION");
if(controlTypeMalfunction.isActive()) {
var selVal = $("select[name=UF_TYPE_MALFUNCTION]").val();
if(selVal == "") {
$("select[name=UF_SIGN_MALFUNCTION] option").each(function(){
$(this).prop("selected", false);
$(this).hide();
})
$("select[name=UF_SIGN_MALFUNCTION]").trigger("chosen:updated");
}
}
}
if(params._id == "UF_SIGN_MALFUNCTION") {
controlSignMalfunction = BX.Crm.EntityEditor.defaultInstance.getControlById("UF_SIGN_MALFUNCTION");
if($("select[name=UF_SIGN_MALFUNCTION]").length > 0) {
var selVal = $("select[name=UF_SIGN_MALFUNCTION]").val();
if(selVal != "") {
if(!controlTypeMalfunction.isActive()) {
$("select[name=UF_SIGN_MALFUNCTION] option").each(function(){
if(!$(this).prop("selected")) {
$(this).hide();
}
});
BX.Crm.EntityEditor.defaultInstance.switchControlMode(controlTypeMalfunction, BX.UI.EntityEditorMode.edit);
BX.showWait($("div[data-cid=UF_TYPE_MALFUNCTION]")[0]);
BX.showWait($("div[data-cid=UF_SIGN_MALFUNCTION]")[0]);
BX.ajax({
url : "/local/ajax/crm.lead.detail/getSignMalfunctions.php",
data: {selElemID: selVal, neddedType: "TYPE"},
method: "POST",
dataType: "json",
timeout: 30,
async: true,
processData: true,
scriptsRunFirst: true,
emulateOnload: true,
start: true,
cache: false,
onsuccess: function(data){
setTimeout(() => {
$("select[name=UF_TYPE_MALFUNCTION] option").each(function(){
if($(this).attr("value") == "")
return true;

if($.inArray($(this).attr("value"), data.typeMalfunction) >= 0) {
selVal = $(this).attr("value");
$(this).prop("selected", true);
} else {
$(this).prop("selected", false);
}
});
$("select[name=UF_TYPE_MALFUNCTION]").trigger("chosen:updated");
BX.closeWait($("div[data-cid=UF_TYPE_MALFUNCTION]")[0]);

BX.ajax({
url : "/local/ajax/crm.lead.detail/getSignMalfunctions.php",
data: {selElemID: selVal, neddedType: "SIGN"},
method: "POST",
dataType: "json",
timeout: 30,
async: true,
processData: true,
scriptsRunFirst: true,
emulateOnload: true,
start: true,
cache: false,
onsuccess: function(data){
updateSelectedOptions("UF_SIGN_MALFUNCTION", data.signMalfunction);
}
});
}, "500");
}
});
} else {
selVal = $("select[name=UF_TYPE_MALFUNCTION]").val();
BX.showWait($("div[data-cid=UF_SIGN_MALFUNCTION]")[0]);
BX.ajax({
url : "/local/ajax/crm.lead.detail/getSignMalfunctions.php",
data: {selElemID: selVal, neddedType: "SIGN"},
method: "POST",
dataType: "json",
timeout: 30,
async: true,
processData: true,
scriptsRunFirst: true,
emulateOnload: true,
start: true,
cache: false,
onsuccess: function(data){
updateSelectedOptions("UF_SIGN_MALFUNCTION", data.signMalfunction);
}
});
}
} else {
$("select[name=UF_SIGN_MALFUNCTION] option").each(function(){
$(this).prop("selected", false);
$(this).hide();
});

if(!controlTypeMalfunction.isActive()) {
BX.Crm.EntityEditor.defaultInstance.switchControlMode(controlTypeMalfunction, BX.UI.EntityEditorMode.edit);
BX.showWait($("div[data-cid=UF_SIGN_MALFUNCTION]")[0]);
setTimeout(() => {
BX.ajax({
url : "/local/ajax/crm.lead.detail/getSignMalfunctions.php",
data: {selElemID: $("select[name=UF_TYPE_MALFUNCTION").val(), neddedType: "SIGN"},
method: "POST",
dataType: "json",
timeout: 30,
async: true,
processData: true,
scriptsRunFirst: true,
emulateOnload: true,
start: true,
cache: false,
onsuccess: function(data){
updateSelectedOptions("UF_SIGN_MALFUNCTION", data.signMalfunction);
}
});
}, "500");
} else {
selVal = $("select[name=UF_TYPE_MALFUNCTION]").val();
if(selVal != "") {
BX.showWait($("div[data-cid=UF_SIGN_MALFUNCTION]")[0]);
BX.ajax({
url: "/local/ajax/crm.lead.detail/getSignMalfunctions.php",
data: {selElemID: selVal, neddedType: "SIGN"},
method: "POST",
dataType: "json",
timeout: 30,
async: true,
processData: true,
scriptsRunFirst: true,
emulateOnload: true,
start: true,
cache: false,
onsuccess: function (data) {
updateSelectedOptions("UF_SIGN_MALFUNCTION", data.signMalfunction);
}
});
}
}
}
}
}
Рубрики
Без рубрики

VS code подключение по SSH ошибки

ssh-keygen -R 192.168.1.123

How to fix warning about ECDSA host key

«Offending ECDSA key in»

Источник: https://superuser.com/questions/421004/how-to-fix-warning-about-ecdsa-host-key

ssh-keygen -l -F <domain_or_IP_address>

How to fix warning about ECDSA host keyCheck the fingerprint for the ECDSA key sent by the remote host [closed]

«ECDSA key fingerprint is»

Источник: https://serverfault.com/questions/690855/check-the-fingerprint-for-the-ecdsa-key-sent-by-the-remote-host

Рубрики
nodejs Без рубрики

Установка Node js Centos 7

Источник: https://linuxize.com/post/how-to-install-node-js-on-centos-7/

Рубрики
Composer OpenServer

Установка composer рядом с openserver

Источник: http://nikolaev-web.ru/blog/installing_the_composer_on_openServer/

Рубрики
PhpPresentation

Создание таблицы в powerpoint PHP

<?php 
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\Shape;
use PhpOffice\PhpPresentation\Shape\Drawing;
use PhpOffice\PhpPresentation\Style\Alignment;
use PhpOffice\PhpPresentation\Style\Bullet;
use PhpOffice\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\Style\Border;
use PhpOffice\PhpPresentation\Style\Fill;

$rowHeight = 0;
$rowCount = count($valuesArray);
$SlideHeight = 514;
$tableHeaderTop = 115;
$HeaderRowHeight = 50;
$AccountName = 'XYZ';
$currentSlide = createTemplatedSlide($objPHPPresentation);
createCommonHeading($objPHPPresentation, $currentSlide, "TEAM", $AccountName);
foreach ($valuesArray as $key => $val) {
    $row = $tableShape->createRow();

    $row->setHeight(40);
    $rowHeight += $row->getHeight();
    $rowCount --;


        $rowNumber++;
        
        if ($key % 2 == 0)
            $row->getFill()->setFillType(Fill::FILL_SOLID)->setRotation(90)->setStartColor(new Color('FFcbcdd4'))->setEndColor(new Color('FFcbcdd4'));
        else
            $row->getFill()->setFillType(Fill::FILL_SOLID)->setRotation(90)->setStartColor(new Color('FFe7e8eb'))->setEndColor(new Color('FFe7e8eb'));
 
        foreach ($val as $k => $v) {
            $textAlignment = Alignment::HORIZONTAL_CENTER;
             $oCell = $row->nextCell();
            $oCell->setWidth(200);
             $oCell->getActiveParagraph()->getAlignment()
                ->setMarginLeft(3)
                ->setMarginRight(3)
                ->setMarginTop(3)
                ->setMarginBottom(3);
                 createCommonTextRun($oCell, 7, $bold, "Montserrat", 0, $v);
            }
            
            
            $currentHeight = $tableHeaderTop + $HeaderRowHeight + $rowHeight;
              if ($currentHeight > $SlideHeight && $rowCount > 0) {
                    $currentSlide = createTemplatedSlide($objPHPPresentation);
                    createCommonHeading($objPHPPresentation, $currentSlide, $headingText, $AccountName);
                    $tableShape = createCommonTable($currentSlide, count($tableHeaderData));
                    createCommonTableHeaderRows($tableShape, $tableHeaderData, $Module);
              
                $rowHeight = 0;
              }
            
            
}


function createCommonTextRun($shape, $size, $setBold, $textStyle, $characterSpacing, $content, $color = null) {

$textRun = $shape->createTextRun($content);
$textRun->getFont()->setBold($setBold)
                   ->setName($textStyle);
$textRun->getFont()->setCharacterSpacing($characterSpacing);
$textRun->getFont()->setSize($size);

if ($color != null)
    $textRun->getFont()->setColor($color);
}

function createTemplatedSlide(PhpOffice\PhpPresentation\PhpPresentation $objPHPPresentation) {
// Create slide
$slide = $objPHPPresentation->createSlide();

// Return slide
return $slide;
}

function createCommonTable($currentSlide, $columnsCount, $continue = FALSE, $Module = "") {
$tableShape = $currentSlide->createTableShape($columnsCount);


return $tableShape;
}
function createCommonTextShape($slide, $height, $width, $offsetX, $offsetY, $horizontalAlignment) {
$shape = $slide->createRichTextShape();
$shape->setHeight($height);
$shape->setWidth($width);
$shape->setOffsetX($offsetX);
$shape->setOffsetY($offsetY);
$shape->getActiveParagraph()->getAlignment()->setHorizontal($horizontalAlignment);

return $shape;
 }

 function createCommonHeading($objPHPPresentation, $currentSlide, $headingText, $AccountName, $Module = "") {
$slideIndex = $objPHPPresentation->getSlideCount();
$headingTextColor = '#000';
$headingAlignment = Alignment::HORIZONTAL_CENTER;
$headingShape = createCommonTextShape($currentSlide, 100, 700, 125, 20, $headingAlignment);
createCommonTextRun($headingShape, 18, false, "Montserrat", 0, $headingText, $headingTextColor);

}
  
function createCommonTableHeaderRows($tableShape, $tableHeaderData, $Module) {
$totalColumns = count($tableHeaderData);
$topWidth = 2;
$row = $tableShape->createRow();

$row->setHeight(50);
$row->getFill()->setFillType(Fill::FILL_SOLID)->setRotation(90)->setStartColor(new Color('FF002f6c'))->setEndColor(new Color('FF002f6c'));
for ($i = 0; $i < $totalColumns; $i++) {
$oCell = $row->nextCell();
    createCommonTextRun($oCell, 9, false, "Montserrat", 0, $tableHeaderData[$i], $cellTextColor);
    $oCell->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_CENTER)->setHorizontal( Alignment::HORIZONTAL_CENTER );
}

}

Источник: https://stackoverflow.com/questions/67055269/phpoffice-phppresentation-row-height-issue-on-creating-ppt-with-tables

Рубрики
Без рубрики

Получить группы пользователя

Источник: https://g-rain-design.ru/blog/posts/d7-orm-user-group/