diff --git a/Layout/default/Order/Index.php b/Layout/default/Order/Index.php index daac03bf0..920e6aa97 100644 --- a/Layout/default/Order/Index.php +++ b/Layout/default/Order/Index.php @@ -87,16 +87,23 @@ +
+ + +
+
-
- - +
+ +
+ +
diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php new file mode 100644 index 000000000..a07eee6e4 --- /dev/null +++ b/Layout/default/Preorder/Index.php @@ -0,0 +1,66 @@ + + + +
+
+
+
+ +
+

Vorbestellungenname : ""?>

+
+
+
+ + +
+
+ + +
+
+
+

Liste aller Vorbestellungenname : ""?>

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
KampagneTypKundeAdressePartner IDAnschlusserstelltbearbeitet
campaign->name?>type?>company) ? $preorder->company : $preorder->firstname." ".$preorder->lastname?>street?>
zip?> city?>
partner->getNameOrCompany()?>termination) ? $preorder->termination->code : ""?> + $camp->id])?>"> + $camp->id])?>" class="text-danger" onclick="if(!confirm('Vorbestellkampagne wirklich löschen?')) return false;" title="Vorbestellkampagne Löschen"> +
+
+
+ +
+
+ + diff --git a/Layout/default/Preordercampaign/Form.php b/Layout/default/Preordercampaign/Form.php index 2d6f72dfb..a74750732 100644 --- a/Layout/default/Preordercampaign/Form.php +++ b/Layout/default/Preordercampaign/Form.php @@ -66,7 +66,7 @@
- " /> + " />
@@ -74,7 +74,7 @@
- " /> + " />
diff --git a/Layout/default/Preordercampaign/Index.php b/Layout/default/Preordercampaign/Index.php index 4707452ee..99352f416 100644 --- a/Layout/default/Preordercampaign/Index.php +++ b/Layout/default/Preordercampaign/Index.php @@ -72,6 +72,7 @@ + @@ -82,7 +83,7 @@ - + "> + diff --git a/Layout/default/mfLogin/Index.php b/Layout/default/mfLogin/Index.php index 03a2ae918..84a1e015f 100644 --- a/Layout/default/mfLogin/Index.php +++ b/Layout/default/mfLogin/Index.php @@ -3,7 +3,7 @@ - thetool | Log in + <?=MFAPPNAME_FULL?> | Log in diff --git a/application/Order/OrderModel.php b/application/Order/OrderModel.php index ae85da88d..b80f56df9 100644 --- a/application/Order/OrderModel.php +++ b/application/Order/OrderModel.php @@ -240,6 +240,14 @@ class OrderModel { $where .= " AND (Address.company like '%$owner%' OR Address.firstname like '%$owner%' OR Address.lastname like '%$owner%' OR Address.customer_number like '%$owner%')"; } } + + if(array_key_exists("owner_address", $filter)) { + $owner_address = FronkDB::singleton()->escape($filter['owner_address']); + if($owner_address) { + $where .= " AND (Address.street like '%$owner_address%' OR Address.zip like '%$owner_address%' OR Address.city like '%$owner_address%')"; + } + } + /* if(array_key_exists("owner", $filter)) { $owner = FronkDB::singleton()->escape($filter['owner']); diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index 7ea2dd781..6c689bba8 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -1,5 +1,59 @@ $name == null) { + + if($name == "campaign") { + $this->campaign = new Preordercampaign($this->id); + return $this->campaign; + } + + if($name == "partner") { + $this->partner = mfValuecache::singleton()->get("mfObjectmodel-Address-".$this->partner_id); + if(!$this->partner) { + $this->partner = new Address($this->partner_id); + mfValuecache::singleton()->set("mfObjectmodel-Address-".$this->partner_id, $this->partner); + } + return $this->partner; + } + + if($name == "creator") { + $user = mfValuecache::singleton()->get("Worker-id-".$this->create_by); + if($user) { + $this->creator = $user; + return $this->creator; + } + $this->creator = new User($this->create_by); + if($this->creator->id) { + mfValuecache::singleton()->set("Worker-id-".$this->create_by, $this->creator); + } + return $this->creator; + } + + if($name == "editor") { + $this->editor = new User($this->edit_by); + return $this->editor; + } + + $classname = ucfirst($name); + $idfield = $name."_id"; + $this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield); + if(!$this->$name) { + $this->$name = new $classname($this->$idfield); + } + + if($this->$name->id) { + mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name); + return $this->$name; + } else { + return null; + } + } + + return $this->$name; + } } \ No newline at end of file diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 4454908be..f3a7864ee 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -15,6 +15,23 @@ class PreorderController extends mfBaseController { } protected function indexAction() { + $this->layout()->setTemplate("Preorder/Index"); + + $campaign_filter = []; + + if($this->request->campaign_id) { + $campaign_id = $this->request->campaign_id; + if(is_numeric($campaign_id) && $campaign_id > 0) { + $campaign = new Preordercampaign($ampaign); + $this->layout()->set("campaign", $campaign); + } + + $campaign_filter["preordercampaign_id"] = $campaign_id; + } + + $preorders = PreorderModel::search($campaign_filter); + $this->layout()->set("preorders", $preorders); + } diff --git a/application/Preordercampaign/PreordercampaignController.php b/application/Preordercampaign/PreordercampaignController.php index 7d462aba6..7271c82d5 100644 --- a/application/Preordercampaign/PreordercampaignController.php +++ b/application/Preordercampaign/PreordercampaignController.php @@ -159,7 +159,8 @@ class PreordercampaignController extends mfBaseController { } $this->layout()->setFlash("Vorbestellkampagne erfolgreich gespeichert.", "success"); - $this->redirect("Preordercampaign", "Edit", ['id' => $new_id]); + //$this->redirect("Preordercampaign", "Edit", ['id' => $new_id]); + $this->redirect("Preordercampaign"); }
Netzgebiete Name
= $camp->from && date('U') <= $camp->to): ?> @@ -91,6 +92,9 @@ + $camp->id])?>"> + network->name?> name?> area?>