public static function GetDateFormat($name, $parent) { global $DB; $timestamp = mktime(7,30,45,2,22,2007); return array( "PARENT" => $parent, "NAME" => $name, "TYPE" => "LIST", "SIZE" => 8, "VALUES" => array( "d-m-Y" => CIBlockFormatProperties::DateFormat("d-m-Y", $timestamp),//"22-02-2007", "m-d-Y" => CIBlockFormatProperties::DateFormat("m-d-Y", $timestamp),//"02-22-2007", "Y-m-d" => CIBlockFormatProperties::DateFormat("Y-m-d", $timestamp),//"2007-02-22", "d.m.Y" => CIBlockFormatProperties::DateFormat("d.m.Y", $timestamp),//"22.02.2007", "d.M.Y" => CIBlockFormatProperties::DateFormat("d.M.Y", $timestamp),//"22.Feb.2007", "m.d.Y" => CIBlockFormatProperties::DateFormat("m.d.Y", $timestamp),//"02.22.2007", "j M Y" => CIBlockFormatProperties::DateFormat("j M Y", $timestamp),//"22 Feb 2007", "M j, Y" => CIBlockFormatProperties::DateFormat("M j, Y", $timestamp),//"Feb 22, 2007", "j F Y" => CIBlockFormatProperties::DateFormat("j F Y", $timestamp),//"22 February 2007", "f j, Y" => CIBlockFormatProperties::DateFormat("f j, Y", $timestamp),//"February 22, 2007", "d.m.y g:i A" => CIBlockFormatProperties::DateFormat("d.m.y g:i A", $timestamp),//"22.02.07 1:30 PM", "d.M.y g:i A" => CIBlockFormatProperties::DateFormat("d.M.y g:i A", $timestamp),//"22.Feb.07 1:30 PM", "d.M.Y g:i A" => CIBlockFormatProperties::DateFormat("d.M.Y g:i A", $timestamp),//"22.Febkate.2007 1:30 PM", "d.m.y G:i" => CIBlockFormatProperties::DateFormat("d.m.y G:i", $timestamp),//"22.02.07 7:30", "d.m.Y H:i" => CIBlockFormatProperties::DateFormat("d.m.Y H:i", $timestamp),//"22.02.2007 07:30", "SHORT" => GetMessage('COMP_PARAM_DATE_FORMAT_SITE'), "FULL" => GetMessage('COMP_PARAM_DATETIME_FORMAT_SITE') ), "DEFAULT" => $DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")), "ADDITIONAL_VALUES" => "Y", ); }
?> </div> <div class="page-events-item__time <?php echo $arItem['PREVIEW_PICTURE'] ? 'page-events-item__time_color_white' : ''; ?> "><?php echo GetMessage('EVENTS_MAIN_FROM'); ?> <?php echo CIBlockFormatProperties::DateFormat('H:i', MakeTimeStamp($arItem['ACTIVE_FROM'], @CSite::GetDateFormat())); ?> <?php echo GetMessage('EVENTS_MAIN_TO'); ?> <?php echo CIBlockFormatProperties::DateFormat('H:i', MakeTimeStamp($arItem['ACTIVE_TO'], @CSite::GetDateFormat())); ?> </div> <div class="page-events-item__description <?php echo $arItem['PREVIEW_PICTURE'] ? 'page-events-item__description_color_white' : ''; ?> "> <?php echo $arItem['NAME']; ?> </div> </a> </div> <?endforeach;?> <div class="clearfix"></div> </div>
public static function ReserveVideoRoom($Params) { $tst = MakeTimeStamp($Params['dateTo']); if (date("H:i", $tst) == '00:00') { $Params['dateTo'] = CIBlockFormatProperties::DateFormat(self::DFormat(true), $tst + (23 * 60 + 59) * 60); } $Params['VMiblockId'] = isset($Params['VMiblockId']) ? $Params['VMiblockId'] : self::$settings['vr_iblock_id']; $check = CCalendar::CheckVideoRoom($Params); if ($check !== true) { return $check; } $sectionID = 0; $dbItem = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $Params['VMiblockId'], "ACTIVE" => "Y")); if ($arItem = $dbItem->Fetch()) { $sectionID = $arItem["ID"]; } $arFields = array("IBLOCK_ID" => $Params['VMiblockId'], "IBLOCK_SECTION_ID" => $sectionID, "NAME" => $Params['name'], "DATE_ACTIVE_FROM" => $Params['dateFrom'], "DATE_ACTIVE_TO" => $Params['dateTo'], "CREATED_BY" => CCalendar::GetCurUserId(), "DETAIL_TEXT" => $Params['description'], "PROPERTY_VALUES" => array("PERIOD_TYPE" => 'NONE', "UF_PERSONS" => $Params['persons'], "MEMBERS" => $Params['members']), "ACTIVE" => "Y"); $bs = new CIBlockElement(); $id = $bs->Add($arFields); return $id; }
$arItem["DETAIL_PAGE_URL"] = htmlspecialcharsbx(str_replace(array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_ID#", "#SECTION_ID#", "#ELEMENT_ID#"), array(SITE_SERVER_NAME, SITE_DIR, $arItem["IBLOCK_ID"], $arItem["IBLOCK_SECTION_ID"], $arItem["ID"]), $arParams["DETAIL_URL"])); } if (array_key_exists("PREVIEW_PICTURE", $arItem)) { $arItem["PREVIEW_PICTURE"] = CFile::GetFileArray($arItem["PREVIEW_PICTURE"]); } if (array_key_exists("DETAIL_PICTURE", $arItem)) { $arItem["DETAIL_PICTURE"] = CFile::GetFileArray($arItem["DETAIL_PICTURE"]); } $arItem["FILE_EXTENTION"] = htmlspecialcharsbx(strtolower(strrchr($arItem['~NAME'], '.'))); $arItem["FIELDS"] = array(); foreach ($arParams["FIELD_CODE"] as $code) { if (array_key_exists($code, $arItem)) { $arItem["FIELDS"][$code] = $arItem[$code]; } } $arItem["FIELDS"]["TIMESTAMP_X"] = CIBlockFormatProperties::DateFormat($arParams["ACTIVE_DATE_FORMAT"], MakeTimeStamp($arItem["TIMESTAMP_X"], CSite::GetDateFormat())); $arItem["DISPLAY_PROPERTIES"] = array(); if ($bGetProperty) { $dbProps = CIBlockElement::GetProperty($arItem['IBLOCK_ID'], $arItem['ID'], array("sort" => "asc")); if ($dbProps) { while ($arProps = $dbProps->Fetch()) { $arItem["PROPERTIES"][$arProps["CODE"]] = $arProps; } } foreach ($arParams["PROPERTY_CODE"] as $pid) { $prop =& $arItem["PROPERTIES"][$pid]; if (is_array($prop["VALUE"]) && count($prop["VALUE"]) > 0 || !is_array($prop["VALUE"]) && strlen($prop["VALUE"]) > 0) { $arItem["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arItem, $prop, "news_out"); } } }
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> <div class="news-list-cnt"> <ul class="news-list"> <?foreach ($arResult["ITEMS"] as $key => $arItems) :?> <?if ($key > 0 && $key%3 == 0):?> </ul><ul class="news-list"> <?endif?> <li> <a href="<?=$arItems["~DETAIL_PAGE_URL"]?>"> <div class="img-cnt"> <img src="<?=CFile::GetPath($arItems["~PREVIEW_PICTURE"])?>" alt="" class="cover"/> </div> <div class="news-info"> <p class="news-date"> <?=CIBlockFormatProperties::DateFormat("H:i", MakeTimeStamp($arItems["ACTIVE_FROM"], FORMAT_DATETIME));?>, <?=CIBlockFormatProperties::DateFormat("d F Y", MakeTimeStamp($arItems["ACTIVE_FROM"], FORMAT_DATETIME));?> </p> <p class="news-announce"><?=$arItems["NAME"]?></p> </div> </a> </li> <?endforeach?> </ul> </div> <?if($arParams["DISPLAY_BOTTOM_PAGER"]):?> <?=$arResult["NAV_STRING"]?> <?endif;?>
$arButtons = CIBlock::GetPanelButtons($arIBlock["ID"], 0, 0, array("SECTION_BUTTONS" => false, "SESSID" => false)); $arIBlock["ADD_ELEMENT_LINK"] = $arButtons["edit"]["add_element"]["ACTION_URL"]; $arIBlock["~LIST_PAGE_URL"] = str_replace(array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_TYPE_ID#", "#IBLOCK_ID#", "#IBLOCK_CODE#", "#IBLOCK_EXTERNAL_ID#", "#CODE#"), array(SITE_SERVER_NAME, SITE_DIR, $arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"], $arIBlock["CODE"], $arIBlock["EXTERNAL_ID"], $arIBlock["CODE"]), strlen($arParams["IBLOCK_URL"]) ? trim($arParams["~IBLOCK_URL"]) : $arIBlock["~LIST_PAGE_URL"]); $arIBlock["~LIST_PAGE_URL"] = preg_replace("'/+'s", "/", $arIBlock["~LIST_PAGE_URL"]); $arIBlock["LIST_PAGE_URL"] = htmlspecialcharsbx($arIBlock["~LIST_PAGE_URL"]); $arIBlock["ITEMS"] = array(); $arrFilter["IBLOCK_ID"] = $arIBlock["ID"]; $rsItem = CIBlockElement::GetList($arOrder, $arrFilter, false, array("nTopCount" => $arParams["NEWS_COUNT"]), $arSelect); $rsItem->SetUrlTemplates($arParams["DETAIL_URL"]); while ($obItem = $rsItem->GetNextElement()) { $arItem = $obItem->GetFields(); $arButtons = CIBlock::GetPanelButtons($arItem["IBLOCK_ID"], $arItem["ID"], 0, array("SECTION_BUTTONS" => false, "SESSID" => false)); $arItem["EDIT_LINK"] = $arButtons["edit"]["edit_element"]["ACTION_URL"]; $arItem["DELETE_LINK"] = $arButtons["edit"]["delete_element"]["ACTION_URL"]; if (strlen($arItem["ACTIVE_FROM"]) > 0) { $arItem["DISPLAY_ACTIVE_FROM"] = CIBlockFormatProperties::DateFormat($arParams["ACTIVE_DATE_FORMAT"], MakeTimeStamp($arItem["ACTIVE_FROM"], CSite::GetDateFormat())); } else { $arItem["DISPLAY_ACTIVE_FROM"] = ""; } $ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($arItem["IBLOCK_ID"], $arItem["ID"]); $arItem["IPROPERTY_VALUES"] = $ipropValues->getValues(); if (isset($arItem["PREVIEW_PICTURE"])) { $arItem["PREVIEW_PICTURE"] = 0 < $arItem["PREVIEW_PICTURE"] ? CFile::GetFileArray($arItem["PREVIEW_PICTURE"]) : false; if ($arItem["PREVIEW_PICTURE"]) { $arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"]; if ($arItem["PREVIEW_PICTURE"]["ALT"] == "") { $arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["NAME"]; } $arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"]; if ($arItem["PREVIEW_PICTURE"]["TITLE"] == "") { $arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["NAME"];
/** * Convert dates if date template set * @param mixed[] $arr data array to be converted * @param string[] $conversion contains sublist of keys of $arr, that will be converted * @return void */ protected function formatDate(&$arr, $conversion) { if (strlen($this->arParams['ACTIVE_DATE_FORMAT']) && self::isNonemptyArray($conversion)) { foreach ($conversion as $fld) { if (!empty($arr[$fld])) { $arr[$fld . "_FORMATED"] = CIBlockFormatProperties::DateFormat($this->arParams['ACTIVE_DATE_FORMAT'], MakeTimeStamp($arr[$fld])); } } } }
break; } } LocalRedirect($APPLICATION->GetCurDir() . '#comment' . intval($_REQUEST['id'])); } /* delete comment */ if ($delete_comment = $_REQUEST['delete_comment']) { foreach ($arResult['COMMENTS'] as $comment) { if ($comment['ID'] == $delete_comment) { if ($comment['CREATED_BY'] == $arResult['USER_ID']) { $el = new CIBlockElement(); $res = $el->Update($delete_comment, array("ACTIVE" => 'N')); crmEntitiesHelper::recalcCommentsCnt($arParams['ID']); $logger->add(array($arResult['TASK']['PROPS']['CUSTOMER']['VALUE'], $arResult['TASK']['PROPS']['PROGRAMMER']['VALUE']), $arParams['ID'], 'delete_comment', strip_tags($comment['~PREVIEW_TEXT'])); ToolTip::Add('Комментарий удалён'); crmEntitiesHelper::RecalcLastCommentDateTime($arParams['ID']); } else { ToolTip::AddError('Ошибка доступа к комментарию'); } break; } } LocalRedirect($APPLICATION->GetCurDir()); } /* tracking time */ $res = CIBlockElement::GetList(array("ID" => "ASC"), array("PROPERTY_TASK" => $arParams['ID'], "IBLOCK_ID" => TRACKING_IBLOCK_ID, "ACTIVE" => "Y"), false, false, array('DETAIL_TEXT', 'ID', 'DATE_CREATE', 'PROPERTY_HOURS')); while ($ar_fields = $res->GetNext()) { $ar_fields['DATE_CREATE'] = CIBlockFormatProperties::DateFormat($arParams['DATE_FORMAT'], MakeTimeStamp($ar_fields['DATE_CREATE'], CSite::GetDateFormat())); $arResult['TRACKING'][] = $ar_fields; } $this->IncludeComponentTemplate();
"> <div class="header"> <div class="author"> <div class="avatar"> <img alt="image" src="<?php $avatar = CFile::ResizeImageGet($arItem["PROPERTIES"]["AVATAR"]["VALUE"], array("width" => 57, "height" => 57), BX_RESIZE_IMAGE_EXACT); echo $avatar["src"]; ?> "> </div> <h2 class="name"><a href="#"><?php echo $arItem["NAME"]; ?> </a></h2> <em class="date"><?php echo CIBlockFormatProperties::DateFormat("d F Y H:i:s", MakeTimeStamp($arItem["DATE_CREATE"], CSite::GetDateFormat())); ?> </em> </div> <div class="votes"> <a href="javascript:void(0)" id="<?php echo $arItemIDs["VOTE_PLUS"]; ?> " class="vote plus"><?php echo intval($arItem["PROPERTIES"]["VOTE_PLUS"]["VALUE"]); ?> </a> <a href="javascript:void(0)" id="<?php echo $arItemIDs["VOTE_MINUS"]; ?> " class="vote minus"><?php
$html .= '</td>'; $html .= '</tr>'; $html .= '</table>'; $html .= '<br>'; $html .= '<p>Итого к оплате без НДС*: ' . number_format($_SESSION["ORDER_ITEM"]['price'], 0, '.', ' ') . ' (' . Number2Word_Rus($_SESSION["ORDER_ITEM"]['price'], 'N') . ') белорусских рублей.</p>'; $html .= '<p style="font-size:80%;">* Стоимость услуг указана без НДС, Исполнитель является плательщиком налогов по УСН.</p>'; $html .= '<table style="width:100%;">'; $html .= '<tr>'; $html .= '<td style="width:50%;background:url(/bitrix/templates/goodidea/images/pechat.jpg) no-repeat 0 0;height:190px;padding-left:70px;vertical-align:top;">'; $html .= ''; $html .= '<p>Исполнитель:</p>'; $html .= '<br><br><br><br>'; $html .= '<p>________________ Р.В. Нестерович</p>'; $html .= '<p>м.п.</p>'; $html .= '<br><br>'; $html .= '<p>' . CIBlockFormatProperties::DateFormat('«j» F Y', time()) . 'г.</p>'; $html .= '</td>'; $html .= '<td style="width:50%;height:190px;padding-left:70px;vertical-align:top;">'; $html .= ''; $html .= '<p>Заказчик:</p>'; $html .= '<br><br><br><br>'; $html .= '<p>________________ ' . $_POST['posContractLName'] . ' ' . $_POST['posContractFName'] . '</p>'; $html .= '<p>м.п.</p>'; $html .= '<br><br>'; $html .= '<p>«___» __________ 201_ г.</p>'; $html .= '</td>'; $html .= '</tr>'; $html .= '</table>'; include $_SERVER['DOCUMENT_ROOT'] . "/mpdf60/mpdf.php"; $mpdf = new mPDF(); $mpdf->charset_in = 'cp1251';
function GetDateFormat($name, $parent) { global $DB; $timestamp = mktime(7, 30, 45, 2, 22, 2007); return array("PARENT" => $parent, "NAME" => $name, "TYPE" => "LIST", "VALUES" => array("d-m-Y" => CIBlockFormatProperties::DateFormat("d-m-Y", $timestamp), "m-d-Y" => CIBlockFormatProperties::DateFormat("m-d-Y", $timestamp), "Y-m-d" => CIBlockFormatProperties::DateFormat("Y-m-d", $timestamp), "d.m.Y" => CIBlockFormatProperties::DateFormat("d.m.Y", $timestamp), "d.M.Y" => CIBlockFormatProperties::DateFormat("d.M.Y", $timestamp), "m.d.Y" => CIBlockFormatProperties::DateFormat("m.d.Y", $timestamp), "j M Y" => CIBlockFormatProperties::DateFormat("j M Y", $timestamp), "M j, Y" => CIBlockFormatProperties::DateFormat("M j, Y", $timestamp), "j F Y" => CIBlockFormatProperties::DateFormat("j F Y", $timestamp), "f j, Y" => CIBlockFormatProperties::DateFormat("f j, Y", $timestamp), "d.m.y g:i A" => CIBlockFormatProperties::DateFormat("d.m.y g:i A", $timestamp), "d.M.y g:i A" => CIBlockFormatProperties::DateFormat("d.M.y g:i A", $timestamp), "d.M.Y g:i A" => CIBlockFormatProperties::DateFormat("d.M.Y g:i A", $timestamp), "d.m.y G:i" => CIBlockFormatProperties::DateFormat("d.m.y G:i", $timestamp), "d.m.Y H:i" => CIBlockFormatProperties::DateFormat("d.m.Y H:i", $timestamp), "SHORT" => GetMessage('COMP_PARAM_DATE_FORMAT_SITE'), "FULL" => GetMessage('COMP_PARAM_DATETIME_FORMAT_SITE')), "DEFAULT" => $DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")), "ADDITIONAL_VALUES" => "Y"); }
public static function formatDisplayDate($date, $format) { if (empty($date)) { return ''; } else { return \CIBlockFormatProperties::DateFormat($format, MakeTimeStamp($date, \CSite::GetDateFormat())); } }
if (strpos($arSection["~DROP_LINK"], "?") === false) { $arSection["~DROP_LINK"] .= "?"; } $arSection["~DROP_LINK"] .= "&" . bitrix_sessid_get() . "&edit=Y"; $arSection["~NEW_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["~SECTION_EDIT_URL"], array("SECTION_ID" => $arSection["ID"], "ACTION" => "new")); $arSection["EDIT_LINK"] = htmlSpecialChars($arSection["~EDIT_LINK"]); $arSection["DROP_LINK"] = htmlSpecialChars($arSection["~DROP_LINK"]); $arSection["NEW_LINK"] = htmlSpecialChars($arSection["~NEW_LINK"]); } $arSection['ELEMENTS_CNT'] = intVal(CIBlockSection::GetSectionElementsCount($arSection["ID"], array("CNT_ALL" => "Y"))); $arSection['SECTIONS_CNT'] = intVal(CIBlockSection::GetCount(array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "SECTION_ID" => $arSection["ID"]))); $arFilter["IBLOCK_SECTION_ID"] = $arSection["ID"]; $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $arParams["IBLOCK_ID"] . "_SECTION", $arSection["ID"], LANGUAGE_ID); $arSection["~DATE"] = $arUserFields["UF_DATE"]; if (is_array($arSection["~DATE"])) { $arSection["DATE"] = CIBlockFormatProperties::DateFormat($arParams["DATE_FORMAT"], MakeTimeStamp($arSection["~DATE"], CSite::GetDateFormat())); } if (intVal($arSection["~DETAIL_PICTURE"]) > 0) { $arSection["PICTURE"] = CFile::GetFileArray($arSection["~DETAIL_PICTURE"]); } elseif (intVal($arSection["~PICTURE"]) > 0) { $arSection["PICTURE"] = CFile::GetFileArray($arSection["~PICTURE"]); } $arResult["SECTIONS"][] = $arSection; } $arResult["USER_HAVE_ACCESS"] = $bUSER_HAVE_ACCESS; $this->IncludeComponentTemplate(); } /*?><pre><b>$arResult["USER_HAVE_ACCESS"]: </b><?=$arResult["USER_HAVE_ACCESS"]?></pre><?*/ if ($arParams["SET_TITLE"]) { $APPLICATION->SetTitle(GetMessage("P_TITLE")); }
<?php if ($code == "SHOW_COUNTER") { ?> <div class="bx-newslist-view"><i class="fa fa-eye"></i> <?php echo GetMessage("IBLOCK_FIELD_" . $code); ?> : <?php echo intval($value); ?> </div> <?php } elseif ($value && ($code == "SHOW_COUNTER_START" || $code == "DATE_ACTIVE_FROM" || $code == "ACTIVE_FROM" || $code == "DATE_ACTIVE_TO" || $code == "ACTIVE_TO" || $code == "DATE_CREATE" || $code == "TIMESTAMP_X")) { ?> <?php $value = CIBlockFormatProperties::DateFormat($arParams["ACTIVE_DATE_FORMAT"], MakeTimeStamp($value, CSite::GetDateFormat())); ?> <div class="bx-newslist-date"><i class="fa fa-calendar-o"></i> <?php echo GetMessage("IBLOCK_FIELD_" . $code); ?> : <?php echo $value; ?> </div> <?php } elseif ($code == "TAGS" && $value) { ?> <div class="bx-newslist-tags"><i class="fa fa-tag"></i> <?php echo GetMessage("IBLOCK_FIELD_" . $code); ?>
function ReserveVR($Params) { $tst = MakeTimeStamp($Params['dateTo']); if (date("H:i", $tst) == '00:00') { $Params['dateTo'] = CIBlockFormatProperties::DateFormat(getDateFormat(true), $tst + (23 * 60 + 59) * 60); } //$maxUsers = COption::GetOptionInt("video", "video-room-users", 6); //if(count($Params['members']) > $maxUsers) // return "max_users_".$maxUsers; $check = CEventCalendar::CheckVR($Params); if ($check !== true) { return $check; } $sectionID = 0; $dbItem = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $Params['VMiblockId'], "ACTIVE" => "Y")); if ($arItem = $dbItem->Fetch()) { $sectionID = $arItem["ID"]; } $arFields = array("IBLOCK_ID" => $Params['VMiblockId'], "IBLOCK_SECTION_ID" => $sectionID, "NAME" => $Params['name'], "DATE_ACTIVE_FROM" => $Params['dateFrom'], "DATE_ACTIVE_TO" => $Params['dateTo'], "CREATED_BY" => $GLOBALS["USER"]->GetID(), "DETAIL_TEXT" => $Params['description'], "PROPERTY_VALUES" => array("UF_PERSONS" => $Params['persons'], "PERIOD_TYPE" => $Params['regularity'], "PERIOD_COUNT" => $Params['regularity_count'], "EVENT_LENGTH" => $Params['regularity_length'], "PERIOD_ADDITIONAL" => $Params['regularity_additional'], "MEMBERS" => $Params['members']), "ACTIVE" => "Y"); $bs = new CIBlockElement(); $id = $bs->Add($arFields); return $id; }
/** * Convert dates if date template set * @param mixed[] array that date conversion performs in * @return void */ protected function formatDate(&$arr) { if (strlen($this->arParams['ACTIVE_DATE_FORMAT'])) { foreach ($this->orderDateFields2Convert as $fld) { if (!empty($arr[$fld])) { $arr[$fld . "_FORMATED"] = CIBlockFormatProperties::DateFormat($this->arParams['ACTIVE_DATE_FORMAT'], MakeTimeStamp($arr[$fld])); } } } }
$arResult['FILTER2'] = $_SESSION['LIST_FILTER2']; $arFilter = array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y'); $arFilter['PROPERTY_PROJECT'] = $arParams["PROJECT"] ? $arParams["PROJECT"] : $projects; $statisticFilter = $arFilter = array_merge($USER->GetViewTasksFilter(), $arFilter); $arFilter = array_merge($arFilter, $filters[$_SESSION['LIST_FILTER']]); $arFilter = array_merge($arFilter, $filters2[$_SESSION['LIST_FILTER2']]); $res = CIBlockElement::GetList(array($sorts[$_SESSION['LIST_SORT']] => $_SESSION['LIST_SORT_ORDER']), $arFilter, false, array('nPageSize' => $arParams['COUNT']), array("ID", "IBLOCK_ID", "NAME", "DETAIL_PAGE_URL", "PROPERTY_*", "DATE_CREATE", "CREATED_BY")); while ($ob = $res->GetNextElement()) { $arFields = $ob->GetFields(); if (strlen($arFields["DATE_CREATE"]) > 0) { $arFields["DATE_CREATE"] = CIBlockFormatProperties::DateFormat($arParams['DATE_FORMAT'], MakeTimeStamp($arFields["DATE_CREATE"], CSite::GetDateFormat())); } $arFields['PROPERTIES'] = $ob->GetProperties(); foreach (array('STATUS_DATE', 'COMMENT_DATE') as $code) { if (strlen($arFields['PROPERTIES'][$code]['VALUE']) > 0) { $arFields['PROPERTIES'][$code]['VALUE'] = CIBlockFormatProperties::DateFormat($arParams['DATE_TIME_FORMAT'], MakeTimeStamp($arFields['PROPERTIES'][$code]['VALUE'], CSite::GetDateFormat())); } } $arFields['NOT_VIEWED'] = $logger->isNotViewed($arFields['ID']); $arFields['NEW_COMMENTS'] = $logger->getNewCommentsCnt($arFields['ID']); $arFields['NEW_STATUS'] = $logger->getStatusField($arFields['ID']); $arFields['STATUS'] = $arFields['PROPERTIES']['STATUS']["VALUE_ENUM_ID"]; $arFields['STATUS_TEXT'] = StatusHelper::getStr($arFields['STATUS']); $arResult['TASKS'][] = $arFields; } $arResult["NAV_STRING"] = $res->GetPageNavString(); $arResult['USER_ID'] = CUser::GetID(); /* statistic */ $arResult['ALL_TASK_TIME'] = $arResult['TASK_CNT'] = $arResult['ACCEPTED_TASK_TIME'] = $arResult['ACCEPTED_TASK_CNT'] = 0; $statisticFilter['!PROPERTY_STATUS'] = STATUS_LIST_REJECT; $res = CIBlockElement::GetList(array(), $statisticFilter, false, false, array("ID", "PROPERTY_CALC_COMMENTS", "PROPERTY_STATUS", "IBLOCK_ID", 'PROPERTY_TRACKING'));