diff --git a/Layout/default/ADBWohneinheit/Form.php b/Layout/default/ADBWohneinheit/Form.php index b7a5b3a65..7773256c2 100644 --- a/Layout/default/ADBWohneinheit/Form.php +++ b/Layout/default/ADBWohneinheit/Form.php @@ -122,48 +122,52 @@ - -
-
-
+ + + + rimo_workorder) && $unit->rimo_workorder->id) || (is_array($unit->ftu_data) && $unit->ftu_data->id)): ?> +
+
+
-
+
-
-
- - - - - - - - - - - - - - - - - - - - - - - -

FTU

FTU Name:ftu_data["name"]?> -
FTU External IDftu_data["id"]?> -

Workorder

Namerimo_workorder->rimo_name?>
External IDrimo_workorder->rimo_id?>
Statusrimo_workorder->rimo_status?>
Erstelltrimo_workorder)) ? date("d.m.Y H:i:s", $unit->rimo_workorder->create) : ""?>
-
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +

FTU

FTU Name:ftu_data["name"]?> +
FTU External IDftu_data["id"]?> +

Workorder

Namerimo_workorder->rimo_name?>
External IDrimo_workorder->rimo_id?>
Statusrimo_workorder->rimo_status?>
Erstelltrimo_workorder)) ? date("d.m.Y H:i:s", $unit->rimo_workorder->create) : ""?>
- - +
+
+ +
diff --git a/Layout/default/AddressDB/View.php b/Layout/default/AddressDB/View.php index 669cd8829..f61d3d060 100644 --- a/Layout/default/AddressDB/View.php +++ b/Layout/default/AddressDB/View.php @@ -31,7 +31,7 @@
-
+
@@ -107,7 +107,7 @@
-
+
diff --git a/Layout/default/Dashboard/Dashboard.php b/Layout/default/Dashboard/Dashboard.php index 6ebac6122..f347982a9 100644 --- a/Layout/default/Dashboard/Dashboard.php +++ b/Layout/default/Dashboard/Dashboard.php @@ -66,7 +66,7 @@ $chartColors = [
-

Akquise Statistiken Momentan nur für Admins sichtbar

+

Akquise Statistiken

@@ -87,7 +87,7 @@ $chartColors = [
- +
Bestellungen

/

@@ -97,13 +97,28 @@ $chartColors = [
- + +
+
+
+
+
+ +
+
Aktive Anschlüsse
+

/

+
+ +
+
+
+
- +
Status BEP Installed (244, SD)

/

@@ -118,7 +133,7 @@ $chartColors = [
- +
Status OTO Installed (245, MD)

/

@@ -128,20 +143,7 @@ $chartColors = [
-
-
-
-
-
- -
-
Aktive Anschlüsse
-

/

-
- -
-
-
+
@@ -199,9 +201,9 @@ $chartColors = [ $count): ?> - ## - % () - - " style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> + ## + % () + - "> @@ -371,7 +373,7 @@ $chartColors = [ labels: [ $count): ?> - code?> - name?> " (%)", + " - (%)", ], diff --git a/Layout/default/User/Form.php b/Layout/default/User/Form.php index 291b3e205..05877814e 100644 --- a/Layout/default/User/Form.php +++ b/Layout/default/User/Form.php @@ -50,7 +50,7 @@
@@ -219,6 +219,13 @@
+ +
+
+ can("Statistics")) ? "checked='checked'" : ""?> /> + +
+

@@ -248,9 +255,9 @@
"> apikey): ?> - + - +
diff --git a/application/Dashboard/DashboardController.php b/application/Dashboard/DashboardController.php index 5f4ff600a..e05ace346 100644 --- a/application/Dashboard/DashboardController.php +++ b/application/Dashboard/DashboardController.php @@ -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; } } diff --git a/application/User/UserController.php b/application/User/UserController.php index e8a51163b..eeba4c1b9 100644 --- a/application/User/UserController.php +++ b/application/User/UserController.php @@ -51,7 +51,9 @@ class UserController extends mfBaseController } $this->layout()->setTemplate('User/Form'); - $addresses = AddressModel::getAll(); + $roles = TT_NETWORK_ROLES_WITH_OWNER; + $roles[] = "systemowner"; + $addresses = AddressModel::search(["addresstype" => $roles]); $this->layout()->set("addresses", $addresses); if ($this->request->address_id) { @@ -225,6 +227,7 @@ class UserController extends mfBaseController $user->permissions->canPreorder = "false"; $user->permissions->canOrder = "false"; $user->permissions->canFibu = "false"; + $user->permissions->canStatistics = "false"; if($r->get("can") && is_array($r->can)) { foreach($r->can as $key => $can) { diff --git a/db/migrations/20240119124212_add_can_statistics_permission.php b/db/migrations/20240119124212_add_can_statistics_permission.php new file mode 100644 index 000000000..fe7593c84 --- /dev/null +++ b/db/migrations/20240119124212_add_can_statistics_permission.php @@ -0,0 +1,31 @@ +getEnvironment() == "thetool") { + $table = $this->table("WorkerPermission"); + $table->addColumn("canStatistics", "enum", ["values" => 'false,true', "default" => "false", "after" => "canOrder"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("WorkerPermission")->removeColumn("canStatistics")->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}