diff --git a/Layout/default/Preorder/billing-export.csv.php b/Layout/default/Preorder/billing-export.csv.php new file mode 100644 index 000000000..380482416 --- /dev/null +++ b/Layout/default/Preorder/billing-export.csv.php @@ -0,0 +1,67 @@ +name.'-billing-'.date('Y-m-d_H-i-s').'.csv"'); +?> +Kampagne;Netzgebiet ID;Netzgebiet;Extref;Bestellcode;OAID;Bestelldatum;Bestelltyp;Status Code; Status Name;Anschlusstyp;GWR Adresscode;Meridian;RW;HW;Anschluss Strasse;Anschluss Hausnummer;Anschluss PLZ;Anschluss Ort;Anschluss Wohneinheit;GPS Breite;GPS Länge;Anzahl Anschlüsse;Kunde Firma;Kunde UID;Kunde Vorname;Kunde Nachname;Kunde Strasse;Kunde PLZ;Kunde Ort;Kunde Telefon;Kunde Email;Partner;Preis Setup;Erstellt;Letzte Bearbeitung +preordercampaign_id); + $status = Layout::getMfValuecacheObject("Preorderstatus", $data->status_id); + $hausnummer = Layout::getMfValuecacheObject("ADBHausnummer", $data->adb_hausnummer_id); + $wohneinheit = Layout::getMfValuecacheObject("ADBWohneinheit", $data->adb_wohneinheit_id); + $netzgebiet = Layout::getMfValuecacheObject("ADBNetzgebiet", $hausnummer->netzgebiet_id); + $strasse = Layout::getMfValuecacheObject("ADBStrasse", $hausnummer->strasse_id); + $gemeinde = Layout::getMfValuecacheObject("ADBGemeinde",$strasse->gemeinde_id); + $ortschaft = Layout::getMfValuecacheObject("ADBOrtschaft", $hausnummer->ortschaft_id); + $plz = Layout::getMfValuecacheObject("ADBPlz", $hausnummer->plz_id); + $partner = Layout::getMfValuecacheObject("Address", $data->partner_id); + + $unit_data = ""; + if($wohneinheit->block) $unit_data .= "Block ".$wohneinheit->block; + if($wohneinheit->stiege) $unit_data .= "Stiege ".$wohneinheit->stiege; + if($wohneinheit->stock) $unit_data .= "Stock ".$wohneinheit->stock; + if($wohneinheit->tuer) $unit_data .= "Tür ".$wohneinheit->tuer; + + if($wohneinheit->unit_string) { + $unit_data = $wohneinheit->unit_string; + } + + $bep = false; + $inhouse = false; + + if($data->attributes) { + $attribs = json_decode($data->attributes, true); + if($attribs['bep_specified']) $bep = true; + if($attribs['inhouse_cabling_supplied']) $inhouse = true; + } + + $addon_property = 0; + $addon_inhouse = 0; + if($data->addon_services) { + $services = json_decode($data->addon_services); + if(is_array($services) && count($services)) { + foreach($services as $service) { + if($service->service == "installation_onproperty" && $service->ordered) { + $addon_property = 1; + } + if($service->service == "installation_inhouse" && $service->ordered) { + $addon_inhouse = 1; + } + } + } + } + + if($data->uid == "string") $data->uid = ""; + +?> +"name?>";"extref?>";"name?>";"extref?>";"ucode?>";"oaid?>";"order_date) ? date("d.m.Y",$data->order_date) : ""?>";"type,"preorder")?>";"code?>";"name?>";"connection_type,"preorder")?>";"adrcd?>";"meridian?>";"rw?>";"hw?>";"name?>";"hausnummer?>";"plz?>";"name?>";"";"gps_lat?>";"gps_long?>";connection_count?>;"company?>";"uid?>";"firstname?>";"lastname?>";"street?>";"zip?>";"city?>";"phone?>";"email?>";"getCompanyOrName()?>";price_setup?>;"create)?>";"edit)?>" + +
-
-
- -

Vorbestellkampagne

+
+
+
+ +
+

Vorbestellkampagne

+
-
- +
-
- -
-
-

Vorbestellkampagne

- -
"> - +
-
+
+

+ Vorbestellkampagne

-
- -
- -
-
+ "> + -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- " /> -
-
- -
- -
- " /> -
-
- - -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ "/> +
+
+ +
+ +
+ "/> +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + Diese Felder müssen beim Bestellen angegeben werden +
+
+ +
+ +
+ + Statt Ort muss Ortsteil/Bezirk angegeben werden +
+
+ +
+ +
+ +
+
+ +
+ +
+ + Weiterer Bestellversuch liefert Fehler zurück +
+
+ +
+ +
+ +
+ + + Customer Installation Feedback (für QR-Code bei Status 145).
+ Templatevariable {{CIFTOKEN}} wird mit echtem Cif Token ersetzt
+ Beispiel: https://pro.ichwillglasfaser.at/ClientSubmit/finishedInstallationWork?c={{CIFTOKEN}} +
+
+
+ +
+ +
+ + Für Begleitschreiben - Status 145 +
+
+
+
+ +
+
+

Netzbetreiber

+
+
+

Aktivnetzbetreiber

+ active_operators as $aop): ?> +
+ +
+ +
+ + +
+ +
+
+ + +
+ +
+ +
+ +
+ + +
+ +
+
+ + +
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+
+ + +

API-User

+
+
+
+ +
+ + Benutzer mit API-Key +
+
+ +
+ +
+ + Hostname der Website, mit oder ohne Protokoll + (https://); *. als Wildcard erlaubt + (*.domain.com); ein Eintrag pro Zeile +
+
+
+
+ + +
+
+
+ +
+ +
+
+
+
+ +
+ +
+ + +
+
+
+ + +
-
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- - Diese Felder müssen beim Bestellen angegeben werden -
-
- -
- -
- - Statt Ort muss Ortsteil/Bezirk angegeben werden -
-
- -
- -
- -
-
- -
- -
- - Weiterer Bestellversuch liefert Fehler zurück -
-
- -
- -
- -
- - - Customer Installation Feedback (für QR-Code bei Status 145).
- Templatevariable {{CIFTOKEN}} wird mit echtem Cif Token ersetzt
- Beispiel: https://pro.ichwillglasfaser.at/ClientSubmit/finishedInstallationWork?c={{CIFTOKEN}} -
-
-
- -
- -
- - Für Begleitschreiben - Status 145 -
-
-
-
-
-
- - -
-
-

API-User

-
-
-
- -
- - Benutzer mit API-Key -
-
- -
- -
- - Hostname der Website, mit oder ohne Protokoll (https://); *. als Wildcard erlaubt (*.domain.com); ein Eintrag pro Zeile -
-
-
-
-
-
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
- -
-
- - - -
-
- - \ No newline at end of file + + \ No newline at end of file diff --git a/application/Api/v1/Modules/Operationaldata/Snopp.php b/application/Api/v1/Modules/Operationaldata/Snopp.php new file mode 100644 index 000000000..1e82876b2 --- /dev/null +++ b/application/Api/v1/Modules/Operationaldata/Snopp.php @@ -0,0 +1,46 @@ + "id missing"]); + } + + $wohneinheit = new \ADBWohneinheit($id); + if(!$wohneinheit->id) { + return \mfResponse::NotFound(["message" => "Home not found"]); + } + + $preorder = \PreorderModel::getFirstActive(["adb_wohneinheit_id" => $id]); + if(!$preorder) { + return \mfResponse::NotFound(["message" => "Home not found"]); + } + + $new_status = \PreorderstatusModel::getFirst(["code" => 300]); + if(!$new_status) { + return \mfResponse::InternalServerError(); + } + + if($preorder->status->code < $new_status->code) { + $preorder->status_id = $new_status->id; + $preorder->save(); + } + + return \mfResponse::Ok(["message" => "OK"]); + } +} \ No newline at end of file diff --git a/application/Api/v1/Modules/Preorder/Activation.php b/application/Api/v1/Modules/Preorder/Activation.php index 2cef47761..d29d30111 100644 --- a/application/Api/v1/Modules/Preorder/Activation.php +++ b/application/Api/v1/Modules/Preorder/Activation.php @@ -1,6 +1,5 @@ $this->get, "post" => $this->post, "db" => $this->db(), "me" => $this->me ]); - }*/ + } $this->addRoute("/operationaldata/networks", "getNetworks", "GET"); $this->addRoute("/operationaldata/preordercampaigns", "getPreorderCampaigns", "GET"); $this->addRoute("/operationaldata/buildings", "getBuildingsByCampaign", "GET"); + $this->addRoute("/operationaldata/home/:id/connected", [$modules["Snopp"], "setPreorderConnected"], "POST"); + /*$this->addRoute("/preorder/open", "getOpenPreorders", "GET"); $this->addRoute("/preorder/customerInstallationFeedback", [$modules["Cif"], "getCifData"], "GET"); $this->addRoute("/preorder/customerInstallationFeedback", [$modules["Cif"], "userSetCif"], "POST"); @@ -184,12 +189,112 @@ class OperationaldataApicontroller extends mfBaseApicontroller return mfResponse::NotFound(["message" => "Network not found"]); } + if($campaign->from > date('U') || $campaign->to < date('U')) { + return mfResponse::Ok(["buildings" => []]); + } + $adb_netzgebiet_id = $campaign->adb_netzgebiet->id; if(!$adb_netzgebiet_id) { return mfResponse::NotFound(["message" => "Network not found"]); } + // nur Bestellungen von Aktivnetzbetreiber und seine ISPs + if(!count($campaign->active_operators)) { + return mfResponse::Ok(["buildings" => []]); + } + + $isp_ids = []; + + foreach($campaign->active_operators as $aop) { + foreach($aop->isps as $op_isp) { + if(!in_array($op_isp->id, $isp_ids)) { + $isp_ids[] = $op_isp->isp_id; + } + } + } + + //var_dump($isp_ids);exit; + + $b = []; + + $woStateNameToId = []; + + $woStateNameToId["Clarify"] = 5; + $woStateNameToId["Review"] = 7; + $woStateNameToId["Accepted"] = 8; + $woStateNameToId["Plan Released"] = 10; + $woStateNameToId["Assigned"] = 20; + $woStateNameToId["Executed"] = 30; + $woStateNameToId["Documented"] = 40; + $woStateNameToId["Cancelled"] = 99; + + + foreach(PreorderModel::searchActive(["preordercampaign_id" => $campaign_id, "partner_id" => $isp_ids]) as $preorder) { + $hausnummer_id = $preorder->adb_hausnummer_id; + $wohneinheit_id = $preorder->adb_wohneinheit_id; + + if(!$hausnummer_id || !$wohneinheit_id) continue; + + $hausnummer = $preorder->adb_hausnummer; + $wohneinheit = $preorder->adb_wohneinheit; + + if(!array_key_exists($hausnummer_id, $b)) { + $b[$hausnummer_id] = [ + 'id' => $preorder->adb_hausnummer_id, + 'status' => [ + 'code' => $preorder->status->code, + 'text' => $preorder->status->name + ], + 'oaid' => $hausnummer->oaid, + 'salescluster_id' => $preorder->preordercampaign_id, + 'network_id' => $preorder->campaign->network_id, + 'zip' => $hausnummer->plz->plz, + 'city' => $hausnummer->strasse->gemeinde->name, + "municipality" => "", + 'district' => $hausnummer->ortschaft->name, + 'street' => $hausnummer->strasse->name, + 'housenumber' => $hausnummer->hausnummer, + 'gps_lat' => ($hausnummer->gps_lat) ? (float)$hausnummer->gps_lat : null, + 'gps_long' => ($hausnummer->gps_long) ? (float)$hausnummer->gps_long : null, + + "homes" => [] + ]; + if($this->district_is_city) { + $b[$hausnummer_id]['city'] = $hausnummer->ortschaft->name; + $b[$hausnummer_id]['municipality'] = $hausnummer->strasse->gemeinde->name; + } else { + unset($b[$hausnummer_id]['municipality']); + } + } + + if(!array_key_exists($wohneinheit_id, $b[$hausnummer_id]["homes"])) { + $b[$hausnummer_id]["homes"][] = [ + 'id' => $wohneinheit_id, + 'oaid' => $wohneinheit->oaid, + 'num' => (int)$wohneinheit->num, + 'block' => $wohneinheit->block, + 'stiege' => $wohneinheit->stiege, + 'stock' => $wohneinheit->stock, + 'tuer' => $wohneinheit->tuer, + 'zusatz' => $wohneinheit->zusatz, + 'patch_cluster' => $wohneinheit->patch_cluster, + 'patch_shelf' => $wohneinheit->patch_shelf, + 'patch_module' => $wohneinheit->patch_module, + 'patch_port' => $wohneinheit->patch_port, + 'workorder_id' => ($wohneinheit->rimo_workorder) ? $wohneinheit->rimo_workorder->id : null, + 'workorder_name' => ($wohneinheit->rimo_workorder) ? $wohneinheit->rimo_workorder->rimo_name : null, + 'workorder_state_id' => ($wohneinheit->rimo_workorder) ? $woStateNameToId[$wohneinheit->rimo_workorder->rimo_status] : null, + 'workorder_state_label' => ($wohneinheit->rimo_workorder) ? $wohneinheit->rimo_workorder->rimo_status : null, + + ]; + } + } + + $buildings = array_values($b); + return mfResponse::Ok(["buildings" => $buildings]); + + /* $db = $this->db(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME); $sql = AddressDB::$wohneinheit_query; @@ -249,17 +354,19 @@ class OperationaldataApicontroller extends mfBaseApicontroller } - /*foreach($b as $tmp_b) { + /* + foreach($b as $tmp_b) { $homes = array_values($tmp_b["homes"]); return mfResponse::Ok(["Homes" => $homes]); unset($tmp_b["homes"]); $tmp_b["homes"] = array_values($homes); $buildings[] = $tmp_b; - }*/ + } $buildings = array_values($b); - - return mfResponse::Ok(["buildings" => $buildings]); + */ + + } } \ No newline at end of file diff --git a/application/Preorder/PreorderModel.php b/application/Preorder/PreorderModel.php index 918c5b36a..3f1a00915 100644 --- a/application/Preorder/PreorderModel.php +++ b/application/Preorder/PreorderModel.php @@ -453,7 +453,9 @@ class PreorderModel { if(array_key_exists("partner_id", $filter)) { $partner_id = $filter['partner_id']; - if(is_numeric($partner_id)) { + if(is_array($partner_id)) { + $where .= " AND partner_id IN (".join(",", $partner_id).")"; + } elseif(is_numeric($partner_id)) { $where .= " AND partner_id=$partner_id"; } } diff --git a/application/Preordercampaign/Preordercampaign.php b/application/Preordercampaign/Preordercampaign.php index 34f2c4eef..714d73293 100644 --- a/application/Preordercampaign/Preordercampaign.php +++ b/application/Preordercampaign/Preordercampaign.php @@ -15,6 +15,8 @@ class Preordercampaign extends mfBaseModel { private $required_fields = []; private $banned_fcps; private $all_fcp_names; + private $active_operators; + private $passive_operators; public function getAllFcpNames() { if(!$this->id) return []; @@ -184,7 +186,32 @@ class Preordercampaign extends mfBaseModel { $this->banned_fcps = $banned_fcp_array; return $this->banned_fcps; } - + + if($name == "passive_operators") { + $pops = PreordercampaignOperatorModel::search(["preordercampaign_id" => $this->id, "type" => "passive"]); + if(!$pops) { + return []; + } + $this->passive_operators = []; + foreach($pops as $pop) { + $this->passive_operators[$pop->operator_id] = $pop; + } + + return $this->passive_operators; + } + + if($name == "active_operators") { + $aops = PreordercampaignOperatorModel::search(["preordercampaign_id" => $this->id, "type" => "active"]); + if(!$aops) { + return []; + } + $this->active_operators = []; + foreach($aops as $aop) { + $this->active_operators[$aop->operator_id] = $aop; + } + return $this->active_operators; + } + if($name == "apiusers") { $items = PreordercampaignApiuserModel::search(["preordercampaign_id" => $this->id]); foreach($items as $poa) { diff --git a/application/Preordercampaign/PreordercampaignController.php b/application/Preordercampaign/PreordercampaignController.php index 0c38655d3..d0da19ba3 100644 --- a/application/Preordercampaign/PreordercampaignController.php +++ b/application/Preordercampaign/PreordercampaignController.php @@ -375,13 +375,145 @@ class PreordercampaignController extends mfBaseController { } } } - + + + //var_dump($r->get());exit; + // sync active operators and ISPs + if(is_array($r->active_operators) && count($r->active_operators)) { + // delete removed operators + foreach(PreordercampaignOperatorModel::search(["preordercampaign_id" => $campaign->id, "type" => "active"]) as $op) { + if(!in_array($op->operator_id, $r->active_operators)) { + $this->log->debug("deleting campaignoperator ".$op->id); + $op->delete(); // automatically deletes isps too + } + } + //var_dump($r->active_operators);exit; + // add missing operators + foreach($r->active_operators as $op_key => $op_id) { + if(!$op_id) continue; + $op = PreordercampaignOperatorModel::getFirst(["preordercampaign_id" => $campaign->id, "type" => "active", "operator_id" => $op_id]); + if(!$op) { + $op = PreordercampaignOperatorModel::create([ + "preordercampaign_id" => $campaign->id, + "operator_id" => $op_id, + "type" => "active" + ]); + $op->save(); + } + + //var_dump($r->active_isps, $op_id);exit; + // sync operators ISPs + if(is_array($r->active_isps) && array_key_exists($op_id, $r->active_isps) && count($r->active_isps[$op_id])) { + // delete removed ISPs + foreach(PreordercampaignOperatorIspModel::search(["campaignoperator_id" => $op_key]) as $isp) { + if(!array_key_exists($op_id, $r->active_isps) || !in_array($isp->isp_id, $r->active_isps[$op_id])) { + $this->log->debug("Deleting isp ".$isp->id." from operator $op_id"); + $isp->delete(); + } + } + // create new ISPs if not existing + //var_dump($op_key, $r->active_isps[$op_id]);exit; + foreach ($r->active_isps[$op_id] as $isp_id) { + if ($op_key == "new" || !PreordercampaignOperatorIspModel::getFirst(["campaignoperator_id" => $op_key, "isp_id" => $isp_id])) { + $new_isp = PreordercampaignOperatorIspModel::create([ + "campaignoperator_id" => $op_key, + "isp_id" => $isp_id + ]); + //var_dump($new_isp);exit; + if (!$new_isp->save()) { + $this->log->debug("Error saving isp " . print_r($new_isp, true)); + } + $this->log->debug("created operatorIsp $op_id $isp_id"); + } + } + } else { + // got empty ISP list, so delete all ISPs + if($op_id && $op_key != "new") { + foreach(PreordercampaignOperatorIspModel::search(["campaignoperator_id" => $op_key]) as $isp) { + $this->log->debug("Deleting all ISPs for $op_id"); + $isp->delete(); + } + } + + } + + + } + } else { + // got empty operator list, delete all + foreach(PreordercampaignOperatorModel::search(["preordercampaign_id" => $campaign->id, "type" => "active"]) as $op) { + $op->delete(); // automatically deletes isps too + } + } + + + if(is_array($r->passive_operators)) { + if(!count($r->passive_operators)) { + foreach(PreordercampaignOperatorModel::search(["preordercampaign_id" => $campaign->id, "type" => "passive"]) as $op) { + $op->delete(); + } + } else { + foreach(PreordercampaignOperatorModel::search(["preordercampaign_id" => $campaign->id, "type" => "passive"]) as $op) { + if(!in_array($op->id, $r->passive_operators)) { + $op->delete(); + } + } + foreach($r->passive_operators as $op_id) { + if(!$op_id) continue; + if(!PreordercampaignOperatorModel::getFirst(["preordercampaign_id" => $campaign->id, "type" => "passive", "operator_id" => $op_id])) { + $new_op = PreordercampaignOperatorModel::create([ + "preordercampaign_id" => $campaign->id, + "operator_id" => $op_id, + "type" => "passive" + ]); + $new_op->save(); + } + } + } + } else { + foreach(PreordercampaignOperatorModel::search(["preordercampaign_id" => $campaign->id, "type" => "passive"]) as $op) { + $op->delete(); + } + } + + + $this->layout()->setFlash("Vorbestellkampagne erfolgreich gespeichert.", "success"); - //$this->redirect("Preordercampaign", "Edit", ['id' => $new_id]); - $this->redirect("Preordercampaign"); + + if($r->return == "index") { + $this->redirect("Preordercampaign"); + } + $this->redirect("Preordercampaign", "Edit", ['id' => $new_id]); + } - + + protected function billingAction() { + if(!$this->me->is("Admin")) { + $this->redirect("Preordercampaign"); + } + + $id = $this->request->id; + if(!is_numeric($id) || !$id) { + $this->layout()->setFlash("Vorbestellkampagne nicht gefunden", "error"); + $this->redirect("Preordercampaign"); + } + + $campaign = new Preordercampaign($id); + if(!$campaign->id) { + $this->layout()->setFlash("Vorbestellkampagne nicht gefunden", "error"); + $this->redirect("Preordercampaign"); + } + + // Get mysqli resource from Model, so layout can output data as it's retrieved + // Works around lousy performance and horrendous memory usage + $res = PreorderModel::searchActive(["preordercampaign_id" => $id], [], true); + + $this->layout()->setTemplate("Preorder/billing-export.csv"); + $this->layout()->set("res", $res); + $this->layout()->set("campaign", $campaign); + } + protected function downloadAddonServices() { $id = $this->request->preordercampaign_id; if(!is_numeric($id) || !$id) { diff --git a/application/PreordercampaignOperator/PreordercampaignOperator.php b/application/PreordercampaignOperator/PreordercampaignOperator.php new file mode 100644 index 000000000..e60041cb4 --- /dev/null +++ b/application/PreordercampaignOperator/PreordercampaignOperator.php @@ -0,0 +1,52 @@ + $this->id]) as $isp) { + $isp->delete(); + } + return true; + } + + public function getProperty($name) { + if($this->$name == null) { + + if($name == "isps") { + $isps = PreordercampaignOperatorIspModel::search(["campaignoperator_id" => $this->id]); + if(!$isps) { + return []; + } + foreach($isps as $isp) { + $this->isps[$isp->isp_id] = $isp; + } + + return $this->isps; + } + + if($name == "operator") { + $operator = mfValuecache::singleton()->getMfObject("Address", $this->operator_id); + if(!$operator) { + return null; + } + + $this->operator = $operator; + return $this->operator; + } + + $classname = ucfirst($name); + $idfield = $name."_id"; + $this->$name = mfValuecache::singleton()->getMfObject($classname, $this->$idfield); + if(!$this->$name) { + return null; + } + } + + return $this->$name; + } +} \ No newline at end of file diff --git a/application/PreordercampaignOperator/PreordercampaignOperatorModel.php b/application/PreordercampaignOperator/PreordercampaignOperatorModel.php new file mode 100644 index 000000000..68056e83f --- /dev/null +++ b/application/PreordercampaignOperator/PreordercampaignOperatorModel.php @@ -0,0 +1,169 @@ + $value) { + if(property_exists(get_called_class(), $field)) { + $model->$field = $value; + } + } + + $me = new User(); + $me->loadMe(); + + if($model->create_by === null) { + $model->create_by = $me->id; + } + if($model->edit_by === null) { + $model->edit_by = $me->id; + } + + return $model; + } + + public static function getAll() { + $items = []; + + $db = FronkDB::singleton(); + + $res = $db->select("PreordercampaignOperator", "*", "1=1 ORDER BY id"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new PreordercampaignOperator($data); + } + } + return $items; + + } + + public static function getFirst($filter = null) { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + mfLoghandler::singleton()->debug($where); + $res = $db->select("PreordercampaignOperator", "*", "$where ORDER BY id"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new PreordercampaignOperator($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function getFirstOaid($oaid) { + $db = FronkDB::singleton(); + + if(!$oaid) return null; + + $where = self::getSqlFilter(["oaid" => $oaid]); + //mfLoghandler::singleton()->debug($where); + $res = $db->select("PreordercampaignOperator", "*", "$where ORDER BY id"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new PreordercampaignOperator($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function count($filter) { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $sql = "SELECT COUNT(*) as cnt FROM PreordercampaignOperator + WHERE $where + "; + + $res = $db->query($sql); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + return $data->cnt; + } + return 0; + } + + public static function search($filter, $limit = false) { + $items = []; + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $sql = "SELECT * FROM PreordercampaignOperator + WHERE $where + ORDER BY id"; + + if(is_array($limit) && count($limit)) { + if(is_numeric($limit['start']) && is_numeric($limit['count'])) { + $sql .= " LIMIT ".$limit['start'].", ".$limit['count']; + } elseif(is_numeric($limit['count'])) { + $sql .= " LIMIT ".$limit['count']; + } + } + + $res = $db->query($sql); + + //mfLoghandler::singleton()->debug($sql); + + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new PreordercampaignOperator($data); + } + } + return $items; + } + + private static function getSqlFilter($filter) { + $db = FronkDB::singleton(); + $where = "1=1 "; + + if(!is_array($filter)) { + return $where; + } + + if(array_key_exists("preordercampaign_id", $filter)) { + $preordercampaign_id = $filter['preordercampaign_id']; + if(is_numeric($preordercampaign_id)) { + $where .= " AND preordercampaign_id = $preordercampaign_id"; + } + } + + if(array_key_exists("operator_id", $filter)) { + $operator_id = $filter['operator_id']; + if(is_numeric($operator_id)) { + $where .= " AND operator_id = $operator_id"; + } + } + + if(array_key_exists("type", $filter)) { + $type = $db->escape($filter['type']); + if($type) { + $where .= " AND type LIKE '$type'"; + } + } + + + + //var_dump($filter, $where);exit; + return $where; + } + +} \ No newline at end of file diff --git a/application/PreordercampaignOperatorIsp/PreordercampaignOperatorIsp.php b/application/PreordercampaignOperatorIsp/PreordercampaignOperatorIsp.php new file mode 100644 index 000000000..b22cd3ccc --- /dev/null +++ b/application/PreordercampaignOperatorIsp/PreordercampaignOperatorIsp.php @@ -0,0 +1,30 @@ +$name == null) { + + if($name == "isp") { + $isp = mfValuecache::singleton()->getMfObject("Address", $this->isp_id); + if(!$isp) { + return null; + } + + $this->isp = $isp; + return $this->isp; + } + + $classname = ucfirst($name); + $idfield = $name."_id"; + $this->$name = mfValuecache::singleton()->getMfObject($classname, $this->$idfield); + if(!$this->$name) { + return null; + } + } + + return $this->$name; + } +} \ No newline at end of file diff --git a/application/PreordercampaignOperatorIsp/PreordercampaignOperatorIspModel.php b/application/PreordercampaignOperatorIsp/PreordercampaignOperatorIspModel.php new file mode 100644 index 000000000..4220f390d --- /dev/null +++ b/application/PreordercampaignOperatorIsp/PreordercampaignOperatorIspModel.php @@ -0,0 +1,160 @@ + $value) { + if(property_exists(get_called_class(), $field)) { + $model->$field = $value; + } + } + + $me = new User(); + $me->loadMe(); + + if($model->create_by === null) { + $model->create_by = $me->id; + } + if($model->edit_by === null) { + $model->edit_by = $me->id; + } + + return $model; + } + + public static function getAll() { + $items = []; + + $db = FronkDB::singleton(); + + $res = $db->select("PreordercampaignOperatorIsp", "*", "1=1 ORDER BY id"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new PreordercampaignOperatorIsp($data); + } + } + return $items; + + } + + public static function getFirst($filter = null) { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + mfLoghandler::singleton()->debug($where); + $res = $db->select("PreordercampaignOperatorIsp", "*", "$where ORDER BY id"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new PreordercampaignOperatorIsp($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function getFirstOaid($oaid) { + $db = FronkDB::singleton(); + + if(!$oaid) return null; + + $where = self::getSqlFilter(["oaid" => $oaid]); + //mfLoghandler::singleton()->debug($where); + $res = $db->select("PreordercampaignOperatorIsp", "*", "$where ORDER BY id"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new PreordercampaignOperatorIsp($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function count($filter) { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $sql = "SELECT COUNT(*) as cnt FROM PreordercampaignOperatorIsp + WHERE $where + "; + + $res = $db->query($sql); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + return $data->cnt; + } + return 0; + } + + public static function search($filter, $limit = false) { + $items = []; + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $sql = "SELECT * FROM PreordercampaignOperatorIsp + WHERE $where + ORDER BY id"; + + if(is_array($limit) && count($limit)) { + if(is_numeric($limit['start']) && is_numeric($limit['count'])) { + $sql .= " LIMIT ".$limit['start'].", ".$limit['count']; + } elseif(is_numeric($limit['count'])) { + $sql .= " LIMIT ".$limit['count']; + } + } + + $res = $db->query($sql); + + //mfLoghandler::singleton()->debug($sql); + + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new PreordercampaignOperatorIsp($data); + } + } + return $items; + } + + private static function getSqlFilter($filter) { + $db = FronkDB::singleton(); + $where = "1=1 "; + + if(!is_array($filter)) { + return $where; + } + + if(array_key_exists("isp_id", $filter)) { + $isp_id = $filter['isp_id']; + if(is_numeric($isp_id)) { + $where .= " AND isp_id = $isp_id"; + } + } + + if(array_key_exists("campaignoperator_id", $filter)) { + $campaignoperator_id = $filter['campaignoperator_id']; + if(is_numeric($campaignoperator_id)) { + $where .= " AND campaignoperator_id = $campaignoperator_id"; + } + } + + //var_dump($filter, $where);exit; + return $where; + } + +} \ No newline at end of file diff --git a/application/Preorderstatus/PreorderstatusModel.php b/application/Preorderstatus/PreorderstatusModel.php index 059c668ac..93400601e 100644 --- a/application/Preorderstatus/PreorderstatusModel.php +++ b/application/Preorderstatus/PreorderstatusModel.php @@ -105,7 +105,7 @@ class PreorderstatusModel { if(is_array($limit) && count($limit)) { if(is_numeric($limit['start']) && is_numeric($limit['count'])) { $sql .= " LIMIT ".$limit['start'].", ".$limit['count']; - } elseif(is_numeric($count)) { + } elseif(is_numeric($limit['count'])) { $sql .= " LIMIT ".$limit['count']; } } diff --git a/config/config.sample.php b/config/config.sample.php index ac1d60149..e3c9b6b76 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1,45 +1,103 @@ [ + "test" => [ + "key" => "", + "url" => "https://rimo-dev.rimo-saas.com/CRM2RIMO/dev", + ], + "prod" => [ + "key" => "", + "url" => "https://rimo-saas.com/CRM2RIMO/prod", + ] + ], + "rml" => [ + "test" => [ + "key" => "", + "url" => "https://rimo-dev.rimo-saas.com/CRM2RIMO/dev" + ], + "prod" => [ + "key" => "", + "url" => "https://rimo-saas.com/CRM2RIMO/prod" + ] + ] +]; + +//MBI-API Server Configuration +const TT_MBI_API_ENABLE = false; //Enable API Calls +const TT_MBI_API_URL = "https://172.16.5.56/api/"; +const TT_MBI_API_VERSION = "v01"; +const TT_MBI_API_KEY = ""; + +//define("FRONKDB_SQLDEBUG", true); // Logging configuration -define("LOGTYPE","file"); // can be one of file, mysql, syslog; defaults to "file" -define("LOGFILENAME",BASEDIR."/var/log/".MFAPPNAME.".log"); +const LOGTYPE = "file"; // can be one of file, mysql, syslog; defaults to "file" +const LOGFILENAME = BASEDIR . "/var/log/" . MFAPPNAME . ".log"; /* * Application-specific settings @@ -47,647 +105,716 @@ define("LOGFILENAME",BASEDIR."/var/log/".MFAPPNAME.".log"); // increment when adding new api // used to route calls without explicit version -define("API_VERSION", "v1"); +const API_VERSION = "v1"; -define("TT_FEATURE_IVT", false); +const TT_FEATURE_IVT = true; -define("TT_ROLES", ['systemowner','productowner','netowner','salespartner','pipeworker','lineworker','pipeplanner','lineplanner','netoperator','supplier','billing','employee','customer','contact','techcontact']); -define("TT_NETWORK_ROLES", ['salespartner','pipeworker','lineworker','pipeplanner','lineplanner','netoperator']); -define("TT_NETWORK_ROLES_WITH_OWNER", ['netowner','salespartner','pipeworker','lineworker','pipeplanner','lineplanner','netoperator']); -define("TT_ADDRESS_LINK_TYPES", ['billing','employee','customer','contact','techcontact']); -define("TT_ATTRIB_RTRTECHCODE_NAME","rtrcode"); -define("TT_ATTRIB_TERMINATION_REQUIRED_NAME", "termination_required"); +const TT_VATRATE_AREAS = [ + "domestic" => "Österreich", + "eu" => "EU", + "other" => "Drittland" +]; +const TT_VATRATE_DEFAULT = 1; -define("TT_GEOCODING_API_URL", "https://maps.googleapis.com/maps/api/geocode/json"); -define("TT_GEOCODING_API_SECRET",""); -define("TT_MAPBOX_TILE_API_TOKEN", ""); -define("TT_BUILDINGSTATUS_CONNECTED", 50); -define("TT_TERMSTATUS_ASSIGNED", 30); -define("TT_TERMSTATUS_CONNECTED", 50); -define("TT_TERMSTATUS_ACTIVE", 60); -define("TT_PLACEHOLDER_GPS_LAT", "47.082999"); -define("TT_PLACEHOLDER_GPS_LONG", "15.425001"); -define("TT_FIRST_CUSTNUM", 102030); -define("TT_OUTGOING_EMAIL", "office@xinon.at"); -define("TT_OUTGOING_EMAIL_NAME", "XINON Kundenservice"); -define("TT_INTERNAL_BILLING_EMAIL_TO", "thetool-tobill@xinon.at"); -define("TT_EXTERNAL_BILLING_EMAIL_TO", "energie-billing@xinon.at"); +const TT_ROLES = ['systemowner', 'productowner', 'netowner', 'salespartner', 'pipeworker', 'lineworker', 'pipeplanner', 'lineplanner', 'netoperator', 'supplier', 'billing', 'employee', 'customer', 'contact', 'techcontact']; +const TT_NETWORK_ROLES = ['salespartner', 'pipeworker', 'lineworker', 'pipeplanner', 'lineplanner', 'netoperator']; +const TT_NETWORK_ROLES_WITH_OWNER = ['netowner', 'salespartner', 'pipeworker', 'lineworker', 'pipeplanner', 'lineplanner', 'netoperator']; +const TT_ADDRESS_LINK_TYPES = ['billing', 'employee', 'customer', 'contact', 'techcontact']; +const TT_ATTRIB_RTRTECHCODE_NAME = "rtr_tech_code"; +const TT_ATTRIB_TERMINATION_REQUIRED_NAME = "termination_required"; +const TT_ATTRIB_VOICENUMBER_REQUIRED_NAME = "needs_number"; -define("TT_CUSTOM_ORDER_PDF_PER_NETOWNER", true); -define("TT_CUSTOM_ORDER_PDF_DEFAULT_OWNER_ID", 1635); +const TT_GEOCODING_API_URL = 'https://maps.googleapis.com/maps/api/geocode/json'; +const TT_GEOCODING_API_SECRET = ''; +const TT_MAPBOX_TILE_API_TOKEN = ""; +const TT_BUILDINGSTATUS_CONNECTED = 50; +const TT_TERMSTATUS_ASSIGNED = 30; +const TT_TERMSTATUS_CONNECTED = 50; +const TT_TERMSTATUS_ACTIVE = 60; +const TT_PLACEHOLDER_GPS_LAT = "47.082999"; +const TT_PLACEHOLDER_GPS_LONG = "15.425001"; +const TT_FIRST_CUSTNUM = 102030; +const TT_FIRST_SUPPLIER_NUM = 301001; +const TT_FIRST_FIBU_ACCOUNT_NUM = 230001; -define("TT_PREORDER_DISCOUNT_2", 25); -define("TT_PREORDER_DISCOUNT_3", 33.33); -define("TT_PREORDER_DISCOUNT_APART", 50); -define("TT_PREORDER_DISCOUNT_BUSINESS", 16.667); +const TT_OUTGOING_SMS_API_KEY = ""; +const TT_OUTGOING_SMS_API_URL = "api.websms.com/rest"; + +const TT_OUTGOING_EMAIL_2FA = "noreply@xinon.at"; +const TT_OUTGOING_EMAIL_2FA_NAME = "'XINON No-Reply'"; + +const TT_OUTGOING_EMAIL = "office@xinon.at"; +const TT_OUTGOING_EMAIL_NAME = "XINON Kundenservice"; +const TT_INTERNAL_BILLING_EMAIL_TO = "thetool-tobill@xinon.at"; +const TT_EXTERNAL_BILLING_EMAIL_TO = "energie-billing@xinon.at"; +const TT_FIBU_EMAIL_TO = "buchhaltung@xinon.at"; + +const TT_CUSTOM_ORDER_PDF_PER_NETOWNER = true; +const TT_CUSTOM_ORDER_PDF_DEFAULT_OWNER_ID = 1635; + +const TT_ADDRESS_BMD_EXPORT_PATH = BASEDIR."/files/bmd/IMP_Kunden_Lieferanten"; +const TT_ADDRESS_BMD_EXPORT_FILENAME = "thetool-export.csv"; +const TT_ADDRESS_DEFAULT_SUPPLIER_DUE = 30; + +const TT_IBAN_VALIDATOR_BASEURL = "https://rest.sepatools.eu/validate_iban/"; +const TT_IBAN_VALIDATOR_USER = ""; +const TT_IBAN_VALIDATOR_PASS = ""; + + +/* + * Preorder settings + */ +const TT_PREORDER_DISCOUNT_2 = 25; +const TT_PREORDER_DISCOUNT_3 = 33.33; +const TT_PREORDER_DISCOUNT_APART = 50; +const TT_PREORDER_DISCOUNT_BUSINESS = 16.667; + +const TT_PREORDERNOTIFICATION_FILE_UPLOAD_SUBFOLDER = "preordernotification"; +const TT_PREORDER_CIF_QR_SUBFOLDER = "preorder-cif"; + +const TT_PREORDER_DEFAULT_CANCEL_STATUSCODE = 910; + +/* + * defines status alignments of preorder status to hausnummer (h) and wohneinheit (w) + * + * $statusmatrix = [ + * "preorder_status_code" => [ + * "h" => adb_status_code, // gebäude + * "w" => adb_status_code // wohneinheit + * ] + * ] + */ +const TT_PREORDER_STATUS_MATRIX = [ + 10 => ["h" => 10, "w" => 10], // 10 new + 110 => ["h" => 110, "w" => 10], // 110 Underground construction planning + 120 => ["h" => 120, "w" => 10], // 120 Underground construction planning finished + 130 => ["h" => 130, "w" => 10], // 130 Underground construction work assigned + 140 => ["h" => 140, "w" => 10], // 140 Conduit at property border + 145 => ["h" => 140, "w" => 10], // 145 Installation kit picked up or shipped + 200 => ["h" => 200, "w" => 10], // 200 Conduit in building + 210 => ["h" => 210, "w" => 10], // 210 Fiber planning + 220 => ["h" => 220, "w" => 10], // 220 Fiber planning finished + 230 => ["h" => 230, "w" => 10], // 230 Fiber installation work assigned + 235 => ["h" => 235, "w" => 10], // 235 Fiber on property line + 240 => ["h" => 240, "w" => 10], // 240 Fiber in building + 241 => ["h" => 241, "w" => 241], // 241 BEP installed (multi-dwelling) + 242 => ["h" => 242, "w" => 242], // 242 Inhouse cabeling finished (multi-dwelling) + 244 => ["h" => 244, "w" => 244], // 244 BEP installed (single-dwelling) + 245 => ["h" => 241, "w" => 245], // 245 OTO installed + 250 => ["h" => false, "w" => 245], // 250 ONT ready + 260 => ["h" => false, "w" => 245], // 260 ONT picked up or shipped + 300 => ["h" => 241, "w" => 300], // 300 ONT installed + 350 => ["h" => 241, "w" => 300], // 350 Waiting for Service -> Vollanschluss (muss ISP nehmen in x Wochen) + 351 => ["h" => 241, "w" => 300], // 351 Ready for Service -> Vorsorgeanschluss (kann ISP nehmen) + 500 => ["h" => 241, "w" => 300], // 500 Finished + 899 => ["h" => false, "w" => false], // 899 Canceled + 900 => ["h" => false, "w" => false], // 900 Canceled + 910 => ["h" => false, "w" => false], // 910 Canceled + 920 => ["h" => false, "w" => false], // 920 Canceled + 921 => ["h" => false, "w" => false], // 921 Canceled +]; /* * Workflow Settings */ -define("TT_WORKFLOW_ITEM_STATUS_FIELD", "pipework_finished"); -define("TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED", "am Grundstück"); -define("TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED", "im Gebäude"); +const TT_WORKFLOW_ITEM_STATUS_FIELD = "pipework_finished"; +const TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED = "am Grundstück"; +const TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED = "im Gebäude"; -define("TT_WORKFLOW_ITEM_PIPEWORK_DONE", "pipework_finished"); -define("TT_WORKFLOW_ITEM_LINEWORK_DONE", "customer_passive_finished"); +const TT_WORKFLOW_ITEM_PIPEWORK_DONE = "pipework_finished"; +const TT_WORKFLOW_ITEM_LINEWORK_DONE = "customer_passive_finished"; -define("TT_WORKFLOW_BUILDING_FILE_TYPES", [ +const TT_WORKFLOW_BUILDING_FILE_TYPES = [ "Rohrplan", "Gestattungsvertrag", "Foto Tiefbau", "Handskizze", "Anderes", -]); -define("TT_WORKFLOW_TERMINATION_FILE_TYPES", [ +]; +const TT_WORKFLOW_TERMINATION_FILE_TYPES = [ "Spleissplan", "Foto Leitungsbau", "Handskizze", "Anderes", -]); +]; -define("TT_ORDER_FILE_TYPES", [ - "order_internet" => "Bestellung Internet & Telefon", - "order_nextv" => "Bestellung nexTV", - "order_general" => "Bestellung Allgemein", - "order_project" => "Bestellung Projekt", - "order_pbx" => "Bestellung Telefonanlage", - "voicenumber_porting" => "Rufnummermitnahme", - "handover_report" => "Übergabe-Protokoll", - "sepa_form" => "Nur Einzugsermächtigung", - "emailjournal_customer" => "Mailverlauf mit Kunde", - "old_phone_contract" => "Telefonvertrag von Voranbieter", - "other" => "Sonstiges Dokument", -]); +const TT_ORDER_FILE_TYPES = [ + "order_internet" => "Bestellung Internet & Telefon", + "order_nextv" => "Bestellung nexTV", + "order_general" => "Bestellung Allgemein", + "order_project" => "Bestellung Projekt", + "order_pbx" => "Bestellung Telefonanlage", + "voicenumber_porting" => "Rufnummermitnahme", + "handover_report" => "Übergabe-Protokoll", + "sepa_form" => "Nur Einzugsermächtigung", + "emailjournal_customer" => "Mailverlauf mit Kunde", + "old_phone_contract" => "Telefonvertrag von Voranbieter", + "other" => "Sonstiges Dokument", +]; -define("TT_CABLE_COLORS", [ - "rot" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 0, - "mark" => false - ], - "gruen" => [ - "hex" => "00FF00", - "hexfg" => "000000", - "r" => 0, - "g" => 255, - "b" => 0, - "mark" => false - ], - "blau" => [ - "hex" => "0000FF", - "hexfg" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 255, - "mark" => false - ], - "gelb" => [ - "hex" => "FFFF00", - "hexfg" => "000000", - "r" => 255, - "g" => 255, - "b" => 0, - "mark" => false - ], - "weiss" => [ - "hex" => "FFFFFF", - "hexfg" => "000000", - "r" => 255, - "g" => 255, - "b" => 255, - "mark" => false - ], - "natur" => [ - "hex" => "FFFFCC", - "hexfg" => "000000", - "r" => 255, - "g" => 255, - "b" => 204, - "mark" => false - ], - "grau" => [ - "hex" => "888888", - "hexfg" => "FFFFFF", - "r" => 136, - "g" => 136, - "b" => 136, - "mark" => false - ], - "braun" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "r" => 165, - "g" => 42, - "b" => 42, - "mark" => false - ], - "violett" => [ - "hex" => "8800FF", - "hexfg" => "FFFFFF", - "r" => 136, - "g" => 0, - "b" => 255, - "mark" => false - ], - "tuerkis" => [ - "hex" => "00FFFF", - "hexfg" => "000000", - "r" => 0, - "g" => 255, - "b" => 255, - "mark" => false - ], - "schwarz" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 0, - "mark" => false - ], - "orange" => [ - "hex" => "FF8800", - "hexfg" => "FFFFFF", - "r" => 255, - "g" => 136, - "b" => 0, - "mark" => false - ], - "rosa" => [ - "hex" => "FF0088", - "hexfg" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 136, - "mark" => false - ], - "rot-1R" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 0, - "mark" => true - ], - "gruen-1R" => [ - "hex" => "00FF00", - "hexfg" => "000000", - "r" => 0, - "g" => 255, - "b" => 0, - "mark" => true - ], - "blau-1R" => [ - "hex" => "0000FF", - "hexfg" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 255, - "mark" => true - ], - "gelb-1R" => [ - "hex" => "FFFF00", - "hexfg" => "000000", - "r" => 255, - "g" => 255, - "b" => 0, - "mark" => true - ], - "weiss-1R" => [ - "hex" => "FFFFFF", - "hexfg" => "000000", - "r" => 255, - "g" => 255, - "b" => 255, - "mark" => true - ], - "grau-1R" => [ - "hex" => "888888", - "hexfg" => "FFFFFF", - "r" => 136, - "g" => 136, - "b" => 136, - "mark" => true - ], - "braun-1R" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "r" => 165, - "g" => 42, - "b" => 42, - "mark" => true - ], - "violett-1R" => [ - "hex" => "8800FF", - "hexfg" => "FFFFFF", - "r" => 136, - "g" => 0, - "b" => 255, - "mark" => true - ], - "tuerkis-1R" => [ - "hex" => "00FFFF", - "hexfg" => "000000", - "r" => 0, - "g" => 255, - "b" => 255, - "mark" => true - ], - "schwarz-1R" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 0, - "mark" => true - ], - "orange-1R" => [ - "hex" => "FF8800", - "hexfg" => "FFFFFF", - "r" => 255, - "g" => 136, - "b" => 0, - "mark" => true - ], - "rosa-1R" => [ - "hex" => "FF0088", - "hexfg" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 136, - "mark" => true - ], - // gabocom colors - "Rot-Gelb" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "hex2" => "FFFF00", - "hexfg2" => "000000", - "r" => 255, - "g" => 0, - "b" => 0, - "r2" => 255, - "g2" => 255, - "b2" => 0, - "two-color" => true - ], - "Rot-Gruen" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "hex2" => "00FF00", - "hexfg2" => "000000", - "r" => 255, - "g" => 0, - "b" => 0, - "r2" => 0, - "g2" => 255, - "b2" => 0, - "two-color" => true - ], - "Rot-Blau" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "hex2" => "0000FF", - "hexfg2" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 0, - "r2" => 0, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Rot-Violett" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "hex2" => "8800FF", - "hexfg2" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 0, - "r2" => 136, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Rot-Grau" => [ - "hex" => "FF0000", - "hexfg" => "FFFFFF", - "hex2" => "888888", - "hexfg2" => "FFFFFF", - "r" => 255, - "g" => 0, - "b" => 0, - "r2" => 136, - "g2" => 136, - "b2" => 136, - "two-color" => true - ], - "Gelb-Blau" => [ - "hex" => "FFFF00", - "hexfg" => "000000", - "hex2" => "0000FF", - "hexfg2" => "FFFFFF", - "r" => 255, - "g" => 255, - "b" => 0, - "r2" => 0, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Gelb-Violett" => [ - "hex" => "FFFF00", - "hexfg" => "000000", - "hex2" => "8800FF", - "hexfg2" => "FFFFFF", - "r" => 255, - "g" => 255, - "b" => 0, - "r2" => 136, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Gelb-Grau" => [ - "hex" => "FFFF00", - "hexfg" => "000000", - "hex2" => "888888", - "hexfg2" => "FFFFFF", - "r" => 255, - "g" => 255, - "b" => 0, - "r2" => 136, - "g2" => 136, - "b2" => 136, - "two-color" => true - ], - "Gruen-Blau" => [ - "hex" => "00FF00", - "hexfg" => "000000", - "hex2" => "0000FF", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 255, - "b" => 0, - "r2" => 0, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Gruen-Violett" => [ - "hex" => "00FF00", - "hexfg" => "000000", - "hex2" => "8800FF", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 255, - "b" => 0, - "r2" => 136, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Gruen-Grau" => [ - "hex" => "00FF00", - "hexfg" => "000000", - "hex2" => "888888", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 255, - "b" => 0, - "r2" => 136, - "g2" => 136, - "b2" => 136, - "two-color" => true - ], - "Braun-Blau" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "hex2" => "0000FF", - "hexfg2" => "FFFFFF", - "r" => 165, - "g" => 42, - "b" => 42, - "r2" => 0, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Braun-Violett" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "hex2" => "8800FF", - "hexfg2" => "FFFFFF", - "r" => 165, - "g" => 42, - "b" => 42, - "r2" => 136, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Braun-Grau" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "hex2" => "888888", - "hexfg2" => "FFFFFF", - "r" => 165, - "g" => 42, - "b" => 42, - "r2" => 136, - "g2" => 136, - "b2" => 136, - "two-color" => true - ], - "Braun-Gruen" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "hex2" => "00FF00", - "hexfg2" => "000000", - "r" => 165, - "g" => 42, - "b" => 42, - "r2" => 0, - "g2" => 255, - "b2" => 0, - "two-color" => true - ], - "Braun-Gelb" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "hex2" => "FFFF00", - "hexfg2" => "000000", - "r" => 165, - "g" => 42, - "b" => 42, - "r2" => 255, - "g2" => 255, - "b2" => 0, - "two-color" => true - ], - "Braun-Rot" => [ - "hex" => "A52A2A", - "hexfg" => "FFFFFF", - "hex2" => "FF0000", - "hexfg2" => "FFFFFF", - "r" => 165, - "g" => 42, - "b" => 42, - "r2" => 255, - "g2" => 0, - "b2" => 0, - "two-color" => true - ], - "Schwarz-Rot" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "FF0000", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 255, - "g2" => 0, - "b2" => 0, - "two-color" => true - ], - "Schwarz-Gelb" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "FFFF00", - "hexfg2" => "000000", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 255, - "g2" => 255, - "b2" => 0, - "two-color" => true - ], - "Schwarz-Gruen" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "00FF00", - "hexfg2" => "000000", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 0, - "g2" => 255, - "b2" => 0, - "two-color" => true - ], - "Schwarz-Blau" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "0000FF", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 0, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Schwarz-Violett" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "8800FF", - "hexfg2" => "000000", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 136, - "g2" => 0, - "b2" => 255, - "two-color" => true - ], - "Schwarz-Grau" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "888888", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 136, - "g2" => 136, - "b2" => 136, - "two-color" => true - ], - "Schwarz-Braun" => [ - "hex" => "000000", - "hexfg" => "FFFFFF", - "hex2" => "A52A2A", - "hexfg2" => "FFFFFF", - "r" => 0, - "g" => 0, - "b" => 0, - "r2" => 165, - "g2" => 42, - "b2" => 42, - "two-color" => true - ] - - - -]); +const TT_CABLE_COLORS = [ + "rot" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 0, + "mark" => false + ], + "gruen" => [ + "hex" => "00FF00", + "hexfg" => "000000", + "r" => 0, + "g" => 255, + "b" => 0, + "mark" => false + ], + "blau" => [ + "hex" => "0000FF", + "hexfg" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 255, + "mark" => false + ], + "gelb" => [ + "hex" => "FFFF00", + "hexfg" => "000000", + "r" => 255, + "g" => 255, + "b" => 0, + "mark" => false + ], + "weiss" => [ + "hex" => "FFFFFF", + "hexfg" => "000000", + "r" => 255, + "g" => 255, + "b" => 255, + "mark" => false + ], + "natur" => [ + "hex" => "FFFFCC", + "hexfg" => "000000", + "r" => 255, + "g" => 255, + "b" => 204, + "mark" => false + ], + "grau" => [ + "hex" => "888888", + "hexfg" => "FFFFFF", + "r" => 136, + "g" => 136, + "b" => 136, + "mark" => false + ], + "braun" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "r" => 165, + "g" => 42, + "b" => 42, + "mark" => false + ], + "violett" => [ + "hex" => "8800FF", + "hexfg" => "FFFFFF", + "r" => 136, + "g" => 0, + "b" => 255, + "mark" => false + ], + "tuerkis" => [ + "hex" => "00FFFF", + "hexfg" => "000000", + "r" => 0, + "g" => 255, + "b" => 255, + "mark" => false + ], + "schwarz" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 0, + "mark" => false + ], + "orange" => [ + "hex" => "FF8800", + "hexfg" => "FFFFFF", + "r" => 255, + "g" => 136, + "b" => 0, + "mark" => false + ], + "rosa" => [ + "hex" => "FF0088", + "hexfg" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 136, + "mark" => false + ], + "rot-1R" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 0, + "mark" => true + ], + "gruen-1R" => [ + "hex" => "00FF00", + "hexfg" => "000000", + "r" => 0, + "g" => 255, + "b" => 0, + "mark" => true + ], + "blau-1R" => [ + "hex" => "0000FF", + "hexfg" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 255, + "mark" => true + ], + "gelb-1R" => [ + "hex" => "FFFF00", + "hexfg" => "000000", + "r" => 255, + "g" => 255, + "b" => 0, + "mark" => true + ], + "weiss-1R" => [ + "hex" => "FFFFFF", + "hexfg" => "000000", + "r" => 255, + "g" => 255, + "b" => 255, + "mark" => true + ], + "grau-1R" => [ + "hex" => "888888", + "hexfg" => "FFFFFF", + "r" => 136, + "g" => 136, + "b" => 136, + "mark" => true + ], + "braun-1R" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "r" => 165, + "g" => 42, + "b" => 42, + "mark" => true + ], + "violett-1R" => [ + "hex" => "8800FF", + "hexfg" => "FFFFFF", + "r" => 136, + "g" => 0, + "b" => 255, + "mark" => true + ], + "tuerkis-1R" => [ + "hex" => "00FFFF", + "hexfg" => "000000", + "r" => 0, + "g" => 255, + "b" => 255, + "mark" => true + ], + "schwarz-1R" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 0, + "mark" => true + ], + "orange-1R" => [ + "hex" => "FF8800", + "hexfg" => "FFFFFF", + "r" => 255, + "g" => 136, + "b" => 0, + "mark" => true + ], + "rosa-1R" => [ + "hex" => "FF0088", + "hexfg" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 136, + "mark" => true + ], + // gabocom colors + "Rot-Gelb" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "hex2" => "FFFF00", + "hexfg2" => "000000", + "r" => 255, + "g" => 0, + "b" => 0, + "r2" => 255, + "g2" => 255, + "b2" => 0, + "two-color" => true + ], + "Rot-Gruen" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "hex2" => "00FF00", + "hexfg2" => "000000", + "r" => 255, + "g" => 0, + "b" => 0, + "r2" => 0, + "g2" => 255, + "b2" => 0, + "two-color" => true + ], + "Rot-Blau" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "hex2" => "0000FF", + "hexfg2" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 0, + "r2" => 0, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Rot-Violett" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "hex2" => "8800FF", + "hexfg2" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 0, + "r2" => 136, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Rot-Grau" => [ + "hex" => "FF0000", + "hexfg" => "FFFFFF", + "hex2" => "888888", + "hexfg2" => "FFFFFF", + "r" => 255, + "g" => 0, + "b" => 0, + "r2" => 136, + "g2" => 136, + "b2" => 136, + "two-color" => true + ], + "Gelb-Blau" => [ + "hex" => "FFFF00", + "hexfg" => "000000", + "hex2" => "0000FF", + "hexfg2" => "FFFFFF", + "r" => 255, + "g" => 255, + "b" => 0, + "r2" => 0, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Gelb-Violett" => [ + "hex" => "FFFF00", + "hexfg" => "000000", + "hex2" => "8800FF", + "hexfg2" => "FFFFFF", + "r" => 255, + "g" => 255, + "b" => 0, + "r2" => 136, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Gelb-Grau" => [ + "hex" => "FFFF00", + "hexfg" => "000000", + "hex2" => "888888", + "hexfg2" => "FFFFFF", + "r" => 255, + "g" => 255, + "b" => 0, + "r2" => 136, + "g2" => 136, + "b2" => 136, + "two-color" => true + ], + "Gruen-Blau" => [ + "hex" => "00FF00", + "hexfg" => "000000", + "hex2" => "0000FF", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 255, + "b" => 0, + "r2" => 0, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Gruen-Violett" => [ + "hex" => "00FF00", + "hexfg" => "000000", + "hex2" => "8800FF", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 255, + "b" => 0, + "r2" => 136, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Gruen-Grau" => [ + "hex" => "00FF00", + "hexfg" => "000000", + "hex2" => "888888", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 255, + "b" => 0, + "r2" => 136, + "g2" => 136, + "b2" => 136, + "two-color" => true + ], + "Braun-Blau" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "hex2" => "0000FF", + "hexfg2" => "FFFFFF", + "r" => 165, + "g" => 42, + "b" => 42, + "r2" => 0, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Braun-Violett" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "hex2" => "8800FF", + "hexfg2" => "FFFFFF", + "r" => 165, + "g" => 42, + "b" => 42, + "r2" => 136, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Braun-Grau" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "hex2" => "888888", + "hexfg2" => "FFFFFF", + "r" => 165, + "g" => 42, + "b" => 42, + "r2" => 136, + "g2" => 136, + "b2" => 136, + "two-color" => true + ], + "Braun-Gruen" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "hex2" => "00FF00", + "hexfg2" => "000000", + "r" => 165, + "g" => 42, + "b" => 42, + "r2" => 0, + "g2" => 255, + "b2" => 0, + "two-color" => true + ], + "Braun-Gelb" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "hex2" => "FFFF00", + "hexfg2" => "000000", + "r" => 165, + "g" => 42, + "b" => 42, + "r2" => 255, + "g2" => 255, + "b2" => 0, + "two-color" => true + ], + "Braun-Rot" => [ + "hex" => "A52A2A", + "hexfg" => "FFFFFF", + "hex2" => "FF0000", + "hexfg2" => "FFFFFF", + "r" => 165, + "g" => 42, + "b" => 42, + "r2" => 255, + "g2" => 0, + "b2" => 0, + "two-color" => true + ], + "Schwarz-Rot" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "FF0000", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 255, + "g2" => 0, + "b2" => 0, + "two-color" => true + ], + "Schwarz-Gelb" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "FFFF00", + "hexfg2" => "000000", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 255, + "g2" => 255, + "b2" => 0, + "two-color" => true + ], + "Schwarz-Gruen" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "00FF00", + "hexfg2" => "000000", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 0, + "g2" => 255, + "b2" => 0, + "two-color" => true + ], + "Schwarz-Blau" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "0000FF", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 0, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Schwarz-Violett" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "8800FF", + "hexfg2" => "000000", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 136, + "g2" => 0, + "b2" => 255, + "two-color" => true + ], + "Schwarz-Grau" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "888888", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 136, + "g2" => 136, + "b2" => 136, + "two-color" => true + ], + "Schwarz-Braun" => [ + "hex" => "000000", + "hexfg" => "FFFFFF", + "hex2" => "A52A2A", + "hexfg2" => "FFFFFF", + "r" => 0, + "g" => 0, + "b" => 0, + "r2" => 165, + "g2" => 42, + "b2" => 42, + "two-color" => true + ] + + +]; // Upload settings -define('MFUPLOAD_FILE_SAVE_PATH',BASEDIR.'/files'); // folder where files will be stored -define('MFUPLOAD_ALLOWED_EXTENSIONS', 'jpg|jpeg|gif|png|pdf|doc.?|xls.?|txt|conf|svg|csv'); // allowed file extensions in regex format -define('MFUPLOAD_ALLOWED_EXTENSIONS_STR',"jpg, png, gif, pdf, doc, xls, csv, txt, conf"); -define('MFUPLOAD_FILE_MAX_SIZE',128*1024*1024); // Max filesize (128 MB) -define('MFUPLOAD_DIRMODE',0777); -define('MFUPLOAD_FILEMODE',0666); +const MFUPLOAD_FILE_SAVE_PATH = BASEDIR . '/files'; // folder where files will be stored +const MFUPLOAD_ALLOWED_EXTENSIONS = 'jpg|jpeg|gif|png|pdf|doc.?|xls.?|txt|conf|svg|csv'; // allowed file extensions in regex format +const MFUPLOAD_ALLOWED_EXTENSIONS_STR = "jpg, png, gif, pdf, doc, xls, csv, txt, conf"; +const MFUPLOAD_FILE_MAX_SIZE = 128 * 1024 * 1024; // Max filesize (128 MB) +const MFUPLOAD_DIRMODE = 0777; +const MFUPLOAD_FILEMODE = 0666; -define('MFLOCALE_TIME', "de_AT.UTF-8"); -define('MFLOCALE_MONETARY', "de_AT.UTF-8"); -define('MFLOCALE_NUMERIC', "de_AT.UTF-8"); +const MFLOCALE_TIME = "de_AT.UTF-8"; +const MFLOCALE_MONETARY = "de_AT.UTF-8"; +const MFLOCALE_NUMERIC = "de_AT.UTF-8"; /* * Maintainer / developer settings */ -define("MFUSEFANCYURLS",true); // to use urls in folder style +const MFUSEFANCYURLS = true; // to use urls in folder style // If your database field names start with a prefix (like Customer_id), set this to true. // Required when extending from mfBase classes (mfBaseController and mfBaseModel). -define("MFMODEL_USEFIELDPREFIX",false); +const MFMODEL_USEFIELDPREFIX = false; + +// the default Controller to call. Without an action, calls index action. +const DEFAULT_ROUTE = "Dashboard"; // use mfLogin? -define("MFUSELOGIN",true); -define("MFSESSION",true); +const MFUSELOGIN = true; +const MFSESSION = true; // The name of your users table. Required by stock mfUser and mfLoginController -define("MFUSERTABLE","Worker"); +const MFUSERTABLE = "Worker"; +const MFUSERTOKENTABLE = "WorkerToken"; // use mfMenu? -define("MFUSEMENU",false); +const MFUSEMENU = false; // The name of your menu table. Required by mfMenu -define("MFMENUTABLE","mfMenu"); +const MFMENUTABLE = "mfMenu"; // change this to wkhtmltopdf-amd64 if your system supports 64 bit binaries -define("WKHTMLTOPDF_BIN",LIBDIR."/mvcfronk/mfWkhtmltopdf/bin/wkhtmltopdf-amd64"); +const WKHTMLTOPDF_BIN = LIBDIR . "/mvcfronk/mfWkhtmltopdf/bin/wkhtmltopdf-amd64"; //define("WKHTMLTOPDF_ARGS",'-q -s A4 --footer-right [page]/[topage]'); -define("WKHTMLTOPDF_ARGS",'-q -s A4 --enable-local-file-access'); +const WKHTMLTOPDF_ARGS = '-q -s A4 --enable-local-file-access'; // where to save PDF files -define("PDFOUTPUTPATH",BASEDIR."/var/temp"); +const PDFOUTPUTPATH = BASEDIR . "/var/temp"; -define("GIT_BIN_PATH", "/usr/bin/git"); -define("PDFTOTEXT_BIN_PATH", "/usr/bin/pdftotext"); - -//MBI-API Server Configuration -define("TT_MBI_API_ENABLE", true); //Enable API Calls -define("TT_MBI_API_URL", "https://x.x.x.x/api/"); -define("TT_MBI_API_VERSION", "v01"); -define("TT_MBI_API_KEY", ""); - -//Raspberry Display Configuration -define("XINON_RASPBERRY_DISPLAY_SSH_USER", ""); -define("XINON_RASPBERRY_DISPLAY_SSH_PASS", ""); \ No newline at end of file +const GIT_BIN_PATH = "/usr/bin/git"; +const PDFTOTEXT_BIN_PATH = "/usr/bin/pdftotext"; +const PDFUNITE_BIN_PATH = "/usr/bin/pdfunite"; \ No newline at end of file diff --git a/db/migrations/20240409181124_create_preordercampaign_operators.php b/db/migrations/20240409181124_create_preordercampaign_operators.php new file mode 100644 index 000000000..75536d18d --- /dev/null +++ b/db/migrations/20240409181124_create_preordercampaign_operators.php @@ -0,0 +1,47 @@ +getEnvironment() == "thetool") { + $table = $this->table("PreordercampaignOperator"); + $table->addColumn("preordercampaign_id", "integer", ["null" => false]); + $table->addColumn("operator_id", "integer", ["null" => false]); + $table->addColumn("type", "enum", ["null" => false, "values" => "active,passive", "default" => "active"]); + $table->addColumn("create_by", "integer", ["null" => false]); + $table->addColumn("edit_by", "integer", ["null" => false]); + $table->addColumn("create", "integer", ["null" => false]); + $table->addColumn("edit", "integer", ["null" => false]); + $table->create(); + + $table = $this->table("PreordercampaignOperatorIsp"); + $table->addColumn("campaignoperator_id", "integer", ["null" => false]); + $table->addColumn("isp_id", "integer", ["null" => false]); + $table->addColumn("create_by", "integer", ["null" => false]); + $table->addColumn("edit_by", "integer", ["null" => false]); + $table->addColumn("create", "integer", ["null" => false]); + $table->addColumn("edit", "integer", ["null" => false]); + $table->create(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("PreordercampaignOperatorIsp")->drop()->save(); + $this->table("PreordercampaignOperator")->drop()->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} diff --git a/scripts/adb-rimo-import/ADBAddressHelper/address_helper.php b/scripts/adb-rimo-import/ADBAddressHelper/address_helper.php index 7691bfb08..6329f8f32 100644 --- a/scripts/adb-rimo-import/ADBAddressHelper/address_helper.php +++ b/scripts/adb-rimo-import/ADBAddressHelper/address_helper.php @@ -262,7 +262,7 @@ class AddressHelper } if (!$strasse) { - $this->logFindAddressError("[EE] Konnte Strasse '$strasse_name' in Gemeinde '$gemeinde_id' nicht anlegen ($addr_dbg_str)"); + $this->logFindAddressError("[EE] Konnte Strasse '$strasse_name' in Gemeinde '$gemeinde_id' nicht finden bzw. anlegen ($addr_dbg_str)"); return false; }