GetGroupRight("subscribe"); if($POST_RIGHT=="D") $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); $aTabs = array( array("DIV" => "edit1", "TAB" => GetMessage("post_posting_tab"), "ICON"=>"main_user_edit", "TITLE"=>GetMessage("post_posting_tab_title")), array("DIV" => "edit2", "TAB" => GetMessage("post_subscr_tab"), "ICON"=>"main_user_edit", "TITLE"=>GetMessage("post_subscr_tab_title")), array("DIV" => "edit3", "TAB" => GetMessage("post_attachments"), "ICON"=>"main_user_edit", "TITLE"=>GetMessage("post_attachments_title")), array("DIV" => "edit4", "TAB" => GetMessage("post_params_tab"), "ICON"=>"main_user_edit", "TITLE"=>GetMessage("post_params_tab_title")), ); $tabControl = new CAdminTabControl("tabControl", $aTabs); CModule::IncludeModule("fileman"); $ID = intval($ID); // Id of the edited record $bCopy = ($action == "copy"); $message = null; $bVarsFromForm = false; if($REQUEST_METHOD == "POST" && ($save.$apply.$Send.$Resend.$Continue!="") && $POST_RIGHT=="W" && check_bitrix_sessid()) { $posting = new CPosting(); $arFields = Array( "FROM_FIELD" => $_REQUEST["FROM_FIELD"], "TO_FIELD" => $_REQUEST["TO_FIELD"], "BCC_FIELD" => $_REQUEST["BCC_FIELD"], "EMAIL_FILTER" => $_REQUEST["EMAIL_FILTER"], "SUBJECT" => $_REQUEST["SUBJECT"], "BODY_TYPE" => ($_REQUEST["BODY_TYPE"] <> "html"? "text":"html"), "BODY" => $_REQUEST["BODY"], "DIRECT_SEND" => ($_REQUEST["DIRECT_SEND"] <> "Y"? "N":"Y"), "CHARSET" => $_REQUEST["CHARSET"], "SUBSCR_FORMAT" => ($_REQUEST["SUBSCR_FORMAT"]<>"html" && $_REQUEST["SUBSCR_FORMAT"]<>"text"? false: $_REQUEST["SUBSCR_FORMAT"]), "RUB_ID" => $_REQUEST["RUB_ID"], "GROUP_ID" => $_REQUEST["GROUP_ID"], "AUTO_SEND_TIME"=> ($_REQUEST["AUTO_SEND_FLAG"]<>"Y"? false: $_REQUEST["AUTO_SEND_TIME"]), ); if($STATUS <> "") { if($STATUS<>"S" && $STATUS<>"E" && $STATUS<>"P" && $STATUS<>"W") $STATUS = "D"; } if($ID>0) { $res = $posting->Update($ID, $arFields); if($Resend <> '') $STATUS="W"; if($res && $STATUS<>"") $res = $posting->ChangeStatus($ID, $STATUS); } else { $arFields["STATUS"] = "D"; $ID = $posting->Add($arFields); $res = ($ID>0); } if($res) { //Delete checked if(is_array($FILE_ID)) foreach($FILE_ID as $file) CPosting::DeleteFile($ID, $file); //New files $arFiles = array(); //Brandnew if(is_array($_FILES["NEW_FILE"])) { foreach($_FILES["NEW_FILE"] as $attribute=>$files) { if(is_array($files)) foreach($files as $index=>$value) $arFiles[$index][$attribute]=$value; } foreach($arFiles as $index => $file) { if(!is_uploaded_file($file["tmp_name"])) unset($arFiles[$index]); } } //Copy if(array_key_exists("FILES", $_POST) && is_array($_POST["FILES"])) { if(intval($COPY_ID) > 0) { //Files from posting_edit.php foreach(array_reverse($_POST["FILES"], true) as $key => $file_id) { //skip "deleted" if(is_array($FILE_ID) && array_key_exists($key, $FILE_ID)) continue; //clone file if(intval($file_id) > 0) { $rsFile = CPosting::GetFileList($COPY_ID, $file_id); if($ar = $rsFile->Fetch()) { array_unshift($arFiles, CFile::MakeFileArray($ar["ID"])); } } } } else { //Files from template_test.php foreach(array_reverse($_POST["FILES"], true) as $file) { if( is_array($file) && $file["tmp_name"] <> '' && $APPLICATION->GetFileAccessPermission($file["tmp_name"]) >= "W" ) { array_unshift($arFiles, $file); } } } } foreach($arFiles as $file) { if($file["name"] <> '' and intval($file["size"])>0) { if (!$posting->SaveFile($ID, $file)) { $_SESSION["SESS_ADMIN"]["POSTING_EDIT_MESSAGE"] = array( "MESSAGE" => $posting->LAST_ERROR, "TYPE" => "ERROR", ); LocalRedirect("posting_edit.php?ID=".$ID."&lang=".LANG."&".$tabControl->ActiveTabParam()); } } } } if($res) { if($Send!="" || $Resend!="" || $Continue!="") { LocalRedirect("posting_admin.php?ID=".$ID."&action=send&lang=".LANG."&".bitrix_sessid_get()); } if($apply!="") { $_SESSION["SESS_ADMIN"]["POSTING_EDIT_MESSAGE"] = array( "MESSAGE" => GetMessage("post_save_ok"), "TYPE" => "OK", ); LocalRedirect("posting_edit.php?ID=".$ID."&lang=".LANG."&".$tabControl->ActiveTabParam()); } else { LocalRedirect("posting_admin.php?lang=".LANG); } } else { if($e = $APPLICATION->GetException()) $message = new CAdminMessage(GetMessage("post_save_error"), $e); $bVarsFromForm = true; } } ClearVars(); $str_STATUS = "D"; $str_DIRECT_SEND = "Y"; $str_BODY_TYPE = "text"; $str_FROM_FIELD = COption::GetOptionString("subscribe", "default_from"); $str_TO_FIELD = COption::GetOptionString("subscribe", "default_to"); $str_AUTO_SEND_FLAG = "N"; $str_AUTO_SEND_TIME = ConvertTimeStamp(time()+CTimeZone::GetOffset(), "FULL"); if($ID>0) { $post = CPosting::GetByID($ID); if(!($post_arr = $post->ExtractFields("str_"))) $ID=0; } if($bVarsFromForm) { if(!array_key_exists("DIRECT_SEND", $_REQUEST)) $DIRECT_SEND = "N"; $DB->InitTableVarsForEdit("b_posting", "", "str_"); if(array_key_exists("AUTO_SEND_FLAG", $_REQUEST)) $str_AUTO_SEND_FLAG = "Y"; else $str_AUTO_SEND_FLAG = "N"; } elseif($ID > 0) { if($str_AUTO_SEND_TIME <> '') { $str_AUTO_SEND_FLAG = "Y"; } else { $str_AUTO_SEND_FLAG = "N"; } } $APPLICATION->SetTitle(($ID>0 && !$bCopy? GetMessage("post_title_edit").$ID : GetMessage("post_title_add"))); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php"); $aMenu = array( array( "TEXT"=>GetMessage("post_mnu_list"), "TITLE"=>GetMessage("post_mnu_list_title"), "LINK"=>"posting_admin.php?lang=".LANG, "ICON"=>"btn_list", ) ); if($ID>0 && !$bCopy) { $aMenu[] = array("SEPARATOR"=>"Y"); $aMenu[] = array( "TEXT"=>GetMessage("post_mnu_add"), "TITLE"=>GetMessage("post_mnu_add_title"), "LINK"=>"posting_edit.php?lang=".LANG, "ICON"=>"btn_new", ); $aMenu[] = array( "TEXT"=>GetMessage("post_mnu_copy"), "TITLE"=>GetMessage("post_mnu_copy_title"), "LINK"=>"posting_edit.php?ID=".$ID."&action=copy&lang=".LANG, "ICON"=>"btn_copy", ); $aMenu[] = array( "TEXT"=>GetMessage("post_mnu_del"), "TITLE"=>GetMessage("post_mnu_del_title"), "LINK"=>"javascript:if(confirm('".GetMessage("post_mnu_confirm")."'))window.location='posting_admin.php?ID=".$ID."&action=delete&lang=".LANG."&".bitrix_sessid_get()."';", "ICON"=>"btn_delete", ); } $context = new CAdminContextMenu($aMenu); $context->Show(); if(is_array($_SESSION["SESS_ADMIN"]["POSTING_EDIT_MESSAGE"])) { CAdminMessage::ShowMessage($_SESSION["SESS_ADMIN"]["POSTING_EDIT_MESSAGE"]); $_SESSION["SESS_ADMIN"]["POSTING_EDIT_MESSAGE"]=false; } if($message) echo $message->Show(); elseif($posting->LAST_ERROR!="") CAdminMessage::ShowMessage($posting->LAST_ERROR); ?>
Begin(); ?> BeginNextTab(); ?>
Fatal error: Uncaught Error: Call to undefined function GetMessage() in D:\ktt\ttepla.com\public_html\bitrix\modules\subscribe\admin\posting_edit.php:275 Stack trace: #0 {main} thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\subscribe\admin\posting_edit.php on line 275