Asset: Multiple Bug fixes, Fix broken asset list if no assets exist, fix bulk Asset Ticket creation to use the client_id of the associated asset, allow to assign to all open projects. Fix Transfer client where client_id is not defined in client overview section

This commit is contained in:
johnnyq
2025-08-25 16:59:15 -04:00
parent 0e54359db8
commit f6c0f840fe
3 changed files with 13 additions and 7 deletions

View File

@@ -8,8 +8,6 @@
</button>
</div>
<input type="hidden" name="bulk_billable" value="0">
<input type="hidden" name="bulk_client" value="<?php echo $client_id; ?>">
<div class="modal-body">
<div class="form-group">
@@ -104,7 +102,7 @@
<option value="0">- None -</option>
<?php
$sql_projects = mysqli_query($mysqli, "SELECT * FROM projects WHERE project_client_id = $client_id AND project_completed_at IS NULL AND project_archived_at IS NULL ORDER BY project_name ASC");
$sql_projects = mysqli_query($mysqli, "SELECT * FROM projects WHERE project_completed_at IS NULL AND project_archived_at IS NULL ORDER BY project_name ASC");
while ($row = mysqli_fetch_array($sql_projects)) {
$project_id_select = intval($row['project_id']);
$project_name_select = nullable_htmlentities($row['project_name']); ?>

View File

@@ -1,3 +1,11 @@
<?php
if ($client_url) {
$client_select_query = "AND client_id != $client_id";
} else {
$client_select_query = '';
}
?>
<div class="modal" id="bulkTransferAssetClientModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
@@ -17,9 +25,9 @@
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
</div>
<select class="form-control select2" name="bulk_client_id">
<option value="">- Client -</option>
<option value="">- Select Client -</option>
<?php
$clients_sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_id != $client_id AND client_archived_at IS NULL");
$clients_sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $client_select_query");
while ($row = mysqli_fetch_array($clients_sql)) {
$client_id_select = intval($row["client_id"]);