Beispiel #1
0
                             }
                         }
                     }
                 }
             }
         }
     }
     if (false == $boolFlag) {
         if ($ex = $APPLICATION->GetException()) {
             $strWarning .= $ex->GetString() . "<br>";
             $bVarsFromForm = true;
         }
     }
 }
 if (!$bVarsFromForm) {
     if ($bBizproc && $_REQUEST['BIZ_PROC_ADD_DEFAULT_TEMPLATES'] == 'Y' && CBPDocument::GetNumberOfWorkflowTemplatesForDocumentType(array("iblock", "CIBlockDocument", "iblock_" . $ID)) <= 0 && $arFields["BIZPROC"] == "Y") {
         CBPDocument::AddDefaultWorkflowTemplates(array("iblock", "CIBlockDocument", "iblock_" . $ID));
     }
     $DB->Commit();
     //Check if index needed
     CIBlock::CheckForIndexes($ID);
     if ($bCatalog) {
         if (isset($boolNeedAgent) && $boolNeedAgent == true) {
             $intYandexExport = CCatalog::GetList(array(), array('YANDEX_EXPORT' => 'Y'), array());
             CAgent::RemoveAgent("CCatalog::PreGenerateXML(\"yandex\");", "catalog");
             if (0 < $intYandexExport) {
                 CAgent::AddAgent("CCatalog::PreGenerateXML(\"yandex\");", "catalog", "N", IntVal(COption::GetOptionString("catalog", "yandex_xml_period", "24")) * 60 * 60, "", "Y");
             }
         }
     }
     $ob = new CAutoSave();
				if (false == $boolFlag)
				{
					if($ex = $APPLICATION->GetException())
					{
						$strWarning .= $ex->GetString()."<br>";
						$bVarsFromForm = true;
					}
				}
			}

			if(!$bVarsFromForm)
			{
				if(
					$bBizproc
					&& $_REQUEST['BIZ_PROC_ADD_DEFAULT_TEMPLATES']=='Y'
					&& CBPDocument::GetNumberOfWorkflowTemplatesForDocumentType(array("iblock", "CIBlockDocument", "iblock_".$ID))<=0
					&& $arFields["BIZPROC"] == "Y"
				)
					CBPDocument::AddDefaultWorkflowTemplates(array("iblock", "CIBlockDocument", "iblock_".$ID));

				$DB->Commit();

				//Check if index needed
				CIBlock::CheckForIndexes($ID);

				if ($bCatalog)
				{
					if (isset($boolNeedAgent) && $boolNeedAgent == true)
					{
						$intYandexExport = CCatalog::GetList(array(),array('YANDEX_EXPORT' => 'Y'),array());
						CAgent::RemoveAgent("CCatalog::PreGenerateXML(\"yandex\");", "catalog");