Client files bugfix

- Hide delete button for techs as they do not have this permission
- Remove unused exclude_condition var
This commit is contained in:
Marcus Hill 2024-07-31 22:06:17 +01:00
parent cc0de316ab
commit cfb13a0c18
2 changed files with 19 additions and 15 deletions

View File

@ -24,7 +24,6 @@
$sql_assets_select = mysqli_query($mysqli, "SELECT * FROM assets
WHERE asset_client_id = $client_id
AND asset_archived_at IS NULL
$exclude_condition
ORDER BY asset_name ASC"
);
while ($row = mysqli_fetch_array($sql_assets_select)) {

View File

@ -225,7 +225,10 @@ $num_of_files = mysqli_num_rows($sql);
<small><?php echo $file_name; ?></small>
<?php if ($session_user_role == 3) { ?>
<a href="#" data-toggle="modal" data-target="#deleteFileModal" onclick="populateFileDeleteModal(<?php echo "$file_id , '$file_name'" ?>)" class="text-white float-right mr-1"><i class="fa fa-times"></i></a>
<?php } ?>
</div>
</div>
</div>
@ -338,10 +341,12 @@ $num_of_files = mysqli_num_rows($sql);
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_file=<?php echo $file_id; ?>">
<i class="fas fa-fw fa-archive mr-2"></i>Archive
</a>
<?php if ($session_user_role == 3) { ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger text-bold" href="#" data-toggle="modal" data-target="#deleteFileModal" onclick="populateFileDeleteModal(<?php echo "$file_id , '$file_name'" ?>)">
<i class="fas fa-fw fa-trash mr-2"></i>Delete
</a>
<?php } ?>
</div>
</div>
</td>