Skip to content

Commit

Permalink
Core: Yes or no custom field exports as text
Browse files Browse the repository at this point in the history
  • Loading branch information
mschering committed Nov 16, 2020
1 parent 51cb97d commit 9df0d99
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Studio: check whether package / module in allowed_modules
- Core: Custom logo didn't display in Dark theme
- Projects: fixed default income email template combo not loading
- Core: Yes or no custom field exports as text

06-11-2020 6.4.190
- Email: find correct translation string for 'Advanced'
Expand Down
13 changes: 13 additions & 0 deletions www/go/core/customfield/YesNo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@ class YesNo extends Base {
protected function getFieldSQL() {
return "tinyint DEFAULT NULL";
}

public function dbToText($value, \go\core\orm\CustomFieldsModel $values, $entity)
{
switch($value) {
case -1:
return go()->t("No");
case 1:
return go()->t("Yes");

default:
return "";
}
}
}

0 comments on commit 9df0d99

Please sign in to comment.