+
+
+
+
+
+
+
+
+
+
+
Inhaber
+
+
+
+ =$order->owner->customer_number?>
+ =$order->owner->getCompanyOrName()?>
+ =$order->owner->street?>
+ =$order->owner->zip?> =$order->owner->city?>
+
+
-
-
+
+
-
+
+
+
+
-
+
+
-
+
-
\ 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/Contract/Contract.php b/application/Contract/Contract.php
index fbc0076fa..cfc32d4af 100644
--- a/application/Contract/Contract.php
+++ b/application/Contract/Contract.php
@@ -50,6 +50,9 @@ class Contract extends mfBaseModel {
case "link":
$this->linkTo[] = $link;
break;
+ case "credit":
+ $this->linkFrom[] = $link;
+ break;
case "upgrade":
$this->upgradeTo[] = $link;
break;
@@ -73,6 +76,9 @@ class Contract extends mfBaseModel {
case "link":
$this->linkFrom[] = $link;
break;
+ case "credit":
+ $this->linkTo[] = $link;
+ break;
case "upgrade":
$this->upgradeFrom[] = $link;
break;
@@ -126,7 +132,40 @@ class Contract extends mfBaseModel {
return false;
}
-
+
+
+ public function addFilesFromOrder() {
+ if(!$this->orderproduct_id) {
+ return true;
+ }
+
+ $op = $this->getProperty("orderproduct");
+ $order = $op->order;
+ if(!$order || !$order->id) return true;
+
+ foreach($order->files as $file) {
+ $cfile = ContractFileModel::create([
+ "contract_id" => $this->id,
+ "file_id" => $file->file_id,
+ "name" => $file->name,
+ "description" => $file->description,
+ "create_by" => $file->create_by,
+ "edit_by" => $file->edit_by
+ ]);
+ $cfile->save();
+
+ $journal = ContractjournalModel::create([
+ "contract_id" => $this->id,
+ "type" => "file",
+ "value" => $cfile->id,
+ "text" => (array_key_exists($cfile->name, TT_ORDER_FILE_TYPES)) ? TT_ORDER_FILE_TYPES[$cfile->name] : $cfile->name
+ ]);
+ $journal->save();
+ }
+
+
+ }
+
public function getProperty($name) {
if($this->$name == null) {
@@ -227,7 +266,7 @@ class Contract extends mfBaseModel {
}
if($name == "links") {
- $this->links = ContractLinkModel::includesContractId($this->id, ["type" => $link]);
+ $this->links = ContractLinkModel::includesContractId($this->id, ["type" => "link"]);
//var_dump($this->links);exit;
return $this->links;
}
diff --git a/application/Contract/ContractModel.php b/application/Contract/ContractModel.php
index 24e4591fb..276a60f0a 100644
--- a/application/Contract/ContractModel.php
+++ b/application/Contract/ContractModel.php
@@ -56,7 +56,7 @@ class ContractModel {
return $model;
}
- public static function createFromOrderproduct($op) {
+ public static function createFromOrderproduct(OrderProduct $op) {
$log = mfLoghandler::singleton();
if(!$op->id) {
@@ -107,6 +107,82 @@ class ContractModel {
return $contract;
}
+
+ public static function createFromContractQueue(Contractqueue $cq, $contracttype = "contract") {
+ $log = mfLoghandler::singleton();
+ $me = new User();
+ $me->loadMe();
+
+ if(!$cq->id) {
+ $log->warning(__METHOD__."(): Invalid Contractqueue object");
+ return false;
+ }
+
+ $order_id = $cq->order_id;
+ $product_id = $cq->product_id;
+
+ $order = new Order($order_id);
+ $product = new Product($product_id);
+
+ if(!$order->id || !$product->id) {
+ $log->warning(__METHOD__."(): Invalid Order or Product");
+ return false;
+ }
+
+ if(!$order->finish_date || $order->finish_date > date("U")) {
+ $log->warning(__METHOD__."(): Order not finished yet");
+ return false;
+ }
+
+ $data = [];
+ $data["orderproduct_id"] = $cq->orderproduct_id;
+ $data["matchcode"] = $cq->matchcode;
+ $data["owner_id"] = $cq->owner_id;
+ $data["billingaddress_id"] = ($cq->billingaddress_id) ? $cq->billingaddress_id : $cq->owner_id;
+ $data["termination_id"] = ($cq->termination_id) ? $cq->termination_id : null;
+ $data["product_id"] = $cq->product_id;
+ $data["product_name"] = $cq->product_name;
+ $data["product_info"] = $cq->product_info;
+ $data["amount"] = $cq->amount;
+ $data["sla_id"] = $cq->sla_id;
+ $data["product_external"] = $cq->product_external;
+ $data["product_external_id"] = $cq->product_external_id;
+ $data["price"] = $cq->price;
+ $data["price_setup"] = $cq->price_setup;
+ $data["price_nne"] = $cq->price_nne;
+ $data["price_nbe"] = $cq->price_nbe;
+ $data["billing_delay"] = $cq->billing_delay;
+ $data["billing_period"] = $cq->billing_period;
+ $data["contract_term"] = $cq->contract_term;
+ $data["order_date"] = $order->order_date;
+
+
+ $data["finish_date"] = $order->finish_date;
+ $data["finish_date_by"] = $me->id;
+ $data["note"] = $order->note;
+
+ if($contracttype == "credit") {
+ $crediting_price = $cq->price_nne;
+ if($cq->crediting_partner_rate) {
+ $crediting_price = round($cq->price / 100 * $cq->crediting_partner_rate, 4);
+ }
+ $crediting_price *= -1;
+
+ $data["matchcode"] = $cq->crediting_matchcode;
+ $data["owner_id"] = $cq->crediting_partner_id;
+ $data["billingaddress_id"] = $cq->crediting_partner_id;
+ $data["termination_id"] = null;
+ $data["price"] = $crediting_price;
+ $data["price_setup"] = 0;
+ $data["price_nne"] = 0;
+ $data["price_nbe"] = 0;
+ }
+
+ $contract = ContractModel::create($data);
+ //var_dump($contract);exit;
+
+ return $contract;
+ }
public function savePrecontract($contract) {
diff --git a/application/Contractqueue/ContractqueueController.php b/application/Contractqueue/ContractqueueController.php
index 6a24934df..0eba9d837 100644
--- a/application/Contractqueue/ContractqueueController.php
+++ b/application/Contractqueue/ContractqueueController.php
@@ -167,6 +167,114 @@ class ContractqueueController extends mfBaseController {
}
$this->layout()->setFlash("Alle Bestellungen importiert", "success");
$this->redirect("Contractqueue");
+ }
+
+ protected function commitAction() {
+ $r = $this->request;
+ //var_dump($r->get());exit;
+
+ $new_contracts = [];
+ $c = 0;
+ $o = 0;
+ foreach(ContractqueueModel::search(["approved" => true, "contract_id" => null]) as $cq) {
+ //var_dump($cq);exit;
+ $contract = new Contract($cq->orderproduct_id);
+ if($contract->id) continue; // contract should not yet exist
+
+ /*
+ * Create Contract
+ */
+ $contract = ContractModel::createFromContractqueue($cq);
+ if(!$contract->save()) {
+ $this->layout()->setFlash("Eine Position in Bestellung ".$cq->order_id." konnte nicht übernommen werden: Fehler beim Speichern");
+ continue;
+ }
+
+ $c++;
+
+ $cq->contract_id = $contract->id;
+ $cq->save();
+
+ // create Contractjournal
+ $journal = ContractjournalModel::create([
+ 'contract_id' => $contract->id,
+ 'type' => "created_from",
+ 'value' => "order"
+ ]);
+ $journal->save();
+
+ $contract->addFilesFromOrder();
+
+ /*
+ * Create Crediting Contract
+ * if required
+ */
+
+ if($cq->approved_credit) {
+ $credit = ContractModel::createFromContractQueue($cq, "credit");
+ if(!$credit->save()) {
+ $this->layout()->setFlash("Zu einer Position in Bestellung ".$cq->order_id." konnte keine Gutschrift erstellt werden: Fehler beim Speichern");
+ continue;
+ }
+ $journal = ContractjournalModel::create([
+ 'contract_id' => $credit->id,
+ 'type' => "created_from",
+ 'value' => "order"
+ ]);
+ $journal->save();
+ $journal = ContractjournalModel::create([
+ 'contract_id' => $contract->id,
+ 'type' => "credit_created",
+ 'value' => $credit->id
+ ]);
+ $journal->save();
+ $link = ContractLinkModel::create([
+ 'contract_id' => $contract->id,
+ 'origin_contract_id' => $credit->id,
+ 'type' => 'credit'
+ ]);
+ $link->save();
+ // XXX: retour link erstellen?
+ }
+
+ /*
+ * Create ContractLinks
+ */
+ foreach($new_contracts as $origin) {
+ if(ContractLinkModel::getFirst(["contract_id" => $contract->id, "origin_contract_id" => $origin->id])) {
+ continue;
+ }
+ $link = ContractLinkModel::create([
+ 'contract_id' => $contract->id,
+ 'origin_contract_id' => $origin->id,
+ 'type' => 'link'
+ ]);
+ $link->save();
+ if($link->id) {
+ $journal = ContractjournalModel::create([
+ 'contract_id' => $contract->id,
+ 'type' => "link",
+ 'value' => $origin->id
+ ]);
+ $journal->save();
+
+ $ojournal = ContractjournalModel::create([
+ 'contract_id' => $origin->id,
+ 'type' => "link",
+ 'value' => $contract->id
+ ]);
+ $ojournal->save();
+ }
+ }
+
+ $new_contracts[] = $contract;
+
+ }
+
+ $this->layout()->setFlash("$c Contracts erstellt", "success");
+ $this->redirect("Contract");
+
+
}
protected function apiAction() {
@@ -180,6 +288,9 @@ class ContractqueueController extends mfBaseController {
case "saveContract":
$return = $this->saveContractApi();
break;
+ case "setApproval":
+ $return = $this->setApprovalApi();
+ break;
default:
$return = false;
}
@@ -304,4 +415,31 @@ class ContractqueueController extends mfBaseController {
return ["contract" => $return, "credit" => $credit];
}
+
+ private function setApprovalApi() {
+ $r = $this->request;
+
+ //var_dump($r->get());exit;
+
+ $id = $r->cq_id;
+ if(!is_numeric($id) || $id < 1) {
+ return false;
+ }
+
+ $cq = new Contractqueue($id);
+ if(!$cq->id) {
+ return false;
+ }
+
+ if($r->type == "order") {
+ $cq->approved = $r->value;
+ }
+ if($r->type == "credit") {
+ $cq->approved_credit = $r->value;
+ }
+
+ $cq->save();
+
+ return ["message" => "contract saved"];
+ }
}
\ No newline at end of file
diff --git a/application/Contractqueue/ContractqueueModel.php b/application/Contractqueue/ContractqueueModel.php
index 36187379d..b6d5d1aaf 100644
--- a/application/Contractqueue/ContractqueueModel.php
+++ b/application/Contractqueue/ContractqueueModel.php
@@ -236,7 +236,7 @@ class ContractqueueModel {
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'];
}
}
@@ -266,7 +266,16 @@ class ContractqueueModel {
$where .= " AND Contractqueue.id like '%$id%'";
}
}
-
+
+ if(array_key_exists("approved", $filter)) {
+ $approved = $filter['approved'];
+ if($approved) {
+ $where .= " AND Contractqueue.approved = 1";
+ } else {
+ $where .= " AND Contractqueue.approved = 0";
+ }
+ }
+
if(array_key_exists("contract_id", $filter)) {
$contract_id = $filter['contract_id'];
if(is_numeric($contract_id)) {
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 7b72ae8e3..42c653a8c 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1,45 +1,104 @@
[
+ "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,651 +106,720 @@ 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");
+const GIT_BIN_PATH = "/usr/bin/git";
+const PDFTOTEXT_BIN_PATH = "/usr/bin/pdftotext";
+const PDFUNITE_BIN_PATH = "/usr/bin/pdfunite";
-//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", "");
-
-define("TT_KOLMISOFT_API_URL", "vportal.xxx.xx");
-define("TT_KOLMISOFT_API_KEY", "");
-define("TT_KOLMISOFT_API_USERNAME", "");
+const TT_KOLMISOFT_API_URL = "vportal.xxx.xx";
+const TT_KOLMISOFT_API_KEY = "";
+const TT_KOLMISOFT_API_USERNAME = "";
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/lang/de.php b/lang/de.php
index f315b23e3..b7fad5bff 100644
--- a/lang/de.php
+++ b/lang/de.php
@@ -55,6 +55,7 @@ $l['contract.upgrade'] = "Upgrade";
$l['contract.downgrade'] = "Downgrade";
$l['contract.relocation'] = "Umzug";
$l['contract.productchange'] = "Produktwechsel";
+$l['contract.credit'] = "Gutschrift";
$l['cc.oesterreich'] = "AT";
diff --git a/lib/mvcfronk/mfBase/mfBaseModel.php b/lib/mvcfronk/mfBase/mfBaseModel.php
index 8fda47f5e..0a704798f 100644
--- a/lib/mvcfronk/mfBase/mfBaseModel.php
+++ b/lib/mvcfronk/mfBase/mfBaseModel.php
@@ -212,6 +212,12 @@ class mfBaseModel {
if($this->fieldprefix && !strstr($field,"_")) {
$where=$this->fieldprefix."_id=$id";
}
+ if(method_exists($this, "beforeDelete")) {
+ // delete can be canceled
+ if(!$this->beforeDelete()) {
+ return false;
+ }
+ }
if($this->db->delete($this->table,$where)) {
if(method_exists($this, "afterDelete")) {
$this->afterDelete();
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;
}