mirror of https://github.com/itflow-org/itflow
Add Contact Types to Contact Details Cleanup code in asset details and contact details
This commit is contained in:
parent
cd732b4dd6
commit
b5e67eb3f6
|
|
@ -122,30 +122,30 @@ if (isset($_GET['asset_id'])) {
|
|||
<i class="fas fa-fw fa-edit"></i>
|
||||
</button>
|
||||
<h3 class="text-bold"><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $asset_name; ?></h3>
|
||||
<?php if (!empty($asset_description)) { ?>
|
||||
<?php if ($asset_description) { ?>
|
||||
<div class="text-secondary"><?php echo $asset_description; ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if (!empty($asset_type)) { ?>
|
||||
<?php if ($asset_type) { ?>
|
||||
<div><i class="fa fa-fw fa-tag text-secondary mr-3"></i><?php echo $asset_type; ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_make)) { ?>
|
||||
if ($asset_make) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-circle text-secondary mr-3"></i><?php echo "$asset_make $asset_model"; ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_os)) { ?>
|
||||
if ($asset_os) { ?>
|
||||
<div class="mt-2"><i class="fab fa-fw fa-windows text-secondary mr-3"></i><?php echo "$asset_os"; ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_serial)) { ?>
|
||||
if ($asset_serial) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-barcode text-secondary mr-3"></i><?php echo $asset_serial; ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_purchase_date)) { ?>
|
||||
if ($asset_purchase_date) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-shopping-cart text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($asset_purchase_date)); ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_install_date)) { ?>
|
||||
if ($asset_install_date) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-calendar-check text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($asset_install_date)); ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_warranty_expire)) { ?>
|
||||
if ($asset_warranty_expire) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-exclamation-triangle text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($asset_warranty_expire)); ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
@ -156,19 +156,19 @@ if (isset($_GET['asset_id'])) {
|
|||
<h5 class="card-title">Network</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if (!empty($asset_ip)) { ?>
|
||||
<?php if ($asset_ip) { ?>
|
||||
<div><i class="fa fa-fw fa-globe text-secondary mr-3"></i><?php echo $asset_ip; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($asset_nat_ip)) { ?>
|
||||
<?php if ($asset_nat_ip) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-random text-secondary mr-3"></i><?php echo $asset_nat_ip; ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_mac)) { ?>
|
||||
if ($asset_mac) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-ethernet text-secondary mr-3"></i><?php echo $asset_mac; ?></div>
|
||||
<?php }
|
||||
if (!empty($asset_uri)) { ?>
|
||||
if ($asset_uri) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-3"></i><a href="<?php echo $asset_uri; ?>" target="_blank">Link</a></div>
|
||||
<?php }
|
||||
if (!empty($asset_uri_2)) { ?>
|
||||
if ($asset_uri_2) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-3"></i><a href="<?php echo $asset_uri; ?>" target="_blank">Link 2</a></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
|
@ -180,19 +180,19 @@ if (isset($_GET['asset_id'])) {
|
|||
<h5 class="card-title">Assignment</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if (!empty($location_name)) { ?>
|
||||
<?php if ($location_name) { ?>
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name; ?></div>
|
||||
<?php }
|
||||
if (!empty($contact_name)) { ?>
|
||||
if ($contact_name) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-user text-secondary mr-3"></i><?php echo $contact_name; ?></div>
|
||||
<?php }
|
||||
if (!empty($contact_email)) { ?>
|
||||
if ($contact_email) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php }
|
||||
if (!empty($contact_phone)) { ?>
|
||||
if ($contact_phone) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><?php echo formatPhoneNumber($contact_phone); echo " $contact_extension"; ?></div>
|
||||
<?php }
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
if ($contact_mobile) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><?php echo formatPhoneNumber($contact_mobile); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,18 +28,8 @@ if (isset($_GET['contact_id'])) {
|
|||
$contact_billing = intval($row['contact_billing']);
|
||||
$contact_technical = intval($row['contact_technical']);
|
||||
$contact_created_at = nullable_htmlentities($row['contact_created_at']);
|
||||
if ($contact_primary == 1 ) {
|
||||
$contact_primary_display = "<small class='text-success'>Primary Contact</small>";
|
||||
} else {
|
||||
$contact_primary_display = false;
|
||||
}
|
||||
$contact_location_id = intval($row['contact_location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$auth_method = nullable_htmlentities($row['contact_auth_method']);
|
||||
|
||||
// Related Assets Query
|
||||
|
|
@ -74,13 +64,16 @@ if (isset($_GET['contact_id'])) {
|
|||
|
||||
<div class="card card-dark">
|
||||
<div class="card-body">
|
||||
<button type="button" class="btn btn-default float-right" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
|
||||
<i class="fas fa-fw fa-user-edit"></i>
|
||||
</button>
|
||||
<h3 class="text-bold"><?php echo $contact_name; ?></h3>
|
||||
<?php if (!empty($contact_title)) { ?>
|
||||
<?php if ($contact_title) { ?>
|
||||
<div class="text-secondary"><?php echo $contact_title; ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="text-center">
|
||||
<?php if (!empty($contact_photo)) { ?>
|
||||
<?php if ($contact_photo) { ?>
|
||||
<img class="img-fluid img-circle p-3" alt="contact_photo" src="<?php echo "uploads/clients/$client_id/$contact_photo"; ?>">
|
||||
<?php } else { ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
|
|
@ -90,26 +83,34 @@ if (isset($_GET['contact_id'])) {
|
|||
<?php } ?>
|
||||
</div>
|
||||
<hr>
|
||||
<?php if (!empty($location_name)) { ?>
|
||||
<div class="mb-1"><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name_display; ?></div>
|
||||
<?php if ($location_name) { ?>
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name; ?></div>
|
||||
<?php }
|
||||
if (!empty($contact_email)) { ?>
|
||||
<div><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
if ($contact_email) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php }
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><a href="tel:<?php echo "$contact_phone"?>"><?php echo "$contact_phone $contact_extension"; ?></a></div>
|
||||
if ($contact_phone) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><a href="tel:<?php echo "$contact_phone"?>"><?php echo "$contact_phone $contact_extension"; ?></a></div>
|
||||
<?php }
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><a href="tel:<?php echo $contact_mobile; ?>"><?php echo $contact_mobile; ?></a></div>
|
||||
if ($contact_mobile) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><a href="tel:<?php echo $contact_mobile; ?>"><?php echo $contact_mobile; ?></a></div>
|
||||
<?php }
|
||||
if (!empty($contact_pin)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-key text-secondary mr-3"></i><?php echo $contact_pin; ?></div>
|
||||
if ($contact_pin) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-key text-secondary mr-3"></i><?php echo $contact_pin; ?></div>
|
||||
<?php }
|
||||
if ($contact_primary) { ?>
|
||||
<div class="mt-2 text-success"><i class="fa fa-fw fa-check mr-3"></i>Primary Contact</div>
|
||||
<?php }
|
||||
if ($contact_important) { ?>
|
||||
<div class="mt-2 text-dark text-bold"><i class="fa fa-fw fa-check mr-3"></i>Important</div>
|
||||
<?php }
|
||||
if ($contact_technical) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-check text-secondary mr-3"></i>Technical</div>
|
||||
<?php }
|
||||
if ($contact_billing) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-check text-secondary mr-3"></i>Billing</div>
|
||||
<?php } ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-clock text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($contact_created_at)); ?></div>
|
||||
<hr>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
|
||||
<i class="fas fa-fw fa-user-edit"></i> Edit
|
||||
</button>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-clock text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($contact_created_at)); ?></div>
|
||||
|
||||
<?php require_once "client_contact_edit_modal.php";
|
||||
?>
|
||||
|
|
@ -119,11 +120,9 @@ if (isset($_GET['contact_id'])) {
|
|||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fa fa-fw fa-edit mr-2"></i>Notes</h5>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<textarea class="form-control" rows=6 id="contactNotes" placeholder="Notes, eg Personal tidbits to spark convo, temperment, etc" onblur="updateContactNotes(<?php echo $contact_id ?>)"><?php echo $contact_notes ?></textarea>
|
||||
<h5 class="card-title">Notes</h5>
|
||||
</div>
|
||||
<textarea class="form-control" rows=6 id="contactNotes" placeholder="Notes, eg Personal tidbits to spark convo, temperment, etc" onblur="updateContactNotes(<?php echo $contact_id ?>)"><?php echo $contact_notes ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -143,7 +142,7 @@ if (isset($_GET['contact_id'])) {
|
|||
|
||||
<div class="card card-dark <?php if ($asset_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-desktop mr-2"></i>Assets</h3>
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-desktop mr-2"></i>Related Assets</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive-sm">
|
||||
|
|
@ -272,7 +271,7 @@ if (isset($_GET['contact_id'])) {
|
|||
|
||||
<div class="card card-dark <?php if ($login_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-key mr-2"></i>Logins</h3>
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-key mr-2"></i>Related Logins</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive-sm-sm">
|
||||
|
|
@ -377,7 +376,7 @@ if (isset($_GET['contact_id'])) {
|
|||
|
||||
<div class="card card-dark <?php if ($software_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-cube mr-2"></i>Licenses</h3>
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-cube mr-2"></i>Related Licenses</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive-sm">
|
||||
|
|
@ -452,7 +451,7 @@ if (isset($_GET['contact_id'])) {
|
|||
|
||||
<div class="card card-dark <?php if ($ticket_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-life-ring mr-2"></i>Tickets</h3>
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-life-ring mr-2"></i>Related Tickets</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive-sm">
|
||||
|
|
|
|||
Loading…
Reference in New Issue