diff --git a/Layout/default/ADBWohneinheit/Form.php b/Layout/default/ADBWohneinheit/Form.php index b3d9bbc7f..b7a5b3a65 100644 --- a/Layout/default/ADBWohneinheit/Form.php +++ b/Layout/default/ADBWohneinheit/Form.php @@ -1 +1,174 @@ id && !array_key_exists($unit->hausnummer->netzgebiet_id, $my_adb_networks)) { + $this->setFlash("Keine Berechtigung", "error"); + mfBaseController::redirect("AddressDB"); + } + +?> + + +
| ID | OAID | Status | @@ -121,6 +125,7 @@|
|---|---|---|---|
| $unit->id])?>"> | =$unit->id?> | =$unit->oaid?> | =$unit->status->code?> - =$unit->status->name?> | diff --git a/Layout/default/Preorder/include/preorder-detail.php b/Layout/default/Preorder/include/preorder-detail.php index f0254f5a7..dfb5b3a66 100644 --- a/Layout/default/Preorder/include/preorder-detail.php +++ b/Layout/default/Preorder/include/preorder-detail.php @@ -312,6 +312,9 @@
| Building Name: | =$preorder->adb_hausnummer->extref?> + | ||
| Building External ID: | +=$preorder->adb_hausnummer->rimo_id?> | ||
| Home External ID: | =$preorder->adb_wohneinheit->extref?>
diff --git a/Layout/default/Productgroup/Form.php b/Layout/default/Productgroup/Form.php
index c5b55d0d3..ad3830a8f 100644
--- a/Layout/default/Productgroup/Form.php
+++ b/Layout/default/Productgroup/Form.php
@@ -7,7 +7,7 @@
+
+
+
diff --git a/application/ADBWohneinheit/ADBWohneinheitController.php b/application/ADBWohneinheit/ADBWohneinheitController.php
index 6836891c8..e1941ce1f 100644
--- a/application/ADBWohneinheit/ADBWohneinheitController.php
+++ b/application/ADBWohneinheit/ADBWohneinheitController.php
@@ -2,4 +2,104 @@
class ADBWohneinheitController extends mfBaseController {
+ protected function init() {
+ $this->needlogin=true;
+ $me = new User();
+ $me->loadMe();
+ $this->me = $me;
+ $this->layout()->set("me",$me);
+
+ if(!$me->is(["Admin", "netowner"]) && !$me->can("Preorder")) {
+ $this->redirect("Dashboard");
+ }
+ }
+
+ protected function addAction() {
+ $this->layout()->setTemplate("ADBWohneinheit/Form");
+
+ if($this->me->is("Admin")) {
+ $my_networks = NetworkModel::getAll();
+ } else {
+ $my_networks = $this->me->myNetworks(["netowner", "salespartner"]);
+ }
+
+ $netzgebiet_ids = [];
+ $my_adb_networks = [];
+ foreach($my_networks as $network) {
+ if($network->adb_netzgebiet_id && !in_array($network->adb_netzgebiet_id, $netzgebiet_ids)) {
+ $netzgebiet_ids[] = $network->adb_netzgebiet_id;
+ $my_adb_networks[$network->adb_netzgebiet_id] = new ADBNetzgebiet($network->adb_netzgebiet_id);
+ }
+ }
+ $this->layout()->set("my_adb_networks", $my_adb_networks);
+
+ }
+
+ protected function editAction() {
+ $id = $this->request->id;
+ if(!is_numeric($id) || $id < 1) {
+ $this->layout()->setFlash("Adresse nicht gefunden", "error");
+ $this->redirect("AddressDB");
+ }
+
+ $unit = new ADBWohneinheit($id);
+ if(!$unit->id) {
+ $this->layout()->setFlash("Wohneinheit nicht gefunden", "error");
+ $this->redirect("AddressDB");
+ }
+
+ /*if(!in_array($hausnummer->netzgebiet_id, $my_adb_networks)) {
+ $this->layout()->setFlash("Adresse nicht gefunden", "error");
+ $this->redirect("AddressDB");
+ }*/
+
+ $this->layout()->set("unit", $unit);
+
+ return $this->addAction();
+ }
+
+ protected function saveAction() {
+ $r = $this->request;
+ $id = $r->id;
+ //var_dump($r->get());exit;
+
+ $unit_data = [];
+
+ if(is_numeric($id) && $id > 0) {
+ $mode = "edit";
+ $unit = new ADBWohneinheit($id);
+ if(!$unit->id) {
+ $this->layout()->setFlash("Wohneinheit nicht gefunden", "error");
+ $this->redirect("AddressDB");
+ }
+ } else {
+ $mode = "add";
+ }
+
+
+ $unit_data["oaid"] = ($r->oaid) ? trim($r->oaid) : null;
+ $unit_data["extref"] = ($r->extref) ? trim($r->extref) : null;
+ $unit_data["block"] = ($r->block) ? trim($r->block) : null;
+ $unit_data["stiege"] = ($r->stiege) ? trim($r->stiege) : null;
+ $unit_data["stock"] = ($r->stock) ? trim($r->stock) : null;
+ $unit_data["tuer"] = ($r->tuer) ? trim($r->tuer) : null;
+ $unit_data["zusatz"] = ($r->zusatz) ? trim($r->zusatz) : null;
+ $unit_data["bezeichner"] = ($r->bezeichner) ? trim($r->bezeichner) : null;
+
+ if($mode == "add") {
+ $unit = ADBWohneinheitModel::create($unit_data);
+ } else {
+ $unit->update($unit_data);
+ }
+
+ if(!$unit->save()) {
+ $this->layout()->setFlash("Beim Speichern der Wohneinheit ist ein Fehler aufgetreten.", "error");
+ $this->layout()->set("unit", $unit);
+ return $this->addAction();
+ }
+
+ $this->layout()->setFlash("Wohneinheit erfolgreich gespeichert.", "success");
+ $this->redirect("AddressDB", "view", ["id" => $unit->hausnummer_id]);
+ }
+
}
\ No newline at end of file
diff --git a/application/ADBWohneinheit/ADBWohneinheitModel.php b/application/ADBWohneinheit/ADBWohneinheitModel.php
index 17243b32c..aa3f0dfe0 100644
--- a/application/ADBWohneinheit/ADBWohneinheitModel.php
+++ b/application/ADBWohneinheit/ADBWohneinheitModel.php
@@ -1,6 +1,8 @@
id;
$hausnummer_data['plz_id'] = $plz->id;
diff --git a/application/AddressDB/AddressDBController.php b/application/AddressDB/AddressDBController.php
index 850728fff..b722634ce 100644
--- a/application/AddressDB/AddressDBController.php
+++ b/application/AddressDB/AddressDBController.php
@@ -270,7 +270,7 @@ class AddressDBController extends mfBaseController {
if(!$this->me->is("Admin")) {
$required[] = "netzgebiet_id";
}
- foreach(['adrcd','extref','netzgebiet_id','strasse','hausnummer','plz','ortschaft','gemeinde','grund_nr','gdaeigenschaft','meridian','rw','hw','gps_lat','gps_long','unit_count'] as $field) {
+ foreach(['adrcd','extref','rimo_id','netzgebiet_id','strasse','hausnummer','plz','ortschaft','gemeinde','grund_nr','gdaeigenschaft','meridian','rw','hw','gps_lat','gps_long','unit_count'] as $field) {
if(in_array($field, $required)) {
if(!trim($r->$field)) {
$this->layout()->setFlash("'".ucfirst($field)."' darf nicht leer sein!", "error");
diff --git a/application/Productgroup/ProductgroupController.php b/application/Productgroup/ProductgroupController.php
index 38a5cc812..c89e3dd18 100644
--- a/application/Productgroup/ProductgroupController.php
+++ b/application/Productgroup/ProductgroupController.php
@@ -87,6 +87,24 @@ class ProductgroupController extends mfBaseController {
$group_data = [];
$group_data['name'] = $name;
+ $group_data["matchcodeorigin"] = null;
+
+ if($r->matchcodeorigin) {
+ switch($r->matchcodeorigin) {
+ case "address":
+ $group_data["matchcodeorigin"] = "address";
+ break;
+ case "domain":
+ $group_data["matchcodeorigin"] = "domain";
+ break;
+ case "terminationaddress":
+ $group_data["matchcodeorigin"] = "terminationaddress";
+ break;
+ case "voicenumber":
+ $group_data["matchcodeorigin"] = "voicenumber";
+ break;
+ }
+ }
if($mode == "edit") {
$group->update($group_data);
diff --git a/application/Productgroup/ProductgroupModel.php b/application/Productgroup/ProductgroupModel.php
index e418345d6..3bd4112e1 100644
--- a/application/Productgroup/ProductgroupModel.php
+++ b/application/Productgroup/ProductgroupModel.php
@@ -1,8 +1,9 @@
escape($filter['name']);
+ $where .= " AND XinonFibuMerge.name='$name'";
+ }
+ }
//var_dump($filter, $where);exit;
return $where;
diff --git a/db/migrations/20240118193741_productgroup_add_matchcodeorigin.php b/db/migrations/20240118193741_productgroup_add_matchcodeorigin.php
new file mode 100644
index 000000000..df899e32e
--- /dev/null
+++ b/db/migrations/20240118193741_productgroup_add_matchcodeorigin.php
@@ -0,0 +1,31 @@
+getEnvironment() == "thetool") {
+ $table = $this->table("Productgroup");
+ $table->addColumn("matchcodeorigin", "string", ["null" => true, "default" => null, "limit" => 64, "after" => "name"]);
+ $table->update();
+ }
+
+ if($this->getEnvironment() == "addressdb") {
+
+ }
+ }
+
+ public function down(): void
+ {
+ if($this->getEnvironment() == "thetool") {
+ $this->table("Productgroup")->removeColumn("matchcodeorigin")->save();
+ }
+
+ if($this->getEnvironment() == "addressdb") {
+
+ }
+ }
+}
diff --git a/lang/de.php b/lang/de.php
index 9c5e67579..e734966c6 100644
--- a/lang/de.php
+++ b/lang/de.php
@@ -73,7 +73,7 @@ $l["cc.tschechien"] = "CZ";
$l["cc.czechia"] = "CZ";
$l["cc.tschechische republik"] = "CZ";
$l["cc.czech republic"] = "CZ";
-$l["cc.Česká republika"] = "CZ";
+$l["cc.Ceska republika"] = "CZ";
$l["cc.deutschland"] = "DE";
$l["cc.germany"] = "DE";
$l["cc.frankreich"] = "FR";
@@ -81,7 +81,6 @@ $l["cc.france"] = "FR";
$l["cc.francaise"] = "FR";
$l["cc.République française"] = "FR";
$l["cc.Republique francaise"] = "FR";
-$l["cc.großbritannien"] = "GB";
$l["cc.grossbritannien"] = "GB";
$l["cc.britain"] = "GB";
$l["cc.great britain"] = "GB";
@@ -89,7 +88,6 @@ $l["cc.uk"] = "GB";
$l["cc.united kingdom"] = "GB";
$l["cc.United Kingdom of Great Britain and Northern Ireland"] = "GB";
$l["cc.Vereinigtes Koenigreich"] = "GB";
-$l["cc.Vereinigtes Koenigreich Großbritannien und Nordirland"] = "GB";
$l["cc.Vereinigtes Koenigreich Grossbritannien und Nordirland"] = "GB";
$l["cc.ungarn"] = "HU";
$l["cc.hungary"] = "HU";
@@ -105,7 +103,6 @@ $l["cc.nihon"] = "JP";
$l["cc.日本"] = "JP";
$l["cc.日本国"] = "JP";
$l["cc.luxemburg"] = "LU";
-$l["cc.großherzogtum luxemburg"] = "LU";
$l["cc.grossherzogtum luxemburg"] = "LU";
$l["cc.luxembourg"] = "LU";
$l["cc.grand duchy of luxembourg"] = "LU";
@@ -126,17 +123,17 @@ $l["cc.slovenia"] = "SL";
$l["cc.slowakei"] = "SK";
$l["cc.slovakia"] = "SK";
$l["cc.slowakische republik"] = "SK";
-$l["cc.Slovak Republic"] = "SK";
-$l["cc.Vereinigte Staaten"] = "US";
-$l["cc.Vereinigte Staaten von Amerika"] = "US";
+$l["cc.slovak republic"] = "SK";
+$l["cc.vereinigte staaten"] = "US";
+$l["cc.vereinigte staaten von amerika"] = "US";
$l["cc.usa - vereinigte staaten"] = "US";
$l["cc.Amerika"] = "US";
-$l["cc.US"] = "US";
-$l["cc.USA"] = "US";
-$l["cc.U.S.A."] = "US";
-$l["cc.America"] = "US";
-$l["cc.United States"] = "US";
-$l["cc.United States of America"] = "US";
+$l["cc.us"] = "US";
+$l["cc.usa"] = "US";
+$l["cc.u.s.a."] = "US";
+$l["cc.america"] = "US";
+$l["cc.united states"] = "US";
+$l["cc.united states of america"] = "US";
$l["cc.mm"] = "CW";
$lang['de'] = $l;
\ No newline at end of file
diff --git a/lib/mvcfronk/mfLayout/mfLayout.php b/lib/mvcfronk/mfLayout/mfLayout.php
index 9881ed950..f4564eb7f 100644
--- a/lib/mvcfronk/mfLayout/mfLayout.php
+++ b/lib/mvcfronk/mfLayout/mfLayout.php
@@ -288,7 +288,6 @@ function __($_string, $prefix = null) {
$string = str_replace(["Ä","Ö","Ü","ß","ä","ö","ü","ß"], ["ae","oe","ue","ss","ae","oe","ue", "ss"], strtolower($_string));
-
if(!$lang) {
//mfLoghandler::singleton()->debug("Loading language file for __() function");
include(BASEDIR . "/lang/de.php");
+
+
+ |