mirror of https://github.com/itflow-org/itflow
Added Location to Global View, updated links and fixed password pop over moving you to the top of the page when clicked in asset and conact details
This commit is contained in:
parent
2795b4e15e
commit
fc00b5e78f
|
|
@ -592,7 +592,7 @@ if (isset($_GET['asset_id'])) {
|
|||
<td><?php echo $login_description; ?></td>
|
||||
<td><?php echo $login_username_display; ?></td>
|
||||
<td>
|
||||
<a tabindex="0" href="#" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></a><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
<button class="btn p-0" type="button" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></button><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $login_uri_display; ?></td>
|
||||
|
|
@ -1080,9 +1080,8 @@ if (isset($_GET['asset_id'])) {
|
|||
});
|
||||
</script>
|
||||
|
||||
<script src="js/recurring_tickets_edit_modal.js"></script>
|
||||
<!-- Include script to get TOTP code via the login ID -->
|
||||
<script src="js/logins_show_otp_via_id.js"></script>
|
||||
<script src="js/credential_show_otp_via_id.js"></script>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -384,12 +384,9 @@ if (isset($_GET['contact_id'])) {
|
|||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i>
|
||||
<a class="text-secondary" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_edit.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>"
|
||||
>
|
||||
<?php echo $asset_name; ?></a>
|
||||
<a class="text-secondary" href="asset_details.php?<?php echo $client_url; ?>asset_id=<?php echo $asset_id; ?>">
|
||||
<?php echo $asset_name; ?>
|
||||
</a>
|
||||
<div class="mt-0">
|
||||
<small class="text-muted"><?php echo $asset_description; ?></small>
|
||||
</div>
|
||||
|
|
@ -544,7 +541,7 @@ if (isset($_GET['contact_id'])) {
|
|||
<td><?php echo $login_description; ?></td>
|
||||
<td><?php echo $login_username_display; ?></td>
|
||||
<td>
|
||||
<a tabindex="0" href="#" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></a><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
<button class="btn p-0" type="button" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></button><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $login_uri_display; ?></td>
|
||||
|
|
@ -1173,17 +1170,17 @@ if (isset($_GET['contact_id'])) {
|
|||
</script>
|
||||
|
||||
<!-- Include script to get TOTP code via the login ID -->
|
||||
<script src="js/logins_show_otp_via_id.js"></script>
|
||||
<script src="js/credential_show_otp_via_id.js"></script>
|
||||
|
||||
<?php
|
||||
|
||||
require_once "modals/ticket_add_modal.php";
|
||||
require_once "modals/client_contact_link_asset_modal.php";
|
||||
require_once "modals/client_contact_link_software_modal.php";
|
||||
require_once "modals/client_contact_link_credential_modal.php";
|
||||
require_once "modals/client_contact_link_service_modal.php";
|
||||
require_once "modals/client_contact_link_document_modal.php";
|
||||
require_once "modals/client_contact_link_file_modal.php";
|
||||
require_once "modals/contact_link_asset_modal.php";
|
||||
require_once "modals/contact_link_software_modal.php";
|
||||
require_once "modals/contact_link_credential_modal.php";
|
||||
require_once "modals/contact_link_service_modal.php";
|
||||
require_once "modals/contact_link_document_modal.php";
|
||||
require_once "modals/contact_link_file_modal.php";
|
||||
|
||||
require_once "modals/recurring_ticket_add_modal.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
|
||||
$login_tag_id_array[] = $login_tag_id;
|
||||
$login_tag_name_display_array[] = "<a href='client_logins.php?client_id=$client_id&tags[]=$login_tag_id'><span class='badge text-light p-1 mr-1' style='background-color: $login_tag_color;'><i class='fa fa-fw fa-$login_tag_icon mr-2'></i>$login_tag_name</span></a>";
|
||||
$login_tag_name_display_array[] = "<a href='credentials.php?$client_url tags[]=$login_tag_id'><span class='badge text-light p-1 mr-1' style='background-color: $login_tag_color;'><i class='fa fa-fw fa-$login_tag_icon mr-2'></i>$login_tag_name</span></a>";
|
||||
}
|
||||
$login_tags_display = implode('', $login_tag_name_display_array);
|
||||
|
||||
|
|
@ -457,6 +457,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@
|
|||
<p><strong>ALL</strong> Contacts</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="locations.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "locations.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-map-marker-alt"></i>
|
||||
<p><strong>ALL</strong> Locations</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="assets.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "assets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="client_locations.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_locations.php") { echo "active"; } ?>">
|
||||
<a href="locations.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "locations.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-map-marker-alt"></i>
|
||||
<p>
|
||||
Locations
|
||||
|
|
|
|||
|
|
@ -4,7 +4,16 @@
|
|||
$sort = "location_name";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_client.php";
|
||||
// If client_id is in URI then show client Side Bar and client header
|
||||
if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND location_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
}
|
||||
|
||||
// Tags Filter
|
||||
if (isset($_GET['tags']) && is_array($_GET['tags']) && !empty($_GET['tags'])) {
|
||||
|
|
@ -27,13 +36,14 @@ $url_query_strings_sort = http_build_query($get_copy);
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS locations.*, GROUP_CONCAT(tag_name) FROM locations
|
||||
"SELECT SQL_CALC_FOUND_ROWS locations.*, clients.*, GROUP_CONCAT(tag_name) FROM locations
|
||||
LEFT JOIN clients ON client_id = location_client_id
|
||||
LEFT JOIN location_tags ON location_tags.location_id = locations.location_id
|
||||
LEFT JOIN tags ON tags.tag_id = location_tags.tag_id
|
||||
WHERE location_client_id = $client_id
|
||||
WHERE location_$archive_query
|
||||
$tag_query
|
||||
AND location_$archive_query
|
||||
AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%')
|
||||
AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$client_query
|
||||
GROUP BY location_id
|
||||
ORDER BY location_primary DESC, $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
|
@ -67,7 +77,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
||||
<div class="row">
|
||||
|
||||
|
|
@ -97,7 +109,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-5">
|
||||
<div class="btn-group float-right">
|
||||
<a href="?client_id=<?php echo $client_id; ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
<a href="?<?php echo $client_url; ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
|
||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||
</a>
|
||||
|
|
@ -167,6 +179,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
Hours <?php if ($sort == 'location_hours') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -174,6 +193,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
$location_description = nullable_htmlentities($row['location_description']);
|
||||
|
|
@ -231,7 +252,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
|
||||
$location_tag_id_array[] = $location_tag_id;
|
||||
$location_tag_name_display_array[] = "<a href='client_locations.php?client_id=$client_id&tags[]=$location_tag_id'><span class='badge text-light p-1 mr-1' style='background-color: $location_tag_color;'><i class='fa fa-fw fa-$location_tag_icon mr-2'></i>$location_tag_name</span></a>";
|
||||
$location_tag_name_display_array[] = "<a href='locations.php?$client_url tags[]=$location_tag_id'><span class='badge text-light p-1 mr-1' style='background-color: $location_tag_color;'><i class='fa fa-fw fa-$location_tag_icon mr-2'></i>$location_tag_name</span></a>";
|
||||
}
|
||||
$location_tags_display = implode('', $location_tag_name_display_array);
|
||||
|
||||
|
|
@ -270,6 +291,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php echo $location_fax_display; ?>
|
||||
</td>
|
||||
<td><?php echo $location_hours_display; ?></td>
|
||||
<?php if (!$client_url) { ?>
|
||||
<td><a href="locations.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
|
|
@ -313,7 +337,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once "modals/client_location_bulk_assign_tags_modal.php"; ?>
|
||||
<?php require_once "modals/location_bulk_assign_tags_modal.php"; ?>
|
||||
</form>
|
||||
<?php require_once "includes/filter_footer.php";
|
||||
?>
|
||||
|
|
@ -324,7 +348,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<?php
|
||||
|
||||
require_once "modals/client_location_add_modal.php";
|
||||
require_once "modals/client_location_import_modal.php";
|
||||
require_once "modals/client_location_export_modal.php";
|
||||
require_once "modals/location_add_modal.php";
|
||||
require_once "modals/location_import_modal.php";
|
||||
require_once "modals/location_export_modal.php";
|
||||
require_once "includes/footer.php";
|
||||
|
|
@ -8,7 +8,6 @@
|
|||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
|
|
@ -33,6 +32,33 @@
|
|||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="client_id" required>
|
||||
<option value="">- Select Client -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']); ?>
|
||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
||||
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Location Name <strong class="text-danger">*</strong> / <span class="text-secondary">Primary</span></label>
|
||||
|
|
@ -126,7 +152,7 @@
|
|||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-contact">
|
||||
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="form-group">
|
||||
<label>Contact</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -148,6 +174,7 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Phone</label>
|
||||
|
|
@ -8,12 +8,14 @@
|
|||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="export_client_locations_csv" class="btn btn-primary text-bold"><i class="fas fa-fw fa-download mr-2"></i>Download CSV</button>
|
||||
<button type="submit" name="export_locations_csv" class="btn btn-primary text-bold"><i class="fas fa-fw fa-download mr-2"></i>Download CSV</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -8,7 +8,9 @@
|
|||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<div class="modal-body bg-white">
|
||||
<p><strong>Format csv file with headings & data:</strong><br>Name, Description, Address, City, State, Postal Code, Phone, Hours</p>
|
||||
<hr>
|
||||
|
|
@ -16,10 +18,10 @@
|
|||
<input type="file" class="form-control-file" name="file" accept=".csv" required>
|
||||
</div>
|
||||
<hr>
|
||||
<div>Download: <a class="text-bold" href="post.php?download_client_locations_csv_template=<?php echo $client_id; ?>">sample csv template</a></div>
|
||||
<div>Download: <a class="text-bold" href="post.php?download_locations_csv_template=<?php echo $client_id; ?>">sample csv template</a></div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="import_client_locations_csv" class="btn btn-primary text-bold"><i class="fa fa-upload mr-2"></i>Import</button>
|
||||
<button type="submit" name="import_locations_csv" class="btn btn-primary text-bold"><i class="fa fa-upload mr-2"></i>Import</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -368,23 +368,22 @@ if (isset($_POST['bulk_delete_locations'])) {
|
|||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
|
||||
if(isset($_POST['export_client_locations_csv'])){
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
||||
//get records from database
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$client_name = sanitizeInput($row['client_name']);
|
||||
if(isset($_POST['export_locations_csv'])){
|
||||
if (isset($_POST['client_id'])) {
|
||||
$client_id = intval($_POST['client_id']);
|
||||
$client_query = "AND location_client_id = $client_id";
|
||||
} else {
|
||||
$client_query = '';
|
||||
}
|
||||
|
||||
//Locations
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_archived_at IS NULL $client_query ORDER BY location_name ASC");
|
||||
|
||||
$num_rows = mysqli_num_rows($sql);
|
||||
|
||||
if($num_rows > 0) {
|
||||
$delimiter = ",";
|
||||
$filename = strtoAZaz09($client_name) . "-Locations-" . date('Y-m-d') . ".csv";
|
||||
$filename = "Locations-" . date('Y-m-d') . ".csv";
|
||||
|
||||
//create a file pointer
|
||||
$f = fopen('php://memory', 'w');
|
||||
|
|
@ -411,13 +410,13 @@ if(isset($_POST['export_client_locations_csv'])){
|
|||
}
|
||||
|
||||
// Logging
|
||||
logAction("Location", "Export", "$session_name exported $num_rows location(s) to a CSV file", $client_id);
|
||||
logAction("Location", "Export", "$session_name exported $num_rows location(s) to a CSV file");
|
||||
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST["import_client_locations_csv"])){
|
||||
if(isset($_POST["import_locations_csv"])){
|
||||
|
||||
enforceUserPermission('module_client', 2);
|
||||
|
||||
|
|
@ -515,17 +514,10 @@ if(isset($_POST["import_client_locations_csv"])){
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['download_client_locations_csv_template'])){
|
||||
$client_id = intval($_GET['download_client_locations_csv_template']);
|
||||
|
||||
//get records from database
|
||||
$sql = mysqli_query($mysqli,"SELECT client_name FROM clients WHERE client_id = $client_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$client_name = $row['client_name'];
|
||||
if(isset($_GET['download_locations_csv_template'])){
|
||||
|
||||
$delimiter = ",";
|
||||
$filename = strtoAZaz09($client_name) . "-Locations-Template.csv";
|
||||
$filename = "Locations-Template.csv";
|
||||
|
||||
//create a file pointer
|
||||
$f = fopen('php://memory', 'w');
|
||||
|
|
|
|||
Loading…
Reference in New Issue