mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Added Link to and unlink Items in Asset Details
This commit is contained in:
51
modals/asset_link_credential_modal.php
Normal file
51
modals/asset_link_credential_modal.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<div class="modal" id="linkCredentialModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="login_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
|
||||
$sql_logins_select = mysqli_query($mysqli, "SELECT login_id, login_name FROM logins
|
||||
WHERE login_client_id = $client_id
|
||||
AND login_asset_id != $contact_id
|
||||
AND login_asset_id = 0
|
||||
AND login_archived_at IS NULL
|
||||
ORDER BY login_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_logins_select)) {
|
||||
$login_id = intval($row['login_id']);
|
||||
$login_name = nullable_htmlentities($row['login_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $login_id ?>"><?php echo $login_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
57
modals/asset_link_document_modal.php
Normal file
57
modals/asset_link_document_modal.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<div class="modal" id="linkDocumentModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
// Check if there are any associated documents
|
||||
if ($linked_documents) {
|
||||
$excluded_document_ids = implode(",", $linked_documents);
|
||||
$exclude_condition = "AND document_id NOT IN ($excluded_document_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed documents
|
||||
}
|
||||
|
||||
$sql_documents_select = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
WHERE document_client_id = $client_id
|
||||
AND document_archived_at IS NULL
|
||||
$exclude_condition
|
||||
ORDER BY document_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
59
modals/asset_link_file_modal.php
Normal file
59
modals/asset_link_file_modal.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<div class="modal" id="linkFileModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
// Check if there are any associated files
|
||||
if (!empty($linked_files)) {
|
||||
$excluded_file_ids = implode(",", $linked_files);
|
||||
$exclude_condition = "AND file_id NOT IN ($excluded_file_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed vendors
|
||||
}
|
||||
|
||||
$sql_files_select = mysqli_query($mysqli, "SELECT * FROM files
|
||||
LEFT JOIN folders ON folder_id = file_folder_id
|
||||
WHERE file_client_id = $client_id
|
||||
$exclude_condition
|
||||
ORDER BY folder_name ASC, file_name ASC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
56
modals/asset_link_service_modal.php
Normal file
56
modals/asset_link_service_modal.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<div class="modal" id="linkServiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
// Check if there are any associated services
|
||||
if (!empty($linked_services)) {
|
||||
$excluded_service_ids = implode(",", $linked_services);
|
||||
$exclude_condition = "AND service_id NOT IN ($excluded_service_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed services
|
||||
}
|
||||
|
||||
$sql_services_select = mysqli_query($mysqli, "SELECT * FROM services
|
||||
WHERE service_client_id = $client_id
|
||||
$exclude_condition
|
||||
ORDER BY service_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
58
modals/asset_link_software_modal.php
Normal file
58
modals/asset_link_software_modal.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<div class="modal" id="linkSoftwareModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="software_id">
|
||||
<option value="">- Select a Device Software License -</option>
|
||||
<?php
|
||||
// Check if there are any associated sofctware
|
||||
if (!empty($linked_software)) {
|
||||
$excluded_software_ids = implode(",", $linked_software);
|
||||
$exclude_condition = "AND software_id NOT IN ($excluded_software_ids)";
|
||||
} else {
|
||||
$exclude_condition = ""; // No condition if there are no displayed software
|
||||
}
|
||||
|
||||
$sql_software_select = mysqli_query($mysqli, "SELECT * FROM software
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_archived_at IS NULL
|
||||
AND software_license_type = 'Device'
|
||||
$exclude_condition
|
||||
ORDER BY software_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user