WIP Preorder
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?=($preorder->id) ? "Vorbestellung bearbeiten" : "Neue Vorbestellung"?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("Preordercampaign", "save")?>">
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("Preorder", "save", ['preordercampaign_id' => $campaign->id])?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group row" id="building-search-selected">
|
||||
<input type="hidden" name="building_id" value="<?=$preorder->building_id?>" ?>
|
||||
<input type="hidden" name="building_id" id="building_id" value="<?=$preorder->building_id?>" />
|
||||
<label class="col-lg-2 col-form-label" for="">Ausgewähltes Gebäude</label>
|
||||
<div class="col-lg-10">
|
||||
<div class="card">
|
||||
@@ -93,9 +93,9 @@
|
||||
<tr>
|
||||
<td class="check-mark align-top" style="font-size: 2.5em; width:40px;"><i class="fas fa-check text-success"></i></td>
|
||||
<td class="label">
|
||||
<?=$preorder->street?><br />
|
||||
<?=$preorder->zip?> <?=$preorder->city?><br />
|
||||
Wohneinheiten: <?=($preorder->units) ? $preorder->units : 1?>
|
||||
<strong><?=$preorder->building->street?></strong><br />
|
||||
<strong><?=$preorder->building->zip?> <?=$preorder->building->city?></strong><br />
|
||||
Wohneinheiten: <?=($preorder->building->units) ? $preorder->building->units : 1?>
|
||||
<?php if($preorder->building->code): ?>
|
||||
<br /><?=$preorder->building->code?>
|
||||
<?php endif; ?>
|
||||
@@ -127,7 +127,19 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="product_id">Produkt</label>
|
||||
<label class="col-lg-2 col-form-label" for="product_id">Vertriebspartner</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="form-control" name="partner_id" id="partner_id">
|
||||
<option value=""></option>
|
||||
<?php foreach($partners as $partner): ?>
|
||||
<option value="<?=$partner->id?>" <?=($preorder->partner_id == $partner->id) ? "selected='selected'" : ""?>><?=$partner->getCompanyOrName()?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="product_id">Produkt *</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="form-control" name="product_id" id="product_id" onchange="updateProduct()">
|
||||
<option value=""></option>
|
||||
@@ -141,14 +153,14 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="price_setup">Netto Preis Setup *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="price_setup" id="price_setup" />
|
||||
<input type="text" class="form-control" name="price_setup" id="price_setup" value="<?=$preorder->price_setup?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="price">Netto Preis Periodisch *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="price" id="price" />
|
||||
<input type="text" class="form-control" name="price" id="price" value="<?=$preorder->price?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -156,13 +168,13 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="price_nne">Preis NNE *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="price_nne" id="price_nne" />
|
||||
<input type="text" class="form-control" name="price_nne" id="price_nne" value="<?=$preorder->price_nne?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="price_nbe">Preis NBE *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="price_nbe" id="price_nbe" />
|
||||
<input type="text" class="form-control" name="price_nbe" id="price_nbe" value="<?=$preorder->price_nbe?>" />
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -170,7 +182,7 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="billing_delay">Verzögerter Verrechnungsstart *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="billing_delay" id="billing_delay" placeholder="Freimonate" />
|
||||
<input type="text" class="form-control" name="billing_delay" id="billing_delay" placeholder="Freimonate" value="<?=$preorder->billing_delay?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -178,66 +190,69 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="company">Firma</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="company" id="company" />
|
||||
<input type="text" class="form-control" name="company" id="company" value="<?=$preorder->company?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="uid">UID</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="uid" id="uid" />
|
||||
<input type="text" class="form-control" name="uid" id="uid" value="<?=$preorder->uid?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="firstname">Vorname *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="firstname" id="firstname" />
|
||||
<input type="text" class="form-control" name="firstname" id="firstname" value="<?=$preorder->firstname?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="lastname">Nachname *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="lastname" id="lastname" />
|
||||
<input type="text" class="form-control" name="lastname" id="lastname" value="<?=$preorder->lastname?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="street">Straße *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="street" id="street" />
|
||||
<input type="text" class="form-control" name="street" id="street" value="<?=$preorder->street?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="zip">PLZ / Ort *</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" class="form-control" name="zip" id="zip" />
|
||||
<input type="text" class="form-control" name="zip" id="zip" value="<?=$preorder->zip?>" />
|
||||
</div>
|
||||
<div class="col-lg-7">
|
||||
<input type="text" class="form-control" name="city" id="city" />
|
||||
<input type="text" class="form-control" name="city" id="city" value="<?=$preorder->city?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="phone">Telefon</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="phone" id="phone" />
|
||||
<input type="text" class="form-control" name="phone" id="phone" value="<?=$preorder->phone?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="email">Email</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="email" id="email" />
|
||||
<input type="text" class="form-control" name="email" id="email" value="<?=$preorder->email?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="note">Interne Notiz</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea id="note" class="form-control" name="note" rows="5"><?=$preorder->note?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
@@ -260,7 +275,18 @@
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#building-search-results-section').hide();
|
||||
$('#building-search-selected').hide();
|
||||
<?php if(!$preorder->building_id): ?>
|
||||
$('#building-search-selected').hide();
|
||||
<?php endif; ?>
|
||||
|
||||
$("#product_id").select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});
|
||||
$("#partner_id").select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});
|
||||
|
||||
/**********************
|
||||
* Event handler
|
||||
@@ -306,8 +332,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function listSearchresults(data) {
|
||||
@@ -324,7 +348,7 @@
|
||||
|
||||
data.buildings.forEach(function(b) {
|
||||
var line = '<tr class="result result-' + b.id + ' pointer" onclick="selectBuilding(' + b.id + ')">';
|
||||
line += '<td><input type="checkbox" readonly="readonly" onclick="selectBuilding(' + b.id + ')" name="building_id" value="' + b.id + '" data-zip="' + b.zip + '" data-city="' + b.city + '" data-street="' + b.street + '" data-code="' + b.code + '" data-oanid="' + b.oan_id + '" data-units="' + b.units + '" /></td>';
|
||||
line += '<td><input type="checkbox" readonly="readonly" onclick="selectBuilding(' + b.id + ')" name="building_result_check" value="' + b.id + '" data-zip="' + b.zip + '" data-city="' + b.city + '" data-street="' + b.street + '" data-code="' + b.code + '" data-oanid="' + b.oan_id + '" data-units="' + b.units + '" /></td>';
|
||||
line += "<td>" + b.street + "</td>";
|
||||
line += "<td>" + b.zip + "</td>";
|
||||
line += "<td>" + b.city + "</td>";
|
||||
@@ -351,27 +375,27 @@
|
||||
}
|
||||
|
||||
function selectBuilding(id) {
|
||||
if($('input[name=building_id][value=' + id + ']').prop('checked')) {
|
||||
$('input[name=building_id][value=' + id + ']').prop('checked', false);
|
||||
if($('input[name=building_result_check][value=' + id + ']').prop('checked')) {
|
||||
$('input[name=building_result_check][value=' + id + ']').prop('checked', false);
|
||||
|
||||
$('#building-search-selected .label').removeClass("font-weight-bold").text("Bitte auswählen...");
|
||||
$('#building-search-selected .check-mark i').removeClass().addClass("fas fa-question text-warning");
|
||||
} else {
|
||||
// check selected checkbox and uncheck all others
|
||||
$('input[name=building_id][value=' + id + ']').prop('checked', true);
|
||||
$('input[name=building_id]').each(function() {
|
||||
$('input[name=building_result_check][value=' + id + ']').prop('checked', true);
|
||||
$('input[name=building_result_check]').each(function() {
|
||||
if($(this).val() != id) {
|
||||
$(this).prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// write selected buildings address
|
||||
var street = $('input[name=building_id][value=' + id + ']').data("street");
|
||||
var zip = $('input[name=building_id][value=' + id + ']').data("zip");
|
||||
var city = $('input[name=building_id][value=' + id + ']').data("city");
|
||||
var code = $('input[name=building_id][value=' + id + ']').data("code");
|
||||
var oan_id = $('input[name=building_id][value=' + id + ']').data("oanid");
|
||||
var units = $('input[name=building_id][value=' + id + ']').data("units");
|
||||
var street = $('input[name=building_result_check][value=' + id + ']').data("street");
|
||||
var zip = $('input[name=building_result_check][value=' + id + ']').data("zip");
|
||||
var city = $('input[name=building_result_check][value=' + id + ']').data("city");
|
||||
var code = $('input[name=building_result_check][value=' + id + ']').data("code");
|
||||
var oan_id = $('input[name=building_result_check][value=' + id + ']').data("oanid");
|
||||
var units = $('input[name=building_result_check][value=' + id + ']').data("units");
|
||||
|
||||
$('input[name=street]').val(street);
|
||||
$('input[name=zip]').val(zip);
|
||||
@@ -393,6 +417,7 @@
|
||||
$('#building-search-selected .check-mark i').removeClass().addClass("fas fa-check text-success");
|
||||
|
||||
$('#building-search-selected').show();
|
||||
$('#building_id').val(id);
|
||||
|
||||
showPreorderForm();
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<h4 class="header-title">Liste aller Vorbestellungen<?=($campaign) ? " - ".$campaign->name : ""?></h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Preordercampaign", "add")?>"><i class="fas fa-plus"></i> Neue Vorbestellung anlegen</a>
|
||||
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Preorder", "add")?>"><i class="fas fa-plus"></i> Neue Vorbestellung anlegen</a>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
@@ -38,18 +38,20 @@
|
||||
<th>Adresse</th>
|
||||
<th>Partner ID</th>
|
||||
<th>Anschluss</th>
|
||||
<th>erstellt</th>
|
||||
<th>bearbeitet</th>
|
||||
<th>Erstellt</th>
|
||||
<th>Zuletzt bearbeitet</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($preorders as $preorder): ?>
|
||||
<tr>
|
||||
<td><?=$preorder->campaign->name?></td>
|
||||
<td><?=$preorder->type?></td>
|
||||
<td><?=__($preorder->type, "preorder")?></td>
|
||||
<td><?=($preorder->company) ? $preorder->company : $preorder->firstname." ".$preorder->lastname?></td>
|
||||
<td><?=$preorder->street?><br /><?=$preorder->zip?> <?=$preorder->city?></td>
|
||||
<td><?=$preorder->partner->getNameOrCompany()?></td>
|
||||
<td><?=$preorder->building->street?><br /><?=$preorder->building->zip?> <?=$preorder->building->city?></td>
|
||||
<td><?=($preorder->partner_id) ? $preorder->partner->getCompanyOrName() : ""?></td>
|
||||
<td><?=($preorder->termination) ? $preorder->termination->code : ""?></td>
|
||||
<td><?=date('d.m.Y H:i', $preorder->create)?></td>
|
||||
<td><?=date('d.m.Y H:i', $preorder->edit)?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?=self::getUrl("Preordercampaign", "edit", ["id" => $camp->id])?>"><i class="far fa-edit" title="Vorbestellkampagne Bearbeiten"></i></a>
|
||||
<a href="<?=self::getUrl("Preordercampaign", "delete", ["id" => $camp->id])?>" class="text-danger" onclick="if(!confirm('Vorbestellkampagne wirklich löschen?')) return false;" title="Vorbestellkampagne Löschen"><i class="fas fa-trash"></i></a>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Preorder extends mfBaseModel {
|
||||
protected $forcestr = ['street','company','zip','phone','email','note'];
|
||||
private $campaign;
|
||||
private $partner;
|
||||
private $building;
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
@@ -16,11 +18,24 @@ class Preorder extends mfBaseModel {
|
||||
$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);
|
||||
if($this->partner->id) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-Address-".$this->partner_id, $this->partner);
|
||||
}
|
||||
}
|
||||
return $this->partner;
|
||||
}
|
||||
|
||||
if($name == "building") {
|
||||
$this->building = mfValuecache::singleton()->get("mfObjectmodel-Building-".$this->building_id);
|
||||
if(!$this->building) {
|
||||
$this->building = new Building($this->building_id);
|
||||
if($this->building->id) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-Building-".$this->building_id, $this->building);
|
||||
}
|
||||
}
|
||||
return $this->building;
|
||||
}
|
||||
|
||||
if($name == "creator") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-".$this->create_by);
|
||||
if($user) {
|
||||
|
||||
@@ -59,6 +59,146 @@ class PreorderController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
$this->layout()->set("products", $products);
|
||||
|
||||
$partners = AddressModel::search(['addresstype' => ['salespartner']]);
|
||||
$this->layout()->set("partners", $partners);
|
||||
}
|
||||
|
||||
protected function saveAction() {
|
||||
$r = $this->request;
|
||||
var_dump($r);
|
||||
|
||||
/*
|
||||
* add or edit
|
||||
*/
|
||||
$id = $r->id;
|
||||
if(is_numeric($id) && $id > 0) {
|
||||
$mode = "edit";
|
||||
$preorder = new Preorder($id);
|
||||
if(!$preorder->id) {
|
||||
$this->layout()->setFlash("Vorbestellung nicht gefunden", "error");
|
||||
$this->redirect("Preordercampaign");
|
||||
}
|
||||
} else {
|
||||
$id = false;
|
||||
$mode = "add";
|
||||
}
|
||||
|
||||
/*
|
||||
* data colletion
|
||||
*/
|
||||
$data = [];
|
||||
$data['preordercampaign_id'] = $r->campaign_id;
|
||||
$data['building_id'] = $r->building_id;
|
||||
$data['termination_id'] = ($r->termination_id) ? $r->termination_id : null;
|
||||
$data['product_id'] = $r->product_id;
|
||||
|
||||
switch($r->type) {
|
||||
case "interest":
|
||||
$data['type'] = "interest";
|
||||
break;
|
||||
case "provision":
|
||||
$data['type'] = "provision";
|
||||
break;
|
||||
case "order":
|
||||
$data['type'] = "order";
|
||||
break;
|
||||
}
|
||||
|
||||
$data['price'] = $r->price;
|
||||
$data['price_setup'] = $r->price_setup;
|
||||
$data['price_nne'] = $r->price_nne;
|
||||
$data['price_nbe'] = $r->price_nbe;
|
||||
$data['billing_delay'] = $r->billing_delay;
|
||||
$data['partner_id'] = $r->partner_id;
|
||||
|
||||
$data['company'] = $r->company;
|
||||
$data['uid'] = $r->uid;
|
||||
$data['firstname'] = $r->firstname;
|
||||
$data['lastname'] = $r->lastname;
|
||||
$data['street'] = $r->street;
|
||||
$data['zip'] = $r->zip;
|
||||
$data['city'] = $r->city;
|
||||
$data['phone'] = $r->phone;
|
||||
$data['email'] = $r->email;
|
||||
$data['note'] = $r->note;
|
||||
|
||||
$data['edit_by'] = $this->me->id;
|
||||
|
||||
if($mode == "add") {
|
||||
$data['create_by'] = $this->me->id;
|
||||
$preorder = PreorderModel::create($data);
|
||||
} else {
|
||||
$preorder->update($data);
|
||||
}
|
||||
|
||||
/*
|
||||
* validation
|
||||
*/
|
||||
|
||||
$campaign = new Preordercampaign($preorder->preordercampaign_id);
|
||||
if(!$campaign->id) {
|
||||
$this->layout()->setFlash("Keine Kampagne ausgewählt!", "error");
|
||||
$this->redirect("Preordercampaign");
|
||||
}
|
||||
|
||||
$product = new Product($data['product_id']);
|
||||
if(!$product->id) {
|
||||
$this->layout()->setFlash("Bitte Produkt auswählen!", "error");
|
||||
$this->layout()->set("preorder", $preorder);
|
||||
$this->layout()->set("campaign", $campaign);
|
||||
return $this->addAction();
|
||||
}
|
||||
$preorder->billing_period = $product->billing_period;
|
||||
if(!$this->me->isAdmin()) {
|
||||
$preorder->price_nne = $product->price_nne;
|
||||
$preorder->price_nbe = $product->price_nbe;
|
||||
}
|
||||
|
||||
|
||||
if(!strlen($preorder->price)
|
||||
|| !strlen($preorder->price_setup)
|
||||
|| !strlen($preorder->price_nne)
|
||||
|| !strlen($preorder->price_nbe)
|
||||
|| !strlen($preorder->price_nne)) {
|
||||
$this->layout()->setFlash("Bitte alle benötigten Produktdaten ausfüllen!", "error");
|
||||
$this->layout()->set("preorder", $preorder);
|
||||
$this->layout()->set("campaign", $campaign);
|
||||
return $this->addAction();
|
||||
}
|
||||
|
||||
if(!strlen($preorder->firstname)
|
||||
|| !strlen($preorder->lastname)
|
||||
|| !strlen($preorder->street)
|
||||
|| !strlen($preorder->zip)
|
||||
|| !strlen($preorder->city)) {
|
||||
$this->layout()->setFlash("Bitte alle benötigten Kundendaten ausfüllen!", "error");
|
||||
$this->layout()->set("preorder", $preorder);
|
||||
$this->layout()->set("campaign", $campaign);
|
||||
return $this->addAction();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//var_dump($preorder);exit;
|
||||
|
||||
|
||||
/*
|
||||
* save
|
||||
*/
|
||||
$new_id = $preorder->save();
|
||||
if(!$new_id) {
|
||||
$this->layout()->setFlash("Fehler beim Speichern", "error");
|
||||
$this->layout()->set("preorder", $preorder);
|
||||
return $this->addAction();
|
||||
}
|
||||
|
||||
|
||||
$qs = ['filter' => ['campaign_id' => $preorder->preordercampaign_id]];
|
||||
$qs = http_build_query($qs);
|
||||
|
||||
$this->layout()->setFlash("Vorbestellung erfolgreich gespeichert!", "success");
|
||||
$this->redirect("Preorder", "Index", $qs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
<?php
|
||||
|
||||
class PreorderModel {
|
||||
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 $preordercampaign_id;
|
||||
public $building_id;
|
||||
public $termination_id;
|
||||
public $product_id;
|
||||
public $type;
|
||||
public $price;
|
||||
public $price_setup;
|
||||
public $price_nne;
|
||||
public $price_nbe;
|
||||
public $billing_delay;
|
||||
public $billing_period;
|
||||
public $partner_id;
|
||||
public $company;
|
||||
public $uid;
|
||||
public $firstname;
|
||||
public $lastname;
|
||||
public $street;
|
||||
public $zip;
|
||||
public $city;
|
||||
public $phone;
|
||||
public $email;
|
||||
|
||||
public $note = null;
|
||||
public $note;
|
||||
|
||||
public $create_by = null;
|
||||
public $edit_by = null;
|
||||
public $create = null;
|
||||
public $edit = null;
|
||||
public $create_by;
|
||||
public $edit_by;
|
||||
public $create;
|
||||
public $edit;
|
||||
|
||||
public static function create(Array $data) {
|
||||
$model = new Preorder();
|
||||
|
||||
@@ -38,4 +38,8 @@ $l['active-t'] = "Internetprodukt aktiv";
|
||||
$l['kolmisoft'] = "VPORTAL (kolmisoft)";
|
||||
$l['sipit'] = "SCA (sipit)";
|
||||
|
||||
$l['preorder.interest'] = "Interessenbekundung";
|
||||
$l['preorder.provision'] = "Vorsorgeanschluss";
|
||||
$l['preorder.order'] = "Vollanschluss";
|
||||
|
||||
$lang['de'] = $l;
|
||||
@@ -257,10 +257,25 @@ function mfLayoutInclude($filename, $folder = "") {
|
||||
include $inc_path;
|
||||
}
|
||||
|
||||
|
||||
function __($string) {
|
||||
/*
|
||||
* global variable $lang to avoid loading it every time it's accessed
|
||||
*/
|
||||
if(!isset($lang)) {
|
||||
$lang = [];
|
||||
include(BASEDIR . "/lang/de.php");
|
||||
}
|
||||
|
||||
function __($string, $prefix = null) {
|
||||
global $lang;
|
||||
|
||||
if(!$lang) {
|
||||
mfLoghandler::singleton()->debug("Loading language file for __() function");
|
||||
include(BASEDIR . "/lang/de.php");
|
||||
}
|
||||
|
||||
if($prefix) {
|
||||
$string = "$prefix.$string";
|
||||
}
|
||||
|
||||
if (array_key_exists($string, $lang['de'])) {
|
||||
return $lang['de'][$string];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user