/** * @param $type * @return null | string */ public static function renderNonEditableTypeStringContent($type) { assert('is_string($type)'); $typesAndLabels = Report::getTypeDropDownArray(); if (isset($typesAndLabels[$type])) { return $typesAndLabels[$type]; } }
/** * @return string * @throws NotSupportedException if the Report is new */ public function getTitle() { if ($this->model->id > 0) { $moduleClassName = $this->model->moduleClassName; $typesAndLabels = Report::getTypeDropDownArray(); return strval($this->model) . ' - ' . Zurmo::t('ReportsModule', '{moduleLabel} {typeLabel} Report', array('{moduleLabel}' => $moduleClassName::getModuleLabelByTypeAndLanguage('Singular'), '{typeLabel}' => $typesAndLabels[$this->model->type])); } else { throw new NotSupportedException(); } }
/** * @return string * @throws NotSupportedException if the Report is new */ public function getTitle() { if ($this->model->id > 0) { $moduleClassName = $this->model->moduleClassName; $moduleLabel = $this->getPuralModuleLabelForReportTitle($moduleClassName); $typesAndLabels = Report::getTypeDropDownArray(); return strval($this->model) . ' - ' . Zurmo::t('ReportsModule', '{moduleLabel} {typeLabel} Report', array('{moduleLabel}' => $moduleLabel, '{typeLabel}' => $typesAndLabels[$this->model->type])); } else { throw new NotSupportedException(); } }
/** * @return array */ protected function getDropDownArray() { return Report::getTypeDropDownArray(); }