Merge branch 'master' into fronkdev

This commit is contained in:
Frank Schubert
2025-02-25 20:34:31 +01:00
11 changed files with 509 additions and 61 deletions

View File

@@ -34,7 +34,6 @@ endforeach;
type="text/css"/>
<link href="<?= self::getResourcePath() ?>css/pages/Calendar/View.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<link href="<?= self::getResourcePath() ?>plugins/summernote/summernote-bs4.min.css" rel="stylesheet">
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/calendar/rrule/rrule.min.js?<?= $git_merge_ts ?>"></script>
@@ -99,6 +98,10 @@ endforeach;
class="btn btn-light btn-light-search top-search-filter"><i
class="fa-duotone fa-solid fa-triangle-exclamation fa-calendar-alert fa-calendar-alert-search"></i>
</button>
<button title="Support Gespräch" data-ctype="6"
class="btn btn-light btn-light-search top-search-filter"><i
class="fa-duotone fa-solid fa-phone-volume fa-calendar-call fa-calendar-call-search"></i>
</button>
</div>
</div>
<?php if (!$rights) : ?>
@@ -370,12 +373,13 @@ endforeach;
<div class="col-3">
<div class="input-group mb-2">
<span title="Erinnerung" class="input-group-text spanwidht">Typ</span>
<select class="form-control form-select" aria-label="Default select" id="type">
<select class="form-control form-select select-2" aria-label="Default select" id="type">
<option value="1">Termin</option>
<option value="2">IBN Xinon</option>
<option value="3">IBN ESTMK</option>
<option value="4">IBN SNOPP</option>
<option value="5">Störung</option>
<option value="6">Support Gespräch</option>
</select>
</div>
</div>
@@ -648,8 +652,7 @@ endforeach;
<div id="output"></div>
<script type="text/javascript" src="<?= self::getResourcePath() ?>plugins/select2/js/i18n/de.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/summernote/summernote-bs4.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/summernote/lang/summernote-de-DE.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/tinymce/tinymce.min.js?<?= $git_merge_ts ?>"></script>
<script>
let requestUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getCalendarEvents']) ?>";

View File

@@ -33,7 +33,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
<form method="get" action="<?=self::getUrl("ConstructionConsent")?>">
<div class="row">
<div class="col-3">
<div class="col-2">
<label class="form-label" for="filter_project_id">Projekt</label>
<select name="filter[project_id]" id="filter_project_id" class="form-control">
<option value="">Alle</option>
@@ -43,15 +43,6 @@ $pagination_entity_name = "Zustimmungserklärungen";
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_object_type">Objektart</label>
<select name="filter[object_type]" id="filter_object_type" class="form-control">
<option value="">Alle</option>
<option value="building" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "building") ? "selected='selected'" : ""?>>Gebäude</option>
<option value="street" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "street") ? "selected='selected'" : ""?>>Straße</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_network">Netzgebiet</label>
<select name="filter[network]" id="filter_network" class="form-control">
@@ -70,14 +61,81 @@ $pagination_entity_name = "Zustimmungserklärungen";
</select>
</div>
<div class="col-1">
<label class="form-label" for="filter_object_type">Objektart</label>
<select name="filter[object_type]" id="filter_object_type" class="form-control">
<option value="">Alle</option>
<option value="building" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "building") ? "selected='selected'" : ""?>>Gebäude</option>
<option value="street" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "street") ? "selected='selected'" : ""?>>Straße</option>
</select>
</div>
<div class="col-1">
<label class="form-label" for="filter_status_light">Ampelstatus</label>
<select name="filter[status_light]" id="filter_status_light" class="form-control">
<option value="">Alle</option>
<option value="blue" <?=(array_key_exists("status_light", $filter) && $filter["status_light"] == "blue") ? "selected='selected'" : ""?>>Blau</option>
<option value="green" <?=(array_key_exists("status_light", $filter) && $filter["status_light"] == "green") ? "selected='selected'" : ""?>>Grün</option>
<option value="yellow" <?=(array_key_exists("status_light", $filter) && $filter["status_light"] == "yellow") ? "selected='selected'" : ""?>>Gelb</option>
<option value="red" <?=(array_key_exists("status_light", $filter) && $filter["status_light"] == "red") ? "selected='selected'" : ""?>>Rot</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_inspection_planner">Begehung Planer</label>
<select name="filter[inspection_planner]" id="filter_inspection_planner" class="form-control">
<option value="">Alle</option>
<option value="!NULL" <?=(array_key_exists("inspection_planner", $filter) && $filter["inspection_planner"] == "!NULL") ? "selected='selected'" : ""?>>Ja</option>
<option value="NULL" <?=(array_key_exists("inspection_planner", $filter) && $filter["inspection_planner"] == "NULL") ? "selected='selected'" : ""?>>Nein</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_conduit_installed_building">Leerrohr im Gebäude</label>
<select name="filter[conduit_installed_building]" id="filter_conduit_installed_building" class="form-control">
<option value="">Alle</option>
<option value="!NULL" <?=(array_key_exists("conduit_installed_building", $filter) && $filter["conduit_installed_building"] == "!NULL") ? "selected='selected'" : ""?>>Ja</option>
<option value="NULL" <?=(array_key_exists("conduit_installed_building", $filter) && $filter["conduit_installed_building"] == "NULL") ? "selected='selected'" : ""?>>Nein</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_conduit_installed_ftu">Leerrohr bis HAK</label>
<select name="filter[conduit_installed_ftu]" id="filter_conduit_installed_ftu" class="form-control">
<option value="">Alle</option>
<option value="!NULL" <?=(array_key_exists("conduit_installed_ftu", $filter) && $filter["conduit_installed_ftu"] == "!NULL") ? "selected='selected'" : ""?>>Ja</option>
<option value="NULL" <?=(array_key_exists("conduit_installed_ftu", $filter) && $filter["conduit_installed_ftu"] == "NULL") ? "selected='selected'" : ""?>>Nein</option>
</select>
</div>
</div>
<div class="row mt-2">
<div class="col-2">
<label class="form-label" for="filter_inhouse_cabling">Inhouse erledigt</label>
<select name="filter[inhouse_cabling]" id="filter_inhouse_cabling" class="form-control">
<option value="">Alle</option>
<option value="!NULL" <?=(array_key_exists("inhouse_cabling", $filter) && $filter["inhouse_cabling"] == "!NULL") ? "selected='selected'" : ""?>>Ja</option>
<option value="NULL" <?=(array_key_exists("inhouse_cabling", $filter) && $filter["inhouse_cabling"] == "NULL") ? "selected='selected'" : ""?>>Nein</option>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_address">Objektadresse</label>
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=(array_key_exists('address', $filter)) ? $filter['address'] : ""?>" />
</div>
<div class="col-2">
<label class="form-label" for="filter_gst">GST</label>
<input type="text" class="form-control" name="filter[gst]" id=filter_gst value="<?=(array_key_exists('gst', $filter)) ? $filter['gst'] : ""?>" />
</div>
</div>
<div class="row mt-2">
<div class="col">
<button type="submit" class="btn btn-primary"><i class="far fa-search fa-fw"></i> Filter anwenden</button>
@@ -89,6 +147,150 @@ $pagination_entity_name = "Zustimmungserklärungen";
</div>
</div>
<?php
// if results are more than 0
if (count($items) > 0) : ?>
<div class="card">
<div class="card-header">
<button class="btn btn-primary collapsed"
type="button"
data-toggle="collapse"
data-target="#collapsibleCard"
aria-expanded="true"
aria-controls="collapsibleCard">
<i class="fas fa-chevron-up chevron-icon"></i>
Statistiken umschalten
</button>
</div>
<div id="collapsibleCard" class="collapse">
<div class="card-body mb-3">
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 10px;">
<?php
$cardConfig = [
[
'key' => null,
'header' => 'Liste der Zustimmungserklärungen',
'icon' => 'fas fa-file-signature',
'text' => 'Objekttyp',
'sub' => [
'Straße/Grundstück ['.$stats['street'].']',
'Gebäude ['.$stats['building'].']'
],
'color' => '#6c757d'
],
[
'key' => 'inspection_planner',
'header' => 'Begehung Planer durchgeführt',
'icon' => 'fas fa-clipboard-check',
'denominator' => $stats['building'] + $stats['street'],
'color' => '#28a745'
],
[
'key' => 'conduit_installed_building',
'header' => 'Leerrohr im Gebäude',
'icon' => 'fas fa-house-user',
'denominator' => $stats['building'],
'color' => '#17a2b8'
],
[
'key' => 'conduit_installed_ftu',
'header' => 'Leerrohr bis HAK',
'icon' => 'fas fa-road',
'denominator' => $stats['street'],
'color' => '#f5b902'
],
[
'key' => 'inhouse_cabling',
'header' => 'Inhouse erledigt',
'icon' => 'fas fa-plug',
'denominator' => $stats['building'],
'color' => '#007bff'
]
];
foreach ($cardConfig as $config) {
$height = 96 + 25 * (isset($config['sub']) ? count($config['sub']) : 0);
$text = $config['key'] ?
$stats[$config['key']].' / '.$config['denominator'].' ('.
round(($config['denominator'] != 0 ? ($stats[$config['key']] / $config['denominator']) : 0) * 100) . '%)' :
$config['text'];
?>
<div class="card">
<div class="card-body p-0" style="background-color: <?= $config['color'] ?>">
<div class="p-2" style="height: <?= $height ?>px">
<div class="float-right">
<i class="<?= $config['icon'] ?> text-white widget-icon font-24"></i>
</div>
<h5 class="text-white font-weight-normal mt-0"><?= $config['header'] ?></h5>
<h3 class="mt-2 text-white"><?= $text ?></h3>
<?php if(isset($config['sub'])): ?>
<div class="text-white font-weight-light tt-dashboard-display-card-sub-header-container">
<?php foreach($config['sub'] as $sub): ?>
<p class="mb-0"><?= $sub ?></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php } ?>
<!-- i have added this to stats and need to show a "traffic light kinda thing round etc" with a grid 2 row 2 col
"status_light_blue" => $status_light_blue,
"status_light_red" => $status_light_red,
"status_light_yellow" => $status_light_yellow,
"status_light_green" => $status_light_green
-->
<div class="card">
<div class="card-body p-0">
<div class="p-2" style="background-color: #f8f9fa">
<h5 class="font-weight-normal mt-0">Anfrageresultat</h5>
</div>
<!-- Horizontal Traffic Light -->
<div style="padding: 20px; background: #333; display: flex; gap: 15px; justify-content: center;">
<div style="display: flex; flex-direction: row; transform: rotate(0deg); gap: 20px;">
<!-- Blue -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #337ab7; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_blue']; ?></span>
</div>
<!-- Red -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #d9534f; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_red']; ?></span>
</div>
<!-- Yellow -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #f0ad4e; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_yellow']; ?></span>
</div>
<!-- Green -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #5cb85c; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_green']; ?></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="card">
<div class="card-body mb-3">

View File

@@ -348,6 +348,7 @@ class CalendarController extends mfBaseController
'text' => $value->customer_number . " " . $text . " - " . $value->street . ", " . $value->zip . " " . $value->city,
'mail' => $value->email,
'mobilenumber' => $mobilenumber,
'spin' => $value->spin,
'location' => $value->street . ", " . $value->zip . " " . $value->city,
'name' => $value->customer_number . " " . $text
);

View File

@@ -47,6 +47,7 @@ class CalendarModel
3 => 'Grüne Kategorie', //ESTMK IBN
4 => 'Lila Kategorie', //Snopp IBN
5 => 'Rote Kategorie', //Störung
6 => 'Rote Kategorie', //Störung
98 => 'Gru00fcne Kategorie', //ESTMK IBN
99 => 'Gr\u00fcne Kategorie', //ESTMK IBN
);

View File

@@ -154,7 +154,7 @@ class ConstructionConsent extends mfBaseModel {
}
return $this->adb_hausnummer;
}
if($name == "adb_strasse") {
if(!$this->adb_strasse_id) return null;
$strasse = new ADBStrasse($this->adb_strasse_id);
@@ -307,7 +307,7 @@ class ConstructionConsent extends mfBaseModel {
return $this->$name;
}
/********************************
* Begin static Model functions
*/
@@ -339,7 +339,7 @@ class ConstructionConsent extends mfBaseModel {
return $model;
}
public static function getAll() {
$items = [];
@@ -377,37 +377,45 @@ class ConstructionConsent extends mfBaseModel {
}
public static function count($filter) {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$sql = "SELECT COUNT(*) as cnt FROM ConstructionConsent
LEFT JOIN ".ADDRESSDB_DBNAME.".view_hausnummer ON (ConstructionConsent.adb_hausnummer_id = view_hausnummer.hausnummer_id)
WHERE $where";
//mfLoghandler::singleton()->debug($sql);
$res = $db->query($sql);
if($db->num_rows($res)) {
$data = $db->fetch_object($res);
return $data->cnt;
}
return 0;
return self::search($filter, false, false, true);
}
public static function search($filter, $limit = false, $order = false) {
//var_dump($filter);exit;
public static function search($filter, $limit = false, $order = false, $returnCount = false) {
$items = [];
if(!$order) {
$order = "adb_hausnummer_id ASC";
}
$having = '';
if(array_key_exists("status_light", $filter) && strlen(trim($filter['status_light'])) > 2) {
$having = " HAVING status_light = '".$filter['status_light']."'";
}
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$sql = "SELECT * FROM ConstructionConsent
LEFT JOIN ".ADDRESSDB_DBNAME.".view_hausnummer ON (ConstructionConsent.adb_hausnummer_id = view_hausnummer.hausnummer_id)
$sql = "SELECT
ConstructionConsent.*,
COALESCE(SUM(cwo.result = 'denied'), 0) AS denied_count,
COALESCE(SUM(cwo.result = 'unresolvable'), 0) AS unresolvable_count,
COALESCE(SUM(cwo.result = 'moved'), 0) AS moved_count,
COALESCE(SUM(cwo.result = 'accepted'), 0) AS accepted_count,
COUNT(cwo.id) AS total_owners,
CASE
WHEN COALESCE(SUM(cwo.result = 'denied'), 0) > 0 THEN 'red'
WHEN COALESCE(SUM(cwo.result = 'unresolvable'), 0) > 0
OR COALESCE(SUM(cwo.result = 'moved'), 0) > 0 THEN 'yellow'
WHEN COALESCE(SUM(cwo.result = 'accepted'), 0) = COUNT(cwo.id)
AND COUNT(cwo.id) > 0 THEN 'green'
ELSE 'blue'
END AS status_light
FROM ConstructionConsent
LEFT JOIN ConstructionConsentOwner cwo ON ConstructionConsent.id = cwo.constructionconsent_id
LEFT JOIN addressdb.view_hausnummer vh ON ConstructionConsent.adb_hausnummer_id = vh.hausnummer_id
LEFT JOIN addressdb.Strasse vs ON ConstructionConsent.adb_strasse_id = vs.id
WHERE $where
GROUP BY ConstructionConsent.id
$having
ORDER BY $order";
if(is_array($limit) && count($limit)) {
@@ -418,16 +426,15 @@ class ConstructionConsent extends mfBaseModel {
}
}
mfLoghandler::singleton()->debug($sql);
$res = $db->query($sql);
if($db->num_rows($res)) {
if ($returnCount) return $db->num_rows($res);
while($data = $db->fetch_object($res)) {
$items[$data->id] = new ConstructionConsent($data);
}
}
return $items;
return $returnCount ? 0 : $items;
}
private static function getSqlFilter($filter) {
@@ -439,7 +446,7 @@ class ConstructionConsent extends mfBaseModel {
$where .= " AND ConstructionConsent.constructionconsentproject_id=$project_id";
}
}
if(array_key_exists("constructionconsentproject_id", $filter)) {
$constructionconsentproject_id = $filter['constructionconsentproject_id'];
if(is_numeric($constructionconsentproject_id)) {
@@ -475,20 +482,34 @@ class ConstructionConsent extends mfBaseModel {
}
}
if(array_key_exists("gst", $filter)) {
$gst = FronkDB::singleton()->escape($filter["gst"]);
if($gst) {
$where .= " AND gst LIKE '%$gst%'";
}
}
if(array_key_exists("address", $filter)) {
$address = FronkDB::singleton()->escape($filter["address"]);
if($address) {
$where .= " AND (vs.name LIKE '%$address%' OR vh.strasse LIKE '%$address%' OR vh.hausnummer LIKE '%$address%' OR vh.plz LIKE '%$address%' OR vh.ortschaft LIKE '%$address%' OR vh.gemeinde LIKE '%$address%')";
}
}
if(array_key_exists("status", $filter)) {
$status = FronkDB::singleton()->escape($filter["status"]);
if($status) {
$where .= " AND status='$status'";
}
}
if(array_key_exists("result", $filter)) {
$result = FronkDB::singleton()->escape($filter["result"]);
if($result) {
$where .= " AND result='$result'";
}
}
if(array_key_exists("owner_name", $filter)) {
$owner_name = FronkDB::singleton()->escape($filter["owner_name"]);
if($owner_name) {
@@ -527,7 +548,43 @@ class ConstructionConsent extends mfBaseModel {
if(array_key_exists("network", $filter)) {
$network = FronkDB::singleton()->escape($filter["network"]);
if($network) {
$where .= " AND view_hausnummer.netzgebiet_id=$network";
$where .= " AND vh.netzgebiet_id=$network";
}
}
if(array_key_exists("inspection_planner", $filter)) {
$inspection_planner = $filter["inspection_planner"];
if($inspection_planner == "!NULL") {
$where .= " AND inspection_planner IS NOT NULL";
} elseif($inspection_planner == "NULL") {
$where .= " AND inspection_planner IS NULL";
}
}
if(array_key_exists("conduit_installed_building", $filter)) {
$conduit_installed_building = $filter["conduit_installed_building"];
if($conduit_installed_building == "!NULL") {
$where .= " AND conduit_installed_building IS NOT NULL";
} elseif($conduit_installed_building == "NULL") {
$where .= " AND conduit_installed_building IS NULL";
}
}
if(array_key_exists("conduit_installed_ftu", $filter)) {
$conduit_installed_ftu = $filter["conduit_installed_ftu"];
if($conduit_installed_ftu == "!NULL") {
$where .= " AND conduit_installed_ftu IS NOT NULL";
} elseif($conduit_installed_ftu == "NULL") {
$where .= " AND conduit_installed_ftu IS NULL";
}
}
if(array_key_exists("inhouse_cabling", $filter)) {
$inhouse_cabling = $filter["inhouse_cabling"];
if($inhouse_cabling == "!NULL") {
$where .= " AND inhouse_cabling IS NOT NULL";
} elseif($inhouse_cabling == "NULL") {
$where .= " AND inhouse_cabling IS NULL";
}
}

View File

@@ -72,6 +72,7 @@ class ConstructionConsentController extends mfBaseController {
$items = ConstructionConsent::search($filter, $pagination);
$this->layout->set("items", $items);
$this->layout()->set("stats", $this->generateStats($filter));
if(array_key_exists("project_id", $filter) && $filter["project_id"]) {
$project = new ConstructionConsentProject($filter["project_id"]);
@@ -936,4 +937,40 @@ class ConstructionConsentController extends mfBaseController {
return ["message" => "ConstructionConsent saved successfully"];
}
}
private function generateStats($baseFilter = array()) {
function getFilteredCount($wantedFilter, $filterValue, $baseFilter) {
if (!empty($baseFilter[$wantedFilter]) && $baseFilter[$wantedFilter] != $filterValue) {
return 0;
} else {
return ConstructionConsent::count(array_merge($baseFilter, [$wantedFilter => $filterValue]));
}
}
$allCount = ConstructionConsent::count($baseFilter);
$streetCount = getFilteredCount("object_type", "street", $baseFilter);
$buildingCount = getFilteredCount("object_type", "building", $baseFilter);
$inspection_planner = getFilteredCount("inspection_planner", "!NULL", $baseFilter);
$conduit_installed_building = getFilteredCount("conduit_installed_building", "!NULL", $baseFilter);
$conduit_installed_ftu = getFilteredCount("conduit_installed_ftu", "!NULL", $baseFilter);
$inhouse_cabling = getFilteredCount("inhouse_cabling", "!NULL", $baseFilter);
$status_light_blue = getFilteredCount("status_light", "blue", $baseFilter);
$status_light_red = getFilteredCount("status_light", "red", $baseFilter);
$status_light_yellow = getFilteredCount("status_light", "yellow", $baseFilter);
$status_light_green = getFilteredCount("status_light", "green", $baseFilter);
return array(
"all" => $allCount,
"street" => $streetCount,
"building" => $buildingCount,
"inspection_planner" => $inspection_planner,
"conduit_installed_building" => $conduit_installed_building,
"conduit_installed_ftu" => $conduit_installed_ftu,
"inhouse_cabling" => $inhouse_cabling,
"status_light_blue" => $status_light_blue,
"status_light_red" => $status_light_red,
"status_light_yellow" => $status_light_yellow,
"status_light_green" => $status_light_green
);
}
}

View File

@@ -270,6 +270,14 @@ class DashboardNewController extends mfBaseController {
$timeline_ont_installiert_300[0][$key]['value'] += $ont_installiert_300_base_value_before_history;
}
$provider_bestellt_500 = $countFunction([">status_code" => "499", "<status_code" => "899"]);
$timeline_provider_bestellt_500 = $this->getTimeline('weekly-provider-bestellt', $campaign_ids, $gemeinde_ids);
$provider_bestellt_500_base_value_before_history = $provider_bestellt_500 - $timeline_provider_bestellt_500[0][count($timeline_provider_bestellt_500[0]) - 1]['value'];
foreach ($timeline_provider_bestellt_500[0] as $key => $value) {
$timeline_provider_bestellt_500[0][$key]['value'] += $provider_bestellt_500_base_value_before_history;
}
self::returnJson([
'type' => 'default',
'order_max_home_addrdb' => $order_max_homes,
@@ -289,10 +297,11 @@ class DashboardNewController extends mfBaseController {
'ont_installiert_300' => $ont_installiert_300,
'vollanschluss_dokumentiert_350' => $countFunction(["status_code" => ["350","500"], "type" => "order"]),
'vorsorge_dokumentiert_351' => $countFunction(["status_code" => ["351","500"], "type" => "provision"]),
'provider_bestellt_500' => $countFunction(["status_code" => "500"]),
'provider_bestellt_500' => $provider_bestellt_500,
'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids),
'timeline_leerrohr' => $timeline_baufortschritt_140,
'timeline_ont_installed' => $timeline_ont_installiert_300
'timeline_ont_installed' => $timeline_ont_installiert_300,
'timeline_provider_bestellt' => $timeline_provider_bestellt_500
]);
@@ -384,6 +393,10 @@ class DashboardNewController extends mfBaseController {
$params['add-where'] = " AND ph.`create` <= UNIX_TIMESTAMP('" . $date . " 23:59:59')";
$value = PreorderModel::countHistoryStatus($params, 500);
break;
case 'weekly-provider-bestellt':
$params['add-where'] = " AND ph.`create` <= UNIX_TIMESTAMP('" . $date . " 23:59:59')";
$value = PreorderModel::countHistoryStatus($params, 500);
break;
}
$newData = [

View File

@@ -782,3 +782,11 @@ td.controls {
width: 100% !important;
max-width: 100% !important;
}
.chevron-icon::before {
content: "\f077";
}
.collapsed .chevron-icon::before {
content: "\f078";
}

View File

@@ -714,4 +714,46 @@ thead .fc-day-today .fc-scrollgrid-sync-inner .fc-col-header-cell-cushion {
}
.fc-event-time {
z-index: 100;
}
.note-editor .dropdown-item {
padding: .15rem 1.2rem;
}
.note-editable p {
line-height: 1.2;
margin-bottom: 0;
}
.tooltip-description p {
margin-bottom: 0;
line-height: 1.2;
}
.note-dropdown-menu {
max-height: 250px !important;
overflow-y: auto !important;
z-index: 99999 !important;
}
.tox-dialog {
z-index: 1060 !important; /* oder ein höherer Wert, je nach Bedarf */
}
.tox .tox-tbtn--select {
max-width: 95px;
}
.fa-calendar-call
{
font-size: 13px;
vertical-align: top;
margin-top: 0px;
}
.fa-calendar-call:after {
color: #ff0000;
opacity: 1;
}
.fa-calendar-call:before {
content: "\f2a0";
color: #000000;
opacity: 1;
}
.fa-calendar-call-search {
font-size: 21px;
margin-top: 0px;
}

View File

@@ -26,8 +26,6 @@ const fileTypeClasses = {
'application/vnd.ms-project': 'fa-file-project',
'application/vnd.ms-visio': 'fa-file-visio',
'application/vnd.ms-publisher': 'fa-file-publisher',
// Weitere Typen und Klassen hinzufügen...
};
let calendar;
let calendarEl = document.getElementById('calendar');
@@ -92,18 +90,15 @@ document.addEventListener('DOMContentLoaded', function () {
$.each($('.calendar-check'), function (index, value) {
if ($(this).prop('checked')) {
rights = true;
resources.push({
id: $(this).data('calendar_id'),
title: $.trim($(this).closest('div').find('label').text()),
order: resourceCounter
});
resourceCounter++;
}
});
$.each(json.data, function (index, value) {
if (!value.timerecording.timerecording) {
allDAy = false;
@@ -375,6 +370,9 @@ document.addEventListener('DOMContentLoaded', function () {
id: info.event.id
}, function (data) {
}).done(function (data) {
if (data.data.description.description) {
tinymce.activeEditor.setContent(data.data.description.description);
}
if (data.data.attachment.attachment) {
let docs = "";
$.each(data.data.attachments.attachments, function (index, value) {
@@ -400,7 +398,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (data.data.type.type == "1") {
$('.customer-div').hide();
$('.ticket-div').hide();
} else if (data.data.type.type == "2" || data.data.type.type == "3" || data.data.type.type == "4") {
} else if (data.data.type.type == "2" || data.data.type.type == "3" || data.data.type.type == "4" || data.data.type.type == "6") {
$('.ticket-div').hide();
$('.customer-div').show();
if (data.data.customer.customer) {
@@ -620,7 +618,7 @@ document.addEventListener('DOMContentLoaded', function () {
$('#name').val(info.event.title);
$('#location').val(info.event.extendedProps.location);
$('#description').val(info.event.extendedProps.description);
// $('#description').val(info.event.extendedProps.description);
$('#delete-event').data('id', info.event.id);
$('#update-event').data('id', info.event.id);
$('#EventModalLabel').data('id', info.event.id);
@@ -698,6 +696,11 @@ document.addEventListener('DOMContentLoaded', function () {
// info.el.querySelector(".fc-event-title").insertAdjacentHTML("afterend", "<div class=\"fc-event-type\"><i class=\"fa-light fa-user-helmet-safety\"></i></div>");
info.el.querySelector(".fc-event-title").insertAdjacentHTML("afterend", "<div class=\"fc-event-type\"><img style='height: 13px;vertical-align: top;' src='/img/snop-logo.png'></div>");
}
if (info.event.extendedProps['event_type'] == '6') {
// info.el.querySelector(".fc-event-title").insertAdjacentHTML("afterend", "<div class=\"fc-event-type\"><i class=\"fa-light fa-user-helmet-safety\"></i></div>");
info.el.querySelector(".fc-event-title").insertAdjacentHTML("afterend", "<div class=\"fc-event-type\"><i class=\"fa-duotone fa-solid fa-phone-volume fa-calendar-call\"></i></div>");
}
if (info.event.extendedProps['event_type'] == '5') {
// info.el.querySelector(".fc-event-title").insertAdjacentHTML("afterend", "<div class=\"fc-event-type\"><i class=\"fa-light fa-user-helmet-safety\"></i></div>");
@@ -1149,14 +1152,18 @@ $(document).ready(function () {
}
});
$('#myModal').on('shown.bs.modal', function () {
$(document).off('focusin.modal');
});
$('#EventModal').on('hide.bs.modal', function (event) {
// $('.select2-multiple').select2('destroy');
// Sobald der Link-Dialog geschlossen wird, fügen wir die "modal-open"-Klasse wieder hinzu, falls noch ein Modal offen ist.
$('#EventModal').on('hidden.bs.modal', function (event) {
tinymce.activeEditor.setContent('');
});
$('#EventModal').on('show.bs.modal', function (event) {
$(document).off('focusin.modal');
$('.attachment-div').empty();
$('#reminder').val('NULL');
$('#type').val('1');
@@ -1201,7 +1208,32 @@ $(document).ready(function () {
$('#add-event').show();
$('#attachments').data('newkey', Math.floor(Math.random() * 10000));
});
tinymce.init({
//font_formats: "Arial=arial,sans-serif;",
selector: '#description',
dialog_container: '#EventModal',
language: 'de',
branding: false,
height: 250,
menubar: false,
forced_root_block_attrs: {
style: 'margin:0;'
},
skin: "tinymce-5",
plugins: ' code link autolink lists table',
paste_block_drop: true,
paste_as_text: true,
paste_data_images: false,
promotion: false,
toolbar1: 'undo redo | styles | bold italic underline strikethrough | fontfamily fontsize forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | table | link unlink',
content_css: "/assets/css/tinymce.css",
content_style: "body { font-family: 'Calibri', sans-serif; }",
font_family_formats: "Calibri=Calibri, sans-serif;Arial=arial,sans-serif; Courier New=courier new,courier,monospace; Georgia=georgia,palatino,serif; Helvetica=helvetica,sans-serif; Lucida Sans=lucida sans unicode,sans-serif; Tahoma=tahoma,arial,helvetica,sans-serif; Times New Roman=times new roman,times,serif",
setup: function (editor) {
}
});
$('body').on('click', '#add-event', function () {
let valid = true;
@@ -1228,7 +1260,7 @@ $(document).ready(function () {
let end = $('#end-date').val() + ' ' + $('#end-time').val();
let title = $('#name').val();
let location = $('#location').val();
let description = $('#description').val();
let description = tinymce.activeEditor.getContent();
let newkey = $('#attachments').data('newkey');
let allday = 0;
let reminder = $('#reminder').val();
@@ -1322,7 +1354,7 @@ $(document).ready(function () {
let end = $('#end-date').val() + ' ' + $('#end-time').val();
let title = $('#name').val();
let location = $('#location').val();
let description = $('#description').val();
let description = tinymce.activeEditor.getContent();
let newkey = $('#attachments').data('newkey');
let allday = 0;
let reminder = $('#reminder').val();
@@ -1706,6 +1738,34 @@ $(document).ready(function () {
};
},
processResults: function (data) {
// Transforms the top-level key of the response object from 'items' to 'results'
return {
results: data.items
};
}
}
});
} else if ($(this).val() == "6") {
$('.customer-div').show();
$('.ticket-div').hide();
$('#customer').select2({
placeholder: "Kunden Suche",
minimumInputLength: 3,
// dropdownParent: $('#EventModal'),
dropdownParent: jQuery('#relContainer2'),
language: "de",
ajax: {
url: requestAddressUrl,
dataType: 'json',
delay: 250,
data: function (params) {
return {
term: params.term,
xinon: 1,
};
},
processResults: function (data) {
// Transforms the top-level key of the response object from 'items' to 'results'
return {
@@ -1832,6 +1892,12 @@ $(document).ready(function () {
$('#customer-info-type-text').val(data.mobilenumber);
}
}
if ($("#customer").select2('data')[0].spin) {// ID deines Editors
var currentContent = tinymce.activeEditor.getContent();
tinymce.activeEditor.setContent(currentContent + '<p style="margin-bottom: 0"><b>Service Pin: </b>' + $("#customer").select2('data')[0].spin + '</p>');
$('#description').val('Service Pin: ' + $("#customer").select2('data')[0].spin + '\n');
}
});
@@ -2351,4 +2417,14 @@ $(document).ready(function () {
});
}
// $('.select-2').select2({
// containerCssClass : 'meine-custom-dropdown', // Klasse für das Dropdown-Menü
// containerCss : "wrap",
// selectionCssClass: 'meine-custom-selection'
// });
$(document).on('focusin', function (e) {
if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
e.stopImmediatePropagation();
}
});
});

View File

@@ -359,7 +359,7 @@ Vue.component('dashboard-default', {
data: dashboardData.timeline[0].filter(item => {
return selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))
}),
color: 'rgb(75, 192, 192)',
color: 'rgb(156, 237, 138)',
fill: true,
yAxisID: 'y',
order: 3
@@ -367,7 +367,7 @@ Vue.component('dashboard-default', {
{
label: 'Leerrohr',
data: dashboardData.timeline_leerrohr[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
color: 'rgb(255, 99, 132)',
color: 'rgb(245, 185, 2)',
fill: false,
yAxisID: 'y',
order: 2
@@ -375,7 +375,15 @@ Vue.component('dashboard-default', {
{
label: 'ONT installiert',
data: dashboardData.timeline_ont_installed[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
color: 'rgb(54, 162, 235)',
color: 'rgb(75, 192, 192)',
fill: false,
yAxisID: 'y',
order: 1
},
{
label: 'Provider bestellt',
data: dashboardData.timeline_provider_bestellt[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
color: 'rgb(11, 179, 108)',
fill: false,
yAxisID: 'y',
order: 1