WIP Voiceplan Zones

This commit is contained in:
Frank Schubert
2023-10-13 11:31:45 +02:00
parent 97432a24bb
commit 33c2c63100
17 changed files with 654 additions and 93 deletions
+10 -1
View File
@@ -4,6 +4,7 @@ class Voiceplan extends mfBaseModel {
private $creator;
private $editor;
private $zones;
private $destinations;
public function importDestinationsFromCsv(File $file) {
@@ -68,10 +69,18 @@ class Voiceplan extends mfBaseModel {
if($this->$name == null) {
if($name == "destinations") {
$this->destinations = VoiceplandestinationModel::search(["voiceplan_id" => $this->id]);
$this->destinations = [];
foreach($this->getProperty("zones") as $zone) {
$this->destinations[] = $zone->destinations;
}
return $this->destinations;
}
if($name == "zones") {
$this->zones = VoiceplanzoneModel::search(["voiceplan_id" => $this->id]);
return $this->zones;
}
if($name == "creator") {
$user = mfValuecache::singleton()->get("Worker-id-".$this->create_by);
if($user) {