private function _setAuthHash($hash) { if (strlen($hash) > 0) { $this->authHash = $hash; CFormCrm::Update($this->ID, array('AUTH_HASH' => $hash)); } }
echo BeginNote(), GetMessage('FORM_CRM_NOT_SAVED'), EndNote(); ?> </td> </tr> <?php } else { $arCRMServers = array(); $dbRes = CFormCrm::GetList(array('NAME' => 'ASC', 'ID' => 'ASC'), array()); while ($arServer = $dbRes->Fetch()) { $arCRMServers[] = $arServer; } $dbRes = CFormCrm::GetByFormID($ID); $bLinkCreated = false; if ($arFormCrmLink = $dbRes->Fetch()) { $bLinkCreated = true; $dbRes = CFormCrm::GetFields($arFormCrmLink['ID']); $arFormCrmFields = array(); while ($arFld = $dbRes->Fetch()) { $arFormCrmFields[] = $arFld; } } $dbRes = CFormField::GetList($ID, 'ALL', $by, $order, array(), $is_filtered); $arFormFields = array(); while ($arFld = $dbRes->Fetch()) { $arFormFields[] = $arFld; } if (false && !$bLinkCreated) { ?> <tr> <td colspan="2" align="center"><?php echo BeginNote(), GetMessage('FORM_CRM_NOT_SET'), EndNote();
<td valign="top"><?php echo GetMessage("FORM_DEFAULT_PERMISSION"); ?> </td> <td valign="top" nowrap><?php $arr = CForm::GetPermissionList("N"); $perm = COption::GetOptionString("form", "FORM_DEFAULT_PERMISSION"); echo SelectBoxFromArray("FORM_DEFAULT_PERMISSION", $arr, $perm); ?> </td> </tr> <?php $tabControl->BeginNextTab(); CJSCore::Init(array('popup', 'ajax')); $arCRMServers = array(); $dbRes = CFormCrm::GetList(array('NAME' => 'ASC', 'ID' => 'ASC'), array()); while ($arServer = $dbRes->Fetch()) { $arCRMServers[] = $arServer; } ?> <tr class="heading"> <td valign="top" align="center" colspan="2"><b><?php echo GetMessage('FORM_TAB_CRM_SECTION_TITLE'); ?> </b></td> </tr> <tr> <td colspan="2"> <style> .form-crm-settings {width: 300px;} .form-crm-settings table {width: 100%;}
} if (is_array($arFields) && count($arFields) > 0) { $result = '{"result":"ok","fields":' . CUtil::PhpToJsObject($arFields) . (is_array($arAuth) ? ',"auth_hash":"' . $authHash . '"' : '') . '}'; } else { $res = $link->GetLastResult(); if ($res) { $result = '{"result":"error","error":"' . CUtil::JSEscape($res->field('error_message')) . '"}'; } } } break; case 'add_lead': $FORM_ID = intval($_REQUEST['FORM_ID']); $RESULT_ID = intval($_REQUEST['RESULT_ID']); if ($FORM_ID > 0 && $RESULT_ID > 0) { $leadId = CFormCrm::AddLead($FORM_ID, $RESULT_ID); if ($leadId > 0) { $result = '{"result":"ok",ID:' . intval($leadId) . '}'; } else { if ($ex = $APPLICATION->GetException()) { $result = '{"result":"error","error":"' . CUtil::JSEscape($ex->GetString()) . '"}'; } } } break; } } else { $result = '{"result":"error","error":"session_expired"}'; } if ($result) { $APPLICATION->RestartBuffer();
if (false === $arForm) { define('BX_ADMIN_FORM_MENU_OPEN', 1); if ($_REQUEST["mode"] == "list") { require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_js.php"; } else { require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php"; } $adminPage->ShowSectionIndex("menu_webforms_list", "form"); if ($_REQUEST["mode"] == "list") { require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_js.php"; } else { require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php"; } die; } else { $dbRes = CFormCrm::GetByFormID($WEB_FORM_ID); $arFormCrmLink = $dbRes->Fetch(); } $HELP_FILE_ACCESS = $APPLICATION->GetFileAccessPermission("/bitrix/modules/form/help/" . LANGUAGE_ID . "/index.php"); $FORM_RIGHT = $APPLICATION->GetGroupRight("form"); $MAIN_RIGHT = $APPLICATION->GetGroupRight("main"); $WEB_FORM_NAME = $arForm["SID"]; ########## require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/include.php"; IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/admin/form_result_list.php"); $err_mess = "File: " . __FILE__ . "<br>Line: "; /*************************************************************************** Utility ***************************************************************************/ function CheckFilter() {