Filestore Fertiggestellt
Cpeprovisioning Performance Update
This commit is contained in:
@@ -1,381 +1,476 @@
|
||||
<?php
|
||||
if(!is_array($filter)) $filter = [];
|
||||
if (!is_array($filter)) $filter = [];
|
||||
$pagination_baseurl = $this->getUrl($Mod, "Index");
|
||||
$pagination_baseurl_params = ["filter" => $filter];
|
||||
$pagination_entity_name = "Zu provisionierende CPEs";
|
||||
?>
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<?php echo $cpecounter; ?>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
|
||||
<li class="breadcrumb-item active">CPE Provisioning</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">CPE Provisioning</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">CPE Provisioning</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">CPE Provisioning</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<h4 class="header-title mb-3">Filter</h4>
|
||||
|
||||
<form method="get" action="<?=self::getUrl("Cpeprovisioning")?>">
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_network_id">Netzgebiet</label>
|
||||
<select name="filter[network_id]" id="filter_network_id" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach(NetworkModel::getAll() as $fnet): ?>
|
||||
<option value="<?=$fnet->id?>" <?=($filter['network_id'] == $fnet->id) ? "selected='selected'" : ""?>><?=$fnet->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_routerconfig_finished">Provisioningstatus</label>
|
||||
<select name="filter[routerconfig_finished]" id="filter_routerconfig_finished" class="form-control">
|
||||
<option value="0" <?=($filter['routerconfig_finished'] == 0) ? "selected='selected'" : ""?>>Offen</option>
|
||||
<option value="1" <?=($filter['routerconfig_finished'] == 1) ? "selected='selected'" : ""?>>Abgeschlossen</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_hide_delayed_finish">Verzögerte Herstellung</label>
|
||||
<select name="filter[hide_delayed_finish]" id="filter_hide_delayed_finish" class="form-control">
|
||||
<option value="0" <?=(array_key_exists("hide_delayed_finish", $filter) &&$filter['hide_delayed_finish'] != 1) ? "selected='selected'" : ""?>>Anzeigen</option>
|
||||
<option value="1" <?=(!array_key_exists("hide_delayed_finish", $filter) || $filter['hide_delayed_finish'] == 1) ? "selected='selected'" : ""?>>Nicht anzeigen</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_owner">Kunde</label>
|
||||
<input type="text" class="form-control" name="filter[owner]" id="filter_owner" value="<?=$filter['owner']?>" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary">Filter anwenden</button>
|
||||
<a class="btn btn-secondary" href="<?=self::getUrl("Cpeprovisioning")?>">Filter zurücksetzen</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">CPE Provisioning</h4>
|
||||
</div>
|
||||
|
||||
<div class="pagination justify-content-center">
|
||||
<?php if(count($products)): ?>
|
||||
Zu provisionierende CPEs 1 bis <?=count($products)?>
|
||||
<?php else: ?>
|
||||
Keine zu provisionierende CPEs gefunden
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<?php $prov_count = 0; ?>
|
||||
<?php foreach($products as $product): ?>
|
||||
<tr class="<?=($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd"?> bottom-no-border">
|
||||
<th>Netzgebiet</th>
|
||||
<th>Service PIN</th>
|
||||
<th>Kunde</th>
|
||||
<th>Produkt</th>
|
||||
<th>Access Type</th>
|
||||
<th>VLANs</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr class="<?=($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd"?> top-no-border bottom-no-border">
|
||||
<td class="pb-0">
|
||||
<?=($product->termination_id) ? $product->termination->building->network->name : $product->order->owner->zip." ".$product->order->owner->city?>
|
||||
</td>
|
||||
<td class="text-pink pb-0"><?=$product->order->owner->spin?></td>
|
||||
<td class="pb-0"><?=$product->order->owner->getCompanyOrName()?></td>
|
||||
<td class="pb-0"><?=$product->product->name?><?=($product->termination_id) ? " <small class='text-pink'>".$product->termination->code."</small>" : ""?></td>
|
||||
<td class="pb-0"><?=$product->product->attributes['bras_type']->value?> - Down: <?=$product->product->attributes["bw_down"]->value?> / Up: <?=$product->product->attributes["bw_up"]->value?></td>
|
||||
<td class="text-monospace pb-0">
|
||||
<?php if($product->termination_id): ?>
|
||||
<?php if($product->termination->getPop()->vlan_public): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
Public: <strong><?=$product->termination->getPop()->vlan_public?></strong>
|
||||
<input type="checkbox" name="vlan_public" form="cpeprovform-<?=$product->id?>" value="<?=$product->termination->getPop()->vlan_public?>" <?=($product->cpeprovisioning->vlan_public) ? "checked='checked'" : ""?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($product->termination->getPop()->vlan_nat): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
NAT: <strong><?=$product->termination->getPop()->vlan_nat?></strong>
|
||||
<input type="checkbox" name="vlan_nat" form="cpeprovform-<?=$product->id?>" value="<?=$product->termination->getPop()->vlan_nat?>" <?=($product->cpeprovisioning->vlan_nat) ? "checked='checked'" : ""?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($product->termination->getPop()->vlan_ipv6): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
IPv6: <strong><?=$product->termination->getPop()->vlan_ipv6?></strong>
|
||||
<input type="checkbox" name="vlan_ipv6" form="cpeprovform-<?=$product->id?>" value="<?=$product->termination->getPop()->vlan_ipv6?>" <?=($product->cpeprovisioning->vlan_ipv6) ? "checked='checked'" : ""?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php if($product->product->attributes['vlan_default_public']->value): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
Public: <strong><?=$product->product->attributes['vlan_default_public']->value?></strong>
|
||||
<input type="checkbox" name="vlan_public" form="cpeprovform-<?=$product->id?>" value="<?=$product->product->attributes['vlan_default_public']->value?>" <?=($product->cpeprovisioning->vlan_public) ? "checked='checked'" : ""?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($product->product->attributes['vlan_default_nat']->value): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
NAT: <strong><?=$product->product->attributes['vlan_default_nat']->value?></strong>
|
||||
<input type="checkbox" name="vlan_nat" form="cpeprovform-<?=$product->id?>" value="<?=$product->product->attributes['vlan_default_nat']->value?>" <?=($product->cpeprovisioning->vlan_nat) ? "checked='checked'" : ""?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if($product->product->attributes['vlan_default_ipv6']->value): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
IPv6: <strong><?=$product->product->attributes['vlan_default_ipv6']->value?></strong>
|
||||
<input type="checkbox" name="vlan_ipv6" form="cpeprovform-<?=$product->id?>" value="<?=$product->product->attributes['vlan_default_ipv6']->value?>" <?=($product->cpeprovisioning->vlan_public) ? "checked='checked'" : ""?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="pb-0" style="min-width: 180px; font-size: 1.1em;">
|
||||
<?php
|
||||
|
||||
$vot = false;
|
||||
$vo_termin = false;
|
||||
$hw = false;
|
||||
$voip = false;
|
||||
|
||||
foreach($product->order->products as $prod) {
|
||||
if(is_array($prod->product->attributes) && count($prod->product->attributes)) {
|
||||
if(array_key_exists("hw_only", $prod->product->attributes)) {
|
||||
if($prod->product->attributes["hw_only"]->value) {
|
||||
$hw[] = (int)$prod->amount."x ".$prod->product->name;
|
||||
}
|
||||
}
|
||||
if(array_key_exists("voip_chan", $prod->product->attributes)) {
|
||||
if($prod->product->attributes["voip_chan"]->value) {
|
||||
$voip = true;
|
||||
}
|
||||
}
|
||||
if(array_key_exists("vot", $prod->product->attributes)) {
|
||||
if($prod->product->attributes["vot"]->value) {
|
||||
$vot = true;
|
||||
}
|
||||
}
|
||||
if($product->order->install_date) {
|
||||
$vo_termin = $product->order->install_date;
|
||||
}
|
||||
if($hw && $voip_chan) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?=($vot || $vo_termin) ? "<i class='fas fa-tools text-purple mr-2' data-toggletooltip='tooltip' title='Vorortinstallation'></i>" : ""?>
|
||||
<?=($hw) ? "<a href='#' class='fas fa-shopping-bag text-purple mr-2' onclick='return false;' title='Hardware' data-toggle='popover' data-placement='top' data-content='".implode("<br />",$hw)."' ></a>" : ""?>
|
||||
<?=($voip) ? "<i class='fas fa-phone text-purple mr-2' data-toggletooltip='tooltip' title='Voice Produkt vorhanden'></i>" : ""?>
|
||||
<?=($product->order->note) ? "<a href='#' class='fas fa-clipboard-list text-purple' onclick='return false;' data-toggle='popover' data-placement='top' data-content='".str_replace('"', '"', str_replace("\n",'<br />',$product->order->note))."'></a>" : ""?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?=($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd"?> bottom-no-border top-no-border">
|
||||
<td>
|
||||
<?php if($product->termination_id && $product->termination->getPop()): ?>
|
||||
<strong>POP</strong>: <?=$product->termination->getPop()->name?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><strong>Telefon:</strong> <?=$product->order->owner->phone?></td>
|
||||
|
||||
<td><strong>Email:</strong> <?=$product->order->owner->email?></td>
|
||||
<td><a target="_blank" href="<?=self::getUrl("Order", "Index", ["id" => $product->order_id, "addJournal" => 1])?>"><i class="fas fa-scroll"></i> Bestelljournal</a></td>
|
||||
<td colspan="3"></td>
|
||||
|
||||
<tr class="<?=($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd"?> bottom-no-border">
|
||||
<td colspan="6">
|
||||
|
||||
<form method="post" id="cpeprovform-<?=$product->id?>" action="<?=self::getUrl("Cpeprovisioning", "Save", ["filter" => $filter])?>">
|
||||
<input type="hidden" name="id" value="<?=$product->cpeprovisioning->id?>" />
|
||||
<input type="hidden" name="order_id" value="<?=$product->order_id?>" />
|
||||
<input type="hidden" name="orderproduct_id" value="<?=$product->id?>" />
|
||||
<input type="hidden" name="termination_id" value="<?=$product->termination_id?>" />
|
||||
|
||||
<div class="card-body mb-3">
|
||||
<h4 class="header-title mb-3">Filter</h4>
|
||||
|
||||
<form method="get" action="<?= self::getUrl("Cpeprovisioning") ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="routertype-<?=$product->id?>">Router</label>
|
||||
<select class="form-control" name="routertype" id="routertype-<?=$product->id?>">
|
||||
<option></option>
|
||||
<option value="eigener Router" <?=($product->cpeprovisioning->routertype == "eigener Router") ? "selected='selected'" : ""?>>Eigener Router</option>
|
||||
<option value="anderes CPE" <?=($product->cpeprovisioning->routertype == "anderes CPE") ? "selected='selected'" : ""?>>Anderes CPE</option>
|
||||
<?php if(preg_match('/^(pppoe|dhcp)$/', $product->product->attributes['bras_type']->value)): ?>
|
||||
<option value="TP-Link Archer C80" <?=($product->cpeprovisioning->routertype == "TP-Link Archer C80") ? "selected='selected'" : ""?>>TP-Link Archer C80 (Inet, IPTV)</option>
|
||||
<option value="FritzBox 4040" <?=($product->cpeprovisioning->routertype == "FritzBox 4040") ? "selected='selected'" : ""?>>FritzBox 4040 (Inet, IPTV)</option>
|
||||
<option value="FritzBox 7530" <?=($product->cpeprovisioning->routertype == "FritzBox 7530") ? "selected='selected'" : ""?>>FritzBox 7530 (Inet, Phone, IPTV)</option>
|
||||
<option value="FritzBox 7590" <?=($product->cpeprovisioning->routertype == "FritzBox 7590") ? "selected='selected'" : ""?>>FritzBox 7590 (Inet, Phone, IPTV)</option>
|
||||
<?php elseif($product->product->attributes['bras_type']->value = "static"): ?>
|
||||
<option value="Mikrotik HAP AC" <?=($product->cpeprovisioning->routertype == "Mikrotik HAP AC") ? "selected='selected'" : ""?>>Mikrotik HAP AC (Inet, IPTV)</option>
|
||||
<option value="Mikrotik HEX S" <?=($product->cpeprovisioning->routertype == "Mikrotik HEX S") ? "selected='selected'" : ""?>>Mikrotik HEX S (Inet, IPTV)</option>
|
||||
<option value="Mikrotik RB3011" <?=($product->cpeprovisioning->routertype == "Mikrotik RB3011") ? "selected='selected'" : ""?>>Mikrotik RB3011 (Inet, IPTV)</option>
|
||||
<?php elseif($product->product->attributes['bras_type']->value == "cmts"): ?>
|
||||
<option value="FritzBox 6490 Cable" <?=($product->cpeprovisioning->routertype == "FritzBox 6490 Cable") ? "selected='selected'" : ""?>>FritzBox 6490 Cable (Inet, Phone, IPTV)</option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_network_id">Netzgebiet</label>
|
||||
<select name="filter[network_id]" id="filter_network_id" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach (NetworkModel::getAll() as $fnet): ?>
|
||||
<option value="<?= $fnet->id ?>" <?= ($filter['network_id'] == $fnet->id) ? "selected='selected'" : "" ?>><?= $fnet->name ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="wifi_ssid-<?=$product->id?>">WLAN SSID</label>
|
||||
<input class="form-control" type="text" name="wifi_ssid" id="router_wifi_ssid-<?=$product->id?>" value="<?=$product->cpeprovisioning->wifi_ssid?>" />
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_routerconfig_finished">Provisioningstatus</label>
|
||||
<select name="filter[routerconfig_finished]" id="filter_routerconfig_finished"
|
||||
class="form-control">
|
||||
<option value="0" <?= ($filter['routerconfig_finished'] == 0) ? "selected='selected'" : "" ?>>
|
||||
Offen
|
||||
</option>
|
||||
<option value="1" <?= ($filter['routerconfig_finished'] == 1) ? "selected='selected'" : "" ?>>
|
||||
Abgeschlossen
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="wifi_pass-<?=$product->id?>">WPA Key</label>
|
||||
<input class="form-control" type="text" name="wifi_pass" id="router_wifi_pass-<?=$product->id?>" value="<?=$product->cpeprovisioning->wifi_pass?>" />
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_hide_delayed_finish">Verzögerte Herstellung</label>
|
||||
<select name="filter[hide_delayed_finish]" id="filter_hide_delayed_finish"
|
||||
class="form-control">
|
||||
<option value="0" <?= (array_key_exists("hide_delayed_finish", $filter) && $filter['hide_delayed_finish'] != 1) ? "selected='selected'" : "" ?>>
|
||||
Anzeigen
|
||||
</option>
|
||||
<option value="1" <?= (!array_key_exists("hide_delayed_finish", $filter) || $filter['hide_delayed_finish'] == 1) ? "selected='selected'" : "" ?>>
|
||||
Nicht anzeigen
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($vot || $vo_termin): ?>
|
||||
<div class="col-md-5"></div>
|
||||
<?php else: ?>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group text-center">
|
||||
<label class="form-label" for="shipping-<?=$product->id?>">Versandauftrag</label>
|
||||
<input class="form-control" type="checkbox" value="1" name="shipping" id="shipping-<?=$product->id?>" <?=($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : ""?> <?=($product->cpeprovisioning->shipping) ? "checked='checked'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_weight-<?=$product->id?>">Gewicht</label>
|
||||
<input class="form-control" type="text" name="ship_weight" id="ship_weight-<?=$product->id?>" value="<?=$product->cpeprovisioning->ship_weight?>" <?=($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : ""?> />
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_owner">Kunde</label>
|
||||
<input type="text" class="form-control" name="filter[owner]" id="filter_owner"
|
||||
value="<?= $filter['owner'] ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_length-<?=$product->id?>">Länge</label>
|
||||
<input class="form-control" type="text" name="ship_length" id="ship_length-<?=$product->id?>" value="<?=$product->cpeprovisioning->ship_length?>" <?=($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_width-<?=$product->id?>">Breite</label>
|
||||
<input class="form-control" type="text" name="ship_width" id="ship_width-<?=$product->id?>" value="<?=$product->cpeprovisioning->ship_width?>" <?=($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_height-<?=$product->id?>">Höhe</label>
|
||||
<input class="form-control" type="text" name="ship_height" id="ship_height-<?=$product->id?>" value="<?=$product->cpeprovisioning->ship_height?>" <?=($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group text-center">
|
||||
<label class="form-label text-success" for="routerconfig_finished-<?=$product->id?>">Routerkonfig <i class="fas fa-check"></i></label>
|
||||
<input class="form-control" type="checkbox" value="1" name="routerconfig_finished" id="routerconfig_finished-<?=$product->id?>" <?=($product->cpeprovisioning->routerconfig_finished) ? "checked='checked'" : ""?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="<?=($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd"?> top-no-border">
|
||||
<td colspan="6">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="mac-<?=$product->id?>">Router MAC Adresse</label>
|
||||
<input class="form-control" form="cpeprovform-<?=$product->id?>" type="text" name="mac" id="mac-<?=$product->id?>" value="<?=$product->cpeprovisioning->mac?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<?php if($product->termination_id): ?>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="mac-<?=$product->id?>">ONT montiert / ONT SN</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<?php if($product->termination->getWorkflowValue("ont_deployed", "int")): ?>
|
||||
<button type="button" class="btn btn-outline-success" disabled="disabled"><i class="fas fa-check"></i></button>
|
||||
<?php else: ?>
|
||||
<button type="button" class="btn btn-outline-secondary" disabled="disabled"><i class="fas fa-times"></i></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<input class="form-control" form="cpeprovform-<?=$product->id?>" type="text" name="ont_sn" id="ont_sn-<?=$product->id?>" value="<?=($product->termination_id) ? $product->termination->getWorkflowValue("ont_sn", "string") : ""?>" />
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary">Filter anwenden</button>
|
||||
<a class="btn btn-secondary" href="<?= self::getUrl("Cpeprovisioning") ?>">Filter
|
||||
zurücksetzen</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<div class="col-md-1"></div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="note-<?=$product->id?>">Kommentar</label>
|
||||
<textarea class="form-control" form="cpeprovform-<?=$product->id?>" name="note" id="note-<?=$product->id?>"><?=htmlentities($product->cpeprovisioning->note)?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label class="form-label"> </label>
|
||||
<button class="form-control btn btn-primary" form="cpeprovform-<?=$product->id?>" type="submit"><i class="fas fa-save"></i> Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php $prov_count++ ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<div class="pagination justify-content-center">
|
||||
<?php if(count($products)): ?>
|
||||
Zu provisionierende CPEs 1 bis <?=count($products)?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="overflow-auto">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">CPE Provisioning</h4>
|
||||
</div>
|
||||
</div>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
<div class="pagination justify-content-center">
|
||||
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<?php $prov_count = 0; ?>
|
||||
<?php foreach ($products as $product): ?>
|
||||
<tr class="<?= ($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd" ?> bottom-no-border">
|
||||
<th>Netzgebiet</th>
|
||||
<th>Service PIN</th>
|
||||
<th>Kunde</th>
|
||||
<th>Produkt</th>
|
||||
<th>Access Type</th>
|
||||
<th>VLANs</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr class="<?= ($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd" ?> top-no-border bottom-no-border">
|
||||
<td class="pb-0">
|
||||
<?= ($product->termination_id) ? $product->termination->building->network->name : $product->order->owner->zip . " " . $product->order->owner->city ?>
|
||||
</td>
|
||||
<td class="text-pink pb-0"><?= $product->order->owner->spin ?></td>
|
||||
<td class="pb-0"><?= $product->order->owner->getCompanyOrName() ?></td>
|
||||
<td class="pb-0"><?= $product->product->name ?><?= ($product->termination_id) ? " <small class='text-pink'>" . $product->termination->code . "</small>" : "" ?></td>
|
||||
<td class="pb-0"><?= $product->product->attributes['bras_type']->value ?> -
|
||||
Down: <?= $product->product->attributes["bw_down"]->value ?> /
|
||||
Up: <?= $product->product->attributes["bw_up"]->value ?></td>
|
||||
<td class="text-monospace pb-0">
|
||||
<?php if ($product->termination_id): ?>
|
||||
<?php if ($product->termination->getPop()->vlan_public): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
Public: <strong><?= $product->termination->getPop()->vlan_public ?></strong>
|
||||
<input type="checkbox" name="vlan_public"
|
||||
form="cpeprovform-<?= $product->id ?>"
|
||||
value="<?= $product->termination->getPop()->vlan_public ?>" <?= ($product->cpeprovisioning->vlan_public) ? "checked='checked'" : "" ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if ($product->termination->getPop()->vlan_nat): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
NAT: <strong><?= $product->termination->getPop()->vlan_nat ?></strong>
|
||||
<input type="checkbox" name="vlan_nat"
|
||||
form="cpeprovform-<?= $product->id ?>"
|
||||
value="<?= $product->termination->getPop()->vlan_nat ?>" <?= ($product->cpeprovisioning->vlan_nat) ? "checked='checked'" : "" ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if ($product->termination->getPop()->vlan_ipv6): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
IPv6: <strong><?= $product->termination->getPop()->vlan_ipv6 ?></strong>
|
||||
<input type="checkbox" name="vlan_ipv6"
|
||||
form="cpeprovform-<?= $product->id ?>"
|
||||
value="<?= $product->termination->getPop()->vlan_ipv6 ?>" <?= ($product->cpeprovisioning->vlan_ipv6) ? "checked='checked'" : "" ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php if ($product->product->attributes['vlan_default_public']->value): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
Public:
|
||||
<strong><?= $product->product->attributes['vlan_default_public']->value ?></strong>
|
||||
<input type="checkbox" name="vlan_public"
|
||||
form="cpeprovform-<?= $product->id ?>"
|
||||
value="<?= $product->product->attributes['vlan_default_public']->value ?>" <?= ($product->cpeprovisioning->vlan_public) ? "checked='checked'" : "" ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if ($product->product->attributes['vlan_default_nat']->value): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
NAT:
|
||||
<strong><?= $product->product->attributes['vlan_default_nat']->value ?></strong>
|
||||
<input type="checkbox" name="vlan_nat"
|
||||
form="cpeprovform-<?= $product->id ?>"
|
||||
value="<?= $product->product->attributes['vlan_default_nat']->value ?>" <?= ($product->cpeprovisioning->vlan_nat) ? "checked='checked'" : "" ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php if ($product->product->attributes['vlan_default_ipv6']->value): ?>
|
||||
<label class="order-date-pill active pointer mb-0">
|
||||
IPv6:
|
||||
<strong><?= $product->product->attributes['vlan_default_ipv6']->value ?></strong>
|
||||
<input type="checkbox" name="vlan_ipv6"
|
||||
form="cpeprovform-<?= $product->id ?>"
|
||||
value="<?= $product->product->attributes['vlan_default_ipv6']->value ?>" <?= ($product->cpeprovisioning->vlan_public) ? "checked='checked'" : "" ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="pb-0" style="min-width: 180px; font-size: 1.1em;">
|
||||
<?php
|
||||
|
||||
$vot = false;
|
||||
$vo_termin = false;
|
||||
$hw = false;
|
||||
$voip = false;
|
||||
|
||||
foreach ($product->order->products as $prod) {
|
||||
if (is_array($prod->product->attributes) && count($prod->product->attributes)) {
|
||||
if (array_key_exists("hw_only", $prod->product->attributes)) {
|
||||
if ($prod->product->attributes["hw_only"]->value) {
|
||||
$hw[] = (int)$prod->amount . "x " . $prod->product->name;
|
||||
}
|
||||
}
|
||||
if (array_key_exists("voip_chan", $prod->product->attributes)) {
|
||||
if ($prod->product->attributes["voip_chan"]->value) {
|
||||
$voip = true;
|
||||
}
|
||||
}
|
||||
if (array_key_exists("vot", $prod->product->attributes)) {
|
||||
if ($prod->product->attributes["vot"]->value) {
|
||||
$vot = true;
|
||||
}
|
||||
}
|
||||
if ($product->order->install_date) {
|
||||
$vo_termin = $product->order->install_date;
|
||||
}
|
||||
if ($hw && $voip_chan) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?= ($vot || $vo_termin) ? "<i class='fas fa-tools text-purple mr-2' data-toggletooltip='tooltip' title='Vorortinstallation'></i>" : "" ?>
|
||||
<?= ($hw) ? "<a href='#' class='fas fa-shopping-bag text-purple mr-2' onclick='return false;' title='Hardware' data-toggle='popover' data-placement='top' data-content='" . implode("<br />", $hw) . "' ></a>" : "" ?>
|
||||
<?= ($voip) ? "<i class='fas fa-phone text-purple mr-2' data-toggletooltip='tooltip' title='Voice Produkt vorhanden'></i>" : "" ?>
|
||||
<?= ($product->order->note) ? "<a href='#' class='fas fa-clipboard-list text-purple' onclick='return false;' data-toggle='popover' data-placement='top' data-content='" . str_replace('"', '"', str_replace("\n", '<br />', $product->order->note)) . "'></a>" : "" ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?= ($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd" ?> bottom-no-border top-no-border">
|
||||
<td>
|
||||
<?php if ($product->termination_id && $product->termination->getPop()): ?>
|
||||
<strong>POP</strong>: <?= $product->termination->getPop()->name ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><strong>Telefon:</strong> <?= $product->order->owner->phone ?></td>
|
||||
|
||||
<td><strong>Email:</strong> <?= $product->order->owner->email ?></td>
|
||||
<td><a target="_blank"
|
||||
href="<?= self::getUrl("Order", "Index", ["id" => $product->order_id, "addJournal" => 1]) ?>"><i
|
||||
class="fas fa-scroll"></i> Bestelljournal</a></td>
|
||||
<td colspan="3"></td>
|
||||
|
||||
<tr class="<?= ($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd" ?> bottom-no-border">
|
||||
<td colspan="6">
|
||||
|
||||
<form method="post" id="cpeprovform-<?= $product->id ?>"
|
||||
action="<?= self::getUrl("Cpeprovisioning", "Save", ["filter" => $filter]) ?>">
|
||||
<input type="hidden" name="id" value="<?= $product->cpeprovisioning->id ?>"/>
|
||||
<input type="hidden" name="order_id" value="<?= $product->order_id ?>"/>
|
||||
<input type="hidden" name="orderproduct_id" value="<?= $product->id ?>"/>
|
||||
<input type="hidden" name="termination_id" value="<?= $product->termination_id ?>"/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="routertype-<?= $product->id ?>">Router</label>
|
||||
<select class="form-control" name="routertype"
|
||||
id="routertype-<?= $product->id ?>">
|
||||
<option></option>
|
||||
<option value="eigener Router" <?= ($product->cpeprovisioning->routertype == "eigener Router") ? "selected='selected'" : "" ?>>
|
||||
Eigener Router
|
||||
</option>
|
||||
<option value="anderes CPE" <?= ($product->cpeprovisioning->routertype == "anderes CPE") ? "selected='selected'" : "" ?>>
|
||||
Anderes CPE
|
||||
</option>
|
||||
<?php if (preg_match('/^(pppoe|dhcp)$/', $product->product->attributes['bras_type']->value)): ?>
|
||||
<option value="TP-Link Archer C80" <?= ($product->cpeprovisioning->routertype == "TP-Link Archer C80") ? "selected='selected'" : "" ?>>
|
||||
TP-Link Archer C80 (Inet, IPTV)
|
||||
</option>
|
||||
<option value="FritzBox 4040" <?= ($product->cpeprovisioning->routertype == "FritzBox 4040") ? "selected='selected'" : "" ?>>
|
||||
FritzBox 4040 (Inet, IPTV)
|
||||
</option>
|
||||
<option value="FritzBox 7530" <?= ($product->cpeprovisioning->routertype == "FritzBox 7530") ? "selected='selected'" : "" ?>>
|
||||
FritzBox 7530 (Inet, Phone, IPTV)
|
||||
</option>
|
||||
<option value="FritzBox 7590" <?= ($product->cpeprovisioning->routertype == "FritzBox 7590") ? "selected='selected'" : "" ?>>
|
||||
FritzBox 7590 (Inet, Phone, IPTV)
|
||||
</option>
|
||||
<?php elseif ($product->product->attributes['bras_type']->value = "static"): ?>
|
||||
<option value="Mikrotik HAP AC" <?= ($product->cpeprovisioning->routertype == "Mikrotik HAP AC") ? "selected='selected'" : "" ?>>
|
||||
Mikrotik HAP AC (Inet, IPTV)
|
||||
</option>
|
||||
<option value="Mikrotik HEX S" <?= ($product->cpeprovisioning->routertype == "Mikrotik HEX S") ? "selected='selected'" : "" ?>>
|
||||
Mikrotik HEX S (Inet, IPTV)
|
||||
</option>
|
||||
<option value="Mikrotik RB3011" <?= ($product->cpeprovisioning->routertype == "Mikrotik RB3011") ? "selected='selected'" : "" ?>>
|
||||
Mikrotik RB3011 (Inet, IPTV)
|
||||
</option>
|
||||
<?php elseif ($product->product->attributes['bras_type']->value == "cmts"): ?>
|
||||
<option value="FritzBox 6490 Cable" <?= ($product->cpeprovisioning->routertype == "FritzBox 6490 Cable") ? "selected='selected'" : "" ?>>
|
||||
FritzBox 6490 Cable (Inet, Phone, IPTV)
|
||||
</option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="wifi_ssid-<?= $product->id ?>">WLAN
|
||||
SSID</label>
|
||||
<input class="form-control" type="text" name="wifi_ssid"
|
||||
id="router_wifi_ssid-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->wifi_ssid ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="wifi_pass-<?= $product->id ?>">WPA
|
||||
Key</label>
|
||||
<input class="form-control" type="text" name="wifi_pass"
|
||||
id="router_wifi_pass-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->wifi_pass ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($vot || $vo_termin): ?>
|
||||
<div class="col-md-5"></div>
|
||||
<?php else: ?>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group text-center">
|
||||
<label class="form-label" for="shipping-<?= $product->id ?>">Versandauftrag</label>
|
||||
<input class="form-control" type="checkbox" value="1"
|
||||
name="shipping"
|
||||
id="shipping-<?= $product->id ?>" <?= ($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : "" ?> <?= ($product->cpeprovisioning->shipping) ? "checked='checked'" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_weight-<?= $product->id ?>">Gewicht</label>
|
||||
<input class="form-control" type="text" name="ship_weight"
|
||||
id="ship_weight-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->ship_weight ?>" <?= ($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_length-<?= $product->id ?>">Länge</label>
|
||||
<input class="form-control" type="text" name="ship_length"
|
||||
id="ship_length-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->ship_length ?>" <?= ($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="ship_width-<?= $product->id ?>">Breite</label>
|
||||
<input class="form-control" type="text" name="ship_width"
|
||||
id="ship_width-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->ship_width ?>" <?= ($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="form-group">
|
||||
<label class="form-label"
|
||||
for="ship_height-<?= $product->id ?>">Höhe</label>
|
||||
<input class="form-control" type="text" name="ship_height"
|
||||
id="ship_height-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->ship_height ?>" <?= ($vot) ? "disabled='disabled' title='Vorortinstallation bestellt'" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group text-center">
|
||||
<label class="form-label text-success"
|
||||
for="routerconfig_finished-<?= $product->id ?>">Routerkonfig <i
|
||||
class="fas fa-check"></i></label>
|
||||
<input class="form-control" type="checkbox" value="1"
|
||||
name="routerconfig_finished"
|
||||
id="routerconfig_finished-<?= $product->id ?>" <?= ($product->cpeprovisioning->routerconfig_finished) ? "checked='checked'" : "" ?> />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="<?= ($prov_count % 2 == 0) ? "table-bg-even" : "table-bg-odd" ?> top-no-border">
|
||||
<td colspan="6">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="mac-<?= $product->id ?>">Router MAC
|
||||
Adresse</label>
|
||||
<input class="form-control" form="cpeprovform-<?= $product->id ?>"
|
||||
type="text" name="mac" id="mac-<?= $product->id ?>"
|
||||
value="<?= $product->cpeprovisioning->mac ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<?php if ($product->termination_id): ?>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="mac-<?= $product->id ?>">ONT montiert /
|
||||
ONT SN</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<?php if ($product->termination->getWorkflowValue("ont_deployed", "int")): ?>
|
||||
<button type="button" class="btn btn-outline-success"
|
||||
disabled="disabled"><i class="fas fa-check"></i>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
disabled="disabled"><i class="fas fa-times"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<input class="form-control" form="cpeprovform-<?= $product->id ?>"
|
||||
type="text" name="ont_sn" id="ont_sn-<?= $product->id ?>"
|
||||
value="<?= ($product->termination_id) ? $product->termination->getWorkflowValue("ont_sn", "string") : "" ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-1"></div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="note-<?= $product->id ?>">Kommentar</label>
|
||||
<textarea class="form-control" form="cpeprovform-<?= $product->id ?>"
|
||||
name="note"
|
||||
id="note-<?= $product->id ?>"><?= htmlentities($product->cpeprovisioning->note) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label class="form-label"> </label>
|
||||
<button class="form-control btn btn-primary"
|
||||
form="cpeprovform-<?= $product->id ?>" type="submit"><i
|
||||
class="fas fa-save"></i> Speichern
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php $prov_count++ ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<div class="pagination justify-content-center">
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
|
||||
</div>
|
||||
<div class="pagination justify-content-center">
|
||||
<?php if (count($products)): ?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
$('[data-toggle="popover"]').popover({html: true})
|
||||
$('[data-toggle="popover"]').popover({html: true})
|
||||
})
|
||||
});
|
||||
|
||||
$(function () {
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$('[data-toggletooltip="tooltip"]').tooltip({html: true})
|
||||
})
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
})
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
|
||||
@@ -127,7 +127,7 @@ $pagination_entity_name = "Device";
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch=[9];
|
||||
|
||||
var columndefs={ type: 'ip-address', targets: 4 };
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
|
||||
@@ -25,6 +25,9 @@ if (!$me->permissions->isAdmin) {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($mode) && $filestorehistory) {
|
||||
$mode = "edit-history";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
@@ -34,7 +37,7 @@ if (!$me->permissions->isAdmin) {
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?= ($file->id) ? "Datei bearbeiten" : "Neue Datei" ?></h4>
|
||||
<form class="form-horizontal" method="post" enctype="multipart/form-data"
|
||||
action="<?= self::getUrl("Filestore", "save") ?>">
|
||||
action="<?= self::getUrl("Filestore", "save", ["mode" => $mode]) ?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
@@ -44,10 +47,11 @@ if (!$me->permissions->isAdmin) {
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="name">Name *</label>
|
||||
<div class="col-lg-10">
|
||||
<?php if (empty($mode)) : ?>
|
||||
<input value="<?= $file->name ?>" class="form-control" name="name"
|
||||
<?php if (empty($mode) && !$filestorehistory) : ?>
|
||||
<input value="<?= $file->name ?>" class="form-control"
|
||||
name="name"
|
||||
id="name">
|
||||
<?php elseif ($mode == "add-version") : ?>
|
||||
<?php else : ?>
|
||||
<span><?= $file->name ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -55,9 +59,10 @@ if (!$me->permissions->isAdmin) {
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="network_id">Netzgebiet *</label>
|
||||
<div class="col-lg-10">
|
||||
<?php if (empty($mode)) : ?>
|
||||
<select class="select2 form-control " name="network_id" id="network_id">
|
||||
<option> </option>
|
||||
<?php if (empty($mode) && !$filestorehistory) : ?>
|
||||
<select class="select2 form-control "
|
||||
name="network_id" id="network_id">
|
||||
<option value=""> </option>
|
||||
<?php foreach ($networks as $key => $network):
|
||||
if (!$me->permissions->isAdmin) {
|
||||
if (!array_key_exists($network->id, $allowedNetworks)) {
|
||||
@@ -68,7 +73,7 @@ if (!$me->permissions->isAdmin) {
|
||||
<option value="<?= $network->id ?>" <?= ($file->network_id == $network->id) ? "selected='selected'" : "" ?>><?= ($network->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php elseif ($mode == "add-version") :
|
||||
<?php else :
|
||||
foreach ($networks as $key => $network):
|
||||
if (($file->network_id == $network->id)) :
|
||||
$networkName = $network->name;
|
||||
@@ -86,12 +91,15 @@ if (!$me->permissions->isAdmin) {
|
||||
id="description"><?= htmlentities($file->description) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="filestore">Datei</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="file" class="form-control-file" id="filestore" name="filestore">
|
||||
<?php if (empty($mode) || $mode=="add-version") : ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="filestore">Datei</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="file" class="form-control-file" id="filestore"
|
||||
name="filestore">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
|
||||
@@ -50,7 +50,8 @@
|
||||
<th>Name</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Netzgebiet</th>
|
||||
<th>Bearbeiter</th>
|
||||
<th style="min-width: 270px;">Bearbeiter</th>
|
||||
<th>Datum/Uhrzeit</th>
|
||||
<th class="edit-width-large"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
@@ -59,6 +60,7 @@
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -80,19 +82,21 @@
|
||||
?><!-- (-->
|
||||
<?php //= date("d.m.Y , H:i", $file->create)
|
||||
?><!--)</td>-->
|
||||
<td><?= $file->editor->name ?> (<?= date("d.m.Y , H:i", $file->edit) ?>)</td>
|
||||
<td><?= $file->editor->name ?></td>
|
||||
<td><?= date("d.m.Y , H:i", $file->edit) ?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("File", "download", ["id" => $file->file_id]) ?>"><i
|
||||
class="far fa-download" title="Download"></i></a>
|
||||
<a href="<?= self::getUrl("Filestore", "edit", ["id" => $file->id, "mode" => "add-version"]) ?>"><i
|
||||
class="far fa-file-circle-plus" title="Dateiversion hinzufügen"></i></a>
|
||||
|
||||
<i data-id="<?= $file->id ?>" title="Versionsverlauf"
|
||||
class="fa-solid fa-clock-rotate-left history-ico check-history"></i>
|
||||
<?php if (!empty($fileshistory[$file->id])) : ?>
|
||||
<i data-id="<?= $file->id ?>" title="Versionsverlauf"
|
||||
class="fa-solid fa-clock-rotate-left history-ico check-history"></i>
|
||||
<?php endif; ?>
|
||||
<a href="<?= self::getUrl("Filestore", "edit", ["id" => $file->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
|
||||
<?php if ($me->permissions->isAdmin || $me->id == $file->edit_by) : ?>
|
||||
<?php if ($me->permissions->isAdmin) : ?>
|
||||
<a style="float: right"
|
||||
href="<?= self::getUrl("Filestore", "delete", ["id" => $file->id]) ?>"
|
||||
onclick="if(!confirm('Datei wirklich löschen?')) return false;"
|
||||
@@ -114,7 +118,7 @@
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch = [3, 4];
|
||||
var hidesearch = [3, 4, 5];
|
||||
var cstmdom = "flrtip";
|
||||
$(document).ready(function () {
|
||||
$(".check-history").click(function () {
|
||||
@@ -127,47 +131,48 @@
|
||||
{id: $(this).data('id')},
|
||||
|
||||
function (data) {
|
||||
let expandtr;
|
||||
if (data) {
|
||||
let expandtr;
|
||||
|
||||
expandtr = `<tr class="filestore-history-tr filestore-history-` + fsiid + `">
|
||||
<td colspan="5" class="filestore-history-td" >
|
||||
<table class="float-right table table-bordered table-condensed" style="width: auto;">
|
||||
expandtr = `<tr class="filestore-history-tr filestore-history-` + fsiid + `">
|
||||
<td colspan="7" class="filestore-history-td" >
|
||||
<table class="float-right table table-bordered table-condensed" style="width: 1300px;">
|
||||
<thead>
|
||||
<tr style="background-color: #fff">
|
||||
<th>Beschreibung</th>
|
||||
<th>Bearbeiter</th>
|
||||
<th style="width: 270px;">Bearbeiter</th>
|
||||
<th style="width: 235px;">Datum/Uhrzeit</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
`;
|
||||
$.each(data, function (i, item) {
|
||||
let isdelete = '';
|
||||
console.log(item.edit);
|
||||
var date = new Date(item.edit * 1000);
|
||||
var day = "0" + date.getDay();
|
||||
var month = "0" + date.getMonth();
|
||||
var year = date.getFullYear();
|
||||
var hours = date.getHours();
|
||||
var minutes = "0" + date.getMinutes();
|
||||
var formattedTime = day + '.' + month + '.' + year + ', ' + hours + ':' + minutes.substr(-2);
|
||||
if (item.is_delete == "1") {
|
||||
isdelete = `<a style="float: right" href="/Filestore/delete/?id=` + item.file_id + `&s=0" onclick="if(!confirm('Datei wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>`;
|
||||
}
|
||||
$.each(data, function (i, item) {
|
||||
let isdelete = '';
|
||||
var date = new Date(item.edit * 1000);
|
||||
var day = "0" + date.getDay();
|
||||
var month = "0" + date.getMonth();
|
||||
var year = date.getFullYear();
|
||||
var hours = date.getHours();
|
||||
var minutes = "0" + date.getMinutes();
|
||||
var formattedTime = day + '.' + month + '.' + year + ', ' + hours + ':' + minutes.substr(-2);
|
||||
if (item.is_delete == "1") {
|
||||
isdelete = `<a style="float: right" href="/FilestoreHistory/delete/?id=` + item.id + `&s=0" onclick="if(!confirm('Datei wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>`;
|
||||
}
|
||||
|
||||
expandtr = expandtr + `<tr class="filestore-history">
|
||||
|
||||
<td>` + item.description + `</td>
|
||||
|
||||
<td>` + item.workername + ` (` + formattedTime + `)</td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;width: 140px;">
|
||||
<a href="/File/download/?id=` + item.file_id + `&s=0"><i class="far fa-download" title="Download"></i></a>
|
||||
expandtr = expandtr + `<tr class="filestore-history">
|
||||
<td>` + item.description + `</td>
|
||||
<td>` + item.workername + `</td>
|
||||
<td>` + formattedTime + `</td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;width: 140px;">
|
||||
<a href="/File/download/?id=` + item.file_id + `&s=0"><i class="far fa-download" title="Download"></i></a>
|
||||
` + isdelete + `
|
||||
</td>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
});
|
||||
expandtr = expandtr + `</table></td></tr>`;
|
||||
dataobject.closest('tr').after(expandtr);
|
||||
});
|
||||
expandtr = expandtr + `</table></td></tr>`;
|
||||
dataobject.closest('tr').after(expandtr);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,266 +1,290 @@
|
||||
<?php
|
||||
|
||||
class CpeprovisioningController extends mfBaseController {
|
||||
|
||||
protected function init() {
|
||||
$this->needlogin=true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me",$me);
|
||||
|
||||
if(!$me->is(["Admin"])) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
protected function indexAction() {
|
||||
$this->layout()->setTemplate("Cpeprovisioning/Index");
|
||||
$cpeproducts = [];
|
||||
|
||||
$this->layout->set("filter", $this->request->filter);
|
||||
$filter = $this->getPreparedFilter($this->request->filter);
|
||||
// pagination defaults
|
||||
$pagination = [];
|
||||
$pagination['start'] = 0;
|
||||
$pagination['count'] = 20;
|
||||
$pagination['maxItems'] = 0;
|
||||
|
||||
$order_filter = $filter;
|
||||
//var_dump($filter);exit;
|
||||
/*
|
||||
* Get orderproducts in need of sending a CPE
|
||||
*/
|
||||
//var_dump($order_filter);exit;
|
||||
$orders = OrderModel::search($order_filter);
|
||||
|
||||
foreach($orders as $order) {
|
||||
if($order_filter["hide_delayed_finish"] && $order->finish_after) {
|
||||
// show at most 4 weeks before finish_after date
|
||||
//$after_ts = Layout::dateToInt($order->finish_after);
|
||||
if($order->finish_after > date("U") + (31 * 86400)) {
|
||||
$this->log->debug("Before 4 weeks before finish_after oid ".$order->id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($order->terminations) && count($order->terminations)) {
|
||||
if(!$order->cpeprovisioning_enabled && $order->terminations[0]->status->code < TT_TERMSTATUS_CONNECTED) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($order->products as $orderproduct) {
|
||||
if($orderproduct->cpeprovisioning->routerconfig_finished == 1) {
|
||||
if(!$filter['routerconfig_finished']) continue;
|
||||
} else {
|
||||
if($filter['routerconfig_finished']) continue;
|
||||
}
|
||||
$product = $orderproduct->product;
|
||||
|
||||
if(is_array($product->attributes) && count($product->attributes)) {
|
||||
// filter out products without bras_type
|
||||
if(array_key_exists("bras_type", $product->attributes) && $product->attributes['bras_type']->value) {
|
||||
$cpeproducts[] = $orderproduct;
|
||||
} else {
|
||||
$this->log->debug("no bras_type oid ".$order->id);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// ignore products without attributes
|
||||
$this->log->debug("no attributes oid ".$order->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->layout()->set("products", $cpeproducts);
|
||||
}
|
||||
|
||||
private function getPreparedFilter($filter) {
|
||||
$new_filter = [];
|
||||
|
||||
if(!is_array($filter)) $filter = [];
|
||||
|
||||
if(array_key_exists("hide_delayed_finish", $filter)) {
|
||||
if($filter["hide_delayed_finish"] == "1") {
|
||||
$new_filter["hide_delayed_finish"] = true;
|
||||
} else {
|
||||
$new_filter["hide_delayed_finish"] = false;
|
||||
}
|
||||
unset($filter["hide_delayed_finish"]);
|
||||
} else {
|
||||
$new_filter["hide_delayed_finish"] = true;
|
||||
}
|
||||
|
||||
if(array_key_exists("routerconfig_finished", $filter)) {
|
||||
if($filter["routerconfig_finished"] == "1") {
|
||||
$new_filter["routerconfig_finished"] = true;
|
||||
$new_filter["hide_delayed_finish"] = false;
|
||||
} else {
|
||||
$new_filter["routerconfig_finished"] = false;
|
||||
$order_filter["finish_date"] = null;
|
||||
}
|
||||
unset($filter["routerconfig_finished"]);
|
||||
} else {
|
||||
$new_filter["routerconfig_finished"] = false;
|
||||
$order_filter["finish_date"] = null;
|
||||
}
|
||||
|
||||
$new_filter['upgrade'] = 0;
|
||||
|
||||
|
||||
foreach($filter as $name => $value) {
|
||||
$new_filter[$name] = $value;
|
||||
}
|
||||
//var_dump($new_filter);exit;
|
||||
return $new_filter;
|
||||
}
|
||||
|
||||
protected function saveAction() {
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
//var_dump($r);exit;
|
||||
if(is_numeric($id) && $id > 0) {
|
||||
$mode = "edit";
|
||||
$cpeprovisioning = new Cpeprovisioning($id);
|
||||
if(!$cpeprovisioning->id) {
|
||||
$this->layout()->setFlash("Eintrag nicht gefunden", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
} else {
|
||||
$mode = "add";
|
||||
}
|
||||
|
||||
$order_id = $r->order_id;
|
||||
$termination_id = $r->termination_id;
|
||||
if(!(is_numeric($termination_id) && $termination_id > 0) && !(is_numeric($order_id) && $order_id > 0)) {
|
||||
$this->layout()->setFlash("Anschluss oder Bestellung nicht gefunden", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
|
||||
$orderproduct = OrderProductModel::getFirst(["order_id" => $order_id, "termination_id" => $termination_id]);
|
||||
if(!$orderproduct) {
|
||||
$this->layout()->setFlash("Anschluss gehört nicht zur Bestellung", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
|
||||
$prov_data = [];
|
||||
$prov_data["termination_id"] = ($r->termination_id) ? $r->termination_id : null;
|
||||
$prov_data["order_id"] = $r->order_id;
|
||||
$prov_data["orderproduct_id"] = $r->orderproduct_id;
|
||||
$prov_data["routerconfig_finished"] = ($r->routerconfig_finished) ? 1 : 0;
|
||||
$prov_data["routertype"] = $r->routertype;
|
||||
$prov_data["shipping"] = ($r->shipping) ? 1 : 0;
|
||||
$prov_data["wifi_ssid"] = $r->wifi_ssid;
|
||||
$prov_data["wifi_pass"] = $r->wifi_pass;
|
||||
$prov_data["mac"] = $r->mac;
|
||||
$prov_data["vlan_public"] = (strlen($r->vlan_public)) ? $r->vlan_public : null;
|
||||
$prov_data["vlan_nat"] = (strlen($r->vlan_nat)) ? $r->vlan_nat : null;
|
||||
$prov_data["vlan_ipv6"] = (strlen($r->vlan_ipv6)) ? $r->vlan_ipv6 : null;
|
||||
$prov_data["ship_weight"] = (strlen($r->ship_weight)) ? $r->ship_weight : null;
|
||||
$prov_data["ship_length"] = (strlen($r->ship_length)) ? $r->ship_length : null;
|
||||
$prov_data["ship_width"] = (strlen($r->ship_width)) ? $r->ship_width : null;
|
||||
$prov_data["ship_height"] = (strlen($r->ship_height)) ? $r->ship_height : null;
|
||||
$prov_data["note"] = $r->note;
|
||||
|
||||
$prov_data["edit_by"] = $this->me->id;
|
||||
|
||||
if($mode == "add") {
|
||||
$prov_data["create_by"] = $this->me->id;
|
||||
$cpeprovisioning = CpeprovisioningModel::create($prov_data);
|
||||
} else {
|
||||
$cpeprovisioning->update($prov_data);
|
||||
}
|
||||
|
||||
//var_dump($prov_data);exit;
|
||||
$new_id = $cpeprovisioning->save();
|
||||
if(!$new_id) {
|
||||
$this->layout()->setFlash("Fehler beim Speichern", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
|
||||
// saved successfully, if routerconfig_finished make Journal entry in Order
|
||||
|
||||
if($cpeprovisioning->routerconfig_finished) {
|
||||
$order_product = new OrderProduct($r->orderproduct_id);
|
||||
|
||||
if($cpeprovisioning->shipping) {
|
||||
$text = "CPE zu Produkt \"".$order_product->product->name."\" zum Versand vorbereitet.\n\n";
|
||||
} else {
|
||||
$text = "CPE zu Produkt \"".$order_product->product->name."\" vorbereitet für Techniker zur Vorortinstallation.\n\n";
|
||||
}
|
||||
$text .= "Router: ".$cpeprovisioning->routertype."\n";
|
||||
$text .= "Zugangstyp: ".$order_product->product->attributes['bras_type']->value."\n";
|
||||
if($cpeprovisioning->vlan_public) {
|
||||
$text .= "Vlan Public: ".$cpeprovisioning->vlan_public."\n";
|
||||
}
|
||||
if($cpeprovisioning->vlan_nat) {
|
||||
$text .= "Vlan NAT: ".$cpeprovisioning->vlan_nat."\n";
|
||||
}
|
||||
if($cpeprovisioning->vlan_ipv6) {
|
||||
$text .= "Vlan IPv6: ".$cpeprovisioning->vlan_ipv6."\n";
|
||||
}
|
||||
class CpeprovisioningController extends mfBaseController
|
||||
{
|
||||
protected function init()
|
||||
{
|
||||
$this->needlogin = true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me", $me);
|
||||
|
||||
$journal = new OrderJournal();
|
||||
$journal->order_id = $order_id;
|
||||
$journal->text = $text;
|
||||
$journal->create_by = $this->me->id;
|
||||
$journal->edit_by = $this->me->id;
|
||||
|
||||
$journal_id = $journal->save();
|
||||
if(!$journal_id) {
|
||||
$this->layout()->setFlash("Konnte nicht ins Bestelljournal schreiben!", "warning");
|
||||
} else {
|
||||
$cpeprovisioning->order_journal_id = $journal_id;
|
||||
$cpeprovisioning->save();
|
||||
}
|
||||
}
|
||||
|
||||
// save ONT sn
|
||||
if($r->ont_sn) {
|
||||
$termination = new Termination($termination_id);
|
||||
$orig_sn = $termination->getWorkflowvalue("ont_sn", "string");
|
||||
|
||||
if($orig_sn === null) {
|
||||
|
||||
$sn_item = WorkflowitemModel::getFirst(["name" => "ont_sn", "object_type" => "termination"]);
|
||||
//var_dump($sn_item);exit;
|
||||
//var_dump(mfValuecache::singleton()->get("wfItemvalue-item-".$sn_item->id."-object-".$termination_id));exit;
|
||||
if(!$sn_item->id) {
|
||||
$this->log->error("ont_sn workflow item not found");
|
||||
} else {
|
||||
$sn_item->setObjectId($termination_id);
|
||||
$termination->workflowitems["ont_sn"] = $sn_item;
|
||||
//$sn_item->value->setValue($r->ont_sn);
|
||||
|
||||
//$sn_item->value->save();
|
||||
if (!$me->is(["Admin"])) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($r->ont_sn != $orig_sn) {
|
||||
$termination->workflowitems["ont_sn"]->value->setValue($r->ont_sn);
|
||||
$termination->workflowitems["ont_sn"]->value->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query = [];
|
||||
if(is_numeric($this->request->s) && $this->request->s > 0) {
|
||||
$query["s"] = $this->request->s;
|
||||
|
||||
protected function indexAction()
|
||||
{
|
||||
$cpecounter = 0;
|
||||
$r = $this->request;
|
||||
$page = $r->s;
|
||||
|
||||
$this->layout()->setTemplate("Cpeprovisioning/Index");
|
||||
$cpeproducts = [];
|
||||
|
||||
$this->layout->set("filter", $this->request->filter);
|
||||
$filter = $this->getPreparedFilter($this->request->filter);
|
||||
// pagination defaults
|
||||
$pagination = [];
|
||||
$pagination['start'] = $page;
|
||||
$pagination['count'] = 25;
|
||||
$pagination['maxItems'] = 0;
|
||||
|
||||
$order_filter = $filter;
|
||||
//var_dump($filter);exit;
|
||||
/*
|
||||
* Get orderproducts in need of sending a CPE
|
||||
*/
|
||||
//var_dump($order_filter);exit;
|
||||
$orders = OrderModel::search($order_filter);
|
||||
$orderproductsprefetch = OrderProductModel::precache();
|
||||
|
||||
|
||||
foreach ($orders as $order) {
|
||||
if ($order_filter["hide_delayed_finish"] && $order->finish_after) {
|
||||
|
||||
// show at most 4 weeks before finish_after date
|
||||
//$after_ts = Layout::dateToInt($order->finish_after);
|
||||
if ($order->finish_after > date("U") + (31 * 86400)) {
|
||||
$this->log->debug("Before 4 weeks before finish_after oid " . $order->id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_array($orderproductsprefetch['terminations'][$order->id]) && count($orderproductsprefetch['terminations'][$order->id])) {
|
||||
|
||||
if (!$order->cpeprovisioning_enabled && $orderproductsprefetch['terminations'][$order->id][0]['statuscode'] < TT_TERMSTATUS_CONNECTED) {
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($orderproductsprefetch[$order->id] as $orderproduct) {
|
||||
|
||||
|
||||
if ($orderproduct['routerconfig_finished'] == 1) {
|
||||
if (!$filter['routerconfig_finished']) continue;
|
||||
} else {
|
||||
if ($filter['routerconfig_finished']) continue;
|
||||
}
|
||||
|
||||
|
||||
$productattributes = $orderproduct['attributes'];
|
||||
|
||||
|
||||
if (is_array($productattributes) && count($productattributes)) {
|
||||
// filter out products without bras_type
|
||||
|
||||
if (array_key_exists("bras_type", $productattributes) && $productattributes) {
|
||||
$pagination['maxItems']++;
|
||||
if ($pagination['maxItems'] >= $pagination['start']+1 && $pagination['maxItems'] <= $pagination['start'] + $pagination['count']) {
|
||||
$cpeproducts[] = OrderProductModel::getOne($orderproduct['id']);
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->log->debug("no bras_type oid " . $order->id);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// ignore products without attributes
|
||||
$this->log->debug("no attributes oid " . $order->id);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$this->layout()->set("pagination", $pagination);
|
||||
$this->layout()->set("products", $cpeproducts);
|
||||
}
|
||||
if (is_array($this->request->filter)) {
|
||||
$query["filter"] = $this->request->filter;
|
||||
|
||||
private function getPreparedFilter($filter)
|
||||
{
|
||||
$new_filter = [];
|
||||
|
||||
if (!is_array($filter)) $filter = [];
|
||||
|
||||
if (array_key_exists("hide_delayed_finish", $filter)) {
|
||||
if ($filter["hide_delayed_finish"] == "1") {
|
||||
$new_filter["hide_delayed_finish"] = true;
|
||||
} else {
|
||||
$new_filter["hide_delayed_finish"] = false;
|
||||
}
|
||||
unset($filter["hide_delayed_finish"]);
|
||||
} else {
|
||||
$new_filter["hide_delayed_finish"] = true;
|
||||
}
|
||||
|
||||
if (array_key_exists("routerconfig_finished", $filter)) {
|
||||
if ($filter["routerconfig_finished"] == "1") {
|
||||
$new_filter["routerconfig_finished"] = true;
|
||||
$new_filter["hide_delayed_finish"] = false;
|
||||
} else {
|
||||
$new_filter["routerconfig_finished"] = false;
|
||||
$order_filter["finish_date"] = null;
|
||||
}
|
||||
unset($filter["routerconfig_finished"]);
|
||||
} else {
|
||||
$new_filter["routerconfig_finished"] = false;
|
||||
$order_filter["finish_date"] = null;
|
||||
}
|
||||
|
||||
$new_filter['upgrade'] = 0;
|
||||
|
||||
|
||||
foreach ($filter as $name => $value) {
|
||||
$new_filter[$name] = $value;
|
||||
}
|
||||
//var_dump($new_filter);exit;
|
||||
return $new_filter;
|
||||
}
|
||||
|
||||
$qs = http_build_query($query);
|
||||
|
||||
$this->layout()->setFlash("Eintrag erfolgreich gespeichert.", "success");
|
||||
$this->redirect("Cpeprovisioning","Index", $qs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function saveAction()
|
||||
{
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
//var_dump($r);exit;
|
||||
if (is_numeric($id) && $id > 0) {
|
||||
$mode = "edit";
|
||||
$cpeprovisioning = new Cpeprovisioning($id);
|
||||
if (!$cpeprovisioning->id) {
|
||||
$this->layout()->setFlash("Eintrag nicht gefunden", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
} else {
|
||||
$mode = "add";
|
||||
}
|
||||
|
||||
$order_id = $r->order_id;
|
||||
$termination_id = $r->termination_id;
|
||||
if (!(is_numeric($termination_id) && $termination_id > 0) && !(is_numeric($order_id) && $order_id > 0)) {
|
||||
$this->layout()->setFlash("Anschluss oder Bestellung nicht gefunden", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
|
||||
$orderproduct = OrderProductModel::getFirst(["order_id" => $order_id, "termination_id" => $termination_id]);
|
||||
if (!$orderproduct) {
|
||||
$this->layout()->setFlash("Anschluss gehört nicht zur Bestellung", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
|
||||
$prov_data = [];
|
||||
$prov_data["termination_id"] = ($r->termination_id) ? $r->termination_id : null;
|
||||
$prov_data["order_id"] = $r->order_id;
|
||||
$prov_data["orderproduct_id"] = $r->orderproduct_id;
|
||||
$prov_data["routerconfig_finished"] = ($r->routerconfig_finished) ? 1 : 0;
|
||||
$prov_data["routertype"] = $r->routertype;
|
||||
$prov_data["shipping"] = ($r->shipping) ? 1 : 0;
|
||||
$prov_data["wifi_ssid"] = $r->wifi_ssid;
|
||||
$prov_data["wifi_pass"] = $r->wifi_pass;
|
||||
$prov_data["mac"] = $r->mac;
|
||||
$prov_data["vlan_public"] = (strlen($r->vlan_public)) ? $r->vlan_public : null;
|
||||
$prov_data["vlan_nat"] = (strlen($r->vlan_nat)) ? $r->vlan_nat : null;
|
||||
$prov_data["vlan_ipv6"] = (strlen($r->vlan_ipv6)) ? $r->vlan_ipv6 : null;
|
||||
$prov_data["ship_weight"] = (strlen($r->ship_weight)) ? $r->ship_weight : null;
|
||||
$prov_data["ship_length"] = (strlen($r->ship_length)) ? $r->ship_length : null;
|
||||
$prov_data["ship_width"] = (strlen($r->ship_width)) ? $r->ship_width : null;
|
||||
$prov_data["ship_height"] = (strlen($r->ship_height)) ? $r->ship_height : null;
|
||||
$prov_data["note"] = $r->note;
|
||||
|
||||
$prov_data["edit_by"] = $this->me->id;
|
||||
|
||||
if ($mode == "add") {
|
||||
$prov_data["create_by"] = $this->me->id;
|
||||
$cpeprovisioning = CpeprovisioningModel::create($prov_data);
|
||||
} else {
|
||||
$cpeprovisioning->update($prov_data);
|
||||
}
|
||||
|
||||
//var_dump($prov_data);exit;
|
||||
$new_id = $cpeprovisioning->save();
|
||||
if (!$new_id) {
|
||||
$this->layout()->setFlash("Fehler beim Speichern", "error");
|
||||
$this->redirect("Cpeprovisioning");
|
||||
}
|
||||
|
||||
// saved successfully, if routerconfig_finished make Journal entry in Order
|
||||
|
||||
if ($cpeprovisioning->routerconfig_finished) {
|
||||
$order_product = new OrderProduct($r->orderproduct_id);
|
||||
|
||||
if ($cpeprovisioning->shipping) {
|
||||
$text = "CPE zu Produkt \"" . $order_product->product->name . "\" zum Versand vorbereitet.\n\n";
|
||||
} else {
|
||||
$text = "CPE zu Produkt \"" . $order_product->product->name . "\" vorbereitet für Techniker zur Vorortinstallation.\n\n";
|
||||
}
|
||||
$text .= "Router: " . $cpeprovisioning->routertype . "\n";
|
||||
$text .= "Zugangstyp: " . $order_product->product->attributes['bras_type']->value . "\n";
|
||||
if ($cpeprovisioning->vlan_public) {
|
||||
$text .= "Vlan Public: " . $cpeprovisioning->vlan_public . "\n";
|
||||
}
|
||||
if ($cpeprovisioning->vlan_nat) {
|
||||
$text .= "Vlan NAT: " . $cpeprovisioning->vlan_nat . "\n";
|
||||
}
|
||||
if ($cpeprovisioning->vlan_ipv6) {
|
||||
$text .= "Vlan IPv6: " . $cpeprovisioning->vlan_ipv6 . "\n";
|
||||
}
|
||||
|
||||
$journal = new OrderJournal();
|
||||
$journal->order_id = $order_id;
|
||||
$journal->text = $text;
|
||||
$journal->create_by = $this->me->id;
|
||||
$journal->edit_by = $this->me->id;
|
||||
|
||||
$journal_id = $journal->save();
|
||||
if (!$journal_id) {
|
||||
$this->layout()->setFlash("Konnte nicht ins Bestelljournal schreiben!", "warning");
|
||||
} else {
|
||||
$cpeprovisioning->order_journal_id = $journal_id;
|
||||
$cpeprovisioning->save();
|
||||
}
|
||||
}
|
||||
|
||||
// save ONT sn
|
||||
if ($r->ont_sn) {
|
||||
$termination = new Termination($termination_id);
|
||||
$orig_sn = $termination->getWorkflowvalue("ont_sn", "string");
|
||||
|
||||
if ($orig_sn === null) {
|
||||
|
||||
$sn_item = WorkflowitemModel::getFirst(["name" => "ont_sn", "object_type" => "termination"]);
|
||||
//var_dump($sn_item);exit;
|
||||
//var_dump(mfValuecache::singleton()->get("wfItemvalue-item-".$sn_item->id."-object-".$termination_id));exit;
|
||||
if (!$sn_item->id) {
|
||||
$this->log->error("ont_sn workflow item not found");
|
||||
} else {
|
||||
$sn_item->setObjectId($termination_id);
|
||||
$termination->workflowitems["ont_sn"] = $sn_item;
|
||||
//$sn_item->value->setValue($r->ont_sn);
|
||||
|
||||
//$sn_item->value->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($r->ont_sn != $orig_sn) {
|
||||
$termination->workflowitems["ont_sn"]->value->setValue($r->ont_sn);
|
||||
$termination->workflowitems["ont_sn"]->value->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$query = [];
|
||||
if (is_numeric($this->request->s) && $this->request->s > 0) {
|
||||
$query["s"] = $this->request->s;
|
||||
}
|
||||
if (is_array($this->request->filter)) {
|
||||
$query["filter"] = $this->request->filter;
|
||||
}
|
||||
|
||||
$qs = http_build_query($query);
|
||||
|
||||
$this->layout()->setFlash("Eintrag erfolgreich gespeichert.", "success");
|
||||
$this->redirect("Cpeprovisioning", "Index", $qs);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ private $file;
|
||||
return $this->editor;
|
||||
}
|
||||
if($name == "histories") {
|
||||
$this->histories=FilestoreHistoryModel::search(["filestore_id="=>$this->id]);
|
||||
$this->histories=FilestoreHistoryModel::search(["filestore_id$filter"=>$this->id]);
|
||||
return $this->histories;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,15 @@ class FilestoreController extends mfBaseController
|
||||
{
|
||||
$this->layout()->setTemplate("Filestore/Index");
|
||||
$files = FilestoreModel::getAll();
|
||||
$fileshistory = FilestoreHistoryModel::getAll();
|
||||
$networkaddress = NetworkAddressModel::getAll();
|
||||
|
||||
|
||||
$this->layout()->set("files", $files);
|
||||
$this->layout()->set("fileshistory", $fileshistory);
|
||||
$this->layout()->set("networkaddresses", $networkaddress);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function addAction()
|
||||
@@ -40,7 +41,7 @@ class FilestoreController extends mfBaseController
|
||||
{
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
$editmode=$r->mode;
|
||||
$editmode = $r->mode;
|
||||
|
||||
//var_dump($r->get());exit;
|
||||
if (is_numeric($id) && $id > 0) {
|
||||
@@ -69,16 +70,24 @@ class FilestoreController extends mfBaseController
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data['name'] = trim($r->name);
|
||||
$data['network_id'] = trim($r->network_id);
|
||||
if ($editmode != "add-version" && $editmode != "edit-history") {
|
||||
$data['name'] = trim($r->name);
|
||||
$data['network_id'] = trim($r->network_id);
|
||||
}
|
||||
|
||||
$data['description'] = trim($r->description);
|
||||
$data['edit_by'] = trim($this->me->id);
|
||||
|
||||
if (!$data['name']) {
|
||||
if (!$data['name'] && $editmode != "add-version" && $editmode != "edit-history") {
|
||||
$this->layout()->setFlash("Name darf nicht leer sein", "error");
|
||||
$this->redirect("Filestore");
|
||||
}
|
||||
|
||||
if (!$data['network_id'] && $editmode != "add-version" && $editmode != "edit-history") {
|
||||
$this->layout()->setFlash("Netzgebiet darf nicht leer sein", "error");
|
||||
$this->redirect("Filestore");
|
||||
}
|
||||
|
||||
if (array_key_exists("filestore", $_FILES) && !$_FILES['filestore']['error']) {
|
||||
$upload_error = false;
|
||||
|
||||
@@ -116,13 +125,17 @@ class FilestoreController extends mfBaseController
|
||||
}
|
||||
$data['file_id'] = $file_id;
|
||||
|
||||
if ($mode == "edit") {
|
||||
if ($mode == "edit" && $editmode == "add-version") {
|
||||
$fsh = FilestoreHistoryModel::create($dataHistory);
|
||||
}
|
||||
} else {
|
||||
if ($mode == "add") {
|
||||
if ($mode == "add" || $editmode == "add-version") {
|
||||
$this->layout()->setFlash("Keine Datei angegeben", "error");
|
||||
$this->redirect("Filestore", "add");
|
||||
if ($editmode == "add-version") {
|
||||
$this->redirect("Filestore");
|
||||
} else {
|
||||
$this->redirect("Filestore", "add");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -170,7 +183,7 @@ class FilestoreController extends mfBaseController
|
||||
}
|
||||
|
||||
$filestore = new Filestore($id);
|
||||
$filestorehistory = new FilestoreHistory($id);
|
||||
$filestorehistory = FilestoreHistoryModel::getAllhistory($id);;
|
||||
if (!$filestore->id) {
|
||||
$this->layout()->setFlash("Datei nicht gefunden", "error");
|
||||
$this->redirect("Filestore");
|
||||
@@ -198,7 +211,6 @@ class FilestoreController extends mfBaseController
|
||||
foreach ($filstore->histories as $h) {
|
||||
$h->file->delete();
|
||||
$h->delete();
|
||||
|
||||
}
|
||||
$filstore->file->delete();
|
||||
// check if Product is unused
|
||||
@@ -223,7 +235,7 @@ class FilestoreController extends mfBaseController
|
||||
$data[$counter]['workername'] = $history->data->workername;
|
||||
$data[$counter]['workerid'] = $history->data->workerid;
|
||||
$data[$counter]['edit'] = $history->edit;
|
||||
if (trim($this->me->id) == $history->data->workerid) {
|
||||
if (trim($this->me->id) == $history->data->workerid || $this->me->is(["Admin"])) {
|
||||
$data[$counter]['is_delete'] = 1;
|
||||
} else {
|
||||
$data[$counter]['is_delete'] = 0;
|
||||
|
||||
@@ -147,5 +147,19 @@ class FilestoreHistoryController extends mfBaseController
|
||||
|
||||
return $this->addAction();
|
||||
}
|
||||
protected function deleteAction()
|
||||
{
|
||||
$id = $this->request->id;
|
||||
|
||||
|
||||
$filstorehistory = new FilestoreHistory($id);
|
||||
|
||||
if (!$filstorehistory->id || $filstorehistory->id != $id) {
|
||||
$this->layout()->setFlash("Datei nicht gefunden.", "error");
|
||||
$this->redirect("Filestore");
|
||||
}
|
||||
$filstorehistory->delete();
|
||||
$this->redirect("Filestore");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,12 +58,12 @@ class FilestoreHistoryModel
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
$sql = "SELECT FilestoreHistory.* FROM FilestoreHistory
|
||||
LEFT JOIN File ON (FilestoreHistory.file_id = File.id)
|
||||
ORDER BY name";
|
||||
|
||||
";
|
||||
$res = $db->query($sql);
|
||||
if ($db->num_rows($res)) {
|
||||
while ($data = $db->fetch_object($res)) {
|
||||
$items[] = new FilestoreHistory($data);
|
||||
while ($data = $db->fetch_array($res)) {
|
||||
$items[$data['filestore_id']] = 1;
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
@@ -114,12 +114,10 @@ class FilestoreHistoryModel
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
|
||||
$sql = "SELECT FilestoreHistory.* FROM FilestoreHistory
|
||||
LEFT JOIN File ON (FilestoreHistory.file_id = File.id)
|
||||
WHERE $where
|
||||
ORDER BY name";
|
||||
|
||||
$res = $db->query($sql);
|
||||
|
||||
if ($db->num_rows($res)) {
|
||||
|
||||
@@ -1,145 +1,204 @@
|
||||
<?php
|
||||
|
||||
class OrderProductModel {
|
||||
public $order_id;
|
||||
public $product_id;
|
||||
public $termination_id;
|
||||
public $upgrade;
|
||||
public $amount;
|
||||
public $pos;
|
||||
public $description;
|
||||
public $price;
|
||||
public $price_setup;
|
||||
public $price_nne;
|
||||
public $price_nbe;
|
||||
public $billing_delay;
|
||||
public $billing_period;
|
||||
public $note;
|
||||
|
||||
public $create_by = null;
|
||||
public $edit_by = null;
|
||||
public $create = null;
|
||||
public $edit = null;
|
||||
|
||||
class OrderProductModel
|
||||
{
|
||||
public $order_id;
|
||||
public $product_id;
|
||||
public $termination_id;
|
||||
public $upgrade;
|
||||
public $amount;
|
||||
public $pos;
|
||||
public $description;
|
||||
public $price;
|
||||
public $price_setup;
|
||||
public $price_nne;
|
||||
public $price_nbe;
|
||||
public $billing_delay;
|
||||
public $billing_period;
|
||||
public $note;
|
||||
|
||||
public static function create(Array $data) {
|
||||
$model = new OrderProduct();
|
||||
|
||||
foreach($data as $field => $value) {
|
||||
if(property_exists(get_called_class(), $field)) {
|
||||
$model->$field = $value;
|
||||
}
|
||||
public $create_by = null;
|
||||
public $edit_by = null;
|
||||
public $create = null;
|
||||
public $edit = null;
|
||||
|
||||
|
||||
public static function create(array $data)
|
||||
{
|
||||
$model = new OrderProduct();
|
||||
|
||||
foreach ($data as $field => $value) {
|
||||
if (property_exists(get_called_class(), $field)) {
|
||||
$model->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!array_key_exists("note", $data)) {
|
||||
$model->note = "";
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
if(!array_key_exists("note", $data)) {
|
||||
$model->note = "";
|
||||
}
|
||||
|
||||
$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 getOne($id) {
|
||||
if(!is_numeric($id) || !$id) {
|
||||
throw new Exception("Invalid number", 400);
|
||||
}
|
||||
$item = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("OrderProduct", "*", "id=$id LIMIT 1");
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new OrderProduct($data);
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function getAll() {
|
||||
$items = [];
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("OrderProduct", "*", "1=1 ORDER BY order_id, pos, product_id, description");
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new OrderProduct($data);
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
public static function getFirst($filter = false) {
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$res = $db->select("OrderProduct", "*", "$where ORDER BY order_id, pos, product_id, description");
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new OrderProduct($data);
|
||||
if($item->id) {
|
||||
|
||||
public static function getOne($id)
|
||||
{
|
||||
if (!is_numeric($id) || !$id) {
|
||||
throw new Exception("Invalid number", 400);
|
||||
}
|
||||
$item = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("OrderProduct", "*", "id=$id LIMIT 1");
|
||||
if ($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new OrderProduct($data);
|
||||
}
|
||||
return $item;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function search($filter) {
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT * FROM OrderProduct WHERE $where ORDER BY order_id, pos, product_id, description";
|
||||
//mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new OrderProduct($data);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
private static function getSqlFilter($filter) {
|
||||
$where = "1=1 ";
|
||||
|
||||
//var_dump($filter);exit;
|
||||
if(array_key_exists("order_id", $filter)) {
|
||||
$order_id = $filter['order_id'];
|
||||
if(is_numeric($order_id)) {
|
||||
$where .= " AND order_id=$order_id";
|
||||
}
|
||||
public static function getAll()
|
||||
{
|
||||
$items = [];
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("OrderProduct", "*", "1=1 ORDER BY order_id, pos, product_id, description");
|
||||
if ($db->num_rows($res)) {
|
||||
while ($data = $db->fetch_object($res)) {
|
||||
$items[] = new OrderProduct($data);
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
if(array_key_exists("product_id", $filter)) {
|
||||
$product_id = $filter['product_id'];
|
||||
if(is_numeric($product_id)) {
|
||||
$where .= " AND order_id=$product_id";
|
||||
}
|
||||
|
||||
public static function getFirst($filter = false)
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$res = $db->select("OrderProduct", "*", "$where ORDER BY order_id, pos, product_id, description");
|
||||
if ($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new OrderProduct($data);
|
||||
if ($item->id) {
|
||||
return $item;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if(array_key_exists("termination_id", $filter)) {
|
||||
$termination_id = $filter['termination_id'];
|
||||
if(is_numeric($termination_id)) {
|
||||
$where .= " AND termination_id=$termination_id";
|
||||
}
|
||||
|
||||
public static function search($filter)
|
||||
{
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT * FROM OrderProduct WHERE $where ORDER BY order_id, pos, product_id, description";
|
||||
//mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if ($db->num_rows($res)) {
|
||||
while ($data = $db->fetch_object($res)) {
|
||||
$items[] = new OrderProduct($data);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
public static function precache()
|
||||
{
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$sql = "SELECT `OrderProduct`.`id`, `OrderProduct`.`order_id`, `OrderProduct`.`product_id`, `OrderProduct`.`termination_id`
|
||||
,`ProducttechAttribute`.`name` ProducttechAttributename,
|
||||
`routerconfig_finished`,
|
||||
`Termination`.`id` `terminationid`,
|
||||
`Terminationstatus`.`code` `statuscode`
|
||||
FROM `OrderProduct`
|
||||
INNER JOIN `Product` ON (`OrderProduct`.`product_id`=`Product`.`id`)
|
||||
INNER JOIN `Producttech` ON (`Producttech`.`id`=`Product`.`producttech_id`)
|
||||
INNER JOIN `ProductAttribute` ON (`ProductAttribute`.`product_id`=`Product`.`id`)
|
||||
INNER JOIN `ProducttechAttribute` ON (`ProductAttribute`.`producttechattribute_id`=`ProducttechAttribute`.`id`)
|
||||
LEFT JOIN `Termination` ON (`OrderProduct`.`termination_id`=`Termination`.`id`)
|
||||
LEFT JOIN `Terminationstatus` ON (`Terminationstatus`.`id` = `Termination`.`status_id`)
|
||||
LEFT JOIN `Cpeprovisioning` ON (`Cpeprovisioning`.`orderproduct_id`=`OrderProduct`.`id`)
|
||||
";
|
||||
//mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if ($db->num_rows($res)) {
|
||||
$oldProduct = "";
|
||||
$oldOrder = "";
|
||||
while ($data = $db->fetch_array($res)) {
|
||||
if ($data['terminationid'])
|
||||
{
|
||||
$items['terminations'][$data['order_id']][]['statuscode']=$data['statuscode'];
|
||||
}
|
||||
if ($oldOrder != $data['order_id']) {
|
||||
$items[$data['order_id']]['statuscode'] = $data['statuscode'];
|
||||
}
|
||||
if ($oldProduct != $data['id']) {
|
||||
$items[$data['order_id']][$data['id']]['id'] = $data['id'];
|
||||
$items[$data['order_id']][$data['id']]['product_id'] = $data['product_id'];
|
||||
$items[$data['order_id']][$data['id']]['termination_id'] = $data['termination_id'];
|
||||
$items[$data['order_id']][$data['id']]['routerconfig_finished'] = $data['routerconfig_finished'];
|
||||
}
|
||||
if ($data['routerconfig_finished'] == 1) {
|
||||
$items[$data['order_id']][$data['id']]['routerconfig_finished'] = $data['routerconfig_finished'];
|
||||
}
|
||||
|
||||
$items[$data['order_id']][$data['id']]['attributes'][$data['ProducttechAttributename']] = $data['ProducttechAttributename'];
|
||||
$oldProduct = $data['id'];
|
||||
$oldOrder = $data['order_id'];
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
private static function getSqlFilter($filter)
|
||||
{
|
||||
$where = "1=1 ";
|
||||
|
||||
//var_dump($filter);exit;
|
||||
if (array_key_exists("order_id", $filter)) {
|
||||
$order_id = $filter['order_id'];
|
||||
if (is_numeric($order_id)) {
|
||||
$where .= " AND order_id=$order_id";
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists("product_id", $filter)) {
|
||||
$product_id = $filter['product_id'];
|
||||
if (is_numeric($product_id)) {
|
||||
$where .= " AND order_id=$product_id";
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists("termination_id", $filter)) {
|
||||
$termination_id = $filter['termination_id'];
|
||||
if (is_numeric($termination_id)) {
|
||||
$where .= " AND termination_id=$termination_id";
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,12 @@ if (typeof cstmdom === "undefined") {
|
||||
cstmdom = "flBrtip";
|
||||
|
||||
}
|
||||
if (typeof columndefs === "undefined") {
|
||||
var columndefs;
|
||||
columndefs = "";
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#filterrow th').each(function (i) {
|
||||
let title = $('#datatable thead th').eq($(this).index()).text();
|
||||
@@ -29,6 +35,8 @@ table = $('#datatable').DataTable({
|
||||
className: 'btn-success margina'
|
||||
|
||||
}
|
||||
], columnDefs: [
|
||||
columndefs
|
||||
],
|
||||
"language": {
|
||||
"url": "/datatables/json/german.json"
|
||||
|
||||
Reference in New Issue
Block a user