Make "next X days" configurable (closes #175)

This commit is contained in:
Bernd Bestel
2019-04-20 15:30:45 +02:00
parent 41988aa1ee
commit c1674d33b4
15 changed files with 149 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
namespace Grocy\Controllers;
use \Grocy\Services\ChoresService;
use \Grocy\Services\UsersService;
class ChoresController extends BaseController
{
@@ -16,10 +17,13 @@ class ChoresController extends BaseController
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
{
$usersService = new UsersService();
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['chores_due_soon_days'];
return $this->AppContainer->view->render($response, 'choresoverview', [
'chores' => $this->Database->chores()->orderBy('name'),
'currentChores' => $this->ChoresService->GetCurrent(),
'nextXDays' => 5
'nextXDays' => $nextXDays
]);
}
@@ -65,4 +69,9 @@ class ChoresController extends BaseController
]);
}
}
public function ChoresSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
{
return $this->AppContainer->view->render($response, 'choressettings');
}
}