diff --git a/core/attributedef/AttributeDashboard.php b/core/attributedef/AttributeDashboard.php new file mode 100644 index 000000000..367a798c1 --- /dev/null +++ b/core/attributedef/AttributeDashboard.php @@ -0,0 +1,98 @@ +GetCode(); + $sClass = MetaModel::GetAttributeOrigin($this->GetHostClass(), $sAttCode); + $sFilePath = APPROOT . 'env-' . utils::GetCurrentEnvironment() . '/' . $this->Get('definition_file'); + return RuntimeDashboard::GetDashboard($sFilePath, $sClass . '__' . $sAttCode); + } + + public function IsUserEditable() + { + return $this->Get('is_user_editable'); + } + + public function IsWritable() + { + return false; + } + + public function GetEditClass() + { + return ""; + } + + public function GetDefaultValue(DBObject $oHostObject = null) + { + return null; + } + + public function GetBasicFilterOperators() + { + return array(); + } + + public function GetBasicFilterLooseOperator() + { + return '='; + } + + public function GetBasicFilterSQLExpr($sOpCode, $value) + { + return ''; + } + + /** + * @inheritdoc + */ + public function MakeFormField(DBObject $oObject, $oFormField = null) + { + return null; + } + + // if this verb returns false, then GetValue must be implemented + public static function LoadInObject() + { + return false; + } + + public function GetValue($oHostObject) + { + return ''; + } + + /** + * @inheritDoc + */ + public function HasAValue($proposedValue): bool + { + // Always return false for now, we don't consider a custom version of a dashboard + return false; + } +} \ No newline at end of file