Implement custom entities / objects (closes #242)

This commit is contained in:
Bernd Bestel
2019-09-18 16:18:15 +02:00
parent 918f84f568
commit 096fb7a116
20 changed files with 666 additions and 18 deletions

View File

@@ -16,21 +16,10 @@ class BaseController
$localizationService = new LocalizationService(GROCY_CULTURE);
$this->LocalizationService = $localizationService;
if (GROCY_MODE === 'prerelease')
{
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
$commitDate = trim(exec('git log --date=iso --pretty="%cd" -n1 HEAD'));
$container->view->set('version', "pre-release-$commitHash");
$container->view->set('releaseDate', \substr($commitDate, 0, 19));
}
else
{
$applicationService = new ApplicationService();
$versionInfo = $applicationService->GetInstalledVersion();
$container->view->set('version', $versionInfo->Version);
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
}
$applicationService = new ApplicationService();
$versionInfo = $applicationService->GetInstalledVersion();
$container->view->set('version', $versionInfo->Version);
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
$container->view->set('__t', function(string $text, ...$placeholderValues) use($localizationService)
{
@@ -64,6 +53,8 @@ class BaseController
}
$container->view->set('featureFlags', $constants);
$container->view->set('userentitiesForSidebar', $this->Database->userentities()->where('show_in_sidebar_menu = 1')->orderBy('name'));
try
{
$usersService = new UsersService();