Kalender Update
* Neuer IBN Typ IBN SBIDI * Neue Kundenabfrage für SBIDI
This commit is contained in:
@@ -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,10 +864,9 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$microsoft_user_id = $result->ms_user_id;
|
||||
|
||||
}
|
||||
if (!$allday)
|
||||
{
|
||||
$allday=0;
|
||||
}
|
||||
if (!$allday) {
|
||||
$allday = 0;
|
||||
}
|
||||
if ($reminder == 'NULL') {
|
||||
$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)
|
||||
|
||||
Reference in New Issue
Block a user