public function GetStatus() { $ViHttp = new CVoxImplantHttp(); $result = $ViHttp->GetDocumentStatus(); if (!$result) { $this->error = new CVoxImplantError(__METHOD__, $ViHttp->GetError()->code, $ViHttp->GetError()->msg); return false; } $verifications = array(); foreach ($result as $key => $verification) { $regionName = GetMessage('VI_DOCS_COUNTRY_' . $verification->REGION); $regionName = strlen($regionName) > 0 ? $regionName : $verification->REGION; $verifications[$key]['REGION'] = $verification->REGION; $verifications[$key]['REGION_NAME'] = $regionName; $verifications[$key]['STATUS'] = $verification->STATUS; $verifications[$key]['STATUS_NAME'] = GetMessage('VI_DOCS_STATUS_' . $verification->STATUS); if ($verification->STATUS != 'VERIFIED' && $verification->UNVERIFIED_HOLD_UNTIL) { $data = new Bitrix\Main\Type\DateTime($verification->UNVERIFIED_HOLD_UNTIL, 'Y-m-d H:i:s'); $verifications[$key]['UNVERIFIED_HOLD_UNTIL'] = $data->format(Bitrix\Main\Type\Date::getFormat()); } else { $verifications[$key]['UNVERIFIED_HOLD_UNTIL'] = ''; } if (isset($verification->DOCUMENTS)) { foreach ($verification->DOCUMENTS as $document) { $data = new Bitrix\Main\Type\DateTime($document->UPLOADED, 'Y-m-d H:i:s'); $verifications[$key]['DOCUMENTS'][] = array('UPLOADED' => $data->format(Bitrix\Main\Type\DateTime::getFormat()), 'DOCUMENT_ID' => $document->DOCUMENT_ID, 'DOCUMENT_STATUS' => $document->DOCUMENT_STATUS, 'DOCUMENT_STATUS_NAME' => GetMessage('VI_DOCS_DOCUMENT_STATUS_' . $document->DOCUMENT_STATUS), 'IS_INDIVIDUAL' => $document->IS_INDIVIDUAL, 'IS_INDIVIDUAL_NAME' => GetMessage('VI_DOCS_IS_INDIVIDUAL_' . $document->IS_INDIVIDUAL), 'REVIEWER_COMMENT' => $document->REVIEWER_COMMENT); } } } return $verifications; }
public static function ConvertFromDB($arProperty, $value, $format = '') { if (strlen($value["VALUE"]) > 0) { try { $time = new Bitrix\Main\Type\DateTime($value['VALUE'], "Y-m-d H:i:s"); $time->toUserTime(); if ($format === 'SHORT') { $phpFormat = $time->convertFormatToPhp(FORMAT_DATE); } elseif ($format === 'FULL') { $phpFormat = $time->convertFormatToPhp(FORMAT_DATETIME); } elseif ($format) { $phpFormat = $time->convertFormatToPhp($format); } else { $phpFormat = $time->getFormat(); } $value["VALUE"] = $time->format($phpFormat); $value["VALUE"] = str_replace(" 00:00:00", "", $value["VALUE"]); } catch (Bitrix\Main\ObjectException $e) { } } return $value; }
public static function ConvertFromDB($arProperty, $value, $format = '') { if (strlen($value["VALUE"]) > 0) { try { $time = new Bitrix\Main\Type\DateTime($value['VALUE'], "Y-m-d H:i:s", new \DateTimeZone('UTC')); $time->setDefaultTimeZone(); $phpFormat = $format? $time->convertFormatToPhp($format): $time->getFormat(); $value["VALUE"] = $time->format($phpFormat); $value["VALUE"] = str_replace(" 00:00:00", "", $value["VALUE"]); } catch(Main\ObjectException $e) { } } return $value; }