Finished Preorder statistics / added statistics permission

This commit is contained in:
Frank Schubert
2024-01-20 09:17:26 +01:00
parent 791465c9a4
commit a90de85ddf
7 changed files with 114 additions and 68 deletions

View File

@@ -23,8 +23,7 @@ class DashboardController extends mfBaseController {
$newss = NewsModel::getAll();
$this->layout()->set("newss", $newss);
//if($this->me->is(["Admin", "netowner", "salespartner"]) || $this->me->can("Preorder")) {
if($this->me->is("Admin")) {
if($this->me->can("Statistics") && $this->me->is(["Admin", "netowner", "salespartner"])) {
return $this->dashboardAction();
}
@@ -118,7 +117,7 @@ class DashboardController extends mfBaseController {
foreach($preordercampaign_id as $campaign_id) {
$campaign = new Preordercampaign($campaign_id);
if($campaign->id) {
$total_homes += $campaign->total_homes;
$total_homes += ($campaign->homes_total) ? $campaign->homes_total : $campaign->total_homes;
}
}