diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php index 93f29fc25..84eaad700 100644 --- a/Layout/default/Preorder/Index.php +++ b/Layout/default/Preorder/Index.php @@ -175,7 +175,7 @@
id): ?> - ['preordercampaign_id' => $campaign->id]])?>">Filter zurücksetzen + ['preordercampaign_id' => $campaign->id], "resetFilter" => 1])?>">Filter zurücksetzen ">Filter zurücksetzen diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index 3df7c8f63..4aa5a0600 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -42,17 +42,26 @@ class Preorder extends mfBaseModel { if($this->oaid) { // If current OAID is from correct Origin then do nothing - $current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid); - if(!$current_oaid) { - return true; // this is a thetool oaid, so do nothing - } - if($campaign->oaid_origin == $current_oaid->origin) { - // also check if wohneinheit has no oaid and set it - if(!$wohneinheit->oaid) { - $wohneinheit->oaid = $current_oaid->oaid; - $wohneinheit->save(); + if($campaign->oaid_origin == "thetool") { + $current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid); + if($current_oaid) { + $this->log->warning("OAID of Preorder ".$this->id." should be thetool, but is OFAA"); + } + } elseif($campaign->oaid_origin == "ofaa") { + $current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid); + if(!$current_oaid) { + $this->log->error("OAID of Preorder ".$this->id." not found in OpenAccessIds"); + // assume it's from a different origin + } else { + if($campaign->oaid_origin == $current_oaid->origin) { + // also check if wohneinheit has no oaid and set it + if(!$wohneinheit->oaid) { + $wohneinheit->oaid = $current_oaid->oaid; + $wohneinheit->save(); + } + return true; + } } - return true; } } diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index fee9a4f04..00c3b68c8 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -17,14 +17,47 @@ class PreorderController extends mfBaseController { protected function indexAction() { $this->layout()->setTemplate("Preorder/Index"); - $rfilter = $this->request->filter; - iF(!is_array($rfilter)) { - $rfilter = []; + if($this->request->resetFilter) { + unset($_SESSION[MFAPPNAME.'-Preorder-filter']); + foreach($_SESSION as $key => $s) { + if(preg_match('/^'.MFAPPNAME.'-Preorder-filter-campaign-\d+$', $key)) { + unset($_SESSION[$key]); + } + } } - $this->layout->set("filter", $rfilter); - - $filter = $this->getPreparedFilter($rfilter); + $filter = []; + + if(is_array($this->request->filter)) { + $filter = $this->request->filter; + + if(isset($this->request->filter["preordercampaign_id"]) && $this->request->filter["preordercampaign_id"]) { + $filter_po_id = $filter["preordercampaign_id"]; + if(count($this->request->filter) == 1 && isset($_SESSION[MFAPPNAME.'-Preorder-filter-campaign-'.$filter_po_id])) { + $filter = $_SESSION[MFAPPNAME.'-Preorder-filter-campaign-'.$filter_po_id]; + } else { + $_SESSION[MFAPPNAME.'-Preorder-filter-campaign-'.$filter["preordercampaign_id"]] = $filter; + } + } else { + $_SESSION[MFAPPNAME.'-Preorder-filter'] = $filter; + } + } else { + if(array_key_exists(MFAPPNAME.'-Preorder-filter', $_SESSION) && count($_SESSION[MFAPPNAME.'-Preorder-filter'])) { + $filter = $_SESSION[MFAPPNAME.'-Preorder-filter']; + if(isset($filter['preordercampaign_id'])) { + $filter_po_id = $filter['preordercampaign_id']; + if(isset($_SESSION[MFAPPNAME.'-Preorder-filter-campaign-'.$filter_po_id])) { + //var_dump("blah"); + $filter = $_SESSION[MFAPPNAME.'-Preorder-filter-campaign-'.$filter_po_id]; + } + } + } + } + + //var_dump($_SESSION, $filter);exit; + + $this->layout->set("filter", $filter); + $filter = $this->getPreparedFilter($filter); // pagination defaults $pagination = []; @@ -624,7 +657,7 @@ class PreorderController extends mfBaseController { } - $qs = ['filter' => ['preordercampaign_id' => $preorder->preordercampaign_id, 'ucode' => $preorder->ucode]]; + $qs = ['filter' => ['preordercampaign_id' => $preorder->preordercampaign_id]]; $qs = http_build_query($qs); $this->layout()->setFlash("Vorbestellung erfolgreich gespeichert!", "success"); diff --git a/contrib/database-init.sql b/contrib/database-init.sql deleted file mode 100644 index 022d0857c..000000000 --- a/contrib/database-init.sql +++ /dev/null @@ -1,276 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.34, for Linux (x86_64) --- --- Host: localhost Database: thetool2 --- ------------------------------------------------------ --- Server version 5.7.34-0ubuntu0.18.04.1 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `Address` --- - -DROP TABLE IF EXISTS `Address`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `Address` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `parent_id` int(11) DEFAULT NULL, - `company` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `firstname` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `lastname` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `street` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `zip` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `city` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `country` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `phone` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `fax` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `mobile` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `email` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Address` --- - -LOCK TABLES `Address` WRITE; -/*!40000 ALTER TABLE `Address` DISABLE KEYS */; -/*!40000 ALTER TABLE `Address` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Addressattribute` --- - -DROP TABLE IF EXISTS `Addressattribute`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `Addressattribute` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `address_id` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `value` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Addressattribute` --- - -LOCK TABLES `Addressattribute` WRITE; -/*!40000 ALTER TABLE `Addressattribute` DISABLE KEYS */; -/*!40000 ALTER TABLE `Addressattribute` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Addresstype` --- - -DROP TABLE IF EXISTS `Addresstype`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `Addresstype` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `address_id` int(11) NOT NULL, - `type` enum('systemowner','netowner','salespartner','pipeworker','lineworker','netoperator','support','billing','employee','customer','supplier','contact') COLLATE utf8mb4_unicode_520_ci NOT NULL, - `primary` tinyint(1) NOT NULL DEFAULT '0', - `note` text COLLATE utf8mb4_unicode_520_ci, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Addresstype` --- - -LOCK TABLES `Addresstype` WRITE; -/*!40000 ALTER TABLE `Addresstype` DISABLE KEYS */; -/*!40000 ALTER TABLE `Addresstype` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Network` --- - -DROP TABLE IF EXISTS `Network`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `Network` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `owner_id` int(11) NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Network` --- - -LOCK TABLES `Network` WRITE; -/*!40000 ALTER TABLE `Network` DISABLE KEYS */; -/*!40000 ALTER TABLE `Network` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Pop` --- - -DROP TABLE IF EXISTS `Pop`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `Pop` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `network_id` int(11) NOT NULL, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `gps_lat` decimal(15,10) DEFAULT NULL, - `gps_long` decimal(15,10) DEFAULT NULL, - `location` text COLLATE utf8mb4_unicode_520_ci, - `note` text COLLATE utf8mb4_unicode_520_ci, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Pop` --- - -LOCK TABLES `Pop` WRITE; -/*!40000 ALTER TABLE `Pop` DISABLE KEYS */; -/*!40000 ALTER TABLE `Pop` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Worker` --- - -DROP TABLE IF EXISTS `Worker`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `Worker` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `address_id` int(11) NOT NULL, - `username` varchar(255) CHARACTER SET utf8mb4 NOT NULL, - `password` varchar(56) CHARACTER SET utf8mb4 NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL, - `email` varchar(255) CHARACTER SET utf8mb4 NOT NULL, - `ip` varchar(39) CHARACTER SET utf8mb4 DEFAULT NULL, - `sessionid` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Worker` --- - -LOCK TABLES `Worker` WRITE; -/*!40000 ALTER TABLE `Worker` DISABLE KEYS */; -INSERT INTO `Worker` VALUES (1,1,'admin','e3823cb9c12137166c9e71978e8383b96300d0e6f46d1c902b794d95','Admin I. Strator','root@localhost',NULL,NULL,1,1,1520600652,1604674421); -/*!40000 ALTER TABLE `Worker` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `WorkerFlag` --- - -DROP TABLE IF EXISTS `WorkerFlag`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `WorkerFlag` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `worker_id` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `value` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `WorkerFlag` --- - -LOCK TABLES `WorkerFlag` WRITE; -/*!40000 ALTER TABLE `WorkerFlag` DISABLE KEYS */; -/*!40000 ALTER TABLE `WorkerFlag` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `WorkerPermission` --- - -DROP TABLE IF EXISTS `WorkerPermission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `WorkerPermission` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `worker_id` int(11) NOT NULL, - `admin` enum('false','true') COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'false', - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `WorkerPermission` --- - -LOCK TABLES `WorkerPermission` WRITE; -/*!40000 ALTER TABLE `WorkerPermission` DISABLE KEYS */; -INSERT INTO `WorkerPermission` VALUES (1,1,'true',1549970701,1604674421); -/*!40000 ALTER TABLE `WorkerPermission` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2021-06-24 20:10:17 diff --git a/contrib/migrations/2021-07-13-building.sql b/contrib/migrations/2021-07-13-building.sql deleted file mode 100644 index b4bb55fc5..000000000 --- a/contrib/migrations/2021-07-13-building.sql +++ /dev/null @@ -1,47 +0,0 @@ -CREATE TABLE `Building` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `network_id` int(11) NOT NULL, - `pop_id` int(11) NOT NULL, - `type_id` int(11) NOT NULL, - `status_id` int(11) NOT NULL, - `pipeworker_id` int(11) DEFAULT NULL, - `code` varchar(16) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `oan_id` varchar(8) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `street` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `zip` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `city` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `gps_lat` decimal(15,10) NOT NULL, - `gps_long` decimal(15,10) NOT NULL, - `contact` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `phone` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `email` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `units` int(11) NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Buildingstatus` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `code` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Buildingtype` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; \ No newline at end of file diff --git a/contrib/migrations/2021-07-20-networksection.sql b/contrib/migrations/2021-07-20-networksection.sql deleted file mode 100644 index 11252b8d0..000000000 --- a/contrib/migrations/2021-07-20-networksection.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `Networksection` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `network_id` int(11) NOT NULL, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -ALTER TABLE `Building` CHANGE `description` `description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL; -ALTER TABLE `Building` ADD `networksection_id` INT NULL DEFAULT NULL AFTER `lineworker_id`; diff --git a/contrib/migrations/2021-07-22-termination b/contrib/migrations/2021-07-22-termination deleted file mode 100644 index 640d5f88a..000000000 --- a/contrib/migrations/2021-07-22-termination +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TABLE `Termination` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `building_id` int(11) NOT NULL, - `status_id` int(11) NOT NULL, - `lineworker_id` int(11) DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `code` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `oan_id` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `rimo_id` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `contact` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `phone` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `email` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Terminationstatus` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `code` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(11) NOT NULL, - `edit` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; \ No newline at end of file diff --git a/contrib/migrations/2021-07-30-order-file.sql b/contrib/migrations/2021-07-30-order-file.sql deleted file mode 100644 index 3264b4244..000000000 --- a/contrib/migrations/2021-07-30-order-file.sql +++ /dev/null @@ -1,67 +0,0 @@ -CREATE TABLE `File` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) NOT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, - `filename` varchar(1024) NOT NULL, - `store_filename` varchar(1024) NOT NULL, - `orig_filename` varchar(1024) NOT NULL, - `subfolder` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; - -CREATE TABLE `Order` ( - `id` int NOT NULL AUTO_INCREMENT, - `owner_id` int DEFAULT NULL, - `billingaddress_id` int DEFAULT NULL, - `order_date` int NOT NULL, - `finish_date` int DEFAULT NULL COMMENT 'timestamp', - `billing_type` enum('invoice','sepa') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, - `bank_account_bank` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, - `bank_account_owner` varchar(1024) NOT NULL, - `bank_account_iban` varchar(255) NOT NULL, - `bank_account_bic` varchar(64) NOT NULL, - `allow_contact` tinyint NOT NULL DEFAULT '0', - `allow_spin` tinyint NOT NULL DEFAULT '0', - `note` text NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; - -CREATE TABLE `OrderFile` ( - `id` int NOT NULL AUTO_INCREMENT, - `order_id` int NOT NULL, - `file_id` int NOT NULL, - `name` varchar(1024) NOT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; - -CREATE TABLE `OrderProduct` ( - `id` int NOT NULL AUTO_INCREMENT, - `order_id` int NOT NULL, - `product_id` int NOT NULL, - `amount` decimal(9,6) NOT NULL DEFAULT '1.000000', - `pos` int NOT NULL, - `description` text NOT NULL, - `price` int NOT NULL DEFAULT '0', - `price_setup` int NOT NULL DEFAULT '0', - `billing_delay` int NOT NULL DEFAULT '0' COMMENT 'in months', - `billing_period` int NOT NULL COMMENT 'in months', - `note` text NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; \ No newline at end of file diff --git a/contrib/migrations/2021-08-24-create-workflow.sql b/contrib/migrations/2021-08-24-create-workflow.sql deleted file mode 100644 index da8002a91..000000000 --- a/contrib/migrations/2021-08-24-create-workflow.sql +++ /dev/null @@ -1,37 +0,0 @@ -ALTER TABLE `Building` ADD `workflow_finished` INT NOT NULL DEFAULT '0' AFTER `networksection_id`; - -CREATE TABLE `Workflowitem` ( - `id` int NOT NULL AUTO_INCREMENT, - `num` int NOT NULL DEFAULT '0', - `object_type` enum('Building','Termination') COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'Building', - `active` int NOT NULL DEFAULT '1', - `visible` int NOT NULL DEFAULT '1', - `required` int NOT NULL DEFAULT '1', - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `label` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `type` enum('string','int','bool','enum','text','file','gps','color','delimiter') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'string', - `typedata` text COLLATE utf8mb4_unicode_520_ci, - `placeholder` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Workflowvalue` ( - `id` int NOT NULL AUTO_INCREMENT, - `item_id` int NOT NULL, - `object_id` int NOT NULL, - `value_string` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `value_int` int DEFAULT NULL, - `value_text` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `changed_by` int NOT NULL, - `changed` int NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; \ No newline at end of file diff --git a/contrib/migrations/20210629-addresstype-planner-vlan.sql b/contrib/migrations/20210629-addresstype-planner-vlan.sql deleted file mode 100644 index 4b20895b1..000000000 --- a/contrib/migrations/20210629-addresstype-planner-vlan.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `Addresstype` CHANGE `type` `type` ENUM('systemowner','netowner','salespartner','pipeworker','lineworker','pipeplanner','lineplanner','netoperator','support','billing','employee','customer','supplier','contact') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL; -ALTER TABLE `Pop` ADD `vlan_public` INT(4) NULL DEFAULT NULL AFTER `location`; -ALTER TABLE `Pop` ADD `vlan_nat` INT(4) NULL DEFAULT NULL AFTER `vlan_public`; -ALTER TABLE `Pop` ADD `vlan_ipv6` INT(4) NULL DEFAULT NULL AFTER `vlan_nat`; - diff --git a/contrib/migrations/20210701-networkaddress.sql b/contrib/migrations/20210701-networkaddress.sql deleted file mode 100644 index fc5f8b060..000000000 --- a/contrib/migrations/20210701-networkaddress.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE `NetworkAddress` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `network_id` int(11) NOT NULL, - `address_id` int(11) NOT NULL, - `type` varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int(11) NOT NULL, - `edit_by` int(11) NOT NULL, - `create` int(10) NOT NULL, - `edit` int(10) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci diff --git a/contrib/migrations/20210705-product-tables.sql b/contrib/migrations/20210705-product-tables.sql deleted file mode 100644 index f4d0b5fca..000000000 --- a/contrib/migrations/20210705-product-tables.sql +++ /dev/null @@ -1,100 +0,0 @@ -CREATE TABLE `Product` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `sla_id` int NOT NULL, - `external` tinyint(1) NOT NULL DEFAULT '0', - `producttech_id` int DEFAULT NULL, - `productgroup_id` int DEFAULT NULL, - `price_nne` decimal(14,4) DEFAULT NULL, - `price_nbe` decimal(14,4) DEFAULT NULL, - `price` decimal(14,4) NOT NULL, - `price_setup` decimal(14,4) NOT NULL DEFAULT '0', - `billing_delay` int NOT NULL DEFAULT '0' COMMENT 'in months', - `billing_period` int NOT NULL COMMENT 'in months', - `ivt_id` int DEFAULT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `ProductNetwork` ( - `id` int NOT NULL AUTO_INCREMENT, - `product_id` int NOT NULL, - `network_id` int NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `ProductAttribute` ( - `id` int NOT NULL AUTO_INCREMENT, - `product_id` int NOT NULL, - `producttechattribute_id` int NOT NULL, - `value` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Productgroup` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Producttech` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `rtrcode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `customer_type` enum('residential','business') COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'residential', - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `ProducttechAttribute` ( - `id` int NOT NULL AUTO_INCREMENT, - `producttech_id` int NOT NULL, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `displayname` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `value` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -CREATE TABLE `Sla` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; - -INSERT INTO `Sla` VALUES (1,'12h/6T - Working Hours','','',1,1,1625495944,1625495944),(2,'24h/7T - 2h/6h Emergency','','',1,1,1625495944,1625495944),(3,'8h/5T - Next Business Day','','',1,1,1625495985,1625495985),(4,'8h/5T - Residential','','',1,1,1625495985,1625495985);