diff --git a/bitrix/php_interface/init.php b/bitrix/php_interface/init.php
index 6a9b729..7892f9f 100644
--- a/bitrix/php_interface/init.php
+++ b/bitrix/php_interface/init.php
@@ -249,4 +249,184 @@ function zerof_get_images($task_uid)
return $images;
}
+//AddEventHandler("iblock", "OnBeforeIBlockElementAdd", "OnBeforeIBlockElementAddHandler");
+//AddEventHandler("iblock", "OnAfterIBlockElementAdd", "OnAfterIBlockElementAddHandler");
+//AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", "OnBeforeIBlockElementUpdateHandler");
+
+function OnBeforeIBlockElementAddHandler(&$arFields)
+{
+ $iblocks_array = [
+ IBLOCK_ID_SPECIALS => "specials",
+ IBLOCK_ID_NEWS => "news",
+ IBLOCK_ID_SLIDER => "slider",
+ IBLOCK_ID_SPECIAL_OFFERS_BANNERS => "special_offers_banner",
+ IBLOCK_ID_SPECIAL_OFFERS_CARS => "special_offers_car_banner",
+ IBLOCK_ID_BANNERS_INNER => "banner_inner",
+ ];
+
+ if(array_key_exists($arFields['IBLOCK_ID'], $iblocks_array))
+ {
+ file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_add.txt", var_export($arFields, true));
+
+ $res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
+ $properties = [];
+
+ while($res_arr = $res->GetNext())
+ {
+ $properties[$res_arr['CODE']] = $res_arr['ID'];
+ }
+
+ if(isset($properties['ADVERTISING']))
+ {
+ if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
+ {
+ //снимаем элемент с публикации по умолчанию
+ $arFields['ACTIVE'] = "N";
+ }
+ else
+ {
+ $arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ 'n0' => [ 'VALUE' => '' ]];
+ }
+ }
+ }
+
+ return true;
+}
+
+function OnAfterIBlockElementAddHandler(&$arFields)
+{
+ $iblocks_array = [
+ IBLOCK_ID_SPECIALS => "specials",
+ IBLOCK_ID_NEWS => "news",
+ IBLOCK_ID_SLIDER => "slider",
+ IBLOCK_ID_SPECIAL_OFFERS_BANNERS => "special_offers_banner",
+ IBLOCK_ID_SPECIAL_OFFERS_CARS => "special_offers_car_banner",
+ IBLOCK_ID_BANNERS_INNER => "banner_inner",
+ ];
+
+ if(array_key_exists($arFields['IBLOCK_ID'], $iblocks_array))
+ {
+ if(isset($properties['ADVERTISING']))
+ {
+ if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
+ {
+ if(!is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']]))
+ {
+ //если ERIR пуст
+ //запускаем получение ЕРИР
+ $arFields['ACTIVE'] = "Y";
+ $arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0] => [ 'VALUE' => '' ]];
+ }
+ }
+ }
+
+ $res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
+ $properties = [];
+
+ while($res_arr = $res->GetNext())
+ {
+ $properties[$res_arr['CODE']] = $res_arr['ID'];
+ }
+
+ if(isset($properties['ADVERTISING']))
+ {
+ if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
+ {
+ //запускаем получение ЕРИР
+ $element = new CIBlockElement;
+ $result = $element->Update($arFields['ID'], [ "ACTIVE" => "Y" ]);
+
+ CIBlockElement::SetPropertyValuesEx($arFields['ID'], $arFields['IBLOCK_ID'], [
+ "ADVERTISING_ERIR" => "12345",
+ "ADVERTISING_SAMPLE_URL" => "67890",
+ ], []);
+
+ //ставим элемент на публикацию
+ $arFields['ACTIVE'] = "Y";
+ }
+ }
+ }
+
+ return true;
+}
+
+function OnBeforeIBlockElementUpdateHandler(&$arFields)
+{
+ $iblocks_array = [
+ IBLOCK_ID_SPECIALS => "specials",
+ IBLOCK_ID_NEWS => "news",
+ IBLOCK_ID_SLIDER => "slider",
+ IBLOCK_ID_SPECIAL_OFFERS_BANNERS => "special_offers_banner",
+ IBLOCK_ID_SPECIAL_OFFERS_CARS => "special_offers_car_banner",
+ IBLOCK_ID_BANNERS_INNER => "banner_inner",
+ ];
+
+ if(array_key_exists($arFields['IBLOCK_ID'], $iblocks_array))
+ {
+ $res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
+ $properties = [];
+
+ while($res_arr = $res->GetNext())
+ {
+ $properties[$res_arr['CODE']] = $res_arr['ID'];
+ }
+
+ if(isset($properties['ADVERTISING']))
+ {
+ if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
+ {
+ if($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']][array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0]]['VALUE'] === "")
+ {
+ //это реклама, ЕРИР нет и его надо получить
+ /*
+ CIBlockElement::SetPropertyValuesEx($arFields['ID'], $arFields['IBLOCK_ID'], [
+ "ADVERTISING_ERIR" => "12345",
+ "ADVERTISING_SAMPLE_URL" => "67890",
+ ], []);
+ */
+
+ $response_str = file_get_contents("https://evo.quickcode.ru/advertising/".$iblocks_array[$arFields['IBLOCK_ID']]."?id=".$arFields['ID']."");
+ $response = json_decode($response_str, true);
+
+ file_put_contents($_SERVER['DOCUMENT_ROOT']."/adv_response.txt", var_export($response, true));
+
+ $arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0]."" => [ 'VALUE' => $response['erir'] ] ];
+ $arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']])[0]."" => [ 'VALUE' => $response['sample'] ] ];
+
+ file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_update.txt", var_export($arFields, true));
+ }
+ }
+ else
+ {
+ //очистка ЕРИР и образца
+ $arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0]."" => [ 'VALUE' => '' ] ];
+ $arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']])[0]."" => [ 'VALUE' => '' ] ];
+
+ file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_update.txt", var_export($arFields, true));
+ }
+ }
+ }
+
+ /*
+ $res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
+ $properties = [];
+
+ while($res_arr = $res->GetNext())
+ {
+ $properties[$res_arr['CODE']] = $res_arr['ID'];
+ }
+
+ if(isset($properties['ADVERTISING']))
+ {
+ if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
+ {
+
+ }
+ }
+ file_put_contents($_SERVER['DOCUMENT_ROOT']."/iblock_properties.txt", var_export($properties, true));
+ */
+
+ return true;
+}
+
?>
\ No newline at end of file
diff --git a/local/components/evolution/about.news.article/templates/.default/template.php b/local/components/evolution/about.news.article/templates/.default/template.php
index 5c2879f..97bda53 100644
--- a/local/components/evolution/about.news.article/templates/.default/template.php
+++ b/local/components/evolution/about.news.article/templates/.default/template.php
@@ -36,25 +36,32 @@ $APPLICATION->AddHeadString('
+
+ }
+ ?>
+
+
+ $tabControl->EndPrologContent();
+
+ $tabControl->BeginEpilogContent();
+
+echo bitrix_sessid_post();
+echo GetFilterHiddens("find_");?>
+
+
+
+
+
+0 && !$bCopy)
+{
+ ?>
+}
+if ($bCopy)
+{
+ ?>
+}
+elseif ($copyID > 0)
+{
+ ?>
+}
+
+if ($bCatalog)
+{
+ CCatalogAdminTools::showFormParams();
+}
+//TODO: $IBLOCK_SECTION_ID - it's crutch
+?>
+
+
+
+$tabControl->EndEpilogContent();
+
+$customTabber->SetErrorState($bVarsFromForm);
+
+$arEditLinkParams = array(
+ "find_section_section" => $find_section_section
+);
+if ($bAutocomplete)
+{
+ $arEditLinkParams['lookup'] = $strLookup;
+}
+if ($adminSidePanelHelper->isPublicFrame())
+{
+ $arEditLinkParams["IFRAME"] = "Y";
+ $arEditLinkParams["IFRAME_TYPE"] = "PUBLIC_FRAME";
+}
+$tabControl->Begin(array(
+ "FORM_ACTION" => $urlBuilder->getElementSaveUrl(null, $arEditLinkParams)
+));
+
+$tabControl->BeginNextFormTab();
+ if($ID > 0 && !$bCopy)
+ {
+ $p = CIblockElement::GetByID($ID);
+ $pr = $p->ExtractFields("prn_");
+ }
+ else
+ {
+ $pr = array();
+ }
+
+if ($ID > 0 && !$bCopy)
+{
+ if (Loader::includeModule('crm'))
+ {
+ $importProduct = \Bitrix\Crm\Order\Import\Internals\ProductTable::getRow([
+ 'select' => ['SETTINGS'],
+ 'filter' => [
+ '=PRODUCT_ID' => CIBlockElement::GetRealElement($ID),
+ ],
+ ]);
+
+ if (!empty($importProduct))
+ {
+ $accountName = !empty($importProduct['SETTINGS']['account_name']) ? $importProduct['SETTINGS']['account_name'] : '';
+ $linkToProduct = !empty($importProduct['SETTINGS']['permalink']) ? $importProduct['SETTINGS']['permalink'] : '';
+
+ $tabControl->BeginCustomField('IMPORTED_FROM', GetMessage('IBLOCK_IMPORT_FROM').':');
+ ?>
+
+ | =$tabControl->GetCustomLabelHTML()?> |
+
+
+
+ =$accountName?>
+ =($linkToProduct ? "".GetMessage('IBLOCK_LINK_TO_MEDIA')."" : '')?>
+ |
+
+
+ $tabControl->EndCustomField('IMPORTED_FROM', '');
+ }
+ }
+}
+
+$tabControl->BeginCustomField("ID", "ID:");
+if ($ID > 0 && !$bCopy)
+{
+ ?>
+ | GetCustomLabelHTML()?> |
+ |
+
+}
+$tabControl->EndCustomField("ID", '');
+
+$tabControl->BeginCustomField("DATE_CREATE", GetMessage("IBLOCK_FIELD_CREATED").":");
+if ($ID > 0 && !$bCopy)
+{
+ if ($str_DATE_CREATE <> ''):?>
+
+ | echo $tabControl->GetCustomLabelHTML() ?> |
+ echo $str_DATE_CREATE ?>
+ if (intval($str_CREATED_BY) > 0):
+ if (!$adminSidePanelHelper->isPublicSidePanel()):
+ ?> [ echo $str_CREATED_BY ?>]
+ endif;
+ $rsUser = CUser::GetByID($str_CREATED_BY);
+ $arUser = $rsUser->Fetch();
+ if ($arUser):
+ echo ' '.CUser::FormatName($nameFormat, $arUser, false, true);
+ endif;
+ endif;
+ ?> |
+
+ EndCustomField("DATE_CREATE", '');
+
+$tabControl->BeginCustomField("TIMESTAMP_X", GetMessage("IBLOCK_FIELD_LAST_UPDATED").":");
+if ($ID > 0 && !$bCopy)
+{
+ ?>
+ | echo $tabControl->GetCustomLabelHTML() ?> |
+ echo $str_TIMESTAMP_X; ?>
+ if (intval($str_MODIFIED_BY) > 0):
+ if (!$adminSidePanelHelper->isPublicSidePanel()):
+ ?> [ echo $str_MODIFIED_BY ?>]
+ endif;
+ if (intval($str_CREATED_BY) != intval($str_MODIFIED_BY))
+ {
+ $rsUser = CUser::GetByID($str_MODIFIED_BY);
+ $arUser = $rsUser->Fetch();
+ }
+ if ($arUser)
+ {
+ echo ' ' . CUser::FormatName($nameFormat, $arUser, false, true);
+ }
+ endif ?> |
+
+}
+$tabControl->EndCustomField("TIMESTAMP_X", '');
+
+$tabControl->AddCheckBoxField("ACTIVE", GetMessage("IBLOCK_FIELD_ACTIVE").":", false, array("Y","N"), $str_ACTIVE=="Y");
+$tabControl->BeginCustomField("ACTIVE_FROM", GetMessage("IBLOCK_FIELD_ACTIVE_PERIOD_FROM"), $arIBlock["FIELDS"]["ACTIVE_FROM"]["IS_REQUIRED"] === "Y");
+?>
+
+ | GetCustomLabelHTML()?>: |
+ |
+
+
+$tabControl->EndCustomField("ACTIVE_FROM", '');
+$tabControl->BeginCustomField("ACTIVE_TO", GetMessage("IBLOCK_FIELD_ACTIVE_PERIOD_TO"), $arIBlock["FIELDS"]["ACTIVE_TO"]["IS_REQUIRED"] === "Y");
+?>
+
+ | GetCustomLabelHTML()?>: |
+ |
+
+
+
+$tabControl->EndCustomField("ACTIVE_TO", '');
+
+if($arTranslit["TRANSLITERATION"] == "Y")
+{
+ $tabControl->BeginCustomField("NAME", GetMessage("IBLOCK_FIELD_NAME").":", true);
+ ?>
+
+ | GetCustomLabelHTML()?> |
+
+ " class="linked" src="/bitrix/themes/.default/icons/iblock/" onclick="set_linked()" />
+ |
+
+
+ $tabControl->EndCustomField("NAME",
+ ''
+ );
+
+ $tabControl->BeginCustomField("CODE", GetMessage("IBLOCK_FIELD_CODE").":", $arIBlock["FIELDS"]["CODE"]["IS_REQUIRED"] === "Y");
+ ?>
+
+ | GetCustomLabelHTML()?> |
+
+ " class="linked" src="/bitrix/themes/.default/icons/iblock/" onclick="set_linked()" />
+ |
+
+
+ $tabControl->EndCustomField("CODE",
+ ''
+ );
+}
+else
+{
+ $tabControl->AddEditField("NAME", GetMessage("IBLOCK_FIELD_NAME").":", true, array("size" => 70, "maxlength" => 255), $str_NAME);
+ $tabControl->AddEditField("CODE", GetMessage("IBLOCK_FIELD_CODE").":", $arIBlock["FIELDS"]["CODE"]["IS_REQUIRED"] === "Y", array("size" => 70, "maxlength" => 255), $str_CODE);
+}
+
+if (
+ $arShowTabs['sections']
+ && $arIBlock["FIELDS"]["IBLOCK_SECTION"]["DEFAULT_VALUE"]["KEEP_IBLOCK_SECTION_ID"] === "Y"
+)
+{
+ $arDropdown = array();
+ if ($str_IBLOCK_ELEMENT_SECTION)
+ {
+ $sectionList = CIBlockSection::GetList(
+ array("left_margin"=>"asc"),
+ array("=ID"=>$str_IBLOCK_ELEMENT_SECTION),
+ false,
+ array("ID", "NAME")
+ );
+ while ($section = $sectionList->Fetch())
+ $arDropdown[$section["ID"]] = htmlspecialcharsEx($section["NAME"]);
+ }
+ $tabControl->BeginCustomField("IBLOCK_ELEMENT_SECTION_ID", GetMessage("IBEL_E_MAIN_IBLOCK_SECTION_ID").":", false);
+ ?>
+
+ | GetCustomLabelHTML()?> |
+
+
+
+
+
+ |
+
+
+ $tabControl->EndCustomField("IBLOCK_ELEMENT_SECTION_ID",
+ ''
+ );
+}
+
+if(COption::GetOptionString("iblock", "show_xml_id", "N")=="Y")
+{
+ if ($bCopy || $ID == 0)
+ {
+ $tabControl->BeginCustomField("XML_ID", GetMessage("IBLOCK_FIELD_XML_ID") . ":", $arIBlock["FIELDS"]["XML_ID"]["IS_REQUIRED"] === "Y");
+ ?>
+ |
+ =$tabControl->GetCustomLabelHTML(); ?> |
+
+
+ |
+
+ $tabControl->EndCustomField("XML_ID", '');
+ }
+ else
+ {
+ $tabControl->AddEditField("XML_ID", GetMessage("IBLOCK_FIELD_XML_ID") . ":", $arIBlock["FIELDS"]["XML_ID"]["IS_REQUIRED"] === "Y", array("size" => 70, "maxlength" => 255, "id" => "XML_ID"), $str_XML_ID);
+ }
+}
+
+$tabControl->AddEditField("SORT", GetMessage("IBLOCK_FIELD_SORT").":", $arIBlock["FIELDS"]["SORT"]["IS_REQUIRED"] === "Y", array("size" => 7, "maxlength" => 10), $str_SORT);
+
+if(!empty($PROP)):
+ if ($arIBlock["SECTION_PROPERTY"] === "Y" || defined("CATALOG_PRODUCT"))
+ {
+ $arPropLinks = array("IBLOCK_ELEMENT_PROP_VALUE");
+ if(is_array($str_IBLOCK_ELEMENT_SECTION) && !empty($str_IBLOCK_ELEMENT_SECTION))
+ {
+ foreach($str_IBLOCK_ELEMENT_SECTION as $section_id)
+ {
+ foreach(CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, $section_id) as $PID => $arLink)
+ $arPropLinks[$PID] = "PROPERTY_".$PID;
+ }
+ }
+ else
+ {
+ foreach(CIBlockSectionPropertyLink::GetArray($IBLOCK_ID, 0) as $PID => $arLink)
+ $arPropLinks[$PID] = "PROPERTY_".$PID;
+ }
+ $tabControl->AddFieldGroup("IBLOCK_ELEMENT_PROPERTY", GetMessage("IBLOCK_ELEMENT_PROP_VALUE"), $arPropLinks, $bPropertyAjax);
+ }
+
+ $tabControl->AddSection("IBLOCK_ELEMENT_PROP_VALUE", GetMessage("IBLOCK_ELEMENT_PROP_VALUE"));
+
+ foreach($PROP as $prop_code=>$prop_fields):
+ $prop_values = $prop_fields["VALUE"];
+ $tabControl->BeginCustomField("PROPERTY_".$prop_fields["ID"], $prop_fields["NAME"], $prop_fields["IS_REQUIRED"]==="Y");
+ ?>
+ " class="adm-detail-file-row">
+ | ">
+ endif;?>GetCustomLabelHTML();?>: |
+ GetFormName(), $bCopy);?> |
+
+
+ $hidden = "";
+ if(!is_array($prop_fields["~VALUE"]))
+ $values = Array();
+ else
+ $values = $prop_fields["~VALUE"];
+ $start = 1;
+ foreach($values as $key=>$val)
+ {
+ if($bCopy)
+ {
+ $key = "n".$start;
+ $start++;
+ }
+
+ if(is_array($val) && array_key_exists("VALUE",$val))
+ {
+ $hidden .= _ShowHiddenValue('PROP['.$prop_fields["ID"].']['.$key.'][VALUE]', $val["VALUE"]);
+ $hidden .= _ShowHiddenValue('PROP['.$prop_fields["ID"].']['.$key.'][DESCRIPTION]', $val["DESCRIPTION"] ?? '');
+ }
+ else
+ {
+ $hidden .= _ShowHiddenValue('PROP['.$prop_fields["ID"].']['.$key.'][VALUE]', $val);
+ $hidden .= _ShowHiddenValue('PROP['.$prop_fields["ID"].']['.$key.'][DESCRIPTION]', "");
+ }
+ }
+ $tabControl->EndCustomField("PROPERTY_".$prop_fields["ID"], $hidden);
+ endforeach;?>
+ 0 && !$bCopy))
+ {
+ $rsLinkedProps = CIBlockProperty::GetList(array(), array(
+ "PROPERTY_TYPE" => "E",
+ "LINK_IBLOCK_ID" => $IBLOCK_ID,
+ "ACTIVE" => "Y",
+ "FILTRABLE" => "Y",
+ ));
+ $arLinkedProp = $rsLinkedProps->GetNext();
+ if ($arLinkedProp && !$adminSidePanelHelper->isPublicSidePanel())
+ {
+ $linkedTitle = '';
+ $tabControl->BeginCustomField("LINKED_PROP", GetMessage("IBLOCK_ELEMENT_EDIT_LINKED"));
+ ?>
+
+ | GetCustomLabelHTML();?> |
+
+
+ if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1)
+ $linkedTitle = htmlspecialcharsbx(GetMessage('IBLOCK_LINKED_ELEMENT_TITLE'));
+ do
+ {
+ $elements_name = (string)CIBlock::GetArrayByID($arLinkedProp["IBLOCK_ID"], "ELEMENTS_NAME");
+ if ($elements_name == '')
+ $elements_name = GetMessage("IBLOCK_ELEMENT_EDIT_ELEMENTS");
+ ?>">
+
+ $href = $selfFolderUrl.htmlspecialcharsbx(CIBlock::GetAdminElementListLink($arLinkedProp["IBLOCK_ID"],
+ array('apply_filter'=>'Y', 'PROPERTY_'.$arLinkedProp["ID"]=>$ID, 'find_section_section' => -1)));
+ ?>
+ |
+
+ =htmlspecialcharsbx(CIBlock::GetArrayByID($arLinkedProp["IBLOCK_ID"], "NAME").": ".$elements_name);?>
+
+ |
+
+ }
+ while ($arLinkedProp = $rsLinkedProps->GetNext());
+ unset($linkedTitle);
+ $tabControl->EndCustomField("LINKED_PROP", "");
+ }
+ }
+
+$tabControl->BeginNextFormTab();
+$tabControl->BeginCustomField("PREVIEW_PICTURE", GetMessage("IBLOCK_FIELD_PREVIEW_PICTURE"), $arIBlock["FIELDS"]["PREVIEW_PICTURE"]["IS_REQUIRED"] === "Y");
+if($bVarsFromForm && !array_key_exists("PREVIEW_PICTURE", $_REQUEST) && $arElement)
+ $str_PREVIEW_PICTURE = intval($arElement["PREVIEW_PICTURE"]);
+?>
+
+ | GetCustomLabelHTML()?>: |
+
+ 0):
+ echo CFileInput::Show(
+ "PREVIEW_PICTURE",
+ $str_PREVIEW_PICTURE,
+ array(
+ "IMAGE" => "Y",
+ "PATH" => "Y",
+ "FILE_SIZE" => "Y",
+ "DIMENSIONS" => "Y",
+ "IMAGE_POPUP" => "Y",
+ "MAX_SIZE" => array(
+ "W" => COption::GetOptionString("iblock", "detail_image_size"),
+ "H" => COption::GetOptionString("iblock", "detail_image_size"),
+ )
+ )
+ );
+ else:
+ echo \Bitrix\Main\UI\FileInput::createInstance(array(
+ "name" => "PREVIEW_PICTURE",
+ "description" => true,
+ "upload" => true,
+ "allowUpload" => "I",
+ "medialib" => true,
+ "fileDialog" => true,
+ "cloud" => true,
+ "delete" => true,
+ "maxCount" => 1
+ ))->show(
+ ($bVarsFromForm ? $_REQUEST["PREVIEW_PICTURE"] : ($ID > 0 && !$bCopy ? $str_PREVIEW_PICTURE: 0)),
+ $bVarsFromForm
+ );
+ endif;?>
+ |
+
+
+$tabControl->EndCustomField("PREVIEW_PICTURE", "");
+$tabControl->BeginCustomField("PREVIEW_TEXT", GetMessage("IBLOCK_FIELD_PREVIEW_TEXT"), $arIBlock["FIELDS"]["PREVIEW_TEXT"]["IS_REQUIRED"] === "Y");
+?>
+
+ | GetCustomLabelHTML()?> |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+ 450,
+ 'width' => '100%'
+ ),
+ "N",
+ 0,
+ "",
+ "",
+ $arIBlock["LID"],
+ true,
+ false,
+ array(
+ 'toolbarConfig' => CFileMan::GetEditorToolbarConfig("iblock_".(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 ? 'public' : 'admin')),
+ 'saveEditorKey' => $IBLOCK_ID,
+ 'hideTypeSelector' => $arIBlock["FIELDS"]["PREVIEW_TEXT_TYPE_ALLOW_CHANGE"]["DEFAULT_VALUE"] === "N",
+ )
+ );?>
+ |
+
+
+
+ |
+
+
+
+
+ > / >
+
+ |
+
+
+ |
+
+ |
+
+ EndCustomField("PREVIEW_TEXT",
+ ''.
+ ''
+);
+$tabControl->BeginNextFormTab();
+$tabControl->BeginCustomField("DETAIL_PICTURE", GetMessage("IBLOCK_FIELD_DETAIL_PICTURE"), $arIBlock["FIELDS"]["DETAIL_PICTURE"]["IS_REQUIRED"] === "Y");
+if($bVarsFromForm && !array_key_exists("DETAIL_PICTURE", $_REQUEST) && $arElement)
+ $str_DETAIL_PICTURE = intval($arElement["DETAIL_PICTURE"]);
+?>
+
+ | GetCustomLabelHTML()?>: |
+
+ 0):
+ echo CFileInput::Show(
+ "DETAIL_PICTURE",
+ $str_DETAIL_PICTURE,
+ array(
+ "IMAGE" => "Y",
+ "PATH" => "Y",
+ "FILE_SIZE" => "Y",
+ "DIMENSIONS" => "Y",
+ "IMAGE_POPUP" => "Y",
+ "MAX_SIZE" => array(
+ "W" => COption::GetOptionString("iblock", "detail_image_size"),
+ "H" => COption::GetOptionString("iblock", "detail_image_size"),
+ )
+ )
+ );
+ else:
+ echo \Bitrix\Main\UI\FileInput::createInstance(array(
+ "name" => "DETAIL_PICTURE",
+ "description" => true,
+ "upload" => true,
+ "allowUpload" => "I",
+ "medialib" => true,
+ "fileDialog" => true,
+ "cloud" => true,
+ "delete" => true,
+ "maxCount" => 1
+ ))->show(
+ $bVarsFromForm ? $_REQUEST["DETAIL_PICTURE"] : ($ID > 0 && !$bCopy? $str_DETAIL_PICTURE: 0),
+ $bVarsFromForm
+ );
+ endif;?>
+ |
+
+
+$tabControl->EndCustomField("DETAIL_PICTURE", "");
+$tabControl->BeginCustomField("DETAIL_TEXT", GetMessage("IBLOCK_FIELD_DETAIL_TEXT"), $arIBlock["FIELDS"]["DETAIL_TEXT"]["IS_REQUIRED"] === "Y");
+?>
+
+ | GetCustomLabelHTML()?> |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+ 450,
+ 'width' => '100%'
+ ),
+ "N",
+ 0,
+ "",
+ "",
+ $arIBlock["LID"],
+ true,
+ false,
+ array(
+ 'toolbarConfig' => CFileMan::GetEditorToolbarConfig("iblock_".(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 ? 'public' : 'admin')),
+ 'saveEditorKey' => $IBLOCK_ID,
+ 'hideTypeSelector' => $arIBlock["FIELDS"]["DETAIL_TEXT_TYPE_ALLOW_CHANGE"]["DEFAULT_VALUE"] === "N",
+ )
+ );
+ ?> |
+
+
+
+ |
+
+
+
+
+ > / >
+
+ |
+
+
+ |
+
+ |
+
+
+
+$tabControl->EndCustomField("DETAIL_TEXT",
+ ''.
+ ''
+);
+ $tabControl->BeginNextFormTab();
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_META_TITLE", GetMessage("IBEL_E_SEO_META_TITLE"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_META_TITLE",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_META_TITLE", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_META_KEYWORDS", GetMessage("IBEL_E_SEO_META_KEYWORDS"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_META_KEYWORDS",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_META_KEYWORDS", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_META_DESCRIPTION", GetMessage("IBEL_E_SEO_META_DESCRIPTION"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_META_DESCRIPTION",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_META_DESCRIPTION", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_PAGE_TITLE", GetMessage("IBEL_E_SEO_ELEMENT_TITLE"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_PAGE_TITLE",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_PAGE_TITLE", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->AddSection("IPROPERTY_TEMPLATES_ELEMENTS_PREVIEW_PICTURE", GetMessage("IBEL_E_SEO_FOR_ELEMENTS_PREVIEW_PICTURE"));
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_PREVIEW_PICTURE_FILE_ALT", GetMessage("IBEL_E_SEO_FILE_ALT"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_PREVIEW_PICTURE_FILE_ALT",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_PREVIEW_PICTURE_FILE_ALT", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_PREVIEW_PICTURE_FILE_TITLE", GetMessage("IBEL_E_SEO_FILE_TITLE"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_PREVIEW_PICTURE_FILE_TITLE",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_PREVIEW_PICTURE_FILE_TITLE", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_PREVIEW_PICTURE_FILE_NAME", GetMessage("IBEL_E_SEO_FILE_NAME"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_PREVIEW_PICTURE_FILE_NAME",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_PREVIEW_PICTURE_FILE_NAME", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->AddSection("IPROPERTY_TEMPLATES_ELEMENTS_DETAIL_PICTURE", GetMessage("IBEL_E_SEO_FOR_ELEMENTS_DETAIL_PICTURE"));
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_DETAIL_PICTURE_FILE_ALT", GetMessage("IBEL_E_SEO_FILE_ALT"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_DETAIL_PICTURE_FILE_ALT",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_DETAIL_PICTURE_FILE_ALT", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_DETAIL_PICTURE_FILE_TITLE", GetMessage("IBEL_E_SEO_FILE_TITLE"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_DETAIL_PICTURE_FILE_TITLE",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_DETAIL_PICTURE_FILE_TITLE", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->BeginCustomField("IPROPERTY_TEMPLATES_ELEMENT_DETAIL_PICTURE_FILE_NAME", GetMessage("IBEL_E_SEO_FILE_NAME"));
+ ?>
+
+ | GetCustomLabelHTML()?> |
+ |
+
+
+ $tabControl->EndCustomField("IPROPERTY_TEMPLATES_ELEMENT_DETAIL_PICTURE_FILE_NAME",
+ IBlockInheritedPropertyHidden($IBLOCK_ID, "ELEMENT_DETAIL_PICTURE_FILE_NAME", $str_IPROPERTY_TEMPLATES, "E", GetMessage("IBEL_E_SEO_OVERWRITE"))
+ );
+ ?>
+
+ $tabControl->AddSection("SEO_ADDITIONAL", GetMessage("IBLOCK_EL_TAB_MO"));
+ $tabControl->BeginCustomField("TAGS", GetMessage("IBLOCK_FIELD_TAGS").":", $arIBlock["FIELDS"]["TAGS"]["IS_REQUIRED"] === "Y");
+ ?>
+
+ GetCustomLabelHTML()?>
|
+
+ Fetch())
+ $arLID[] = $arSite["LID"];
+ echo InputTags("TAGS", htmlspecialcharsback($str_TAGS), $arLID, 'size="55"');
+ else:?>
+
+
+ |
+
+
+ $tabControl->EndCustomField("TAGS",
+ ''
+ );
+
+ ?>
+
+BeginNextFormTab();
+
+ $tabControl->BeginCustomField("SECTIONS", GetMessage("IBLOCK_SECTION"), $arIBlock["FIELDS"]["IBLOCK_SECTION"]["IS_REQUIRED"] === "Y");
+ ?>
+
+
+
+ $l = CIBlockSection::GetTreeList(Array("IBLOCK_ID"=>$IBLOCK_ID), array("ID", "NAME", "DEPTH_LEVEL"));?>
+ | GetCustomLabelHTML()?> |
+
+
+ |
+
+
+ GetCustomLabelHTML()?> |
+
+
+ |
+
+
+ GetCustomLabelHTML()?> |
+
+
+
+
+ ..." onClick="jsUtils.OpenWindow('=$selfFolderUrl?>iblock_section_search.php?lang=&IBLOCK_ID=&n=input_IBLOCK_SECTION&m=y&iblockfix=y&tableId=iblocksection-=$IBLOCK_ID; ?>', 900, 700);">
+ |
+
+
+
+
+
+ $hidden = "";
+ if(is_array($str_IBLOCK_ELEMENT_SECTION))
+ foreach($str_IBLOCK_ELEMENT_SECTION as $section_id)
+ $hidden .= '';
+ $tabControl->EndCustomField("SECTIONS", $hidden);
+endif;
+
+if ($arShowTabs['product'])
+{
+ $tabControl->BeginNextFormTab();
+ $tabControl->BeginCustomField(
+ 'PRODUCT',
+ $catalogTabNames[CCatalogAdminTools::TAB_PRODUCT]['NAME'],
+ false
+ );
+
+ $iblockEditProduct = $ID > 0 && !$bCopy
+ ? CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, 'element_edit_price')
+ : CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $MENU_SECTION_ID, 'element_edit_price')
+ ;
+
+ $allowEdit = false;
+ if ($iblockEditProduct)
+ {
+ $allowEdit = $ID > 0 && !$bCopy
+ ? $allowProductEdit
+ : $allowProductAdd
+ ;
+ }
+
+ $product = [
+ 'ID' => $ID,
+ 'IBLOCK_ID' => $IBLOCK_ID,
+ 'TYPE' => Catalog\ProductTable::TYPE_SKU,
+ ];
+ $productConfig = [
+ 'FROM_FORM' => $bVarsFromForm,
+ 'ALLOW_EDIT' => $allowEdit,
+ ];
+
+ echo CCatalogAdminTools::getSystemProductFieldsHtml($product, $productConfig);
+
+ $tabControl->EndCustomField('PRODUCT', '');
+}
+
+if ($arShowTabs['catalog'])
+{
+ $tabControl->BeginNextFormTab();
+ $tabControl->BeginCustomField(
+ 'CATALOG',
+ $catalogTabNames[CCatalogAdminTools::TAB_CATALOG]['NAME'],
+ true
+ );
+ include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/admin/templates/product_edit.php");
+ $tabControl->EndCustomField("CATALOG", "");
+}
+
+if ($arShowTabs['sku'])
+{
+ $tabControl->BeginNextFormTab();
+ $tabControl->BeginCustomField('OFFERS', GetMessage("IBLOCK_EL_TAB_OFFERS"), false);
+ ?>|
+
+ define('B_ADMIN_SUBELEMENTS',1);
+ define('B_ADMIN_SUBELEMENTS_LIST',false);
+
+ $intSubIBlockID = $arMainCatalog['IBLOCK_ID'];
+ $arSubIBlock = CIBlock::GetArrayByID($intSubIBlockID);
+ $arSubIBlock["SITE_ID"] = array();
+ $rsSites = CIBlock::GetSite($intSubIBlockID);
+ while($arSite = $rsSites->Fetch())
+ $arSubIBlock["SITE_ID"][] = $arSite["LID"];
+ $strSubIBlockType = $arSubIBlock['IBLOCK_TYPE_ID'];
+ $arSubIBlockType = CIBlockType::GetByIDLang($strSubIBlockType, LANGUAGE_ID);
+
+ $boolIncludeOffers = CIBlockRights::UserHasRightTo($intSubIBlockID, $intSubIBlockID, "iblock_admin_display");
+ $arSubCatalog = CCatalogSku::GetInfoByOfferIBlock($arMainCatalog['IBLOCK_ID']);
+ $boolSubCatalog = (!empty($arSubCatalog) && is_array($arSubCatalog));
+ if (!$boolCatalogRead && !$boolCatalogPrice)
+ $boolSubCatalog = false;
+
+ $boolSubWorkFlow = Bitrix\Main\Loader::includeModule("workflow") && $arSubIBlock["WORKFLOW"] != "N";
+ $boolSubBizproc = Bitrix\Main\Loader::includeModule("bizproc") && $arSubIBlock["BIZPROC"] != "N";
+
+ $intSubPropValue = (0 == $ID || $bCopy ? '-'.$TMP_ID : $ID);
+ $strSubTMP_ID = $TMP_ID;
+
+ $additionalParams = (defined("SELF_FOLDER_URL") ? "&public=y" : "");
+ $strSubElementAjaxPath = '/bitrix/tools/iblock/iblock_subelement_admin.php?WF=Y&IBLOCK_ID=' . $intSubIBlockID
+ . '&type='.urlencode($strSubIBlockType) . '&lang=' . LANGUAGE_ID
+ . '&find_section_section=0&find_el_property_' . $arSubCatalog['SKU_PROPERTY_ID']
+ . '='.(0 == $ID || $bCopy ? '-' . $TMP_ID : $ID)
+ . '&TMP_ID=' . urlencode($strSubTMP_ID)
+ . '&urlBuilderId=' . urlencode($urlBuilderId)
+ . $additionalParams
+ ;
+ if ($boolIncludeOffers && file_exists($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/iblock/admin/templates/iblock_subelement_list.php'))
+ {
+ require($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/iblock/admin/templates/iblock_subelement_list.php');
+ }
+ else
+ {
+ ShowError(GetMessage('IBLOCK_EL_OFFERS_ACCESS_DENIED'));
+ }
+ ?> |
+ $tabControl->EndCustomField('OFFERS','');
+}
+
+if ($arShowTabs['product_set'])
+{
+ $tabControl->BeginNextFormTab();
+ $tabControl->BeginCustomField('PRODUCT_SET', GetMessage('IBLOCK_EL_PRODUCT_SET').':', false);
+ ?>|
+
+ $intProductID = (0 < $ID ? CIBlockElement::GetRealElement($ID) : 0);
+
+ $arSets = false;
+ CCatalogAdminProductSetEdit::setProductFormParams(array('TYPE' => CCatalogProductSet::TYPE_SET));
+ if (0 < $intProductID)
+ {
+ $arSets = CCatalogProductSet::getAllSetsByProduct($intProductID, CCatalogProductSet::TYPE_SET);
+ if ($bCopy)
+ CCatalogAdminProductSetEdit::clearOwnerSet($arSets);
+ }
+ if (empty($arSets))
+ $arSets = CCatalogAdminProductSetEdit::getEmptySet($intProductID);
+
+ if ($bVarsFromForm)
+ CCatalogAdminProductSetEdit::getFormValues($arSets);
+ CCatalogAdminProductSetEdit::addEmptyValues($arSets);
+
+ CCatalogAdminProductSetEdit::showEditForm($arSets);
+ ?> |
+ $tabControl->EndCustomField('PRODUCT_SET', '');
+}
+if ($arShowTabs['product_group'])
+{
+ $tabControl->BeginNextFormTab();
+ $tabControl->BeginCustomField('PRODUCT_GROUP', GetMessage('IBLOCK_EL_PRODUCT_GROUP').':', false);
+ ?>|
+
+ $intProductID = (0 < $ID ? CIBlockElement::GetRealElement($ID) : 0);
+
+ $arSets = false;
+ CCatalogAdminProductSetEdit::setProductFormParams(array('TYPE' => CCatalogProductSet::TYPE_GROUP));
+ if (0 < $intProductID)
+ {
+ $arSets = CCatalogProductSet::getAllSetsByProduct($intProductID, CCatalogProductSet::TYPE_GROUP);
+ if ($bCopy)
+ CCatalogAdminProductSetEdit::clearOwnerSet($arSets);
+ }
+ if (empty($arSets))
+ $arSets = CCatalogAdminProductSetEdit::getEmptySet($intProductID);
+ if ($bVarsFromForm)
+ CCatalogAdminProductSetEdit::getFormValues($arSets);
+ CCatalogAdminProductSetEdit::addEmptyValues($arSets);
+
+ CCatalogAdminProductSetEdit::showEditForm($arSets);
+
+ ?> |
+ $tabControl->EndCustomField('PRODUCT_GROUP', '');
+}
+if($arShowTabs['workflow']):?>
+
+ $tabControl->BeginNextFormTab();
+ $tabControl->BeginCustomField("WORKFLOW_PARAMS", GetMessage("IBLOCK_EL_TAB_WF_TITLE"));
+ if($pr["DATE_CREATE"] <> ''):
+ ?>
+
+ |
+
+ if (intval($pr["CREATED_BY"])>0):
+ ?> [">] =htmlspecialcharsex($pr["CREATED_USER_NAME"])?>
+ endif;
+ ?> |
+
+
+ '' && !$bCopy):?>
+
+ |
+
+ if (intval($str_MODIFIED_BY)>0):
+ ?> [] =$str_USER_NAME?>
+ endif;
+ ?> |
+
+
+ ''):?>
+
+ |
+
+ if (intval($prn_WF_LOCKED_BY)>0):
+ ?> [] =$prn_LOCKED_USER_NAME?>
+ endif;
+ ?> |
+
+ EndCustomField("WORKFLOW_PARAMS", "");
+ if ($WF=="Y" || $view=="Y"):
+ $tabControl->BeginCustomField("WF_STATUS_ID", GetMessage("IBLOCK_FIELD_STATUS").":");
+ ?>
+
+ | GetCustomLabelHTML()?> |
+
+ 0 && !$bCopy):?>
+
+
+
+
+ |
+
+
+ if($ID > 0 && !$bCopy)
+ $hidden = '';
+ else
+ {
+ $rsStatus = CWorkflowStatus::GetDropDownList("N", "desc");
+ $arDefaultStatus = $rsStatus->Fetch();
+ if($arDefaultStatus)
+ $def_WF_STATUS_ID = intval($arDefaultStatus["REFERENCE_ID"]);
+ else
+ $def_WF_STATUS_ID = "";
+ $hidden = '';
+ }
+ $tabControl->EndCustomField("WF_STATUS_ID", $hidden);
+ endif;
+ $tabControl->BeginCustomField("WF_COMMENTS", GetMessage("IBLOCK_COMMENTS"));
+ ?>
+
+
+
+ $tabControl->EndCustomField("WF_COMMENTS", '');
+endif;
+
+if ($arShowTabs['bizproc']):
+
+ $tabControl->BeginNextFormTab();
+
+ $tabControl->BeginCustomField("BIZPROC_WF_STATUS", GetMessage("IBEL_E_PUBLISHED"));
+ ?>
+
+ | =GetMessage("IBEL_E_PUBLISHED")?>: |
+ =($str_BP_PUBLISHED=="Y"?GetMessage("MAIN_YES"):GetMessage("MAIN_NO"))?> |
+
+
+ $tabControl->EndCustomField("BIZPROC_WF_STATUS", '');
+
+ ob_start();
+ $required = false;
+ CBPDocument::AddShowParameterInit(MODULE_ID, "only_users", DOCUMENT_TYPE);
+
+ $bizProcIndex = 0;
+ if (!isset($arDocumentStates))
+ {
+ $arDocumentStates = CBPDocument::GetDocumentStates(
+ array(MODULE_ID, ENTITY, DOCUMENT_TYPE),
+ ($ID > 0) ? array(MODULE_ID, ENTITY, $ID) : null
+ );
+ }
+ foreach ($arDocumentStates as $arDocumentState)
+ {
+ $bizProcIndex++;
+ if ($arDocumentState["ID"] <> '')
+ {
+ $canViewWorkflow = CBPDocument::CanUserOperateDocument(
+ CBPCanUserOperateOperation::ViewWorkflow,
+ $USER->GetID(),
+ array(MODULE_ID, ENTITY, $ID),
+ array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["ID"] > 0 ? $arDocumentState["ID"] : $arDocumentState["TEMPLATE_ID"])
+ );
+ }
+ else
+ {
+ $canViewWorkflow = CBPDocument::CanUserOperateDocumentType(
+ CBPCanUserOperateOperation::ViewWorkflow,
+ $USER->GetID(),
+ array(MODULE_ID, ENTITY, DOCUMENT_TYPE),
+ array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["ID"] > 0 ? $arDocumentState["ID"] : $arDocumentState["TEMPLATE_ID"])
+ );
+ }
+ if (!$canViewWorkflow)
+ continue;
+ ?>
+
+ |
+ = htmlspecialcharsbx($arDocumentState["TEMPLATE_NAME"]) ?>
+ '' && $arDocumentState["WORKFLOW_STATUS"] <> ''):?>
+ ($WF,
+ "find_section_section" => $find_section_section,
+ "stop_bizproc" => $arDocumentState["ID"],
+ ), "&".bitrix_sessid_get()))?>">)
+
+ |
+
+
+ |
+ = htmlspecialcharsbx($arDocumentState["TEMPLATE_NAME"]) ?> |
+
+
+
+ |
+ = htmlspecialcharsbx($arDocumentState["TEMPLATE_DESCRIPTION"]) ?> |
+
+
+ ''):?>
+
+ |
+ = $arDocumentState["STATE_MODIFIED"] ?> |
+
+
+ ''):?>
+
+ |
+ ''):?>&back_url== urlencode($APPLICATION->GetCurPageParam("", array())) ?>">= $arDocumentState["STATE_TITLE"] <> '' ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"] ?> ''):?> |
+
+
+
+ if ($arDocumentState["ID"] == '')
+ {
+ CBPDocument::StartWorkflowParametersShow(
+ $arDocumentState["TEMPLATE_ID"],
+ $arDocumentState["TEMPLATE_PARAMETERS"],
+ ($bCustomForm ? "tabControl" : "form_element_".$IBLOCK_ID)."_form",
+ $bVarsFromForm
+ );
+ if (is_array($arDocumentState["TEMPLATE_PARAMETERS"]))
+ {
+ foreach ($arDocumentState["TEMPLATE_PARAMETERS"] as $arParameter)
+ {
+ if ($arParameter["Required"])
+ $required = true;
+ }
+ }
+ }
+
+ $arEvents = CBPDocument::GetAllowableEvents($USER->GetID(), $arCurrentUserGroups, $arDocumentState, $arIBlock["RIGHTS_MODE"] === "E");
+ if (!empty($arEvents))
+ {
+ ?>
+
+ |
+
+ ">
+ ">
+
+ |
+
+
+ }
+
+ if ($arDocumentState["ID"] <> '')
+ {
+ $arTasks = CBPDocument::GetUserTasksForWorkflow($USER->GetID(), $arDocumentState["ID"]);
+ if (!empty($arTasks))
+ {
+ ?>
+
+ |
+
+
+ foreach ($arTasks as $arTask)
+ {
+ ?>&back_url== urlencode($APPLICATION->GetCurPageParam("", array())) ?>" title="= strip_tags($arTask["DESCRIPTION"]) ?>">= $arTask["NAME"] ?>
+ }
+ ?>
+ |
+
+
+ }
+ }
+ }
+ if ($bizProcIndex <= 0)
+ {
+ ?>
+
+
|
+ =GetMessage("IBEL_BIZPROC_NA")?> |
+
+
+ }
+ ?>
+
+
+ if ($ID > 0):
+ $bStartWorkflowPermission = CBPDocument::CanUserOperateDocument(
+ CBPCanUserOperateOperation::StartWorkflow,
+ $USER->GetID(),
+ array(MODULE_ID, ENTITY, $ID),
+ array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["TEMPLATE_ID"])
+ );
+ if ($bStartWorkflowPermission):
+ ?>
+
+ |
+
+
+ |
+ ">
+ |
+
+
+ endif;
+ endif;
+ $html = ob_get_contents();
+ ob_end_clean();
+ $tabControl->BeginCustomField("BIZPROC", GetMessage("IBEL_E_TAB_BIZPROC"), $required);
+ echo $html;
+ $tabControl->EndCustomField("BIZPROC", "");
+endif;
+
+if($arShowTabs['edit_rights']):
+ $tabControl->BeginNextFormTab();
+ if($ID > 0)
+ {
+ $obRights = new CIBlockElementRights($IBLOCK_ID, $ID);
+ $htmlHidden = '';
+ foreach($obRights->GetRights() as $RIGHT_ID => $arRight)
+ $htmlHidden .= '
+
+
+
+ ';
+ }
+ else
+ {
+ $obRights = new CIBlockSectionRights($IBLOCK_ID, $MENU_SECTION_ID);
+ $htmlHidden = '';
+ }
+
+ $tabControl->BeginCustomField("RIGHTS", GetMessage("IBEL_E_RIGHTS_FIELD"));
+ IBlockShowRights(
+ 'element',
+ $IBLOCK_ID,
+ $ID,
+ GetMessage("IBEL_E_RIGHTS_SECTION_TITLE"),
+ "RIGHTS",
+ $obRights->GetRightsList(),
+ $obRights->GetRights(array("count_overwrited" => true, "parents" => $str_IBLOCK_ELEMENT_SECTION)),
+ false, /*$bForceInherited=*/($ID <= 0) || $bCopy
+ );
+ $tabControl->EndCustomField("RIGHTS", $htmlHidden);
+endif;
+
+$newElement = ($ID <= 0) || $bCopy;
+$currentElement = ($ID > 0) && !$bCopy;
+$bDisabled =
+ ($view=="Y")
+ || ($bWorkflow && $prn_LOCK_STATUS=="red")
+ || (
+ $newElement
+ && !CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $MENU_SECTION_ID, "section_element_bind")
+ )
+ || (
+ $currentElement
+ && !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit")
+ )
+ || (
+ $bBizproc
+ && !$canWrite
+ )
+;
+
+if (
+ !$bDisabled
+ && $bCatalog
+ && !empty($arMainCatalog)
+ && $newElement
+ && !$allowProductAdd
+)
+{
+ $bDisabled = true;
+}
+
+if ($adminSidePanelHelper->isSidePanelFrame()):
+ $tabControl->Buttons(array(
+ 'disabled' => $bDisabled,
+ 'btnApply' => false,
+ ));
+elseif(!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1):
+ ob_start();
+ $disableHtml = $bDisabled
+ ? ' disabled data-btn-disabled="Y"'
+ : ''
+ ;
+ ?>
+ type="submit" class="adm-btn-save" name="save" id="save" value="">
+ if (!$bAutocomplete)
+ {
+ ?> type="submit" class="button" name="apply" id="apply" value="">
+ }
+ ?>
+ type="submit" class="button" name="dontsave" id="dontsave" value="">
+ if (!$bAutocomplete)
+ {
+ ?> type="submit" class="adm-btn-add" name="save_and_add" id="save_and_add" value="">
+ }
+ $buttons_add_html = ob_get_contents();
+ ob_end_clean();
+ $tabControl->Buttons(false, $buttons_add_html);
+elseif(!$bPropertyAjax && (!isset($_REQUEST['nobuttons']) || $_REQUEST['nobuttons'] !== "Y")):
+
+ $wfClose = "{
+ title: '".CUtil::JSEscape(GetMessage("IBLOCK_EL_CANC"))."',
+ name: 'dontsave',
+ id: 'dontsave',
+ action: function () {
+ var FORM = this.parentWindow.GetForm();
+ FORM.appendChild(BX.create('INPUT', {
+ props: {
+ type: 'hidden',
+ name: this.name,
+ value: 'Y'
+ }
+ }));
+ this.disableUntilError();
+ this.parentWindow.Submit();
+ }
+ }";
+ $save_and_add = "{
+ title: '".CUtil::JSEscape(GetMessage("IBLOCK_EL_SAVE_AND_ADD"))."',
+ name: 'save_and_add',
+ id: 'save_and_add',
+ className: 'adm-btn-add',
+ action: function () {
+ var FORM = this.parentWindow.GetForm();
+ FORM.appendChild(BX.create('INPUT', {
+ props: {
+ type: 'hidden',
+ name: 'save_and_add',
+ value: 'Y'
+ }
+ }));
+
+ this.parentWindow.hideNotify();
+ this.disableUntilError();
+ this.parentWindow.Submit();
+ }
+ }";
+ $cancel = "{
+ title: '".CUtil::JSEscape(GetMessage("IBLOCK_EL_CANC"))."',
+ name: 'cancel',
+ id: 'cancel',
+ action: function () {
+ BX.WindowManager.Get().Close();
+ if(window.reloadAfterClose)
+ top.BX.reload(true);
+ }
+ }";
+ $editInPanelParams = array(
+ 'WF' => ($WF == 'Y' ? 'Y': null),
+ 'find_section_section' => $find_section_section,
+ 'menu' => null
+ );
+ if (!empty($arMainCatalog))
+ $editInPanelParams = CCatalogAdminTools::getFormParams($editInPanelParams);
+ $edit_in_panel = "{
+ title: '".CUtil::JSEscape(GetMessage('IBLOCK_EL_EDIT_IN_PANEL'))."',
+ name: 'edit_in_panel',
+ id: 'edit_in_panel',
+ className: 'adm-btn-add',
+ action: function () {
+ location.href = '".$selfFolderUrl.CIBlock::GetAdminElementEditLink(
+ $IBLOCK_ID,
+ $ID,
+ $editInPanelParams
+ )."';
+ }
+ }";
+ unset($editInPanelParams);
+ $tabControl->ButtonsPublic(array(
+ '.btnSave',
+ ($ID > 0 && $bWorkflow? $wfClose: $cancel),
+ $edit_in_panel,
+ $save_and_add
+ ));
+endif;
+
+$tabControl->Show();
+if (
+ (!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1)
+ && CIBlockRights::UserHasRightTo($IBLOCK_ID, $IBLOCK_ID, "iblock_edit")
+ && !$bAutocomplete && !$adminSidePanelHelper->isSidePanel()
+)
+{
+
+ echo
+ BeginNote(),
+ GetMessage("IBEL_E_IBLOCK_MANAGE_HINT"),
+ ' ($WF=="Y"? "Y": null), "find_section_section" => $find_section_section, "IBLOCK_SECTION_ID" => $find_section_section, "return_url" => ($return_url <> ''? $return_url: null)))).'">',
+ GetMessage("IBEL_E_IBLOCK_MANAGE_HINT_HREF"),
+ '',
+ EndNote()
+ ;
+}
+ //////////////////////////
+ //END of the custom form
+ //////////////////////////
\ No newline at end of file
diff --git a/local/templates/evolution/css/forms/style.css b/local/templates/evolution/css/forms/style.css
index 4c84190..487da13 100644
--- a/local/templates/evolution/css/forms/style.css
+++ b/local/templates/evolution/css/forms/style.css
@@ -615,10 +615,28 @@
left: 20px;
bottom: 25px;
}
+@media all and (max-width: 1280px) {
+ #preapproval_block {
+ bottom: 95px;
+ }
+}
+@media all and (max-width: 768px) {
+ #preapproval_block {
+ left: 0px;
+ }
+}
+@media all and (max-width: 540px) {
+ #preapproval_block.active {
+ width: 100vw;
+ height: 100vh;
+ left: 0px;
+ top: 0px;
+ }
+}
#preapproval_block #preapproval_block_span_wrapper {
overflow: hidden;
- margin-left: -20px;
- padding-left: 20px;
+ margin-left: -40px;
+ padding-left: 40px;
}
#preapproval_block .span_hidden {
z-index: 1;
@@ -677,17 +695,19 @@
#preapproval_block .preapproval_form_policy input:checked + label:before {
background: url("/images/icons/checkbox_white.svg") no-repeat center #1c01a9;
}
-@media all and (max-width: 1280px) {
- #preapproval_block {
- bottom: 95px;
- }
-}
#preapproval_block.active .block_open {
display: none;
}
#preapproval_block.active .block_form {
display: block;
}
+@media all and (max-width: 540px) {
+ #preapproval_block.active .block_form {
+ width: 100vw;
+ height: 100vh;
+ border-radius: 0px;
+ }
+}
#preapproval_block .block_toggle {
cursor: pointer;
}
@@ -718,6 +738,11 @@
background: var(--blue);
position: relative;
}
+@media all and (max-width: 768px) {
+ #preapproval_block .block_open i {
+ flex: none;
+ }
+}
#preapproval_block .block_open i:before {
content: "";
display: block;
diff --git a/local/templates/evolution/css/forms/style.less b/local/templates/evolution/css/forms/style.less
index e8e8123..47a0d27 100644
--- a/local/templates/evolution/css/forms/style.less
+++ b/local/templates/evolution/css/forms/style.less
@@ -732,10 +732,28 @@
left: 20px;
bottom: 25px;
+ @media all and (max-width: 1280px) {
+ //display: none;
+ bottom: 95px;
+ }
+
+ @media all and (max-width: 768px) {
+ left: 0px;
+ }
+
+ @media all and (max-width: 540px) {
+ &.active {
+ width: 100vw;
+ height: 100vh;
+ left: 0px;
+ top: 0px;
+ }
+ }
+
#preapproval_block_span_wrapper {
overflow: hidden;
- margin-left: -20px;
- padding-left: 20px;
+ margin-left: -40px;
+ padding-left: 40px;
}
.span_hidden {
@@ -810,11 +828,6 @@
}
}
- @media all and (max-width: 1280px) {
-// display: none;
- bottom: 95px;
- }
-
&.active {
.block_open {
display: none;
@@ -822,6 +835,12 @@
.block_form {
display: block;
+
+ @media all and (max-width: 540px) {
+ width: 100vw;
+ height: 100vh;
+ border-radius: 0px;
+ }
}
}
@@ -857,6 +876,10 @@
background: var(--blue);
position: relative;
+ @media all and (max-width: 768px) {
+ flex: none;
+ }
+
&:before {
content: "";
display: block;
diff --git a/local/templates/evolution/css/var.css b/local/templates/evolution/css/var.css
index 65dfdd3..60b9404 100644
--- a/local/templates/evolution/css/var.css
+++ b/local/templates/evolution/css/var.css
@@ -1309,3 +1309,60 @@ section[data-page][data-page="special"] + #order .container:after {
background: var(--blue);
border-radius: 0px;
}
+.advwrapper {
+ position: relative;
+ width: fit-content;
+}
+.advblock {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ justify-content: flex-start;
+ overflow: hidden;
+}
+.advblock:hover {
+ width: fit-content;
+ height: fit-content;
+}
+.adv_button_slider {
+ position: absolute;
+ right: 0px;
+ top: 2px;
+ top: 0px;
+ z-index: 1;
+ font-size: 10px;
+ color: rgba(0, 0, 0, 0.75);
+ padding: 6px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ cursor: pointer;
+ background: rgba(255, 255, 255, 0.55);
+ border-radius: 0px;
+ line-height: 15px;
+ width: 57px;
+ height: 17px;
+ display: none;
+}
+.adv_button_news {
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ z-index: 4;
+ font-size: 9px;
+ color: #000000;
+ padding: 6px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ cursor: pointer;
+ background: #ffffff;
+ line-height: 14px;
+ width: 53px;
+ height: 14px;
+}
+.adv_button_slider_erir {
+ align-items: flex-end;
+}
+.adv_button_news_article {
+ right: 12px !important;
+ top: 2px !important;
+}
diff --git a/local/templates/evolution/css/var.less b/local/templates/evolution/css/var.less
index f9cbacc..85d49ee 100644
--- a/local/templates/evolution/css/var.less
+++ b/local/templates/evolution/css/var.less
@@ -1109,4 +1109,69 @@ section[data-page] {
[data-custom-scroll]::-webkit-scrollbar-thumb {
background: var(--blue);
border-radius: 0px;
+}
+
+.advwrapper {
+ position: relative;
+ width: fit-content;
+}
+
+.advblock {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ justify-content: flex-start;
+ overflow: hidden;
+
+ &:hover {
+ width: fit-content;
+ height: fit-content;
+ }
+}
+
+.adv_button_slider {
+ position: absolute;
+ right: 0px;
+ top: 2px;
+ top: 0px;
+ z-index: 1;
+ font-size: 10px;
+ color: rgba(0,0,0,0.75);
+ padding: 6px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ cursor: pointer;
+ background: rgba(255,255,255,0.55);
+ border-radius: 0px;
+ line-height: 15px;
+ width: 57px;
+ height: 17px;
+ display: none;
+}
+
+.adv_button_news {
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ top: 0px;
+ z-index: 4;
+ font-size: 9px;
+ color: rgba(0,0,0,1);
+ padding: 6px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ cursor: pointer;
+ background: rgba(255,255,255,1);
+ line-height: 14px;
+ width: 53px;
+ height: 14px;
+}
+
+.adv_button_slider_erir {
+ align-items: flex-end;
+}
+
+.adv_button_news_article {
+ right: 12px !important;
+ top: 2px !important;
}
\ No newline at end of file