remove folder location vars as no longer needed as files and documents have been merged

This commit is contained in:
johnnyq 2025-11-28 15:26:26 -05:00
parent 7737dbc65d
commit 540512a156
4 changed files with 20 additions and 26 deletions

View File

@ -51,10 +51,10 @@ $page_title = $row['document_name'];
<ol class="breadcrumb d-print-none"> <ol class="breadcrumb d-print-none">
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a> <a href="client_overview.php?client_id=<?= $client_id ?>"><?= $client_name ?></a>
</li> </li>
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="documents.php?client_id=<?php echo $client_id; ?>">Documents</a> <a href="files.php?client_id=<?= $client_id ?>">Files</a>
</li> </li>
<?php <?php
// Build the full folder path // Build the full folder path
@ -84,7 +84,7 @@ $page_title = $row['document_name'];
$bread_crumb_folder_name = $folder['folder_name']; // Sanitized before put in array $bread_crumb_folder_name = $folder['folder_name']; // Sanitized before put in array
?> ?>
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="documents.php?client_id=<?php echo $client_id; ?>&folder_id=<?php echo $bread_crumb_folder_id; ?>"> <a href="files.php?client_id=<?php echo $client_id; ?>&folder_id=<?php echo $bread_crumb_folder_id; ?>">
<i class="fas fa-fw fa-folder-open mr-2"></i><?php echo $bread_crumb_folder_name; ?> <i class="fas fa-fw fa-folder-open mr-2"></i><?php echo $bread_crumb_folder_name; ?>
</a> </a>
</li> </li>

View File

@ -45,7 +45,7 @@ ob_start();
<select class="form-control select2" name="folder"> <select class="form-control select2" name="folder">
<option value="0">/</option> <option value="0">/</option>
<?php <?php
$sql_folders_select = mysqli_query($mysqli, "SELECT * FROM folders WHERE folder_location = 0 AND folder_client_id = $client_id ORDER BY folder_name ASC"); $sql_folders_select = mysqli_query($mysqli, "SELECT * FROM folders WHERE folder_client_id = $client_id ORDER BY folder_name ASC");
while ($row = mysqli_fetch_array($sql_folders_select)) { while ($row = mysqli_fetch_array($sql_folders_select)) {
$folder_id_select = intval($row['folder_id']); $folder_id_select = intval($row['folder_id']);
$folder_name_select = nullable_htmlentities($row['folder_name']); $folder_name_select = nullable_htmlentities($row['folder_name']);

View File

@ -3,7 +3,6 @@
require_once '../../../includes/modal_header.php'; require_once '../../../includes/modal_header.php';
$client_id = intval($_GET['client_id'] ?? 0); $client_id = intval($_GET['client_id'] ?? 0);
$folder_location = intval($_GET['folder_location'] ?? 0);
$current_folder_id = intval($_GET['current_folder_id'] ?? 0); $current_folder_id = intval($_GET['current_folder_id'] ?? 0);
$folder_name = nullable_htmlentities(getFieldByID('folders', $current_folder_id, 'folder_name') ?? '/'); $folder_name = nullable_htmlentities(getFieldByID('folders', $current_folder_id, 'folder_name') ?? '/');
@ -18,7 +17,6 @@ ob_start();
</div> </div>
<form action="post.php" method="post" autocomplete="off"> <form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="client_id" value="<?= $client_id ?>"> <input type="hidden" name="client_id" value="<?= $client_id ?>">
<input type="hidden" name="folder_location" value="<?= $folder_location ?>">
<input type="hidden" name="parent_folder" value="<?= $current_folder_id ?>"> <input type="hidden" name="parent_folder" value="<?= $current_folder_id ?>">
<div class="modal-body"> <div class="modal-body">

View File

@ -1568,14 +1568,10 @@ function getFieldById($table, $id, $field, $escape_method = 'sql') {
} }
// Recursive function to display folder options - Used in folders files and documents // Recursive function to display folder options - Used in folders files and documents
function display_folder_options($parent_folder_id, $client_id, $folder_location = 0, $indent = 0) { function display_folder_options($parent_folder_id, $client_id, $indent = 0) {
global $mysqli; global $mysqli;
$folder_location = intval($folder_location); $sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_client_id = $client_id ORDER BY folder_name ASC");
// 0 = Document Folders
// 1 = File Folders
$sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_location = $folder_location AND folder_client_id = $client_id ORDER BY folder_name ASC");
while ($row = mysqli_fetch_array($sql_folders)) { while ($row = mysqli_fetch_array($sql_folders)) {
$folder_id = intval($row['folder_id']); $folder_id = intval($row['folder_id']);
$folder_name = nullable_htmlentities($row['folder_name']); $folder_name = nullable_htmlentities($row['folder_name']);
@ -1593,7 +1589,7 @@ function display_folder_options($parent_folder_id, $client_id, $folder_location
echo "<option value=\"$folder_id\" $selected>$indentation$folder_name</option>"; echo "<option value=\"$folder_id\" $selected>$indentation$folder_name</option>";
// Recursively display subfolders // Recursively display subfolders
display_folder_options($folder_id, $client_id, $folder_location, $indent + 1); display_folder_options($folder_id, $client_id, $indent + 1);
} }
} }