diff --git a/Layout/andom-tec/menu.php b/Layout/andom-tec/menu.php index 6ae37c0d9..3f322d5ed 100644 --- a/Layout/andom-tec/menu.php +++ b/Layout/andom-tec/menu.php @@ -66,6 +66,7 @@ + is(["Admin","salespartner"])): ?>
  • @@ -84,7 +85,7 @@ diff --git a/Layout/default/Address/Form.php b/Layout/default/Address/Form.php index 6900ee4a1..550f0bd51 100644 --- a/Layout/default/Address/Form.php +++ b/Layout/default/Address/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Building/Form.php b/Layout/default/Building/Form.php index 5ec903a2c..893b3cd9d 100644 --- a/Layout/default/Building/Form.php +++ b/Layout/default/Building/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Building/Index.php b/Layout/default/Building/Index.php index 856219403..74d2edf34 100644 --- a/Layout/default/Building/Index.php +++ b/Layout/default/Building/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Objekte & Anschlüsse"; ?> - + diff --git a/Layout/default/Contractconfig/Index.php b/Layout/default/Contractconfig/Index.php index 95bad86b1..b8de1b705 100644 --- a/Layout/default/Contractconfig/Index.php +++ b/Layout/default/Contractconfig/Index.php @@ -1,7 +1,7 @@ - +
    diff --git a/Layout/default/Cpeprovisioning/Index.php b/Layout/default/Cpeprovisioning/Index.php index 3c816e1e6..00517a107 100644 --- a/Layout/default/Cpeprovisioning/Index.php +++ b/Layout/default/Cpeprovisioning/Index.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Cpeshipping/History.php b/Layout/default/Cpeshipping/History.php index 1c33d91e7..83d14b1b3 100644 --- a/Layout/default/Cpeshipping/History.php +++ b/Layout/default/Cpeshipping/History.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Cpeshipping/Index.php b/Layout/default/Cpeshipping/Index.php index cb8d8bad1..838cfba97 100644 --- a/Layout/default/Cpeshipping/Index.php +++ b/Layout/default/Cpeshipping/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "CPEs"; ?> - +
    diff --git a/Layout/default/Dashboard/Index.php b/Layout/default/Dashboard/Index.php index 000ca6d0e..e36881ab1 100644 --- a/Layout/default/Dashboard/Index.php +++ b/Layout/default/Dashboard/Index.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Linework/Index.php b/Layout/default/Linework/Index.php index 96e847a3c..8d1e26f02 100644 --- a/Layout/default/Linework/Index.php +++ b/Layout/default/Linework/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Leitungsbauaufträge"; ?> - + diff --git a/Layout/default/Network/Form.php b/Layout/default/Network/Form.php index edc2a6eaa..d629d0c7a 100644 --- a/Layout/default/Network/Form.php +++ b/Layout/default/Network/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Network/Index.php b/Layout/default/Network/Index.php index 23a7fd544..d78edf19a 100644 --- a/Layout/default/Network/Index.php +++ b/Layout/default/Network/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Netzgebiete"; ?> - +
    diff --git a/Layout/default/News/Index.php b/Layout/default/News/Index.php index a6f2a11a4..facc22d35 100644 --- a/Layout/default/News/Index.php +++ b/Layout/default/News/Index.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Order/Form.php b/Layout/default/Order/Form.php index 847b555d0..2b2c85db6 100644 --- a/Layout/default/Order/Form.php +++ b/Layout/default/Order/Form.php @@ -2,7 +2,7 @@ //var_dump($order);exit; $includes_external_product = false; ?> - +
    @@ -701,8 +701,9 @@
    - + is("Admin", "netoperator")): ?> + id && !$includes_external_product): ?>
    diff --git a/Layout/default/Order/Index.php b/Layout/default/Order/Index.php index 6e653fa6f..daac03bf0 100644 --- a/Layout/default/Order/Index.php +++ b/Layout/default/Order/Index.php @@ -17,7 +17,7 @@ //var_dump($sorted_networks);exit; ?> - +
    diff --git a/Layout/default/Patching/Index.php b/Layout/default/Patching/Index.php index 9c84133c3..b98c233b0 100644 --- a/Layout/default/Patching/Index.php +++ b/Layout/default/Patching/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Patchungen"; ?> - +
    diff --git a/Layout/default/Pipework/Index.php b/Layout/default/Pipework/Index.php index e1f8aa476..3890297c9 100644 --- a/Layout/default/Pipework/Index.php +++ b/Layout/default/Pipework/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Tiefbauaufträge"; ?> - + diff --git a/Layout/default/Pop/Form.php b/Layout/default/Pop/Form.php index 77b54a2ee..6194c56a0 100644 --- a/Layout/default/Pop/Form.php +++ b/Layout/default/Pop/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Preorder/Form.php b/Layout/default/Preorder/Form.php index 366ced48e..8543911a2 100644 --- a/Layout/default/Preorder/Form.php +++ b/Layout/default/Preorder/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Preordercampaign/Form.php b/Layout/default/Preordercampaign/Form.php new file mode 100644 index 000000000..2d6f72dfb --- /dev/null +++ b/Layout/default/Preordercampaign/Form.php @@ -0,0 +1,121 @@ + + +
    +
    +
    + +

    Vorbestellkampagne

    +
    +
    +
    + + +
    +
    + +
    +
    +

    Vorbestellkampagne

    + +
    "> + + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + +
    + +
    + " /> +
    +
    + + +
    + +
    + " /> +
    +
    + +
    +
    + + + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/Layout/default/Preordercampaign/Index.php b/Layout/default/Preordercampaign/Index.php index 7e3abc094..4707452ee 100644 --- a/Layout/default/Preordercampaign/Index.php +++ b/Layout/default/Preordercampaign/Index.php @@ -1,4 +1,4 @@ - +
    @@ -23,7 +23,7 @@

    Filter

    -
    "> + ">
    @@ -50,7 +50,7 @@ @@ -72,6 +72,7 @@ + @@ -80,17 +81,25 @@ - + + - - - + + + diff --git a/Layout/default/Product/Form.php b/Layout/default/Product/Form.php index e7115e531..5d74d2685 100644 --- a/Layout/default/Product/Form.php +++ b/Layout/default/Product/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Product/Index.php b/Layout/default/Product/Index.php index a638e63fc..df377851b 100644 --- a/Layout/default/Product/Index.php +++ b/Layout/default/Product/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Produkte"; ?> - +
    diff --git a/Layout/default/Producttech/Form.php b/Layout/default/Producttech/Form.php index 7a5c2f12e..65bca275c 100644 --- a/Layout/default/Producttech/Form.php +++ b/Layout/default/Producttech/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Producttech/Index.php b/Layout/default/Producttech/Index.php index 90e6dc33e..df654027c 100644 --- a/Layout/default/Producttech/Index.php +++ b/Layout/default/Producttech/Index.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/User/Form.php b/Layout/default/User/Form.php index 9a9607bd3..85c9d0def 100644 --- a/Layout/default/User/Form.php +++ b/Layout/default/User/Form.php @@ -1,7 +1,7 @@ - +
    diff --git a/Layout/default/User/Index.php b/Layout/default/User/Index.php index 0dc0beba0..60e28858b 100644 --- a/Layout/default/User/Index.php +++ b/Layout/default/User/Index.php @@ -5,7 +5,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Benutzer"; ?> - +
    diff --git a/Layout/default/Voicenumber/Form.php b/Layout/default/Voicenumber/Form.php index b8530bff7..b47e33406 100644 --- a/Layout/default/Voicenumber/Form.php +++ b/Layout/default/Voicenumber/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Voicenumberblock/Form.php b/Layout/default/Voicenumberblock/Form.php index 2850ecefc..2929daa5f 100644 --- a/Layout/default/Voicenumberblock/Form.php +++ b/Layout/default/Voicenumberblock/Form.php @@ -1,4 +1,4 @@ - +
    diff --git a/Layout/default/Voicenumberblock/Index.php b/Layout/default/Voicenumberblock/Index.php index 6dddc0a6a..dc2eadf2a 100644 --- a/Layout/default/Voicenumberblock/Index.php +++ b/Layout/default/Voicenumberblock/Index.php @@ -3,7 +3,7 @@ $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Rufnummernblöcke"; ?> - +
    diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 4b6a48294..4454908be 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -14,6 +14,10 @@ class PreorderController extends mfBaseController { } } + protected function indexAction() { + + } + protected function addAction() { $this->layout()->setTemplate("Preorder/Form"); diff --git a/application/Preorder/PreorderModel.php b/application/Preorder/PreorderModel.php index 2debf04b1..b00174e34 100644 --- a/application/Preorder/PreorderModel.php +++ b/application/Preorder/PreorderModel.php @@ -67,7 +67,7 @@ class PreorderModel { $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - $res = $db->select("Preorder", "*", "$where ORDER BY name, network_id"); + $res = $db->select("Preorder", "*", "$where ORDER BY zip, city, company, lastname, firstname"); if($db->num_rows($res)) { $data = $db->fetch_object($res); $item = new Preorder($data); @@ -85,7 +85,7 @@ class PreorderModel { $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - $res = $db->select("Preorder", "*", "$where ORDER BY name, network_id"); + $res = $db->select("Preorder", "*", "$where ORDER BY zip, city, company, lastname, firstname"); if($db->num_rows($res)) { while($data = $db->fetch_object($res)) { $items[] = new Preorder($data); @@ -98,13 +98,15 @@ class PreorderModel { $where = "1=1 "; //var_dump($filter);exit; - if(array_key_exists("network_id", $filter)) { - $networkid = $filter['network_id']; - if(is_numeric($networkid)) { - $where .= " AND network_id=$networkid"; + if(array_key_exists("preordercampaign_id", $filter)) { + $preordercampaignid = $filter['preordercampaign_id']; + if(is_numeric($preordercampaignid)) { + $where .= " AND preordercampaign_id=$preordercampaignid"; } } + + //var_dump($filter, $where);exit; return $where; } diff --git a/application/Preordercampaign/PreordercampaignController.php b/application/Preordercampaign/PreordercampaignController.php index 4bd332753..7d462aba6 100644 --- a/application/Preordercampaign/PreordercampaignController.php +++ b/application/Preordercampaign/PreordercampaignController.php @@ -17,6 +17,24 @@ class PreordercampaignController extends mfBaseController { protected function indexAction() { $this->layout()->setTemplate("Preordercampaign/Index"); + $this->layout->set("filter", $this->request->filter); + + if($this->request->filter) { + $filter = $this->getPreparedFilter($this->request->filter); + } + + // pagination defaults + $pagination = []; + $pagination['start'] = 0; + $pagination['count'] = 20; + $pagination['maxItems'] = 0; + + if(is_numeric($this->request->s)) { + $pagination['start'] = intval($this->request->s); + } + + $my_networks = []; + if($this->me->is("Admin")) { if($filter['network_id']) { $my_networks[] = new Network($filter['network_id']); @@ -79,13 +97,13 @@ class PreordercampaignController extends mfBaseController { $id = $this->request->id; if(!is_numeric($id) || !$id) { $this->layout()->setFlash("Vorbestellkampagne nicht gefunden", "error"); - $this->redirect("Preordercampain"); + $this->redirect("Preordercampaign"); } $campaign = new Preordercampaign($id); - if(!$campain->id) { + if(!$campaign->id) { $this->layout()->setFlash("Vorbestellkampagne nicht gefunden", "error"); - $this->redirect("Preordercampain"); + $this->redirect("Preordercampaign"); } $this->layout()->set("campaign", $campaign); @@ -93,4 +111,56 @@ class PreordercampaignController extends mfBaseController { return $this->addAction(); } + protected function saveAction() { + $r = $this->request; + //var_dump($r);exit; + $id = $r->id; + if(is_numeric($id) && $id > 0) { + $mode = "edit"; + $campaign = new Preordercampaign($id); + if(!$campaign->id) { + $this->layout()->setFlash("Vorbestellkampagne nicht gefunden", "error"); + $this->redirect("Preordercampaign"); + } + } else { + $id = false; + $mode = "add"; + } + + $data = []; + $data['network_id'] = $r->network_id; + $data['name'] = $r->name; + $data['description'] = $r->description; + $data['area'] = $r->area; + $data['note'] = $r->note; + + if($r->from) { + $data['from'] = self::dateToTimestamp($r->from); + } + + if($r->to) { + $data['to'] = self::dateToTimestamp($r->to); + } + + $data['edit_by'] = $this->me->id; + + if($mode == "add") { + $data['create_by'] = $this->me->id; + $campaign = PreordercampaignModel::create($data); + } else { + $campaign->update($data); + } + + $new_id = $campaign->save(); + if(!$new_id) { + $this->layout()->setFlash("Fehler beim Speichern", "error"); + $this->layout()->set("campaign", $campaign); + return $this->add(); + } + + $this->layout()->setFlash("Vorbestellkampagne erfolgreich gespeichert.", "success"); + $this->redirect("Preordercampaign", "Edit", ['id' => $new_id]); + + } + } \ No newline at end of file diff --git a/application/Preordercampaign/PreordercampaignModel.php b/application/Preordercampaign/PreordercampaignModel.php index 8cf4ab54e..48351859a 100644 --- a/application/Preordercampaign/PreordercampaignModel.php +++ b/application/Preordercampaign/PreordercampaignModel.php @@ -3,12 +3,10 @@ class PreordercampaignModel { public $name = null; public $network_id = null; - public $gps_lat = null; - public $gps_long = null; - public $location = null; - public $vlan_public = null; - public $vlan_nat = null; - public $vlan_ipv6 = null; + public $description = null; + public $area = null; + public $from = null; + public $to = null; public $note = null;
    Netzgebiete Name GebietEnde
    + = $camp->from && date('U') <= $camp->to): ?> + + + + + + network->name?> name?> area?>preorders)?>start)?>end)?> ["campaign_id" => $camp->id]])?>">preorders)?>from)?>to)?> - $camp->id])?>"> - $camp->id])?>" class="text-danger" onclick="if(!confirm('Vorbestellkampagne wirklich löschen?')) return false;" title="Vorbestellkampagne Löschen"> + $camp->id])?>"> + $camp->id])?>" class="text-danger" onclick="if(!confirm('Vorbestellkampagne wirklich löschen?')) return false;" title="Vorbestellkampagne Löschen">