mirror of https://github.com/itflow-org/itflow
DB Update Added Null Default to new meshcentral vars so it doesnt break when adding records, Added Service History #384 Thank you @aftechro for the idea. This has been added to asset list and ticket details and some UI updates to ticket details as well
This commit is contained in:
parent
5063bdb854
commit
f102c19692
|
|
@ -0,0 +1,37 @@
|
|||
<div class="modal" id="assetTicketsModal<?php echo $asset_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-<?php echo $device_icon; ?>"></i> <?php echo $asset_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
<?php
|
||||
// Query is run from client_assets.php
|
||||
while($row = mysqli_fetch_array($sql_tickets)){
|
||||
$ticket_id = $row['ticket_id'];
|
||||
$ticket_prefix = $row['ticket_prefix'];
|
||||
$ticket_number = $row['ticket_number'];
|
||||
$ticket_subject = $row['ticket_subject'];
|
||||
$ticket_status = $row['ticket_status'];
|
||||
$ticket_created_at = $row['ticket_created_at'];
|
||||
$ticket_updated_at = $row['ticket_updated_at'];
|
||||
?>
|
||||
<p>
|
||||
<i class="fas fa-fw fa-ticket-alt"></i>
|
||||
Ticket: <a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo "$ticket_prefix$ticket_number" ?></a> on <?php echo $ticket_created_at; ?> <?php echo $ticket_subject; ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -268,6 +268,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
$login_id = $row['login_id'];
|
||||
$login_username = $row['login_username'];
|
||||
$login_password = decryptLoginEntry($row['login_password']);
|
||||
|
||||
$sql_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_asset_id = $asset_id ORDER BY ticket_number DESC");
|
||||
$ticket_count = mysqli_num_rows($sql_tickets);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
|
|
@ -337,6 +340,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown"><i class="fas fa-ellipsis-h"></i></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
|
||||
<?php if($ticket_count > 0){ ?>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#assetTicketsModal<?php echo $asset_id; ?>">Tickets (<?php echo $ticket_count; ?>)</a>
|
||||
<?php } ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
|
||||
</div>
|
||||
|
|
@ -347,6 +353,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
|
||||
include("client_asset_edit_modal.php");
|
||||
include("client_asset_tickets_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
12
db.sql
12
db.sql
|
|
@ -77,7 +77,7 @@ CREATE TABLE `assets` (
|
|||
`asset_install_date` date DEFAULT NULL,
|
||||
`asset_reciept` varchar(200) DEFAULT NULL,
|
||||
`asset_notes` text DEFAULT NULL,
|
||||
`asset_meshcentral_id` varchar(200) NOT NULL,
|
||||
`client_meshcentral_group` varchar(200) DEFAULT NULL,
|
||||
`asset_created_at` datetime NOT NULL,
|
||||
`asset_updated_at` datetime DEFAULT NULL,
|
||||
`asset_archived_at` datetime DEFAULT NULL,
|
||||
|
|
@ -239,7 +239,7 @@ CREATE TABLE `clients` (
|
|||
`client_currency_code` varchar(200) NOT NULL,
|
||||
`client_net_terms` int(10) NOT NULL,
|
||||
`client_notes` text DEFAULT NULL,
|
||||
`client_meshcentral_group` varchar(200) NOT NULL,
|
||||
`client_meshcentral_group` varchar(200) DEFAULT NULL,
|
||||
`client_created_at` datetime NOT NULL,
|
||||
`client_updated_at` datetime DEFAULT NULL,
|
||||
`client_archived_at` datetime DEFAULT NULL,
|
||||
|
|
@ -1116,9 +1116,9 @@ CREATE TABLE `settings` (
|
|||
`config_stripe_enable` tinyint(1) DEFAULT NULL,
|
||||
`config_stripe_publishable` varchar(255) DEFAULT NULL,
|
||||
`config_stripe_secret` varchar(255) DEFAULT NULL,
|
||||
`config_meshcentral_uri` varchar(200) NOT NULL,
|
||||
`config_meshcentral_user` varchar(200) NOT NULL,
|
||||
`config_meshcentral_secret` varchar(200) NOT NULL,
|
||||
`config_meshcentral_uri` varchar(200) DEFAULT NULL,
|
||||
`config_meshcentral_user` varchar(200) DEFAULT NULL,
|
||||
`config_meshcentral_secret` varchar(200) DEFAULT NULL,
|
||||
PRIMARY KEY (`company_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
|
@ -1456,4 +1456,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2022-02-26 11:19:56
|
||||
-- Dump completed on 2022-02-27 16:53:14
|
||||
|
|
|
|||
75
ticket.php
75
ticket.php
|
|
@ -179,7 +179,7 @@ if(isset($_GET['ticket_id'])){
|
|||
|
||||
<div class="row mb-3">
|
||||
<div class="col-9">
|
||||
<h3>Ticket <?php echo "$ticket_prefix$ticket_number"; ?> <?php echo $ticket_status_display; ?></h3>
|
||||
<h3><i class="fas fa-fw fa-ticket-alt text-secondary"></i> Ticket <?php echo "$ticket_prefix$ticket_number"; ?> <?php echo $ticket_status_display; ?></h3>
|
||||
</div>
|
||||
<?php if($ticket_status != "Closed") { ?>
|
||||
<div class="col-3">
|
||||
|
|
@ -367,7 +367,7 @@ if(isset($_GET['ticket_id'])){
|
|||
<br>
|
||||
<!-- <i class="fa fa-fw fa-info-circle text-secondary ml-1 mr-2 mb-2"></i>--><?php //echo $primary_contact_display; ?>
|
||||
<!-- <br>-->
|
||||
<i class="fa fa-fw fa-envelope text-secondary ml-1 mr-2 mb-2"></i>Related tickets: Open <strong><?php echo $ticket_related_open; ?></strong> | Closed <strong><?php echo $ticket_related_closed; ?></strong> | Total <strong><?php echo $ticket_related_total; ?></strong>
|
||||
<span class="ml-1">Related tickets: Open <strong><?php echo $ticket_related_open; ?></strong> | Closed <strong><?php echo $ticket_related_closed; ?></strong> | Total <strong><?php echo $ticket_related_total; ?></strong></span>
|
||||
<hr>
|
||||
<?php
|
||||
if(!empty($location_name)){
|
||||
|
|
@ -396,7 +396,7 @@ if(isset($_GET['ticket_id'])){
|
|||
<?php
|
||||
if(!empty($contact_mobile)){
|
||||
?>
|
||||
<i class="fa fa-fw fa-mobile text-secondary ml-1 mr-2 mb-2"></i><?php echo $contact_mobile; ?>
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary ml-1 mr-2 mb-2"></i><?php echo $contact_mobile; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
|
@ -421,7 +421,7 @@ if(isset($_GET['ticket_id'])){
|
|||
<div class="ml-1"><i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i>Closed by: <?php echo strtoupper($ticket_closed_by_display); ?></a></div>
|
||||
<?php } ?>
|
||||
<?php if(!empty($ticket_total_reply_time)){ ?>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-check text-secondary mr-2 mb-2"></i>Total time worked: <?php echo $ticket_total_reply_time; ?></div>
|
||||
<div class="ml-1"><i class="far fa-fw fa-clock text-secondary mr-2 mb-2"></i>Total time worked: <?php echo $ticket_total_reply_time; ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
|
@ -430,30 +430,30 @@ if(isset($_GET['ticket_id'])){
|
|||
<div class="card card-body card-outline card-dark mb-3">
|
||||
<div>
|
||||
<h4 class="text-secondary">Asset</h4>
|
||||
<i class="fa fa-fw fa-desktop text-secondary ml-1 mr-2 mb-2"></i> Asset name: <strong><?php echo $asset_name; ?></strong>
|
||||
<i class="fa fa-fw fa-desktop text-secondary ml-1 mr-2 mb-2"></i><strong><?php echo $asset_name; ?></strong>
|
||||
<br>
|
||||
|
||||
<?php if(!empty($asset_os)) { ?>
|
||||
<i class="fa fa-fw fa-tag text-secondary ml-1 mr-2 mb-2"></i> OS: <?php echo $asset_os; ?>
|
||||
<i class="fab fa-fw fa-microsoft text-secondary ml-1 mr-2 mb-2"></i><?php echo $asset_os; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!empty($asset_ip)) { ?>
|
||||
<i class="fa fa-fw fa-network-wired text-secondary ml-1 mr-2 mb-2"></i> IP: <?php echo "$asset_ip"; ?>
|
||||
<i class="fa fa-fw fa-network-wired text-secondary ml-1 mr-2 mb-2"></i><?php echo "$asset_ip"; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!empty($asset_make)) { ?>
|
||||
<i class="fa fa-fw fa-tag text-secondary ml-1 mr-2 mb-2"></i> Model: <?php echo "$asset_make $asset_model"; ?>
|
||||
<i class="fa fa-fw fa-tag text-secondary ml-1 mr-2 mb-2"></i>Model: <?php echo "$asset_make $asset_model"; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!empty($asset_serial)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-barcode text-secondary ml-1 mr-2 mb-2"></i> Service Tag: <?php echo $asset_serial; ?>
|
||||
<i class="fa fa-fw fa-barcode text-secondary ml-1 mr-2 mb-2"></i>Service Tag: <?php echo $asset_serial; ?>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
|
|
@ -461,11 +461,66 @@ if(isset($_GET['ticket_id'])){
|
|||
|
||||
if (!empty($asset_warranty_expire)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-tag text-secondary ml-1 mr-2 mb-2"></i> Warranty expires: <strong><font color="<?php echo $warranty_status_color ?>"> <?php echo $dt_value ?></font></strong>
|
||||
<i class="far fa-fw fa-calendar-alt text-secondary ml-1 mr-2 mb-2"></i>Warranty expires: <strong><font color="<?php echo $warranty_status_color ?>"> <?php echo $dt_value ?></font></strong>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$sql_asset_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_asset_id = $asset_id ORDER BY ticket_number DESC");
|
||||
$ticket_asset_count = mysqli_num_rows($sql_asset_tickets);
|
||||
|
||||
if($ticket_asset_count > 0 ){
|
||||
?>
|
||||
|
||||
<button class="btn btn-block btn-secondary" data-toggle="modal" data-target="#assetTicketsModal">Service History (<?php echo $ticket_asset_count; ?>)</button>
|
||||
|
||||
<div class="modal" id="assetTicketsModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-desktop"></i> <?php echo $asset_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
<?php
|
||||
// Query is run from client_assets.php
|
||||
while($row = mysqli_fetch_array($sql_asset_tickets)){
|
||||
$ticket_id = $row['ticket_id'];
|
||||
$ticket_prefix = $row['ticket_prefix'];
|
||||
$ticket_number = $row['ticket_number'];
|
||||
$ticket_subject = $row['ticket_subject'];
|
||||
$ticket_status = $row['ticket_status'];
|
||||
$ticket_created_at = $row['ticket_created_at'];
|
||||
$ticket_updated_at = $row['ticket_updated_at'];
|
||||
?>
|
||||
<p>
|
||||
<i class="fas fa-fw fa-ticket-alt"></i>
|
||||
Ticket: <a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo "$ticket_prefix$ticket_number" ?></a> on <?php echo $ticket_created_at; ?> <?php echo $ticket_subject; ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
<?php
|
||||
|
||||
// WIP Need to only show users within the session company
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM users ORDER BY user_name ASC");
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM users WHERE user_id IN('$session_user_company_access') ORDER BY user_name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$user_id = $row['user_id'];
|
||||
$user_name = $row['user_name'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue