Filestore Fertiggestellt
Cpeprovisioning Performance Update
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
<?php
|
||||
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"); ?>
|
||||
|
||||
<?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"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">CPE Provisioning</li>
|
||||
</ol>
|
||||
</div>
|
||||
@@ -40,31 +44,43 @@
|
||||
|
||||
<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 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 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']?>" />
|
||||
<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>
|
||||
<a class="btn btn-secondary" href="<?= self::getUrl("Cpeprovisioning") ?>">Filter
|
||||
zurücksetzen</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -75,16 +91,15 @@
|
||||
|
||||
<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">
|
||||
<?php if(count($products)): ?>
|
||||
Zu provisionierende CPEs 1 bis <?=count($products)?>
|
||||
<?php else: ?>
|
||||
Keine zu provisionierende CPEs gefunden
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
@@ -106,44 +121,61 @@
|
||||
<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="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'" : ""?> />
|
||||
<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'" : ""?> />
|
||||
<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'" : ""?> />
|
||||
<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'" : ""?> />
|
||||
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'" : ""?> />
|
||||
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'" : ""?> />
|
||||
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; ?>
|
||||
@@ -197,13 +229,16 @@
|
||||
<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><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])?>">
|
||||
<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 ?>"/>
|
||||
@@ -214,21 +249,42 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="routertype-<?= $product->id ?>">Router</label>
|
||||
<select class="form-control" name="routertype" id="routertype-<?=$product->id?>">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<option value="FritzBox 6490 Cable" <?= ($product->cpeprovisioning->routertype == "FritzBox 6490 Cable") ? "selected='selected'" : "" ?>>
|
||||
FritzBox 6490 Cable (Inet, Phone, IPTV)
|
||||
</option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
@@ -237,15 +293,21 @@
|
||||
|
||||
<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?>" />
|
||||
<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?>" />
|
||||
<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>
|
||||
|
||||
@@ -255,7 +317,9 @@
|
||||
<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'" : ""?> />
|
||||
<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>
|
||||
|
||||
@@ -263,25 +327,34 @@
|
||||
<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'" : ""?> />
|
||||
<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'" : ""?> />
|
||||
<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'" : ""?> />
|
||||
<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'" : ""?> />
|
||||
<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; ?>
|
||||
@@ -289,8 +362,12 @@
|
||||
|
||||
<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'" : ""?> />
|
||||
<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>
|
||||
|
||||
@@ -306,24 +383,34 @@
|
||||
<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?>" />
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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") : ""?>" />
|
||||
<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; ?>
|
||||
@@ -335,14 +422,19 @@
|
||||
<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>
|
||||
<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>
|
||||
<button class="form-control btn btn-primary"
|
||||
form="cpeprovform-<?= $product->id ?>" type="submit"><i
|
||||
class="fas fa-save"></i> Speichern
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -355,9 +447,12 @@
|
||||
<?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)): ?>
|
||||
Zu provisionierende CPEs 1 bis <?=count($products)?>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
<?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">
|
||||
<input type="file" class="form-control-file" id="filestore"
|
||||
name="filestore">
|
||||
</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>
|
||||
|
||||
<?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,22 +131,23 @@
|
||||
{id: $(this).data('id')},
|
||||
|
||||
function (data) {
|
||||
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;">
|
||||
<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();
|
||||
@@ -151,14 +156,13 @@
|
||||
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>`;
|
||||
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>` + 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 + `
|
||||
@@ -168,6 +172,7 @@
|
||||
});
|
||||
expandtr = expandtr + `</table></td></tr>`;
|
||||
dataobject.closest('tr').after(expandtr);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
class CpeprovisioningController extends mfBaseController {
|
||||
|
||||
protected function init() {
|
||||
class CpeprovisioningController extends mfBaseController
|
||||
{
|
||||
protected function init()
|
||||
{
|
||||
$this->needlogin = true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
@@ -14,7 +15,12 @@ class CpeprovisioningController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
protected function indexAction() {
|
||||
protected function indexAction()
|
||||
{
|
||||
$cpecounter = 0;
|
||||
$r = $this->request;
|
||||
$page = $r->s;
|
||||
|
||||
$this->layout()->setTemplate("Cpeprovisioning/Index");
|
||||
$cpeproducts = [];
|
||||
|
||||
@@ -22,8 +28,8 @@ class CpeprovisioningController extends mfBaseController {
|
||||
$filter = $this->getPreparedFilter($this->request->filter);
|
||||
// pagination defaults
|
||||
$pagination = [];
|
||||
$pagination['start'] = 0;
|
||||
$pagination['count'] = 20;
|
||||
$pagination['start'] = $page;
|
||||
$pagination['count'] = 25;
|
||||
$pagination['maxItems'] = 0;
|
||||
|
||||
$order_filter = $filter;
|
||||
@@ -33,9 +39,12 @@ class CpeprovisioningController extends mfBaseController {
|
||||
*/
|
||||
//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)) {
|
||||
@@ -44,24 +53,37 @@ class CpeprovisioningController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($order->terminations) && count($order->terminations)) {
|
||||
if(!$order->cpeprovisioning_enabled && $order->terminations[0]->status->code < TT_TERMSTATUS_CONNECTED) {
|
||||
|
||||
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($order->products as $orderproduct) {
|
||||
if($orderproduct->cpeprovisioning->routerconfig_finished == 1) {
|
||||
foreach ($orderproductsprefetch[$order->id] as $orderproduct) {
|
||||
|
||||
|
||||
if ($orderproduct['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)) {
|
||||
|
||||
$productattributes = $orderproduct['attributes'];
|
||||
|
||||
|
||||
if (is_array($productattributes) && count($productattributes)) {
|
||||
// filter out products without bras_type
|
||||
if(array_key_exists("bras_type", $product->attributes) && $product->attributes['bras_type']->value) {
|
||||
$cpeproducts[] = $orderproduct;
|
||||
|
||||
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;
|
||||
@@ -73,12 +95,14 @@ class CpeprovisioningController extends mfBaseController {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$this->layout()->set("pagination", $pagination);
|
||||
$this->layout()->set("products", $cpeproducts);
|
||||
}
|
||||
|
||||
private function getPreparedFilter($filter) {
|
||||
private function getPreparedFilter($filter)
|
||||
{
|
||||
$new_filter = [];
|
||||
|
||||
if (!is_array($filter)) $filter = [];
|
||||
@@ -118,7 +142,8 @@ class CpeprovisioningController extends mfBaseController {
|
||||
return $new_filter;
|
||||
}
|
||||
|
||||
protected function saveAction() {
|
||||
protected function saveAction()
|
||||
{
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
//var_dump($r);exit;
|
||||
@@ -247,7 +272,6 @@ class CpeprovisioningController extends mfBaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query = [];
|
||||
if (is_numeric($this->request->s) && $this->request->s > 0) {
|
||||
$query["s"] = $this->request->s;
|
||||
|
||||
@@ -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()
|
||||
@@ -69,16 +70,24 @@ class FilestoreController extends mfBaseController
|
||||
}
|
||||
|
||||
$data = [];
|
||||
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,14 +125,18 @@ 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");
|
||||
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,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
class OrderProductModel {
|
||||
class OrderProductModel
|
||||
{
|
||||
public $order_id;
|
||||
public $product_id;
|
||||
public $termination_id;
|
||||
@@ -22,7 +23,8 @@ class OrderProductModel {
|
||||
public $edit = null;
|
||||
|
||||
|
||||
public static function create(Array $data) {
|
||||
public static function create(array $data)
|
||||
{
|
||||
$model = new OrderProduct();
|
||||
|
||||
foreach ($data as $field => $value) {
|
||||
@@ -48,7 +50,8 @@ class OrderProductModel {
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function getOne($id) {
|
||||
public static function getOne($id)
|
||||
{
|
||||
if (!is_numeric($id) || !$id) {
|
||||
throw new Exception("Invalid number", 400);
|
||||
}
|
||||
@@ -63,7 +66,8 @@ class OrderProductModel {
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function getAll() {
|
||||
public static function getAll()
|
||||
{
|
||||
$items = [];
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
@@ -78,7 +82,8 @@ class OrderProductModel {
|
||||
|
||||
}
|
||||
|
||||
public static function getFirst($filter = false) {
|
||||
public static function getFirst($filter = false)
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
@@ -95,7 +100,8 @@ class OrderProductModel {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function search($filter) {
|
||||
public static function search($filter)
|
||||
{
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
@@ -113,7 +119,60 @@ class OrderProductModel {
|
||||
return $items;
|
||||
}
|
||||
|
||||
private static function getSqlFilter($filter) {
|
||||
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;
|
||||
|
||||
@@ -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