mirror of
https://github.com/itflow-org/itflow
synced 2026-07-25 01:40:40 +00:00
Update the rest of the PHP functions to use camelCase
This commit is contained in:
@@ -40,9 +40,9 @@ if (isset($_GET['asset_id'])) {
|
||||
$asset_model = escapeHtml($row['asset_model']);
|
||||
$asset_serial = escapeHtml($row['asset_serial']);
|
||||
$asset_os = escapeHtml($row['asset_os']);
|
||||
$asset_uri = sanitize_url($row['asset_uri']);
|
||||
$asset_uri_2 = sanitize_url($row['asset_uri_2']);
|
||||
$asset_uri_client = sanitize_url($row['asset_uri_client']);
|
||||
$asset_uri = escapeUrl($row['asset_uri']);
|
||||
$asset_uri_2 = escapeUrl($row['asset_uri_2']);
|
||||
$asset_uri_client = escapeUrl($row['asset_uri_client']);
|
||||
$asset_status = escapeHtml($row['asset_status']);
|
||||
$asset_purchase_reference = escapeHtml($row['asset_purchase_reference']);
|
||||
$asset_purchase_date = escapeHtml($row['asset_purchase_date']);
|
||||
|
||||
@@ -569,9 +569,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$asset_ipv6 = escapeHtml($row['interface_ipv6']);
|
||||
$asset_nat_ip = escapeHtml($row['interface_nat_ip']);
|
||||
$asset_mac = escapeHtml($row['interface_mac']) ?: '-';
|
||||
$asset_uri = sanitize_url($row['asset_uri']);
|
||||
$asset_uri_2 = sanitize_url($row['asset_uri_2']);
|
||||
$asset_uri_client = sanitize_url($row['asset_uri_client']);
|
||||
$asset_uri = escapeUrl($row['asset_uri']);
|
||||
$asset_uri_2 = escapeUrl($row['asset_uri_2']);
|
||||
$asset_uri_client = escapeUrl($row['asset_uri_client']);
|
||||
$asset_status = escapeHtml($row['asset_status']);
|
||||
$asset_purchase_reference = escapeHtml($row['asset_purchase_reference']);
|
||||
$asset_purchase_date = escapeHtml($row['asset_purchase_date']);
|
||||
|
||||
@@ -365,13 +365,13 @@ $sql_asset_retired = mysqli_query(
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = escapeHtml($row['credential_name']);
|
||||
$credential_description = escapeHtml($row['credential_description']);
|
||||
$credential_uri = sanitize_url($row['credential_uri']);
|
||||
$credential_uri = escapeUrl($row['credential_uri']);
|
||||
if (empty($credential_uri)) {
|
||||
$credential_uri_display = "-";
|
||||
} else {
|
||||
$credential_uri_display = "<a href='$credential_uri'>" . truncate($credential_uri,40) . "</a><button class='btn btn-sm clipboardjs' type='button' title='$credential_uri' data-clipboard-text='$credential_uri'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$credential_uri_2 = sanitize_url($row['credential_uri_2']);
|
||||
$credential_uri_2 = escapeUrl($row['credential_uri_2']);
|
||||
$credential_username = escapeHtml(decryptCredentialEntry($row['credential_username']));
|
||||
if (empty($credential_username)) {
|
||||
$credential_username_display = "-";
|
||||
|
||||
@@ -318,13 +318,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$credential_id = intval($row['c_credential_id']);
|
||||
$credential_name = escapeHtml($row['credential_name']);
|
||||
$credential_description = escapeHtml($row['credential_description']);
|
||||
$credential_uri = sanitize_url($row['credential_uri']);
|
||||
$credential_uri = escapeUrl($row['credential_uri']);
|
||||
if (empty($credential_uri)) {
|
||||
$credential_uri_display = "-";
|
||||
} else {
|
||||
$credential_uri_display = "<a href='$credential_uri'>" . truncate($credential_uri,40) . "</a><button class='btn btn-sm clipboardjs' type='button' title='$credential_uri' data-clipboard-text='$credential_uri'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$credential_uri_2 = sanitize_url($row['credential_uri_2']);
|
||||
$credential_uri_2 = escapeUrl($row['credential_uri_2']);
|
||||
$credential_username = escapeHtml(decryptCredentialEntry($row['credential_username']));
|
||||
if (empty($credential_username)) {
|
||||
$credential_username_display = "-";
|
||||
|
||||
@@ -60,7 +60,7 @@ while ($breadcrumb_folder_id > 0) {
|
||||
// ---------------------------------------------
|
||||
// Helper: unified folder tree (no folder_location)
|
||||
// ---------------------------------------------
|
||||
function is_ancestor_folder($folder_id, $current_folder_id, $client_id) {
|
||||
function isAncestorFolder($folder_id, $current_folder_id, $client_id) {
|
||||
global $mysqli;
|
||||
|
||||
if ($current_folder_id == 0) {
|
||||
@@ -73,13 +73,13 @@ function is_ancestor_folder($folder_id, $current_folder_id, $client_id) {
|
||||
$result = mysqli_query($mysqli, "SELECT parent_folder FROM folders WHERE folder_id = $current_folder_id AND folder_client_id = $client_id");
|
||||
if ($row = mysqli_fetch_assoc($result)) {
|
||||
$parent_folder_id = intval($row['parent_folder']);
|
||||
return is_ancestor_folder($folder_id, $parent_folder_id, $client_id);
|
||||
return isAncestorFolder($folder_id, $parent_folder_id, $client_id);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function display_folders($parent_folder_id, $client_id, $indent = 0, $render_root = false) {
|
||||
function displayFolders($parent_folder_id, $client_id, $indent = 0, $render_root = false) {
|
||||
global $mysqli, $get_folder_id, $session_user_role, $archive_query, $archived, $num_root_items, $folders_expanded;
|
||||
|
||||
// Always render root (only once)
|
||||
@@ -141,7 +141,7 @@ function display_folders($parent_folder_id, $client_id, $indent = 0, $render_roo
|
||||
$subfolder_count = intval(mysqli_fetch_assoc($subfolder_result)['count']);
|
||||
|
||||
// Active or ancestor of active folder = on active path
|
||||
$on_active_path = ($get_folder_id == $folder_id) || is_ancestor_folder($folder_id, $get_folder_id, $client_id);
|
||||
$on_active_path = ($get_folder_id == $folder_id) || isAncestorFolder($folder_id, $get_folder_id, $client_id);
|
||||
|
||||
// Option C: indent with padding (no AdminLTE sidebar CSS required)
|
||||
// Tune these numbers if you want tighter/looser indent
|
||||
@@ -202,7 +202,7 @@ function display_folders($parent_folder_id, $client_id, $indent = 0, $render_roo
|
||||
// Collapsed by default: ONLY render children if folder is on active path
|
||||
if ($subfolder_count > 0 && ($folders_expanded || $on_active_path)) {
|
||||
echo '<ul class="nav nav-pills flex-column bg-light">';
|
||||
display_folders($folder_id, $client_id, $indent + 1);
|
||||
displayFolders($folder_id, $client_id, $indent + 1);
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ $num_root_items = intval($row_root_files['num']) + intval($row_root_docs['num'])
|
||||
|
||||
<?php
|
||||
// Start folder tree from root
|
||||
display_folders(0, $client_id);
|
||||
displayFolders(0, $client_id);
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
|
||||
while ($row = mysqli_fetch_assoc($sql_custom_links)) {
|
||||
$custom_link_name = escapeHtml($row['custom_link_name']);
|
||||
$custom_link_uri = sanitize_url($row['custom_link_uri']);
|
||||
$custom_link_uri = escapeUrl($row['custom_link_uri']);
|
||||
$custom_link_icon = escapeHtml($row['custom_link_icon']);
|
||||
$custom_link_new_tab = intval($row['custom_link_new_tab']);
|
||||
if ($custom_link_new_tab == 1) {
|
||||
|
||||
@@ -30,9 +30,9 @@ $asset_make = escapeHtml($row['asset_make']);
|
||||
$asset_model = escapeHtml($row['asset_model']);
|
||||
$asset_serial = escapeHtml($row['asset_serial']);
|
||||
$asset_os = escapeHtml($row['asset_os']);
|
||||
$asset_uri = sanitize_url($row['asset_uri']);
|
||||
$asset_uri_2 = sanitize_url($row['asset_uri_2']);
|
||||
$asset_uri_client = sanitize_url($row['asset_uri_client']);
|
||||
$asset_uri = escapeUrl($row['asset_uri']);
|
||||
$asset_uri_2 = escapeUrl($row['asset_uri_2']);
|
||||
$asset_uri_client = escapeUrl($row['asset_uri_client']);
|
||||
$asset_status = escapeHtml($row['asset_status']);
|
||||
$asset_purchase_reference = escapeHtml($row['asset_purchase_reference']);
|
||||
$asset_purchase_date = escapeHtml($row['asset_purchase_date']);
|
||||
|
||||
@@ -66,7 +66,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" id="client_name" placeholder="Name or Company" maxlength="200" onfocusout="client_duplicate_check()" required autofocus>
|
||||
<input type="text" class="form-control" name="name" id="client_name" placeholder="Name or Company" maxlength="200" onfocusout="checkClientDuplicate()" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<input type="checkbox" name="lead" value="1" <?php if($leads_filter == 1){ echo "checked"; } ?>>
|
||||
@@ -393,7 +393,7 @@ ob_start();
|
||||
|
||||
<script>
|
||||
// Checks for duplicate clients
|
||||
function client_duplicate_check() {
|
||||
function checkClientDuplicate() {
|
||||
var name = document.getElementById("client_name").value;
|
||||
//Send a GET request to ajax.php as ajax.php?client_duplicate_check=true&name=NAME
|
||||
jQuery.get(
|
||||
|
||||
@@ -150,7 +150,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" id="contact_email" placeholder="Email Address" maxlength="200" onfocusout="contact_email_check()">
|
||||
<input type="email" class="form-control" name="email" id="contact_email" placeholder="Email Address" maxlength="200" onfocusout="checkContactEmail()">
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<span class="text-info" id="contact_check_info"></span>
|
||||
@@ -346,7 +346,7 @@ $(document).ready(function() {
|
||||
|
||||
<script>
|
||||
// Checks contact emails
|
||||
function contact_email_check() {
|
||||
function checkContactEmail() {
|
||||
var email = document.getElementById("contact_email").value;
|
||||
//Send a GET request to ajax.php as ajax.php?contact_email_check=true&email=email
|
||||
jQuery.get(
|
||||
|
||||
@@ -14,8 +14,8 @@ $credential_name = escapeHtml($row['credential_name']);
|
||||
$credential_description = escapeHtml($row['credential_description']);
|
||||
$credential_uri = escapeHtml($row['credential_uri']);
|
||||
$credential_uri_2 = escapeHtml($row['credential_uri_2']);
|
||||
$credential_uri_link = sanitize_url($row['credential_uri']);
|
||||
$credential_uri_2_link = sanitize_url($row['credential_uri_2']);
|
||||
$credential_uri_link = escapeUrl($row['credential_uri']);
|
||||
$credential_uri_2_link = escapeUrl($row['credential_uri_2']);
|
||||
$credential_username = escapeHtml(decryptCredentialEntry($row['credential_username']));
|
||||
$credential_password = escapeHtml(decryptCredentialEntry($row['credential_password']));
|
||||
$credential_otp_secret = escapeHtml($row['credential_otp_secret']);
|
||||
|
||||
@@ -67,7 +67,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" id="domain_name" placeholder="example.com" maxlength="200" required autofocus onfocusout="domain_check()">
|
||||
<input type="text" class="form-control" name="name" id="domain_name" placeholder="example.com" maxlength="200" required autofocus onfocusout="checkApexDomain()">
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<span class="text-info" id="domain_check_info"></span>
|
||||
@@ -200,7 +200,7 @@ ob_start();
|
||||
|
||||
<script>
|
||||
// Checks domains aren't sub-domains (99%)
|
||||
function domain_check() {
|
||||
function checkApexDomain() {
|
||||
var domain = document.getElementById("domain_name").value;
|
||||
//Send a GET request to ajax.php as ajax.php?apex_domain_check=true&domain=domain
|
||||
jQuery.get(
|
||||
|
||||
@@ -273,13 +273,13 @@ ob_start();
|
||||
mysqli_data_seek($sql_credentials, 0);
|
||||
while ($row = mysqli_fetch_assoc($sql_credentials)) {
|
||||
if (!empty($row['credential_uri'])) {
|
||||
$urls[] = sanitize_url($row['credential_uri']);
|
||||
$urls[] = escapeUrl($row['credential_uri']);
|
||||
}
|
||||
}
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
while ($row = mysqli_fetch_assoc($sql_assets)) {
|
||||
if (!empty($row['asset_uri'])) {
|
||||
$urls[] = sanitize_url($row['asset_uri']);
|
||||
$urls[] = escapeUrl($row['asset_uri']);
|
||||
}
|
||||
}
|
||||
$urls = array_unique($urls);
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
|
||||
while ($row = mysqli_fetch_assoc($sql_custom_links)) {
|
||||
$custom_link_name = escapeHtml($row['custom_link_name']);
|
||||
$custom_link_uri = sanitize_url($row['custom_link_uri']);
|
||||
$custom_link_uri = escapeUrl($row['custom_link_uri']);
|
||||
$custom_link_icon = escapeHtml($row['custom_link_icon']);
|
||||
$custom_link_new_tab = intval($row['custom_link_new_tab']);
|
||||
if ($custom_link_new_tab == 1) {
|
||||
|
||||
@@ -4,46 +4,6 @@ require_once "includes/inc_all_reports.php";
|
||||
|
||||
enforceUserPermission('module_support');
|
||||
|
||||
function secondsToTime($inputSeconds) {
|
||||
$inputSeconds = floor($inputSeconds);
|
||||
|
||||
$secondsInAMinute = 60;
|
||||
$secondsInAnHour = 60 * $secondsInAMinute;
|
||||
$secondsInADay = 24 * $secondsInAnHour;
|
||||
|
||||
// Extract days
|
||||
$days = floor($inputSeconds / $secondsInADay);
|
||||
|
||||
// Extract hours
|
||||
$hourSeconds = $inputSeconds % $secondsInADay;
|
||||
$hours = floor($hourSeconds / $secondsInAnHour);
|
||||
|
||||
// Extract minutes
|
||||
$minuteSeconds = $hourSeconds % $secondsInAnHour;
|
||||
$minutes = floor($minuteSeconds / $secondsInAMinute);
|
||||
|
||||
// Extract the remaining seconds
|
||||
$remainingSeconds = $minuteSeconds % $secondsInAMinute;
|
||||
$seconds = ceil($remainingSeconds);
|
||||
|
||||
// Format and return
|
||||
$timeParts = [];
|
||||
$sections = [
|
||||
'day' => (int)$days,
|
||||
'hour' => (int)$hours,
|
||||
'minute' => (int)$minutes,
|
||||
'second' => (int)$seconds,
|
||||
];
|
||||
|
||||
foreach ($sections as $name => $value){
|
||||
if ($value > 0) {
|
||||
$timeParts[] = $value. ' '.$name.($value == 1 ? '' : 's');
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $timeParts);
|
||||
}
|
||||
|
||||
if (isset($_GET['year'])) {
|
||||
$year = intval($_GET['year']);
|
||||
} else {
|
||||
|
||||
@@ -4,44 +4,6 @@ require_once "includes/inc_all_reports.php";
|
||||
|
||||
enforceUserPermission('module_sales', 1);
|
||||
|
||||
function secondsToTime($inputSeconds) {
|
||||
$secondsInAMinute = 60;
|
||||
$secondsInAnHour = 60 * $secondsInAMinute;
|
||||
$secondsInADay = 24 * $secondsInAnHour;
|
||||
|
||||
// Extract days
|
||||
$days = floor($inputSeconds / $secondsInADay);
|
||||
|
||||
// Extract hours
|
||||
$hourSeconds = $inputSeconds % $secondsInADay;
|
||||
$hours = floor($hourSeconds / $secondsInAnHour);
|
||||
|
||||
// Extract minutes
|
||||
$minuteSeconds = $hourSeconds % $secondsInAnHour;
|
||||
$minutes = floor($minuteSeconds / $secondsInAMinute);
|
||||
|
||||
// Extract the remaining seconds
|
||||
$remainingSeconds = $minuteSeconds % $secondsInAMinute;
|
||||
$seconds = ceil($remainingSeconds);
|
||||
|
||||
// Format and return
|
||||
$timeParts = [];
|
||||
$sections = [
|
||||
'day' => (int)$days,
|
||||
'hour' => (int)$hours,
|
||||
'minute' => (int)$minutes,
|
||||
'second' => (int)$seconds,
|
||||
];
|
||||
|
||||
foreach ($sections as $name => $value){
|
||||
if ($value > 0){
|
||||
$timeParts[] = $value. ' '.$name.($value == 1 ? '' : 's');
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $timeParts);
|
||||
}
|
||||
|
||||
if (isset($_GET['year'])) {
|
||||
$year = intval($_GET['year']);
|
||||
} else {
|
||||
|
||||
@@ -4,46 +4,6 @@ require_once "includes/inc_all_reports.php";
|
||||
|
||||
enforceUserPermission('module_support');
|
||||
|
||||
function secondsToTime($inputSeconds) {
|
||||
$inputSeconds = floor($inputSeconds);
|
||||
|
||||
$secondsInAMinute = 60;
|
||||
$secondsInAnHour = 60 * $secondsInAMinute;
|
||||
$secondsInADay = 24 * $secondsInAnHour;
|
||||
|
||||
// Extract days
|
||||
$days = floor($inputSeconds / $secondsInADay);
|
||||
|
||||
// Extract hours
|
||||
$hourSeconds = $inputSeconds % $secondsInADay;
|
||||
$hours = floor($hourSeconds / $secondsInAnHour);
|
||||
|
||||
// Extract minutes
|
||||
$minuteSeconds = $hourSeconds % $secondsInAnHour;
|
||||
$minutes = floor($minuteSeconds / $secondsInAMinute);
|
||||
|
||||
// Extract the remaining seconds
|
||||
$remainingSeconds = $minuteSeconds % $secondsInAMinute;
|
||||
$seconds = ceil($remainingSeconds);
|
||||
|
||||
// Format and return
|
||||
$timeParts = [];
|
||||
$sections = [
|
||||
'day' => (int)$days,
|
||||
'hour' => (int)$hours,
|
||||
'minute' => (int)$minutes,
|
||||
'second' => (int)$seconds,
|
||||
];
|
||||
|
||||
foreach ($sections as $name => $value){
|
||||
if ($value > 0){
|
||||
$timeParts[] = $value. ' '.$name.($value == 1 ? '' : 's');
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $timeParts);
|
||||
}
|
||||
|
||||
if (isset($_GET['year'])) {
|
||||
$year = intval($_GET['year']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user