init
This commit is contained in:
3
module/api/app_api_domain.php
Normal file
3
module/api/app_api_domain.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
echo "true";
|
||||
?>
|
||||
0
module/api/cronjob_send_custom_notif.inc.php
Normal file
0
module/api/cronjob_send_custom_notif.inc.php
Normal file
238
module/api/cronjob_send_custom_notif.php
Normal file
238
module/api/cronjob_send_custom_notif.php
Normal file
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
function getAccessToken($jsonKeyPath) {
|
||||
try {
|
||||
|
||||
$jwt = generateJWT($jsonKeyPath);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://oauth2.googleapis.com/token');
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
|
||||
'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
||||
'assertion' => $jwt,
|
||||
]));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/x-www-form-urlencoded',
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$jsonResponse = json_decode($response, true);
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
return $jsonResponse['access_token'];
|
||||
}
|
||||
|
||||
function generateJWT($jsonKeyPath) {
|
||||
$jsonKey = json_decode(file_get_contents($jsonKeyPath), true);
|
||||
|
||||
$header = base64_encode(json_encode([
|
||||
'alg' => 'RS256',
|
||||
'typ' => 'JWT',
|
||||
]));
|
||||
|
||||
$iat = time();
|
||||
$exp = $iat + 3600; // 1 час
|
||||
$claimSet = base64_encode(json_encode([
|
||||
'iss' => $jsonKey['client_email'],
|
||||
'scope' => 'https://www.googleapis.com/auth/firebase.messaging',
|
||||
'aud' => 'https://oauth2.googleapis.com/token',
|
||||
'exp' => $exp,
|
||||
'iat' => $iat,
|
||||
]));
|
||||
|
||||
$signatureInput = $header . '.' . $claimSet;
|
||||
|
||||
openssl_sign($signatureInput, $signature, openssl_pkey_get_private($jsonKey['private_key']), 'sha256');
|
||||
$signature = base64_encode($signature);
|
||||
|
||||
return $signatureInput . '.' . $signature;
|
||||
}
|
||||
|
||||
function send($token, $username, $message){
|
||||
$jsonKeyPath = '../../notifications-c5c54-a9705bfea23c.json';
|
||||
$accessToken = getAccessToken($jsonKeyPath);
|
||||
|
||||
$json = json_encode([
|
||||
"message" => [
|
||||
"token" => $token,
|
||||
"notification" => [
|
||||
"title" => $username,
|
||||
"body" => $message
|
||||
],
|
||||
"data" => [
|
||||
"story_id" => "story_12345",
|
||||
"badgeIncrement" => "1"
|
||||
],
|
||||
"apns" => [
|
||||
"payload" => [
|
||||
"aps" => [
|
||||
"content-available" => 1 // Требуется для пробуждения приложения на iOS
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
$url = "https://fcm.googleapis.com/v1/projects/notifications-c5c54/messages:send";
|
||||
|
||||
$ch = curl_init($url);
|
||||
|
||||
|
||||
$headers = [
|
||||
'Authorization: Bearer ' . $accessToken,
|
||||
'Content-Type: application/json; charset=UTF-8',
|
||||
];
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$env = parse_ini_file('/var/www/web10/htdocs/intranet/config/.env');
|
||||
|
||||
$db_host = $env['MAIN_MYSQL_DB_HOST'];
|
||||
$db_port = $env['MAIN_MYSQL_DB_PORT'];
|
||||
$db_user = $env['MAIN_MYSQL_DB_USER'];
|
||||
$db_pass = $env['MAIN_MYSQL_DB_PASS'];
|
||||
$db_schema = $env['MAIN_MYSQL_DB_SCHEMA'];
|
||||
|
||||
$conn = new mysqli($db_host, $db_user, $db_pass, $db_schema, $db_port);
|
||||
|
||||
|
||||
|
||||
// Format current date to match the validity_from format (YYYY-MM-DD)
|
||||
$currDate = date('Y-m-d');
|
||||
|
||||
// Query to get all collections where validity_from matches today's date
|
||||
$query_get_all_current_collections = "SELECT * FROM main_collection WHERE delayed_notification = 1 AND validity_from = '$currDate'";
|
||||
$result_collections = $conn->query($query_get_all_current_collections);
|
||||
|
||||
if ($result_collections->num_rows > 0) {
|
||||
// Loop through each collection
|
||||
while ($row = $result_collections->fetch_assoc()) {
|
||||
|
||||
print_r($row["description"]);
|
||||
print_r($row["id"]);
|
||||
$article_name = $row["description"];
|
||||
|
||||
|
||||
echo "<br>--------------------<br>";
|
||||
|
||||
$department_ids = [];
|
||||
$role_ids = [];
|
||||
|
||||
$query_get_department = "SELECT * FROM intranet_teil_link WHERE content_type = 'collection' AND content_id = " . $row['id'];
|
||||
$result_department = $conn->query($query_get_department);
|
||||
|
||||
while ($row_department = $result_department->fetch_assoc()) {
|
||||
$department_ids[] = $row_department['main_department_id'];
|
||||
var_dump($row_department);
|
||||
}
|
||||
|
||||
echo "<br>--------------------<br>";
|
||||
|
||||
$query_get_role = "SELECT * FROM intranet_role_link WHERE content_type = 'collection' AND content_id = " . $row['id'];
|
||||
$result_role = $conn->query($query_get_role);
|
||||
|
||||
while ($row_role = $result_role->fetch_assoc()) {
|
||||
$role_ids[] = $row_role['main_role_id'];
|
||||
var_dump($row_role);
|
||||
}
|
||||
|
||||
// Create comma-separated strings
|
||||
$abteilung = implode(',', $department_ids);
|
||||
$role = implode(',', $role_ids);
|
||||
|
||||
$abteilungArray = explode(',', $abteilung);
|
||||
$roleArray = explode(',', $role);
|
||||
|
||||
$mergedArray = [];
|
||||
|
||||
foreach ($abteilungArray as $abteilung) {
|
||||
foreach ($roleArray as $role) {
|
||||
$mergedArray[] = [
|
||||
'abteilung' => $abteilung,
|
||||
'role' => $role
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tokenArray = [];
|
||||
// print_r($mergedArray);
|
||||
// print_r($abteilungArray);
|
||||
// print_r($roleArray);
|
||||
var_dump($mergedArray);
|
||||
foreach ($mergedArray as $element) {
|
||||
|
||||
if ( $element['abteilung'] == "" && $element['role'] == "") {
|
||||
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1";
|
||||
} else if ( $element['abteilung'] == "") {
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_role_id = " . $element['role'];
|
||||
} else if ( $element['role'] == "") {
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_department_id = " . $element['abteilung'];
|
||||
} else {
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_department_id = " . $element['abteilung'] . " and main_role_id = " . $element['role'];
|
||||
}
|
||||
// var_dump($sql);
|
||||
var_dump($sql);
|
||||
$result = $conn->query($sql);
|
||||
if ($result->num_rows > 0) {
|
||||
while($row = $result->fetch_assoc()) {
|
||||
$query = "SELECT DISTINCT main_contact.id, main_contact.name, token_contact.token as 'token' FROM main_contact LEFT JOIN token_contact ON token_contact.contact_id = main_contact.id WHERE main_contact.id = '".$row['main_contact_id']."'";
|
||||
// var_dump($query);
|
||||
$user_result = $conn->query($query);
|
||||
if ($user_result->num_rows > 0) {
|
||||
while($contact = $user_result->fetch_assoc()) {
|
||||
if ($contact['token'] != null && $contact['token'] != "") {
|
||||
// send($contact['token'], "Intranet", "Neuer Beitrag im Intranet");
|
||||
$contact_info = [
|
||||
'id' => $contact['id'],
|
||||
'name' => $contact['name'],
|
||||
'token' => $contact['token']
|
||||
];
|
||||
if (!in_array($contact_info, $tokenArray, true)) {
|
||||
$tokenArray[] = $contact_info;
|
||||
|
||||
} else {
|
||||
// echo "Already in array";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// var_dump($tokenArray);
|
||||
// foreach ($tokenArray as $token) {
|
||||
// // print("würde gesendet: <br>");
|
||||
// send($token['token'], "Neuer Beitrag im Intranet", $article_name);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
echo "No collections found for today.";
|
||||
}
|
||||
|
||||
$query = "INSERT INTO cron_jobs (name) VALUES ('send_custom_notif')";
|
||||
$result = $conn->query($query);
|
||||
|
||||
|
||||
25
module/api/getUser.php
Normal file
25
module/api/getUser.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$userLogin = $_POST['login_api_phone'];
|
||||
$userPassword = $_POST['password_api_phone'];
|
||||
$password = md5($userPassword);
|
||||
|
||||
// echo $userLogin." ".$password;
|
||||
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=web4_intranet;charset=utf8', "web4_intranet", "WewJedjuAbEynk3");
|
||||
$GLOBALS["pdo_conn"] = $pdo;
|
||||
|
||||
$noPublish = "SELECT main_contact_id AS contact_id FROM main_contact_department INNER JOIN main_contact ON main_contact_department.main_contact_id=main_contact.id WHERE main_contact.shortcut='$userLogin' AND main_contact.password='$password'";
|
||||
|
||||
|
||||
$stmt = $pdo->prepare($noPublish);
|
||||
$stmt->execute();
|
||||
|
||||
// $pp = md5($userPassword);
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row) {
|
||||
echo $row["contact_id"];
|
||||
}else {
|
||||
echo "null";
|
||||
}
|
||||
?>
|
||||
3
module/api/isShowEvent.php
Normal file
3
module/api/isShowEvent.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
14
module/api/out_system.inc.php
Normal file
14
module/api/out_system.inc.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$user = $_POST['user'];
|
||||
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=web4_intranet;charset=utf8', "web4_intranet", "WewJedjuAbEynk3");
|
||||
$GLOBALS["pdo_conn"] = $pdo;
|
||||
|
||||
$noPublish = "UPDATE token_contact SET token_contact.in_system=0 WHERE token_contact.contact_id=$user";
|
||||
|
||||
$stmt = $pdo->prepare($noPublish);
|
||||
$stmt->execute();
|
||||
|
||||
$count = $stmt->fetchColumn();
|
||||
|
||||
?>
|
||||
16
module/api/sendTokenToDB.php
Normal file
16
module/api/sendTokenToDB.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$token = $_POST['token'];
|
||||
$user = $_POST['user'];
|
||||
$domain = $_POST['domain'];
|
||||
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=web4_intranet;charset=utf8', "web4_intranet", "WewJedjuAbEynk3");
|
||||
$GLOBALS["pdo_conn"] = $pdo;
|
||||
|
||||
$noPublish = "CALL insertToken('$token', '$user')";
|
||||
|
||||
$stmt = $pdo->prepare($noPublish);
|
||||
$stmt->execute();
|
||||
|
||||
$count = $stmt->fetchColumn();
|
||||
|
||||
?>
|
||||
224
module/api/send_custom_notif.inc.php
Normal file
224
module/api/send_custom_notif.inc.php
Normal file
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$user = $_POST['user'];
|
||||
$title = $_POST['title'];
|
||||
$body = $_POST['body'];
|
||||
$abteilung = $_POST['abteilung'];
|
||||
$role = $_POST['role'];
|
||||
$domain = $_POST['domain'];
|
||||
$input_collection_id = $_POST['input_collection_id'];
|
||||
|
||||
|
||||
function getAccessToken($jsonKeyPath) {
|
||||
try {
|
||||
|
||||
$jwt = generateJWT($jsonKeyPath);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://oauth2.googleapis.com/token');
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
|
||||
'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
||||
'assertion' => $jwt,
|
||||
]));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/x-www-form-urlencoded',
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$jsonResponse = json_decode($response, true);
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
return $jsonResponse['access_token'];
|
||||
}
|
||||
|
||||
function generateJWT($jsonKeyPath) {
|
||||
$jsonKey = json_decode(file_get_contents($jsonKeyPath), true);
|
||||
|
||||
$header = base64_encode(json_encode([
|
||||
'alg' => 'RS256',
|
||||
'typ' => 'JWT',
|
||||
]));
|
||||
|
||||
$iat = time();
|
||||
$exp = $iat + 3600; // 1 час
|
||||
$claimSet = base64_encode(json_encode([
|
||||
'iss' => $jsonKey['client_email'],
|
||||
'scope' => 'https://www.googleapis.com/auth/firebase.messaging',
|
||||
'aud' => 'https://oauth2.googleapis.com/token',
|
||||
'exp' => $exp,
|
||||
'iat' => $iat,
|
||||
]));
|
||||
|
||||
$signatureInput = $header . '.' . $claimSet;
|
||||
|
||||
openssl_sign($signatureInput, $signature, openssl_pkey_get_private($jsonKey['private_key']), 'sha256');
|
||||
$signature = base64_encode($signature);
|
||||
|
||||
return $signatureInput . '.' . $signature;
|
||||
}
|
||||
|
||||
function send($token, $username, $message){
|
||||
$jsonKeyPath = '../../notifications-c5c54-a9705bfea23c.json';
|
||||
$accessToken = getAccessToken($jsonKeyPath);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
{
|
||||
"message": {
|
||||
"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJzaG9ydGN1dCI6ImVhIn0.mcO9WT0VV_lXJp48mu3XF9E9bKEdCitoKogAk067LwQ",
|
||||
"notification": {
|
||||
"title": "Breaking News",
|
||||
"body": "New news story available."
|
||||
},
|
||||
"data": {
|
||||
"story_id": "story_12345"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$json = json_encode([
|
||||
"message" => [
|
||||
"token" => $token,
|
||||
"notification" => [
|
||||
"title" => $username,
|
||||
"body" => $message
|
||||
],
|
||||
"data" => [
|
||||
"story_id" => "story_12345",
|
||||
"badgeIncrement" => "1"
|
||||
],
|
||||
"apns" => [
|
||||
"payload" => [
|
||||
"aps" => [
|
||||
"content-available" => 1 // Требуется для пробуждения приложения на iOS
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$url = "https://fcm.googleapis.com/v1/projects/notifications-c5c54/messages:send";
|
||||
|
||||
|
||||
$ch = curl_init($url);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$headers = [
|
||||
'Authorization: Bearer ' . $accessToken,
|
||||
'Content-Type: application/json; charset=UTF-8',
|
||||
];
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$env = parse_ini_file('../../config/.env');
|
||||
|
||||
$db_host = $env['MAIN_MYSQL_DB_HOST'];
|
||||
$db_port = $env['MAIN_MYSQL_DB_PORT'];
|
||||
$db_user = $env['MAIN_MYSQL_DB_USER'];
|
||||
$db_pass = $env['MAIN_MYSQL_DB_PASS'];
|
||||
$db_schema = $env['MAIN_MYSQL_DB_SCHEMA'];
|
||||
|
||||
$conn = new mysqli($db_host, $db_user, $db_pass, $db_schema, $db_port);
|
||||
|
||||
$abteilungArray = explode(',', $abteilung);
|
||||
$roleArray = explode(',', $role);
|
||||
|
||||
$mergedArray = [];
|
||||
|
||||
foreach ($abteilungArray as $abteilung) {
|
||||
foreach ($roleArray as $role) {
|
||||
$mergedArray[] = [
|
||||
'abteilung' => $abteilung,
|
||||
'role' => $role
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$query_collection_name = "SELECT * FROM main_collection WHERE id = " . $input_collection_id;
|
||||
$result = $conn->query($query_collection_name);
|
||||
if ($result->num_rows > 0) {
|
||||
$row = $result->fetch_assoc();
|
||||
$collection_name = $row['description'];
|
||||
} else {
|
||||
echo "collection not found";
|
||||
die();
|
||||
}
|
||||
|
||||
$tokenArray = [];
|
||||
// print_r($mergedArray);
|
||||
// print_r($abteilungArray);
|
||||
// print_r($roleArray);
|
||||
foreach ($mergedArray as $element) {
|
||||
// $sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_department_id = " . $element['abteilung'] . " and main_role_id = " . $element['role'];
|
||||
// var_dump($sql);
|
||||
if ( $element['abteilung'] == "" && $element['role'] == "") {
|
||||
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1";
|
||||
} else if ( $element['abteilung'] == "") {
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_role_id = " . $element['role'];
|
||||
} else if ( $element['role'] == "") {
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_department_id = " . $element['abteilung'];
|
||||
} else {
|
||||
$sql = "SELECT DISTINCT main_contact_id FROM main_contact_department WHERE main_mandant_id = 1 AND active = 1 and main_department_id = " . $element['abteilung'] . " and main_role_id = " . $element['role'];
|
||||
}
|
||||
$result = $conn->query($sql);
|
||||
if ($result->num_rows > 0) {
|
||||
while($row = $result->fetch_assoc()) {
|
||||
$query = "SELECT DISTINCT main_contact.id, main_contact.name, token_contact.token as 'token' FROM main_contact LEFT JOIN token_contact ON token_contact.contact_id = main_contact.id WHERE main_contact.id = '".$row['main_contact_id']."'";
|
||||
// var_dump($query);
|
||||
$user_result = $conn->query($query);
|
||||
if ($user_result->num_rows > 0) {
|
||||
while($contact = $user_result->fetch_assoc()) {
|
||||
if ($contact['token'] != null && $contact['token'] != "") {
|
||||
// send($contact['token'], "Intranet", "Neuer Beitrag im Intranet");
|
||||
$contact_info = [
|
||||
'id' => $contact['id'],
|
||||
'name' => $contact['name'],
|
||||
'token' => $contact['token']
|
||||
];
|
||||
if (!in_array($contact_info, $tokenArray, true)) {
|
||||
$tokenArray[] = $contact_info;
|
||||
} else {
|
||||
// echo "Already in array";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($tokenArray as $token) {
|
||||
send($token['token'], "Neuer Beitrag im Intranet", $collection_name);
|
||||
}
|
||||
|
||||
// send("cyO6CxjDS5S7fz5DX1vA95:APA91bGxyA0ai9h1oCt4vrEmfYu0Ics1uX8kxfWNztYgQF1oQgLD-Nql7dM88LfudccwCA3vKM7cQldqOfffbRv-9v_79B7bmnhlFOZUsEsaZVpqWoHaOEyTw7bYo6VY8aC00GGwv_M1", "Test breadcrumb", "Test message");
|
||||
210
module/api/send_notif.inc.php
Normal file
210
module/api/send_notif.inc.php
Normal file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
$user = $_POST['user'];
|
||||
$title = $_POST['title'];
|
||||
$body = $_POST['body'];
|
||||
$domain = $_POST['domain'];
|
||||
|
||||
|
||||
$news_id = $_POST["news_id"];
|
||||
|
||||
|
||||
function getAccessToken($jsonKeyPath) {
|
||||
try {
|
||||
|
||||
$jwt = generateJWT($jsonKeyPath);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://oauth2.googleapis.com/token');
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
|
||||
'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
||||
'assertion' => $jwt,
|
||||
]));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Content-Type: application/x-www-form-urlencoded',
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$jsonResponse = json_decode($response, true);
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
return $jsonResponse['access_token'];
|
||||
}
|
||||
|
||||
function generateJWT($jsonKeyPath) {
|
||||
$jsonKey = json_decode(file_get_contents($jsonKeyPath), true);
|
||||
|
||||
$header = base64_encode(json_encode([
|
||||
'alg' => 'RS256',
|
||||
'typ' => 'JWT',
|
||||
]));
|
||||
|
||||
$iat = time();
|
||||
$exp = $iat + 3600; // 1 час
|
||||
$claimSet = base64_encode(json_encode([
|
||||
'iss' => $jsonKey['client_email'],
|
||||
'scope' => 'https://www.googleapis.com/auth/firebase.messaging',
|
||||
'aud' => 'https://oauth2.googleapis.com/token',
|
||||
'exp' => $exp,
|
||||
'iat' => $iat,
|
||||
]));
|
||||
|
||||
$signatureInput = $header . '.' . $claimSet;
|
||||
|
||||
openssl_sign($signatureInput, $signature, openssl_pkey_get_private($jsonKey['private_key']), 'sha256');
|
||||
$signature = base64_encode($signature);
|
||||
|
||||
return $signatureInput . '.' . $signature;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$jsonKeyPath = '../../notifications-c5c54-a9705bfea23c.json';
|
||||
|
||||
|
||||
$accessToken = getAccessToken($jsonKeyPath);
|
||||
|
||||
|
||||
|
||||
$url = 'https://fcm.googleapis.com/v1/projects/notifications-c5c54/messages:send';
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
|
||||
|
||||
|
||||
|
||||
// HERE NEW LOGIC
|
||||
// GET ALl MANDANTS FROM NEWS ID
|
||||
$mysql_con = new mysqli("localhost", "web4_intranet", "WewJedjuAbEynk3", "web4_intranet");
|
||||
|
||||
$allowed_contact_ids = [];
|
||||
|
||||
$all_mandants_query = "SELECT main_mandant_id FROM `main_collection_mandant_link` WHERE main_collection_id = ".(int)$news_id;
|
||||
$sql_all_mandants = @mysqli_query($mysql_con, $all_mandants_query);
|
||||
while ($row = @mysqli_fetch_assoc($sql_all_mandants)) {
|
||||
$all_mandants[] = $row["main_mandant_id"];
|
||||
}
|
||||
|
||||
$all_departments_query = "SELECT main_department_id FROM `main_collection_department_link` WHERE main_collection_id = ".(int)$news_id;
|
||||
$sql_all_departments = @mysqli_query($mysql_con, $all_departments_query);
|
||||
while ($row = @mysqli_fetch_assoc($sql_all_departments)) {
|
||||
$all_departments[] = $row["main_department_id"];
|
||||
}
|
||||
|
||||
$all_fachbereich_query = "SELECT main_fachbereich_id FROM `main_collection_fachbereich_link` WHERE main_collection_id = ".(int)$news_id;
|
||||
$sql_all_fachbereichs = @mysqli_query($mysql_con, $all_fachbereich_query);
|
||||
while ($row = @mysqli_fetch_assoc($sql_all_fachbereichs)) {
|
||||
$all_fachbereichs[] = $row["main_fachbereich_id"];
|
||||
}
|
||||
|
||||
$all_einrichtungen_query = "SELECT main_einricht_id FROM `main_collection_einricht_link` WHERE main_collection_id = ".(int)$news_id;
|
||||
$sql_all_einrichtungen = @mysqli_query($mysql_con, $all_einrichtungen_query);
|
||||
while ($row = @mysqli_fetch_assoc($sql_all_einrichtungen)) {
|
||||
$all_einrichtungen[] = $row["main_einricht_id"];
|
||||
}
|
||||
|
||||
$all_role_query = "SELECT main_role_id FROM `main_collection_role_link` WHERE main_collection_id = ".(int)$news_id;
|
||||
$sql_all_rolles = @mysqli_query($mysql_con, $all_role_query);
|
||||
while ($row = @mysqli_fetch_assoc($sql_all_rolles)) {
|
||||
$all_rolles[] = $row["main_role_id"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query_get_all_contacts = "SELECT * FROM main_contact_department";
|
||||
$sql_get_all_contacts = @mysqli_query($mysql_con, $query_get_all_contacts);
|
||||
|
||||
|
||||
while ($row = mysqli_fetch_assoc($sql_get_all_contacts)) {
|
||||
|
||||
$count++;
|
||||
// 1. Mandant
|
||||
if (!empty($all_mandants) && !in_array($row["main_mandant_id"], $all_mandants)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2. Department
|
||||
if (!empty($all_departments) && !in_array($row["main_department_id"], $all_departments)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($all_fachbereichs) && !in_array($row["main_bereich_id"], $all_fachbereichs)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($all_einrichtungen) && !in_array($row["main_einricht_id"], $all_einrichtungen)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($all_rolles) && !in_array($row["main_role_id"], $all_rolles)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$allowed_contact_ids[] = $row["main_contact_id"];
|
||||
}
|
||||
|
||||
$allowed_contact_ids = array_unique($allowed_contact_ids);
|
||||
|
||||
foreach ($allowed_contact_ids as $cid) {
|
||||
$query_contact_token = "SELECT * FROM token_contact WHERE contact_id = ".(int)$cid." AND in_system = 1 ORDER BY id DESC LIMIT 1";
|
||||
$sql_contactn_token = @mysqli_query($mysql_con, $query_contact_token);
|
||||
|
||||
|
||||
while ($row_token = @mysqli_fetch_assoc($sql_contactn_token)) {
|
||||
|
||||
|
||||
$contactId = trim($row_token['contact_id'] ?? '');
|
||||
$token = trim($row_token['token'] ?? '');
|
||||
|
||||
if ($contactId === '' || $contactId === 'undefined' ||
|
||||
$token === '' || $token === 'undefined') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'message' => [
|
||||
'token' => $row_token["token"],
|
||||
'notification' => [
|
||||
'title' => $title,
|
||||
'body' => $body,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
$jsonData = json_encode($data);
|
||||
|
||||
$ch = curl_init($url);
|
||||
|
||||
|
||||
$headers = [
|
||||
'Authorization: Bearer ' . $accessToken,
|
||||
'Content-Type: application/json; charset=UTF-8',
|
||||
];
|
||||
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
||||
|
||||
|
||||
$response = curl_exec($ch);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
85
module/api/testGraph.php
Normal file
85
module/api/testGraph.php
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$parts = parse_url("https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."");
|
||||
parse_str($parts['query'], $query);
|
||||
$code = $query['code'];
|
||||
// var_dump(getToken($code));
|
||||
$token = getToken($code);
|
||||
// $refresh_token = getToken($code)[1];
|
||||
// var_dump($token);
|
||||
$headers = [
|
||||
'Authorization: Bearer '.$token[0],
|
||||
'Content-Type: application/json'
|
||||
];
|
||||
|
||||
|
||||
$fcmUrl = 'https://graph.microsoft.com/v1.0/me';
|
||||
$cRequest = curl_init();
|
||||
curl_setopt($cRequest, CURLOPT_URL, $fcmUrl);
|
||||
curl_setopt($cRequest, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($cRequest, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($cRequest, CURLOPT_SSL_VERIFYPEER, false);
|
||||
$result = curl_exec($cRequest);
|
||||
$obj = json_decode($result);
|
||||
$email = $obj->mail;
|
||||
curl_close($cRequest);
|
||||
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=dev-intranet;charset=utf8', "dev-user", "AcdinemGeor5qua");
|
||||
$GLOBALS["pdo_conn"] = $pdo;
|
||||
// echo $token."</br>".$email."</br>".$refresh_token;
|
||||
|
||||
$noPublish = "CALL insertTokenMicrosoftKey('$token[0]', '$email', '$token[1]')";
|
||||
|
||||
$stmt = $pdo->prepare($noPublish);
|
||||
$stmt->execute();
|
||||
|
||||
$count = $stmt->fetchColumn();
|
||||
|
||||
?>
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
window.close();
|
||||
}, 1000);
|
||||
|
||||
</script>'
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
function getToken($code){
|
||||
$array = array();
|
||||
$headers = [
|
||||
'Content-Type: application/x-www-form-urlencoded'
|
||||
];
|
||||
$fcmUrl = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token';
|
||||
$cRequest = curl_init();
|
||||
curl_setopt($cRequest, CURLOPT_URL, $fcmUrl);
|
||||
curl_setopt($cRequest, CURLOPT_POST, true);
|
||||
curl_setopt($cRequest, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($cRequest, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($cRequest, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($cRequest, CURLOPT_POSTFIELDS, http_build_query(array(
|
||||
'client_id' => '998f5db8-f544-4dda-a10a-79eda88a5437',
|
||||
'scope' => 'openid User.ReadWrite Calendars.ReadWrite Presence.ReadWrite',
|
||||
'code' => $code,
|
||||
'redirect_uri' => 'https://dev-intranet.breadcrumb-online.de/module/api/testGraph.php',
|
||||
'grant_type' => 'authorization_code',
|
||||
'client_secret' => 'S6Z8Q~zae4D8k0mpbCtgAQrAUV5we.FxcR6LHav-'
|
||||
|
||||
)));
|
||||
$result = curl_exec($cRequest);
|
||||
$obj_token = json_decode($result);
|
||||
$token_get = $obj_token->access_token;
|
||||
echo $result;
|
||||
$refresh_token = $obj_token->refresh_token;
|
||||
array_push($array, $token_get);
|
||||
array_push($array, $refresh_token);
|
||||
curl_close($cRequest);
|
||||
return $array;
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
22
module/api/tgw.php
Normal file
22
module/api/tgw.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
$fcmUrl = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id=998f5db8-f544-4dda-a10a-79eda88a5437&response_type=code&redirect_uri=https://dev-intranet.breadcrumb-online.de/module/api/testGraph.php&response_mode=query&scope=offline_access%20User.ReadWrite%20Presence.ReadWrite%20Calendars.ReadWrite&state=12345';
|
||||
$cRequest = curl_init();
|
||||
curl_setopt($cRequest, CURLOPT_URL, $fcmUrl);
|
||||
curl_setopt($cRequest, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($cRequest, CURLOPT_SSL_VERIFYPEER, false);
|
||||
$result = curl_exec($cRequest);
|
||||
echo $result;
|
||||
curl_close($cRequest);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
141
module/bewerber/edit_stufe.inc.php
Normal file
141
module/bewerber/edit_stufe.inc.php
Normal file
@@ -0,0 +1,141 @@
|
||||
<?
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
switch ($action) {
|
||||
case 'edit_stufeform':
|
||||
edit_stufeform();
|
||||
break;
|
||||
|
||||
case 'delete_stufeform':
|
||||
delete_stufeform();
|
||||
break;
|
||||
case 'new_stufeform':
|
||||
|
||||
require_once("edit_stufeform_cardform.inc.php");
|
||||
break;
|
||||
|
||||
case 'save_stufeform':
|
||||
save_stufeform();
|
||||
break;
|
||||
|
||||
case 'moveup_line_stufeform':
|
||||
moveup_line_stufeform();
|
||||
require_once("edit_stufe_listform.inc.php");
|
||||
break;
|
||||
case 'movedown_line_stufeform':
|
||||
movedown_line_stufeform();
|
||||
require_once("edit_stufe_listform.inc.php");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
require_once("edit_stufe_listform.inc.php");
|
||||
|
||||
break;
|
||||
}
|
||||
function save_stufeform() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE stufe SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
short_text = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_short_text"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . "
|
||||
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
|
||||
} else {
|
||||
|
||||
$query = "INSERT INTO stufe
|
||||
(main_language_id, description, modified_date, modified_user, short_text)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_short_text']) . "'
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("stufeform_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("stufeform_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
|
||||
edit_stufeform($input_id, $messages);
|
||||
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_stufeform["description"] = $_REQUEST["input_description"];
|
||||
$input_stufeform["short_text"] = $_REQUEST["input_short_text"];
|
||||
$input_stufeform["id"] = $_REQUEST["input_id"];
|
||||
require_once("edit_stufeform_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function edit_stufeform( $_id = "", $messages = array() ) {
|
||||
|
||||
$input_id = '';
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} if(isset($_REQUEST['input_id']) && $_id == ''){
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM stufe WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_stufeform = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_stufeform_cardform.inc.php");
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_stufeform = array();
|
||||
|
||||
require_once("edit_stufeform_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function delete_stufeform() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM stufe WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once("edit_stufe_listform.inc.php");
|
||||
}
|
||||
?>
|
||||
35
module/bewerber/edit_stufe_listform.inc.php
Normal file
35
module/bewerber/edit_stufe_listform.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$formname = "form_stufe_list";
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_stufeform', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_stufeform')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_stufeform', false, '{$translation->get('delete_stufeform_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_stufe'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT stufe.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from stufe left join main_admin_user ON stufe.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . ") ORDER BY sorting asc";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_stufeform", FALSE, 'update_sortorder_stufe', "sendRequest('delete_stufeform', false, '{$translation->get('delete_stufeform_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
102
module/bewerber/edit_stufeform_cardform.inc.php
Normal file
102
module/bewerber/edit_stufeform_cardform.inc.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "bewerber_forms";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$is_survey = 0;
|
||||
if(isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
$is_survey = 1;
|
||||
}
|
||||
$query = 'SELECT * FROM google_recaptcha';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$grecaptcha = @mysqli_fetch_array($result);
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($grecaptcha["secretkey"] == "" && $grecaptcha["websitekey"] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_stufeform["id"] == "") {
|
||||
|
||||
echo $translation->get("new_stufeform");
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
echo $translation->get("edit_stufeform");
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_stufeform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_stufeform', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_stufeform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_stufeform', true, '{$translation->get('delete_stufeform_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_stufeform["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_stufeform["description"], 255) ?>
|
||||
<? input($translation->get("short_text"), "input_short_text", "smalltextarea", $input_stufeform["short_text"], 255) ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_stufeform["id"] != "") {
|
||||
show_changed_on($input_stufeform["id"], "stufe");
|
||||
show_changed_by($input_stufeform["id"], "stufe");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
|
||||
?>
|
||||
218
module/bewerber/process/edit_process.inc.php
Normal file
218
module/bewerber/process/edit_process.inc.php
Normal file
@@ -0,0 +1,218 @@
|
||||
<?
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
switch ($action) {
|
||||
case 'edit_processform':
|
||||
edit_processform();
|
||||
break;
|
||||
|
||||
case 'delete_processform':
|
||||
delete_processform();
|
||||
break;
|
||||
case 'new_processform':
|
||||
|
||||
require_once("edit_processform_cardform.inc.php");
|
||||
break;
|
||||
|
||||
case 'save_processform':
|
||||
save_processform();
|
||||
break;
|
||||
|
||||
case 'moveup_line_processform':
|
||||
moveup_line_processform();
|
||||
require_once("edit_process_listform.inc.php");
|
||||
break;
|
||||
case 'movedown_line_processform':
|
||||
movedown_line_processform();
|
||||
require_once("edit_process_listform.inc.php");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
require_once("edit_process_listform.inc.php");
|
||||
|
||||
break;
|
||||
}
|
||||
function save_processform() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE bewerber_process SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
short_text = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_short_text"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
code = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"])."'
|
||||
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
|
||||
} else {
|
||||
|
||||
$query = "INSERT INTO bewerber_process
|
||||
(main_language_id, description, modified_date, modified_user, short_text, code)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_short_text']) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_code']) . "'
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if ($_REQUEST["input_code"] <> urlencode($_REQUEST["input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("processform_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("processform_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
$stufe = array();
|
||||
$stufe_ids = $_POST['select_stufe'];
|
||||
if($stufe_ids != NULL && isset($_POST['select_stufe'])){
|
||||
|
||||
$stufe = explode(',', $stufe_ids);
|
||||
}
|
||||
|
||||
if(!empty($stufe) && gettype($stufe) == 'array') {
|
||||
$deleteOld = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM bewerber_process_stufe WHERE process_id='".$input_id."'");
|
||||
|
||||
foreach($stufe as $key => $val){
|
||||
$query = "INSERT INTO bewerber_process_stufe
|
||||
(stufe_id, process_id)
|
||||
VALUES (
|
||||
" . $val . ",
|
||||
'" . $input_id . "'
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
edit_processform($input_id, $messages);
|
||||
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_processform["description"] = $_REQUEST["input_description"];
|
||||
$input_processform["short_text"] = $_REQUEST["input_short_text"];
|
||||
$input_processform["id"] = $_REQUEST["input_id"];
|
||||
require_once("edit_processform_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function edit_processform( $_id = "", $messages = array() ) {
|
||||
|
||||
$input_id = '';
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} if(isset($_REQUEST['input_id']) && $_id == ''){
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM bewerber_process WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_processform = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_processform_cardform.inc.php");
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_processform = array();
|
||||
|
||||
require_once("edit_processform_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function delete_processform() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM bewerber_process WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once("edit_process_listform.inc.php");
|
||||
}
|
||||
function create_stufe_set($process_id){
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
|
||||
$query = "SELECT * FROM stufe WHERE main_language_id = '" . $GLOBALS["language"]['id'] . "'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$preselect = array();
|
||||
$query2 = "SELECT * FROM bewerber_process_stufe WHERE process_id = '" . $process_id . "'";
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
|
||||
while($row2 = @mysqli_fetch_array($result2)){
|
||||
array_push($preselect,$row2['stufe_id']);
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="label"><?php echo $translation->get("select_stufe"); ?></div>
|
||||
<div class="groups bc-select-ui ui fluid multiple search selection dropdown" style="clear:both;display:inline-block;">
|
||||
<input type="hidden" name="select_stufe">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text"><?php echo $translation->get("select_stufe"); ?></div>
|
||||
<div class="menu">
|
||||
<?
|
||||
|
||||
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
echo "<div class=\"item\" data-value=\"{$row['id']}\">".$row["description"]."</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/Semantic-UI-master/semantic.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/plugins/Semantic-UI-master/bc-semantic.css?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/Semantic-UI-master/bc-semantic.css')?>">
|
||||
<script>
|
||||
var $y = jQuery.noConflict();
|
||||
|
||||
$y( document ).ready(function() {
|
||||
$y('.groups.ui.fluid.multiple.dropdown').dropdown('set selected', <?= json_encode($preselect) ?>);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<? }
|
||||
?>
|
||||
35
module/bewerber/process/edit_process_listform.inc.php
Normal file
35
module/bewerber/process/edit_process_listform.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$formname = "form_process_list";
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_processform', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_processform')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_processform', false, '{$translation->get('delete_processform_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_process'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT bewerber_process.id, description AS '" . $translation->get("description") . "', code, from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from bewerber_process left join main_admin_user ON bewerber_process.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . ") ORDER BY sorting asc";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_processform", FALSE, 'update_sortorder_process', "sendRequest('delete_processform', false, '{$translation->get('delete_processform_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
112
module/bewerber/process/edit_processform_cardform.inc.php
Normal file
112
module/bewerber/process/edit_processform_cardform.inc.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "bewerber_forms";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$is_survey = 0;
|
||||
if(isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
$is_survey = 1;
|
||||
}
|
||||
$query = 'SELECT * FROM google_recaptcha';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$grecaptcha = @mysqli_fetch_array($result);
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($grecaptcha["secretkey"] == "" && $grecaptcha["websitekey"] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_processform["id"] == "") {
|
||||
|
||||
echo $translation->get("new_processform");
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
echo $translation->get("edit_processform");
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_processform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_processform', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_processform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_processform', true, '{$translation->get('delete_processform_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_processform["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_processform["description"], 255) ?>
|
||||
<? input($translation->get("Code"), "input_code", "text", $input_processform["code"], 255) ?>
|
||||
<? input($translation->get("short_text"), "input_short_text", "smalltextarea", $input_processform["short_text"], 255) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_processform["id"] != "") {
|
||||
show_changed_on($input_processform["id"], "bewerber_process");
|
||||
show_changed_by($input_processform["id"], "bewerber_process");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_processform["id"] != "") {
|
||||
create_stufe_set($input_processform["id"]);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
|
||||
?>
|
||||
11
module/bewerber/process/process.php
Normal file
11
module/bewerber/process/process.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
function process_edit() {
|
||||
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_process.inc.php';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
11
module/bewerber/stufe.php
Normal file
11
module/bewerber/stufe.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
function stufe_edit() {
|
||||
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_stufe.inc.php';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
18
module/bewerber/user/bewerber.php
Normal file
18
module/bewerber/user/bewerber.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
function bewerber_edit() {
|
||||
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_bewerber.inc.php';
|
||||
}
|
||||
function bewerbung_edit(){
|
||||
if(!isset($_REQUEST["action"]) || $_REQUEST["action"] == ''){
|
||||
$_REQUEST["action"] = 'bewerbung';
|
||||
}
|
||||
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_bewerber.inc.php';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
482
module/bewerber/user/edit_bewerber.inc.php
Normal file
482
module/bewerber/user/edit_bewerber.inc.php
Normal file
@@ -0,0 +1,482 @@
|
||||
<?
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'edit_bewerberform':
|
||||
edit_bewerberform();
|
||||
break;
|
||||
|
||||
case 'delete_bewerberform':
|
||||
delete_bewerberform();
|
||||
break;
|
||||
|
||||
|
||||
case 'save_bewerberform':
|
||||
save_bewerberform();
|
||||
break;
|
||||
case 'save_bewerbungform':
|
||||
save_bewerbungform();
|
||||
break;
|
||||
case 'bewerbung':
|
||||
require_once("edit_bewerbung_listform.inc.php");
|
||||
break;
|
||||
case 'edit_bewerbung':
|
||||
|
||||
edit_bewerbung();
|
||||
break;
|
||||
case 'loadProcessStufe':
|
||||
loadProcessStufe();
|
||||
break;
|
||||
default:
|
||||
|
||||
require_once("edit_bewerber_listform.inc.php");
|
||||
|
||||
break;
|
||||
}
|
||||
function save_bewerbungform() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
|
||||
if ($_REQUEST["user_id"] <> '') {
|
||||
$query = "UPDATE bewerber_user SET
|
||||
name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
email = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_email"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . "
|
||||
|
||||
|
||||
WHERE id = '" . $_REQUEST["user_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
|
||||
$input_id = $_REQUEST["user_id"];
|
||||
|
||||
} else {
|
||||
|
||||
$query = "INSERT INTO bewerber_user
|
||||
(main_language_id, name, modified_date, modified_user, email)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_name']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_email']) . "'
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_name"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_name") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_email"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_email") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("user_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("user_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
$process = '';
|
||||
if( isset($_POST['select_process'])){
|
||||
|
||||
$process = $_REQUEST['select_process'];
|
||||
}
|
||||
|
||||
if($process != '') {
|
||||
$queryDel = "DELETE FROM bewerber_user_process WHERE user_id='".$input_id."' AND main_collection_id = '".$_REQUEST['main_collection_id']."'";
|
||||
|
||||
$deleteOld = @mysqli_query($GLOBALS["mysql_con"], $queryDel );
|
||||
|
||||
|
||||
$query = "INSERT INTO bewerber_user_process
|
||||
(user_id, process_id, main_collection_id)
|
||||
VALUES (
|
||||
" . $input_id . ",
|
||||
'" . $process . "',
|
||||
'".$_REQUEST['main_collection_id']."'
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$stufe = array();
|
||||
$stufe_ids = $_POST['select_stufe'];
|
||||
if($stufe_ids != NULL && isset($_POST['select_stufe'])){
|
||||
|
||||
$stufe = explode(',', $stufe_ids);
|
||||
}
|
||||
$queryDel = "DELETE FROM bewerbung_process_stufe WHERE bewerbung_id = '".$_REQUEST['input_id']."' AND user_id = '".$input_id."'";
|
||||
$deleteOldStufe = @mysqli_query($GLOBALS["mysql_con"],$queryDel);
|
||||
|
||||
if(!empty($stufe) && gettype($stufe) == 'array') {
|
||||
|
||||
foreach($stufe as $key => $val){
|
||||
$query = "INSERT INTO bewerbung_process_stufe
|
||||
(bewerbung_id, stufe_id, process_id, user_id)
|
||||
VALUES (
|
||||
" . $_REQUEST['input_id'] . ",
|
||||
" . $val . ",
|
||||
'" . $process . "',
|
||||
" . $input_id . "
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$_REQUEST['action'] = 'save_bewerbungform';
|
||||
edit_bewerbung($_REQUEST['input_id'], $messages);
|
||||
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_bewerberform["name"] = $_REQUEST["input_name"];
|
||||
$input_bewerberform["email"] = $_REQUEST["input_email"];
|
||||
$input_bewerberform["input_id"] = $_REQUEST["input_id"];
|
||||
require_once("edit_bewerbung_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function save_bewerberform() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE bewerber_user SET
|
||||
name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
email = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_email"]) . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . "
|
||||
|
||||
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
|
||||
} else {
|
||||
|
||||
$query = "INSERT INTO bewerber_user
|
||||
(main_language_id, name, modified_date, modified_user, email)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_name']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_email']) . "'
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_name"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_name") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_email"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_email") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("user_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("user_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
$process = array();
|
||||
$process_ids = $_POST['select_process'];
|
||||
if($process_ids != NULL && isset($_POST['select_process'])){
|
||||
|
||||
$process = explode(',', $process_ids);
|
||||
}
|
||||
|
||||
if(!empty($process) && gettype($process) == 'array') {
|
||||
$deleteOld = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM bewerber_user_process WHERE user_id='".$input_id."'");
|
||||
|
||||
foreach($process as $key => $val){
|
||||
$query = "INSERT INTO bewerber_user_process
|
||||
(user_id, process_id)
|
||||
VALUES (
|
||||
" . $input_id . ",
|
||||
'" . $val . "'
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// notes
|
||||
|
||||
$deleteData = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM bewerber_user_notes WHERE user_id='".$input_id."' ");
|
||||
print_r($options);
|
||||
if(isset($_REQUEST['totalOption']) && $_REQUEST['totalOption'] > 0){
|
||||
$options = $_REQUEST['totalOption'] ;
|
||||
for($column = 0; $column <= $options; $column++){
|
||||
|
||||
if (array_key_exists("input_user_note_" . $input_id."_".$column,$_POST) && $_POST["input_user_note_" . $input_id."_".$column] != "" && $_POST["input_user_note_" . $input_id."_".$column] != NULL) {
|
||||
|
||||
$query = "INSERT INTO bewerber_user_notes
|
||||
(user_id, notes)
|
||||
VALUES (
|
||||
" . $input_id . ",
|
||||
'" . $_POST["input_user_note_" . $input_id."_".$column] . "'
|
||||
)";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
}
|
||||
// notea end
|
||||
edit_bewerberform($input_id, $messages);
|
||||
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_bewerberform["name"] = $_REQUEST["input_name"];
|
||||
$input_bewerberform["email"] = $_REQUEST["input_email"];
|
||||
$input_bewerberform["id"] = $_REQUEST["input_id"];
|
||||
require_once("edit_bewerber_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function edit_bewerbung( $_id = "", $messages = array() ) {
|
||||
|
||||
$input_id = '';
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} if((isset($_REQUEST['input_id']) || isset($_REQUEST['data-inputid']) ) && $_id == ''){
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['data-inputid'])){
|
||||
$input_id = $_REQUEST["data-inputid"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT bu.*, bun.id as bunID, bun.main_collection_id, bun.contact_id FROM bewerber_user as bu INNER JOIN bewerbung as bun on bu.id = bun.user_id WHERE bun.id = '" . $input_id . "' LIMIT 1";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_bewerberform = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_bewerbung_cardform.inc.php");
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_bewerberform = array();
|
||||
|
||||
require_once("edit_bewerbung_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function edit_bewerberform( $_id = "", $messages = array() ) {
|
||||
|
||||
$input_id = '';
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} if(isset($_REQUEST['input_id']) && $_id == ''){
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
if(isset($_REQUEST['bewerber_id'])){
|
||||
$input_id = $_REQUEST['bewerber_id'];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM bewerber_user WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_bewerberform = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_bewerber_cardform.inc.php");
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_bewerberform = array();
|
||||
|
||||
require_once("edit_bewerber_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function delete_processform() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM bewerber_user WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once("edit_process_listform.inc.php");
|
||||
}
|
||||
function create_process_set($user_id, $collection_id){
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
|
||||
$query = "SELECT * FROM bewerber_process WHERE main_language_id = '" . $GLOBALS["language"]['id'] . "'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$preselect = array();
|
||||
$query2 = "SELECT * FROM bewerber_user_process WHERE user_id = '" . $user_id . "' AND main_collection_id = ".$collection_id;
|
||||
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
|
||||
while($row2 = @mysqli_fetch_array($result2)){
|
||||
array_push($preselect,$row2['process_id']);
|
||||
}
|
||||
echo "<div class=\"label\"><label for=\"" ."select_process" . "\">" . $translation->get("select_process") . "</label></div>";
|
||||
echo "<div class=\"input\"><select onchange=\"loadProcessStufe(this.value);\" class=\"bigselect\" name=\"" . "select_process" . "\" id=\"" . "select_process" . "\">";
|
||||
|
||||
|
||||
// neue typen die nur fuer kollektionen vorgesehen sind
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
$selected = '';
|
||||
if (in_array($row['id'], $preselect)) {
|
||||
$selected = 'selected="selected"';
|
||||
}
|
||||
echo "<option " . $selected . " value=\"" . $row['id'] . "\">" . $row["description"].' - '.$row['code'] . "</option>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "</select>";
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<? }
|
||||
function loadProcessStufe(){
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$process_id = $_REQUEST['process_id'];
|
||||
$query = "SELECT st.* FROM stufe as st INNER JOIN bewerber_process_stufe as bps on st.id = bps.stufe_id WHERE st.main_language_id = '" . $GLOBALS["language"]['id'] . "' AND process_id = ".$process_id ;
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="label"><?php echo $translation->get("select_stufe"); ?></div>
|
||||
<div class="groups bc-select-ui ui fluid multiple search selection dropdown" style="clear:both;display:inline-block;">
|
||||
<input type="hidden" name="select_stufe">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text"><?php echo $translation->get("select_stufe"); ?></div>
|
||||
<div class="menu">
|
||||
<?
|
||||
|
||||
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
echo "<div class=\"item\" data-value=\"{$row['id']}\">".$row["description"]."</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/Semantic-UI-master/semantic.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/plugins/Semantic-UI-master/bc-semantic.css?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/Semantic-UI-master/bc-semantic.css')?>">
|
||||
<script>
|
||||
var $y = jQuery.noConflict();
|
||||
|
||||
$y( document ).ready(function() {
|
||||
$y('.groups.ui.fluid.multiple.dropdown').dropdown();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<?
|
||||
}
|
||||
function create_stufe_set($bunID){
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
|
||||
$query = "SELECT st.* FROM stufe as st INNER JOIN bewerbung_process_stufe as bps on st.id = bps.stufe_id WHERE main_language_id = '" . $GLOBALS["language"]['id'] . "' AND bewerbung_id = ".$bunID;
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$preselect = array();
|
||||
$query2 = "SELECT * FROM bewerbung_process_stufe WHERE bewerbung_id = '" . $bunID . "'";
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
|
||||
while($row2 = @mysqli_fetch_array($result2)){
|
||||
array_push($preselect,$row2['stufe_id']);
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="label"><?php echo $translation->get("select_stufe"); ?></div>
|
||||
<div class="groups bc-select-ui ui fluid multiple search selection dropdown" style="clear:both;display:inline-block;">
|
||||
<input type="hidden" name="select_stufe">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text"><?php echo $translation->get("select_stufe"); ?></div>
|
||||
<div class="menu">
|
||||
<?
|
||||
|
||||
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
echo "<div class=\"item\" data-value=\"{$row['id']}\">".$row["description"]."</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/Semantic-UI-master/semantic.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/plugins/Semantic-UI-master/bc-semantic.css?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/Semantic-UI-master/bc-semantic.css')?>">
|
||||
<script>
|
||||
var $y = jQuery.noConflict();
|
||||
|
||||
$y( document ).ready(function() {
|
||||
$y('.groups.ui.fluid.multiple.dropdown').dropdown('set selected', <?= json_encode($preselect) ?>);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<? }
|
||||
|
||||
function create_notes_set($user_id){
|
||||
$query = "SELECT * FROM bewerber_user_notes WHERE user_id = ".$user_id;
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$counter = 0;
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
echo '<div class="notes_input input_note_'.$counter.'">';
|
||||
echo '<textarea name="input_user_note_'.$user_id.'_'.$counter.'"> '.$row['notes'].'</textarea>';
|
||||
|
||||
echo '<button type="button" data-counter="'.$counter.'" class="r-btnRemove btnRemove btn btn-danger">Entfernen -</button>';
|
||||
echo '</div>';
|
||||
$counter++;
|
||||
}
|
||||
echo '<input type="hidden" id="totalOption" name="totalOption" value="'.$counter.'">';
|
||||
}
|
||||
?>
|
||||
156
module/bewerber/user/edit_bewerber_cardform.inc.php
Normal file
156
module/bewerber/user/edit_bewerber_cardform.inc.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "bewerber_forms";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$is_survey = 0;
|
||||
|
||||
$query = 'SELECT * FROM google_recaptcha';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$grecaptcha = @mysqli_fetch_array($result);
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($grecaptcha["secretkey"] == "" && $grecaptcha["websitekey"] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
|
||||
echo $translation->get("edit_user");
|
||||
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_bewerberform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_bewerberform', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_bewerberform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_bewerberform', true, '{$translation->get('delete_user_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_bewerberform["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("name"), "input_name", "text", $input_bewerberform["name"], 255) ?>
|
||||
<? input($translation->get("email"), "input_email", "text", $input_bewerberform["email"], 255) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_bewerberform["id"] != "") {
|
||||
show_changed_on($input_bewerberform["id"], "bewerber_user");
|
||||
show_changed_by($input_bewerberform["id"], "bewerber_user");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<div class="notes_section">
|
||||
<button style="position:inherit;" type="button" class="r-btnAdd btnAdd btn btn-primary" data-user="<?=$input_bewerberform["id"];?>">Hinzufügen +</button>
|
||||
<?php
|
||||
if ($input_bewerberform["id"] != "") {
|
||||
create_notes_set($input_bewerberform["id"]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?php $formname .= "_listing";
|
||||
?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="bewerber_id" type="hidden" value="<?= $input_bewerberform['id']; ?>">
|
||||
<?php
|
||||
$query = "SELECT bun.id, description as '". $translation->get("description")."', from_unixtime(bun.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from bewerber_user AS bu left join main_admin_user ON bu.modified_user = main_admin_user.id INNER JOIN bewerbung as bun on bu.id = bun.user_id INNER JOIN main_collection as mc on bun.main_collection_id = mc.id where (bu.id = " . (int)$input_bewerberform['id'] . ") ORDER BY id DESC";
|
||||
|
||||
$format = array('option', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_bewerbung", FALSE, 'update_sortorder_bewerber', "sendRequest('delete_bewerbung', false, '{$translation->get('delete_stufeform_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?
|
||||
|
||||
?>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
|
||||
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
||||
crossorigin="anonymous"></script>
|
||||
<script type="text/javascript">
|
||||
$('.btnAdd').click(function(){
|
||||
var counter = $('#totalOption').val();
|
||||
var user = $(this).attr('data-user');
|
||||
counter++;
|
||||
|
||||
$('#totalOption').val(counter);
|
||||
|
||||
$('.notes_section').append(loadNextModule(counter, user));
|
||||
});
|
||||
$('.btnRemove').click(function(){
|
||||
|
||||
counter = $(this).attr('data-counter');
|
||||
$('.input_note_'+ counter).remove();
|
||||
console.log('counter ist' + counter);
|
||||
counter--;
|
||||
$('#totalOption').val(counter);
|
||||
|
||||
|
||||
});
|
||||
function myFunctionDelete(counter){
|
||||
|
||||
$('.input_note_'+ counter).remove();
|
||||
|
||||
|
||||
counter--;
|
||||
$('#totalOption').val(counter);
|
||||
}
|
||||
function loadNextModule(counter, user_id){
|
||||
var html = '<div class="notes_input input_note_'+counter+'">' +
|
||||
'<textarea name="input_user_note_'+user_id+'_'+counter+'"> </textarea>'+
|
||||
'<button type="button" onclick="myFunctionDelete('+counter+')" data-counter="'+counter+'" class="r-btnRemove btnRemove btn btn-danger">Entfernen -</button>'+
|
||||
'</div>';
|
||||
|
||||
return html
|
||||
}
|
||||
</script>
|
||||
35
module/bewerber/user/edit_bewerber_listform.inc.php
Normal file
35
module/bewerber/user/edit_bewerber_listform.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$formname = "form_bewerber_list";
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_bewerberform')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_bewerberform', false, '{$translation->get('delete_user_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('bewerber'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT bu.id, bu.name AS '" . $translation->get("name") . "', from_unixtime(bu.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from bewerber_user AS bu left join main_admin_user ON bu.modified_user = main_admin_user.id INNER JOIN contactform_header as ch on bu.contact_form_id = ch.id where (bu.main_language_id = " . (int)$GLOBALS["language"]['id'] . ") ORDER BY id DESC";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_bewerberform", FALSE, 'update_sortorder_bewerber', "sendRequest('delete_bewerberform', false, '{$translation->get('delete_user_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
229
module/bewerber/user/edit_bewerbung_cardform.inc.php
Normal file
229
module/bewerber/user/edit_bewerbung_cardform.inc.php
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "bewerber_forms";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$bewerber_id = (isset($_REQUEST['bewerber_id']) ? $_REQUEST['bewerber_id'] : "");
|
||||
|
||||
$is_survey = 0;
|
||||
|
||||
$query = 'SELECT * FROM google_recaptcha';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$grecaptcha = @mysqli_fetch_array($result);
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($grecaptcha["secretkey"] == "" && $grecaptcha["websitekey"] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
|
||||
echo $translation->get("edit_bewerbung");
|
||||
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_bewerbungform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_bewerbungform', true, '', true)");
|
||||
|
||||
if($bewerber_id != ''){
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_bewerberform', true)");
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_bewerberform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_bewerbungform', true, '{$translation->get('delete_stufeform_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_bewerberform["bunID"] ?>">
|
||||
<input name="user_id" type="hidden" value="<?= $input_bewerberform["id"] ?>">
|
||||
<input name="bewerber_id" type="hidden" value="<?= $bewerber_id ?>">
|
||||
|
||||
<input name="contact_id" type="hidden" value="<?= $input_bewerberform["contact_id"] ?>">
|
||||
<input name="main_collection_id" type="hidden" value="<?= $input_bewerberform["main_collection_id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("name"), "input_name", "text", $input_bewerberform["name"], 255) ?>
|
||||
<? input($translation->get("email"), "input_email", "text", $input_bewerberform["email"], 255) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_bewerberform["id"] != "") {
|
||||
show_changed_on($input_bewerberform["bunId"], "bewerbung");
|
||||
show_changed_by($input_bewerberform["bunID"], "bewerbung");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_bewerberform["id"] != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE id = ".$input_bewerberform["main_collection_id"];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$collection = @mysqli_fetch_array($result);
|
||||
input($translation->get("job_applied"), "main_collection", "text", $collection["description"], 255, TRUE) ;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_bewerberform["id"] != "") {
|
||||
create_process_set($input_bewerberform["id"], $input_bewerberform["main_collection_id"]);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($input_bewerberform["id"] != "") { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
|
||||
<div class="process_stufe">
|
||||
<?php
|
||||
if ($input_bewerberform["id"] != "") {
|
||||
create_stufe_set($input_bewerberform["bunID"]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<hr>
|
||||
<h2><?php echo $translation->get("top_userdata");; ?></h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$query = "SELECT cl.* FROM contactform_line as cl INNER JOIN contactform_header as ch on cl.header_id = ch.id WHERE header_id = '" . $input_bewerberform["contact_id"] . "' AND code != 'registration_name' AND code != 'registration_email' AND is_registration = 1 ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($field = @mysqli_fetch_array($result)) {
|
||||
$queryLink = "SELECT bucl.* FROM contactform_line as cl INNER JOIN bewerber_user_contact_link as bucl on cl.id = bucl.line_id WHERE header_id = '" . $input_bewerberform["contact_id"] . "' AND line_id = ".$field['id']." AND user_id = ". $input_bewerberform["id"]." ORDER BY sorting ASC";
|
||||
$resultLink = @mysqli_query($GLOBALS['mysql_con'], $queryLink);
|
||||
$row = @mysqli_fetch_array($resultLink);
|
||||
echo '<td>';
|
||||
input($field['name'], $field["code"], "text", $row["content"], 255, TRUE) ;
|
||||
echo '</td>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function loadProcessStufe( process_id ) {
|
||||
|
||||
|
||||
$('.process_stufe', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (process_id == "" || process_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>' )[0]);
|
||||
formData.append("process_id", process_id);
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
url : "?action=loadProcessStufe",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
// dataType : 'html',
|
||||
success : function ( output, status, xhr ) {
|
||||
console.log('log ist' + xhr.getResponseHeader('REQUIRES_AUTH'));
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.loader').hide();
|
||||
$('.process_stufe' ).html(output);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
var msg = '';
|
||||
if (jqXHR.status === 0) {
|
||||
msg = 'Not connect.\n Verify Network.';
|
||||
} else if (jqXHR.status == 404) {
|
||||
msg = 'Requested page not found. [404]';
|
||||
} else if (jqXHR.status == 500) {
|
||||
msg = 'Internal Server Error [500].';
|
||||
} else if (exception === 'parsererror') {
|
||||
msg = 'Requested JSON parse failed.';
|
||||
} else if (exception === 'timeout') {
|
||||
msg = 'Time out error.';
|
||||
} else if (exception === 'abort') {
|
||||
msg = 'Ajax request aborted.';
|
||||
} else {
|
||||
msg = 'Uncaught Error.\n' + jqXHR.responseText;
|
||||
}
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
35
module/bewerber/user/edit_bewerbung_listform.inc.php
Normal file
35
module/bewerber/user/edit_bewerbung_listform.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$formname = "form_bewerber_list";
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_bewerbung')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_bewerbung', false, '{$translation->get('delete_stufeform_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_bewerbung'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT bun.id, bu.name AS '" . $translation->get("name") . "', description as '". $translation->get("description")."', from_unixtime(bun.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from bewerber_user AS bu left join main_admin_user ON bu.modified_user = main_admin_user.id INNER JOIN bewerbung as bun on bu.id = bun.user_id INNER JOIN main_collection as mc on bun.main_collection_id = mc.id where (bu.main_language_id = " . (int)$GLOBALS["language"]['id'] . ") ORDER BY id DESC";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_bewerbung", FALSE, 'update_sortorder_bewerber', "sendRequest('delete_bewerbung', false, '{$translation->get('delete_stufeform_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
9
module/calendar/calendar.php
Normal file
9
module/calendar/calendar.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
function calendar_show() {
|
||||
require("show_calendar.inc.php");
|
||||
}
|
||||
|
||||
function calendar_edit() {
|
||||
require_once('edit_calendar.inc.php');
|
||||
}
|
||||
250
module/calendar/calendar_collection_serial.php
Normal file
250
module/calendar/calendar_collection_serial.php
Normal file
@@ -0,0 +1,250 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$query = "SELECT * FROM calendar_serial WHERE main_collection_id = " . $input_collection['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if(@mysqli_num_rows($result) > 0) {
|
||||
$row = mysqli_fetch_array($result);
|
||||
}
|
||||
|
||||
$date_from = new DateTime($row['date_from']);
|
||||
$date_to = new DateTime($row['date_to']);
|
||||
|
||||
$weekday = array("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag");
|
||||
$weekday_en = array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday");
|
||||
$month = array("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
|
||||
$ordinal = array("ersten", "zweiten", "dritten", "vierten", "letzten");
|
||||
$repeating_type_en= array("daily", "weekly", "monthly", "yearly");
|
||||
$repeating_type = array("Tächlich", "Wöchentlich", "Monatlich", "Jährlich");
|
||||
|
||||
$default_value = 1;
|
||||
$value = $default_value;
|
||||
|
||||
function getCalendarValue($value, $type, $classname = ""){
|
||||
$amount = 0;
|
||||
switch ($value['repeating_type']) {
|
||||
case 'daily':
|
||||
$amount = $value['day_nr'];
|
||||
break;
|
||||
case 'weekly':
|
||||
$amount = $value['week_nr'];
|
||||
break;
|
||||
case 'monthly':
|
||||
if($value['repeating_radio'] == 1){
|
||||
if($classname == 'first_day'){
|
||||
$amount = $value['day_nr'];
|
||||
}else if($classname == 'first_month'){
|
||||
$amount = $value['month_nr'];
|
||||
}
|
||||
}else{
|
||||
if($classname == 'second_day'){
|
||||
$amount = $value['day_nr'];
|
||||
}else if($classname == 'second_week'){
|
||||
$amount = $value['week_nr'];
|
||||
}else if($classname == 'second_month'){
|
||||
$amount = $value['month_nr'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'yearly':
|
||||
if($classname == 'year_nr'){
|
||||
$amount = $value['year_nr'];
|
||||
}
|
||||
if($value['repeating_radio'] == 1){
|
||||
if($classname == 'first_day'){
|
||||
$amount = $value['day_nr'];
|
||||
}else if($classname == 'first_month'){
|
||||
$amount = $value['month_nr'];
|
||||
}
|
||||
}else{
|
||||
if($classname == 'second_day'){
|
||||
$amount = $value['day_nr'];
|
||||
}else if($classname == 'second_week'){
|
||||
$amount = $value['week_nr'];
|
||||
}else if($classname == 'second_month'){
|
||||
$amount = $value['month_nr'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if($type != $value['repeating_type']){
|
||||
$amount = 0;
|
||||
}
|
||||
return $amount;
|
||||
}
|
||||
?>
|
||||
|
||||
<button id="serientermin">Serientermin erstellen</button>
|
||||
<div class='serial_date'>
|
||||
<div class="serial_heading">
|
||||
<h3>Serienmuster auswählen</h3>
|
||||
<button onclick="closeSerialize();saveCollection(false);" id="serienterminclose"></button>
|
||||
</div>
|
||||
<label id='date_from'>Von</label>
|
||||
<input id='date_from' type="date" name="date_from" value="<?= $date_from->format('Y-m-d') ?>">
|
||||
<label id='date_to'>Bis</label>
|
||||
<input id='date_to' type="date" name="date_to" value="<?= $date_to->format('Y-m-d') ?>">
|
||||
<label id='start_time'>Beginn</label>
|
||||
<input id='start_time' type="time" name="start_time" value="<?= $row['start_time']?>">
|
||||
<label id='end_time'>Ende</label>
|
||||
<input id='end_time' type="time" name="end_time" value="<?= $row['end_time']?>">
|
||||
<div class="serial-content">
|
||||
<div class="radio-buttons">
|
||||
<?php createRadioButtons($repeating_type, $repeating_type_en, $row['repeating_type'])?>
|
||||
<input type='hidden' value='<?= $row['repeating_type'] ?>' name='input_repeating_type' id='repeating_type'>
|
||||
<input type='hidden' value='<?= $row['repeating_radio'] ?>' name='input_repeating_radio' id='repeating_radio'>
|
||||
</div>
|
||||
<div class="option-wrapper">
|
||||
<div class='daily repeating_type' style='display: none'>
|
||||
<h4>Täglich</h4>
|
||||
Jede/Alle <input min="0" type="number" name="daily_count" value="<?= getCalendarValue($row, 'daily') ?>"> Tag(e)
|
||||
</div>
|
||||
<div class='weekly repeating_type' style='display: none'>
|
||||
<h4>Wöchentlich</h4>
|
||||
Jede/Alle <input min="0" type="number" name="weekly_count" value="<?= getCalendarValue($row, 'weekly') ?>"> Woche(n) am
|
||||
<div class="week-wrapper">
|
||||
<?php createCheckbox($weekday, $weekday_en, $row)?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='monthly repeating_type' style='display: none'>
|
||||
<h4>Monatlich</h4>
|
||||
<div class="monthly-option">
|
||||
<input type="radio" <?= getRadioChecked($row['repeating_radio'], '1') ?> name="monthly_type" id="monthly_first" value="1"/>
|
||||
|
||||
<label for='monthly_first'>Am</label>
|
||||
<input min="0" type="number" name="monthly_day_1" value="<?= getCalendarValue($row, 'monthly', 'first_day') ?>">. Tag jedes
|
||||
<input min="0" type="number" name="monthly_count_1" value="<?= getCalendarValue($row, 'monthly', 'first_month') ?>">. Monats
|
||||
</div>
|
||||
<div class="monthly-option">
|
||||
<input type="radio" <?= getRadioChecked($row['repeating_radio'], '2') ?> name="monthly_type" id="monthly_second" value="2"/>
|
||||
|
||||
<label for='monthly_second'>Am</label>
|
||||
<select name='monthly_day_2'>
|
||||
<?php createDropdown($ordinal, getCalendarValue($row, 'monthly', 'second_day'))?>
|
||||
</select>
|
||||
<select name='monthly_week_2'>
|
||||
<?php createDropdown($weekday, getCalendarValue($row, 'monthly', 'second_week'))?>
|
||||
</select>
|
||||
jeden/alle <input min="0" type="number" name="montly_count_2" value="<?= getCalendarValue($row, 'monthly', 'second_month') ?>"> Monat(e)
|
||||
</div>
|
||||
</div>
|
||||
<div class='yearly repeating_type' style='display: none'>
|
||||
<h4>Jährlich</h4>
|
||||
<div class="yearly-options">
|
||||
Jedes/Alle <input min="0" type="number" name="yearly_count" value="<?= getCalendarValue($row, 'yearly', 'year_nr') ?>"> Jahr(n)
|
||||
</div>
|
||||
<div class="yearly-options">
|
||||
<label for='yearly_first'>Am</label>
|
||||
<input type="radio" <?= getRadioChecked($row['repeating_radio'], '1') ?> name="yearly_type" id="yearly_first" value="1"/>
|
||||
<input type="number" name="yearly_day_1" value="<?= getCalendarValue($row, 'yearly', 'first_day') ?>">.
|
||||
<select name='yearly_month_1'>
|
||||
<?php createDropdown($month, getCalendarValue($row, 'yearly', 'first_month'))?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="yearly-options">
|
||||
<label for='yearly_second'>Am</label>
|
||||
<input type="radio" <?= getRadioChecked($row['repeating_radio'], '2') ?> name="yearly_type" id="yearly_second" value="2"/>
|
||||
<select name='yearly_day_2'>
|
||||
<?php createDropdown($ordinal, getCalendarValue($row, 'yearly', 'second_day'))?>
|
||||
</select>
|
||||
<select name='yearly_week_2'>
|
||||
<?php createDropdown($weekday, getCalendarValue($row, 'yearly', 'second_week'))?>
|
||||
</select>
|
||||
im
|
||||
<select name='yearly_month_2'>
|
||||
<?php createDropdown($month, getCalendarValue($row, 'yearly', 'second_month'))?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-overlay"></div>
|
||||
|
||||
<script>
|
||||
function show_type(type){
|
||||
$(".repeating_type").hide();
|
||||
$("."+type).show();
|
||||
}
|
||||
|
||||
$(".repeating_type").each(function(){
|
||||
let repeating_type = $('input[name="repeating_type"]:checked').val();
|
||||
if($(this).hasClass(repeating_type)){
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
|
||||
$("button#serientermin").click(function(){
|
||||
$(".serial_date").addClass("modal-open");
|
||||
$(".serial_date.modal-open").prependTo("body");
|
||||
$(".modal-overlay").prependTo("body");
|
||||
$(".modal-overlay").show();
|
||||
$(this).hide()
|
||||
});
|
||||
|
||||
function closeSerialize(){
|
||||
$(".serial_date.modal-open").appendTo(".collection_form");
|
||||
$(".serial_date").removeClass("modal-open");
|
||||
$("button#serientermin").show();
|
||||
$(".modal-overlay").hide();
|
||||
}
|
||||
|
||||
$('input[name="repeating_type"]').change(function() {
|
||||
$('#repeating_type').val($(this).val());
|
||||
});
|
||||
|
||||
$('input[name="monthly_type"]').change(function() {
|
||||
$('#repeating_radio').val($(this).val());
|
||||
});
|
||||
|
||||
$('input[name="yearly_type"]').change(function() {
|
||||
$('#repeating_radio').val($(this).val());
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
function getRadioChecked($repeating_radio, $value){
|
||||
$checked = 'checked';
|
||||
if($repeating_radio == $value){
|
||||
return $checked;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function createDropdown($array, $active){
|
||||
echo "<option selected disabled>---</option>";
|
||||
foreach ($array as $key => $value) {
|
||||
$key = $key+1;
|
||||
$selected = "";
|
||||
if($key == $active){
|
||||
$selected = "selected";
|
||||
}
|
||||
echo "<option ".$selected." value='".$key."'>".$value."</option>";
|
||||
}
|
||||
}
|
||||
|
||||
function createCheckbox($array, $weekday_en, $row){
|
||||
foreach ($array as $key => $value) {
|
||||
$checked = "";
|
||||
if($row[$weekday_en[$key]] == 1){
|
||||
$checked = "checked";
|
||||
}
|
||||
echo "<label for='".$weekday_en[$key]."'>".$value."</label>";
|
||||
echo "<input ".$checked." type='checkbox' name='".$weekday_en[$key]."' id='".$weekday_en[$key]."'>";
|
||||
}
|
||||
}
|
||||
|
||||
function createRadioButtons($array, $repeating_type_en, $selected_type){
|
||||
foreach ($array as $key => $value) {
|
||||
$checked = "";
|
||||
if($repeating_type_en[$key] == $selected_type){
|
||||
$checked = "checked";
|
||||
}
|
||||
echo "<div class='radio-group'>";
|
||||
echo "<input ".$checked." type='radio' name='repeating_type' id='".$repeating_type_en[$key]."' value='".$repeating_type_en[$key]."' onclick='show_type(\"{$repeating_type_en[$key]}\");'/>";
|
||||
echo "<label for='".$repeating_type_en[$key]."'>".$value."</label>";
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
152
module/calendar/edit_calendar.inc.php
Normal file
152
module/calendar/edit_calendar.inc.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
||||
case 'edit_calendar':
|
||||
edit_calendar();
|
||||
break;
|
||||
case 'delete_calendar':
|
||||
delete_calendar();
|
||||
break;
|
||||
case 'new_calendar':
|
||||
require_once("edit_calendar_cardform.inc.php");
|
||||
break;
|
||||
case 'new_contact_calendar':
|
||||
require_once("edit_calendar_contact_cardform.inc.php");
|
||||
break;
|
||||
case 'save_calendar':
|
||||
save_calendar();
|
||||
break;
|
||||
|
||||
default:
|
||||
require_once("edit_calendar_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function edit_calendar( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM calendar_header WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_calendar = @mysqli_fetch_array($result);
|
||||
if(isset($_REQUEST['input_contactform_id'])){
|
||||
require_once("edit_calendar_contact_cardform.inc.php");
|
||||
}else{
|
||||
require_once("edit_calendar_cardform.inc.php");
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_calendar = array();
|
||||
require_once("edit_calendar_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_calendar() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM calendar_header WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// zuordnung von Seiten loeschen
|
||||
$query = "DELETE FROM main_page_link WHERE main_sitepart_id = 1 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
$query = "DELETE FROM multi_contactform_link WHERE main_sitepart_id = 1 AND main_sitepart_header_id = '" . $_REQUEST["input_id"]."'";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
update_sitepart_changes(1, $_REQUEST["input_id"], TRUE);
|
||||
}
|
||||
require_once("edit_calendar_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_calendar() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
$input_all_languages = ($_POST["input_all_languages"] == "on") ? 1 : 0;
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("calendar_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("calendar_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
update_sitepart_changes(1, $input_id);
|
||||
|
||||
if (is_page_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_page_id"], 1, $input_id) === FALSE) {
|
||||
assoc_sitepart(1, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_content_page();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_calendar($input_id, $messages);
|
||||
|
||||
} else if(is_contact_edit()){
|
||||
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_section_id"], 1, $input_id) === FALSE) {
|
||||
|
||||
assoc_sitepart(1, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_contactform();
|
||||
return;
|
||||
}
|
||||
|
||||
edit_calendar($input_id, $messages);
|
||||
}
|
||||
elseif (is_component_edit()) {
|
||||
header('EDIT_ERROR: 1'); // verhindern, dass overlay geschlossen wird
|
||||
if (line_already_exists($_REQUEST["input_component_id"], 1, $input_id) === FALSE) {
|
||||
assoc_sitepart(1, $input_id, FALSE);
|
||||
}
|
||||
|
||||
if ($_REQUEST['force_close'] == 1) {
|
||||
edit_component("", $messages);
|
||||
return;
|
||||
}
|
||||
|
||||
edit_calendar($input_id, $messages);
|
||||
} else {
|
||||
edit_calendar($input_id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_calendar["description"] = $_REQUEST["input_description"];
|
||||
$input_calendar["type"] = 0;
|
||||
$input_calendar["content"] = $_REQUEST["calendar"];
|
||||
$input_calendar["id"] = $_REQUEST["input_id"];
|
||||
$input_calendar["all_languages"] = $input_all_languages;
|
||||
require_once("edit_calendar_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
72
module/calendar/edit_calendar_cardform.inc.php
Normal file
72
module/calendar/edit_calendar_cardform.inc.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_calendar_card";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_calendar["id"] == "") {
|
||||
echo $translation->get("new_calendar");
|
||||
} else {
|
||||
echo $translation->get("edit_calendar");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
if (is_page_edit() || is_component_edit()) {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_calendar', true)"); ?>
|
||||
|
||||
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_calendar', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_calendar["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_calendar', true, '{$translation->get('delete_calendar_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit_calendar", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_calendar["id"] ?>">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="1">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_calendar["description"], 255) ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_calendar["all_languages"]) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($input_calendar["id"] != "") {
|
||||
show_changed_on($input_calendar["id"], "calendar_header");
|
||||
show_changed_by($input_calendar["id"], "calendar_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
68
module/calendar/ics.inc.php
Normal file
68
module/calendar/ics.inc.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
$calendar_id = $_GET['calendar'];
|
||||
|
||||
//Wird benötigt um Enviroment Variable zu holen
|
||||
session_start();
|
||||
$currDir = __DIR__;
|
||||
$rootDir = dirname(dirname($currDir));
|
||||
$mysydeDir = $rootDir . '/mysyde';
|
||||
|
||||
require_once($rootDir . '/vendor/autoload.php');
|
||||
require_once($rootDir . "/mysyde/frontend/frontend_functions.inc.php");
|
||||
|
||||
// $baseDir = rtrim(dirname(dirname(__DIR__,2),'/'));
|
||||
|
||||
$envDir = $rootDir . '/config';
|
||||
$envFilePath = $envDir . '/.env';
|
||||
if (is_dir($envDir) && file_exists($envFilePath) && is_file($envFilePath) && is_readable($envFilePath)) {
|
||||
$dotenv = new \Dotenv\Dotenv($envDir);
|
||||
$dotenv->load();
|
||||
}
|
||||
$common = $mysydeDir ."/common/common_functions.inc.php";
|
||||
require_once($common);
|
||||
|
||||
$connEnv = (local_environment()) ? $mysydeDir."/dc.config.php" : $mysydeDir."/dc-server.config.php";
|
||||
|
||||
require_once($connEnv);
|
||||
|
||||
db_connect();
|
||||
|
||||
function get_collection_data($collection_id, $content_id){
|
||||
$query = "SELECT * FROM main_collection_link WHERE main_collection_id = ".$collection_id . " AND main_collection_setup_content_id = ".$content_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
return $row['data'];
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM main_collection WHERE id = ".$calendar_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
|
||||
$uid = get_collection_rewrite($row['description'], $row['id']);
|
||||
|
||||
$start_date = new DateTime(get_collection_data($calendar_id, 54));
|
||||
|
||||
// ICS-Daten generieren
|
||||
$icsData = "BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID: ".$uid."
|
||||
BEGIN:VEVENT
|
||||
DTSTART:".$start_date->format('Ymd')."T100000Z
|
||||
DTEND:".$start_date->format('Ymd')."T100000Z
|
||||
SUMMARY: ".$row['description']."
|
||||
DESCRIPTION: ".$row['description']."
|
||||
END:VEVENT
|
||||
END:VCALENDAR";
|
||||
|
||||
// Dateinamen festlegen
|
||||
|
||||
$filename = $uid.".ics";
|
||||
|
||||
// ICS-Datei generieren
|
||||
header('Content-Type: text/calendar; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename=' . $filename);
|
||||
|
||||
echo $icsData;
|
||||
|
||||
|
||||
?>
|
||||
173
module/calendar/show_calendar.inc.php
Normal file
173
module/calendar/show_calendar.inc.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
$pdo = new PDO("mysql:host=".$GLOBALS['myservername'].";dbname=".$GLOBALS['mydb'].';charset=utf8', $GLOBALS['mylogin'], $GLOBALS['mypass']);
|
||||
$GLOBALS["pdo_conn"] = $pdo;
|
||||
|
||||
$select_collection = $GLOBALS['pdo_conn']->prepare("SELECT * FROM main_collection WHERE main_collection_setup_id = :main_collection_setup_id ORDER BY sorting ASC");
|
||||
$select_collection->execute(array(':main_collection_setup_id' => '47'));
|
||||
$res_collection = $select_collection->fetchALL(PDO::FETCH_ASSOC);
|
||||
$GLOBALS['array'] = array();
|
||||
|
||||
$weekday = array("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag");
|
||||
$GLOBALS['weekday_en'] = array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday");
|
||||
$month = array("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
|
||||
$GLOBALS['month_en'] = array("january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december");
|
||||
$ordinal = array("ersten", "zweiten", "dritten", "vierten", "letzten");
|
||||
$repeating_type_en= array("daily", "weekly", "monthly", "yearly");
|
||||
$repeating_type = array("Tächlich", "Wöchentlich", "Monatlich", "Jährlich");
|
||||
|
||||
foreach ($res_collection as $key => $value) {
|
||||
$serial = selectCalendarSerial($value['id']);
|
||||
$start_date = new DateTime($value['validity_from']);
|
||||
$end_date = new DateTime($value['validity_to']);
|
||||
switch ($serial['repeating_type']) {
|
||||
case 'daily':
|
||||
setDailyEvent($serial, $start_date, $end_date, $value['id']);
|
||||
break;
|
||||
case 'weekly':
|
||||
setWeeklyEvent($serial, $start_date, $end_date, $value['id']);
|
||||
break;
|
||||
case 'monthly':
|
||||
setMonthlyEvent($serial, $start_date, $end_date, $value['id']);
|
||||
break;
|
||||
case 'yearly':
|
||||
setYearlyEvent($serial, $start_date, $end_date, $value['id']);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function setDailyEvent($serial, $start_date, $end_date, $collection_id){
|
||||
$date = new DateTime($start_date->format('Y-m-d'));
|
||||
while ($date <= $end_date) {
|
||||
buildArray($collection_id, $date);
|
||||
if($serial == 0){
|
||||
$date->modify('+1 days');
|
||||
}else{
|
||||
$date->modify('+'.$serial['day_nr'].' days');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setWeeklyEvent($serial, $start_date, $end_date, $collection_id){
|
||||
$date = new DateTime($start_date->format('Y-m-d'));
|
||||
while ($date <= $end_date) {
|
||||
foreach ($GLOBALS['weekday_en'] as $weekday_key => $weekday_value) {
|
||||
if($serial[$weekday_value] != 0){
|
||||
$real_date = new DateTime(date("d.m.Y", strtotime($weekday_value, $date->getTimestamp())));
|
||||
buildArray($collection_id, $real_date);
|
||||
}
|
||||
}
|
||||
$date->modify('+'.$serial['week_nr'].' weeks');
|
||||
}
|
||||
}
|
||||
|
||||
function setMonthlyEvent($serial, $start_date, $end_date, $collection_id){
|
||||
switch ($serial['repeating_radio']) {
|
||||
case '1':
|
||||
$date = new DateTime($start_date->format('Y-m-').$serial['day_nr']);
|
||||
while ($date <= $end_date) {
|
||||
buildArray($collection_id, $date);
|
||||
$date->modify('+'.$serial['month_nr'].' months');
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
$date = new DateTime($start_date->format('Y-m-').'1');
|
||||
while ($date <= $end_date) {
|
||||
$real_date = new DateTime(date("d.m.Y", strtotime($serial['day_nr'] . $GLOBALS['weekday_en'][$serial['week_nr']-1], $date->getTimestamp())));
|
||||
buildArray($collection_id, $real_date);
|
||||
$date->modify('+'.$serial['month_nr'].' months');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function setYearlyEvent($serial, $start_date, $end_date, $collection_id){
|
||||
switch ($serial['repeating_radio']) {
|
||||
case '1':
|
||||
$date = new DateTime($start_date->format('Y-').$serial['month_nr'].'-'.$serial['day_nr']);
|
||||
while ($date <= $end_date) {
|
||||
buildArray($collection_id, $date);
|
||||
$date->modify('+'.$serial['year_nr'].' years');
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
$date = new DateTime($start_date->format('Y-m-').'1');
|
||||
while ($date <= $end_date) {
|
||||
$real_date = new DateTime(date("d.m.Y", strtotime($serial['day_nr'] . $GLOBALS['weekday_en'][$serial['week_nr']-1] . $GLOBALS['month_en'][$serial['month_nr']-1], $date->getTimestamp())));
|
||||
buildArray($collection_id, $real_date);
|
||||
$date->modify('+'.$serial['year_nr'].' years');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function buildArray($collection_id, $date){
|
||||
$select_collection = $GLOBALS['pdo_conn']->prepare("SELECT * FROM main_collection WHERE id = :id LIMIT 1");
|
||||
$select_collection->execute(array(':id' => $collection_id));
|
||||
$res_collection = $select_collection->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$title = selectCollectionData($collection_id, 199);
|
||||
$description = selectCollectionData($collection_id, 199);
|
||||
|
||||
$fullviewLinkEvent = get_link_to_navigation($GLOBALS["navigation"]['id']) . get_collection_rewrite($res_collection['description'], $res_collection['id']);
|
||||
$linkTitle = 'Mehr erfahren';
|
||||
|
||||
$GLOBALS['array'][] = [
|
||||
'id' => "event-".$collection_id,
|
||||
'name' => $title,
|
||||
'description' => $description,
|
||||
'link' => $fullviewLinkEvent,
|
||||
'link_title' => $linkTitle,
|
||||
'date' => $date->format('Y.m.d'),
|
||||
'type' => "event",
|
||||
'color' => "gray",
|
||||
'everyYear' => false
|
||||
];
|
||||
}
|
||||
|
||||
function selectCalendarSerial($collection_id){
|
||||
$select_collection = $GLOBALS['pdo_conn']->prepare("SELECT * FROM calendar_serial WHERE main_collection_id = :main_collection_id");
|
||||
$select_collection->execute(array(':main_collection_id' => $collection_id));
|
||||
$res_collection = $select_collection->fetch(PDO::FETCH_ASSOC);
|
||||
return $res_collection;
|
||||
}
|
||||
|
||||
function selectCollectionData($collection_id, $main_collection_setup_content_id){
|
||||
$select_collection = $GLOBALS['pdo_conn']->prepare("SELECT * FROM main_collection_link WHERE main_collection_id = :main_collection_id AND main_collection_setup_content_id = :main_collection_setup_content_id");
|
||||
$select_collection->execute(array(':main_collection_id' => $collection_id, ':main_collection_setup_content_id' => $main_collection_setup_content_id));
|
||||
$res_collection = $select_collection->fetch(PDO::FETCH_ASSOC);
|
||||
return $res_collection['data'];
|
||||
}
|
||||
?>
|
||||
|
||||
<div class='calendar'>
|
||||
<div id="calendar"></div>
|
||||
</div>
|
||||
<link rel="stylesheet" type="text/css" href="/plugins/evo-calendar/css/evo-calendar.min.css">
|
||||
<script type="text/javascript" src="/plugins/evo-calendar/js/evo-calendar.min.js?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/evo-calendar/js/evo-calendar.js')?>"></script>
|
||||
<script>
|
||||
var evoCalendar = [];
|
||||
$('#calendar').evoCalendar({
|
||||
todayHighlight: true,
|
||||
sidebarDisplayDefault: false,
|
||||
eventDisplayDefault: false,
|
||||
firstDayOfWeek: 1,
|
||||
'eventHeaderFormat': 'dd. MM yyyy',
|
||||
language: 'de'
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php foreach($GLOBALS['array'] as $key => $val){?>
|
||||
<script>
|
||||
evoCalendar.push(<? echo json_encode($val); ?>);
|
||||
</script>
|
||||
<?php } ?>
|
||||
<script>
|
||||
// console.log(evoCalendar);
|
||||
$("#calendar").evoCalendar('addCalendarEvent', evoCalendar);
|
||||
</script>
|
||||
286
module/certificate/certificate.inc.php
Normal file
286
module/certificate/certificate.inc.php
Normal file
@@ -0,0 +1,286 @@
|
||||
<?
|
||||
switch ($_GET["action"]) {
|
||||
case 'edit':
|
||||
edit_certificate();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_certificate($certificate['id']);
|
||||
break;
|
||||
case 'new':
|
||||
require_once("certificate_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_certificate();
|
||||
break;
|
||||
case 'save_line_certificate':
|
||||
save_line_certificate();
|
||||
break;
|
||||
case 'new_line_certificate':
|
||||
require_once("certificate_line_cardform.inc.php");
|
||||
// new_line_certificate();
|
||||
break;
|
||||
case 'edit_line_certificate':
|
||||
edit_line_certificate();
|
||||
break;
|
||||
case 'delete_line_certificate':
|
||||
delete_line_certificate();
|
||||
break;
|
||||
case 'moveup_line_certificate':
|
||||
moveup_line_certificate();
|
||||
edit_certificate();
|
||||
break;
|
||||
case 'movedown_line_certificate':
|
||||
movedown_line_certificate();
|
||||
edit_certificate();
|
||||
break;
|
||||
case 'open_card':
|
||||
open_card();
|
||||
case 'load_collection_pages' : load_collection_pages(); break;
|
||||
case 'load_collections' : load_collections(); break;
|
||||
default:
|
||||
require_once("certificate_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function open_card() {?>
|
||||
<script type="text/javascript">
|
||||
openCardOnStart = true;
|
||||
openCardAction = 'new';
|
||||
</script>
|
||||
<?php }
|
||||
|
||||
function edit_certificate( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_POST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
|
||||
$pdoHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$pdoPort = getenv('MAIN_MYSQL_DB_PORT');
|
||||
$pdoUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$pdoPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
$pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass);
|
||||
|
||||
$prepStatement = " SELECT * FROM main_certificate WHERE id = :id LIMIT 1 ";
|
||||
$params = [
|
||||
[':id', $input_id, PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$result = $pdo->getResultArray();
|
||||
|
||||
if (count($result) == 1) {
|
||||
$input_certificate = $result[0];
|
||||
require_once("certificate_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$input_certificate = array();
|
||||
require_once("certificate_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_certificate() {
|
||||
if ($_POST["input_id"] <> '') {
|
||||
$query = "DELETE FROM main_certificate WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function save_certificate() {
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
$input_id = "";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$input_recurring = ($_POST["input_recurring"] == "on") ? 1 : 0;
|
||||
|
||||
if ($_POST["input_id"] <> '') {
|
||||
$inserted = FALSE;
|
||||
$input_id = $_POST["input_id"];
|
||||
$query = "UPDATE main_certificate
|
||||
SET title = '" . $_POST['input_title'] . "',
|
||||
description = '" . $_POST['input_description'] . "',
|
||||
recurring = '" . $input_recurring . "',
|
||||
validity_period = '" . $_POST['input_validity_period'] . "',
|
||||
access_type = '" . $_POST['input_access_type'] . "',
|
||||
main_collection_page_list_id = '" . $_POST['main_collection_page_list_id'] . "',
|
||||
main_collection_setup_id = '" . $_POST['main_collection_setup_id'] . "',
|
||||
main_collection_id = '" . $_POST['main_collection_id'] . "'
|
||||
WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
} else {
|
||||
$query = "INSERT INTO main_certificate (id, title, description, recurring, validity_period, access_type, main_collection_page_list_id, main_collection_setup_id, main_collection_id) VALUES (
|
||||
NULL,
|
||||
'" . $_POST['input_title'] . "',
|
||||
'" . $_POST['input_description'] . "',
|
||||
'" . $input_recurring . "',
|
||||
'" . $_POST['input_validity_period'] . "',
|
||||
'" . $_POST['input_access_type'] . "',
|
||||
'" . $_POST['main_collection_page_list_id'] . "',
|
||||
'" . $_POST['main_collection_setup_id'] . "',
|
||||
'" . $_POST['main_collection_id'] . "'
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("certificate_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("certificate_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
$mandant_ids = $_POST['select_mandant'];
|
||||
$mandant = explode(',', $mandant_ids);
|
||||
if(!empty($mandant) && gettype($mandant) == 'array') {
|
||||
$deleteLink = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM certificate_mandant_link WHERE main_certificate_id = ".$input_id);
|
||||
foreach($mandant as $key => $mandant_value){
|
||||
$query = "INSERT INTO certificate_mandant_link
|
||||
(main_certificate_id, main_mandant_id)
|
||||
VALUES (
|
||||
" . $input_id . ",
|
||||
" . $mandant_value . "
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
save_certificate_contact_list($input_id);
|
||||
edit_certificate($input_id, $messages);
|
||||
} else {
|
||||
require_once("edit_certificate_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function save_certificate_contact_list($certificate_id){
|
||||
$datetime = new DateTime();
|
||||
$query = "SELECT * FROM main_contact WHERE active = 1 ORDER BY name ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
$done = ($_POST["done_".$row['id']] == "on") ? 1 : 0;
|
||||
$active = ($_POST["active_".$row['id']] == "on") ? 1 : 0;
|
||||
$deleteActive = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM certificate_contact WHERE certificate_id=".$certificate_id." AND main_contact_id = ".$row['id']);
|
||||
if($active == 1){
|
||||
$query_active = "INSERT INTO certificate_contact (certificate_id, main_contact_id, active)
|
||||
VALUES (
|
||||
'".$certificate_id."',
|
||||
'".$row['id']."',
|
||||
'".$active."'
|
||||
)";
|
||||
$result_active = @mysqli_query($GLOBALS['mysql_con'], $query_active);
|
||||
}
|
||||
|
||||
$query2 = "SELECT * FROM certificate_contact_submit WHERE certificate_id = ".$certificate_id." AND main_contact_id = ".$row['id']. " ORDER BY id DESC LIMIT 1";
|
||||
$result2 = @mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$row2 = @mysqli_fetch_array($result2);
|
||||
$query3 = "";
|
||||
if($row2 != NULL){
|
||||
if($row2['correct'] != $done){
|
||||
$query3 = "UPDATE certificate_contact_submit SET correct = ".$done.", issue_date = '".$datetime->format('Y-m-d H:i:s')."' WHERE id = ".$row2['id'];
|
||||
}
|
||||
}else{
|
||||
if($done == 1){
|
||||
$query3 = "INSERT INTO certificate_contact_submit (certificate_id, main_contact_id, issue_date, correct)
|
||||
VALUES (
|
||||
'".$certificate_id."',
|
||||
'".$row['id']."',
|
||||
'".$datetime->format('Y-m-d H:i:s')."',
|
||||
'".$done."'
|
||||
)";
|
||||
}
|
||||
}
|
||||
$result3 = @mysqli_query($GLOBALS['mysql_con'], $query3);
|
||||
}
|
||||
}
|
||||
|
||||
function load_collection_pages() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
ob_start();
|
||||
create_page_with_collection_select($_POST['collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", array(), false);
|
||||
$output1 = ob_get_clean();
|
||||
|
||||
$active_groups = array();
|
||||
$query = "SELECT main_collection_setup_group_id from main_page_collection_group_link where main_page_link_id = '" . $_POST['page_link_id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$active_groups[] = $row['main_collection_setup_group_id'];
|
||||
}
|
||||
ob_start();
|
||||
create_collection_preview_group_select($_POST['collection_setup_id'], $_POST['page_link_id'], $active_groups);
|
||||
$output2 = ob_get_clean();
|
||||
|
||||
echo json_encode(array('page_with_collection_select' => $output1, 'collection_preview_group_select' => $output2));
|
||||
}
|
||||
|
||||
function load_collections() {
|
||||
// ajax call
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$setup_id = $_POST['main_collection_setup_id'];
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if($setup_id != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = '" . $setup_id . "'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
while ($row = @mysqli_fetch_array($result,1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
input_select($translation->get("choose_collection"),"main_collection_id",$values = $collection_ids,$value_names = $collections,"", false, false);
|
||||
}
|
||||
|
||||
function create_mandant_select($category_id){
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$query = "SELECT * FROM main_mandant";
|
||||
$mandant_result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$preselect = array();
|
||||
|
||||
$query = "SELECT * FROM certificate_mandant_link WHERE main_certificate_id = ".$category_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
array_push($preselect,$row['main_mandant_id']);
|
||||
}
|
||||
$allselect = array();
|
||||
?>
|
||||
<div class="label"><?php echo $translation->get("mandant")?></div>
|
||||
<div class="mandant bc-select-ui ui fluid multiple search selection dropdown" style="clear:both;display:inline-block;">
|
||||
<input type="hidden" name="select_mandant">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text"><?php echo $translation->get("mandant")?></div>
|
||||
<div class="menu">
|
||||
<?
|
||||
while($mandant = @mysqli_fetch_array($mandant_result)) {
|
||||
array_push($allselect,$mandant['id']);
|
||||
echo "<div class=\"item\" data-value=\"{$mandant['id']}\">".$mandant["description"]."</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='all_mandants' ><?php echo $translation->get("all_mandants")?></div>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/Semantic-UI-master/semantic.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/plugins/Semantic-UI-master/bc-semantic.css?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/Semantic-UI-master/bc-semantic.css')?>">
|
||||
<script>
|
||||
var $y = jQuery.noConflict();
|
||||
|
||||
$y( document ).ready(function() {
|
||||
$y('.mandant.ui.fluid.multiple.dropdown').dropdown('set selected', <?= json_encode($preselect) ?>);
|
||||
});
|
||||
|
||||
$(".all_mandants").click(function() {
|
||||
$y('.mandant.ui.fluid.multiple.dropdown').dropdown('set selected', <?= json_encode($allselect) ?>);
|
||||
});
|
||||
|
||||
</script>
|
||||
<?
|
||||
}
|
||||
209
module/certificate/certificate_cardform.inc.php
Normal file
209
module/certificate/certificate_cardform.inc.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
$formname = "form_certificate_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if ($input_certificate['main_collection_setup_id'] != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = " . $input_certificate['main_collection_setup_id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_certificate["id"] == "") {
|
||||
echo $translation->get("new_certificate");
|
||||
} else {
|
||||
echo $translation->get("edit_certificate");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete', true, '{$translation->get('delete_user_confirm')}', true)", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_certificate["id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr class="certificate_table_row">
|
||||
<td class="w-100">
|
||||
<? input($translation->get("title"), "input_title", "text", $input_certificate["title"], 255) ?>
|
||||
<? input($translation->get("description"), "input_description", "textarea", $input_certificate["description"]) ?>
|
||||
</td>
|
||||
<td class="w-100">
|
||||
<div class="basic_settings">
|
||||
<div class="toggle_headline opened">
|
||||
<h3><?= $translation->get("basic_settings") ?></h3>
|
||||
<div class="chevron"></div>
|
||||
</div>
|
||||
<div class="toggle_area">
|
||||
<div class="recurring_group">
|
||||
<div class="recurring_input">
|
||||
<? input($translation->get("recurring"), "input_recurring", "checkbox", $input_certificate["recurring"]) ?>
|
||||
</div>
|
||||
<?php
|
||||
$types = [
|
||||
'3' => "3 Monate",
|
||||
'6' => "6 Monate",
|
||||
'12' => "12 Monate",
|
||||
'24' => "24 Monate",
|
||||
'36' => "36 Monate (Mindestlaufzeit)",
|
||||
];
|
||||
$preselect = 4;
|
||||
if(isset($input_certificate['validity_period']) ){
|
||||
$preselect = $input_certificate['validity_period'];
|
||||
}
|
||||
?>
|
||||
<div class="recurring_select">
|
||||
<? input_select($translation->get("validity_period"), "input_validity_period", $values = array_keys($types), $value_names = array_values($types), $preselect, FALSE, FALSE); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='basic_setting_inputs'>
|
||||
<div class='collection_setup'>
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_certificate['main_collection_setup_id'], FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</div></div>
|
||||
<div class="collection_pages">
|
||||
<? create_page_with_collection_select($input_certificate['main_collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", $input_certificate['main_collection_page_list_id'], FALSE); ?>
|
||||
</div></div>
|
||||
<div class="collection_list_choose">
|
||||
<? input_select($translation->get("choose_collection"), "main_collection_id", $values = $collection_ids, $value_names = $collections, $input_certificate["main_collection_id"], FALSE, FALSE); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= create_mandant_select($input_certificate['id']); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<?php
|
||||
if ($input_certificate['id'] != "") {
|
||||
require_once 'certificate_contact_listform.inc.php';
|
||||
}?>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#input_recurring').change(function(){
|
||||
if(this.checked){
|
||||
$('.recurring_select').show();
|
||||
}
|
||||
else{
|
||||
$('.recurring_select').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(".toggle_headline").click(function() {
|
||||
$(this).next().slideToggle();
|
||||
$(this).toggleClass("opened");
|
||||
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadPagesWithCollection( collection_setup_id ) {
|
||||
load_collections(collection_setup_id);
|
||||
$('.collection_pages').html("");
|
||||
|
||||
if (collection_setup_id == "" || collection_setup_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("collection_setup_id", collection_setup_id);
|
||||
formData.append("page_link_id", '<?php echo $input_line["id"]; ?>');
|
||||
$.ajax({
|
||||
url : "?action=load_collection_pages",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
dataType : 'json',
|
||||
success : function ( output, status, xhr ) {
|
||||
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.collection_pages').html(output.page_with_collection_select);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
var msg = '';
|
||||
if (jqXHR.status === 0) {
|
||||
msg = 'Not connect.\n Verify Network.';
|
||||
} else if (jqXHR.status == 404) {
|
||||
msg = 'Requested page not found. [404]';
|
||||
} else if (jqXHR.status == 500) {
|
||||
msg = 'Internal Server Error [500].';
|
||||
} else if (exception === 'parsererror') {
|
||||
msg = 'Requested JSON parse failed.';
|
||||
} else if (exception === 'timeout') {
|
||||
msg = 'Time out error.';
|
||||
} else if (exception === 'abort') {
|
||||
msg = 'Ajax request aborted.';
|
||||
} else {
|
||||
msg = 'Uncaught Error.\n' + jqXHR.responseText;
|
||||
}
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function load_collections( collection_setup_id ) {
|
||||
$('.collection_list_choose').html("");
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("main_collection_setup_id", collection_setup_id);
|
||||
$.ajax({
|
||||
url : "?action=load_collections",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.collection_list_choose').html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
115
module/certificate/certificate_contact_listform.inc.php
Normal file
115
module/certificate/certificate_contact_listform.inc.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contact_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
|
||||
function load_contact_list_old($input_id){
|
||||
$query = "SELECT certificate_contact_link.id,
|
||||
main_contact.name,
|
||||
main_mandant.description,
|
||||
certificate_contact_link.issue_date,
|
||||
main_certificate.validity_period,
|
||||
certificate_contact_link.active
|
||||
FROM certificate_contact_link
|
||||
LEFT JOIN
|
||||
main_contact
|
||||
ON main_contact.id = certificate_contact_link.main_contact_id
|
||||
LEFT JOIN
|
||||
main_mandant
|
||||
ON main_mandant.id = main_contact.master_mandant_id
|
||||
LEFT JOIN
|
||||
main_certificate
|
||||
ON main_certificate.id = certificate_contact_link.certificate_id
|
||||
WHERE certificate_id = '".$input_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
$issue_date = new DateTime($row['issue_date']);
|
||||
$validity_date = new DateTime($row['issue_date']);
|
||||
$current_date = new DateTime();
|
||||
$validity_date->modify('+'.$row['validity_period'].' months');
|
||||
$class = "";
|
||||
$expired = 0;
|
||||
if($current_date >= $validity_date){
|
||||
$class = "expired";
|
||||
$expired = 1;
|
||||
}
|
||||
if($row['active'] == 0){
|
||||
$class = "not_active";
|
||||
}
|
||||
?>
|
||||
<tr class='<?= $class ?>'>
|
||||
<td><?= $expired ?></td>
|
||||
<td><?= $row['name'] ?></td>
|
||||
<td><?= $row['description'] ?></td>
|
||||
<td><?= $issue_date->format('d.m.Y') ?></td>
|
||||
<td><?= $validity_date->format('d.m.Y') ?></td>
|
||||
<td><?= $row['active'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function load_contact_list($input_id){
|
||||
$query = "SELECT * FROM main_contact WHERE active = 1 ORDER BY name ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
$query2 = "SELECT * FROM certificate_contact_submit LEFT JOIN main_certificate ON main_certificate.id = certificate_contact_submit.certificate_id WHERE certificate_id = '".$input_id."' AND main_contact_id = ".$row['id']." ORDER BY certificate_contact_submit.id DESC LIMIT 1";
|
||||
$result2 = @mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$row2 = @mysqli_fetch_array($result2);
|
||||
|
||||
$query_mandant = "SELECT * FROM main_mandant WHERE id = ".$row['master_mandant_id'];
|
||||
$result_mandant = @mysqli_query($GLOBALS['mysql_con'], $query_mandant);
|
||||
$row_mandant = @mysqli_fetch_array($result_mandant);
|
||||
|
||||
$query_active = "SELECT * FROM certificate_contact WHERE certificate_id= '".$input_id."' AND main_contact_id = ".$row['id'];
|
||||
$result_active = @mysqli_query($GLOBALS['mysql_con'], $query_active);
|
||||
$row_active = @mysqli_fetch_array($result_active);
|
||||
|
||||
$datetime = "";
|
||||
if($row2['issue_date']){
|
||||
$datetime = new DateTime($row2['issue_date']);
|
||||
$datetime = $datetime->format('d.m.Y');
|
||||
}
|
||||
$issue_date = new DateTime($row2['issue_date']);
|
||||
$validity_date = new DateTime($row2['issue_date']);
|
||||
$validity_date->modify('+'.$row2['validity_period'].' months');
|
||||
|
||||
$done = "";
|
||||
$active = "";
|
||||
$class = "";
|
||||
if(isset($row_active) && $row_active['active'] == 1){
|
||||
$active = "checked='checked'";
|
||||
}
|
||||
if($row2['correct'] == 1){
|
||||
$done = "checked='checked'";
|
||||
$class = "checked";
|
||||
}
|
||||
?>
|
||||
<tr class='<?= $class ?>'>
|
||||
<input type='hidden' name='contact_<?= $row['id']?>'>
|
||||
<td><input type='checkbox' class='checkbox' name='done_<?= $row['id']?>' <?= $done?>></td>
|
||||
<td><?= $row['name'] ?></td>
|
||||
<td><?= $row_mandant['description'] ?></td>
|
||||
<td><?= $issue_date->format('d.m.Y')?></td>
|
||||
<td><?= $validity_date->format('d.m.Y')?></td>
|
||||
<td><input type='checkbox' class='checkbox' name='active_<?= $row['id']?>' <?= $active?>></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<h2>Benutzerliste</h2>
|
||||
<table class='learning_unit_user_list'>
|
||||
<tr>
|
||||
<th>Erledigt</th>
|
||||
<th>Benutzer</th>
|
||||
<th>Mandant</th>
|
||||
<th>Ausstellungsdatum</th>
|
||||
<th>Ablaufdatum</th>
|
||||
<th>Aktiv</th>
|
||||
</tr>
|
||||
<?= load_contact_list($input_id);?>
|
||||
</table>
|
||||
28
module/certificate/certificate_listform.inc.php
Normal file
28
module/certificate/certificate_listform.inc.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_certificate_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_certificate'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT id, title AS '" . $translation->get("name") . "', description AS '" . $translation->get("description") . "' FROM main_certificate";
|
||||
$format = array("option", "text", "text");
|
||||
if ($result = mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, "form_certificate_list", $format);
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
114
module/certificate/old_show_certificate.inc.php
Normal file
114
module/certificate/old_show_certificate.inc.php
Normal file
File diff suppressed because one or more lines are too long
81
module/certificate/show_certificate.inc.php
Normal file
81
module/certificate/show_certificate.inc.php
Normal file
File diff suppressed because one or more lines are too long
68
module/collection/#edit_collection_cardform_new.inc.php
Normal file
68
module/collection/#edit_collection_cardform_new.inc.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?
|
||||
$formname = "form_collection_cardform_new";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
|
||||
// erstelle kollektionen sammeln
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function create_new_collection( _id ) {
|
||||
$('.main_collection_setup_id', $('#<?php echo $formname; ?>')).val(_id);
|
||||
loadCard('save_collection', true);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
echo $translation->get("new_collection");
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<?php if (count($collection_setups) == 0) {
|
||||
|
||||
// Wenn keine Kollektionseinstellungen angelegt wurden, dann nicht weiter machen
|
||||
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<form id="<?php echo $formname; ?>" name="<?php echo $formname; ?>" method="post">
|
||||
<input name="input_collection_id" type="hidden" value="">
|
||||
<input name="main_collection_setup_id" class="main_collection_setup_id" type="hidden" value="" />
|
||||
<input name="firstsave" value="1" type="hidden" />
|
||||
|
||||
<div id="srollerInhalteHeadline"><h2><?php echo $translation->get("choose_collection_type"); ?></h2></div>
|
||||
<div id="pagecontentScroller" class="pagecontentScroller">
|
||||
<div class="scroller_inhalte">
|
||||
|
||||
<ul class="inhalte_menu new_collection">
|
||||
<?php
|
||||
foreach ($collection_setups as $collectionId => $collectionData) {
|
||||
button("inhalt_collection_setup", '<img src="' . PATH_SETUP_ICON_COLLECTION . $collectionData['icon'] . '" /><span>' . $collectionData['description'] . '</span>', 'form_collection_cardform_new', "create_new_collection({$collectionId})");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
14
module/collection/collection.php
Normal file
14
module/collection/collection.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
require_once("collection_config.inc.php");
|
||||
|
||||
function collection_show() {
|
||||
require("show_collection.inc.php");
|
||||
}
|
||||
|
||||
function collection_edit() {
|
||||
require_once('edit_collection.inc.php');
|
||||
}
|
||||
|
||||
function collection_edit_setup() {
|
||||
require_once('edit_collection_setup.inc.php');
|
||||
}
|
||||
84
module/collection/collection_config.inc.php
Normal file
84
module/collection/collection_config.inc.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?
|
||||
//Bildpfade
|
||||
define("PATH_ORIGINAL_PICTURE_COLLECTION", "../../userdata/collection/original/");
|
||||
define("PATH_RESIZE_COLLECTION", "../../userdata/collection/resize/");
|
||||
define("PATH_ICON_COLLECTION", "/userdata/collection/icon/");
|
||||
define("PATH_ORIGINAL_FRONTEND_COLLECTION", "/userdata/collection/resize/");
|
||||
define("PATH_THUMB_FRONTEND_COLLECTION", "/userdata/collection/thumbnail/");
|
||||
|
||||
// kollektionsbilder
|
||||
define("PATH_SETUP_ICON_COLLECTION", "/layout/admin/img/icons/collections/");
|
||||
|
||||
$collection_setup_images = array(
|
||||
'artikel.png',
|
||||
'bilder.png',
|
||||
'calendar.png',
|
||||
'dokumente_2.png',
|
||||
'dokumente.png',
|
||||
'karriere.png',
|
||||
'liste.png',
|
||||
'news.png',
|
||||
'newsletter.png',
|
||||
'orte.png',
|
||||
'person.png',
|
||||
'videos.png'
|
||||
);
|
||||
|
||||
$collection_icon_images = array(
|
||||
"ankuendigung" => array(
|
||||
"" => array(
|
||||
"name" => "Keine",
|
||||
"image" => ''
|
||||
),
|
||||
|
||||
"allgemeine info" => array(
|
||||
"name" => "Allgemeine Info",
|
||||
"image" => '<svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" viewBox="0 0 33 33">
|
||||
<path id="info" d="M19.5,32.7A13.2,13.2,0,1,0,6.3,19.5,13.2,13.2,0,0,0,19.5,32.7Zm0,3.3A16.5,16.5,0,1,1,36,19.5,16.5,16.5,0,0,1,19.5,36ZM17.85,17.85v9.9h3.3v-9.9Zm0-6.6h3.3v3.3h-3.3Z" transform="translate(-3 -3)"/>
|
||||
</svg>'
|
||||
),
|
||||
|
||||
"technisches Problem" => array(
|
||||
"name" => "Technisches Problem",
|
||||
"image" => '<svg xmlns="http://www.w3.org/2000/svg" width="33" height="25.85" viewBox="0 0 33 25.85">
|
||||
<path id="devices" d="M32.474,16.1h-3.3V8.4a1.651,1.651,0,0,0-1.65-1.65H2.775A1.651,1.651,0,0,0,1.125,8.4V25.312a1.651,1.651,0,0,0,1.65,1.65H14.6V30.4H10.475v2.2h10.45V30.4H16.8V26.962h6.325V30.95a1.651,1.651,0,0,0,1.65,1.65h7.7a1.651,1.651,0,0,0,1.65-1.65v-13.2a1.651,1.651,0,0,0-1.65-1.65Zm-9.35,1.65v7.012H3.325V8.95H26.974V16.1h-2.2A1.651,1.651,0,0,0,23.124,17.75Zm8.8,12.65h-6.6V18.3h6.6Z" transform="translate(-1.125 -6.75)"/>
|
||||
</svg>'
|
||||
),
|
||||
|
||||
"wartung" => array(
|
||||
"name" => "Wartung",
|
||||
"image" => '<svg xmlns="http://www.w3.org/2000/svg" width="31.198" height="32.043" viewBox="0 0 31.198 32.043">
|
||||
<g id="settings" transform="translate(-2.715 -2.295)">
|
||||
<path id="Pfad_11458" data-name="Pfad 11458" d="M30.932,19.188V17.433l2.2-1.928a2.3,2.3,0,0,0,.436-2.927L30.862,7.987a2.314,2.314,0,0,0-2.72-1.032L25.354,7.9a13.026,13.026,0,0,0-1.5-.861l-.586-2.892a2.3,2.3,0,0,0-2.3-1.847H15.6a2.3,2.3,0,0,0-2.3,1.847l-.586,2.892A13.175,13.175,0,0,0,11.2,7.9L8.472,6.908a2.3,2.3,0,0,0-.733-.068A2.3,2.3,0,0,0,5.753,7.987L3.045,12.578a2.3,2.3,0,0,0,.47,2.881l2.169,1.985V19.2L3.515,21.128a2.3,2.3,0,0,0-.47,2.927l2.708,4.591a2.314,2.314,0,0,0,2.72,1.032l2.789-.941a13.026,13.026,0,0,0,1.5.861l.586,2.892a2.3,2.3,0,0,0,2.3,1.847h5.417a2.3,2.3,0,0,0,2.3-1.847l.586-2.892a13.175,13.175,0,0,0,1.515-.861l2.778.941a2.314,2.314,0,0,0,2.72-1.032l2.617-4.591a2.3,2.3,0,0,0-.47-2.881ZM28.877,27.5,24.94,26.166a10.168,10.168,0,0,1-3.11,1.8l-.814,4.12H15.6l-.815-4.074a10.742,10.742,0,0,1-3.1-1.8L7.738,27.5,5.03,22.907l3.122-2.754a10.214,10.214,0,0,1,0-3.592L5.03,13.726,7.738,9.135l3.937,1.331a10.168,10.168,0,0,1,3.11-1.8l.814-4.12h5.417l.815,4.074a10.742,10.742,0,0,1,3.1,1.8l3.947-1.285,2.708,4.591L28.464,16.48a10.214,10.214,0,0,1,0,3.592l3.122,2.835Z"/>
|
||||
<path id="Pfad_11459" data-name="Pfad 11459" d="M18.136,25.022a6.817,6.817,0,1,1,4.889-2A6.886,6.886,0,0,1,18.136,25.022Zm0-11.476a4.488,4.488,0,0,0-4.591,4.591,4.488,4.488,0,0,0,4.591,4.591,4.488,4.488,0,0,0,4.591-4.591,4.488,4.488,0,0,0-4.591-4.591Z" transform="translate(0.172 0.18)"/>
|
||||
</g>
|
||||
</svg>'
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
"highlight" => array(
|
||||
"" => array(
|
||||
"name" => "Keine",
|
||||
"image" => ''
|
||||
),
|
||||
|
||||
"projekt des monats" => array(
|
||||
"name" => "Projekt des Monats",
|
||||
"image" => '<svg xmlns="http://www.w3.org/2000/svg" width="54.344" height="54.344" viewBox="0 0 54.344 54.344">
|
||||
<path id="trophy" d="M54.344,16.982A16.967,16.967,0,0,1,45.88,31.71a16.7,16.7,0,0,1-8.518,2.255h-1.7q-5.095,2.282-5.095,6.793,0,5.413,4.246,7.377a17.676,17.676,0,0,1,4.352,1.221q1.593.744,1.593,1.593,0,1.433-3.981,2.415a40.517,40.517,0,0,1-9.607.98,40.861,40.861,0,0,1-9.605-.981q-3.979-.978-3.981-2.415,0-.85,1.593-1.593a17.765,17.765,0,0,1,4.352-1.221q4.246-1.964,4.246-7.377,0-4.511-5.095-6.793h-1.7A16.926,16.926,0,0,1,0,16.982a14.267,14.267,0,0,1,2.787-8.81,15.2,15.2,0,0,1,7.456-5.308Q10.189,1.22,10.189,0H44.154q0,1.274-.053,2.865a15.186,15.186,0,0,1,7.456,5.308A14.28,14.28,0,0,1,54.344,16.982ZM10.879,9.977a7.505,7.505,0,0,0-4.086,7.006,9.778,9.778,0,0,0,2.839,7.031,9.766,9.766,0,0,0,6.873,3.105Q12.366,20.7,10.879,9.978Zm19.371.266L27.172,3.4l-3.078,6.846-7.111.956,5.253,5.148-1.38,7.43,6.316-3.609,6.316,3.609-1.38-7.43L37.361,11.2Zm13.215-.266Q41.979,20.7,37.838,27.118a9.757,9.757,0,0,0,6.873-3.105,9.78,9.78,0,0,0,2.839-7.03A7.505,7.505,0,0,0,43.464,9.977Z" fill="#fff"/>
|
||||
</svg>'
|
||||
),
|
||||
|
||||
"job des monats" => array(
|
||||
"name" => "Job des Monats",
|
||||
"image" => '<svg xmlns="http://www.w3.org/2000/svg" width="52.01" height="52.012" viewBox="0 0 52.01 52.012">
|
||||
<g id="rocket" transform="translate(-2.251 -2.251)">
|
||||
<path id="Pfad_11401" data-name="Pfad 11401" d="M24.344,11.024a3.1,3.1,0,1,0,2.191.907,3.1,3.1,0,0,0-2.191-.907Z" transform="translate(12.369 5.713)" fill="#fff"/>
|
||||
<path id="Pfad_11402" data-name="Pfad 11402" d="M53.965,4.347a.033.033,0,0,1,0-.01A2.368,2.368,0,0,0,52.208,2.56c-3.459-.844-8.9.056-14.933,2.47a48.038,48.038,0,0,0-15.625,9.894,37.233,37.233,0,0,0-3.431,3.928,15.208,15.208,0,0,0-6.8,1.093c-6.7,2.951-8.618,10.5-9.128,13.6a2.9,2.9,0,0,0,3.157,3.367h.015l7.467-.816c.01.1.02.182.028.263a3.989,3.989,0,0,0,1.149,2.406l3.644,3.647a3.979,3.979,0,0,0,2.4,1.151l.249.026-.812,7.458v.015a2.882,2.882,0,0,0,3.34,3.16c3.117-.5,10.663-2.393,13.606-9.133a15.347,15.347,0,0,0,1.1-6.773,36.545,36.545,0,0,0,3.941-3.431,47.677,47.677,0,0,0,9.9-15.5c2.4-5.962,3.306-11.446,2.483-15.039Zm-12.43,20.3a6.768,6.768,0,1,1,2.019-4.822A6.823,6.823,0,0,1,41.535,24.65Z" transform="translate(0)" fill="#fff"/>
|
||||
<path id="Pfad_11403" data-name="Pfad 11403" d="M16.6,29.482a1.858,1.858,0,0,0-1.276.31c-.741.507-1.488,1.009-2.239,1.5a1.733,1.733,0,0,1-2.439-2.322l1.41-2.439a1.858,1.858,0,0,0-1.76-2.891,7.112,7.112,0,0,0-4.136,2.026c-.424.426-1.717,1.719-2.412,6.648a41.557,41.557,0,0,0-.375,4.268,1.858,1.858,0,0,0,1.858,1.906h.046a41.783,41.783,0,0,0,4.272-.372c4.93-.7,6.223-1.99,6.649-2.416a7.023,7.023,0,0,0,2.019-4.149A1.858,1.858,0,0,0,16.6,29.48Z" transform="translate(0.732 13.919)" fill="#fff"/>
|
||||
</g>
|
||||
</svg>'
|
||||
)
|
||||
),
|
||||
);
|
||||
17
module/collection/collection_contact_form_option.inc.php
Normal file
17
module/collection/collection_contact_form_option.inc.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$query = "SELECT * FROM contactform_header WHERE id = ".$fieldSetup['option_string'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
?>
|
||||
<h2><?php echo $translation->get("contactform_options"); ?> : <?= $row['description']; ?></h2>
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<input type="hidden" name="header_id<?=$fieldSetup['id']?>" value="<?=$fieldSetup['option_string']?>">
|
||||
<td>
|
||||
<? input($translation->get("recipient_name"), "receiver_name".$fieldSetup['id'], "text", isset($dataLinked["receiver_name"]) ? $dataLinked["receiver_name"] : $row['recipient_name'], 255) ?>
|
||||
<? input($translation->get("recipient_email"), "receiver_email".$fieldSetup['id'], "text", isset($dataLinked["receiver_email"]) ? $dataLinked["receiver_email"] : $row['recipient_email'], 255) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
17
module/collection/collections.xml
Normal file
17
module/collection/collections.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0"?>
|
||||
<collections>
|
||||
<collection_setup id="30">
|
||||
<collection id="143">
|
||||
<description>Slideshow wird ohne Inhalt ausgeblendet</description>
|
||||
<headline>Slideshow wird ohne Inhalt ausgeblendet</headline>
|
||||
</collection>
|
||||
<collection id="144">
|
||||
<description>Slideshow wird ohne Inhalt ausgeblendet</description>
|
||||
<headline>Slideshow wird ohne Inhalt ausgeblendet</headline>
|
||||
</collection>
|
||||
<collection id="145">
|
||||
<description>Slideshow wird ohne Inhalt ausgeblendet</description>
|
||||
<headline>Slideshow wird ohne Inhalt ausgeblendet</headline>
|
||||
</collection>
|
||||
</collection_setup>
|
||||
</collections>
|
||||
197
module/collection/component_collection_preview_cardform.inc.php
Normal file
197
module/collection/component_collection_preview_cardform.inc.php
Normal file
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_preview_list";
|
||||
$inputname = "input_id";
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$collection_setup_id = 0;
|
||||
|
||||
// erstelle kollektionen sammeln
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
$query = "SELECT ms.id, ms.main_language_id, ms.code, ms.description, ms.linked, ms.icon, ms.modified_user, ms.modified_date, ms.all_languages, ms.show_filter FROM main_collection_setup as ms INNER JOIN main_collection_setup_websites as mcsw on ms.id = mcsw.main_collection_setup_id WHERE mcsw.main_site_id = ".$GLOBALS['site']['id']." AND ms.is_multidomain = 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if ($input_line['main_collection_setup_id'] != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = '" . $input_line['main_collection_setup_id'] . "' AND main_language_id = '" . $GLOBALS["language"]['id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$active_groups = array();
|
||||
$query = "SELECT main_collection_setup_group_id FROM main_component_collection_group_link WHERE main_component_link_id = '" . (int)$input_line["id"]."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$active_groups[] = $row['main_collection_setup_group_id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadPagesWithCollection( collection_setup_id ) {
|
||||
load_collections(collection_setup_id);
|
||||
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html("");
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (collection_setup_id == "" || collection_setup_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname; ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("collection_setup_id", collection_setup_id);
|
||||
formData.append("component_link_id", '<?php echo $input_line["id"]; ?>');
|
||||
$.ajax({
|
||||
url : "?action=load_collection_pages_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.loader', $('#<?php echo $formname; ?>')).hide();
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html(output.page_with_collection_select);
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html(output.collection_preview_group_select);
|
||||
}
|
||||
},
|
||||
dataType : 'json'
|
||||
});
|
||||
}
|
||||
|
||||
function load_collections( collection_setup_id ) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("main_collection_setup_id", collection_setup_id);
|
||||
$.ajax({
|
||||
url : "?action=load_collections_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_view_type( _type ) {
|
||||
if (_type == 0) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).show();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).show();
|
||||
}
|
||||
}
|
||||
|
||||
function save_and_close_page_line() {
|
||||
jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
|
||||
loadCard('save_collection_preview_page', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_collection_preview"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit_component', true)"); ?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_collection_preview_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "save_and_close_page_line();"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input_select($translation->get("collection_preview_type"), "main_collection_view_type", $values = array('0', '1'), $value_names = array($translation->get("single_collection"), $translation->get("collection_list")), $input_line["main_collection_view_type"], FALSE, FALSE, 'onchange="toggle_view_type(this.value);"'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
|
||||
<div class="collection_pages">
|
||||
<?
|
||||
create_page_with_collection_select($input_line['main_collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", $input_line, FALSE);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php
|
||||
if ($input_line["main_collection_view_type"] == 0) {
|
||||
$display_list_choose = '';
|
||||
$display_item_choose = 'style="display:none;"';
|
||||
} else {
|
||||
$display_item_choose = '';
|
||||
$display_list_choose = 'style="display:none;"';
|
||||
}
|
||||
|
||||
// einzelne kollektion
|
||||
echo "<div class=\"collection_list_choose\" " . $display_list_choose . ">";
|
||||
input_select($translation->get("choose_collection"), "main_collection_id", $values = $collection_ids, $value_names = $collections, $input_line["main_collection_id"], FALSE, FALSE);
|
||||
echo "</div>";
|
||||
|
||||
// kollektionsliste
|
||||
echo "<div class=\"collection_items_choose\" " . $display_item_choose . ">";
|
||||
input($translation->get("collection_list_items"), "main_collection_items", "text", $input_line["main_collection_items"], 255);
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</form>
|
||||
301
module/collection/contact_collection_preview_cardform.inc.php
Normal file
301
module/collection/contact_collection_preview_cardform.inc.php
Normal file
@@ -0,0 +1,301 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_preview_list";
|
||||
$inputname = "input_id";
|
||||
$input_contactform_id = (isset($_REQUEST["input_contactform_id"]) ? $_REQUEST["input_contactform_id"] : "");
|
||||
$collection_setup_id = 0;
|
||||
|
||||
// erstelle kollektionen sammeln
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$query = "SELECT ms.id, ms.main_language_id, ms.code, ms.description, ms.linked, ms.icon, ms.modified_user, ms.modified_date, ms.all_languages, ms.show_filter FROM main_collection_setup as ms INNER JOIN main_collection_setup_websites as mcsw on ms.id = mcsw.main_collection_setup_id WHERE mcsw.main_site_id = ".$GLOBALS['site']['id']." ";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if ($input_line['main_collection_setup_id'] != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = " . $input_line['main_collection_setup_id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$active_groups = array();
|
||||
$query = "SELECT main_collection_setup_group_id FROM main_page_collection_group_link WHERE main_page_link_id = " . (int)$input_line["id"];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$active_groups[] = $row['main_collection_setup_group_id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadPagesWithCollection( collection_setup_id ) {
|
||||
load_collections(collection_setup_id);
|
||||
console.log('hello');
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html("");
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (collection_setup_id == "" || collection_setup_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname; ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("collection_setup_id", collection_setup_id);
|
||||
formData.append("page_link_id", '<?php echo $input_line["id"]; ?>');
|
||||
$.ajax({
|
||||
url : "?action=load_collection_pages_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
dataType : 'json',
|
||||
success : function ( output, status, xhr ) {
|
||||
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/dc/");
|
||||
} else {
|
||||
$('.loader', $('#<?php echo $formname; ?>')).hide();
|
||||
console.log('history');
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html(output.page_with_collection_select);
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html(output.collection_preview_group_select);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
var msg = '';
|
||||
if (jqXHR.status === 0) {
|
||||
msg = 'Not connect.\n Verify Network.';
|
||||
} else if (jqXHR.status == 404) {
|
||||
msg = 'Requested page not found. [404]';
|
||||
} else if (jqXHR.status == 500) {
|
||||
msg = 'Internal Server Error [500].';
|
||||
} else if (exception === 'parsererror') {
|
||||
msg = 'Requested JSON parse failed.';
|
||||
} else if (exception === 'timeout') {
|
||||
msg = 'Time out error.';
|
||||
} else if (exception === 'abort') {
|
||||
msg = 'Ajax request aborted.';
|
||||
} else {
|
||||
msg = 'Uncaught Error.\n' + jqXHR.responseText;
|
||||
}
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function load_collections( collection_setup_id ) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("main_collection_setup_id", collection_setup_id);
|
||||
$.ajax({
|
||||
url : "?action=load_collections_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/dc/");
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_view_type( _type ) {
|
||||
if (_type == 0) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).show();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).show();
|
||||
}
|
||||
}
|
||||
|
||||
function save_and_close_page_line() {
|
||||
jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
|
||||
loadCard('save_collection_preview_page', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
if (isset($_REQUEST['is_collection_preview']) && $_REQUEST['is_collection_preview'] == 1) {
|
||||
echo $translation->get("assign_collection_preview");
|
||||
} else {
|
||||
echo $translation->get("assign_collection_list");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_contactform', true)"); ?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_collection_preview_page', true)"); ?>
|
||||
<?= button("delete",$translation->get("delete_content"),$formname,"loadCard('delete_line_contact', true, '{$translation->get('delete_assoc_pageline')}')","", false); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
if ($messages !== null) {
|
||||
if ((gettype($messages) == 'array' || gettype($messages) == 'object') && count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if (isset($_REQUEST['is_collection_preview']) && $_REQUEST['is_collection_preview'] == 1): ?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_contactform_id" value="<?php echo $input_contactform_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input name="is_collection_preview" id="is_collection_preview" type="hidden" value="1" />
|
||||
<input type="hidden" name="input_section_id" value="<?php echo $_REQUEST['input_section_id']; ?>" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_class_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input_select($translation->get("collection_preview_type"), "main_collection_view_type", $values = array('0', '1'), $value_names = array($translation->get("single_collection"), $translation->get("collection_list")), $input_line["main_collection_view_type"], FALSE, FALSE, 'onchange="toggle_view_type(this.value);"'); ?>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
|
||||
<div class="collection_pages">
|
||||
<?
|
||||
create_page_with_collection_select($input_line['main_collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", $input_line, FALSE);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php
|
||||
if ($input_line["main_collection_view_type"] == 0) {
|
||||
$display_list_choose = '';
|
||||
$display_item_choose = 'style="display:none;"';
|
||||
} else {
|
||||
$display_item_choose = '';
|
||||
$display_list_choose = 'style="display:none;"';
|
||||
}
|
||||
|
||||
// einzelne kollektion
|
||||
echo "<div class=\"collection_list_choose\" " . $display_list_choose . ">";
|
||||
input_select($translation->get("choose_collection"), "main_collection_id", $values = $collection_ids, $value_names = $collections, $input_line["main_collection_id"], FALSE, FALSE);
|
||||
echo "</div>";
|
||||
|
||||
// kollektionsliste
|
||||
echo "<div class=\"collection_items_choose\" " . $display_item_choose . ">";
|
||||
input($translation->get("collection_list_items"), "main_collection_items", "text", $input_line["main_collection_items"], 255);
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_line['active']); ?>
|
||||
<? input($translation->get("self_definded_class"), "layout_class_defined", "text", $input_line["layout_class_defined"], 50) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_contactform_id" value="<?php echo $input_contactform_id; ?>" />
|
||||
<input type="hidden" name="input_section_id" value="<?php echo $_REQUEST['input_section_id']; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input name="is_collection_list" id="is_collection_list" type="hidden" value="1" />
|
||||
|
||||
<input name="main_collection_id" type="hidden" value="0" />
|
||||
<input name="main_collection_page_list_id" type="hidden" value="0" />
|
||||
<input name="main_collection_items" type="hidden" value="0" />
|
||||
<input name="main_collection_view_type" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_class_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_line['active']); ?>
|
||||
<? input($translation->get("self_definded_class"), "layout_class_defined", "text", $input_line["layout_class_defined"], 50) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
309
module/collection/custom_collection_functions.inc.php
Normal file
309
module/collection/custom_collection_functions.inc.php
Normal file
@@ -0,0 +1,309 @@
|
||||
<?php
|
||||
function new_line_collection_setup() {
|
||||
$input_line = array(
|
||||
'fieldtype' => $_POST['fieldtype'],
|
||||
'type_id' => $_POST['type_id'],
|
||||
);
|
||||
|
||||
require_once("edit_collection_custom_setup_line_cardform.inc.php");
|
||||
}
|
||||
function load_sitepart_form() {
|
||||
$collectionTypes = \DynCom\mysyde\common\classes\CollectionTypes::get();
|
||||
|
||||
$code = $collectionTypes[$_POST['sitepartid']]['code'];
|
||||
|
||||
$include = MODULE_PATH . "collection/edit_collection_" . $code . "_config.inc.php";
|
||||
if (file_exists($include)) {
|
||||
require_once($include);
|
||||
}
|
||||
}
|
||||
function save_line_collection_setup() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
$id = $_REQUEST["input_line_id"];
|
||||
$is_teaser = ($_POST["main_input_is_teaser"] == "on") ? 1 : 0;
|
||||
$is_bulletlist = ($_POST["main_input_is_bulletlist"] == "on") ? 1 : 0;
|
||||
$show_description_title = ($_POST["main_input_show_description_title"] == "on") ? 1 : 0;
|
||||
$mandatory = ($_POST["main_input_mandatory"] == "on") ? 1 : 0;
|
||||
$main_collection_id = $_POST['collection_id'];
|
||||
$options = array();
|
||||
// echo '<pre>';print_r($_POST);exit;
|
||||
foreach ($_POST as $key => $value) {
|
||||
if (substr($key, 0, 16) == 'collection_setup') {
|
||||
$options[$key] = $value;
|
||||
}
|
||||
}
|
||||
$serialize_options = serialize($options);
|
||||
|
||||
if ($_REQUEST["input_line_id"] <> '') {
|
||||
$query = "UPDATE main_collection_setup_content SET
|
||||
fieldtype = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["collection_type"]) . "',
|
||||
note = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_note"]) . "',
|
||||
input_maxlength = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_maxlength"]) . "',
|
||||
fieldname = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_description"]) . "',
|
||||
code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_code"]) . "',
|
||||
is_teaser = " . $is_teaser . ",
|
||||
is_bulletlist = " . $is_bulletlist . ",
|
||||
show_description_title = " . $show_description_title . ",
|
||||
mandatory = " . $mandatory . ",
|
||||
option_string = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_option_string"]) . "',
|
||||
type_id = '" . (int)$_REQUEST['main_input_choose_type'] . "',
|
||||
options = '" . $serialize_options . "',
|
||||
main_collection_id = '".$main_collection_id."'
|
||||
WHERE id = '" . $_REQUEST["input_line_id"] . "' LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
} else {
|
||||
$_REQUEST["main_input_code"] = "field-".time();
|
||||
$sorting = @mysqli_fetch_array(@mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting)+1 AS 'newsorting' FROM main_collection_setup_content WHERE main_collection_setup_id = '" . $_REQUEST["input_id"]."'"));
|
||||
$sorting = ($sorting["newsorting"] <> "") ? $sorting = $sorting["newsorting"] : $sorting = 1;
|
||||
$query = "INSERT INTO main_collection_setup_content (main_collection_setup_id, fieldtype, note, input_maxlength, fieldname, code, is_teaser, is_bulletlist, show_description_title, mandatory, option_string, type_id, options, sorting, main_collection_id) VALUES (
|
||||
'" . (int)$_REQUEST["input_id"] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["collection_type"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_note"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_maxlength"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_description"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_code"]) . "',
|
||||
" . $is_teaser . ",
|
||||
" . $is_bulletlist . ",
|
||||
" . $show_description_title . ",
|
||||
" . $mandatory . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["main_input_option_string"]) . "',
|
||||
'" . (int)$_REQUEST['main_input_choose_type'] . "',
|
||||
'" . $serialize_options . "',
|
||||
" . $sorting . ",
|
||||
" .$main_collection_id . "
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["main_input_choose_type"] == '') | ($_REQUEST["main_input_choose_type"] == 0)) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_choose_inputtype") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["main_input_code"] == '') | ($_REQUEST["main_input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if ($_REQUEST["main_input_code"] <> urlencode($_REQUEST["main_input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if ($inserted === FALSE) {
|
||||
update_sitepart_setup($options, $id);
|
||||
}
|
||||
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
|
||||
edit_collection_setup();
|
||||
} else {
|
||||
if ($inserted === TRUE) {
|
||||
$id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("collection_line_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("collection_line_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
edit_line_collection_setup($id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_line["id"] = $_REQUEST["input_line_id"];
|
||||
$input_line["is_teaser"] = $_REQUEST["main_input_is_teaser"];
|
||||
$input_line["fieldname"] = $_REQUEST["main_input_description"];
|
||||
$input_line["fieldtype"] = $_REQUEST["collection_type"];
|
||||
$input_line['type_id'] = $_REQUEST["main_input_choose_type"];
|
||||
$input_line["code"] = $_REQUEST["main_input_code"];
|
||||
$input_line['options'] = $serialize_options;
|
||||
require_once("edit_collection_custom_setup_line_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function update_sitepart_setup( $options, $setup_content_id ) {
|
||||
if ($_REQUEST["collection_type"] != "siteparts") {
|
||||
return;
|
||||
}
|
||||
|
||||
$sitepartId = (int)$_REQUEST['main_input_choose_type'];
|
||||
|
||||
$query = "SELECT main_sitepart_header_id FROM main_collection_link WHERE main_collection_setup_content_id = '" . $setup_content_id . "' AND main_sitepart_id = '" . $sitepartId."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sitepart_header_ids = array();
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$sitepart_header_ids[] = $row['main_sitepart_header_id'];
|
||||
}
|
||||
|
||||
if (count($sitepart_header_ids) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch ($sitepartId) {
|
||||
case 2:
|
||||
update_sitepart_header_slideshow($options, $sitepart_header_ids);
|
||||
break;
|
||||
case 3:
|
||||
update_sitepart_header_contactform($options, $sitepart_header_ids);
|
||||
break;
|
||||
case 6:
|
||||
update_sitepart_header_gallery($options, $sitepart_header_ids);
|
||||
break;
|
||||
case 7:
|
||||
update_sitepart_header_magicscroll($options, $sitepart_header_ids);
|
||||
break;
|
||||
case 8:
|
||||
update_sitepart_header_googlemaps($options, $sitepart_header_ids);
|
||||
break;
|
||||
}
|
||||
}
|
||||
function update_sitepart_header_slideshow( $options, $sitepart_header_ids ) {
|
||||
$query = "UPDATE slideshow_header SET
|
||||
|
||||
width = " . (int)$options['collection_setup_width'] . ",
|
||||
height = " . (int)$options['collection_setup_height'] . ",
|
||||
effect = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_effect']) . "',
|
||||
arrows = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_arrows']) . "',
|
||||
eff_interval = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_eff_interval']) . "',
|
||||
effect_duration = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_effect_duration']) . "',
|
||||
text_effect = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_text_effect']) . "',
|
||||
text_pos = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options['collection_setup_text_pos']) . "'
|
||||
|
||||
WHERE id IN (" . join(',', $sitepart_header_ids) . ")";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
function update_sitepart_header_contactform( $options, $sitepart_header_ids ) {
|
||||
$query = "UPDATE contactform_header SET
|
||||
|
||||
sender_name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_sender_name"]) . "',
|
||||
sender_email = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_sender_email"]) . "',
|
||||
recipient_name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_recipient_name"]) . "',
|
||||
recipient_email = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_recipient_email"]) . "',
|
||||
subject = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_input_subject"]) . "'
|
||||
|
||||
WHERE id IN (" . join(',', $sitepart_header_ids) . ")";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
function update_sitepart_header_gallery( $options, $sitepart_header_ids ) {
|
||||
$query = "UPDATE gallery_header SET
|
||||
|
||||
width = " . (int)$options["collection_setup_gallery_width"] . ",
|
||||
height = " . (int)$options["collection_setup_gallery_height"] . ",
|
||||
thumb_width = " . (int)$options["collection_setup_gallery_thumb_width"] . ",
|
||||
thumb_height = " . (int)$options["collection_setup_gallery_thumb_height"] . "
|
||||
|
||||
WHERE id IN (" . join(',', $sitepart_header_ids) . ")";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
function update_sitepart_header_magicscroll( $options, $sitepart_header_ids ) {
|
||||
$query = "UPDATE scrollbar_header SET
|
||||
|
||||
width = " . (int)$options["collection_setup_width"] . ",
|
||||
height = " . (int)$options["collection_setup_height"] . ",
|
||||
item_width = " . (int)$options["collection_setup_item_width"] . ",
|
||||
item_height = " . (int)$options["collection_setup_item_height"] . ",
|
||||
arrows = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_arrows"]) . "',
|
||||
eff_interval = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_eff_interval"]) . "',
|
||||
effect_duration = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_effect_duration"]) . "',
|
||||
items = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_items"]) . "',
|
||||
step = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_step"]) . "'
|
||||
|
||||
WHERE id IN (" . join(',', $sitepart_header_ids) . ")";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
function update_sitepart_header_googlemaps( $options, $sitepart_header_ids ) {
|
||||
$query = "UPDATE google_maps_header SET
|
||||
|
||||
width = " . (int)$options["collection_setup_google_maps_width"] . ",
|
||||
height = " . (int)$options["collection_setup_google_maps_height"] . ",
|
||||
icon_location = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $options["collection_setup_icon_location"]) . "'
|
||||
|
||||
WHERE id IN (" . join(',', $sitepart_header_ids) . ")";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
function edit_line_collection_setup( $_id = "", $messages = array() ) {
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$line_id = $_id;
|
||||
} else {
|
||||
$line_id = $_REQUEST["input_line_id"];
|
||||
}
|
||||
|
||||
if ($line_id <> '') {
|
||||
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE id = '" . $line_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
|
||||
$input_line = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_collection_custom_setup_line_cardform.inc.php");
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
require_once("edit_collection_custom_setup_line_cardform.inc.php");
|
||||
|
||||
}
|
||||
}
|
||||
function edit_collection_setup( $_id = "", $messages = array() ) {
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["collection_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
|
||||
$query = "SELECT * FROM main_collection WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
|
||||
$input_collection = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_collection_cardform.inc.php");
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
require_once("edit_collection_cardform.inc.php");
|
||||
|
||||
}
|
||||
}
|
||||
function delete_line_collection_setup() {
|
||||
|
||||
if ($_REQUEST["input_line_id"] <> '') {
|
||||
$query = "DELETE FROM main_collection_setup_content WHERE id = '" . $_REQUEST["input_line_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
edit_collection_setup();
|
||||
}
|
||||
function update_sortorder_collection_setup() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE main_collection_setup_content SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
129
module/collection/dashboard_collections.php
Normal file
129
module/collection/dashboard_collections.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
require_once(MODULE_PATH . "collection/collection_config.inc.php");
|
||||
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$pageIds = array();
|
||||
$sitepartCount = array();
|
||||
$formname = "form_edit_collection";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
|
||||
function countCollection($setup_id){
|
||||
$query = "SELECT id FROM main_collection WHERE main_collection_setup_id = ".$setup_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
return $num_rows;
|
||||
}
|
||||
function loadWorlds(){
|
||||
$query = "SELECT * FROM main_collection_setup_world ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
echo "<div class='pop-up-element'>";
|
||||
$query_setup = "SELECT main_collection_setup.* FROM main_collection_setup LEFT JOIN main_collection_setup_worlds_link ON main_collection_setup_worlds_link.main_collection_setup_id = main_collection_setup.id WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) AND main_collection_setup_world_id = ".$row['id']." ORDER BY main_collection_setup.id ASC";
|
||||
$result_setup = @mysqli_query($GLOBALS['mysql_con'], $query_setup);
|
||||
while ($row_setup = @mysqli_fetch_array($result_setup, 1)) {
|
||||
?>
|
||||
<a class="dashoard_box button_inhalt_collection"
|
||||
href="<?php echo get_menu_link($_GET["level_1"] . "/" . $row_setup['id'], $GLOBALS['site'], $GLOBALS['language']); ?>">
|
||||
<span
|
||||
class="dashboard_box_number"><?php echo countCollection($row_setup['id']); ?></span>
|
||||
<span class="dashboard_box_description"><?php echo $row_setup['description']; ?></span>
|
||||
<img
|
||||
src="<?php echo PATH_SETUP_ICON_COLLECTION . ($row_setup['icon'] != "" ? $row_setup['icon'] : 'dokumente_2.png'); ?>" />
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
function allCollections(){
|
||||
echo "<div class='pop-up-element'>";
|
||||
$query_setup = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) ORDER BY main_collection_setup.id ASC";
|
||||
$result_setup = @mysqli_query($GLOBALS['mysql_con'], $query_setup);
|
||||
while ($row_setup = @mysqli_fetch_array($result_setup, 1)) {
|
||||
?>
|
||||
<a class="dashoard_box button_inhalt_collection"
|
||||
href="<?php echo get_menu_link($_GET["level_1"] . "/" . $row_setup['id'], $GLOBALS['site'], $GLOBALS['language']); ?>">
|
||||
<span
|
||||
class="dashboard_box_number"><?php echo countCollection($row_setup['id']); ?></span>
|
||||
<span class="dashboard_box_description"><?php echo $row_setup['description']; ?></span>
|
||||
<img
|
||||
src="<?php echo PATH_SETUP_ICON_COLLECTION . ($row_setup['icon'] != "" ? $row_setup['icon'] : 'dokumente_2.png'); ?>" />
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
function loadWorldButtons(){
|
||||
$query = "SELECT * FROM main_collection_setup_world ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
echo "<div class='pop-up-button'>Alle</div>";
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
echo "<div class='pop-up-button'>".$row['description']."</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div id="mainContent" class="w-100">
|
||||
<div class="collection-content dashboard-left-content">
|
||||
<img class="mysyde-icon img-fluid"src="/layout/admin/img/icons/mysyde-icon.svg" alt="MySyde Icon">
|
||||
<div class="text-content">
|
||||
<div class="text-white"><?php echo current_website_language($site, $language); ?></div>
|
||||
<h1 class="new-h1 text-white"><?php echo $translation->get("intranet_posts"); ?></h1>
|
||||
<p class="text-white">Sie sind das Herz und die Niere einer jeden Content Welt</p>
|
||||
</div>
|
||||
<img src="/layout/admin/img/icons/mysyde-bg.jpg" alt="" class="module-content-img hintergrund module-hintergrund position-absolute top-0 left-0 z-index-1">
|
||||
</div>
|
||||
<div class="collection_overview">
|
||||
<div class='collection_world_buttons'>
|
||||
<?php loadWorldButtons(); ?>
|
||||
</div>
|
||||
<div class='collection_world_content'>
|
||||
<?php allCollections();?>
|
||||
<?php loadWorlds();?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
// Popup Element automatisches öffnen
|
||||
var popupButton = document.getElementsByClassName("pop-up-button");
|
||||
for (let i = 0; i < popupButton.length; i++) {
|
||||
popupButton[i].setAttribute("data-button", i);
|
||||
}
|
||||
|
||||
var popupElement = document.getElementsByClassName("pop-up-element");
|
||||
$(".pop-up-element").hide();
|
||||
for (let i = 0; i < popupElement.length; i++) {
|
||||
popupElement[i].setAttribute("data-element", i);
|
||||
}
|
||||
|
||||
$(".pop-up-button").click(function() {
|
||||
|
||||
let buttonID = this.getAttribute("data-button");
|
||||
|
||||
$(".pop-up-element").each(function() {
|
||||
|
||||
let elementID = this.getAttribute("data-element");
|
||||
$(".pop-up-button").removeClass('current');
|
||||
|
||||
if (buttonID == elementID) {
|
||||
$(this).animate({ 'opacity': 'show' }, 500);
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
|
||||
});
|
||||
$(this).addClass('current');
|
||||
});
|
||||
|
||||
|
||||
$(".pop-up-element:first-child").show();
|
||||
$(".pop-up-button:first-child").addClass("current");
|
||||
$(".pop-up-element:first-child").addClass("current");
|
||||
</script>
|
||||
3045
module/collection/edit_collection.inc.php
Normal file
3045
module/collection/edit_collection.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
353
module/collection/edit_collection_cardform.inc.php
Normal file
353
module/collection/edit_collection_cardform.inc.php
Normal file
@@ -0,0 +1,353 @@
|
||||
<?
|
||||
$formname = "form_collection_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
// Masked
|
||||
global $masked;
|
||||
|
||||
if($masked){?>
|
||||
<style>
|
||||
.collection_field table.cardform td:first-child {
|
||||
width: 100%;
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<?php }
|
||||
// Masked
|
||||
$collection_setup_id;
|
||||
$collection_setup_id = NULL;
|
||||
if (isset($_GET["level_2"]) && (int)$_GET["level_2"]) {
|
||||
$collection_setup_id = $_GET["level_2"];
|
||||
}
|
||||
$query = "SELECT * FROM main_collection_setup WHERE id = '" . $collection_setup_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$collection_setup = @mysqli_fetch_array($result);
|
||||
|
||||
if($collection_setup['is_custom_collection'] == '1'){
|
||||
|
||||
$masked = FALSE;
|
||||
}
|
||||
|
||||
// erstelle kollektionen sammeln
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
// erstellte kontaktformulare sammeln
|
||||
$contactforms = array();
|
||||
$query = "SELECT * FROM contactform_header WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) AND collection_header = 0";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$contactforms[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$sorting_values = array(
|
||||
$translation->get("collection_sorting_keep"),
|
||||
$translation->get("collection_sorting_change_top"),
|
||||
$translation->get("collection_sorting_change_bottom")
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<script> $( "#overlaycrumb , .collectionform, .collections form#form_line_list " ).wrapAll( "<div class='collection-main-wrapper' />");
|
||||
$( "ul.toolbar_menu.collection, .collection_form.collection " ).wrapAll( "<div class='collection-wrapper'></div>" );
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function saveCollectionMasked(_close){
|
||||
var aFormData = new FormData();
|
||||
|
||||
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
$('#overlayContent :input').each(function() {
|
||||
if ($(this).attr("type") == "file") {
|
||||
aFormData.append($(this).attr("name"), $(this).get(0).files[0]);
|
||||
} else if ($(this).attr("type") == "checkbox") {
|
||||
if ($(this).prop("checked") === true) {
|
||||
aFormData.append($(this).attr("name"), "on");
|
||||
}
|
||||
} else {
|
||||
aFormData.append($(this).attr("name"), $(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
loadCard('savemasked_collection', true, '', _close, aFormData);
|
||||
|
||||
}
|
||||
|
||||
function saveCollection(_close) {
|
||||
|
||||
var aFormData = new FormData();
|
||||
|
||||
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
$('#overlayContent :input').each(function() {
|
||||
if ($(this).attr("type") == "file") {
|
||||
aFormData.append($(this).attr("name"), $(this).get(0).files[0]);
|
||||
} else if ($(this).attr("type") == "checkbox") {
|
||||
if ($(this).prop("checked") === true) {
|
||||
aFormData.append($(this).attr("name"), "on");
|
||||
}
|
||||
} else {
|
||||
aFormData.append($(this).attr("name"), $(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
loadCard('save_collection', true, '', _close, aFormData);
|
||||
}
|
||||
function copy_collection(_close) {
|
||||
|
||||
var aFormData = new FormData();
|
||||
|
||||
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
$('#overlayContent :input').each(function() {
|
||||
if ($(this).attr("type") == "file") {
|
||||
aFormData.append($(this).attr("name"), $(this).get(0).files[0]);
|
||||
} else if ($(this).attr("type") == "checkbox") {
|
||||
if ($(this).prop("checked") === true) {
|
||||
aFormData.append($(this).attr("name"), "on");
|
||||
}
|
||||
} else {
|
||||
aFormData.append($(this).attr("name"), $(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
loadCard('copy_collection', true, '', _close, aFormData);
|
||||
}
|
||||
function toggle_registration_forms(_checkbox) {
|
||||
if ($(_checkbox).is(":checked")) {
|
||||
$('.registration_select', $('#<?php echo $formname; ?>')).show();
|
||||
} else {
|
||||
$('.registration_select', $('#<?php echo $formname; ?>')).hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<div id="overlaycrumb" class='collection'>
|
||||
|
||||
|
||||
<?php
|
||||
input($translation->get("collection_title"), "input_description", "text", $input_collection["description"], 255);
|
||||
create_contactform_select($contactforms, $translation->get("registration_form"), "registration_contactform_id", $input_collection, (int)$input_collection["registration"] == 0 ? TRUE : FALSE);
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if (count($collection_setups) == 0) {
|
||||
|
||||
// Wenn keine Kollektionseinstellungen angelegt wurden, dann nicht weiter machen
|
||||
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu collection">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
if (is_page_edit()) {
|
||||
button("left", $translation->get("show_all"), $formname, "loadCard('list_collection_page', true)");
|
||||
}
|
||||
|
||||
if(!$masked){
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "saveCollection(false)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "saveCollection(true)");
|
||||
// Kopie Kollecktion
|
||||
|
||||
}else{
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "saveCollectionMasked(true)");
|
||||
}
|
||||
?>
|
||||
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
button("back", $translation->get("back"), $formname, "backButton()", "", FALSE);
|
||||
|
||||
|
||||
if ($input_collection["id"] != "") {
|
||||
button("copy", $translation->get("copy_collection_setup_entry"), $formname, "copy_collection(true)", "", FALSE);
|
||||
}
|
||||
// Loeschen button
|
||||
if ($input_collection["id"] != "" && is_page_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_collection', true, '{$translation->get('delete_collection_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" class='collection_form collection'>
|
||||
<input name="input_collection_id" type="hidden" value="<?= $input_collection["id"] ?>">
|
||||
<input type="hidden" name="main_collection_setup_id" value="<?php echo $input_collection['main_collection_setup_id']; ?>" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<?php if($masked){
|
||||
$count = 5;
|
||||
for($i = 1; $i<= $count; $i++){
|
||||
?>
|
||||
<table class="cardform quickentry card_count<?=$i?>" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<?php
|
||||
text($translation->get("collection_type"), $collection_setup['description']);
|
||||
echo '<div class="dp">';
|
||||
input($translation->get("validity_from"), "input_validity_from", "date", datefromsql($input_collection["validity_from"]), 10);
|
||||
input($translation->get("validity_from"), "input_validity_from", "date", datefromsql($input_collection["validity_from"]), 10);
|
||||
echo '</div>';
|
||||
// input_select($translation->get("collection_change_sorting"), "input_change_sorting", $values = array_keys($sorting_values), $value_names = array_values($sorting_values), "", FALSE, FALSE);
|
||||
// input($translation->get("registration_possible"), "input_registration", "checkbox", $input_collection["registration"], NULL, FALSE, FALSE, 'onchange="toggle_registration_forms(this);"');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="full-block">
|
||||
<hr>
|
||||
<div class="collectionform">
|
||||
<?php
|
||||
|
||||
$collectionFieldSetups = array();
|
||||
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = '" . $collection_setup_id . "' ORDER BY sorting ASC";
|
||||
|
||||
$result_collection = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result_collection, 1)) {
|
||||
$collectionFieldSetups[] = $row;
|
||||
}
|
||||
|
||||
if (count($collectionFieldSetups)) {
|
||||
|
||||
foreach ($collectionFieldSetups as $row) {
|
||||
echo "<tr><td>";
|
||||
|
||||
create_collection_input_field_masked($row, $collection_setup_id, $i);
|
||||
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<?php } //end foreach ?>
|
||||
<?php } else{ ?>
|
||||
<div class="collection_toolbar_table">
|
||||
<table class="cardform " border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
// if ($collection_setup['collection_type'] == 1) {
|
||||
try {
|
||||
//code...
|
||||
|
||||
multi_select_permission($input_collection['id'], 'department');
|
||||
multi_select_permission($input_collection['id'], 'role');
|
||||
multi_select_permission($input_collection['id'], 'einricht');
|
||||
multi_select_permission($input_collection['id'], 'fachbereich');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
// }
|
||||
create_mandant_select($input_collection['id']);
|
||||
|
||||
if ($collection_setup['collection_type'] == 4) {
|
||||
create_knowledegecenter_category_select($input_collection['id']);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($input_collection["id"] != "") {
|
||||
create_collection_groups_select($input_collection);
|
||||
}
|
||||
// create_collection_tags();
|
||||
input($translation->get("validity_from"), "input_validity_from", "date", ($input_collection["validity_from"]), 10);
|
||||
input($translation->get("validity_to"), "input_validity_to", "date", ($input_collection["validity_to"]), 10);
|
||||
// input($translation->get("active"), "input_active", "checkbox", $input_collection["active"], 10);
|
||||
input($translation->get("readable"), "input_readable", "checkbox", "", 10);
|
||||
// input_select($translation->get("collection_change_sorting"), "input_change_sorting", $values = array_keys($sorting_values), $value_names = array_values($sorting_values), "", FALSE, FALSE);
|
||||
// input($translation->get("registration_possible"), "input_registration", "checkbox", $input_collection["registration"], NULL, FALSE, FALSE, 'onchange="toggle_registration_forms(this);"');
|
||||
create_contactform_select($contactforms, $translation->get("registration_form"), "registration_contactform_id", $input_collection, (int)$input_collection["registration"] == 0 ? TRUE : FALSE);
|
||||
?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<!-- <?php
|
||||
if ($collection_setup['collection_type'] == 3) {
|
||||
require_once MODULE_PATH. "calendar/calendar_collection_serial.php";
|
||||
}
|
||||
?> -->
|
||||
</form>
|
||||
|
||||
|
||||
<?
|
||||
if ($input_collection['id'] != "") {
|
||||
require_once("edit_collection_line_listform.inc.php");
|
||||
}
|
||||
if($collection_setup['is_custom_collection'] && $input_collection['id'] != ''){
|
||||
$collection_id = $input_collection['id'];
|
||||
require_once("edit_collection_custom_list.inc.php");
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
// function btnClicked(el){
|
||||
// if ($(el).parent(".collection_field").hasClass("current")){
|
||||
// $(el).parent(".collection_field").children(".input.active").removeClass("active");
|
||||
// $(el).parent(".collection_field").removeClass("current");
|
||||
|
||||
// }
|
||||
// else {
|
||||
// $(el).parent(".collection_field").children(".input").addClass("active");
|
||||
// $(el).parent(".collection_field").addClass("current");
|
||||
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
127
module/collection/edit_collection_custom_list.inc.php
Normal file
127
module/collection/edit_collection_custom_list.inc.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
use DynCom\mysyde\common\classes\CollectionTypes;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_line_list";
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::getCustom();
|
||||
|
||||
|
||||
$collectionTypes = \DynCom\mysyde\common\classes\CollectionTypes::get();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function toggleScrollerHeadline() {
|
||||
var contentscroller = $('.inhalte_toggle_container');
|
||||
contentscroller.show();
|
||||
}
|
||||
|
||||
function contentmenuClick( _el, _fieldtype, _type_id, selectedField = '' ) {
|
||||
saveCollection(false);
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
setCurrentToolbarClicked(_el);
|
||||
jQuery('input[name="fieldtype"]', jQuery('#<?php echo $formname; ?>')).val(_fieldtype);
|
||||
jQuery('input[name="type_id"]', jQuery('#<?php echo $formname; ?>')).val(_type_id);
|
||||
jQuery('input[name="selectedField"]', jQuery('#<?php echo $formname; ?>')).val(selectedField);
|
||||
// saveCollection(false);
|
||||
loadCard('newCustomLine_collection', true);
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" style="position:unset;">
|
||||
<input name="input_id" type="hidden" value="<?= $collection_setup_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
|
||||
<input type="hidden" name="fieldtype" value="" />
|
||||
<input type="hidden" name="selectedField" value="">
|
||||
<input type="hidden" name="type_id" value="" />
|
||||
<input type="hidden" name="collection_id" value="<?=$collection_id?>" />
|
||||
|
||||
<h3 ><?php echo $translation->get("collection_field_headline"); ?></h3>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "toggleScrollerHeadline();", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('editLineSetup_collection')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('deleteLineSetup_collection', false, '{$translation->get('delete_setup_line_collection_confirm')}')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="inhalte_toggle_container" id="inhalte_form_headline">
|
||||
<div id="srollerInhalteHeadline"><h2><?php echo $translation->get("insert_new_field"); ?></h2></div>
|
||||
</div>
|
||||
<div id="pagecontentScroller" class="pagecontentScroller inhalte_toggle_container">
|
||||
<div class="scroller_inhalte">
|
||||
|
||||
<ul class="inhalte_menu">
|
||||
<?php
|
||||
button('inhalt_eingabefeld graybox', "Eingabefeld", $formname, "contentmenuClick(this, 'standard', 0, 1)");
|
||||
|
||||
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
if ((isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === TRUE) && $sitepartId != 14) {
|
||||
continue;
|
||||
}
|
||||
|
||||
button($sitepartData['class'], $sitepartData['description'], $formname, "contentmenuClick(this, 'siteparts', " . $sitepartId . ")");
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = '" . $collection_setup_id . "' AND main_collection_id = '".$collection_id."' ORDER BY sorting ASC";
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
echo " <table data-sortableupdateaction=\"update_sortorder_setup_collection\" cellpadding=0 cellspacing=0 border=0 class=\"linklist sortableTable\">\n";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_key($translation->get("type"), "");
|
||||
echo format_key("", "");
|
||||
echo format_key($translation->get("description"), "");
|
||||
echo format_key($translation->get("show_in_teaser"), "");
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
|
||||
if ($row['fieldtype'] == 'siteparts') {
|
||||
// die zeile bezieht sich auf ein sitepart
|
||||
$sitepartType = $translation->get("sitepart") . ": " . $siteparts[$row['type_id']]['description'];
|
||||
} else {
|
||||
// zeile ist ein extra datentyp fuer kollektionen
|
||||
$sitepartType = $translation->get("input_field") . ": " . $collectionTypes[$row['type_id']]['description'];
|
||||
}
|
||||
|
||||
$checkedRow = $row['id'] == $_REQUEST["input_line_id"] ? 'true' : 'false';
|
||||
|
||||
echo " <tr id=\"linklistid_{$row['id']}\" class=\"linklist_content\" data-checked=\"{$checkedRow}\" data-inputname=\"input_id\" data-action=\"editLineSetup_collection\" data-inputid=\"{$row['id']}\">\n";
|
||||
|
||||
echo format_value($sitepartType, "input_id");
|
||||
echo format_value("", "sorticon", "sort");
|
||||
echo format_value($row['fieldname'], "input_id");
|
||||
echo format_value($row['is_teaser'], "input_id", "boolean");
|
||||
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
echo " </table>\n";
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
@@ -0,0 +1,351 @@
|
||||
<?
|
||||
$formname = "form_collection_choose_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::getCustom();
|
||||
function create_type_select( $name, $selectname = "input_choose_type", $input_line, $selectedField = '' ) {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$collectionTypes = \DynCom\mysyde\common\classes\CollectionTypes::get();
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::getCustom();
|
||||
echo "<div class=\"label\"><label for=\"" . $selectname . "\">" . $name . "</label></div>";
|
||||
echo "<div class=\"input\"><select onchange=\"load_sitepart_settings(this.value);\" class=\"bigselect\" name=\"" . $selectname . "\" id=\"" . $selectname . "\">";
|
||||
|
||||
|
||||
// neue typen die nur fuer kollektionen vorgesehen sind
|
||||
foreach ($collectionTypes as $typeId => $typeData) {
|
||||
$selected = '';
|
||||
if (isset($input_line['fieldtype']) && $input_line['fieldtype'] == 'standard' && $typeId == $input_line['type_id']) {
|
||||
$selected = 'selected="selected"';
|
||||
}else if($selectedField != "" && $typeId == $selectedField){
|
||||
$selected = 'selected="selected"';
|
||||
|
||||
|
||||
}
|
||||
// echo 'selected ist'.$typeId.' and val ist'.$selectedField;
|
||||
|
||||
echo "<option " . $selected . " value=\"" . $typeId . "\">" . $typeData['description'] . "</option>";
|
||||
|
||||
}
|
||||
|
||||
// // siteparts anzeigen
|
||||
// echo "<optgroup label=\"Siteparts\" value=\"siteparts\">";
|
||||
// foreach($siteparts as $sitepartId => $sitepartData) {
|
||||
// $selected = '';
|
||||
//
|
||||
// if(isset($input_line['fieldtype']) && $input_line['fieldtype'] == 'siteparts' && $sitepartId == $input_line['type_id']) {
|
||||
// $selected = 'selected="selected"';
|
||||
// }
|
||||
// echo "<option " . $selected . " value=\"" . $sitepartId . "\">" . $sitepartData['description'] . "</option>";
|
||||
// }
|
||||
// echo "</optgroup>";
|
||||
|
||||
echo "</select>";
|
||||
}
|
||||
|
||||
$sitepart_options = array();
|
||||
if (isset($input_line['options'])) {
|
||||
$sitepart_options = unserialize($input_line['options']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
loadFields();
|
||||
})
|
||||
|
||||
function setCollectionType( _select ) {
|
||||
var collectiontype = jQuery(_select).find('option:selected').parent().attr('value');
|
||||
jQuery('#collection_type', jQuery('#<?php echo $formname; ?>')).val(collectiontype);
|
||||
if (collectiontype == 'siteparts') {
|
||||
load_sitepart_settings(jQuery(_select).val());
|
||||
} else {
|
||||
jQuery('#collection_type_settings').html('');
|
||||
}
|
||||
}
|
||||
|
||||
function loadFields() {
|
||||
|
||||
let _sitepartId = $('#main_input_choose_type').val();
|
||||
|
||||
//Zeichenlängefeld
|
||||
if( _sitepartId == 1 || _sitepartId == 2 ) {
|
||||
$('#main_input_maxlength').closest('tr').show();
|
||||
} else {
|
||||
$('#main_input_maxlength').val('').closest('tr').hide();
|
||||
}
|
||||
|
||||
//Zeichenlängefeld
|
||||
if( _sitepartId == 6 || _sitepartId == 7 ) {
|
||||
$('#main_input_option_string').closest('tr').show();
|
||||
} else {
|
||||
$('#main_input_option_string').val('').closest('tr').hide();
|
||||
}
|
||||
|
||||
//Zeichenlängefeld
|
||||
if( _sitepartId == 2) {
|
||||
$('#main_input_is_bulletlist').closest('tr').show();
|
||||
} else {
|
||||
$('#main_input_is_bulletlist').val('').closest('tr').hide();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function load_sitepart_settings( _sitepartId ) {
|
||||
|
||||
loadFields();
|
||||
|
||||
jQuery('#collection_type_settings').html('');
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("sitepartid", _sitepartId);
|
||||
$.ajax({
|
||||
url : "?action=loadsitepart_collection",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
jQuery('#collection_type_settings').html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_collection_field");
|
||||
} else {
|
||||
echo $translation->get("edit_collection_field");
|
||||
}
|
||||
?>
|
||||
|
||||
<?php button("closeoverlay", $translation->get("back"), $formname, "loadCard('editCustomSetup_collection', true)"); ?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
button("left", $translation->get("back"), $formname, "loadCard('editCustomSetup_collection', true)");
|
||||
|
||||
// Speichern buttons
|
||||
|
||||
button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('saveLine_collection', true)");
|
||||
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('deleteLineSetup_collection', true, '{$translation->get('delete_line_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$is_teaser = 1;
|
||||
if (isset($input_line["is_teaser"])) {
|
||||
$is_teaser = $input_line["is_teaser"];
|
||||
}
|
||||
|
||||
$show_description_title = 0;
|
||||
if (isset($input_line["show_description_title"])) {
|
||||
$show_description_title = $input_line["show_description_title"];
|
||||
}
|
||||
|
||||
$is_bulletlist = 0;
|
||||
if (isset($input_line["is_bulletlist"])) {
|
||||
$is_bulletlist = $input_line["is_bulletlist"];
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_REQUEST['input_id'] ?>">
|
||||
<input name="collection_id" type="hidden" value="<?= $_REQUEST['collection_id']; ?>">
|
||||
<input type="hidden" name="collection_type" id="collection_type" value="<?= $input_line["fieldtype"]; ?>" />
|
||||
<input type="hidden" name="selectedField" id="selectedField" value="<?= $_REQUEST['selectedField']; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<?php if ($input_line['fieldtype'] == 'standard'): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?
|
||||
$selectedField = $_REQUEST['selectedField'];
|
||||
create_type_select($translation->get("choose_type"), "main_input_choose_type", $input_line, $selectedField); ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="main_input_choose_type" value="<?php echo $input_line['type_id']; ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($input_line['fieldtype'] == 'standard') { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("input_maxlength"), "main_input_maxlength", "number", $input_line["input_maxlength"]) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("note"), "main_input_note", "text", $input_line["note"]) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display:none">
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "main_input_code", "code", $input_line["code"], 20) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "main_input_description", "text", $input_line["fieldname"], 45) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ($input_line['fieldtype'] == 'standard') { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("optionvalues"), "main_input_option_string", "text", $input_line["option_string"], 400) ?>
|
||||
<div class="main_input_option_string" style="display:none;">
|
||||
<div id="example1">
|
||||
<div class="r-group">
|
||||
<p>
|
||||
<label for="main_input_option_string_0_0" data-pattern-text="<?= $translation->get("optionvalues");?> +=1:"><?= $translation->get("optionvalues");?> 1:</label>
|
||||
<input type="text" name="main_input_option_string[0]" id="main_input_option_string_0" class="form-control" data-pattern-name="vehicle[++]" data-pattern-id="main_input_option_string_++" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<!-- Add a remove button for the item. If one didn't exist, it would be added to overall group -->
|
||||
<button type="button" class="r-btnRemove btn btn-danger">Remove -</button>
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" class="r-btnAdd btn btn-primary">Add +</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("is_bulletlist"), "main_input_is_bulletlist", "checkbox", $is_bulletlist) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("show_in_teaser"), "main_input_is_teaser", "checkbox", $is_teaser) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("show_description_title"), "main_input_show_description_title", "checkbox", $show_description_title) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("mandatory_field"), "main_input_mandatory", "checkbox", $input_line["mandatory"]) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<div id="collection_type_settings">
|
||||
<?php
|
||||
if ($input_line['fieldtype'] == 'siteparts' && $input_line['type_id'] > 0) {
|
||||
$sitepartCode = $siteparts[$input_line['type_id']]['code'];
|
||||
$sitepartfolder = $siteparts[$input_line['type_id']]['folder'];
|
||||
|
||||
$include = MODULE_PATH . $sitepartfolder . "/collection_" . $sitepartCode . "_cardform.inc.php";
|
||||
if (file_exists($include)) {
|
||||
require_once($include);
|
||||
}
|
||||
} elseif ($input_line['fieldtype'] == 'standard' && $input_line['type_id'] == 5) {
|
||||
$include = MODULE_PATH . "collection/edit_collection_image_config.inc.php";
|
||||
if (file_exists($include)) {
|
||||
require_once($include);
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
// var $y = jQuery.noConflict();
|
||||
// $y('#example1').repeater({
|
||||
// btnAddClass: 'r-btnAdd',
|
||||
// btnRemoveClass: 'r-btnRemove',
|
||||
// groupClass: 'r-group',
|
||||
// minItems: 1,
|
||||
// maxItems: 0,
|
||||
// startingIndex: 0,
|
||||
// showMinItemsOnLoad: true,
|
||||
// reindexOnDelete: true,
|
||||
// repeatMode: 'append',
|
||||
// animation: 'fade',
|
||||
// animationSpeed: 400,
|
||||
// animationEasing: 'swing',
|
||||
// clearValues: true
|
||||
// }, [
|
||||
// {
|
||||
// "main_input_option_string[0]":"",
|
||||
|
||||
// }
|
||||
// ]);
|
||||
</script>
|
||||
22
module/collection/edit_collection_image_config.inc.php
Normal file
22
module/collection/edit_collection_image_config.inc.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
if (!is_array($sitepart_options) || count($sitepart_options) == 0) {
|
||||
$width = 1920;
|
||||
$height = 1080;
|
||||
} else {
|
||||
$width = $sitepart_options["collection_setup_image_width"];
|
||||
$height = $sitepart_options["collection_setup_image_height"];
|
||||
}
|
||||
?>
|
||||
<h2>Bildoptionen</h2>
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><?php input($translation->get("max_width"), "collection_setup_image_width", "code", $width); ?> </td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php input($translation->get("max_height"), "collection_setup_image_height", "code", $height); ?> </td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
41
module/collection/edit_collection_line_listform.inc.php
Normal file
41
module/collection/edit_collection_line_listform.inc.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_line_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
|
||||
$main_collection_setup_id = '';
|
||||
if(!empty($input_collection)){
|
||||
$main_collection_setup_id = $input_collection['main_collection_setup_id'];
|
||||
}else if (isset($_GET["level_2"]) && (int)$_GET["level_2"]) {
|
||||
$main_collection_setup_id = $_GET["level_2"];
|
||||
}
|
||||
$query = "SELECT * FROM main_collection_setup WHERE id = '" . $main_collection_setup_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$main_collection_setup = @mysqli_fetch_array($result);
|
||||
?>
|
||||
|
||||
<div class="collectionform">
|
||||
<?php
|
||||
$collectionFieldSetups = array();
|
||||
if(!$main_collection_setup['is_custom_collection']){
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = '" . $main_collection_setup_id . "' ORDER BY sorting ASC";
|
||||
}else{
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = '" . $main_collection_setup_id . "' AND main_collection_id = '".$input_collection['id']."' ORDER BY sorting ASC";
|
||||
}
|
||||
$result_collection = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result_collection, 1)) {
|
||||
$collectionFieldSetups[] = $row;
|
||||
}
|
||||
|
||||
if (count($collectionFieldSetups)) {
|
||||
foreach ($collectionFieldSetups as $row) {
|
||||
echo "<tr><td>";
|
||||
|
||||
create_collection_input_field($row, $input_collection);
|
||||
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
202
module/collection/edit_collection_listform.inc.php
Normal file
202
module/collection/edit_collection_listform.inc.php
Normal file
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_list";
|
||||
$inputname = "input_id";
|
||||
$filter = (isset($_REQUEST['filter']) ? $_REQUEST['filter'] : "");
|
||||
global $filter_mandant;
|
||||
$filter_mandant = (isset($_REQUEST['mandant_id']) ? $_REQUEST['mandant_id'] : 0);
|
||||
|
||||
$collection_setup_info = get_collection_setup_info();
|
||||
|
||||
function filter_mandant($filter){ ?>
|
||||
<h3><?php echo get_translation('filter_mandant'); ?>:</h3>
|
||||
<div class="input">
|
||||
<select id="filter_mandant" name="filter_mandant" class="bigselect" onchange="filter_mandant();">
|
||||
<option value="0"><?php echo get_translation('all_mandate'); ?></option>
|
||||
<?php
|
||||
$query = "SELECT * FROM main_mandant";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = @mysqli_fetch_array($result)){ ?>
|
||||
<option value="<?= $row['id'] ?>" <?= ($filter == $row['id'] ? 'selected="selected"' : ""); ?>><?= $row['description'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function filter_collection() {
|
||||
jQuery('#form_collection_list .requestLoader').show();
|
||||
|
||||
var filter = jQuery('#collection_filter').val();
|
||||
|
||||
jQuery('#form_collection_list').attr("action", "?filter=" + filter).submit();
|
||||
|
||||
return;
|
||||
|
||||
var formData = {
|
||||
filter_id: jQuery('#collection_filter').val(),
|
||||
};
|
||||
|
||||
jQuery('#filter_collection_setup_id').val(jQuery('#collection_filter').val());
|
||||
$.ajax({
|
||||
url : "?action=filter_collection",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
success: function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
jQuery('#form_collection_list .requestLoader').hide();
|
||||
jQuery('#page_linklist').html(output);
|
||||
|
||||
initForm();
|
||||
initLinklist();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function filter_mandant() {
|
||||
var filter = jQuery('#filter_mandant').val();
|
||||
const url = window.location.href.split('&')[0];
|
||||
if(window.location.search){
|
||||
var newUrl = url + '&mandant_id='+filter;
|
||||
}else{
|
||||
var newUrl = url + '?mandant_id='+filter;
|
||||
}
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_collection', true)"); ?>
|
||||
<!-- <?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_collection')"); ?> -->
|
||||
<?php if(!$collection_setup_info['is_custom_collection']){
|
||||
// echo button("new", $translation->get("mask"), $formname, "loadCard('mask_collection', true)");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<li>
|
||||
<ul>
|
||||
<!-- <?= button("up", $translation->get("go_up"), $formname, "sendRequest('moveup_line_collection')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "sendRequest('movedown_line_collection')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_collection', false, '{$translation->get('delete_collection_confirm')}')", "", FALSE); ?> -->
|
||||
<!-- <?= button("xml", $translation->get("generate_xml"), $formname, "sendRequest('generate_xml')", "", FALSE); ?> -->
|
||||
</ul>
|
||||
</li>
|
||||
<div class="filter-collection">
|
||||
<h3><?php echo get_translation('filter'); ?>:</h3>
|
||||
<div class="input">
|
||||
<select id="collection_filter" name="collection_filter" class="bigselect" onchange="filter_collection();">
|
||||
<option value="0"><?php echo get_translation('collection_filter_active'); ?></option>
|
||||
<option value="past" <?php echo ($filter == "past" ? 'selected="selected"' : ""); ?>><?php echo get_translation('collection_filter_past'); ?></option>
|
||||
<option value="future" <?php echo ($filter == "future" ? 'selected="selected"' : ""); ?>><?php echo get_translation('collection_filter_future'); ?></option>
|
||||
<option value="all" <?php echo ($filter == "all" ? 'selected="selected"' : ""); ?>><?php echo get_translation('collection_filter_all'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter_mandant">
|
||||
<?= filter_mandant($filter_mandant) ?>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo $collection_setup_info['description']; ?></h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_collection_id" value="" />
|
||||
<input type="hidden" id="filter_collection_setup_id" name="filter_collection_setup_id"
|
||||
value="<?php echo(isset($_REQUEST['filter_id']) ? (int)$_REQUEST['filter_id'] : ''); ?>" />
|
||||
<div class="requestLoader"></div>
|
||||
<div id="page_linklist">
|
||||
<?
|
||||
$where = "";
|
||||
if ($collection_setup_id != 0) {
|
||||
$where = " and main_collection.main_collection_setup_id = " . $collection_setup_id;
|
||||
}
|
||||
|
||||
switch($filter) {
|
||||
case 'past':
|
||||
$where .= " AND (validity_to IS NOT NULL AND validity_to < '" . date("Y-m-d") . "') ";
|
||||
break;
|
||||
case 'future':
|
||||
$where .= " AND (validity_from IS NOT NULL AND validity_from > '" . date("Y-m-d") . "') ";
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
// muss nicht nach datum gefiltert werden
|
||||
break;
|
||||
|
||||
default:
|
||||
$where .= " AND (validity_from IS NULL OR validity_from <= '" . date("Y-m-d") . "') ";
|
||||
$where .= " AND (validity_to IS NULL OR validity_to >= '" . date("Y-m-d") . "') ";
|
||||
break;
|
||||
}
|
||||
|
||||
if($filter_mandant != NULL){
|
||||
$where = " AND ((main_collection_mandant_link.main_collection_id IS NOT NULL AND main_mandant_id = ".$filter_mandant.") OR main_collection_mandant_link.main_collection_id IS NULL)";
|
||||
}
|
||||
|
||||
$query = "SELECT
|
||||
DISTINCT main_collection.id,
|
||||
main_collection.description AS '" . $translation->get("description") . "',
|
||||
from_unixtime(main_collection.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "',
|
||||
main_admin_user.name AS '" . $translation->get("changed_by") . "'
|
||||
from
|
||||
main_collection left join main_admin_user
|
||||
ON
|
||||
main_collection.modified_user = main_admin_user.id
|
||||
inner join main_collection_setup
|
||||
ON
|
||||
main_collection.main_collection_setup_id = main_collection_setup.id
|
||||
LEFT JOIN main_collection_setup_websites
|
||||
ON main_collection_setup.id = main_collection_setup_websites.main_collection_setup_id
|
||||
LEFT JOIN main_collection_mandant_link
|
||||
ON main_collection.id = main_collection_mandant_link.main_collection_id
|
||||
where
|
||||
(main_collection_setup.main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR main_collection_setup.all_languages = 1 OR main_collection_setup_websites.main_site_id = ".$GLOBALS['site']['id']." ) $where ORDER BY main_collection.main_collection_setup_id asc, sorting asc";
|
||||
|
||||
if($collection_setup_id == 4){
|
||||
$query = query_infoboard($where);
|
||||
}
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_collection_id", "edit_collection", TRUE, "update_sortorder_collection", "sendRequest('delete_collection', false, '{$translation->get('delete_collection_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
function query_infoboard($where){
|
||||
$query = "SELECT DISTINCT main_collection.id,
|
||||
IFNULL(DATE_FORMAT(main_data.data_date, '%d.%m.%Y'), '') AS 'Datum',
|
||||
main_collection.description AS 'Beschreibung',
|
||||
main_admin_user.name AS 'Geändert von'
|
||||
FROM main_collection LEFT JOIN (
|
||||
SELECT
|
||||
ml.main_collection_id,
|
||||
ml.data AS data_text,
|
||||
STR_TO_DATE(ml.data, '%Y-%m-%d') AS data_date
|
||||
FROM main_collection_link ml
|
||||
WHERE ml.main_collection_setup_content_id = 54
|
||||
) AS main_data ON main_collection.id = main_data.main_collection_id
|
||||
LEFT JOIN main_admin_user
|
||||
ON main_collection.modified_user = main_admin_user.id
|
||||
LEFT JOIN main_collection_mandant_link
|
||||
ON main_collection.id = main_collection_mandant_link.main_collection_id
|
||||
WHERE main_collection.main_collection_setup_id = 4" . $where . " ORDER BY main_collection.main_collection_setup_id asc, main_data.data_date DESC";
|
||||
return $query;
|
||||
}
|
||||
?>
|
||||
1225
module/collection/edit_collection_setup.inc.php
Normal file
1225
module/collection/edit_collection_setup.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
150
module/collection/edit_collection_setup_cardform.inc.php
Normal file
150
module/collection/edit_collection_setup_cardform.inc.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?
|
||||
$formname = "form_collection_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
global $collection_setup_images;
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var PATH_SETUP_ICON_COLLECTION = '<?php echo PATH_SETUP_ICON_COLLECTION; ?>';
|
||||
|
||||
function change_setup_icon( _image ) {
|
||||
$('.setup_icon', $('#<?php echo $formname; ?>')).val(_image);
|
||||
$('.setup_icon_container img').remove();
|
||||
$('.setup_icon_container').append($('<img>').attr("src", PATH_SETUP_ICON_COLLECTION + _image));
|
||||
}
|
||||
$(document).ready(function(){
|
||||
if($('#is_multidomain').prop("checked") == true){
|
||||
$('#websiteSelection').show();
|
||||
}
|
||||
|
||||
$('#is_multidomain').click(function(){
|
||||
if($(this).prop("checked") == true){
|
||||
$('#websiteSelection').show();
|
||||
}
|
||||
else if($(this).prop("checked") == false){
|
||||
$('#websiteSelection').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_collection["id"] == "") {
|
||||
echo $translation->get("new_collection_setup");
|
||||
} else {
|
||||
echo $translation->get("edit_collection_setup");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
if (is_page_edit()) {
|
||||
button("left", $translation->get("show_all"), $formname, "loadCard('list_collection_page', true)");
|
||||
}
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_collection_setup', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_collection_setup', true, '', true)");
|
||||
|
||||
if ($input_collection["id"] != "") {
|
||||
button("copy", $translation->get("copy_collection_setup"), $formname, "loadCard('copy_collection_setup', true)");
|
||||
}
|
||||
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_collection["id"] != "" && is_page_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete-collection"), $formname, "loadCard('delete_collection_setup', true, '{$translation->get('delete_collection_setup_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_collection["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="8">
|
||||
<input class="setup_icon" name="setup_icon" id="setup_icon" type="hidden"
|
||||
value="<?php echo $input_collection['icon']; ?>" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? input($translation->get("textkey"), "input_code", "code", $input_collection["code"], 20) ?>
|
||||
<? input($translation->get("collection_name"), "input_description", "text", $input_collection["description"], 255) ?>
|
||||
<?php
|
||||
$types = [
|
||||
'1' => $translation->get("normal"),
|
||||
'2' => $translation->get("job"),
|
||||
'3' => $translation->get("calendar"),
|
||||
'4' => $translation->get("top_knowledgecenter"),
|
||||
];
|
||||
$preselect = 1;
|
||||
if(isset($input_collection['collection_type']) ){
|
||||
$preselect = $input_collection['collection_type'];
|
||||
}
|
||||
?>
|
||||
<?php input_select($translation->get("collection_type"), "collection_type", $values = array_keys($types), $value_names = array_values($types), $preselect, FALSE, FALSE); ?>
|
||||
<?php collection_setup_world($input_collection); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo "<h3>".$translation->get("normal_collection_settings")."</h3>";
|
||||
input($translation->get("collection_linked"), "input_linked", "checkbox", $input_collection["linked"]);
|
||||
input($translation->get("desc_title"),"input_desc_title", "checkbox",$input_collection["desc_title"]);
|
||||
input($translation->get("show_in_menu"),"input_show_in_menu", "checkbox",$input_collection["show_in_menu"]);
|
||||
input($translation->get("Filter"),"input_show_filter", "checkbox",$input_collection["show_filter"]);
|
||||
echo "<h3 class='irgendwas'>".$translation->get("advanced_collection_settings")."</h3>";
|
||||
input($translation->get("custom"),"is_custom_collection", "checkbox",$input_collection["is_custom_collection"]);
|
||||
input($translation->get("show_group_name"),"input_show_group_name", "checkbox",$input_collection["show_group_name"]);
|
||||
input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_collection["all_languages"]);
|
||||
input($translation->get("frontend_creation"), "frontend_creation", "checkbox", $input_collection['is_multidomain'], NULL, FALSE, FALSE, '');
|
||||
input($translation->get("is_multidomain").'?', "is_multidomain", "checkbox", $input_collection['is_multidomain'], NULL, FALSE, FALSE, '');
|
||||
if ($input_collection["id"] != "") {
|
||||
try {
|
||||
collection_setup_websites($input_collection);
|
||||
}catch(Exception $e) {
|
||||
echo 'Message: ' .$e->getMessage();
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?
|
||||
if ($input_collection['id'] != "") {
|
||||
if(!$input_collection['is_custom_collection']){
|
||||
require_once("edit_collection_setup_line_listform.inc.php");
|
||||
}
|
||||
|
||||
require_once("edit_collection_setup_group_listform.inc.php");
|
||||
}
|
||||
?>
|
||||
90
module/collection/edit_collection_setup_copy.inc.php
Normal file
90
module/collection/edit_collection_setup_copy.inc.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_setup_copy_card";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$from = isset($_REQUEST['from']) ? $_REQUEST['from'] : '';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadLanguages( website_id ) {
|
||||
$('#siteLanguages', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (website_id == "" || website_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname; ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
$.ajax({
|
||||
url : "?action=load_languages",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.loader', $('#<?php echo $formname; ?>')).hide();
|
||||
$('#siteLanguages', $('#<?php echo $formname; ?>')).html(output.site_languages);
|
||||
}
|
||||
},
|
||||
dataType : 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("copy_collection"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
|
||||
<? button("left", $translation->get("back"), $formname, "loadCard('edit_collection_setup', true)"); ?>
|
||||
<?= button("save", $translation->get("copy_and_save"), $formname, "loadCard('copy_and_save_collection_setup', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_collection["id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><?php echo $translation->get("copy_collection_to"); ?>:</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? site_select($translation->get("website"), "site_id", null, false, true, 'loadLanguages(this.value);'); ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
<div id="siteLanguages"></div>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?
|
||||
$formname = "form_collection_group_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_collection_group");
|
||||
} else {
|
||||
echo $translation->get("edit_collection_group");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_collection_setup', true)");
|
||||
|
||||
// Speichern buttons
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_group_collection_setup', true)");
|
||||
button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_group_collection_setup', true)");
|
||||
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_group_collection_setup', true, '{$translation->get('delete_collection_group_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_group_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_REQUEST['input_id'] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_line["description"], 255) ?>
|
||||
<? input_select($translation->get("default_active"), "input_default_active", $values = array('0', '1'), $value_names = array($translation->get("no"), $translation->get("yes")), $input_line["default_active"]); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
use DynCom\mysyde\common\classes\CollectionTypes;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_group_line_list";
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$collectionTypes = \DynCom\mysyde\common\classes\CollectionTypes::get();
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_group_id" value="" />
|
||||
|
||||
<h3><?php echo $translation->get("collection_groups"); ?></h3>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_group_collection_setup', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_group_collection_setup')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_group_collection_setup', false, '{$translation->get('delete_collection_group_confirm')}')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, description AS '" . $translation->get("description") . "' from main_collection_setup_group WHERE main_collection_setup_id = '" . $input_id . "' ORDER by id asc";
|
||||
$format = array('option', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_group_id", "edit_group_collection_setup", "", "", "loadCard('delete_group_collection_setup', false, '{$translation->get('delete_collection_group_confirm')}')", TRUE);
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
506
module/collection/edit_collection_setup_line_cardform.inc.php
Normal file
506
module/collection/edit_collection_setup_line_cardform.inc.php
Normal file
@@ -0,0 +1,506 @@
|
||||
<?
|
||||
$formname = "form_collection_choose_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
$sitepart_options = array();
|
||||
if (isset($input_line['options'])) {
|
||||
$sitepart_options = unserialize($input_line['options']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
loadFields();
|
||||
})
|
||||
|
||||
function setCollectionType( _select ) {
|
||||
var collectiontype = jQuery(_select).find('option:selected').parent().attr('value');
|
||||
jQuery('#collection_type', jQuery('#<?php echo $formname; ?>')).val(collectiontype);
|
||||
if (collectiontype == 'siteparts') {
|
||||
load_sitepart_settings(jQuery(_select).val());
|
||||
} else {
|
||||
jQuery('#collection_type_settings').html('');
|
||||
}
|
||||
}
|
||||
|
||||
function loadFields() {
|
||||
|
||||
let _sitepartId = $('#main_input_choose_type').val();
|
||||
|
||||
//Zeichenlängefeld
|
||||
if( _sitepartId == 1 || _sitepartId == 2 ) {
|
||||
$('#main_input_maxlength').closest('tr').show();
|
||||
} else {
|
||||
$('#main_input_maxlength').val('').closest('tr').hide();
|
||||
}
|
||||
|
||||
//Zeichenlängefeld
|
||||
if( _sitepartId == 6 || _sitepartId == 7 ) {
|
||||
$('#main_input_option_string').closest('tr').show();
|
||||
} else {
|
||||
$('#main_input_option_string').val('').closest('tr').hide();
|
||||
}
|
||||
|
||||
//Zeichenlängefeld
|
||||
if( _sitepartId == 2) {
|
||||
$('#main_input_is_bulletlist').closest('tr').show();
|
||||
} else {
|
||||
$('#main_input_is_bulletlist').val('').closest('tr').hide();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function load_sitepart_settings( _sitepartId ) {
|
||||
|
||||
loadFields();
|
||||
|
||||
jQuery('#collection_type_settings').html('');
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("sitepartid", _sitepartId);
|
||||
$.ajax({
|
||||
url : "?action=load_sitepart_form",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
jQuery('#collection_type_settings').html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_collection_field");
|
||||
} else {
|
||||
echo $translation->get("edit_collection_field");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_collection_setup', true)");
|
||||
|
||||
// Speichern buttons
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_line_collection_setup', true)");
|
||||
button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_collection_setup', true)");
|
||||
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_collection_setup', true, '{$translation->get('delete_line_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$is_teaser = 1;
|
||||
if (isset($input_line["is_teaser"])) {
|
||||
$is_teaser = $input_line["is_teaser"];
|
||||
}
|
||||
|
||||
$show_description_title = 0;
|
||||
if (isset($input_line["show_description_title"])) {
|
||||
$show_description_title = $input_line["show_description_title"];
|
||||
}
|
||||
|
||||
$is_bulletlist = 0;
|
||||
if (isset($input_line["is_bulletlist"])) {
|
||||
$is_bulletlist = $input_line["is_bulletlist"];
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_REQUEST['input_id'] ?>">
|
||||
<input type="hidden" name="collection_type" id="collection_type" value="<?= $input_line["fieldtype"]; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<?php if ($input_line['fieldtype'] == 'standard'): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? create_type_select($translation->get("choose_type"), "main_input_choose_type", $input_line); ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="main_input_choose_type" value="<?php echo $input_line['type_id']; ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($input_line['fieldtype'] == 'standard') { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("input_maxlength"), "main_input_maxlength", "number", $input_line["input_maxlength"]) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<?php if ($input_line['fieldtype'] != 'group' && $input_line['fieldtype'] != 'collection_preview') { ?>
|
||||
<? input($translation->get("note"), "main_input_note", "text", $input_line["note"]) ?>
|
||||
<?php } else{ ?>
|
||||
<input type="hidden" name="main_input_note" value="" />
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "main_input_code", "code", $input_line["code"], 255) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "main_input_description", "text", $input_line["fieldname"], 45) ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php if($input_line['fieldtype'] == 'siteparts' && $input_line['type_id'] == '10'){ ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("height_px"), "height", "text", $input_line["height"], 45) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("width_px"), "width", "text", $input_line["width"], 45) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if($input_line['type_id'] == 8889){
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$forms = array();
|
||||
$form_ids = array();
|
||||
$forms[] = '-----';
|
||||
$form_ids[] = 0;
|
||||
$query = "SELECT * FROM contactform_header WHERE is_survey = 0 AND is_multistep = 0 AND main_language_id = ".$GLOBALS["language"]['id'];
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$forms[] = $row['description'];
|
||||
$form_ids[] = $row['id'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<? input_select($translation->get("select_contactform"), "select_contactform", $form_ids, $forms, $input_line['option_string']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php }?>
|
||||
<?php if($input_line['type_id'] == 8888 && $input_line["id"] != ''){
|
||||
?>
|
||||
<input type="hidden" name="preview_settings" value="1">
|
||||
<tr>
|
||||
<?php
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
$collections[] = '-----';
|
||||
$collection_ids[] = 0;
|
||||
$query = "SELECT * FROM main_collection_setup WHERE main_language_id = ".$GLOBALS["language"]['id'];
|
||||
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
$dataLinked = array();
|
||||
$query = "SELECT * FROM main_collection_setup_preview WHERE main_collection_setup_id = ".$_REQUEST['input_id']." AND field_id = ".$input_line['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$dataLinked = $row;
|
||||
}
|
||||
|
||||
?>
|
||||
<? input_select($translation->get("select_setup"), "select_setup", $collection_ids, $collections, $dataLinked['main_collection_setup_id_selected'], FALSE, FALSE, "onchange='loadPagesWithCollection(this.value);'"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? input_select($translation->get("collection_preview_type"), "main_collection_view_type", $values = array('0', '1'), $value_names = array($translation->get("single_collection"), $translation->get("collection_list")), $dataLinked['main_collection_view_type'], FALSE, FALSE, 'onchange="toggle_view_type(this.value);"'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
|
||||
<div class="collection_pages">
|
||||
<?
|
||||
$dataLinked['main_collection_setup_id'] = $dataLinked['main_collection_setup_id_selected'];
|
||||
create_page_with_collection_select($dataLinked['main_collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", $dataLinked, FALSE);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<?php
|
||||
$display_list_choose;
|
||||
if ($dataLinked["main_collection_view_type"] == 0) {
|
||||
$display_list_choose = '';
|
||||
$display_item_choose = 'style="display:none;"';
|
||||
} else {
|
||||
$display_item_choose = '';
|
||||
$display_list_choose = 'style="display:none;"';
|
||||
}
|
||||
|
||||
// einzelne kollektion
|
||||
echo "<div class=\"collection_list_choose\" " .$display_list_choose." >";
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
$query = "SELECT DISTINCT mc.* FROM main_collection as mc WHERE mc.main_collection_setup_id = " . $_REQUEST['input_id'];
|
||||
if (!empty($dataLinked) && $dataLinked['main_collection_setup_id'] != "") {
|
||||
$query = "SELECT DISTINCT mc.* FROM main_collection as mc WHERE mc.main_collection_setup_id = " . $dataLinked['main_collection_setup_id'];
|
||||
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
|
||||
input_select($translation->get("choose_collection"), "main_collection_id", $values = !empty($dataLinked) ? $collection_ids : array(), $value_names = !empty($dataLinked) ? $collections : array(), $dataLinked['main_collection_id_selected'], FALSE, FALSE);
|
||||
echo "</div>";
|
||||
|
||||
|
||||
// kollektionsliste
|
||||
echo "<div class=\"collection_items_choose\" " . $display_item_choose . ">";
|
||||
$items = 990;
|
||||
|
||||
input($translation->get("collection_list_items"), "main_collection_items", "text", $items , 255);
|
||||
|
||||
|
||||
// input($translation->get('job_specific'), 'job_selected'.$fieldSetup['id'], 'checkbox', $dataLinked["job_selected"] );
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } else {?>
|
||||
<input type="hidden" name="preview_settings" value="0">
|
||||
<?php }?>
|
||||
|
||||
<?php if ($input_line['fieldtype'] == 'standard') { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("optionvalues"), "main_input_option_string", "text", $input_line["option_string"], 400) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("is_bulletlist"), "main_input_is_bulletlist", "checkbox", $is_bulletlist) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($input_line['fieldtype'] != 'group' && $input_line['fieldtype'] != 'collection_preview' && $input_line['type_id'] != 16) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("show_in_teaser"), "main_input_is_teaser", "checkbox", $is_teaser) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("show_description_title"), "main_input_show_description_title", "checkbox", $show_description_title) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
<div id="collection_type_settings">
|
||||
<?php
|
||||
if ($input_line['fieldtype'] == 'siteparts' && $input_line['type_id'] > 0) {
|
||||
$sitepartCode = $siteparts[$input_line['type_id']]['code'];
|
||||
$sitepartfolder = $siteparts[$input_line['type_id']]['folder'];
|
||||
|
||||
$include = MODULE_PATH . $sitepartfolder . "/collection_" . $sitepartCode . "_cardform.inc.php";
|
||||
if (file_exists($include)) {
|
||||
require_once($include);
|
||||
}
|
||||
} elseif ($input_line['fieldtype'] == 'standard' && $input_line['type_id'] == 5) {
|
||||
$include = MODULE_PATH . "collection/edit_collection_image_config.inc.php";
|
||||
if (file_exists($include)) {
|
||||
require_once($include);
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function loadPagesWithCollection( collection_setup_id ) {
|
||||
load_collections(collection_setup_id);
|
||||
console.log('hello');
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html("");
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname ?>')).html("");
|
||||
|
||||
if (collection_setup_id == "" || collection_setup_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>' )[0]);
|
||||
formData.append("collection_setup_id", collection_setup_id);
|
||||
formData.append("page_link_id", '<?php echo $input_line["id"]; ?>');
|
||||
formData.append("input_id", $('input[name=input_line_id]').val());
|
||||
|
||||
|
||||
$.ajax({
|
||||
url : "?action=loadPage_collection",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
dataType : 'json',
|
||||
success : function ( output, status, xhr ) {
|
||||
console.log('log ist' + xhr.getResponseHeader('REQUIRES_AUTH'));
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.loader').hide();
|
||||
$('.collection_pages' ).html(output.page_with_collection_select);
|
||||
$('.collection_preview_group_select_container' ).html(output.collection_preview_group_select);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
var msg = '';
|
||||
if (jqXHR.status === 0) {
|
||||
msg = 'Not connect.\n Verify Network.';
|
||||
} else if (jqXHR.status == 404) {
|
||||
msg = 'Requested page not found. [404]';
|
||||
} else if (jqXHR.status == 500) {
|
||||
msg = 'Internal Server Error [500].';
|
||||
} else if (exception === 'parsererror') {
|
||||
msg = 'Requested JSON parse failed.';
|
||||
} else if (exception === 'timeout') {
|
||||
msg = 'Time out error.';
|
||||
} else if (exception === 'abort') {
|
||||
msg = 'Ajax request aborted.';
|
||||
} else {
|
||||
msg = 'Uncaught Error.\n' + jqXHR.responseText;
|
||||
}
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function load_collections( collection_setup_id ) {
|
||||
$('.collection_list_choose' ).html("");
|
||||
console.log('form name ist' + '<?php echo $formname; ?>');
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("main_collection_setup_id_", collection_setup_id);
|
||||
formData.append("input_id", $('input[name=input_line_id]').val());
|
||||
|
||||
|
||||
$.ajax({
|
||||
url : "?action=load_collection",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
console.log(output);
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.collection_list_choose' ).html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_view_type( _type ) {
|
||||
if (_type == 0) {
|
||||
$('.collection_list_choose' ).show();
|
||||
$('.collection_items_choose' ).hide();
|
||||
} else {
|
||||
$('.collection_list_choose' ).hide();
|
||||
$('.collection_items_choose' ).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
136
module/collection/edit_collection_setup_line_listform.inc.php
Normal file
136
module/collection/edit_collection_setup_line_listform.inc.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
use DynCom\mysyde\common\classes\CollectionTypes;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_line_list";
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
$collectionTypes = \DynCom\mysyde\common\classes\CollectionTypes::get();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function toggleScrollerHeadline() {
|
||||
var contentscroller = $('.inhalte_toggle_container');
|
||||
contentscroller.show();
|
||||
}
|
||||
|
||||
function contentmenuClick( _el, _fieldtype, _type_id ) {
|
||||
|
||||
setCurrentToolbarClicked(_el);
|
||||
jQuery('input[name="fieldtype"]', jQuery('#<?php echo $formname; ?>')).val(_fieldtype);
|
||||
console.log(jQuery('input[name="fieldtype"]').val());
|
||||
jQuery('input[name="type_id"]', jQuery('#<?php echo $formname; ?>')).val(_type_id);
|
||||
loadCard('new_line_collection_setup', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
|
||||
<input type="hidden" name="fieldtype" value="" />
|
||||
<input type="hidden" name="type_id" value="" />
|
||||
|
||||
<h3><?php echo $translation->get("collection_field_headline"); ?></h3>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "toggleScrollerHeadline();", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_collection_setup')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_collection_setup', false, '{$translation->get('delete_setup_line_collection_confirm')}')", "", FALSE); ?>
|
||||
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_collection_setup')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_collection_setup')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="inhalte_toggle_container" id="inhalte_form_headline">
|
||||
<div id="srollerInhalteHeadline"><h2><?php echo $translation->get("insert_new_field"); ?></h2></div>
|
||||
</div>
|
||||
<div id="pagecontentScroller" class="pagecontentScroller inhalte_toggle_container">
|
||||
<div class="scroller_inhalte">
|
||||
|
||||
<ul class="inhalte_menu">
|
||||
<?php
|
||||
button('inhalt_eingabefeld graybox', "Eingabefeld", $formname, "contentmenuClick(this, 'standard', 1)");
|
||||
button('inhalt_fließtext graybox', "Fließtext", $formname, "contentmenuClick(this, 'standard', 2)");
|
||||
button('inhalt_datum graybox', "Datum", $formname, "contentmenuClick(this, 'standard', 3)");
|
||||
// button('inhalt_datum graybox', "Zeit", $formname, "contentmenuClick(this, 'standard', 7777)");
|
||||
button('inhalt_link graybox', "Link", $formname, "contentmenuClick(this, 'standard', 4)");
|
||||
button('inhalt_bild graybox', "Bild", $formname, "contentmenuClick(this, 'standard', 5)");
|
||||
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
if ((isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === TRUE) && $sitepartId != 14) {
|
||||
continue;
|
||||
}
|
||||
if((isset($sitepartData['is_collection']) || $sitepartData['is_collection'] === TRUE)){
|
||||
button($sitepartData['class'], $sitepartData['description'], $formname, "contentmenuClick(this, 'siteparts', " . $sitepartId . ")");
|
||||
}
|
||||
}
|
||||
button("inhalt_collection graybox", $translation->get("collection_preview"), $formname, "contentmenuClick(this, 'collection_preview', 8888)");
|
||||
button("inhalt_contact graybox", $translation->get("connected_form"), $formname, "contentmenuClick(this, 'connected_form', 666)");
|
||||
// button("inhalt_collection graybox", $translation->get("link_contactform"), $formname, "contentmenuClick(this, 'link_contactform', 8889)");
|
||||
|
||||
?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = '" . $input_id . "' ORDER BY sorting ASC";
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
echo " <table data-sortableupdateaction=\"update_sortorder_collection_setup\" cellpadding=0 cellspacing=0 border=0 class=\"linklist sortableTable\">\n";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_key($translation->get("type"), "");
|
||||
echo format_key("", "");
|
||||
echo format_key($translation->get("description"), "");
|
||||
echo format_key($translation->get("show_in_teaser"), "");
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
|
||||
if ($row['fieldtype'] == 'siteparts') {
|
||||
// die zeile bezieht sich auf ein sitepart
|
||||
$sitepartType = $translation->get("sitepart") . ": " . $siteparts[$row['type_id']]['description'];
|
||||
} else {
|
||||
// zeile ist ein extra datentyp fuer kollektionen
|
||||
if($row['fieldtype'] != 'collection_preview' && $row['fieldtype'] != 'link_contactform'){
|
||||
$sitepartType = $translation->get("input_field") . ": " . $collectionTypes[$row['type_id']]['description'];
|
||||
}else if($row['fieldtype'] == 'collection_preview'){
|
||||
$sitepartType = $translation->get("collection_preview");
|
||||
}else{
|
||||
$sitepartType = $translation->get("link_contactform");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$checkedRow = $row['id'] == $_REQUEST["input_line_id"] ? 'true' : 'false';
|
||||
|
||||
echo " <tr id=\"linklistid_{$row['id']}\" class=\"linklist_content\" data-checked=\"{$checkedRow}\" data-inputname=\"input_id\" data-action=\"edit_line_collection_setup\" data-inputid=\"{$row['id']}\">\n";
|
||||
|
||||
echo format_value($sitepartType, "input_id");
|
||||
echo format_value("", "sorticon", "sort");
|
||||
echo format_value($row['fieldname'], "input_id");
|
||||
echo format_value($row['is_teaser'], "input_id", "boolean");
|
||||
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
echo " </table>\n";
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
28
module/collection/edit_collection_setup_listform.inc.php
Normal file
28
module/collection/edit_collection_setup_listform.inc.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_collection_setup', true)"); ?>
|
||||
<?= button("left", $translation->get("collection_world"), $formname, "loadCard('load_collection_setup_world', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<h1><?php echo get_translation('top_collections'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT main_collection_setup.id, description AS '" . $translation->get("description") . "', main_collection_setup.code AS '" . $translation->get("code") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from main_collection_setup left join main_admin_user ON main_collection_setup.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) ORDER BY id asc";
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_collection_setup");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?
|
||||
$formname = "form_collection_choose_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_world["id"] == "") {
|
||||
echo $translation->get("new_collection_world");
|
||||
} else {
|
||||
echo $translation->get("edit_collection_world");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
button("left", $translation->get("back"), $formname, "loadCard('load_collection_setup_world', true)");
|
||||
|
||||
// Speichern buttons
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_collection_setup_world', true)");
|
||||
button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_collection_setup_world', true)");
|
||||
|
||||
if ($input_world["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_collection_setup_world', true, '{$translation->get('delete_collection_setup_world_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_world_id" type="hidden" value="<?= $input_world["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_REQUEST['input_id'] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_world["description"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_world_list";
|
||||
$inputname = "input_id";
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_world["id"] == "") {
|
||||
echo $translation->get("collection_world");
|
||||
} else {
|
||||
echo $translation->get("collection_world");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, ""); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "backButton()"); ?>
|
||||
</ul>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_world_id" value="" />
|
||||
<input type="hidden" name="fieldtype" value="" />
|
||||
<input type="hidden" name="type_id" value="" />
|
||||
<ul class="toolbar_menu collection_world">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_collection_setup_world', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_collection_setup_world')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_collection_setup_world', false, '{$translation->get('delete_collection_setup_world_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_collection_setup_world')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_collection_setup_world')", "", FALSE); ?>
|
||||
</ul>
|
||||
<?php
|
||||
$query = "SELECT * FROM main_collection_setup_world ORDER BY sorting ASC";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
echo " <table data-sortableupdateaction=\"update_sortorder_collection_setup_world\" cellpadding=0 cellspacing=0 border=0 class=\"linklist sortableTable\">\n";
|
||||
echo "<tr>";
|
||||
echo format_key($translation->get("description"), "");
|
||||
echo format_key("", "");
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
echo " <tr id=\"linklistid_{$row['id']}\" class=\"linklist_content\" data-checked=\"{$checkedRow}\" data-inputname=\"input_id\" data-action=\"edit_collection_setup_world\" data-inputid=\"{$row['id']}\">\n";
|
||||
echo format_value($row['description'], "input_id");
|
||||
echo format_value("", "sorticon", "sort");
|
||||
echo " </tr>\n";
|
||||
}
|
||||
echo " </table>\n";
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
|
||||
<h2><?php echo $translation->get("contact_field_headline"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new_level"), $formname, "loadCard('new_line_contactform_level', true)", "", FALSE); ?>
|
||||
<?= button("new", $translation->get("new_section"), $formname, "loadCard('new_line_contactform_section', true)", "", FALSE); ?>
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_contactform', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_contactform')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', false, '{$translation->get('delete_contactform_field_confirm')}')", "", FALSE); ?>
|
||||
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_contactform')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_contactform')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
<div class="tab">
|
||||
<?
|
||||
$query = "SELECT * FROM contactform_steps where contactform_id = ".$input_id;
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$i = 0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
?>
|
||||
<button class="tablinks" onclick="openTab(event, 'tab<?=$row['id']?>')" <?php if($i == 0){ ?> id="defaultOpen" <?php } ?> ><?= $row['name'];?></button>
|
||||
|
||||
<? $i ++; } ?>
|
||||
</div>
|
||||
|
||||
<!-- tab div -->
|
||||
|
||||
|
||||
|
||||
|
||||
<?
|
||||
$query = "SELECT * FROM contactform_steps where contactform_id = ".$input_id;
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
?>
|
||||
<div id="tab<?=$row['id']?>" class="tabcontent">
|
||||
|
||||
<div class="tab">
|
||||
<?
|
||||
$query = "SELECT * FROM contactform_section where contactform_id = ".$input_id.'';
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$i = 0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
?>
|
||||
<button class="tablinks" onclick="openSection(event, 'tab_section_<?=$row['id']?>')" <?php if($i == 0){ ?> id="defaultOpen2" <?php } ?> ><?= $row['name'];?></button>
|
||||
|
||||
<? $i ++; } ?>
|
||||
</div>
|
||||
|
||||
<!-- tab div -->
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
</form>
|
||||
36
module/collection/frontend_creation.inc.php
Normal file
36
module/collection/frontend_creation.inc.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<script type="text/javascript"
|
||||
src="/mysyde/admin/admin.js?t=<?=
|
||||
filemtime($_SERVER['DOCUMENT_ROOT'] . '/mysyde/admin/admin.js')
|
||||
?>"></script>
|
||||
<script type="text/javascript" src="/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script type="text/javascript" src="/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script type="text/javascript" src="/plugins/ckfinder/ckfinder.js"></script>
|
||||
<script type="text/javascript" src="/plugins/dropzone/dropzone.js"></script>
|
||||
<script type="text/javascript" src="/layout/admin/js/bc.backend.js"></script>
|
||||
<?php
|
||||
|
||||
if($_GET['action'] == 'create_collection'){
|
||||
require_once("collection_config.inc.php");
|
||||
echo '<div id="overlayContent" class="contentSetup">';
|
||||
if(isset($_GET['mian_collection_id']) && $_GET['mian_collection_id'] != ''){
|
||||
?>
|
||||
<script>
|
||||
function reloadPageWithoutParams() {
|
||||
var url = window.location.href;
|
||||
var newURL = url.split('?')[0]; // Teil vor dem Fragezeichen behalten
|
||||
window.location.href = newURL; // Seite neu laden
|
||||
}
|
||||
|
||||
// Funktionsaufruf
|
||||
reloadPageWithoutParams();
|
||||
</script>
|
||||
<?php
|
||||
// edit_collection($_GET['mian_collection_id'], $messages = array(), $frontend = TRUE);
|
||||
}else{
|
||||
require_once("frontend_creation_cardform.inc.php");
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
118
module/collection/frontend_creation_cardform.inc.php
Normal file
118
module/collection/frontend_creation_cardform.inc.php
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
<script type="text/javascript" src="/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script type="text/javascript" src="/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script type="text/javascript" src="/plugins/ckfinder/ckfinder.js"></script>
|
||||
<?php
|
||||
|
||||
$formname = 'form_collection_cardform';
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get('translation');
|
||||
$inputname = 'input_id';
|
||||
$input_page_id = (isset($_REQUEST['input_page_id']) ? $_REQUEST['input_page_id'] : '');
|
||||
|
||||
$collection_setup_id = $_GET['setup_id'];
|
||||
?>
|
||||
|
||||
<div id="content-collection" class="collections">
|
||||
<div id="overlay"></div>
|
||||
<div id="overlayWrapper">
|
||||
<div id="overlayContenting">
|
||||
<div id="overlaycrumb" class='collection'>
|
||||
<?php
|
||||
|
||||
button("save", $translation->get("save"), $formname, "saveCollection(false)");
|
||||
|
||||
?>
|
||||
<form id="<?=
|
||||
$formname
|
||||
?>" name="<?=
|
||||
$formname
|
||||
?>" method="post" class='collection_form collection'>
|
||||
<input name="input_collection_id_frontend" id="input_collection_id_frontend" type="hidden" value="<?=
|
||||
$input_collection['id']
|
||||
?>">
|
||||
<input type="hidden" name="main_collection_setup_id" value="<?php
|
||||
echo $collection_setup_id;
|
||||
?>" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php
|
||||
echo $input_page_id;
|
||||
?>" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
input($translation->get("collection_title"), "input_description", "text", $input_collection["description"], 255);
|
||||
if ($input_collection['id'] != '') {
|
||||
create_collection_groups_select($input_collection);
|
||||
}
|
||||
create_collection_tags();
|
||||
input($translation->get('validity_from'), 'input_validity_from', 'date', datefromsql($input_collection['validity_from']), 10);
|
||||
input($translation->get('validity_to'), 'input_validity_to', 'date', datefromsql($input_collection['validity_to']), 10);
|
||||
create_contactform_select($contactforms, $translation->get('registration_form'), 'registration_contactform_id', $input_collection, (int) $input_collection['registration'] == 0 ? TRUE : FALSE);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
// create_mandant_select($input_collection['id']);
|
||||
if ($collection_setup['collection_type'] == 4) {
|
||||
// create_knowledegecenter_category_select($input_collection['id']);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="collectionform">
|
||||
|
||||
<?php
|
||||
|
||||
$query = 'SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = ' . $collection_setup_id . ' ORDER BY sorting ASC';
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($content = @mysqli_fetch_array($result)) {
|
||||
echo '<tr><td>';
|
||||
$collectionData = array();
|
||||
if(isset($input_collection['id']) && $input_collection['id'] != ''){
|
||||
$collectionData = $input_collection;
|
||||
}
|
||||
create_collection_input_field($content, $collectionData);
|
||||
echo '</td></tr>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( "#overlaycrumb , .collectionform, .collections form#form_line_list " ).wrapAll( "<div class='collection-main-wrapper' />");
|
||||
$( "ul.toolbar_menu.collection, .collection_form.collection " ).wrapAll( "<div class='collection-wrapper'></div>" );
|
||||
|
||||
function saveCollection(_close) {
|
||||
|
||||
var aFormData = new FormData();
|
||||
|
||||
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
$('#overlayContent :input').each(function() {
|
||||
if ($(this).attr("type") == "file") {
|
||||
aFormData.append($(this).attr("name"), $(this).get(0).files[0]);
|
||||
} else if ($(this).attr("type") == "checkbox") {
|
||||
if ($(this).prop("checked") === true) {
|
||||
aFormData.append($(this).attr("name"), "on");
|
||||
}
|
||||
} else {
|
||||
aFormData.append($(this).attr("name"), $(this).val());
|
||||
}
|
||||
});
|
||||
console.log(aFormData);
|
||||
loadCard_frontend('frontend_collection', true, '', _close, aFormData);
|
||||
}
|
||||
</script>
|
||||
147
module/collection/masked_collection_functions.inc.php
Normal file
147
module/collection/masked_collection_functions.inc.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
|
||||
// masked collection
|
||||
function create_collection_input_field_masked($fieldSetup, $collection_setup_id, $fieldCount)
|
||||
{
|
||||
|
||||
|
||||
//Übersetzung anzeigen
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
//Pflichtfeld einblenden wenn vorhanden
|
||||
if (isset($fieldSetup['mandatory']) && $fieldSetup['mandatory'] != 0) {
|
||||
$mandatory = "<span class=\"mandatory\"> *</span>";
|
||||
}
|
||||
|
||||
echo "<div class=\"collection_field\">";
|
||||
echo "<div class=\"label\"><label for=\"" . $fieldSetup['code'] . "\">" . $fieldSetup['fieldname'] . $mandatory . "</label></div>";
|
||||
echo " <div class=\"input\">";
|
||||
//Hinweis einblenden wenn vorhanden
|
||||
if (isset($fieldSetup['note']) && $fieldSetup['note'] != '') {
|
||||
echo "<div class=\"input_note\">" . $translation->get("note") . ": " . $fieldSetup['note'] . "</div>";
|
||||
}
|
||||
|
||||
if ($fieldSetup['fieldtype'] == 'siteparts') {
|
||||
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
$sitepartConfig = $siteparts[$fieldSetup['type_id']];
|
||||
|
||||
$headerData = get_sitepart_header_data(0, $fieldSetup['id']);
|
||||
|
||||
// print_r(MODULE_PATH . $sitepartConfig['folder'] . "/collection_" . $sitepartConfig['code'] . "_line_listform.inc.php");
|
||||
require(MODULE_PATH . $sitepartConfig['folder'] . "/collection_" . $sitepartConfig['code'] . "_line_listform.inc.php");
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// vorhandenen value auslesen
|
||||
$data = '';
|
||||
$linkText = '';
|
||||
$query = "SELECT data, linkText FROM main_collection_link WHERE main_collection_setup_content_id = " . $fieldSetup['id'] . " AND main_collection_id = " . 0;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$data = $row['data'];
|
||||
$linkText = $row['linkText'];
|
||||
}
|
||||
|
||||
echo "<form id=\"form_collection_input_" . $fieldSetup['id'].'_count'.$fieldCount . "\" method=\"post\" name=\"form_collection_input_" . $fieldSetup['id'] .'_count'.$fieldCount. "\">";
|
||||
echo "<input type=\"hidden\" name=\"input_collection_hidden_info_" . $fieldSetup['id'].'_count'.$fieldCount . "\" value=\"" . $fieldSetup['type_id'] . "\" />";
|
||||
|
||||
if ($fieldSetup['type_id'] != 2) {
|
||||
$input_maxlength = 255;
|
||||
}
|
||||
|
||||
if (isset($fieldSetup['input_maxlength']) && $fieldSetup['input_maxlength'] != 0) {
|
||||
$input_maxlength = $fieldSetup['input_maxlength'];
|
||||
}
|
||||
|
||||
switch ($fieldSetup['type_id']) {
|
||||
|
||||
case 2: // textarea
|
||||
echo "<textarea id=\"input_collection_link_" . $fieldSetup['id']. '_count'.$fieldCount. "\" class=\"normal\" maxlength=\"" . $input_maxlength . "\" name=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount."\">" . $data . "</textarea>";
|
||||
break;
|
||||
|
||||
case 3: // datumsfeld
|
||||
echo "<input id=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount. "\" class=\"code datepicker\" type=\"text\" value=\"" . $data . "\" maxlength=\"255\" name=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "\">";
|
||||
echo "<script type=\"text/javascript\">$('#input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "').datepicker();</script>";
|
||||
break;
|
||||
|
||||
case 4: // link
|
||||
echo "<input id=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount."\" class=\"code\" type=\"text\" value=\"" . $data . "\" maxlength=\"255\" name=\"input_collection_link_" . $fieldSetup['id'] . "\">";
|
||||
echo "<div><div class='input_note'>Link Text </div><input id=\"input_collection_link_text_" . $fieldSetup['id'] .'_count'.$fieldCount. "\" class=\"code\" type=\"text\" value=\"" . $linkText . "\" maxlength=\"255\" name=\"input_collection_link_text_" . $fieldSetup['id'] . "\"></div>";
|
||||
break;
|
||||
|
||||
case 5: // einzelnes bild
|
||||
if ($data != "") {
|
||||
echo "<table cellpadding=\"0\" cellspacing=\"0\">";
|
||||
echo "<tr><td>";
|
||||
echo "<img src=\"" . PATH_ICON_COLLECTION . $data . "?time=" . time() . "\" /></td><td><input type=\"checkbox\" name=\"delete_collection_image_" . $fieldSetup['id'] . '_count'.$fieldCount."\" /> Bild entfernen</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
}
|
||||
echo "<input id=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "\" class=\"code\" type=\"file\" name=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount."\">";
|
||||
break;
|
||||
|
||||
case 6: // Dropdown
|
||||
echo "<select style=\"float:left;\" id=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "\" class=\"code\" type=\"text\" name=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount."\" >";
|
||||
//Get all option_values
|
||||
$options = explode(";", $fieldSetup["option_string"]);
|
||||
//Values als Integer
|
||||
$value = 0;
|
||||
$data = unserialize($data);
|
||||
foreach ($options as $option) {
|
||||
$selected_text = ($data == $value) ? " selected=\"selected\"" : "";
|
||||
echo "<option" . $selected_text . " value=\"" . $value . "\">" . $option . "</option>";
|
||||
$value++;
|
||||
}
|
||||
echo "</select>";
|
||||
|
||||
if ($fieldSetup['id'] == 38 || $fieldSetup['id'] == 45 || $fieldSetup['id'] == 57) {
|
||||
echo "<div class=\"dropdownPreview\" data-image=\"" . $fieldSetup['id'] .'_count'.$fieldCount. "\" style=\"float:left\" >dsadas</div>";
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: // Checkbox
|
||||
|
||||
echo "<label id=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "\" class=\"checkbox\" >";
|
||||
//Get all option_values
|
||||
$options = explode(";", $fieldSetup["option_string"]);
|
||||
//Values als Integer
|
||||
$value = 1;
|
||||
foreach ($options as $option) {
|
||||
$selected_text = ($data == 1) ? " checked=\"checked\"" : "";
|
||||
// $selected_text = ($data == $value) ? " checked=\"checked\"" : "";
|
||||
echo "<div class=\"input_collection_link_checkbox\">";
|
||||
echo "<input id=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "_value_" . $value . "\" type=\"checkbox\" name=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "[]\" value=val_\"$value\" ".$selected_text.">";
|
||||
echo "<label " . "for=\"input_collection_link_" . $fieldSetup['id'] .'_count'.$fieldCount. "_value_" . $value . "\">" . $option . "</label>";
|
||||
echo "</div>";
|
||||
$value++;
|
||||
}
|
||||
echo "</label>";
|
||||
break;
|
||||
|
||||
case 1: // normales inputfeld
|
||||
default:
|
||||
if($fieldSetup['id'] == 119 || $fieldSetup['id'] == 120){
|
||||
create_collection_azubi_select($data, $fieldSetup['id']);
|
||||
}else if($fieldSetup['id'] == 283){
|
||||
create_collection_person_select($data, $fieldSetup['id']);
|
||||
}else if($fieldSetup['id'] == 115){
|
||||
create_select_from_collection($data, $fieldSetup['id'], 32);
|
||||
}else if($fieldSetup['id'] == 286){
|
||||
create_select_from_collection($data, $fieldSetup['id'], 31);
|
||||
}else {
|
||||
echo "<input id=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount."\" class=\"code\" type=\"text\" value=\"" . htmlspecialchars($data) . "\" maxlength=\"" . $input_maxlength . "\" name=\"input_collection_link_" . $fieldSetup['id'] . '_count'.$fieldCount."\">";
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
echo "</form>";
|
||||
}
|
||||
|
||||
echo " </div>";
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
42
module/collection/page_collection_listform.inc.php
Normal file
42
module/collection/page_collection_listform.inc.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_collection_list"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_page"), $formname, "loadCard('assoc_collection_list_page')"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_collection_setup_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="insert_collection_list" type="hidden" value="1">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT main_collection_setup.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from main_collection_setup left join main_admin_user ON main_collection_setup.modified_user = main_admin_user.id where main_language_id = " . (int)$GLOBALS["language"]['id'] . " ORDER BY id asc";
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_collection_setup_id", "assoc_collection_list_page");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
281
module/collection/page_collection_preview_cardform.inc.php
Normal file
281
module/collection/page_collection_preview_cardform.inc.php
Normal file
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_preview_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$collection_setup_id = 0;
|
||||
|
||||
// erstelle kollektionen sammeln
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$query = "SELECT ms.id, ms.main_language_id, ms.code, ms.description, ms.linked, ms.icon, ms.modified_user, ms.modified_date, ms.all_languages, ms.show_filter FROM main_collection_setup as ms INNER JOIN main_collection_setup_websites as mcsw on ms.id = mcsw.main_collection_setup_id WHERE mcsw.main_site_id = ".$GLOBALS['site']['id']." ";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if ($input_line['main_collection_setup_id'] != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = " . $input_line['main_collection_setup_id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$active_groups = array();
|
||||
$query = "SELECT main_collection_setup_group_id FROM main_page_collection_group_link WHERE main_page_link_id = " . (int)$input_line["id"];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$active_groups[] = $row['main_collection_setup_group_id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadPagesWithCollection( collection_setup_id ) {
|
||||
load_collections(collection_setup_id);
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html("");
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (collection_setup_id == "" || collection_setup_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname; ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("collection_setup_id", collection_setup_id);
|
||||
formData.append("page_link_id", '<?php echo $input_line["id"]; ?>');
|
||||
$.ajax({
|
||||
url : "?action=load_collection_pages_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
dataType : 'json',
|
||||
success : function ( output, status, xhr ) {
|
||||
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.loader', $('#<?php echo $formname; ?>')).hide();
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html(output.page_with_collection_select);
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html(output.collection_preview_group_select);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
var msg = '';
|
||||
if (jqXHR.status === 0) {
|
||||
msg = 'Not connect.\n Verify Network.';
|
||||
} else if (jqXHR.status == 404) {
|
||||
msg = 'Requested page not found. [404]';
|
||||
} else if (jqXHR.status == 500) {
|
||||
msg = 'Internal Server Error [500].';
|
||||
} else if (exception === 'parsererror') {
|
||||
msg = 'Requested JSON parse failed.';
|
||||
} else if (exception === 'timeout') {
|
||||
msg = 'Time out error.';
|
||||
} else if (exception === 'abort') {
|
||||
msg = 'Ajax request aborted.';
|
||||
} else {
|
||||
msg = 'Uncaught Error.\n' + jqXHR.responseText;
|
||||
}
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function load_collections( collection_setup_id ) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("main_collection_setup_id", collection_setup_id);
|
||||
$.ajax({
|
||||
url : "?action=load_collections_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_view_type( _type ) {
|
||||
if (_type == 0) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).show();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).show();
|
||||
}
|
||||
}
|
||||
|
||||
function save_and_close_page_line() {
|
||||
jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
|
||||
loadCard('save_collection_preview_page', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
if (isset($_REQUEST['is_collection_preview']) && $_REQUEST['is_collection_preview'] == 1) {
|
||||
echo $translation->get("assign_collection_preview");
|
||||
} else {
|
||||
echo $translation->get("assign_collection_list");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_collection_preview_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "save_and_close_page_line();"); ?>
|
||||
</ul>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if ((gettype($messages) == 'array' || gettype($messages) == 'object') && count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if (isset($_REQUEST['is_collection_preview']) && $_REQUEST['is_collection_preview'] == 1): ?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input name="is_collection_preview" id="is_collection_preview" type="hidden" value="1" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input_select($translation->get("collection_preview_type"), "main_collection_view_type", $values = array('0', '1'), $value_names = array($translation->get("single_collection"), $translation->get("collection_list")), $input_line["main_collection_view_type"], FALSE, FALSE, 'onchange="toggle_view_type(this.value);"'); ?>
|
||||
<? input_select($translation->get("choose_order"), "main_collection_order", $values = ["sort", "date_asc", "date_desc", "desc_asc", "desc_desc"], $value_names = ["Sortierung", "Datum aufsteigend", "Datum absteigend", "Beschreibung aufsteigend", "Beschreibung absteigend"], $input_line["main_collection_order"], FALSE, FALSE); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
|
||||
<div class="collection_pages">
|
||||
<?
|
||||
create_page_with_collection_select($input_line['main_collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", $input_line, FALSE);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php
|
||||
if ($input_line["main_collection_view_type"] == 0) {
|
||||
$display_list_choose = '';
|
||||
$display_item_choose = 'style="display:none;"';
|
||||
} else {
|
||||
$display_item_choose = '';
|
||||
$display_list_choose = 'style="display:none;"';
|
||||
}
|
||||
|
||||
// einzelne kollektion
|
||||
echo "<div class=\"collection_list_choose\" " . $display_list_choose . ">";
|
||||
input_select($translation->get("choose_collection"), "main_collection_id", $values = $collection_ids, $value_names = $collections, $input_line["main_collection_id"], FALSE, FALSE);
|
||||
echo "</div>";
|
||||
|
||||
// kollektionsliste
|
||||
echo "<div class=\"collection_items_choose\" " . $display_item_choose . ">";
|
||||
input($translation->get("collection_list_items"), "main_collection_items", "text", $input_line["main_collection_items"], 255);
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="collection_preview_tag_container">
|
||||
<?php create_collection_preview_tags($input_line["id"]); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input name="is_collection_list" id="is_collection_list" type="hidden" value="1" />
|
||||
|
||||
<input name="main_collection_id" type="hidden" value="0" />
|
||||
<input name="main_collection_page_list_id" type="hidden" value="0" />
|
||||
<input name="main_collection_items" type="hidden" value="0" />
|
||||
<input name="main_collection_view_type" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input_select($translation->get("choose_order"), "main_collection_order", $values = ["sort", "date_asc", "date_desc", "desc_asc", "desc_desc"], $value_names = ["Sortierung", "Datum aufsteigend", "Datum absteigend", "Beschreibung aufsteigend", "Beschreibung absteigend"], $input_line["main_collection_order"], FALSE, FALSE); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/icons/ajax-loader.gif" />
|
||||
</td>
|
||||
<td>
|
||||
</tr>
|
||||
<tr>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="collection_preview_tag_container">
|
||||
<?php create_collection_preview_tags($input_line["id"]); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
0
module/collection/show_collection.inc.php
Normal file
0
module/collection/show_collection.inc.php
Normal file
101
module/community_board/community_board_ajax.inc.php
Normal file
101
module/community_board/community_board_ajax.inc.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
session_start();
|
||||
$currDir = __DIR__;
|
||||
$rootDir = dirname(dirname($currDir));
|
||||
$mysydeDir = $rootDir . '/mysyde';
|
||||
|
||||
require_once($rootDir . '/vendor/autoload.php');
|
||||
require_once($rootDir . "/mysyde/frontend/frontend_functions.inc.php");
|
||||
|
||||
$envDir = $rootDir . '/config';
|
||||
$envFilePath = $envDir . '/.env';
|
||||
if (is_dir($envDir) && file_exists($envFilePath) && is_file($envFilePath) && is_readable($envFilePath)) {
|
||||
$dotenv = new \Dotenv\Dotenv($envDir);
|
||||
$dotenv->load();
|
||||
}
|
||||
$common = $mysydeDir ."/common/common_functions.inc.php";
|
||||
require_once($common);
|
||||
|
||||
$connEnv = (local_environment()) ? $mysydeDir."/dc.config.php" : $mysydeDir."/dc-server.config.php";
|
||||
|
||||
require_once($connEnv);
|
||||
|
||||
db_connect();
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$post_id = $_POST['post_id'];
|
||||
switch ($_POST['action']) {
|
||||
case 'complete_task':
|
||||
complete_task($task_id, $_POST['status']);
|
||||
break;
|
||||
case 'delete_post':
|
||||
delete_post($post_id);
|
||||
break;
|
||||
case 'count_comments':
|
||||
count_comment_ajax($post_id);
|
||||
break;
|
||||
case 'count_likes':
|
||||
count_likes_ajax($post_id);
|
||||
break;
|
||||
case 'update_likes':
|
||||
update_likes($post_id, $_POST['main_contact_id']);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function delete_post($post_id){
|
||||
$query_link = "DELETE FROM community_board_post_category_link WHERE community_board_post_id = ".$post_id;
|
||||
$result_link = @mysqli_query($GLOBALS['mysql_con'], $query_link);
|
||||
|
||||
$query_comment = "DELETE FROM community_board_comment WHERE community_board_post_id = ".$post_id;
|
||||
$result_comment = @mysqli_query($GLOBALS['mysql_con'], $query_comment);
|
||||
|
||||
$query_post = "DELETE FROM community_board_post WHERE id = ".$post_id;
|
||||
$result_post = @mysqli_query($GLOBALS['mysql_con'], $query_post);
|
||||
}
|
||||
|
||||
function get_main_contact($main_contact_id){
|
||||
$query = "SELECT * FROM main_contact WHERE id = ".$main_contact_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
return $row;
|
||||
}
|
||||
|
||||
function count_comment_ajax($post_id){
|
||||
$query = "SELECT * FROM community_board_comment WHERE community_board_post_id = ".$post_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$count = 0;
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$count++;
|
||||
}
|
||||
echo $count;
|
||||
}
|
||||
|
||||
function count_likes_ajax($post_id){
|
||||
$query = "SELECT * FROM community_board_post_likes WHERE community_board_post_id = ".$post_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$count = 0;
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$count++;
|
||||
}
|
||||
echo $count;
|
||||
}
|
||||
|
||||
function update_likes($post_id, $main_contact_id){
|
||||
$query = "SELECT * FROM community_board_post_likes WHERE community_board_post_id = ".$post_id." AND main_contact_id = ".$main_contact_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) >= 1) {
|
||||
$query = "DELETE FROM community_board_post_likes WHERE community_board_post_id = ".$post_id." AND main_contact_id = ".$main_contact_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}else{
|
||||
$query = "INSERT INTO community_board_post_likes
|
||||
(community_board_post_id, main_contact_id)
|
||||
VALUES (
|
||||
'" . $post_id . "',
|
||||
'" . $main_contact_id . "'
|
||||
)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
134
module/community_board/community_board_category.inc.php
Normal file
134
module/community_board/community_board_category.inc.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'close_community_board_category':
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
break;
|
||||
case 'load_community_board_category':
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
break;
|
||||
case 'new_community_board_category' :
|
||||
require_once("community_board_category_cardform.inc.php");
|
||||
break;
|
||||
case 'edit_community_board_category':
|
||||
edit_community_board_category();
|
||||
break;
|
||||
case 'delete_community_board_category':
|
||||
delete_community_board_category();
|
||||
break;
|
||||
case 'save_community_board_category':
|
||||
save_community_board_category();
|
||||
break;
|
||||
case 'moveup_community_board_category':
|
||||
moveup_community_board_category();
|
||||
break;
|
||||
case 'movedown_community_board_category':
|
||||
movedown_community_board_category();
|
||||
break;
|
||||
case 'update_sortorder_community_board_category':
|
||||
update_sortorder_community_board_category();
|
||||
break;
|
||||
default:
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function edit_community_board_category($_id = "") {
|
||||
if ((int)$_id > 0) {
|
||||
$category_id = $_id;
|
||||
} else {
|
||||
$category_id = $_REQUEST["input_category_id"];
|
||||
}
|
||||
if ($category_id <> '') {
|
||||
$query = "SELECT * FROM community_board_category WHERE id = '" . $category_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_category = @mysqli_fetch_array($result);
|
||||
require_once("community_board_category_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("community_board_category_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function save_community_board_category() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
if ($_REQUEST["input_category_id"] <> '') {
|
||||
$query = "UPDATE community_board_category SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "'
|
||||
WHERE id = '" . $_REQUEST["input_category_id"] . "' LIMIT 1";
|
||||
} else {
|
||||
$sorting = @mysqli_fetch_array(@mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting)+1 AS 'newsorting' FROM main_community_board_category"));
|
||||
$sorting = ($sorting["newsorting"] <> "") ? $sorting = $sorting["newsorting"] : $sorting = 1;
|
||||
$query = "INSERT INTO community_board_category (description, sorting) VALUES (
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
" . $sorting . "
|
||||
)";
|
||||
}
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
} else {
|
||||
require_once("community_board_category_cordform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_community_board_category() {
|
||||
if ($_REQUEST["input_category_id"] <> '') {
|
||||
$query = "DELETE FROM mcommunity_board_category WHERE id = '" . $_REQUEST["input_category_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
}
|
||||
|
||||
function moveup_community_board_category() {
|
||||
move_community_board_category("<", "DESC", $_POST["input_category_id"]);
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
}
|
||||
|
||||
function movedown_community_board_category() {
|
||||
move_community_board_category(">", "ASC", $_POST["input_category_id"]);
|
||||
require_once("community_board_category_listform.inc.php");
|
||||
}
|
||||
|
||||
function move_community_board_category( $way, $order, $pic_id ) {
|
||||
$query = "SELECT * FROM community_board_category WHERE id = '" . $pic_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_pic = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM community_board_category WHERE sorting " . $way . " " . $curr_pic["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_pic = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_pic["id"] <> '') && ($change_pic["id"] <> '')) {
|
||||
$query = "UPDATE community_board_category SET sorting = " . $change_pic["sorting"] . " WHERE id = " . $curr_pic["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE community_board_category SET sorting = " . $curr_pic["sorting"] . " WHERE id = " . $change_pic["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function update_sortorder_community_board_category() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE community_board_category SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
var_dump($query);
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?
|
||||
$formname = "form_collection_choose_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_category["id"] == "") {
|
||||
echo $translation->get("new_community_board_category");
|
||||
} else {
|
||||
echo $translation->get("edit_community_board_category");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
button("left", $translation->get("back"), $formname, "loadCard('load_community_board_category', true)");
|
||||
|
||||
// Speichern buttons
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_community_board_category', true)");
|
||||
button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_community_board_category', true)");
|
||||
|
||||
if ($input_category["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_community_board_category', true, '{$translation->get('delete_community_board_category_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_category_id" type="hidden" value="<?= $input_category["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_REQUEST['input_id'] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_category["description"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_category_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, ""); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "backButton()"); ?>
|
||||
</ul>
|
||||
<div id="mainContent">
|
||||
|
||||
<h1><?php echo get_translation('community_board_category'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_category_id" value="" />
|
||||
<input type="hidden" name="fieldtype" value="" />
|
||||
<input type="hidden" name="type_id" value="" />
|
||||
<ul class="toolbar_menu community_board_category new">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_community_board_category', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_community_board_category')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_community_board_category', false, '{$translation->get('delete_community_board_category_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_community_board_category')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_community_board_category')", "", FALSE); ?>
|
||||
</ul>
|
||||
<?php
|
||||
$query = "SELECT * FROM community_board_category ORDER BY sorting ASC";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
echo " <table data-sortableupdateaction=\"update_sortorder_community_board_category\" cellpadding=0 cellspacing=0 border=0 class=\"linklist sortableTable\">\n";
|
||||
echo "<tr>";
|
||||
echo format_key($translation->get("description"), "");
|
||||
echo format_key("", "");
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
echo " <tr id=\"linklistid_{$row['id']}\" class=\"linklist_content\" data-checked=\"{$checkedRow}\" data-inputname=\"input_id\" data-action=\"edit_community_board_category\" data-inputid=\"{$row['id']}\">\n";
|
||||
echo format_value($row['description'], "input_id");
|
||||
echo format_value("", "sorticon", "sort");
|
||||
echo " </tr>\n";
|
||||
}
|
||||
echo " </table>\n";
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
105
module/community_board/community_board_post.inc.php
Normal file
105
module/community_board/community_board_post.inc.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'close_community_board_post':
|
||||
require_once("community_board_post_listform.inc.php");
|
||||
break;
|
||||
case 'load_community_board_post':
|
||||
require_once("community_board_post_listform.inc.php");
|
||||
break;
|
||||
case 'new_community_board_post' :
|
||||
require_once("community_board_post_cardform.inc.php");
|
||||
break;
|
||||
case 'edit_community_board_post':
|
||||
edit_community_board_post();
|
||||
break;
|
||||
case 'delete_community_board_post':
|
||||
delete_community_board_post();
|
||||
break;
|
||||
case 'save_community_board_post':
|
||||
save_community_board_post();
|
||||
break;
|
||||
default:
|
||||
require_once("community_board_post_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function getContactFromID($main_contact_id){
|
||||
$query = "SELECT * FROM main_contact WHERE id = '" . $main_contact_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$main_contact = @mysqli_fetch_array($result);
|
||||
}
|
||||
return $main_contact['name'];
|
||||
}
|
||||
|
||||
function loadComments($post_id){
|
||||
$query = "SELECT * FROM community_board_comment WHERE community_board_post_id = '" . $post_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
echo "<div class='community_board_chat'>";
|
||||
echo "<h4>Kommentare</h4>";
|
||||
while ($comment = @mysqli_fetch_array($result)) {
|
||||
echo "<p><strong>".getContactFromID($comment['main_contact_id']).": </strong>".$comment['comment']."</p>";
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
function edit_community_board_post($_id = "") {
|
||||
if ((int)$_id > 0) {
|
||||
$post_id = $_id;
|
||||
} else {
|
||||
$post_id = $_REQUEST["input_post_id"];
|
||||
}
|
||||
if ($post_id <> '') {
|
||||
$query = "SELECT * FROM community_board_post WHERE id = '" . $post_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_post = @mysqli_fetch_array($result);
|
||||
require_once("community_board_post_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("community_board_post_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function save_community_board_post() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
if ($_REQUEST["input_post_id"] <> '') {
|
||||
$query = "UPDATE community_board_post SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "'
|
||||
WHERE id = '" . $_REQUEST["input_post_id"] . "' LIMIT 1";
|
||||
} else {
|
||||
$sorting = @mysqli_fetch_array(@mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting)+1 AS 'newsorting' FROM main_community_board_post"));
|
||||
$sorting = ($sorting["newsorting"] <> "") ? $sorting = $sorting["newsorting"] : $sorting = 1;
|
||||
$query = "INSERT INTO community_board_post (description, sorting) VALUES (
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
" . $sorting . "
|
||||
)";
|
||||
}
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
require_once("community_board_post_listform.inc.php");
|
||||
} else {
|
||||
require_once("community_board_post_cordform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_community_board_post() {
|
||||
if ($_REQUEST["input_post_id"] <> '') {
|
||||
$query = "DELETE FROM community_board_post WHERE id = '" . $_REQUEST["input_post_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
require_once("community_board_post_listform.inc.php");
|
||||
}
|
||||
65
module/community_board/community_board_post_cardform.inc.php
Normal file
65
module/community_board/community_board_post_cardform.inc.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?
|
||||
$formname = "form_collection_choose_cardform";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_post["id"] == "") {
|
||||
echo $translation->get("new_community_board_post");
|
||||
} else {
|
||||
echo $translation->get("edit_community_board_post");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
button("left", $translation->get("back"), $formname, "loadCard('load_community_board_post', true)");
|
||||
|
||||
// Speichern buttons
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_community_board_post', true)");
|
||||
button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_community_board_post', true)");
|
||||
|
||||
if ($input_post["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_community_board_post', true, '{$translation->get('delete_community_board_post_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$creation_date = new DateTime($input_post["creation_date"]);
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_post_id" type="hidden" value="<?= $input_post["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_REQUEST['input_id'] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("title"), "input_title", "text", $input_post["title"]) ?>
|
||||
<? input($translation->get("content"), "input_description", "textarea", $input_post["content"]) ?>
|
||||
<? input($translation->get("creation_date"), "input_creation_date", "text", $creation_date->format('d.m.Y H:i'), 50, TRUE) ?>
|
||||
<? input($translation->get("contact"), "input_creation_contact", "text", getContactFromID($input_post["creation_contact"]), 50, TRUE) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
if ($input_post["id"] != "") {
|
||||
loadComments($input_post['id']);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
37
module/community_board/community_board_post_listform.inc.php
Normal file
37
module/community_board/community_board_post_listform.inc.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_post_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_community_board_post', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_community_board_post')"); ?>
|
||||
</ul>
|
||||
<div id="mainContent">
|
||||
|
||||
<h1><?php echo get_translation('community_board_post'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_post_id" value="" />
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT
|
||||
DISTINCT community_board_post.id,
|
||||
community_board_post.title AS '" . $translation->get("title") . "',
|
||||
main_contact.name AS '" . $translation->get("contact") . "'
|
||||
FROM
|
||||
community_board_post
|
||||
LEFT JOIN
|
||||
main_contact
|
||||
ON
|
||||
community_board_post.creation_contact = main_contact.id
|
||||
ORDER BY community_board_post.id ASC";
|
||||
$format = array("option", "text", "text", "text");
|
||||
if ($result = mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_post_id", "edit_community_board_post");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
294
module/community_board/show_community_board.inc.php
Normal file
294
module/community_board/show_community_board.inc.php
Normal file
@@ -0,0 +1,294 @@
|
||||
<?php
|
||||
$category_id = 0;
|
||||
if(isset($_GET['category_id'])){
|
||||
$category_id = $_GET['category_id'];
|
||||
}
|
||||
|
||||
function load_categories($category_id){
|
||||
$query = "SELECT * FROM community_board_category ORDER BY sorting";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$active_all = '';
|
||||
if($category_id == 0){
|
||||
$active_all = 'active';
|
||||
}
|
||||
echo "<a href='?' class='category_item ".$active_all."'>Alle</a>";
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$active = '';
|
||||
if($category_id == $row['id']){
|
||||
$active = 'active';
|
||||
}
|
||||
echo "<a href='?category_id=".$row['id']."' class='category_item ".$active."'>".$row['description']."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
function load_all_posts($category_id){
|
||||
$where = "";
|
||||
if($category_id != 0){
|
||||
$where = "WHERE community_board_category_id = ".$category_id;
|
||||
}
|
||||
$query = "SELECT * FROM community_board_post_category_link ".$where;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
load_post($row['community_board_post_id'], $row['community_board_category_id']);
|
||||
}
|
||||
}
|
||||
|
||||
function load_post($post_id, $category_id){
|
||||
$query = "SELECT * FROM community_board_post WHERE id = ".$post_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$user = get_user_from_id($row['creation_contact']);
|
||||
$user_image = 'platzhalter-mann-compressor.jpg';
|
||||
if($user['image'] != ""){
|
||||
$user_image = $user['image'];
|
||||
}
|
||||
?>
|
||||
<div class='post' data-id='<?= $post_id?>'>
|
||||
<div class='post_header'>
|
||||
<div>
|
||||
<img src='/userdata/intranet/contact/<?= $user_image?>'>
|
||||
<div>
|
||||
<p class="post_header_name"><?= $user['name']?></p>
|
||||
<p class="post_header_category">Kategorie: <?= get_category_from_id($category_id)?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($user['id'] == $GLOBALS['main_contact']['id']){?>
|
||||
<div class='delete_post' data-id='<?= $post_id?>'>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash3" viewBox="0 0 16 16"><path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"/></svg>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<div class='post_image_slider'>
|
||||
<?= load_image_slider($row['gallery_id'])?>
|
||||
</div>
|
||||
<div class='post_content'>
|
||||
<div class="post_toolbar">
|
||||
<div class="like <?= check_if_liked($post_id)?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="30.251" height="28.101" viewBox="0 0 30.251 28.101">
|
||||
<path id="heart-sharp" d="M18,31.5l-.633-.422c-3.008-2.009-6.814-4.279-9.633-7.616A16.471,16.471,0,0,1,3.375,12.423,7.934,7.934,0,0,1,11.185,4.5,8.863,8.863,0,0,1,18,7.89,8.863,8.863,0,0,1,24.815,4.5a7.933,7.933,0,0,1,7.81,7.921A16.448,16.448,0,0,1,28.266,23.46c-2.819,3.339-6.625,5.61-9.633,7.618Z" transform="translate(-2.874 -4)" stroke-width="1"/>
|
||||
</svg>
|
||||
|
||||
<span class='like_count_<?= $row['id']?>'>0</span>
|
||||
</div>
|
||||
<div class="comment">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="37" height="31.864" viewBox="0 0 37 31.864">
|
||||
<path id="comment" d="M36,12.857a10.019,10.019,0,0,1-2.411,6.459A16.287,16.287,0,0,1,27.04,24,23.346,23.346,0,0,1,18,25.715a27.434,27.434,0,0,1-2.913-.161,21.959,21.959,0,0,1-9.241,4.862,15.169,15.169,0,0,1-2.29.442.789.789,0,0,1-.613-.181,1.014,1.014,0,0,1-.352-.583v-.02a.265.265,0,0,1-.01-.241.541.541,0,0,0,.04-.2q-.01-.04.09-.191l.121-.181.141-.171.161-.181q.141-.161.623-.693l.693-.763q.211-.231.623-.794a8.178,8.178,0,0,0,.653-1.025q.241-.462.542-1.185a12.788,12.788,0,0,0,.522-1.527A14.748,14.748,0,0,1,1.818,18.5,9.747,9.747,0,0,1,0,12.857,9.569,9.569,0,0,1,1.426,7.865,13.7,13.7,0,0,1,5.263,3.757a19.542,19.542,0,0,1,5.746-2.742A23.923,23.923,0,0,1,18,0a23.346,23.346,0,0,1,9.04,1.718A16.287,16.287,0,0,1,33.589,6.4,10.018,10.018,0,0,1,36,12.857Z" transform="translate(0.5 0.5)" stroke-width="1"/>
|
||||
</svg>
|
||||
|
||||
<span class='comment_count_<?= $row['id']?>'>0</span>
|
||||
</div>
|
||||
</div>
|
||||
<h3><?= $row['title']?></h3>
|
||||
<p class="post_content_desc"><?= $row['content']?></p>
|
||||
<span id="read_more">Mehr lesen</span>
|
||||
<div class='post_comments'>
|
||||
<?= load_comments($post_id)?>
|
||||
<div class='new_comment'>
|
||||
<form method='post' autocomplete="off">
|
||||
<input type='hidden' name='input_post_id' value='<?= $post_id?>'>
|
||||
<input type='text' id="new_comment_textarea"name='input_comment' placeholder='Kommentar schreiben'></input>
|
||||
<label>
|
||||
<input type='submit' name='submit_comment' value='Kommentar senden'>
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if(isset($_POST['submit_comment'])){
|
||||
if($_POST['input_comment'] != ""){
|
||||
$comment = str_replace(array('\r\n', '\n\r', '\n', '\r'), '<br>', $_POST['input_comment']);
|
||||
$query = "INSERT INTO community_board_comment
|
||||
(community_board_post_id, main_contact_id, comment)
|
||||
VALUES (
|
||||
'" . $_POST['input_post_id'] . "',
|
||||
'" . $GLOBALS['main_contact']['id'] . "',
|
||||
'" . $comment ."'
|
||||
)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
$uri = $_SERVER["REDIRECT_URL"];
|
||||
echo "<script type='text/javascript'>window.location.href = 'https://".$host.$uri."';</script>";
|
||||
}
|
||||
}
|
||||
|
||||
function load_image_slider($gallery_id){
|
||||
$select_slideshow = $GLOBALS['pdo_conn']->prepare("SELECT * FROM slideshow_line WHERE header_id = ".$gallery_id);
|
||||
$select_slideshow->execute(array());
|
||||
$res_slideshow = $select_slideshow->fetchALL(PDO::FETCH_ASSOC);
|
||||
if($res_slideshow[0]['id'] == 0){
|
||||
return;
|
||||
}
|
||||
echo "<div class='image_slider'>";
|
||||
echo "<div class='img_owl'>";
|
||||
foreach ($res_slideshow as $key => $value) {
|
||||
echo "<div class='image'>";
|
||||
if($value['description'] == 'video'){
|
||||
echo "<div class='video_settings'>";
|
||||
echo '<div data_id="'.$value['id'].'" class="play"><svg xmlns="http://www.w3.org/2000/svg" width="43.713" height="49.926" viewBox="0 0 43.713 49.926">
|
||||
<path id="play" d="M3.041.39,42.953,23.148q.78.439.78,1.925t-.78,1.827L3.041,49.658a2.047,2.047,0,0,1-1.462.268A2.591,2.591,0,0,1,.02,49.073v-48Q1.531-.585,3.041.39Z" transform="translate(-0.02 -0.029)"/>
|
||||
</svg></div>';
|
||||
echo '<div data_id="'.$value['id'].'" class="pause" style="display: none"><svg xmlns="http://www.w3.org/2000/svg" width="49.951" height="49.951" viewBox="0 0 49.951 49.951">
|
||||
<path id="pause" d="M43.728,49.951H37.484a6.245,6.245,0,0,1-6.244-6.244V6.244a6.018,6.018,0,0,1,1.829-4.415A6.011,6.011,0,0,1,37.484,0h6.244a6.018,6.018,0,0,1,4.415,1.829,6.011,6.011,0,0,1,1.829,4.415V43.707a6.245,6.245,0,0,1-6.244,6.244Zm-31.22,0H6.264a6.018,6.018,0,0,1-4.415-1.829A6.007,6.007,0,0,1,.021,43.707V6.244A6.018,6.018,0,0,1,1.85,1.829,6.011,6.011,0,0,1,6.265,0h6.244a6.018,6.018,0,0,1,4.415,1.829,6.011,6.011,0,0,1,1.829,4.415V43.707a6.018,6.018,0,0,1-1.829,4.415,6.011,6.011,0,0,1-4.415,1.829Z" transform="translate(-0.021)"/>
|
||||
</svg></div>';
|
||||
echo "</div>";
|
||||
echo "<video data_id='".$value['id']."' src='/userdata/intranet/community_board/".$value['filename']."'>";
|
||||
}else {
|
||||
echo "<img src='/userdata/intranet/community_board/".$value['filename']."'>";
|
||||
}
|
||||
echo "</div>";
|
||||
}
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
function load_comments($post_id){
|
||||
$query = "SELECT * FROM community_board_comment WHERE community_board_post_id = ".$post_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$user = get_user_from_id($row['main_contact_id']);
|
||||
$user_image = 'platzhalter-mann-compressor.jpg';
|
||||
if($user['image'] != ""){
|
||||
$user_image = $user['image'];
|
||||
}
|
||||
?>
|
||||
<div class='post_comment_item'>
|
||||
<img src='/userdata/intranet/contact/<?= $user_image?>'>
|
||||
<div>
|
||||
<p class="comment_item_content"><?php echo nl2br($row['comment'])?></p>
|
||||
<p class="comment_item_author">von: <?= $user['name']?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function check_if_liked($post_id){
|
||||
$return = '';
|
||||
$query = "SELECT * FROM community_board_post_likes WHERE community_board_post_id = ".$post_id." AND main_contact_id = ".$GLOBALS['main_contact']['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) >= 1) {
|
||||
$return = 'is_liked';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function get_user_from_id($user_id){
|
||||
$query = "SELECT * FROM main_contact WHERE id = ".$user_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
return $row;
|
||||
}
|
||||
|
||||
function get_category_from_id($category_id){
|
||||
$query = "SELECT * FROM community_board_category WHERE id = ".$category_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
return $row['description'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class='community_board'>
|
||||
<div class="community_board_header">
|
||||
<div class='category_filter'>
|
||||
<?= load_categories($category_id);?>
|
||||
</div>
|
||||
<button class='new_post_button'>+</button>
|
||||
<?php require_once('show_community_board_cardform.inc.php')?>
|
||||
</div>
|
||||
<div class='posts'>
|
||||
<?= load_all_posts($category_id);?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('.post').each(function(){
|
||||
var post_id = $(this).attr('data-id');
|
||||
ajax_action(post_id, 'count_likes', true, '.like_count_'+post_id);
|
||||
ajax_action(post_id, 'count_comments', true, '.comment_count_'+post_id);
|
||||
});
|
||||
|
||||
$('.post').on('click', '.like', function() {
|
||||
var post_id = $(this).parent().parent().parent().attr('data-id');
|
||||
$(this).toggleClass("is_liked");
|
||||
ajax_action(post_id, 'update_likes', false);
|
||||
setTimeout(function() {
|
||||
ajax_action(post_id, 'count_likes', true, '.like_count_'+post_id);
|
||||
ajax_action(post_id, 'count_comments', true, '.comment_count_'+post_id);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
function ajax_action(post_id, action, show, content_class = 0){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "/module/community_board/community_board_ajax.inc.php",
|
||||
data: {
|
||||
post_id : post_id,
|
||||
action : action,
|
||||
status : status,
|
||||
main_contact_id : <?= $GLOBALS['main_contact']['id'] ?>,
|
||||
},
|
||||
success: function(data){
|
||||
if(show == true){
|
||||
$(content_class).html(data)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.posts').on('click', '.delete_post', function() {
|
||||
var post_id = $(this).attr('data-id');
|
||||
ajax_action(post_id, 'delete_post', false);
|
||||
location.reload();
|
||||
});
|
||||
|
||||
$('.new_post_button').click(function() {
|
||||
$('.new_post').show();
|
||||
});
|
||||
$('span#read_more').click(function() {
|
||||
const $readMoreSpan = $(this);
|
||||
const $previousDiv = $readMoreSpan.prev();
|
||||
const $nextDiv = $readMoreSpan.next();
|
||||
|
||||
if ($previousDiv.hasClass('show_all')) {
|
||||
// Wenn die Klasse 'show_all' bereits vorhanden ist, entferne sie
|
||||
$previousDiv.removeClass('show_all');
|
||||
$readMoreSpan.html('mehr lesen');
|
||||
} else {
|
||||
// Wenn die Klasse 'show_all' nicht vorhanden ist, füge sie hinzu
|
||||
$previousDiv.addClass('show_all');
|
||||
$readMoreSpan.html('weniger lesen');
|
||||
}
|
||||
|
||||
$nextDiv.slideToggle();
|
||||
});
|
||||
|
||||
|
||||
$('.comment').click(function() {
|
||||
$(this).parent().next().next().next().next().slideToggle();
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Funktion zum Ausblenden des '.new_post'-Elements
|
||||
function hideNewPost() {
|
||||
$('.new_post').hide();
|
||||
}
|
||||
|
||||
// Event-Listener für das Klicken auf den Schließen-Button
|
||||
$('.close_entry_button').click(function() {
|
||||
hideNewPost();
|
||||
});
|
||||
|
||||
// Event-Listener für das Drücken der Escape-Taste
|
||||
$(document).keyup(function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
hideNewPost();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
173
module/community_board/show_community_board_cardform.inc.php
Normal file
173
module/community_board/show_community_board_cardform.inc.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<div style='display: none' class='new_post'>
|
||||
<div class="entry-wrapper">
|
||||
|
||||
<div class="data-wrapper">
|
||||
<form method='post' autocomplete='off' enctype="multipart/form-data">
|
||||
<div class="post_c_header">
|
||||
<h1>Beitrag erstellen</h1>
|
||||
<div class="close_entry_button"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-square" viewBox="0 0 16 16">
|
||||
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
|
||||
</svg>schließen ohne zu speichern
|
||||
</div>
|
||||
</div>
|
||||
<?php select_category();?>
|
||||
<textarea id='title' type='text' name='title' required
|
||||
placeholder='Titel & Teaser' maxlength='255'></textarea>
|
||||
<div class="form-floating" id='image_1_wrapper1'>
|
||||
<input id='image_1' type='file' name='image_1' accept=".png,.jpg,.jpeg,.gif,.mp4">
|
||||
<label for="image_1">0 von 5 max. Bilder</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating" id='image_2_wrapper2' style="display: none">
|
||||
<input id='image_2' type='file' name='image_2' accept=".png,.jpg,.jpeg,.gif,.mp4"
|
||||
>
|
||||
<label for="image_2">2 von 5 max. Bilder</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating" id='image_3_wrapper3' style="display: none">
|
||||
<input id='image_3' type='file' name='image_3' accept=".png,.jpg,.jpeg,.gif,.mp4"
|
||||
>
|
||||
<label for="image_3">3 von 5 max. Bilder</label>
|
||||
</div>
|
||||
<div class="form-floating" id='image_4_wrapper4' style="display: none">
|
||||
<input id='image_4' type='file' name='image_4' accept=".png,.jpg,.jpeg,.gif,.mp4"
|
||||
>
|
||||
<label for="image_4">4 von 5 max. Bilder</label>
|
||||
</div>
|
||||
<div class="form-floating" id='image_5_wrapper5' style="display: none">
|
||||
<input id='image_5' type='file' name='image_5' accept=".png,.jpg,.jpeg,.gif,.mp4"
|
||||
>
|
||||
<label for="image_5">5 von 5 max. Bilder</label>
|
||||
</div>
|
||||
|
||||
<textarea id='description' name="description" rows="4" cols="50"
|
||||
placeholder='Beschreibungstext (maximal 750 Zeichen)' maxlength='750'></textarea>
|
||||
|
||||
<input id='absenden' type='submit' name='submit_post' value='Beitrag veröffentlichen'>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Funktion, die aufgerufen wird, wenn ein Bild hochgeladen wird
|
||||
function handleImageUpload(inputElement, nextWrapperId) {
|
||||
const fileInput = inputElement;
|
||||
const nextWrapper = document.getElementById(nextWrapperId);
|
||||
|
||||
fileInput.addEventListener('change', function() {
|
||||
if (fileInput.files.length > 0) {
|
||||
nextWrapper.style.display = 'flex';
|
||||
} else {
|
||||
nextWrapper.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Event-Listener für die Bild-Eingabefelder
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const image1Input = document.getElementById('image_1');
|
||||
handleImageUpload(image1Input, 'image_2_wrapper2');
|
||||
|
||||
const image2Input = document.getElementById('image_2');
|
||||
handleImageUpload(image2Input, 'image_3_wrapper3');
|
||||
|
||||
const image3Input = document.getElementById('image_3');
|
||||
handleImageUpload(image3Input, 'image_4_wrapper4');
|
||||
|
||||
const image4Input = document.getElementById('image_4');
|
||||
handleImageUpload(image4Input, 'image_5_wrapper5');
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_POST['submit_post'])){
|
||||
if($_POST['title'] != ""){
|
||||
$slideshow_header_id = createSlideshowHeader();
|
||||
$i = 1;
|
||||
while ($i <= 5) {
|
||||
if(!$_FILES['image_'.$i]['name'] == "") {
|
||||
uploadImage('image_'.$i, $slideshow_header_id);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$current_date = new DateTime();
|
||||
$content = str_replace(array('\r\n', '\n\r', '\n', '\r'), '<br>', $_POST['description']);
|
||||
|
||||
$insertquery = "INSERT INTO community_board_post
|
||||
(creation_date, creation_contact, title, content, gallery_id)
|
||||
VALUES (
|
||||
'" . $current_date->format('Y-m-d H:i:s') . "',
|
||||
'" . $GLOBALS['main_contact']['id'] . "',
|
||||
'" . $_POST['title'] . "',
|
||||
'" . $content . "',
|
||||
'" . $slideshow_header_id ."'
|
||||
)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $insertquery);
|
||||
|
||||
$post_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$insert2 = "INSERT INTO community_board_post_category_link
|
||||
(community_board_post_id, community_board_category_id)
|
||||
VALUES (
|
||||
'" . $post_id . "',
|
||||
'" . $_POST['category'] ."'
|
||||
)";
|
||||
$result2 = @mysqli_query($GLOBALS['mysql_con'], $insert2);
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
$uri = $_SERVER["REDIRECT_URL"];
|
||||
echo "<script type='text/javascript'>window.location.href = 'https://".$host.$uri."';</script>";
|
||||
}
|
||||
}
|
||||
|
||||
function select_category(){
|
||||
$query = "SELECT * FROM community_board_category ORDER BY sorting";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
echo "<select id='category' name='category'>";
|
||||
echo "<option value='0'>Kategorie auswählen</option>";
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
echo "<option value='".$row['id']."'>".$row['description']."</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
}
|
||||
|
||||
function uploadImage($name, $header_id){
|
||||
$upload_folder = '/userdata/intranet/community_board/';
|
||||
$filename = pathinfo($_FILES[$name]['name'], PATHINFO_FILENAME);
|
||||
$extension = strtolower(pathinfo($_FILES[$name]['name'], PATHINFO_EXTENSION));
|
||||
|
||||
$allowed_extensions = array('png', 'jpg', 'jpeg', 'gif', 'mp4');
|
||||
if(!in_array($extension, $allowed_extensions)) {
|
||||
die();
|
||||
}
|
||||
|
||||
$saveFilename = $header_id . "_" . cleanFilename($_FILES[$name]['name']);
|
||||
|
||||
define("PATH_RESIZE", "../../userdata/intranet/community_board/");
|
||||
define("PATH_ORIGINAL_FRONTEND", "/userdata/intranet/community_board/");
|
||||
move_uploaded_file($_FILES[$name]['tmp_name'], PATH_RESIZE . $saveFilename);
|
||||
|
||||
$description = 'image';
|
||||
$preview = "<img src='".PATH_ORIGINAL_FRONTEND.$saveFilename."'>";
|
||||
if($extension == 'mp4'){
|
||||
$description = 'video';
|
||||
$preview = "<video src='".PATH_ORIGINAL_FRONTEND.$saveFilename."'>";
|
||||
}
|
||||
|
||||
createSlideshowLine($header_id, $preview, $saveFilename, $description);
|
||||
}
|
||||
|
||||
function createSlideshowHeader(){
|
||||
$insert_slideshow_header = $GLOBALS['pdo_conn']->prepare("INSERT INTO slideshow_header VALUES (NULL, ".$GLOBALS['language']['id'].", '', 1000, 500, 'fade', 'yes', 4, 1, 'fixed', 'bottom', '', '', 1, 0)");
|
||||
$insert_slideshow_header->execute();
|
||||
$id = $GLOBALS['pdo_conn']->lastInsertId();
|
||||
return $id;
|
||||
}
|
||||
|
||||
function createSlideshowLine($header_id, $preview, $filename, $description){
|
||||
$insert_slideshow_line = $GLOBALS['pdo_conn']->prepare("INSERT INTO slideshow_line VALUES(NULL, :header_id, :preview, :filename, :description, '', '', '', '', '', 0, 0, 0)");
|
||||
$insert_slideshow_line->execute(array(':header_id' => $header_id, ':preview' => $preview, ':filename' => $filename, ':description' => $description));
|
||||
}
|
||||
|
||||
26
module/contactform/collection_contactform_cardform.inc.php
Normal file
26
module/contactform/collection_contactform_cardform.inc.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
?>
|
||||
<h2><?php echo $translation->get("contactform_options"); ?></h2>
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("subject"), "collection_setup_input_subject", "text", $sitepart_options["collection_setup_input_subject"], 255) ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("sender_name"), "collection_setup_sender_name", "text", $sitepart_options["collection_setup_sender_name"], 255) ?>
|
||||
<? input($translation->get("sender_email"), "collection_setup_sender_email", "text", $sitepart_options["collection_setup_sender_email"], 255) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("recipient_name"), "collection_setup_recipient_name", "text", $sitepart_options["collection_setup_recipient_name"], 255) ?>
|
||||
<? input($translation->get("recipient_email"), "collection_setup_recipient_email", "text", $sitepart_options["collection_setup_recipient_email"], 255) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_contactform_list_" . $fieldSetup['id'];
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $fieldSetup['id']; ?>" />
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_contactform', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_contactform')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', false, '{$translation->get('delete_contactform_field_confirm')}')", "", FALSE); ?>
|
||||
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_contactform')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_contactform')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
|
||||
$query = "SELECT * FROM main_collection_link WHERE main_collection_id = " . $collectionData['id'] . " AND main_collection_setup_content_id = " . $fieldSetup['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows == 0) {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div></form>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = @mysqli_fetch_array($result, 1);
|
||||
|
||||
$query = "SELECT id, CASE typ WHEN 1 THEN '" . $translation->get("textfield") . "' WHEN 2 THEN '" . $translation->get("textarea") . "' WHEN 3 THEN '" . $translation->get("yesno") . "' WHEN 4 THEN '" . $translation->get("optionfield") . "' WHEN 5 THEN '" . $translation->get("headline") . "' WHEN 6 THEN '" . $translation->get("spacerow") . "' WHEN 7 THEN '" . $translation->get("title_news") . "' WHEN 8 THEN '" . $translation->get("file") . "' END AS 'Typ', code AS '" . $translation->get("textkey") . "', name AS '" . $translation->get("caption") . "', mandatory AS '" . $translation->get("mandatory_field") . "' FROM contactform_line WHERE header_id = " . $row['main_sitepart_header_id'] . " ORDER BY sorting ASC";
|
||||
$format = array('option', 'text', 'text', 'text', 'boolean');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_contactform", TRUE, "update_sortorder_contactform");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
50
module/contactform/component_contactform_listform.inc.php
Normal file
50
module/contactform/component_contactform_listform.inc.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contactform_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_contactforms"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit_component', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_page"), $formname, "loadCard('assoc_line_component')"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="3">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$is_multistep = 0;
|
||||
|
||||
if(isset($_GET['is_multistep_form'])){
|
||||
$is_multistep = $_GET['is_multistep_form'];
|
||||
}
|
||||
$query = "SELECT contactform_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from contactform_header left join main_admin_user ON contactform_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 AND is_multistep = ".$is_multistep." order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_component");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
280
module/contactform/contact_collection_preview_cardform.inc.php
Normal file
280
module/contactform/contact_collection_preview_cardform.inc.php
Normal file
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_preview_list";
|
||||
$inputname = "input_id";
|
||||
$input_contactform_id = (isset($_REQUEST["input_contactform_id"]) ? $_REQUEST["input_contactform_id"] : "");
|
||||
$collection_setup_id = 0;
|
||||
|
||||
// erstelle kollektionen sammeln
|
||||
$collection_setups = array();
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$query = "SELECT ms.id, ms.main_language_id, ms.code, ms.description, ms.linked, ms.icon, ms.modified_user, ms.modified_date, ms.all_languages, ms.show_filter FROM main_collection_setup as ms INNER JOIN main_collection_setup_websites as mcsw on ms.id = mcsw.main_collection_setup_id WHERE mcsw.main_site_id = ".$GLOBALS['site']['id']." ";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$collection_setups[$row['id']] = $row;
|
||||
}
|
||||
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if ($input_line['main_collection_setup_id'] != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = " . $input_line['main_collection_setup_id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$active_groups = array();
|
||||
$query = "SELECT main_collection_setup_group_id FROM main_page_collection_group_link WHERE main_page_link_id = " . (int)$input_line["id"];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$active_groups[] = $row['main_collection_setup_group_id'];
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadPagesWithCollection( collection_setup_id ) {
|
||||
load_collections(collection_setup_id);
|
||||
console.log('hello');
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html("");
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (collection_setup_id == "" || collection_setup_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname; ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("collection_setup_id", collection_setup_id);
|
||||
formData.append("page_link_id", '<?php echo $input_line["id"]; ?>');
|
||||
$.ajax({
|
||||
url : "?action=load_collection_pages_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
dataType : 'json',
|
||||
success : function ( output, status, xhr ) {
|
||||
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/dc/");
|
||||
} else {
|
||||
$('.loader', $('#<?php echo $formname; ?>')).hide();
|
||||
console.log('history');
|
||||
$('.collection_pages', $('#<?php echo $formname; ?>')).html(output.page_with_collection_select);
|
||||
$('.collection_preview_group_select_container', $('#<?php echo $formname; ?>')).html(output.collection_preview_group_select);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, exception) {
|
||||
var msg = '';
|
||||
if (jqXHR.status === 0) {
|
||||
msg = 'Not connect.\n Verify Network.';
|
||||
} else if (jqXHR.status == 404) {
|
||||
msg = 'Requested page not found. [404]';
|
||||
} else if (jqXHR.status == 500) {
|
||||
msg = 'Internal Server Error [500].';
|
||||
} else if (exception === 'parsererror') {
|
||||
msg = 'Requested JSON parse failed.';
|
||||
} else if (exception === 'timeout') {
|
||||
msg = 'Time out error.';
|
||||
} else if (exception === 'abort') {
|
||||
msg = 'Ajax request aborted.';
|
||||
} else {
|
||||
msg = 'Uncaught Error.\n' + jqXHR.responseText;
|
||||
}
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function load_collections( collection_setup_id ) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("main_collection_setup_id", collection_setup_id);
|
||||
$.ajax({
|
||||
url : "?action=load_collections_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/dc/");
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).html(output);
|
||||
}
|
||||
},
|
||||
error : function ( jqXHR, textStatus, errorThrown ) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggle_view_type( _type ) {
|
||||
if (_type == 0) {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).show();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
} else {
|
||||
$('.collection_list_choose', $('#<?php echo $formname; ?>')).hide();
|
||||
$('.collection_items_choose', $('#<?php echo $formname; ?>')).show();
|
||||
}
|
||||
}
|
||||
|
||||
function save_and_close_page_line() {
|
||||
jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
|
||||
loadCard('save_collection_preview_page', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
if (isset($_REQUEST['is_collection_preview']) && $_REQUEST['is_collection_preview'] == 1) {
|
||||
echo $translation->get("assign_collection_preview");
|
||||
} else {
|
||||
echo $translation->get("assign_collection_list");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_contactform', true)"); ?>
|
||||
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_collection_preview_page', true)"); ?>
|
||||
<?= button("delete",$translation->get("delete_content"),$formname,"loadCard('delete_line_contact', true, '{$translation->get('delete_assoc_pageline')}')","", false); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if ((gettype($messages) == 'array' || gettype($messages) == 'object') && count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
print_r($input_line);
|
||||
?>
|
||||
|
||||
<?php if (isset($_REQUEST['is_collection_preview']) && $_REQUEST['is_collection_preview'] == 1): ?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_contactform_id" value="<?php echo $input_contactform_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input name="is_collection_preview" id="is_collection_preview" type="hidden" value="1" />
|
||||
<input type="hidden" name="input_section_id" value="<?php echo $_REQUEST['input_section_id']; ?>" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_area_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input_select($translation->get("collection_preview_type"), "main_collection_view_type", $values = array('0', '1'), $value_names = array($translation->get("single_collection"), $translation->get("collection_list")), $input_line["main_collection_view_type"], FALSE, FALSE, 'onchange="toggle_view_type(this.value);"'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/2015/ajax-loader.gif" />
|
||||
|
||||
<div class="collection_pages">
|
||||
<?
|
||||
create_page_with_collection_select($input_line['main_collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", $input_line, FALSE);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php
|
||||
if ($input_line["main_collection_view_type"] == 0) {
|
||||
$display_list_choose = '';
|
||||
$display_item_choose = 'style="display:none;"';
|
||||
} else {
|
||||
$display_item_choose = '';
|
||||
$display_list_choose = 'style="display:none;"';
|
||||
}
|
||||
|
||||
// einzelne kollektion
|
||||
echo "<div class=\"collection_list_choose\" " . $display_list_choose . ">";
|
||||
input_select($translation->get("choose_collection"), "main_collection_id", $values = $collection_ids, $value_names = $collections, $input_line["main_collection_id"], FALSE, FALSE);
|
||||
echo "</div>";
|
||||
|
||||
// kollektionsliste
|
||||
echo "<div class=\"collection_items_choose\" " . $display_item_choose . ">";
|
||||
input($translation->get("collection_list_items"), "main_collection_items", "text", $input_line["main_collection_items"], 255);
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="0" />
|
||||
<input type="hidden" name="input_contactform_id" value="<?php echo $input_contactform_id; ?>" />
|
||||
<input type="hidden" name="input_section_id" value="<?php echo $_REQUEST['input_section_id']; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input name="is_collection_list" id="is_collection_list" type="hidden" value="1" />
|
||||
|
||||
<input name="main_collection_id" type="hidden" value="0" />
|
||||
<input name="main_collection_page_list_id" type="hidden" value="0" />
|
||||
<input name="main_collection_items" type="hidden" value="0" />
|
||||
<input name="main_collection_view_type" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_area_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? create_collection_select($collection_setups, $translation->get("choose_collection_type"), "main_collection_setup_id", $input_line, FALSE, TRUE, "loadPagesWithCollection(this.value);"); ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/2015/ajax-loader.gif" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="collection_preview_group_select_container">
|
||||
<?php create_collection_preview_group_select($input_line['main_collection_setup_id'], $input_line["id"], $active_groups); ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
16
module/contactform/contactform.php
Normal file
16
module/contactform/contactform.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?
|
||||
|
||||
function contactform_show( $sitepart_id ) {
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'show_contactform.inc.php';
|
||||
}
|
||||
|
||||
function contactform_edit() {
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_contactform.inc.php';
|
||||
}
|
||||
function multi_contactform_edit(){
|
||||
if(!isset($_REQUEST['action']))
|
||||
$_REQUEST['action'] = 'multi_contactform';
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_contactform.inc.php';
|
||||
}
|
||||
|
||||
?>
|
||||
156
module/contactform/edit_collection_listform.inc.php
Normal file
156
module/contactform/edit_collection_listform.inc.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_collection_list";
|
||||
$inputname = "input_id";
|
||||
$filter = (isset($_REQUEST['filter']) ? $_REQUEST['filter'] : "");
|
||||
|
||||
$collection_setup_info = get_collection_setup_info();
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function filter_collection() {
|
||||
jQuery('#form_collection_list .requestLoader').show();
|
||||
|
||||
var filter = jQuery('#collection_filter').val();
|
||||
|
||||
jQuery('#form_collection_list').attr("action", "?filter=" + filter).submit();
|
||||
|
||||
return;
|
||||
|
||||
var formData = {
|
||||
filter_id: jQuery('#collection_filter').val(),
|
||||
};
|
||||
|
||||
jQuery('#filter_collection_setup_id').val(jQuery('#collection_filter').val());
|
||||
$.ajax({
|
||||
url : "?action=filter_collection",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
success: function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
jQuery('#form_collection_list .requestLoader').hide();
|
||||
jQuery('#page_linklist').html(output);
|
||||
|
||||
initForm();
|
||||
initLinklist();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_collection', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_collection')"); ?>
|
||||
|
||||
|
||||
<li>
|
||||
<ul>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "sendRequest('moveup_line_collection')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "sendRequest('movedown_line_collection')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_collection', false, '{$translation->get('delete_collection_confirm')}')", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_collections'); ?> - <?php echo $collection_setup_info['description']; ?></h1>
|
||||
|
||||
<h3><?php echo get_translation('filter'); ?>:</h3>
|
||||
|
||||
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_collection_id" value="" />
|
||||
<input type="hidden" id="filter_collection_setup_id" name="filter_collection_setup_id"
|
||||
value="<?php echo(isset($_REQUEST['filter_id']) ? (int)$_REQUEST['filter_id'] : ''); ?>" />
|
||||
|
||||
|
||||
<div class="input">
|
||||
<select id="collection_filter" name="collection_filter" class="bigselect" onchange="filter_collection();">
|
||||
<option value=""><?php echo get_translation('collection_filter_active'); ?></option>
|
||||
<option value="past" <?php echo ($filter == "past" ? 'selected="selected"' : ""); ?>><?php echo get_translation('collection_filter_past'); ?></option>
|
||||
<option value="future" <?php echo ($filter == "future" ? 'selected="selected"' : ""); ?>><?php echo get_translation('collection_filter_future'); ?></option>
|
||||
<option value="all" <?php echo ($filter == "all" ? 'selected="selected"' : ""); ?>><?php echo get_translation('collection_filter_all'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="requestLoader"></div>
|
||||
<div id="page_linklist">
|
||||
<?
|
||||
$where = "";
|
||||
if ($collection_setup_id != NULL) {
|
||||
$where = " and main_collection_setup_id = " . $collection_setup_id;
|
||||
}
|
||||
|
||||
switch($filter) {
|
||||
case 'past':
|
||||
$where .= " AND (validity_to IS NOT NULL AND validity_to < '" . date("Y-m-d") . "') ";
|
||||
break;
|
||||
case 'future':
|
||||
$where .= " AND (validity_from IS NOT NULL AND validity_from > '" . date("Y-m-d") . "') ";
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
// muss nicht nach datum gefiltert werden
|
||||
break;
|
||||
|
||||
default:
|
||||
$where .= " AND (validity_from IS NULL OR validity_from <= '" . date("Y-m-d") . "') ";
|
||||
$where .= " AND (validity_to IS NULL OR validity_to >= '" . date("Y-m-d") . "') ";
|
||||
break;
|
||||
}
|
||||
|
||||
$query = "SELECT
|
||||
main_collection.id,
|
||||
main_collection_setup.description AS '" . $translation->get("type") . "',
|
||||
main_collection.description AS '" . $translation->get("description") . "',
|
||||
from_unixtime(main_collection.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "',
|
||||
main_admin_user.name AS '" . $translation->get("changed_by") . "'
|
||||
from
|
||||
main_collection left join main_admin_user
|
||||
ON
|
||||
main_collection.modified_user = main_admin_user.id
|
||||
inner join main_collection_setup
|
||||
ON
|
||||
main_collection.main_collection_setup_id = main_collection_setup.id
|
||||
where
|
||||
(main_collection_setup.main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR main_collection_setup.all_languages = 1) $where ORDER BY main_collection_setup_id asc, sorting asc";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_collection_id", "edit_collection", TRUE, "update_sortorder_collection");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/v/dt/r-2.2.5/datatables.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js" ></script>
|
||||
<script>
|
||||
var $y = jQuery.noConflict();
|
||||
$y(document).ready( function () {
|
||||
console.log('hello');
|
||||
$y("<?='#'.$formname.'_table';?>").DataTable({
|
||||
"paging": true,
|
||||
"ordering": true,
|
||||
"order": [[ 0, "asc" ]],
|
||||
"lengthMenu": [[5, 10, 15, 30, -1], [5, 10, 15, 30, "All"]],
|
||||
"responsive": true,
|
||||
'searching' : true,
|
||||
"scrollX": false,
|
||||
"info": true,
|
||||
columnDefs: [
|
||||
{ orderable: false, targets: -1 }
|
||||
],
|
||||
} );
|
||||
});
|
||||
</script>
|
||||
1746
module/contactform/edit_contactform.inc.php
Normal file
1746
module/contactform/edit_contactform.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
116
module/contactform/edit_contactform_cardform.inc.php
Normal file
116
module/contactform/edit_contactform_cardform.inc.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contactform_card";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$is_survey = 0;
|
||||
if(isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
$is_survey = 1;
|
||||
}
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($GLOBALS['site']['secretkey'] == "" && $GLOBALS['site']['websitekey'] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_contactform["id"] == "") {
|
||||
if(isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
echo $translation->get("new_survey");
|
||||
}else{
|
||||
echo $translation->get("new_contactform");
|
||||
}
|
||||
|
||||
} else {
|
||||
if(isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
echo $translation->get("edit_survey");
|
||||
}else{
|
||||
echo $translation->get("edit_contactform");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
if (is_page_edit() || is_component_edit()) {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_contactform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_contactform', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_contactform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_contactform', true, '{$translation->get('delete_contactform_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_contactform["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="3">
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_contactform["description"], 255) ?>
|
||||
<? input($translation->get("sender_name"), "input_sender_name", "text", $input_contactform["sender_name"], 255) ?>
|
||||
<? input($translation->get("sender_email"), "input_sender_email", "text", $input_contactform["sender_email"], 255) ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_contactform["all_languages"]) ?>
|
||||
<? input($translation->get("recaptcha_active"), "input_recaptcha_active", "checkbox", $input_contactform["recaptcha_active"],NULL,$reCaptchaDisabled) ?>
|
||||
<!-- <? input($translation->get("Umfragen"), "is_survey", "checkbox", $input_contactform["is_survey"]) ?> -->
|
||||
<? input($translation->get("is_registration"), "is_registration", "checkbox", $input_contactform["is_registration"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("subject"), "input_subject", "text", $input_contactform["subject"], 255) ?>
|
||||
|
||||
<? input($translation->get("recipient_name"), "input_recipient_name", "text", $input_contactform["recipient_name"], 255) ?>
|
||||
<? input($translation->get("recipient_email"), "input_recipient_email", "text", $input_contactform["recipient_email"], 255) ?>
|
||||
<? input($translation->get("auto_answer"), "input_auto_answer", "textarea", $input_contactform["auto_answer"]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($reCaptchaDisabled) {
|
||||
?>
|
||||
<tr>
|
||||
<td><div class=""><?= $translation->get("recaptcha_inactive") ?></div></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
if ($input_contactform['id'] != "") {
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'edit_contactform_line_listform.inc.php';
|
||||
}
|
||||
?>
|
||||
334
module/contactform/edit_contactform_line_cardform.inc.php
Normal file
334
module/contactform/edit_contactform_line_cardform.inc.php
Normal file
@@ -0,0 +1,334 @@
|
||||
<?
|
||||
$formname = "form_line_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
$collection_setup_content_id = (isset($_REQUEST["collection_setup_content_id"]) ? $_REQUEST["collection_setup_content_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
|
||||
$queryform = "SELECT * FROM contactform_header WHERE id = '" . $header_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryform);
|
||||
$contactform = @mysqli_fetch_array($result);
|
||||
$is_multiform = $contactform['is_multistep'];
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_contactform_field");
|
||||
} else {
|
||||
echo $translation->get("edit_contactform_field");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?
|
||||
if (is_collection_edit()) {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_collection', true)");
|
||||
} else {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_contactform', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_contactform', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_contactform', true)"); ?>
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', true, '{$translation->get('delete_contactform_field_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $header_id; ?>" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $collection_setup_content_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input type="hidden" name="linklist_form" value="form_field_contactform_list" />
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
if($is_multiform){
|
||||
$section_id = 0;
|
||||
$query = " SELECT * FROM contactform_section WHERE contactform_id = ".$header_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
?>
|
||||
<?php
|
||||
$queryLine = "SELECT * FROM multi_contactform_link WHERE contactform_line_id = '" . $input_line["id"] . "' LIMIT 1";
|
||||
$resultLine = @mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
$input_liner = array();
|
||||
$input_liner['layout_area_id'] = '';
|
||||
if (@mysqli_num_rows($resultLine) == 1) {
|
||||
$input_liner = @mysqli_fetch_array($resultLine);
|
||||
}
|
||||
?>
|
||||
<? layout_class_select($translation->get("layout_area"), "input_layout_area_id", $input_liner['layout_area_id']); ?>
|
||||
<div class="label"><label for="abschnitt">Abschnitt Auswählen</label></div>
|
||||
<div class="input">
|
||||
|
||||
<select class="select" name="section_id" id="section_id">
|
||||
<?php while( $row = mysqli_fetch_array($result)){ ?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $input_line['section_id']){ echo 'selected';} ?>><?php echo $row['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="label"><label for="abschnitt">Nächste Abschnitt</label></div>
|
||||
<div class="input">
|
||||
|
||||
<select class="select" name="next_section_id" id="next_section_id">
|
||||
<option value="NA" <?php if($input_line['next_section_id'] == 'NA'){ echo 'selected'; } ?>>---</option>
|
||||
<?php $result = @mysqli_query($GLOBALS['mysql_con'], $query); while( $row = mysqli_fetch_array($result)){ ?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $input_line['next_section_id']){ echo 'selected';} ?>><?php echo $row['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="label"><label for="abschnitt">Bild</label></div>
|
||||
<div class="input">
|
||||
<input type="file" name="field_img">
|
||||
<?php
|
||||
$valFile = '';
|
||||
if($input_line["field_img"] != '' && $input_line["field_img"] != NULL){
|
||||
$valFile = $input_line["field_img"];
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="field_img_old" value="<?=$valFile;?>">
|
||||
<?php
|
||||
if($input_line["field_img"] != NULL && $input_line["field_img"] != ''){
|
||||
echo "<div class='img_container intranet_user_image'><img class='img-fluid' src='/userdata/collection/resize/".$input_line["field_img"]."'></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="label"><label for="abschnitt" >Icon</label></div>
|
||||
<div class="input">
|
||||
<input type="text" name="icon" value="<?= $input_line["icon"];?>">
|
||||
</div>
|
||||
<? input('Link -Textfeld?', "linked_field", "checkbox", $input_line["linked_field"]); ?>
|
||||
<? input('Linklplatz Platzhalter', "linked_placeholder", "text", $input_line["linked_placeholder"], 50) ?>
|
||||
|
||||
<? } ?>
|
||||
<div class="label"><label for="input_typ">Typ</label></div>
|
||||
<div class="input">
|
||||
<select class="select" name="input_typ" id="input_typ" <?= ($input_line["code"] != 'registration_name' && $input_line["code"] != 'registration_email') ? '' : 'disabled'; ?>>
|
||||
|
||||
<option<?= ($input_line["typ"] == 1) ? " selected=\"selected\"" : " "; ?>
|
||||
value="1"><?php echo $translation->get("textfield"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 2) ? " selected=\"selected\"" : " "; ?>
|
||||
value="2"><?php echo $translation->get("textarea"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 3) ? " selected=\"selected\"" : " "; ?>
|
||||
value="3"><?php echo $translation->get("yesno"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 4) ? " selected=\"selected\"" : " "; ?>
|
||||
value="4"><?php echo $translation->get("optionfield"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 5) ? " selected=\"selected\"" : " "; ?>
|
||||
value="5"><?php echo $translation->get("headline"); ?></option>
|
||||
<!-- <option<?= ($input_line["typ"] == 6) ? " selected=\"selected\"" : " "; ?>
|
||||
value="6"><?php echo $translation->get("spacerow"); ?></option> -->
|
||||
<!-- <option<?= ($input_line["typ"] == 7) ? " selected=\"selected\"" : " "; ?>
|
||||
value="7"><?php echo $translation->get("title_news"); ?></option> -->
|
||||
<option<?= ($input_line["typ"] == 8) ? " selected=\"selected\"" : " "; ?>
|
||||
value="8"><?php echo $translation->get("file"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 9) ? " selected=\"selected\"" : " "; ?>
|
||||
value="9"><?php echo $translation->get("checkbox"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 10) ? " selected=\"selected\"" : " "; ?>
|
||||
value="10"><?php echo 'Radio'; ?></option>
|
||||
<option<?= ($input_line["typ"] == 11) ? " selected=\"selected\"" : " "; ?>
|
||||
value="11"><?php echo $translation->get("date"); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<? input($translation->get("textkey"), "input_code", "text", $input_line["code"], 50, ($input_line["code"] != 'registration_name' && $input_line["code"] != 'registration_email') ? FALSE : TRUE) ?>
|
||||
<?php if($input_line["code"] == 'registration_email' || $input_line["code"] == 'registration_name' ){ ?>
|
||||
<input type="hidden" name="input_code" value="<?= $input_line["code"] ?>">
|
||||
<input type="hidden" name="input_typ" value="<?= $input_line["typ"] ?>">
|
||||
<?php } ?>
|
||||
<? input($translation->get("caption"), "input_name", "text", $input_line["name"], 250) ?>
|
||||
<? input($translation->get("caption_in_field"), "input_infield", "checkbox", $input_line["infield"]) ?>
|
||||
<? input($translation->get("mandatory_field"), "input_mandatory", "checkbox", $input_line["mandatory"]) ?>
|
||||
<br />
|
||||
<?php if(!$contactform['is_survey']){ ?>
|
||||
<? input($translation->get("optionvalues"), "input_option_string", "text", $input_line["option_string"], 200) ?>
|
||||
<?php }else{ ?>
|
||||
<input type="hidden" value="" name="input_option_string">
|
||||
<?php }?>
|
||||
</td>
|
||||
<?php if($contactform['is_survey']){ ?>
|
||||
<td>
|
||||
<div class="main_input_option_string" >
|
||||
<div id="example1">
|
||||
<button type="button" class="r-btnAdd btnAdd btn btn-primary">Hinzufügen +</button>
|
||||
|
||||
<?php $totalOptions = 0; $queryOpt = 'SELECT * FROM contactform_line_option WHERE line_id = '.$input_line["id"];
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
$dataArray = array();
|
||||
$i = 0;
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
$totalOptions = @mysqli_num_rows($result);
|
||||
while( $rowData = mysqli_fetch_array($result)){
|
||||
|
||||
?>
|
||||
<div class="r-group moduleAppended rGroup<?=$i;?>">
|
||||
<p>
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_name'; } ?>" data-pattern-text="<?=$translation->get("optionvalues")?> +=1:"><?=$translation->get("optionvalues")?>:</label><br>
|
||||
<input type="text" value="<?=$rowData['option_string']?>" name="input_option[<?=$i;?>][name]" id="input_option_<?=$i;?>_name" class="form-control text" data-pattern-name="input_option[++][name]" data-pattern-id="input_option_++_name" />
|
||||
</p>
|
||||
|
||||
|
||||
<div class="">
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_linked_field'; } ?>" data-pattern-text="Link -Textfeld? +=1:">Link -Textfeld?:</label><br>
|
||||
<input <?php if($rowData['linked_field'] == 1){ echo 'checked';} ?> type="checkbox" name="input_option[<?=$i;?>][linked_field]" id="input_option_<?=$i;?>_linked_field" class="form-control checkbox" data-pattern-name="input_option[++][linked_field]" data-pattern-id="input_option_++_linked_field" />
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_linked_placeholde'; } ?>" data-pattern-text="Linklplatz Platzhalter +=1:">Linklplatz Platzhalter:</label> <br>
|
||||
<input type="text" name="input_option[<?=$i;?>][linked_placeholder]" id="input_option_<?=$i;?>_linked_placeholder" class="form-control text" data-pattern-name="input_option[++][linked_placeholder]" data-pattern-id="input_option_++_linked_placeholder" value="<?= $rowData['linked_placeholder'];?>" />
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<!-- Add a remove button for the item. If one didn't exist, it would be added to overall group -->
|
||||
<?php if($i != 0){ ?>
|
||||
<button type="button" data-counter="<?= $i;?>" class="r-btnRemove btnRemove btn btn-danger">Entfernen -</button>
|
||||
<?php } ?>
|
||||
<hr>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<?php $i ++; }
|
||||
}else{
|
||||
?>
|
||||
<div class="r-group">
|
||||
<p>
|
||||
<label for="input_option_0_0" data-pattern-text="<?=$translation->get("optionvalues")?> +=1:"><?=$translation->get("optionvalues")?>:</label><br>
|
||||
<input type="text" name="input_option[0][name]" id="input_option_0_name" class="form-control text" data-pattern-name="input_option[++][name]" data-pattern-id="input_option_++_name" />
|
||||
</p>
|
||||
|
||||
|
||||
<!-- <div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Icon +=1:">Icon:</label> <br>
|
||||
<input type="text" name="input_option[0][icon]" id="input_option_0_icon" class="form-control text" data-pattern-name="input_option[++][icon]" data-pattern-id="input_option_++_icon" />
|
||||
</div> -->
|
||||
|
||||
<div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Link -Textfeld? +=1:">Link -Textfeld?:</label><br>
|
||||
<input type="checkbox" name="input_option[0][linked_field]" id="input_option_0_linked_field" class="form-control checkbox" data-pattern-name="input_option[++][linked_field]" data-pattern-id="input_option_++_linked_field" />
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Linklplatz Platzhalter +=1:">Linklplatz Platzhalter:</label> <br>
|
||||
<input type="text" name="input_option[0][linked_placeholder]" id="input_option_0_linked_placeholder" class="form-control text" data-pattern-name="input_option[++][linked_placeholder]" data-pattern-id="input_option_++_linked_placeholder" />
|
||||
</div>
|
||||
<p>
|
||||
<!-- Add a remove button for the item. If one didn't exist, it would be added to overall group -->
|
||||
|
||||
<hr>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" value="<?= $totalOptions;?>" id="totalOption">
|
||||
</form>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
|
||||
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.btnAdd').click(function(){
|
||||
var counter = $('#totalOption').val();
|
||||
counter++;
|
||||
console.log('counter ist' + counter);
|
||||
$('#totalOption').val(counter);
|
||||
$('#example1').append(loadNextModule(counter));
|
||||
});
|
||||
$('.btnRemove').click(function(){
|
||||
counter = $(this).attr('data-counter');
|
||||
console.log('counter ist' + counter);
|
||||
$('.rGroup'+ counter).remove();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.dropbtn').click(function(){
|
||||
console.log('jazba');
|
||||
var counter = $(this).attr('data-counter');
|
||||
|
||||
$("#myDropdown"+counter+".dropdown-content").show();
|
||||
});
|
||||
$('.iconSelect').click(function(){
|
||||
console.log('select');
|
||||
var id = $(this).attr('data-counter');
|
||||
var icon = $(this).attr('data-icon');
|
||||
var htmlIcon = "<span class='material-icons'>" + icon + '</span>';
|
||||
$("#input_option_" + id+"_icon").val(icon);
|
||||
$('.btnNumber' + id).html(htmlIcon);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function loadNextModule(count = 0){
|
||||
|
||||
|
||||
|
||||
var html = '<p></p>'+'<div class="r-group moduleAppended rGroup'+count+'">' +
|
||||
'<p>' +
|
||||
' <label for="input_option_0_'+count+'" ><?=$translation->get("optionvalues")?> </label><br>' +
|
||||
'<input type="text" name="input_option['+count+'][name]" id="input_option_'+count+'_name" class="form-control text" /> ' +
|
||||
'</p> '+
|
||||
'<p>'+
|
||||
|
||||
|
||||
|
||||
'<div class="">'+
|
||||
' <label >Link -Textfeld?</label><br>'+
|
||||
'<input type="checkbox" name="input_option['+count+'][linked_field]" id="input_option_'+count+'_linked_field" class="form-control checkbox" />'+
|
||||
'</div>'+
|
||||
'<div class="">'+
|
||||
'<label >Linklplatz Platzhalter:</label> <br>'+
|
||||
'<input type="text" name="input_option['+count+'][linked_placeholder]" id="input_option_'+count+'_linked_placeholder" class="form-control text" />'+
|
||||
'</div> ' +
|
||||
'<p>'+
|
||||
|
||||
'<button type="button" onclick="myFunctionDelete('+count+')" data-counter="'+count+'" class="r-btnRemove btnRemove btn btn-danger">Entfernen -</button>'+
|
||||
|
||||
' </p>'+
|
||||
'</div> ';
|
||||
|
||||
return html;
|
||||
|
||||
}
|
||||
function myFunctionDelete(counter){
|
||||
console.log('counter');
|
||||
jQuery('.rGroup'+ counter).remove();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
63
module/contactform/edit_contactform_line_listform.inc.php
Normal file
63
module/contactform/edit_contactform_line_listform.inc.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
|
||||
|
||||
<h2><?php echo $translation->get("contact_field_headline"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_line_contactform', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_contactform')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', false, '{$translation->get('delete_contactform_field_confirm')}')", "", FALSE); ?>
|
||||
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_contactform')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_contactform')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, CASE typ WHEN 1 THEN '" . $translation->get("textfield") . "' WHEN 2 THEN '" . $translation->get("textarea") . "' WHEN 3 THEN '" . $translation->get("yesno") . "' WHEN 4 THEN '" . $translation->get("optionfield") . "' WHEN 5 THEN '" . $translation->get("headline") . "' WHEN 6 THEN '" . $translation->get("spacerow") . "' WHEN 7 THEN '" . $translation->get("title_news") . "' WHEN 8 THEN '" . $translation->get("file") . "' WHEN 9 THEN 'Checkbox' WHEN 10 THEN 'Radio' END AS 'Typ', code AS '" . $translation->get("textkey") . "', name AS '" . $translation->get("caption") . "', mandatory AS '" . $translation->get("mandatory_field") . "' FROM contactform_line WHERE header_id = '" . $input_id . "' ORDER BY sorting ASC";
|
||||
$format = array('option', 'text', 'text', 'text', 'boolean');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_contactform", TRUE, "update_sortorder_contactform", "loadCard('delete_line_contactform', false, '{$translation->get('delete_contactform_field_confirm')}')", TRUE);
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
<?php if($input_id != '' && $input_id != NULL && isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
$formname = $formname.$input_id.'survey'
|
||||
?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
|
||||
<h2><?php echo $translation->get("survey_response"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_contactform_survey')", "", FALSE); ?>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<?
|
||||
$query = "SELECT sp.id, sp.name AS 'Name', sp.email FROM survey_persons as sp INNER JOIN survey_answers as sa on sp.id = sa.spid WHERE sp.header_id = '" . $input_id . "' ORDER BY sp.id DESC";
|
||||
$format = array('option', 'text', 'text', 'text', 'boolean');
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "edit_line_contactform", FALSE, "update_sortorder_contactform", "", TRUE);
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
<?php } ?>
|
||||
33
module/contactform/edit_contactform_listform.inc.php
Normal file
33
module/contactform/edit_contactform_listform.inc.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$formname = "form_contactform_list";
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_contactform', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_contactforms'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT contactform_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from contactform_header left join main_admin_user ON contactform_header.modified_user = main_admin_user.id where is_multistep = 0 AND (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 ORDER BY id asc";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_contactform");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
462
module/contactform/edit_contactform_multi_line_cardform.inc.php
Normal file
462
module/contactform/edit_contactform_multi_line_cardform.inc.php
Normal file
@@ -0,0 +1,462 @@
|
||||
<style>
|
||||
.dropbtn {
|
||||
background-color: #3498DB;
|
||||
color: white;
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.dropbtn:hover, .dropbtn:focus {
|
||||
background-color: #2980B9;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #f1f1f1;
|
||||
min-width: 160px;
|
||||
overflow: auto;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
||||
z-index: 1;
|
||||
max-height:300px;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.dropdown-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.dropdown a:hover {background-color: #ddd;}
|
||||
|
||||
.show {display: block;}
|
||||
</style>
|
||||
<?
|
||||
$formname = "form_line_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
$collection_setup_content_id = (isset($_REQUEST["collection_setup_content_id"]) ? $_REQUEST["collection_setup_content_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
$step_id = (isset($_REQUEST["step_id"]) ? $_REQUEST["step_id"] : 0);
|
||||
$section_id = (isset($_REQUEST["input_section_id"]) ? $_REQUEST["input_section_id"] : 0);
|
||||
if(isset($_REQUEST["section_id"])){
|
||||
$section_id = $_REQUEST["section_id"];
|
||||
}
|
||||
|
||||
if($input_line['section_id'] != NULL){
|
||||
$section_id = $input_line['section_id'] ;
|
||||
}
|
||||
|
||||
$queryform = "SELECT * FROM contactform_header WHERE id = '" . $header_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryform);
|
||||
$contactform = @mysqli_fetch_array($result);
|
||||
$is_multiform = $contactform['is_multistep'];
|
||||
$icons = array();
|
||||
$queryIcons = "SELECT * FROM material_icons";
|
||||
$resultIcons = @mysqli_query($GLOBALS['mysql_con'], $queryIcons);
|
||||
while($icon = @mysqli_fetch_array($resultIcons)){
|
||||
array_push($icons, $icon['code']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_contactform_field");
|
||||
} else {
|
||||
echo $translation->get("edit_contactform_field");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?
|
||||
if (is_collection_edit()) {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_collection', true)");
|
||||
} else {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_contactform', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_contactform', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_contactform', true)"); ?>
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', true, '{$translation->get('delete_contactform_field_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $header_id; ?>" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $collection_setup_content_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input type="hidden" id="opt_id" name="opt_id">
|
||||
<input type="hidden" name="linklist_form" value="form_field_contactform_list" />
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
if($is_multiform){
|
||||
// $section_id = 0;
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
$queryLine = "SELECT * FROM multi_contactform_link WHERE contactform_line_id = " . $input_line["id"] . " LIMIT 1";
|
||||
|
||||
$resultLine = @mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
$input_liner = array();
|
||||
$input_liner['layout_area_id'] = '';
|
||||
if (@mysqli_num_rows($resultLine) == 1) {
|
||||
$input_liner = @mysqli_fetch_array($resultLine);
|
||||
}
|
||||
?>
|
||||
<? layout_class_select($translation->get("layout_area"), "input_layout_area_id", $input_liner['layout_area_id']); ?>
|
||||
<? input($translation->get("self_definded_class"), "layout_class_defined", "text", $input_liner["layout_class_defined"], 50) ?>
|
||||
<div class="label"><label for="abschnitt">Abschnitt Auswählen</label></div>
|
||||
<div class="input">
|
||||
|
||||
<select class="select" name="section_id" id="section_id">
|
||||
<?php
|
||||
$queryStep = "SELECT * FROM contactform_steps where contactform_id = ".$header_id.' ORDER BY sorting ASC' ;
|
||||
$resultStep = @mysqli_query($GLOBALS['mysql_con'], $queryStep);
|
||||
|
||||
$e = 1;
|
||||
while($rowStep = mysqli_fetch_array($resultStep)){
|
||||
$query = "SELECT * FROM contactform_section where step_id = ".$rowStep['id'].'';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$a = 1;
|
||||
while( $row = mysqli_fetch_array($result)){
|
||||
|
||||
?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $section_id){ echo 'selected';} ?>><?php echo $e.'.'.$a.': '.$row['name'] ?></option>
|
||||
<?php $a++; } $e++; } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<? $query = "SELECT * FROM contactform_section where contactform_id = ".$header_id.''; } ?>
|
||||
<div class="label"><label for="input_typ">Typ</label></div>
|
||||
<div class="input">
|
||||
<select class="select" name="input_typ" id="input_typ">
|
||||
<option<?= ($input_line["typ"] == 1) ? " selected=\"selected\"" : " "; ?>
|
||||
value="1"><?php echo $translation->get("textfield"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 2) ? " selected=\"selected\"" : " "; ?>
|
||||
value="2"><?php echo $translation->get("textarea"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 3) ? " selected=\"selected\"" : " "; ?>
|
||||
value="3"><?php echo $translation->get("yesno"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 4) ? " selected=\"selected\"" : " "; ?>
|
||||
value="4"><?php echo $translation->get("optionfield"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 5) ? " selected=\"selected\"" : " "; ?>
|
||||
value="5"><?php echo $translation->get("headline"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 6) ? " selected=\"selected\"" : " "; ?>
|
||||
value="6"><?php echo $translation->get("spacerow"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 7) ? " selected=\"selected\"" : " "; ?>
|
||||
value="7"><?php echo $translation->get("title_news"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 8) ? " selected=\"selected\"" : " "; ?>
|
||||
value="8"><?php echo $translation->get("file"); ?></option>
|
||||
<?php if($is_multiform){ ?>
|
||||
<option<?= ($input_line["typ"] == 9) ? " selected=\"selected\"" : " "; ?>
|
||||
value="9"><?php echo $translation->get("checkbox"); ?></option>
|
||||
<option<?= ($input_line["typ"] == 10) ? " selected=\"selected\"" : " "; ?>
|
||||
value="10"><?php echo 'Radio'; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<? input($translation->get("textkey"), "input_code", "text", $input_line["code"], 50) ?>
|
||||
<? input($translation->get("caption"), "input_name", "text", $input_line["name"], 250) ?>
|
||||
<? input($translation->get("caption_in_field"), "input_infield", "checkbox", $input_line["infield"]) ?>
|
||||
<? input($translation->get("mandatory_field"), "input_mandatory", "checkbox", $input_line["mandatory"]) ?>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_liner['active']); ?>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="main_input_option_string" >
|
||||
<div id="example1">
|
||||
<button type="button" class="r-btnAdd btnAdd btn btn-primary">Hinzufügen +</button>
|
||||
|
||||
<?php $totalOptions = 0; $queryOpt = 'SELECT * FROM contactform_line_option WHERE line_id = '.$input_line["id"];
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
$dataArray = array();
|
||||
$i = 0;
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
$totalOptions = @mysqli_num_rows($result);
|
||||
while( $rowData = mysqli_fetch_array($result)){
|
||||
|
||||
?>
|
||||
<div class="r-group moduleAppended rGroup<?=$i;?>">
|
||||
<p>
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_name'; } ?>" data-pattern-text="<?=$translation->get("optionvalues")?> +=1:"><?=$translation->get("optionvalues")?>:</label><br>
|
||||
<input type="text" value="<?=$rowData['option_string']?>" name="input_option[<?=$i;?>][name]" id="input_option_<?=$i;?>_name" class="form-control text" data-pattern-name="input_option[++][name]" data-pattern-id="input_option_++_name" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_bild'; } ?>" data-pattern-text="Bild +=1:">Bild:</label><br>
|
||||
<input type="file" name="input_option[<?=$i;?>][bild]" id="input_option_<?=$i;?>_bild" class="form-control file" data-pattern-name="input_option[++][bild]" data-pattern-id="input_option_++_bild" />
|
||||
<input value="<?= $rowData['field_img']?>" type="hidden" name="input_option[<?=$i;?>][old_bild]" id="input_option_<?=$i;?>_old_bild" class="form-control" data-pattern-name="input_option[++][old_bild]" data-pattern-id="input_option_++_old_bild" />
|
||||
<?php
|
||||
if($rowData["field_img"] != NULL && $rowData["field_img"] != ''){
|
||||
echo '<ul class="toolbar_menu">';
|
||||
echo "<div class='img_container user_img".$rowData['id']."'><img class='img-fluid' src='/userdata/collection/resize/".$rowData["field_img"]."'></div>";
|
||||
echo button("delete", $translation->get("delete").' Bild', $formname, "delete_bild(this, '{$formname}', '{$rowData['id']}')");
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<div>
|
||||
<label >Icon:</label> <br>
|
||||
<input type="hidden" name="input_option[<?=$i;?>][icon]" id="input_option_<?=$i?>_icon" value="<?=$rowData['icon'] ;?>" class="form-control text" />
|
||||
<?php if(!empty($icons)){?>
|
||||
<div class="dropdown">
|
||||
<button data-counter="<?=$i?>" class="dropbtn btnNumber<?=$i?>"><?php if($rowData['icon'] != NULL && $rowData['icon'] != '' && $rowData['icon'] != ' ') { $htmlIcon = "<span class='material-icons'>" . $rowData['icon'] . '</span>'; echo $htmlIcon;} else { ?>--- <?php } ?></button>
|
||||
<div id="myDropdown<?=$i?>" class="dropdown-content dropdown">
|
||||
<a data-counter="<?= $i;?>" data-icon=" " class="iconSelect" role="button">---</a>
|
||||
<?php foreach($icons as $icon){ ?>
|
||||
<a data-counter="<?= $i;?>" data-icon="<?= $icon?>" class="iconSelect" role="button"><span class="material-icons md-24"><?=$icon?></span></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_nextSection'; } ?>" data-pattern-text="Nächste Abschnitt +=1:">Nächste Abschnitt:</label><br>
|
||||
|
||||
<select class="select" name="input_option[<?=$i;?>][nextSection]" id="input_option_<?=$i;?>_nextSection" data-pattern-name="input_option[++][nextSection]" data-pattern-id="input_option_++_nextSection">
|
||||
<option value="0" <?php if($rowData['next_section_id'] == '0'){ echo 'selected'; } ?>>---</option>
|
||||
<?php $resultSection = @mysqli_query($GLOBALS['mysql_con'], $query); while( $row = mysqli_fetch_array($resultSection)){ ?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $rowData['next_section_id']){ echo 'selected';} ?>><?php echo $row['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_linked_field'; } ?>" data-pattern-text="Link -Textfeld? +=1:">Link -Textfeld?:</label><br>
|
||||
<input <?php if($rowData['linked_field'] == 1){ echo 'checked';} ?> type="checkbox" name="input_option[<?=$i;?>][linked_field]" id="input_option_<?=$i;?>_linked_field" class="form-control checkbox" data-pattern-name="input_option[++][linked_field]" data-pattern-id="input_option_++_linked_field" />
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="<?php if($i == 0){ echo 'input_option_0_0' ;} else { echo 'input_option_'.$i.'_linked_placeholde'; } ?>" data-pattern-text="Linklplatz Platzhalter +=1:">Linklplatz Platzhalter:</label> <br>
|
||||
<input type="text" name="input_option[<?=$i;?>][linked_placeholder]" id="input_option_<?=$i;?>_linked_placeholder" class="form-control text" data-pattern-name="input_option[++][linked_placeholder]" data-pattern-id="input_option_++_linked_placeholder" value="<?= $rowData['linked_placeholder'];?>" />
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<!-- Add a remove button for the item. If one didn't exist, it would be added to overall group -->
|
||||
<?php if($i != 0){ ?>
|
||||
<button type="button" data-counter="<?= $i;?>" class="r-btnRemove btnRemove btn btn-danger">Entfernen -</button>
|
||||
<?php } ?>
|
||||
<hr>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<?php $i ++; }
|
||||
}else{
|
||||
?>
|
||||
<div class="r-group">
|
||||
<p>
|
||||
<label for="input_option_0_0" data-pattern-text="<?=$translation->get("optionvalues")?> +=1:"><?=$translation->get("optionvalues")?>:</label><br>
|
||||
<input type="text" name="input_option[0][name]" id="input_option_0_name" class="form-control text" data-pattern-name="input_option[++][name]" data-pattern-id="input_option_++_name" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="input_option_0_0" data-pattern-text="Bild +=1:">Bild:</label><br>
|
||||
<input type="file" name="input_option[0][bild]" id="input_option_0_bild" class="form-control file" data-pattern-name="input_option[++][bild]" data-pattern-id="input_option_++_bild" />
|
||||
</p>
|
||||
<label >Icon:</label> <br>
|
||||
<input type="hidden" name="input_option[<?=$i;?>][icon]" id="input_option_<?=$i?>_icon" value="" class="form-control text" />
|
||||
<?php if(!empty($icons)){?>
|
||||
<div class="dropdown">
|
||||
<button data-counter="<?=$i?>" class="dropbtn btnNumber<?=$i?>">---</button>
|
||||
<div id="myDropdown<?=$i?>" class="dropdown-content dropdown">
|
||||
<a data-counter="<?= $i;?>" data-icon=" " class="iconSelect" role="button">---</a>
|
||||
<?php foreach($icons as $icon){ ?>
|
||||
<a data-counter="<?= $i;?>" data-icon="<?= $icon?>" class="iconSelect" role="button"><span class="material-icons md-24"><?=$icon?></span></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- <div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Icon +=1:">Icon:</label> <br>
|
||||
<input type="text" name="input_option[0][icon]" id="input_option_0_icon" class="form-control text" data-pattern-name="input_option[++][icon]" data-pattern-id="input_option_++_icon" />
|
||||
</div> -->
|
||||
<div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Nächste Abschnitt +=1:">Nächste Abschnitt:</label><br>
|
||||
|
||||
<select class="select" name="input_option[0][nextSection]" id="input_option_0_nextSection" data-pattern-name="input_option[++][nextSection]" data-pattern-id="input_option_++_nextSection">
|
||||
<option value="0" selected>---</option>
|
||||
<?php $result = @mysqli_query($GLOBALS['mysql_con'], $query); while( $row = mysqli_fetch_array($result)){ ?>
|
||||
<option
|
||||
value="<?= $row['id']?>" <?php if($row['id'] == $input_line['next_section_id']){ echo 'selected';} ?>><?php echo $row['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Link -Textfeld? +=1:">Link -Textfeld?:</label><br>
|
||||
<input type="checkbox" name="input_option[0][linked_field]" id="input_option_0_linked_field" class="form-control checkbox" data-pattern-name="input_option[++][linked_field]" data-pattern-id="input_option_++_linked_field" />
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="input_option_0_0" data-pattern-text="Linklplatz Platzhalter +=1:">Linklplatz Platzhalter:</label> <br>
|
||||
<input type="text" name="input_option[0][linked_placeholder]" id="input_option_0_linked_placeholder" class="form-control text" data-pattern-name="input_option[++][linked_placeholder]" data-pattern-id="input_option_++_linked_placeholder" />
|
||||
</div>
|
||||
<p>
|
||||
<!-- Add a remove button for the item. If one didn't exist, it would be added to overall group -->
|
||||
|
||||
<hr>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" value="<?= $totalOptions;?>" id="totalOption">
|
||||
</form>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
|
||||
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.btnAdd').click(function(){
|
||||
var counter = $('#totalOption').val();
|
||||
counter++;
|
||||
console.log('counter ist' + counter);
|
||||
$('#totalOption').val(counter);
|
||||
$('#example1').append(loadNextModule(counter));
|
||||
});
|
||||
$('.btnRemove').click(function(){
|
||||
counter = $(this).attr('data-counter');
|
||||
console.log('counter ist' + counter);
|
||||
$('.rGroup'+ counter).remove();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.dropbtn').click(function(){
|
||||
console.log('jazba');
|
||||
var counter = $(this).attr('data-counter');
|
||||
|
||||
$("#myDropdown"+counter+".dropdown-content").show();
|
||||
});
|
||||
$('.iconSelect').click(function(){
|
||||
console.log('select');
|
||||
var id = $(this).attr('data-counter');
|
||||
var icon = $(this).attr('data-icon');
|
||||
var htmlIcon = "<span class='material-icons'>" + icon + '</span>';
|
||||
$("#input_option_" + id+"_icon").val(icon);
|
||||
$('.btnNumber' + id).html(htmlIcon);
|
||||
});
|
||||
});
|
||||
function delete_bild(_el, fornmame, opt_id){
|
||||
$('#opt_id').val(opt_id);
|
||||
loadCard('delete_line_contactform_bild', true, "<?= $translation->get('delete_bild_confirm')?>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadNextModule(count = 0){
|
||||
var option = '';
|
||||
<?php $result = @mysqli_query($GLOBALS['mysql_con'], $query); while( $row = mysqli_fetch_array($result)){ ?>
|
||||
var value = '<?= $row['id']?>';
|
||||
var name = '<?= $row['name']?>';
|
||||
option = option+ '<option value="' + value + '" > ' + name + '</option>';
|
||||
<?php } ?>
|
||||
|
||||
|
||||
var html = '<p><hr></p>'+'<div class="r-group moduleAppended rGroup'+count+'">' +
|
||||
'<p>' +
|
||||
' <label for="input_option_0_'+count+'" ><?=$translation->get("optionvalues")?> </label><br>' +
|
||||
'<input type="text" name="input_option['+count+'][name]" id="input_option_'+count+'_name" class="form-control text" /> ' +
|
||||
'</p> '+
|
||||
'<p>'+
|
||||
' <label for="input_option_0_'+count+'" >Bild :</label><br>'+
|
||||
'<input type="file" name="input_option['+count+'][bild]" id="input_option_'+count+'_bild" class="form-control file" />'+
|
||||
'</p>'+
|
||||
'<div class="">'+
|
||||
'<label for="input_option_0_'+count+'">Icon:</label> <br>'+
|
||||
'<input type="text" name="input_option['+count+'][icon]" id="input_option_'+count+'_icon" class="form-control text" />' +
|
||||
' </div>' +
|
||||
'<div class="">' +
|
||||
'<label >Nächste Abschnitt :</label><br>' +
|
||||
|
||||
'<select class="select" name="input_option['+count+'][nextSection]" id="input_option_'+count+'_nextSection" >'+
|
||||
'<option value="0" selected>---</option>'+
|
||||
option +
|
||||
'</select>'+
|
||||
'</div>'+
|
||||
'<div class="">'+
|
||||
' <label >Link -Textfeld?</label><br>'+
|
||||
'<input type="checkbox" name="input_option['+count+'][linked_field]" id="input_option_'+count+'_linked_field" class="form-control checkbox" />'+
|
||||
'</div>'+
|
||||
'<div class="">'+
|
||||
'<label >Linklplatz Platzhalter:</label> <br>'+
|
||||
'<input type="text" name="input_option['+count+'][linked_placeholder]" id="input_option_'+count+'_linked_placeholder" class="form-control text" />'+
|
||||
'</div> ' +
|
||||
'<p>'+
|
||||
|
||||
'<button type="button" onclick="myFunctionDelete('+count+')" data-counter="'+count+'" class="r-btnRemove btnRemove btn btn-danger">Entfernen -</button>'+
|
||||
|
||||
' </p>'+
|
||||
'</div> ';
|
||||
|
||||
return html;
|
||||
|
||||
}
|
||||
function myFunctionDelete(counter){
|
||||
console.log('counter');
|
||||
jQuery('.rGroup'+ counter).remove();
|
||||
}
|
||||
|
||||
// // Close the dropdown if the user clicks outside of it
|
||||
window.onclick = function(event) {
|
||||
if (!event.target.matches('.dropbtn')) {
|
||||
var dropdowns = document.getElementsByClassName("dropdown-content");
|
||||
$('.dropdown-content').hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
112
module/contactform/edit_multi_contactform_cardform.inc.php
Normal file
112
module/contactform/edit_multi_contactform_cardform.inc.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contactform_card";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
|
||||
$query = 'SELECT * FROM google_recaptcha';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$grecaptcha = @mysqli_fetch_array($result);
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($grecaptcha["secretkey"] == "" && $grecaptcha["websitekey"] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_contactform["id"] == "") {
|
||||
echo $translation->get("new_contactform");
|
||||
} else {
|
||||
echo $translation->get("edit_contactform");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
// Zurueck zur uebersicht
|
||||
if (is_page_edit() || is_component_edit()) {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_contactform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_contactform', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_contactform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_contactform', true, '{$translation->get('delete_contactform_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
// Zuruecksetzen
|
||||
button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_contactform["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input type="hidden" name="is_multistep" value="1" />
|
||||
<input name="data-sitepartid" type="hidden" value="3">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_contactform["description"], 255) ?>
|
||||
<? input($translation->get("sender_name"), "input_sender_name", "text", $input_contactform["sender_name"], 255) ?>
|
||||
<? input($translation->get("sender_email"), "input_sender_email", "text", $input_contactform["sender_email"], 255) ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_contactform["all_languages"]) ?>
|
||||
<? input($translation->get("recaptcha_active"), "input_recaptcha_active", "checkbox", $input_contactform["recaptcha_active"],NULL,$reCaptchaDisabled) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("subject"), "input_subject", "text", $input_contactform["subject"], 255) ?>
|
||||
|
||||
<? input($translation->get("recipient_name"), "input_recipient_name", "text", $input_contactform["recipient_name"], 255) ?>
|
||||
<? input($translation->get("recipient_email"), "input_recipient_email", "text", $input_contactform["recipient_email"], 255) ?>
|
||||
<? input($translation->get("auto_answer"), "input_auto_answer", "textarea", $input_contactform["auto_answer"]) ?>
|
||||
<?php
|
||||
if ($input_contactform["id"] != "") {
|
||||
show_changed_on($input_contactform["id"], "contactform_header");
|
||||
show_changed_by($input_contactform["id"], "contactform_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($reCaptchaDisabled) {
|
||||
?>
|
||||
<tr>
|
||||
<td><div class=""><?= $translation->get("recaptcha_inactive") ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
if ($input_contactform['id'] != "") {
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'edit_multi_contactform_line_listform.inc.php';
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?
|
||||
$formname = "form_line_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
$collection_setup_content_id = (isset($_REQUEST["collection_setup_content_id"]) ? $_REQUEST["collection_setup_content_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_contactform_field");
|
||||
} else {
|
||||
echo $translation->get("edit_contactform_field");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?
|
||||
if (is_collection_edit()) {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_collection', true)");
|
||||
} else {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_contactform', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_contactform_level', true)"); ?>
|
||||
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform_level', true, '{$translation->get('delete_contactform_field_confirm')}')");
|
||||
}
|
||||
?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $header_id; ?>" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $collection_setup_content_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input type="hidden" name="linklist_form" value="form_field_contactform_list" />
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? input($translation->get("self_definded_class"), "class", "text", $input_line["class"], 50) ?>
|
||||
<? input($translation->get("description"), "name", "text", $input_line["name"], 250) ?>
|
||||
<? input($translation->get("sorting"), "sorting", "number", $input_line["sorting"], 250) ?>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?
|
||||
$formname = "form_line_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
$collection_setup_content_id = (isset($_REQUEST["collection_setup_content_id"]) ? $_REQUEST["collection_setup_content_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$header_id = (isset($input_line["header_id"]) ? $input_line["header_id"] : "");
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_contactform_field");
|
||||
} else {
|
||||
echo $translation->get("edit_contactform_field");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?
|
||||
if (is_collection_edit()) {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_collection', true)");
|
||||
} else {
|
||||
button("left", $translation->get("overview"), $formname, "loadCard('edit_contactform', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_contactform_section', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "jQuery('#save_and_close', jQuery('#" . $formname . "')).val(1);loadCard('save_line_contactform_section', true)"); ?>
|
||||
<?php
|
||||
if ($input_line["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform_section', true, '{$translation->get('delete_contactform_field_confirm')}')");
|
||||
}
|
||||
?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input name="input_line_id" type="hidden" value="<?= $input_line["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $header_id; ?>" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_setup_content_id" value="<?php echo $collection_setup_content_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input type="hidden" name="linklist_form" value="form_field_contactform_list" />
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="label"><label for="input_typ">Ebene:</label></div>
|
||||
<div class="input">
|
||||
<?php $query = "SELECT * FROM contactform_steps where contactform_id = ".$header_id;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
?>
|
||||
<select class="select" name="step_id" required id="input_typ">
|
||||
<?php $i = 0; while($row = mysqli_fetch_array($result)){ ?>
|
||||
<option <?php if($row['id'] == $input_line['step_id']){ echo 'selected';} ?> value="<?= $row['id'];?>"
|
||||
><?php echo ($i + 1).': '.$row['name']; ?></option>
|
||||
<?php $i ++; } ?>
|
||||
</select>
|
||||
</div>
|
||||
<? input($translation->get("self_definded_class"), "class", "text", $input_line["class"], 50) ?>
|
||||
<? input($translation->get("description"), "name", "text", $input_line["name"], 250) ?>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
332
module/contactform/edit_multi_contactform_line_listform.inc.php
Normal file
332
module/contactform/edit_multi_contactform_line_listform.inc.php
Normal file
@@ -0,0 +1,332 @@
|
||||
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_id ?>">
|
||||
<input type="hidden" id="input_line_id" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_component_id" value="<?php echo $input_component_id; ?>" />
|
||||
<input type="hidden" name="is_multiform" value="1">
|
||||
<input type="hidden" name="step_id" id="step_id">
|
||||
<input type="hidden" name="section_id" id="section_id">
|
||||
|
||||
<div class="tab">
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new_level"), $formname, "loadCard('new_line_contactform_level', true)", "", FALSE); ?>
|
||||
<?= button("new", $translation->get("new_section"), $formname, "loadCard('new_line_contactform_section', true)", "", FALSE); ?>
|
||||
<?php
|
||||
// echo button("new", $translation->get("new"), $formname, "loadCard('new_line_contactform', true)", "", FALSE);
|
||||
?>
|
||||
<?php
|
||||
// echo button("edit", $translation->get("edit"), $formname, "loadCard('edit_line_contactform')", "", FALSE);
|
||||
|
||||
|
||||
?>
|
||||
<?php
|
||||
// button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_contactform', false, '{$translation->get('delete_contactform_field_confirm')}')", "", FALSE);
|
||||
?>
|
||||
|
||||
<?php
|
||||
// button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_contactform')", "", FALSE);
|
||||
?>
|
||||
<?php
|
||||
// button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_contactform')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<?
|
||||
$query = "SELECT * FROM contactform_steps where contactform_id = ".$input_id.' ORDER BY sorting ASC';
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$i = 0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
?>
|
||||
|
||||
<button class="tablinks" onclick="openTab(event, 'tab<?=$row['id']?>')" <?php if($i == 0){ ?> id="defaultOpen" <?php } ?> ><?= ($i+1).': '.$row['name'];?></button>
|
||||
|
||||
<? $i ++; } ?>
|
||||
</div>
|
||||
|
||||
<!-- tab div -->
|
||||
|
||||
|
||||
|
||||
|
||||
<?
|
||||
$query = "SELECT * FROM contactform_steps where contactform_id = ".$input_id.' ORDER BY sorting ASC';
|
||||
|
||||
$resultStep = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$e = 1;
|
||||
while($rowStep = mysqli_fetch_array($resultStep)){
|
||||
|
||||
?>
|
||||
<div id="tab<?=$rowStep['id']?>" class="tabcontent">
|
||||
|
||||
<div class="tab two">
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("edit", "Ebene bearbeiten", $formname, "edit_level(this, '{$formname}', '{$rowStep['id']}')", "", FALSE); ?>
|
||||
|
||||
</ul>
|
||||
<?
|
||||
|
||||
|
||||
$query = "SELECT * FROM contactform_section where step_id = ".$rowStep['id'].'';
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$i = 0;
|
||||
$a = 1;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
?>
|
||||
<button class="tablinksSection" onclick="openSection(event, 'tab_section_<?=$row['id']?>')" <?php if($i == 0){ ?> id="defaultOpen2" <?php } ?> ><?= $e.'.'.$a.': '.$row['name'];?></button>
|
||||
|
||||
<? $i ++; $a++; } ?>
|
||||
</div>
|
||||
|
||||
<!-- tab div -->
|
||||
|
||||
</div>
|
||||
<?php $e++; }
|
||||
|
||||
$query = "SELECT * FROM contactform_section where contactform_id = ".$input_id.'';
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$i = 0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
<div id="tab_section_<?=$row['id']?>" class="tabcontentSection">
|
||||
|
||||
<div class="data-link text-right">
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("add_content2"), $formname, "toggleScrollerHeadline('" . $translation->get("add_content2") . "', 'new', ".$row['id'].");", "", false); ?>
|
||||
<?= button("edit", "Abschnitt bearbeiten", $formname, "edit_section(this, '{$formname}', '{$row['id']}')", "", false);?>
|
||||
<?= button("new", $translation->get("new"), $formname, "new_field(this, '{$formname}', '{$row['id']}','{$row['step_id']}')", "", false) ?>
|
||||
<?= button("up",$translation->get("go_up"),$formname,"moveup_line_multi(this, '{$formname}', '{$row['id']}')", "", false); ?>
|
||||
<?= button("down",$translation->get("go_down"),$formname,"movedown_line_multi(this, '{$formname}', '{$row['id']}')", "", false); ?>
|
||||
</ul>
|
||||
<!-- Form -->
|
||||
<form style="position:inherit;" id="form_inhalte<?= $row['id']?>" name="form_inhalte<?= $row['id']?>" method="post" class="inhalte_toggle_container<?=$row['id']?>">
|
||||
<input type="hidden" name="update_visitor_data" value="1" />
|
||||
<input type="hidden" name="sitepart_id" value="0" />
|
||||
<input name="input_section_id" type="hidden" value="<?= $row['id'] ?>">
|
||||
|
||||
<input name="input_contactform_id" type="hidden" value="<?= $input_id; ?>">
|
||||
|
||||
<div class="inhalte_toggle_container inhalte_toggle_container<?=$row['id']?>" id="inhalte_form_headline<?=$row['id']?>">
|
||||
<div id="srollerInhalteHeadline<?=$row['id']?>"><h2></h2></div>
|
||||
<div id="scroller_inhalte_form<?=$row['id'];?>">
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?
|
||||
// layout_area_select($translation->get("layout_area"));
|
||||
?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?
|
||||
// input($translation->get("active"), "input_active", "checkbox", 1);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pagecontentScroller<?=$row['id']?>" class="pagecontentScroller inhalte_toggle_container inhalte_toggle_container<?=$row['id']?>">
|
||||
<div class="scroller_inhalte">
|
||||
|
||||
<ul class="inhalte_menu">
|
||||
<?php
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
// keine shop siteparts anzeigen
|
||||
if ($sitepartData['code'] == 'slideshow' || $sitepartData['code'] == 'textcontent') {
|
||||
|
||||
|
||||
button($sitepartData['class'], $sitepartData['description'], 'form_inhalte'.$row['id'], "contentmenuClick(this, '{$sitepartData['code']}', false, $sitepartId, '{$row['id']}')");
|
||||
}
|
||||
}
|
||||
|
||||
button("inhalt_collection graybox", $translation->get("collection"), 'form_inhalte'.$row['id'], "contentmenuClick(this, 'collection_list', true, '{$row['id']}')");
|
||||
button("inhalt_collection graybox", $translation->get("collection_preview"), 'form_inhalte'.$row['id'], "contentmenuClick(this, 'collection_preview', true, '{$row['id']}')");
|
||||
// button("inhalt_collection graybox", $translation->get("group"), 'form_inhalte'.$row['id'], "contentmenuClick(this, 'group', true, '{$row['id']}')");
|
||||
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
// nur shop siteparts anzeigen
|
||||
if (!isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === FALSE || $sitepartData['code'] == 'contactform') {
|
||||
continue;
|
||||
}
|
||||
|
||||
button($sitepartData['class'] . ' graybox', $sitepartData['description'], 'form_inhalte'.$row['id'], "contentmenuClick(this, '{$sitepartData['code']}', false, $sitepartId, '{$row['id']}')");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
show_contact_link_rows($row['id']);
|
||||
?>
|
||||
</form>
|
||||
<!-- Form End -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<?php $i ++; } ?>
|
||||
|
||||
|
||||
<script>
|
||||
var clickmode = 'new';
|
||||
$('.inhalte_toggle_container').hide();
|
||||
function toggle_inhalte_scroller() {
|
||||
|
||||
if (contentscroller.css('display') == 'none') {
|
||||
contentscroller.show();
|
||||
} else {
|
||||
contentscroller.hide();
|
||||
}
|
||||
}
|
||||
function toggleScrollerHeadline( _headline, _clickAction, section_id = '' ) {
|
||||
var contentscroller = $('.inhalte_toggle_container'+section_id);
|
||||
$('#srollerInhalteHeadline'+section_id+' h2').html(_headline);
|
||||
contentscroller.show();
|
||||
|
||||
clickmode = _clickAction;
|
||||
}
|
||||
function contentmenuClick( _el, _module, _listOnly, _sitepartId, section_id = '' ) {
|
||||
var listOnly = _listOnly || false;
|
||||
var sitepartId = _sitepartId || 0;
|
||||
console.log(_el);
|
||||
setCurrentToolbarClicked(_el);
|
||||
|
||||
if (listOnly === true) {
|
||||
|
||||
loadCard('list_' + _module + '_page', true);
|
||||
return;
|
||||
}
|
||||
console.log(clickmode);
|
||||
$('input[name="sitepart_id"]', $('#form_inhalte'+section_id)).val(_sitepartId);
|
||||
|
||||
if (clickmode == 'list') {
|
||||
loadCard('list_' + _module + '_page', true);
|
||||
} else {
|
||||
_module = 'contact_'+_module;
|
||||
loadCard('new_' + _module, true);
|
||||
}
|
||||
}
|
||||
function edit_level(_el, fornmame, level_id){
|
||||
console.log('level');
|
||||
$('#step_id').val(level_id);
|
||||
loadCard('edit_line_level', true)
|
||||
}
|
||||
function edit_section(_el, fornmame, section_id){
|
||||
$('#section_id').val(section_id);
|
||||
loadCard('edit_line_section', true)
|
||||
}
|
||||
function moveup_line_multi(_el, fornmame, section_id){
|
||||
$('#section_id').val(section_id);
|
||||
input_line_id = 0;
|
||||
input_line_id = $('#form_inhalte'+section_id+" ol.linklist li>div").attr('data-inputid');
|
||||
$('#input_line_id').val(input_line_id);
|
||||
loadCard('moveup_line_multicontactform', true);
|
||||
}
|
||||
function movedown_line_multi(_el, fornmame, section_id){
|
||||
$('#section_id').val(section_id);
|
||||
input_line_id = 0;
|
||||
input_line_id = $('#form_inhalte'+section_id+" ol.linklist li>div").attr('data-inputid');
|
||||
$('#input_line_id').val(input_line_id);
|
||||
loadCard('movedown_line_multicontactform', true);
|
||||
}
|
||||
function new_field(_el, fornmame, section_id, step_id){
|
||||
$('#section_id').val(section_id);
|
||||
$('#step_id').val(step_id);
|
||||
loadCard('new_line_contactform', true)
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
// var reorderCall = null;
|
||||
|
||||
// //$('.dd').nestable({ /* config options */ });
|
||||
// $('ol.sortable').nestedSortable({
|
||||
// forcePlaceholderSize: true,
|
||||
// handle : '.dd-icon',
|
||||
// helper : 'clone',
|
||||
// items : 'li',
|
||||
// opacity : .6,
|
||||
// placeholder : 'placeholder',
|
||||
// revert : 250,
|
||||
// tabSize : 25,
|
||||
// tolerance : 'pointer',
|
||||
// toleranceElement : '> div',
|
||||
// maxLevels : 2,
|
||||
// isTree : true,
|
||||
// expandOnHover : 1000,
|
||||
// cookieIndex : 'nestedSortable_pagecontent_expanded',
|
||||
// startCollapsed : true,
|
||||
// stop : function ( event, ui ) {
|
||||
// reorder_navigation();
|
||||
// store_expanded();
|
||||
// },
|
||||
// disabled : false,
|
||||
// isAllowed : function ( placeholder, placeholderParent, originalItem ) {
|
||||
|
||||
// // gruppe in eine gruppe hinzufuegen nicht moeglich
|
||||
// if (placeholderParent !== null &&
|
||||
// jQuery(originalItem).hasClass("mjs-nestedSortable-no-nesting") === false &&
|
||||
// jQuery(placeholderParent).hasClass("mjs-nestedSortable-no-nesting") === false) {
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('.disclose').click(function () {
|
||||
// $(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
|
||||
// store_expanded();
|
||||
// });
|
||||
|
||||
// function store_expanded() {
|
||||
// var list = [];
|
||||
// $('ol.sortable').find('li.mjs-nestedSortable-expanded').each(function () {
|
||||
// list.push($(this).attr("id"));
|
||||
// });
|
||||
// $.cookie('nestedSortable_pagecontent_expanded', list.join(','));
|
||||
// }
|
||||
|
||||
// function reorder_navigation() {
|
||||
// if (reorderCall !== null) {
|
||||
// reorderCall.abort();
|
||||
// }
|
||||
|
||||
// serialized = $('ol.sortable').nestedSortable('serialize');
|
||||
// arraied = $('ol.sortable').nestedSortable('toHierarchy', {startDepthCount: 0});
|
||||
// var parameter = {
|
||||
// list: arraied
|
||||
// };
|
||||
// reorderCall = jQuery.post("?action=reorder_content_page", parameter, function ( output, status, xhr ) {
|
||||
// if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
// window.location.replace("/dc/");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
</script>
|
||||
32
module/contactform/edit_multi_contactform_listform.inc.php
Normal file
32
module/contactform/edit_multi_contactform_listform.inc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contactform_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_multi_contactform', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_contactform')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_contactform', false, '{$translation->get('delete_contactform_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_contactforms'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT contactform_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from contactform_header left join main_admin_user ON contactform_header.modified_user = main_admin_user.id where is_multistep = 1 AND (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 ORDER BY id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_contactform");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
492
module/contactform/multiform_functions.inc.php
Normal file
492
module/contactform/multiform_functions.inc.php
Normal file
@@ -0,0 +1,492 @@
|
||||
|
||||
<?php
|
||||
|
||||
// ini_set('display_errors', 1);
|
||||
// ini_set('display_startup_errors', 1);
|
||||
// error_reporting(E_ALL);
|
||||
function load_form_field($sitepart_id, $lid, $sid){
|
||||
|
||||
|
||||
$queryLine = "SELECT * FROM multi_contactform_link INNER JOIN main_layout_class on multi_contactform_link.layout_area_id = main_layout_class.id WHERE contactform_line_id = '" . $lid . "' LIMIT 1";
|
||||
$resultLine = @mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
$input_liner = array();
|
||||
$input_liner['layout_area_id'] = '';
|
||||
if (@mysqli_num_rows($resultLine) == 1) {
|
||||
$input_liner = @mysqli_fetch_array($resultLine);
|
||||
}
|
||||
|
||||
|
||||
$query = "SELECT * FROM contactform_line WHERE header_id = '" . $sitepart_id . "' AND id = ".$lid." ORDER BY sorting ASC";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($field = @mysqli_fetch_array($result)) {
|
||||
|
||||
if ($field['mandatory'] == 1) {
|
||||
$mandatory_text = " *";
|
||||
$required = "required";
|
||||
} else {
|
||||
$mandatory_text = "";
|
||||
$required = "";
|
||||
}
|
||||
$prefillValue = '';
|
||||
if (array_key_exists("input_" . $field["code"],$_POST)) {
|
||||
$prefillValue = $_POST["input_" . $field["code"]];
|
||||
}
|
||||
if ($field["infield"] == "1") {
|
||||
$placeholder = "placeholder='" . $field['name'] . $mandatory_text . "'";
|
||||
$label = "";
|
||||
} else {
|
||||
$placeholder = "";
|
||||
$label = $field['name'] . $mandatory_text;
|
||||
}
|
||||
|
||||
if (isset($_GET["action" . $sitepart_id]) && $_GET["action" . $sitepart_id] == "send" && $field["mandatory"] == 1 && trim($_POST["input_" . $field["code"]]) == "") {
|
||||
$errorclass = "error";
|
||||
} else {
|
||||
$errorclass = "";
|
||||
}
|
||||
|
||||
if (isset($_GET["action" . $sitepart_id]) && $_GET["action" . $sitepart_id] == "send" && $field["mandatory"] == 1 && in_array($field['id'], $field_errors)) {
|
||||
$errorclass = "error";
|
||||
} else {
|
||||
$errorclass = "";
|
||||
}
|
||||
if($field["field_img"] != NULL && $field["field_img"] != ''){
|
||||
echo "<div class='img_container intranet_user_image'><img class='img-fluid' src='/userdata/collection/resize/".$field["field_img"]."'></div>";
|
||||
}
|
||||
if (!empty($input_liner)) {
|
||||
echo "<div class=\"" . $input_liner['code'] . " ".$input_liner['layout_class_defined']." " . $sitepart['layout_class_defined'] . "\">";
|
||||
}
|
||||
$queryOpt = 'SELECT * FROM contactform_line_option WHERE line_id = '.$field['id'];
|
||||
$resultOpt = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
|
||||
switch ($field["typ"]) {
|
||||
case 1:?>
|
||||
<div class="form-group">
|
||||
<label for="input_<?=$field["code"];?>"><?=$label?></label>
|
||||
<input data-section="<?=$field['section_id']?>" data-next-section="<?=$field['next_section_id']?>" type="text" class="form-control text <?= $errorclass ?>" <?= $required ?>
|
||||
name="input_<?= $field['code'] ?>"
|
||||
id="input_<?= $field["code"]; ?>" <?= $placeholder; ?>
|
||||
value="<?= htmlspecialchars($_POST["input_" . $field["code"]], ENT_QUOTES, 'UTF-8') ?>">
|
||||
</div>
|
||||
<?
|
||||
break;
|
||||
case 2:?>
|
||||
<div class="form-group">
|
||||
<label for="input_<?=$field["code"];?>"><?=$label?></label>
|
||||
<textarea class="form-control textarea <?= $errorclass ?>" <?= $required ?>
|
||||
name="input_<?= $field['code'] ?>"
|
||||
id="input_<?= $field["code"]; ?>" <?= $placeholder; ?>
|
||||
value="<?= htmlspecialchars(str_replace( '\r\n', PHP_EOL, $_POST["input_" . $field["code"]]), ENT_QUOTES, 'UTF-8') ?>"></textarea>
|
||||
</div>
|
||||
<?
|
||||
break;
|
||||
case 3:
|
||||
$checked_text = ($prefillValue) ? " checked=\"checked\"" : "";
|
||||
?>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input data-section="<?=$field['section_id']?>" data-next-section="<?=$field['next_section_id']?>" class="form-check-input input_selection" <?= $checked_text ?> <?= $required ?>
|
||||
name="input_<?= $field['code'] ?>" id="input_<?= $field["code"]; ?>"
|
||||
type="checkbox" value="<?= $field["code"]; ?>">
|
||||
<?=$field['name'] . $mandatory_text;?>
|
||||
</label>
|
||||
</div>
|
||||
<?
|
||||
break;
|
||||
case 4:?>
|
||||
|
||||
<div class="form-group">
|
||||
<h2 class="select-headline multi_input_heading" for="input_<?=$field["code"];?>"><?=$label?></h2>
|
||||
<div class="input select_body <?= $errorclass ?>">
|
||||
<select class="select input_select" data-section="<?=$field['section_id']?>" data-next-section="<?=$field['next_section_id']?>" <?= $required ?> name="input_<?= $field['code'] ?>"
|
||||
id="input_<?= $field['code']; ?>">
|
||||
<option selected>------</option>
|
||||
<?
|
||||
// $options = explode(";", $field["option_string"]);
|
||||
while ($option = @mysqli_fetch_array($resultOpt)) {
|
||||
$className = 'col-md-12';
|
||||
$linked = 0;
|
||||
if($option['linked_field']){
|
||||
$linked = 1;
|
||||
}
|
||||
$selected_text = ($prefillValue == $option['option_string']) ? " selected=\"selected\"" : "";
|
||||
echo "<option data-opt='".$option['id']."' data-linked='".$linked."' data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' data-field='".$field['id']."' data-id='".$field['id']."' " . $selected_text . " value=\"" . $option['option_string'] . "\">" . $option['option_string'] . "</option>";
|
||||
// if($option['linked_field']){
|
||||
// echo "<div class=\"input_collection_link_input_linked ".$className." iconfield-no-border \">";
|
||||
// echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' readonly class='input_selection_text inputLinked_".$option['id']."' data-id='".$key."' id=\"input_collection_link_field_" . $field['id'] . "_value_" . $value . "\" placeholder= '".$option['linked_placeholder']."' type=\"text\" name=\"inputlinked_" . $field['id'] . "_".$option['id']."\" value='' >";
|
||||
// echo '</div>';
|
||||
// }
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
$queryOpt = 'SELECT * FROM contactform_line_option WHERE line_id = '.$field['id'];
|
||||
$resultOpt = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
|
||||
while ($option = @mysqli_fetch_array($resultOpt)) {
|
||||
if($option['linked_field']){
|
||||
echo '<div class="noDisplay input_selected_linked select'.$option['id'].'">';
|
||||
echo "<div class=\"input_collection_link_input_linked ".$className." iconfield-no-border \">";
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' readonly class='input_selection_text inputLinked_".$option['id']."' data-id='".$key."' id=\"input_collection_link_field_" . $field['id'] . "_value_" . $value . "\" placeholder= '".$option['linked_placeholder']."' type=\"text\" name=\"inputlinked_" . $field['id'] . "_".$option['id']."\" value='' >";
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
break;
|
||||
case 5:
|
||||
echo "<h2>" . $field["name"] . "</h2>";
|
||||
break;
|
||||
case 6:
|
||||
echo "<br />";
|
||||
break;
|
||||
case 7:
|
||||
if ($_GET["registration"] == 1 && (int)$_GET["collection_id"] > 0) {
|
||||
$query = "SELECT * FROM main_collection WHERE id = '" . $_GET["collection_id"]."'";
|
||||
$newsresult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($newsresult) == 1) {
|
||||
$news = @mysqli_fetch_array($newsresult);
|
||||
echo "<h3>" . $news["description"] . "</h3>";
|
||||
echo "<input name=\"input_" . $field["code"] . "\" type=\"hidden\" id=\"input_" . $field["code"] . "\" value=\"" . $news["description"] . "\" /></td></tr>\n";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:?>
|
||||
<div class="form-group">
|
||||
<label for="input_<?=$field["code"];?>"><?=$label?></label>
|
||||
<input class="form-control file <?= $errorclass ?>" <?= $required ?>
|
||||
name="input_<?= $field['code'] ?>" id="input_<?= $field["code"]; ?>"
|
||||
type="file"/>
|
||||
</div>
|
||||
<?
|
||||
break;
|
||||
case 9: // Checkbox
|
||||
|
||||
|
||||
// echo "<div class='form-group'> <label id=\"input_collection_link_" . $field['id'] . "\" class=\"checkbox\" >".$field['name'];
|
||||
// //Get all option_values
|
||||
// $options = explode(";", $field["option_string"]);
|
||||
// //Values als Integer
|
||||
// $value = 1;
|
||||
// foreach ($options as $option) {
|
||||
|
||||
// echo "<div class=\"input_collection_link_checkbox\">";
|
||||
// echo "<input class='input_selection' data-section='".$field['section_id']."' data-next-section='".$field['next_section_id']."' data-id='".$field['id']."' id=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\" type=\"checkbox\" name=\"input_" . $field['id'] . "[]\" value=val_\"$option\" >";
|
||||
// echo "<label " . "for=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\">" . $option . "</label>";
|
||||
// echo "</div>";
|
||||
// $value++;
|
||||
// }
|
||||
// echo "</label></div>";
|
||||
// checkbox start
|
||||
echo "<div class='form-group'> <h2 id=\"input_collection_link_" . $field['id'] . "\" class=\"checkbox multi_input_heading classLabel\" >".$field['name'].'</h2>';
|
||||
//Get all option_values
|
||||
|
||||
//Values als Integer
|
||||
$value = 1;
|
||||
while ($option = @mysqli_fetch_array($resultOpt)) {
|
||||
$iconClass = '';
|
||||
if($option['icon'] != NULL && $option['icon'] != ''){
|
||||
$iconClass = ' <span class="material-icons">'.$option['icon'].'</span> ';
|
||||
}
|
||||
$imgClass = '';
|
||||
if($option['field_img'] != NULL && $option['field_img'] != '' && $option['field_img'] != ' '){
|
||||
$imgClass = "<div class='img_container img-option'><img class='img-fluid' src='/userdata/collection/resize/".$option["field_img"]."'></div>";
|
||||
}
|
||||
|
||||
if(!$option['linked_field']){
|
||||
echo "<div class=\"input_collection_link_checkbox col-md-4 iconfield \">";
|
||||
echo "<label " . "for=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\">".' '.$imgClass.$iconClass .'<br>'. $option['option_string'] ;
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' class='input_selection_checkbox' data-field='".$field['id']."' data-id='".$field['id']."' id=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\" type=\"checkbox\" name=\"input_" . $field['id'] . "[]\" value='".$option['option_string']."' >";
|
||||
|
||||
|
||||
echo "</label>";
|
||||
echo "</div>";
|
||||
} else{
|
||||
$className = 'col-md-12';
|
||||
if($option['linked_field']){
|
||||
$className = 'col-md-6';
|
||||
}
|
||||
echo '<div class="row">';
|
||||
echo "<div class=\"input_collection_link_checkbox ".$className." iconfield-no-border \">";
|
||||
echo "<label " . "for=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\">".' '.$imgClass.$iconClass .'<br>'. $option['option_string'] ;
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' class='input_selection_checkbox input_check_linked' data-id='".$field['id']."' data-opt='".$option['id']."' id=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\" type=\"checkbox\" name=\"input_" . $field['id'] . "[]\" value='".$option['option_string']."' >";
|
||||
|
||||
|
||||
echo "</label>";
|
||||
echo "</div>";
|
||||
if($option['linked_field']){
|
||||
echo "<div class=\"input_collection_link_input_linked ".$className." iconfield-no-border \">";
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' readonly class='input_selection_text inputLinked_".$option['id']."' data-id='".$key."' id=\"input_collection_link_field_" . $field['id'] . "_value_" . $value . "\" placeholder= '".$option['linked_placeholder']."' type=\"text\" name=\"inputlinked_" . $field['id'] . "_".$option['id']."\" value='' >";
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<?php }
|
||||
echo '</div>';
|
||||
}
|
||||
$value++;
|
||||
}
|
||||
echo "</div>";
|
||||
// checkbox end
|
||||
// break;
|
||||
case 10: // Radio
|
||||
|
||||
|
||||
echo "<div class='form-group'> <h2 id=\"input_collection_link_" . $field['id'] . "\" class=\"checkbox multi_input_heading classLabel\" >".$field['name'].'</h2>';
|
||||
//Get all option_values
|
||||
|
||||
//Values als Integer
|
||||
$value = 1;
|
||||
while ($option = @mysqli_fetch_array($resultOpt)) {
|
||||
$iconClass = '';
|
||||
if($option['icon'] != NULL && $option['icon'] != ''){
|
||||
$iconClass = ' <span class="material-icons">'.$option['icon'].'</span> ';
|
||||
}
|
||||
$imgClass = '';
|
||||
if($option['field_img'] != NULL && $option['field_img'] != '' && $option['field_img'] != ' '){
|
||||
$imgClass = "<div class='img_container img-option'><img class='img-fluid' src='/userdata/collection/resize/".$option["field_img"]."'></div>";
|
||||
}
|
||||
|
||||
if(!$option['linked_field']){
|
||||
echo "<div class=\"input_collection_link_checkbox col-md-4 iconfield \">";
|
||||
echo "<label " . "for=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\">".' '.$imgClass.$iconClass .'<br>'. $option['option_string'] ;
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' class='input_selection_radio' data-field='".$field['id']."' data-id='".$field['id']."' id=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\" type=\"radio\" name=\"input_" . $field['id'] . "\" value='".$option['option_string']."' >";
|
||||
|
||||
|
||||
echo "</label>";
|
||||
echo "</div>";
|
||||
} else{
|
||||
$className = 'col-md-12';
|
||||
if($option['linked_field']){
|
||||
$className = 'col-md-6';
|
||||
}
|
||||
echo '<div class="row">';
|
||||
echo "<div class=\"input_collection_link_checkbox ".$className." iconfield-no-border \">";
|
||||
echo "<label " . "for=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\">".' '.$imgClass.$iconClass .'<br>'. $option['option_string'] ;
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' class='input_selection_radio input_radio_linked' data-id='".$field['id']."' data-opt='".$option['id']."' id=\"input_collection_link_" . $field['id'] . "_value_" . $value . "\" type=\"radio\" name=\"input_" . $field['id'] . "\" value='".$option['option_string']."' >";
|
||||
|
||||
|
||||
echo "</label>";
|
||||
echo "</div>";
|
||||
if($option['linked_field']){
|
||||
echo "<div class=\"input_collection_link_input_linked ".$className." iconfield-no-border \">";
|
||||
echo "<input data-form='". $sitepart_id."' data-section='".$field['section_id']."' data-next-section='".$option['next_section_id']."' readonly class='input_selection_text inputLinked_".$option['id']."' data-id='".$key."' id=\"input_collection_link_field_" . $field['id'] . "_value_" . $value . "\" placeholder= '".$option['linked_placeholder']."' type=\"text\" name=\"inputlinked_" . $field['id'] . "_".$option['id']."\" value='' >";
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<?php }
|
||||
echo '</div>';
|
||||
}
|
||||
$value++;
|
||||
}
|
||||
echo "</div>";
|
||||
// break;
|
||||
}
|
||||
$resultOpt = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
$is_end = 1;
|
||||
|
||||
while ($option = @mysqli_fetch_array($resultOpt)) {
|
||||
if($option['next_section_id'] != NULL && $option['next_section_id'] != 0 ){
|
||||
$is_end = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="hiddenDiv div<?=$field['id']?>">
|
||||
<input type="hidden" name="next_section_<?=$sid;?>" id="next_section_<?=$sid;?>" value="<?= $is_end;?>">
|
||||
</div>
|
||||
|
||||
<?php if (!empty($input_liner)) {
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// daten sammeln
|
||||
$query = "SELECT * FROM contactform_header WHERE id = '" . $sitepart_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$contactform_header = @mysqli_fetch_array($result);
|
||||
|
||||
if ($contactform_header['recaptcha_active'] == 1) {
|
||||
$websiteKey = $reCaptcha['websitekey'];
|
||||
$reCaptcha = TRUE;
|
||||
} else {
|
||||
$reCaptcha = FALSE;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div style="display:none;">
|
||||
<input type="text" name="input_captcha1" id="input_captcha1" value="" />
|
||||
<input type="text" name="input_captcha2" id="input_captcha2" value="<?= time() ?>" />
|
||||
</div>
|
||||
<? if ($reCaptcha == TRUE) { ?>
|
||||
|
||||
<div class="recaptcha-class" style="float: left; padding-top: 0px;width:100%;">
|
||||
<div class="g-recaptcha" data-sitekey="<? echo $websiteKey; ?>"></div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<? }
|
||||
}
|
||||
function show_sitepart_content_contact($sitepart_id, $sitepart_header_id, $link_id = NULL, &$IOCContainer = null)
|
||||
{
|
||||
require_once CMS_PATH . "common/classes/Siteparts.php";
|
||||
$allSiteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$sitepartData = $allSiteparts[$sitepart_id];
|
||||
// container um das sitepart, daurch ansprechbar mit javascript
|
||||
|
||||
$GLOBALS["navigation"]['sitepart_header_id'] = $sitepart_header_id;
|
||||
|
||||
require_once(realpath(MODULE_PATH . $sitepartData['folder']) . DIRECTORY_SEPARATOR . $sitepartData['code'] . ".php");
|
||||
$function = '';
|
||||
$refFunc = '';
|
||||
try {
|
||||
|
||||
//If the exception is thrown, this text will not be shown
|
||||
$function = $sitepartData['code'].'_show';
|
||||
$refFunc = new ReflectionFunction($function);
|
||||
}
|
||||
|
||||
//catch exception
|
||||
catch(Exception $e) {
|
||||
echo 'ErrorMsg: ' .$e->getMessage();exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$noOfParams = $refFunc->getNumberOfParameters();
|
||||
$noOfReqParams = $refFunc->getNumberOfRequiredParameters();
|
||||
if ($sitepart_header_id > 0) {
|
||||
if ($noOfParams === 1) {
|
||||
$function($sitepart_header_id);
|
||||
} elseif ($noOfParams > 1) {
|
||||
$function($sitepart_header_id, $IOCContainer);
|
||||
}
|
||||
} elseif ($noOfReqParams === 0) {
|
||||
if ($noOfParams > 0 && isset($IOCContainer)) {
|
||||
$function($IOCContainer);
|
||||
} else {
|
||||
$function();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Layout Area integration - 10. August 2009 MH
|
||||
function get_contentContact($cid, $sectionID)
|
||||
{
|
||||
|
||||
require_once CMS_PATH . "common/classes/Siteparts.php";
|
||||
$allSiteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
|
||||
|
||||
if ($cid <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$query = "SELECT * FROM multi_contactform_link WHERE contact_form_id = " . (int)$cid . " AND main_section_link_parent_id = 0 AND main_section_id = ".$sectionID." AND active = 1 ORDER BY sorting ASC";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($sitepart = @mysqli_fetch_array($result)) {
|
||||
if($sitepart['contactform_line_id'] > 0 && $sitepart['contactform_line_id'] != NULL){
|
||||
load_form_field($cid,$sitepart['contactform_line_id'], $sectionID );
|
||||
continue;
|
||||
}
|
||||
if ($sitepart['main_section_group'] == 1) {
|
||||
show_group_content($sitepart);
|
||||
continue;
|
||||
}
|
||||
$queryLine = "SELECT * FROM multi_contactform_link INNER JOIN main_layout_class on multi_contactform_link.layout_area_id = main_layout_class.id WHERE multi_contactform_link.id = '" . $sitepart['id'] . "' LIMIT 1";
|
||||
$resultLine = @mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
$input_liner = array();
|
||||
$input_liner['layout_area_id'] = '';
|
||||
if (@mysqli_num_rows($resultLine) == 1) {
|
||||
$input_liner = @mysqli_fetch_array($resultLine);
|
||||
}
|
||||
// echo '<pre> data'; print_r($sitepart);echo '</pre><br>';
|
||||
// layout klassen wrapper anzeigen
|
||||
|
||||
|
||||
if ($sitepart['main_sitepart_id'] > 0) {
|
||||
if (!empty($input_liner)) {
|
||||
echo "<div class=\"" . $input_liner['code'] . " ".$input_liner['layout_class_defined']." " . $sitepart['layout_class_defined'] . "\">";
|
||||
}
|
||||
show_sitepart_content_contact($sitepart['main_sitepart_id'], $sitepart['main_sitepart_header_id'], $sitepart['id'], $IOCContainer);
|
||||
if (!empty($input_liner)) {
|
||||
echo "</div>";
|
||||
}
|
||||
} elseif ($sitepart['main_collection_setup_id'] > 0) {
|
||||
if (!empty($input_liner)) {
|
||||
echo "<div class=\"" . $input_liner['code'] . " ".$input_liner['layout_class_defined']." " . $sitepart['layout_class_defined'] . "\">";
|
||||
}
|
||||
|
||||
show_collection_setup_content($sitepart);
|
||||
if (!empty($input_liner)) {
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// layout klassenwrapper beenden
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form class="form-label-left regForm regForm<?=$sitepart_id; ?>" id="contactformular_<?= $sitepart_id ?>" method="post" action="<?= ml($tempSitepart, "action", "send") ?>" enctype="multipart/form-data">
|
||||
<?
|
||||
$querySteps = "SELECT cfst.id as stepID, cfst.name as stepName, cfst.class as stepClass , cfs.id as sectionID, cfs.name, cfs.class FROM contactform_steps as cfst INNER JOIN contactform_section as cfs on cfst.id = cfs.step_id WHERE cfst.contactform_id = ".$sitepart_id." ORDER BY cfst.sorting ASC, cfs.id ASC";
|
||||
$resultStep = @mysqli_query($GLOBALS['mysql_con'], $querySteps);
|
||||
$current = 0;
|
||||
while($rowStep = @mysqli_fetch_array($resultStep)){ ?>
|
||||
<div class="tab dataNumber<?= $current; ?> abschnitt_<?= $rowStep['sectionID']?> <?=$rowStep['class']?>">
|
||||
<?php
|
||||
get_contentContact($sitepart_id, $rowStep['sectionID']);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<? $current ++;} ?>
|
||||
|
||||
|
||||
<div class="contact-button" id="submit_button">
|
||||
<!-- <input type="submit" name="button" class="button" id="button" value="<?= $translation->get('send') ?>" />
|
||||
-->
|
||||
<div style="overflow:auto;">
|
||||
<div style="float:right;">
|
||||
<button type="button" class="prevBtn" data-form="<?= $sitepart_id;?>" data-id="-1" id="prevBtn" >Bisherige</button>
|
||||
<button type="button" class="nextBtn" data-ende="0" data-form="<?= $sitepart_id;?>" id="nextBtn" >Nächste</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
console.log('ready');
|
||||
jQuery('body').addClass('multiFormPage');
|
||||
});
|
||||
</script>
|
||||
48
module/contactform/page_contactform_listform.inc.php
Normal file
48
module/contactform/page_contactform_listform.inc.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contactform_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_contactforms"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_page"), $formname, "loadCard('assoc_line_page')"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="3">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$is_multistep = 0;
|
||||
if(isset($_GET['is_multistep_form'])){
|
||||
$is_multistep = $_GET['is_multistep_form'];
|
||||
}
|
||||
$query = "SELECT contactform_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from contactform_header left join main_admin_user ON contactform_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) and collection_header = 0 AND is_multistep = " .$is_multistep." order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_page");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
1071
module/contactform/show_contactform.inc.php
Normal file
1071
module/contactform/show_contactform.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
43
module/contactform/show_contactform_ajax.inc.php
Normal file
43
module/contactform/show_contactform_ajax.inc.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
//Wird benötigt um Enviroment Variable zu holen
|
||||
session_start();
|
||||
$currDir = __DIR__;
|
||||
$rootDir = dirname(dirname($currDir));
|
||||
$mysydeDir = $rootDir . '/mysyde';
|
||||
|
||||
require_once($rootDir . '/vendor/autoload.php');
|
||||
require_once($rootDir . "/mysyde/frontend/frontend_functions.inc.php");
|
||||
|
||||
// $baseDir = rtrim(dirname(dirname(__DIR__,2),'/'));
|
||||
|
||||
$envDir = $rootDir . '/config';
|
||||
$envFilePath = $envDir . '/.env';
|
||||
if (is_dir($envDir) && file_exists($envFilePath) && is_file($envFilePath) && is_readable($envFilePath)) {
|
||||
$dotenv = new \Dotenv\Dotenv($envDir);
|
||||
$dotenv->load();
|
||||
}
|
||||
$common = $mysydeDir ."/common/common_functions.inc.php";
|
||||
require_once($common);
|
||||
|
||||
$connEnv = (local_environment()) ? $mysydeDir."/dc.config.php" : $mysydeDir."/dc-server.config.php";
|
||||
|
||||
require_once($connEnv);
|
||||
|
||||
db_connect();
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$mandant_id = $_POST['mandant_id'];
|
||||
}
|
||||
selectUser($mandant_id);
|
||||
|
||||
function selectUser($mandant_id){
|
||||
$query = "SELECT * FROM main_contact WHERE master_mandant_id = " . $mandant_id . " ORDER BY name ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
?>
|
||||
<option value="">---</option>
|
||||
<?
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
echo "<option value=\"" . $row['id'] . "\">" . $row['name'] . "</option>";
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user