Refactor contact management functions and remove phpinfo.php

- Updated formatting and structure of functions in edit_contact.inc.php for better readability and consistency.
- Added comments to clarify the purpose of certain code sections, especially regarding mandant handling.
- Removed the deprecated phpinfo.php file to clean up the codebase.
This commit is contained in:
2026-05-11 08:54:44 +02:00
parent 8749bc7994
commit 52ca9249c3
64 changed files with 13445 additions and 3562 deletions

View File

@@ -278,6 +278,7 @@ function save_collection($firstsave = FALSE)
$input_registration = ($_POST["input_registration"] == "on") ? 1 : 0;
$input_active = ($_POST["input_active"] == "on") ? 1 : 0;
$input_readable = ($_POST["input_readable"] == "on") ? 1 : 0;
$input_is_archived = (isset($_POST["input_is_archived"]) && $_POST["input_is_archived"] == "on") ? 1 : 0;
$registration_contactform_id = 0;
if ($input_registration == 1) {
@@ -312,7 +313,8 @@ function save_collection($firstsave = FALSE)
modified_date = " . time() . ",
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
active = 1,
readable = " . $input_readable . "
readable = " . $input_readable . ",
is_archived = " . $input_is_archived . "
WHERE id = '" . $_REQUEST["input_collection_id"] . "'
LIMIT 1";
$inserted = FALSE;
@@ -326,7 +328,7 @@ function save_collection($firstsave = FALSE)
$sorting = ($sorting["newsorting"] <> "") ? $sorting = $sorting["newsorting"] : $sorting = 1;
$insertquery = "INSERT INTO main_collection
(main_language_id, main_collection_setup_id, description, registration, registration_contactform_id, creation_date, modified_date, modified_user, validity_from, validity_to, sorting)
(main_language_id, main_collection_setup_id, description, registration, registration_contactform_id, creation_date, modified_date, modified_user, validity_from, validity_to, sorting, is_archived)
VALUES (
" . $GLOBALS["language"]['id'] . ",
'" . $collection_setup_id . "',
@@ -338,7 +340,8 @@ function save_collection($firstsave = FALSE)
" . (int)$GLOBALS["admin_user"]['id'] . ",
" . $input_validity_from . ",
" . $input_validity_to . ",
" . $sorting . "
" . $sorting . ",
" . $input_is_archived . "
)";
$inserted = TRUE;
}
@@ -1343,7 +1346,7 @@ function create_collection_input_field($fieldSetup, $collectionData) {
}else{
echo '<ul class="toolbar_menu">';
input("", "input_collection_link_".$fieldSetup['id'], "hidden", $data);
button("new", $translation->get("new"), $formname, "openGallery('input_collection_link_".$fieldSetup['id']."', 'collection_image_".$fieldSetup['id']."')", "", FALSE);
button("new", $translation->get("new"), $formname, "openGallery('input_collection_link_".$fieldSetup['id']."', 'collection_image_".$fieldSetup['id']."','collection', 'single')", "", FALSE);
button("delete", $translation->get("delete"), $formname, "delete_collection_image('input_collection_link_".$fieldSetup['id']."', 'collection_image_".$fieldSetup['id']."')", "", FALSE);
echo '</ul>';
$video_erweiterungen = array('mp4', 'avi', 'mkv', 'mov', 'wmv');
@@ -1937,6 +1940,56 @@ function copy_collection($addCopySuffix = TRUE) {
@mysqli_query($GLOBALS['mysql_con'], $query);
}
}
// Filegallery
if($lineRow['main_sitepart_id'] == 5) {
$query = "SELECT * FROM filegallery_header WHERE id = " . $lineRow['main_sitepart_header_id'];
$filegalleryHeader = @mysqli_query($GLOBALS['mysql_con'], $query);
if(@mysqli_num_rows($filegalleryHeader) > 0) {
if (!defined('PATH_ORIGINAL_FILEGALLERY')) {
require_once(MODULE_PATH . "filegallery/filegallery.config.inc.php");
}
$contentColumns = get_column_names_to_copy("filegallery_header");
$query = "INSERT INTO filegallery_header
SELECT " . join(", ", $contentColumns) . " FROM filegallery_header
WHERE id = " . $lineRow['main_sitepart_header_id'];
@mysqli_query($GLOBALS['mysql_con'], $query);
$newContentID = mysqli_insert_id($GLOBALS['mysql_con']);
insert_copy_link($lineRow['main_sitepart_header_id'], $newContentID, "filegallery_header");
$query = "UPDATE main_collection_link SET main_sitepart_header_id = '" . $newContentID . "' WHERE id = " . $newLineId;
@mysqli_query($GLOBALS['mysql_con'], $query);
$lineColumns = get_column_names_to_copy("filegallery_line");
$query = "SELECT * FROM filegallery_line WHERE header_id = " . $lineRow['main_sitepart_header_id'];
$filegalleryLineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
while($filegalleryLineRow = @mysqli_fetch_array($filegalleryLineResult)) {
$finalLineColumns = $lineColumns;
$finalLineColumns['header_id'] = $newContentID;
$query = "INSERT INTO filegallery_line
SELECT " . join(", ", $finalLineColumns) . " FROM filegallery_line
WHERE id = " . $filegalleryLineRow['id'];
@mysqli_query($GLOBALS['mysql_con'], $query);
$newFilegalleryLineId = mysqli_insert_id($GLOBALS['mysql_con']);
insert_copy_link($filegalleryLineRow['id'], $newFilegalleryLineId, "filegallery_line");
if (!empty($filegalleryLineRow['filename'])) {
$filenameParts = explode('_', $filegalleryLineRow['filename'], 2);
$sourceFilename = $filegalleryLineRow['filename'];
$baseFilename = (count($filenameParts) === 2) ? $filenameParts[1] : $sourceFilename;
$targetFilename = $newFilegalleryLineId . "_" . $baseFilename;
if (file_exists(PATH_ORIGINAL_FILEGALLERY . $sourceFilename)) {
copy(PATH_ORIGINAL_FILEGALLERY . $sourceFilename, PATH_ORIGINAL_FILEGALLERY . $targetFilename);
$query = "UPDATE filegallery_line SET filename = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $targetFilename) . "' WHERE id = " . $newFilegalleryLineId;
@mysqli_query($GLOBALS['mysql_con'], $query);
}
}
}
}
}
// Youtube

View File

@@ -59,7 +59,15 @@ $sorting_values = array(
</script>
<script type="text/javascript">
function showCollectionSavingLoader() {
jQuery('#overlay').show();
jQuery('#overlayWrapper').show();
jQuery('#overlayLoader').show();
}
function saveCollectionMasked(_close){
showCollectionSavingLoader();
var aFormData = new FormData();
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
@@ -85,6 +93,8 @@ $sorting_values = array(
function saveCollection(_close) {
showCollectionSavingLoader();
var aFormData = new FormData();
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
@@ -195,9 +205,12 @@ create_contactform_select($contactforms, $translation->get("registration_form"),
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);
}
if ($input_collection["id"] != "") {
input("Archiv", "input_is_archived", "checkbox", (int)$input_collection["is_archived"] === 1 ? "on" : "");
}
// Zuruecksetzen
?>
</ul>
</li>

View File

@@ -92,8 +92,16 @@ while ($content = @mysqli_fetch_array($result)) {
$( "#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 showCollectionSavingLoader() {
jQuery('#overlay').show();
jQuery('#overlayWrapper').show();
jQuery('#overlayLoader').show();
}
function saveCollection(_close) {
showCollectionSavingLoader();
var aFormData = new FormData();
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen