protected static function prepareUFInfo() { if (!is_array(self::$arUFId) || count(self::$arUFId) <= 0 || is_array(self::$ufInfo)) { return; } self::$arUFId = array(); self::$ufInfo = array(); self::$ufEnumerations = array(); }
public static function formatResultsTotal(&$total, &$columnInfo, &$customChartTotal = null) { parent::formatResultsTotal($total, $columnInfo); foreach ($total as $k => $v) { // remove prefix TOTAL_ $original_k = substr($k, 6); $cInfo = $columnInfo[$original_k]; if (strpos($k, 'DURATION_PLAN_HOURS') !== false && !strlen($cInfo['prcnt'])) { if (!empty($v)) { $days = floor($v / 24); $hours = $v - $days * 24; $v = ''; if (!empty($days)) { $v .= $days . GetMessage('TASKS_REPORT_DURATION_DAYS'); } if (!empty($hours)) { if (!empty($days)) { $v .= ' '; } $v .= $hours . GetMessage('TASKS_REPORT_DURATION_HOURS'); } $total[$k] = $v; } } elseif (strpos($k, 'DURATION') !== false && !strlen($cInfo['prcnt'])) { $hours = floor($v / 60); $minutes = date('i', $v % 60 * 60); $total[$k] = $hours . ':' . $minutes; } elseif (strpos($k, 'TIME_ESTIMATE') !== false && !strlen($cInfo['prcnt'])) { $hours = floor($v / 3600); $minutes = date('i', $v % 3600); $total[$k] = $hours . ':' . $minutes; } elseif ((strpos($k, 'IS_EFFECTIVE_PRCNT') !== false || strpos($k, 'IS_OVERDUE_PRCNT') !== false || strpos($k, 'IS_MARKED_PRCNT') !== false) && $cInfo['prcnt'] !== 'self_column') { if (self::$nRows > 0 && substr($v, 0, 2) !== '--') { $total[$k] = round(doubleval($v) / self::$nRows, 2) . '%'; } } } }
public static function formatResultsTotal(&$total, &$columnInfo, &$customChartTotal = null) { foreach ($total as $k => &$v) { if (preg_match('/_OPPORTUNITY$/', $k) || preg_match('/_ACCOUNT$/', $k) || preg_match('/_AMOUNT$/', $k) || preg_match('/_PRICE$/', $k) || preg_match('/_PRICE_WORK$/', $k) || preg_match('/_PRICE_PAYED$/', $k) || preg_match('/_PRICE_CANCELED$/', $k)) { $v = self::MoneyToString(doubleval($v)); } elseif (preg_match('/_QUANTITY$/', $k)) { $d = doubleval($v); $floor = floor($d); if ($floor === $d) { $v = str_replace(' ', ' ', number_format($floor, 0, '.', '')); } else { $v = str_replace(' ', ' ', number_format($d, 2, '.', '')); } } } parent::formatResultsTotal($total, $columnInfo); }
public static function getUserNameFormat() { if (self::$userNameFormat === null) { $site = new CSite(); self::$userNameFormat = $site->GetNameFormat(false); } return self::$userNameFormat; }