Merge branch 'spidev' into 'master'

Pop Updates

See merge request fronk/thetool!1953
This commit is contained in:
Daniel Spitzer
2025-12-14 19:00:42 +00:00
6 changed files with 79 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
type="text/css"/>
<link href="<?= self::getResourcePath() ?>assets/css/print.min.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css">-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css">
<link href="<?= self::getResourcePath() ?>css/pages/Pop/Detail.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<div class="row">
@@ -66,6 +66,10 @@ if (!empty(trim($pops->vlan_ipv6)))
<th>Name</th>
<td><?= $pops->name ?> </td>
</tr>
<tr>
<th>Kategorie</th>
<td><?= $categoryArray[$pops->category]['name']." (".$categoryArray[$pops->category]['comment'].")" ?> </td>
</tr>
<tr>
<th>Standort</th>
<td>
@@ -614,11 +618,11 @@ if (!empty(trim($pops->vlan_ipv6)))
<div class="modal-header">
<h5 class="modal-title" id="fiberPlanCableModalLabel">
<i class="fa fa-cable"></i> Kabel-Details
<!-- <button class="btn btn-primary btn-sm ml-3"-->
<!-- id="modal-edit-cable-btn"-->
<!-- style="display: none;">-->
<!-- <i class="fas fa-table"></i> Excel-Editor-->
<!-- </button>-->
<button class="btn btn-primary btn-sm ml-3"
id="modal-edit-cable-btn"
style="display: none;">
<i class="fas fa-table"></i> Excel-Editor
</button>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
@@ -718,12 +722,12 @@ if (!empty(trim($pops->vlan_ipv6)))
$('[data-toggle="popover"]').popover();
});
</script>
<!--<script src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>-->
<script src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>
<script type="text/javascript" src="<?= self::getResourcePath() ?>assets/js/print.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript" src="<?= self::getResourcePath() ?>js/pages/pop/detail.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript" src="<?= self::getResourcePath() ?>js/pages/pop/fiber.js?<?= $git_merge_ts ?>"></script>
<!--<script type="text/javascript"-->
<!-- src="--><?php //= self::getResourcePath() ?><!--js/pages/pop/fibertable.js?--><?php //= $git_merge_ts ?><!--"></script>-->
<script type="text/javascript"
src="<?= self::getResourcePath() ?>js/pages/pop/fibertable.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= $git_merge_ts ?>"></script>

View File

@@ -82,7 +82,17 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") {
value="<?= $pop->name ?>">
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="category">Kategorie</label>
<div class="col-lg-3">
<select class="select2 form-control " name="category"
id="category">
<?php foreach ($categoryArray as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $pop->category) ? "selected='selected'" : "" ?>><?= $value['name']." (".$value['comment'].")" ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="gps_lat">GPS Breite</label>
<div class="col-lg-10">

View File

@@ -30,6 +30,7 @@ class PopController extends mfBaseController
return [
"id" => $pop->id,
"name" => $pop->name,
"category" => $pop->category,
"networkArea" => $pop->networks,
"location" => $pop->location,
"state" => $pop->state,
@@ -94,7 +95,9 @@ class PopController extends mfBaseController
$this->layout()->set("cables_json", json_encode($cables_json));
$popnetwork = PopNetworkModel::getbyPopid($id);
$stateArray = PopModel::$stateArray;
$categoryArray=PopModel::$categoryArray;
$this->layout()->set("stateArray", $stateArray);
$this->layout()->set("categoryArray", $categoryArray);
$this->layout()->set("popnetwork", implode(', ', $popnetwork['name']));
$this->layout()->set("popnetwork_ids", json_encode($popnetwork['network_id']));
$this->layout()->setTemplate("Pop/Detail");
@@ -1105,7 +1108,9 @@ class PopController extends mfBaseController
protected function addAction()
{
$stateArray = PopModel::$stateArray;
$categoryArray=PopModel::$categoryArray;
$this->layout()->set("stateArray", $stateArray);
$this->layout()->set("categoryArray", $categoryArray);
$this->layout()->setTemplate("Pop/Form");
$this->layout()->set("networks", NetworkModel::getAll());
@@ -1166,6 +1171,7 @@ class PopController extends mfBaseController
$data['name'] = $r->name;
$data['category']=$r->category;
$data['gps_lat'] = ($r->gps_lat) ? $r->gps_lat : null;
$data['gps_long'] = ($r->gps_long) ? $r->gps_long : null;
$data['location'] = $r->location;

View File

@@ -3,6 +3,7 @@
class PopModel
{
public $name = null;
public $category=null;
public $network_id = null;
public $gps_lat = null;
public $gps_long = null;
@@ -30,6 +31,14 @@ class PopModel
5 => "von Techniker abgenommen (Altbestand)",
];
public static $categoryArray = [
1 => array('name' => 'Outdoor', 'comment' => 'Kasten/Schrank'),
2 => array('name' => 'Indoor', 'comment' => 'Keller Gebäude'),
3 => array('name' => 'Sender/Funk', 'comment' => 'Sendemast'),
4 => array('name' => 'Container', 'comment' => 'Garage, Container')
];
public static function find($data)
{

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddPopFieldCategory extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$timerecordingCategory = $this->table("Pop");
$timerecordingCategory->addColumn("category", "integer", ["null" => false, "default" => 1, "after" => "name"]);
$timerecordingCategory->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('Pop');
$table->removeColumn("category");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -1,5 +1,6 @@
Vue.component('Pop', {
//language=Vue
// g
template: `
<tt-card>
@@ -37,7 +38,7 @@ Vue.component('Pop', {
</template>
<template v-slot:actions="{ row }">
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Pop/edit/?id=' + row.id"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Pop/edit/?id=' + row.id +'&returnto=Pop'"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a v-if="row.folder_link && window.TT_CONFIG.IS_ADMIN === '1'" :href="row.folder_link" target="_blank"><i class="fas fa-folder" title="Ordner"></i></a>
<a :href="window['TT_CONFIG']['BASE_URL'] +'/Pop/delete/?id=' + row.id" onclick="if(!confirm('Device wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash "></i></a>
</template>
@@ -55,6 +56,11 @@ Vue.component('Pop', {
defaultPageSize: 25,
headers: [
{text: 'Name', key: 'name', priority: 10},
{text: 'Kategorie', key: 'category', class: 'text-center', priority: 4, filter: 'select', filterOptions: [
{value: '1', text: 'Outdoor (Kasten/Schrank)'},
{value: '2', text: 'Indoor (Keller Gebäude)'},
{value: '3', text: 'Sender/Funk (Sendemast)'},
{value: '4', text: 'Container (Garage, Container)'}]},
{text: 'Netzgebiet', key: 'networkArea', class: 'text-center',
// TODO: fix autocomplete Filter
// filter: 'autocomplete',