Kalender Update
* Neuer IBN Typ IBN SBIDI * Neue Kundenabfrage für SBIDI
This commit is contained in:
@@ -20,10 +20,19 @@ if (!is_array($Calendar_colors[$Calendar[0]->go_calendar_id])) {
|
||||
$Calendar_colors[$Calendar[0]->go_calendar_id]['txtcolor'] = '#000000';
|
||||
$colorCounter++;
|
||||
}
|
||||
//$specialCalendars = array(999 => 'Abwesenheiten', 998 => 'Geburtstage', 997 => 'Feiertage',30 => 'Anhänger Klein SO-421DH', 31 => 'Einblasmaschine Bagela', 32 => 'Einblasmaschine Jetting', 33 => 'JetBus SO-786DK', 34 => 'Kabeltransporter SO-373AR', 35 => 'Kofferanhänger SO-512CC', 36 => 'Kompressor SO-142BF');
|
||||
$specialCalendars = array(999 => 'Abwesenheiten', 998 => 'Geburtstage', 997 => 'Feiertage');
|
||||
$carCalendars = array();
|
||||
foreach ($rights as $key => $right) :
|
||||
$CalArray[$CalendarAll[$key]->user->name] = $key;
|
||||
endforeach;
|
||||
//$CalArray['Anhänger Klein SO-421DH'] = 30;
|
||||
//$CalArray['Einblasmaschine Bagela'] = 31;
|
||||
//$CalArray['Einblasmaschine Jetting'] = 32;
|
||||
//$CalArray['JetBus SO-786DK'] = 33;
|
||||
//$CalArray['Kabeltransporter SO-373AR'] = 34;
|
||||
//$CalArray['Kofferanhänger SO-512CC'] = 35;
|
||||
//$CalArray['Kompressor SO-142BF'] = 36;
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
@@ -91,11 +100,17 @@ endforeach;
|
||||
class="logo-top-search"
|
||||
src='/img/estmk_logo.png'>
|
||||
</button>
|
||||
<button title="SNOPP Inbetriebnahmen"
|
||||
<button title="Sbidi Inbetriebnahmen"
|
||||
class="btn btn-light btn-light-search top-search-filter" data-ctype="7"><img
|
||||
class="logo-top-search"
|
||||
src='/img/sbidi-logo.png'>
|
||||
</button>
|
||||
<button title="SNOPP"
|
||||
class="btn btn-light btn-light-search top-search-filter" data-ctype="4"><img
|
||||
class="logo-top-search"
|
||||
src='/img/snop-logo.png'>
|
||||
</button>
|
||||
|
||||
<button title="Störungen" data-ctype="5"
|
||||
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>
|
||||
@@ -243,6 +258,7 @@ endforeach;
|
||||
|
||||
foreach ($rights as $key => $right) :
|
||||
$CalArray[$CalendarAll[$key]->user->name] = $key;
|
||||
|
||||
if (!is_array($Calendar_colors[$key])) {
|
||||
$Calendar_colors[$key]['bgcolor'] = $standardCalendarColors[$colorCounter];
|
||||
$Calendar_colors[$key]['txtcolor'] = '#ffffff';
|
||||
@@ -387,9 +403,10 @@ endforeach;
|
||||
<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="7">IBN SBIDI</option>
|
||||
<option value="4">SNOPP</option>
|
||||
<option value="5">Störung</option>
|
||||
<option value="6">Support Gespräch</option>
|
||||
<option value="6">Support Gespräch </option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -767,6 +784,7 @@ endforeach;
|
||||
let requestEventAttachmentTmpDeleteUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'deleteCalendarEventAttachmentTmp']) ?>";
|
||||
let requestEventAttachmentUploadUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'uploadCalendarEventAttachment']) ?>";
|
||||
let requestAddressUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getAddress']) ?>";
|
||||
let requestAddressSbidiUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getAddressSbidi']) ?>"
|
||||
let requestTicketUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getTicket']) ?>";
|
||||
let requestInsertUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'insertCalendarEvent']) ?>";
|
||||
let requestUpdateUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'updateCalendarEvent']) ?>";
|
||||
|
||||
@@ -115,6 +115,10 @@ class CalendarController extends mfBaseController
|
||||
$r = $this->request;
|
||||
$this->getAddress($r);
|
||||
die();
|
||||
case "getAddressSbidi":
|
||||
$r = $this->request;
|
||||
$this->getAddressSbidi($r);
|
||||
die();
|
||||
case "getTicket";
|
||||
$r = $this->request;
|
||||
$this->getTicket($r);
|
||||
@@ -187,7 +191,6 @@ class CalendarController extends mfBaseController
|
||||
}
|
||||
$json = json_encode($json);
|
||||
echo $json;
|
||||
|
||||
die();
|
||||
case "deleteCalendarEventAttachmentTmp":
|
||||
$r = $this->request;
|
||||
@@ -313,6 +316,7 @@ class CalendarController extends mfBaseController
|
||||
|
||||
if ($value->mobile) {
|
||||
foreach ($mobiles as $mobile) {
|
||||
|
||||
foreach ($prefixes as $prefix) {
|
||||
if (strpos($value->mobile, $prefix . $mobile) !== false) {
|
||||
$mobilenumber = str_replace($prefix . $mobile, '+43' . $mobile, $value->mobile);
|
||||
@@ -377,6 +381,70 @@ class CalendarController extends mfBaseController
|
||||
die();
|
||||
}
|
||||
|
||||
private function getAddressSbidi($r)
|
||||
{
|
||||
$address = CalendarModel::getAddressSbidi($r->term);
|
||||
$mobiles = CalendarModel::$austrian_mobile_prefixes;
|
||||
$prefixes = array('0043', '43 ', '43', '0');
|
||||
foreach ($address as $key => $value) {
|
||||
unset($mobilenumber);
|
||||
if ($value->phone) {
|
||||
foreach ($mobiles as $mobile) {
|
||||
$found = 0;
|
||||
foreach ($prefixes as $prefix) {
|
||||
if (strpos($value->phone, $prefix . $mobile) !== false) {
|
||||
$mobilenumber = str_replace($prefix . $mobile, '+43' . $mobile, $value->phone);
|
||||
$found = 1;
|
||||
break;
|
||||
} else if (substr($value->phone, 0, 3) == $mobile) {
|
||||
$mobilenumber = "+43" . $value->phone;
|
||||
$found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($found) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($mobilenumber) {
|
||||
if (strlen($mobilenumber) > 0 && strlen($mobilenumber) < 22) {
|
||||
$mobilenumber = str_replace(" ", "", $mobilenumber);
|
||||
$mobilenumber = str_replace("(", "", $mobilenumber);
|
||||
$mobilenumber = str_replace(")", "", $mobilenumber);
|
||||
$mobilenumber = str_replace("-", "", $mobilenumber);
|
||||
$mobilenumber = str_replace("/", "", $mobilenumber);
|
||||
$mobilenumber = str_replace(".", "", $mobilenumber);
|
||||
$mobilenumber = str_replace(",", "", $mobilenumber);
|
||||
$mobilenumber = str_replace(";", "", $mobilenumber);
|
||||
$mobilenumber = str_replace(":", "", $mobilenumber);
|
||||
$mobilenumber = str_replace("++", "+", $mobilenumber);
|
||||
|
||||
}
|
||||
} else if ($value->phone) {
|
||||
$mobilenumber = $value->phone;
|
||||
} else {
|
||||
$mobilenumber = "";
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
'id' => $value->id,
|
||||
'text' => $value->lastname . " " . $value->firstname . " - " . $value->street . ", " . $value->zip . " " . $value->city,
|
||||
'mail' => $value->email,
|
||||
'mobilenumber' => $mobilenumber,
|
||||
'location' => $value->street . " " . $value->number . ", " . $value->zip . " " . $value->city,
|
||||
'name' => $value->lastname . " " . $value->firstname
|
||||
);
|
||||
}
|
||||
$json['incomplete_results'] = false;
|
||||
$json['total_count'] = count($rows);
|
||||
$json['items'] = $rows;
|
||||
$json = json_encode($json);
|
||||
echo trim($json);
|
||||
|
||||
die();
|
||||
}
|
||||
|
||||
private function getTicket($r)
|
||||
{
|
||||
|
||||
@@ -521,9 +589,7 @@ class CalendarController extends mfBaseController
|
||||
->setCellValue([9, 1], 'Termintyp')
|
||||
->setCellValue([10, 1], 'Privat')
|
||||
->setCellValue([11, 1], 'Sichtbarkeit')
|
||||
->setCellValue([12, 1], 'Organisator')
|
||||
|
||||
;
|
||||
->setCellValue([12, 1], 'Organisator');
|
||||
$counter = 2;
|
||||
foreach ($calendarEvents['data'] as $event) {
|
||||
if ($event['privateflag']['privateflag']) {
|
||||
@@ -570,8 +636,7 @@ class CalendarController extends mfBaseController
|
||||
->setCellValue([9, $counter], $calendarType)
|
||||
->setCellValue([10, $counter], $event['privateflag']['privateflag'])
|
||||
->setCellValue([11, $counter], $event['busy']['busy'])
|
||||
->setCellValue([12, $counter], $event['isorganizer']['isorganizer'])
|
||||
;
|
||||
->setCellValue([12, $counter], $event['isorganizer']['isorganizer']);
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,12 @@ class CalendarModel
|
||||
1 => 'Termin',
|
||||
2 => 'IBN Xinon',
|
||||
3 => 'IBN ESTMK',
|
||||
4 => 'IBN Snopp',
|
||||
4 => 'Snopp',
|
||||
5 => 'Störung',
|
||||
6 => 'Support Gespräch'
|
||||
6 => 'Support Gespräch',
|
||||
7 => 'IBN SBIDI',
|
||||
);
|
||||
|
||||
public static $standardCalendarColors = [
|
||||
'#b3d5f3', '#d0e2c0', '#bac2d4', '#c6d4c0', '#e3e3e3',
|
||||
'#acdce5', '#cdb6c0', '#aae0e1', '#d9d9d9', '#d9e5d5',
|
||||
@@ -57,6 +59,7 @@ class CalendarModel
|
||||
4 => 'Lila Kategorie', //Snopp IBN
|
||||
5 => 'Rote Kategorie', //Störung
|
||||
6 => 'Rote Kategorie', //Störung
|
||||
7 => 'Orange Kategorie', //Störung
|
||||
98 => 'Gru00fcne Kategorie', //ESTMK IBN
|
||||
99 => 'Gr\u00fcne Kategorie', //ESTMK IBN
|
||||
);
|
||||
@@ -698,7 +701,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$updateArray['busy'] = $busy;
|
||||
|
||||
|
||||
if ($type == 2 || $type == 3 || $type == 4) {
|
||||
if ($type == 2 || $type == 3 || $type == 4 || $type == 7) {
|
||||
|
||||
if ($r->customer)
|
||||
$updateArray['customer'] = $r->customer;
|
||||
@@ -861,8 +864,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$microsoft_user_id = $result->ms_user_id;
|
||||
|
||||
}
|
||||
if (!$allday)
|
||||
{
|
||||
if (!$allday) {
|
||||
$allday = 0;
|
||||
}
|
||||
if ($reminder == 'NULL') {
|
||||
@@ -876,7 +878,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$categories = json_encode($categories);
|
||||
} else
|
||||
$categories = NULL;
|
||||
if ($type == 2 || $type == 3 || $type == 4) {
|
||||
if ($type == 2 || $type == 3 || $type == 4 || $type == 7) {
|
||||
$customer = $r->customer;
|
||||
$customer_info_type = $r->customer_info_type;
|
||||
$customer_info_text = $r->customer_info_text;
|
||||
@@ -1155,6 +1157,26 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
|
||||
}
|
||||
|
||||
public static function getAddressSbidi($search)
|
||||
{
|
||||
$sql = "SELECT Preorder.id,`firstname`, `lastname`, `street`, `housenumber`, `block`, `stiege`, `stock`, `tuer`, `zip`, `city`, `phone`, `email`
|
||||
FROM Preorder INNER JOIN Preordercampaign ON Preorder.preordercampaign_id=Preordercampaign.id
|
||||
INNER JOIN Network ON Network.id=Preordercampaign.network_id
|
||||
WHERE Network.owner_id='9633'";
|
||||
if ($search) {
|
||||
$sql .= " AND (firstname LIKE '%$search%' OR lastname LIKE '%$search%' OR street LIKE '%$search%' OR housenumber LIKE '%$search%' OR block LIKE '%$search%' OR stiege LIKE '%$search%' OR stock LIKE '%$search%' OR tuer LIKE '%$search%' OR zip LIKE '%$search%' OR city LIKE '%$search%')";
|
||||
}
|
||||
$sql .= " ORDER BY lastname";
|
||||
$db = FronkDB::singleton();
|
||||
$res = $db->query($sql);
|
||||
if ($db->num_rows($res)) {
|
||||
while ($data = $db->fetch_object($res)) {
|
||||
$items[] = $data;
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
public static function getFirst()
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
@@ -11,7 +11,8 @@ class CalendarTemplateModel
|
||||
"1"=>"Termin",
|
||||
"2"=>"IBN Xinon",
|
||||
"3"=>"IBN E-Stmk",
|
||||
"4"=>"IBN Snopp",
|
||||
"7"=>"IBN SBIDI",
|
||||
"4"=>"Snopp",
|
||||
"5"=>"Störungen"
|
||||
);
|
||||
public static function find($data)
|
||||
|
||||
@@ -475,7 +475,87 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
html: true
|
||||
});
|
||||
}
|
||||
} else if (data.data.type.type == "5") {
|
||||
}
|
||||
else if (data.data.type.type == "7")
|
||||
{
|
||||
$('.ticket-div').hide();
|
||||
$('.customer-div').show();
|
||||
if (data.data.customer.customer) {
|
||||
$('#customer').html('<option>' + data.data.customer.customer + '</option>');
|
||||
} else {
|
||||
$('#customer').html('<option></option>');
|
||||
}
|
||||
if (data.data.customer_info_reminder.customer_info_reminder) {
|
||||
if (data.data.customer_info_reminder.customer_info_reminder == 1) {
|
||||
$('#customer-info-reminder-check').prop('checked', true);
|
||||
} else {
|
||||
$('#customer-info-reminder-check').prop('checked', false);
|
||||
}
|
||||
}
|
||||
$('#customer').select2({
|
||||
placeholder: "Kunden Suche",
|
||||
minimumInputLength: 3,
|
||||
dropdownParent: jQuery('#relContainer2'),
|
||||
// dropdownParent: $('#EventModal'),
|
||||
language: "de",
|
||||
ajax: {
|
||||
url: requestAddressSbidiUrl,
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
// Transforms the top-level key of the response object from 'items' to 'results'
|
||||
return {
|
||||
results: data.items
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
if (data.data.customer_info.customer_info) {
|
||||
const obj = JSON.parse(data.data.customer_info.customer_info);
|
||||
$('#customer-info-text').val(obj.customer_info_text);
|
||||
$('#customer-info-type').val(obj.customer_info_type);
|
||||
$('#customer-info-type-text').val(obj.customer_info_type_text);
|
||||
}
|
||||
if (data.data.customer_info_send.customer_info_send) {
|
||||
const obj = JSON.parse(data.data.customer_info_send.customer_info_send);
|
||||
$('#customer-info-check-info').html('<i class="fa-sharp-duotone fa-solid fa-circle-info customer-info-point"></i>');
|
||||
const unixTime = obj.sendtime;
|
||||
const date = new Date(unixTime * 1000);
|
||||
const germanDateTime = date.toLocaleString('de-DE', {
|
||||
day: '2-digit',
|
||||
month: '2-digit',
|
||||
year: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
});
|
||||
let typeText;
|
||||
if (obj.customer_info_type == 1) {
|
||||
typeText = 'E-Mail';
|
||||
} else if (obj.customer_info_type == 2) {
|
||||
typeText = 'SMS';
|
||||
}
|
||||
let customer_info_text = "";
|
||||
if (obj.customer_info_text) {
|
||||
customer_info_text = obj.customer_info_text.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br />$2');
|
||||
}
|
||||
let title = `<div class="text-center font-weight-500">Letzte gesendete Info (` + typeText + `):</div>
|
||||
<div class="text-left">` + customer_info_text + `</div>
|
||||
<div class="text-left"><span class="font-weight-500">gesendet an:</span> ` + obj.customer_info_type_text + `</div>
|
||||
<div class="text-left"><span class="font-weight-500">gesendet von:</span> ` + obj.sendby + `</div>
|
||||
<div class="text-left"><span class="font-weight-500">gesendet am:</span> ` + germanDateTime + `</div>
|
||||
|
||||
`;
|
||||
let tooltip = new Tooltip($('.customer-info-point'), {
|
||||
title: title,
|
||||
placement: 'right',
|
||||
trigger: 'hover',
|
||||
container: 'body',
|
||||
html: true
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (data.data.type.type == "5") {
|
||||
$('.ticket-div').show();
|
||||
$('.customer-div').hide();
|
||||
if (data.data.customer.customer) {
|
||||
@@ -703,6 +783,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/estmk_logo.png'></div>");
|
||||
}
|
||||
if (info.event.extendedProps['event_type'] == '7') {
|
||||
|
||||
// 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: 15px;vertical-align: top;margin-top:-1px' src='/img/sbidi-logo.png'></div>");
|
||||
}
|
||||
if (info.event.extendedProps['event_type'] == '4') {
|
||||
|
||||
// info.el.querySelector(".fc-event-title").insertAdjacentHTML("afterend", "<div class=\"fc-event-type\"><i class=\"fa-light fa-user-helmet-safety\"></i></div>");
|
||||
@@ -1310,7 +1395,7 @@ $(document).ready(function () {
|
||||
if ($('#customer-info-check').is(':checked')) {
|
||||
customer_info_check = 1;
|
||||
}
|
||||
if (type == '2' || type == '3' || type == '4') {
|
||||
if (type == '2' || type == '3' || type == '4' || type == '7') {
|
||||
customer_info_text = $('#customer-info-text').val();
|
||||
customer_info_type = $('#customer-info-type').val();
|
||||
customer_info_type_text = $('#customer-info-type-text').val();
|
||||
@@ -1427,7 +1512,7 @@ $(document).ready(function () {
|
||||
if ($('#customer-info-check').is(':checked')) {
|
||||
customer_info_check = 1;
|
||||
}
|
||||
if (type == '2' || type == '3' || type == '4') {
|
||||
if (type == '2' || type == '3' || type == '4' || type=='7') {
|
||||
customer_info_text = $('#customer-info-text').val();
|
||||
customer_info_type = $('#customer-info-type').val();
|
||||
customer_info_type_text = $('#customer-info-type-text').val();
|
||||
@@ -1785,6 +1870,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() == "7") {
|
||||
$('.customer-div').show();
|
||||
$('.ticket-div').hide();
|
||||
$('#customer').select2({
|
||||
placeholder: "Kunden Suche",
|
||||
minimumInputLength: 3,
|
||||
// dropdownParent: $('#EventModal'),
|
||||
dropdownParent: jQuery('#relContainer2'),
|
||||
language: "de",
|
||||
ajax: {
|
||||
url: requestAddressSbidiUrl,
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
return {
|
||||
term: params.term,
|
||||
xinon: 0,
|
||||
};
|
||||
},
|
||||
|
||||
processResults: function (data) {
|
||||
// Transforms the top-level key of the response object from 'items' to 'results'
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user