Commit 6877798f authored by Paul-Gabriel Müller's avatar Paul-Gabriel Müller Committed by Johannes

Remove weight query on index page

parent eb3db18e
Pipeline #106824000 failed with stages
in 17 minutes and 6 seconds
......@@ -67,10 +67,10 @@
- Show correct from/to information in mailboxes !1264 !1239 #603 @alex.simm
- Fix adding members to mailboxes by orga !1255 #677 @alex.simm
- Fix missing translations for MenuBasketsEntry. !1271 #761 @ctwx_ok
- disable delete account buttons for non-orga users !1279 @Caluera
- disable delete account buttons for non-orga users !1279 @Caluera
- repaired link to profile in the very first pinwall post #512 !1281 @Caluera
- Disallow foodsharing email addresses to be used as password restore addresses !1268 #744 @alex.simm
- Remove email addresses from the bounce list before sending a confirmation mail !1268 #756 @alex.simm
- Disallow foodsharing email addresses to be used as password restore addresses !1268 #744 @alex.simm
- Remove email addresses from the bounce list before sending a confirmation mail !1268 #756 @alex.simm
- Move map control elements on small devices #695 !1286 @lea.mzw
## Refactoring
......@@ -109,6 +109,7 @@
- Switched use of Session::id to Session::may !1257 @pfaufisch
- Refactored FoodsaverModel to FoodsaverGateway !1178 !1266 #9 @svenpascal
- Updated dependencies and fixed broken templates !1272 !1283 @ctwx_ok
- Removed class IndexGateway as it serves no purpose !1270 #763 @panschk
## Dev/Test/CI stuff
......
......@@ -8,11 +8,9 @@ use Foodsharing\Modules\Core\Control;
class IndexControl extends Control
{
private $contentGateway;
private $indexGateway;
public function __construct(IndexGateway $indexGateway, IndexView $view, ContentGateway $contentGateway)
public function __construct(IndexView $view, ContentGateway $contentGateway)
{
$this->indexGateway = $indexGateway;
parent::__construct();
$this->contentGateway = $contentGateway;
$this->view = $view;
......@@ -22,14 +20,6 @@ class IndexControl extends Control
{
$this->pageHelper->addTitle('Rette mit!');
$gerettet = (int)$this->indexGateway->getFetchedWeight();
if ($gerettet == 0) {
$gerettet = 762338;
}
$gerettet = round($gerettet, 0);
$host = $_SERVER['HTTP_HOST'] ?? BASE_URL;
if (strpos($host, 'foodsharing.at') !== false) {
$page_content = $this->contentGateway->get(37);
......
<?php
namespace Foodsharing\Modules\Index;
use Foodsharing\Modules\Core\BaseGateway;
use Foodsharing\Modules\Core\DBConstants\Region\RegionIDs;
class IndexGateway extends BaseGateway
{
public function getFetchedWeight()
{
$stm = 'SELECT stat_fetchweight FROM fs_bezirk WHERE id = :region_id';
return $this->db->fetchValue($stm, [':region_id' => RegionIDs::EUROPE]);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment