mirror of
https://github.com/itflow-org/itflow
synced 2026-11-21 11:57:25 +00:00
QoL 50: sortLink and sortFirstOrder in functions/format.php replace the 48 copied sort_link closures and 115 hand-written header links, the first click on a new column sorts names A-Z and dates, money and counts newest or largest first, with changelog lines
This commit is contained in:
@@ -222,6 +222,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u
|
||||
- Menus, icons and questions: every More menu has the same ⋮ button, and Delete, Restore and Export each have one icon everywhere. The required-field star sits the same way on every form, and Incident response has the usual dark window with its warning in red. A question before an action names it on its button - Delete, Remove, Archive - rather than Yes. Resetting a ticket's timer, removing an approval request, redacting with nothing selected and a window that fails to open now use ITFlow's own question and message rather than the browser's. Every list's search box reads Search ..., with what it looks in shown when you point at it.
|
||||
- Dropdowns: the empty first choice reads the same way everywhere - - Select a client -, - Select an account - and so on where you pick one, - Any client -, - Any status - where a list is filtered, and - None -, - No contact -, - Nobody - where it can be left blank. They had said - Select Client -, - Pick a role -, - Which account -, - How it was paid -, - All Clients -, Not Assigned and the like.
|
||||
- Capitals: page and window titles, menu items and buttons are in Title Case - New Ticket, Mark Reviewed, Back Up Now, Turn Off Portal Access - and field labels, section headings, tabs and help are in sentence case - Postal code, Tax rate, Physical location - in the agent pages, Admin and the client portal alike. The settings pages in the menu are now Company Details, Invoices and Billing, Purchase Orders, Client Portal and Single Sign-on.
|
||||
- Lists: the first click on a column you aren't sorting by sorts names A-Z and dates, money and counts newest or largest first, and a second click flips it. It used to go the opposite way to the column you were on, so the first click could go either way.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -445,6 +446,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u
|
||||
- Code: `intval()` and `floatval()` in place of `(int)` and `(float)` casts, and `(string)` in place of `strval()`, as the rest of the code has them. `redirect()` in place of a raw `Location` header wherever `functions.php` is loaded - the sign-in check, the client portal's sign-up, join, reset and Microsoft 365 sign-in, the guest Knowledge Base and card payment pages and the tax package report. `redirect()`'s fallback for when output has already started writes the URL with `json_encode()` (tags, quotes and ampersands escaped) and `escapeHtml()` rather than `addslashes()` and a bare `htmlspecialchars()`. `escapeHtml()` replaces the last `htmlspecialchars()` on a page, and the plain-HTTP cookie notice goes through `flashAlert()` as a warning. Raw `mysqli_real_escape_string()` stays where HTML is stored (ticket details, replies, documents, signatures), since `escapeSql()` strips tags.
|
||||
- Confirms: `itflowConfirm({title, text, button, icon, danger})` in `js/confirm_modal.js` asks the SweetAlert question from script and resolves true when confirmed; `confirm-link` goes through it, and with no `data-confirm-button` takes the link's own text (three words or fewer) for the button. `fa-ellipsis-v`, `fa-trash`, `fa-redo` and `fa-download` are the icons for More, Delete, Restore and Export - `fa-redo-alt` stays for recurring and `fa-undo` for restoring a backup or a version.
|
||||
- UI text: titles, menu items and buttons in Title Case, with a, an, the, and, but, or, for, as, at, by, in, of, on, to, via, from, with and into lower case unless first or last, and a verb's particle capitalised (Turn Off, Back Up, Sign In); field labels, section headings, tabs and help in sentence case. Proper names and acronyms keep their capitals either way. The empty-state and header `'actions'` labels are buttons, so Title Case too.
|
||||
- Lists: `sortLink($column, $label, $first, $title, $class)` in `functions/format.php` draws a sortable column header from what `includes/filter_header.php` sets, and `sortFirstOrder()` picks the first direction from the column's name. It replaces the 48 copied `$sort_link` closures and the 115 header links written out by hand; a page with its own first directions passes `$first`.
|
||||
|
||||
## [26.11.8]
|
||||
|
||||
|
||||
@@ -69,10 +69,6 @@ if ($ready) {
|
||||
}
|
||||
|
||||
$state_badges = ['showing' => 'text-bg-success', 'scheduled' => 'text-bg-info', 'ended' => 'text-bg-secondary', 'archived' => 'text-bg-secondary'];
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) use ($client_filter) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'client' => $client_filter, 'show' => $view]));
|
||||
};
|
||||
@@ -127,10 +123,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('announcement_title', 'Banner') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('client_name', 'For') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('starts', 'From') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('ends', 'Until') ?></th>
|
||||
<th class="ps-3"><?= sortLink('announcement_title', 'Banner') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('client_name', 'For') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('starts', 'From') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('ends', 'Until') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -56,10 +56,6 @@ $unused = aiUseCaseMap()['unused'];
|
||||
$providers = mysqli_query($mysqli, "SELECT ai_provider_id, ai_provider_name, ai_provider_kind FROM ai_providers ORDER BY ai_provider_name");
|
||||
$any_provider = mysqli_num_rows($providers) > 0;
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$add_url = 'modals/ai/ai_model_edit.php' . ($provider_filter ? "?provider=$provider_filter" : '');
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
@@ -109,11 +105,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('ai_model_name', 'Model') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('ai_provider_name', 'Provider') ?></th>
|
||||
<th><?= $sort_link('ai_model_use_case', 'For') ?></th>
|
||||
<th class="ps-3"><?= sortLink('ai_model_name', 'Model') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('ai_provider_name', 'Provider') ?></th>
|
||||
<th><?= sortLink('ai_model_use_case', 'For') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Instructions</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('requests', 'Last 30 days') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('requests', 'Last 30 days') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -58,10 +58,6 @@ while ($model = mysqli_fetch_assoc($model_sql)) {
|
||||
$unused = aiUseCaseMap()['unused'];
|
||||
$any_provider = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FROM ai_providers"))[0]) > 0;
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$add_url = 'modals/ai/ai_provider_edit.php';
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
@@ -96,11 +92,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('ai_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('ai_provider_kind', 'Kind') ?></th>
|
||||
<th class="ps-3"><?= sortLink('ai_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('ai_provider_kind', 'Kind') ?></th>
|
||||
<th class="d-none d-md-table-cell">Key</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('model_count', 'Models') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('requests', 'Last 30 days') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('model_count', 'Models') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('requests', 'Last 30 days') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -91,10 +91,6 @@ $people = mysqli_query($mysqli, "SELECT DISTINCT user_id, user_name FROM ai_usag
|
||||
$model_row = $model_filter ? aiModelRow($model_filter) : null;
|
||||
$retention = appLogRetention();
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
// A view keeps the filters, and starts from its first page
|
||||
$view_url = function ($key) {
|
||||
$query = $_GET;
|
||||
@@ -204,13 +200,13 @@ $ms_text = function ($ms) {
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('ai_usage_id', 'When') ?></th>
|
||||
<th><?= $sort_link('ai_usage_feature', 'Feature') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('user_name', 'Who') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('client_name', 'Client') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('ai_usage_model', 'Model') ?></th>
|
||||
<th class="d-none d-sm-table-cell text-end"><?= $sort_link('tokens', 'Tokens') ?></th>
|
||||
<th class="d-none d-lg-table-cell text-end"><?= $sort_link('ai_usage_ms', 'Time') ?></th>
|
||||
<th class="ps-3"><?= sortLink('ai_usage_id', 'When') ?></th>
|
||||
<th><?= sortLink('ai_usage_feature', 'Feature') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('user_name', 'Who') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('ai_usage_model', 'Model') ?></th>
|
||||
<th class="d-none d-sm-table-cell text-end"><?= sortLink('tokens', 'Tokens') ?></th>
|
||||
<th class="d-none d-lg-table-cell text-end"><?= sortLink('ai_usage_ms', 'Time') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -62,10 +62,6 @@ $address_taken = apiKeyInAddressAccepted();
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(api_key_expire > '$today'), 0), COALESCE(SUM(api_key_expire <= '$today'), 0)
|
||||
FROM api_keys LEFT JOIN users ON user_id = api_key_user_id WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -138,10 +134,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" title="Select all on this page">
|
||||
</div>
|
||||
</th>
|
||||
<th><?= $sort_link('api_key_name', 'Key') ?> <span class="fw-normal text-body-secondary small ms-2"><?= $sort_link('api_key_expire', 'by expiry') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('user_name', 'Acts as') ?></th>
|
||||
<th><?= sortLink('api_key_name', 'Key') ?> <span class="fw-normal text-body-secondary small ms-2"><?= sortLink('api_key_expire', 'by expiry') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('user_name', 'Acts as') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Can open</th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('api_key_last_used_at', 'Last used') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('api_key_last_used_at', 'Last used') ?></th>
|
||||
<th class="d-none d-xl-table-cell text-end">Calls <span class="fw-normal text-body-secondary small">(30 days)</span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -59,10 +59,6 @@ $categories = appLogCategories();
|
||||
$any_filter = $q !== '' || $category_filter !== '' || $dtf !== '1970-01-01' || $dtt !== '2099-12-31';
|
||||
$retention = appLogRetention();
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
// A view keeps the filters, and starts from its first page
|
||||
$view_url = function ($key) {
|
||||
$query = $_GET;
|
||||
@@ -153,9 +149,9 @@ $filters_url = function ($modal) use ($dtf, $dtt, $view, $category_filter) {
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('app_log_created_at', 'When') ?></th>
|
||||
<th><?= $sort_link('app_log_type', 'Level') ?></th>
|
||||
<th><?= $sort_link('app_log_category', 'Category') ?></th>
|
||||
<th class="ps-3"><?= sortLink('app_log_created_at', 'When') ?></th>
|
||||
<th><?= sortLink('app_log_type', 'Level') ?></th>
|
||||
<th><?= sortLink('app_log_category', 'Category') ?></th>
|
||||
<th>Details</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -72,10 +72,6 @@ $entity_filter = is_scalar($_GET['entity'] ?? null) ? intval($_GET['entity']) :
|
||||
$more_filters = $action_filter !== '' || $entity_filter;
|
||||
$any_filter = $q !== '' || $client_filter || $user_filter !== '' || $type_filter !== '' || $action_filter !== '' || $entity_filter || $dtf !== '1970-01-01' || $dtt !== '2099-12-31';
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
// A view keeps the filters, and starts from its first page
|
||||
$view_url = function ($key) {
|
||||
$query = $_GET;
|
||||
@@ -211,12 +207,12 @@ $view_empty = [
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('log_created_at', 'When') ?></th>
|
||||
<th><?= $sort_link('user_name', 'Who') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('client_name', 'Client') ?></th>
|
||||
<th><?= $sort_link('log_type', 'What') ?></th>
|
||||
<th class="ps-3"><?= sortLink('log_created_at', 'When') ?></th>
|
||||
<th><?= sortLink('user_name', 'Who') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th><?= sortLink('log_type', 'What') ?></th>
|
||||
<th>Description</th>
|
||||
<th class="d-none d-xl-table-cell"><?= $sort_link('log_ip', 'From') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= sortLink('log_ip', 'From') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -173,10 +173,6 @@ $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS backup_id, backup_type,
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$type_looks = [
|
||||
BACKUP_TYPE_FULL => ['icon' => 'fa-box-open', 'tone' => 'itflow-asset-tone-server'],
|
||||
@@ -342,10 +338,10 @@ $status_looks = [
|
||||
<table class="table table-hover align-middle mb-0" data-backup-list>
|
||||
<thead class="table-light text-nowrap">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('backup_type', 'Backup') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('backup_created_at', 'Made') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('backup_size', 'Size') ?></th>
|
||||
<th><?= $sort_link('backup_status', 'Status') ?></th>
|
||||
<th class="ps-3"><?= sortLink('backup_type', 'Backup') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('backup_created_at', 'Made') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('backup_size', 'Size') ?></th>
|
||||
<th><?= sortLink('backup_status', 'Status') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -82,10 +82,6 @@ $counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', array
|
||||
}, $views)) . " FROM canned_responses WHERE $filters"));
|
||||
$view_counts = array_combine(array_keys($views), $counts);
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) use ($category_filter) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'category' => $category_filter, 'show' => $view]));
|
||||
};
|
||||
@@ -155,10 +151,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('canned_response_name', 'Response') ?></th>
|
||||
<th class="ps-3"><?= sortLink('canned_response_name', 'Response') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Offered on</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('use_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('use_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -82,9 +82,8 @@ while ($row = mysqli_fetch_row($sql)) {
|
||||
}
|
||||
|
||||
// A column first sorts the way it reads best - A to Z, most used, first to last - then flips
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon, $sort_first) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . ($sort === $column ? $disp : $sort_first[$column]) . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
$sort_link = function ($column, $label) use ($sort_first) {
|
||||
return sortLink($column, $label, $sort_first[$column] ?? null);
|
||||
};
|
||||
$pill_url = function ($archived) use ($kind) {
|
||||
return '?' . http_build_query(array_filter(['category' => $kind, 'q' => $_GET['q'] ?? '', 'show' => $archived ? 'archived' : '']));
|
||||
|
||||
@@ -59,10 +59,6 @@ foreach (CONTRACT_SLA_PRIORITIES as $priority => $part) {
|
||||
$template_default_slas[$priority] = intval(getTicketSlaId(0, $priority, false));
|
||||
}
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view]));
|
||||
};
|
||||
@@ -103,10 +99,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('contract_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('contract_template_term_months', 'Term') ?></th>
|
||||
<th class="ps-3"><?= sortLink('contract_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('contract_template_term_months', 'Term') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Cover</th>
|
||||
<th class="text-end"><?= $sort_link('contracts', 'Contracts') ?></th>
|
||||
<th class="text-end"><?= sortLink('contracts', 'Contracts') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -234,9 +234,8 @@ uasort($jobs, function ($a, $b) use ($sort_keys, $sort, $order) {
|
||||
});
|
||||
// A heading sorts its own way round first - names A to Z, the latest run and what needs a look at the top - then the other
|
||||
$sort_first = ['job' => 'ASC', 'schedule' => 'ASC', 'last_run' => 'DESC', 'status' => 'ASC'];
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon, $sort_first) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . ($sort === $column ? $disp : $sort_first[$column]) . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
$sort_link = function ($column, $label) use ($sort_first) {
|
||||
return sortLink($column, $label, $sort_first[$column] ?? null);
|
||||
};
|
||||
|
||||
$status_looks = [
|
||||
|
||||
@@ -60,10 +60,6 @@ $view_counts = array_combine(array_keys($views), $counts);
|
||||
// Dragging into order: one menu's links, in its order, with nothing searched
|
||||
$can_reorder = $show_location && $sort === 'custom_link_order' && $order === 'ASC' && $q === '' && $num_rows[0] > 1;
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view]));
|
||||
};
|
||||
@@ -105,11 +101,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<?php if ($can_reorder) { ?><th style="width: 1%"><span class="visually-hidden">Order</span></th><?php } ?>
|
||||
<th class="<?= $can_reorder ? 'ps-0' : 'ps-3' ?>"><?= $sort_link('custom_link_name', 'Link') ?></th>
|
||||
<th class="<?= $can_reorder ? 'ps-0' : 'ps-3' ?>"><?= sortLink('custom_link_name', 'Link') ?></th>
|
||||
<?php if (!$show_location) { ?>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('custom_link_location', 'Shows in') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('custom_link_location', 'Shows in') ?></th>
|
||||
<?php } ?>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('custom_link_uri', 'Goes to') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('custom_link_uri', 'Goes to') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -80,10 +80,6 @@ foreach ($rows as $template_id => $row) {
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(document_template_archived_at IS NULL), 0), COALESCE(SUM(document_template_archived_at IS NOT NULL), 0),
|
||||
COALESCE(SUM(document_template_archived_at IS NULL AND document_template_required > 0), 0) FROM document_templates WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view]));
|
||||
};
|
||||
@@ -142,10 +138,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('document_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('changed_at', 'Changed') ?></th>
|
||||
<th class="ps-3"><?= sortLink('document_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('changed_at', 'Changed') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -78,10 +78,6 @@ usort($rows, function ($a, $b) use ($key, $order) {
|
||||
$num_rows = [count($rows)];
|
||||
$rows = array_slice($rows, $record_from, $record_to);
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view]));
|
||||
};
|
||||
@@ -128,9 +124,9 @@ $money = function ($amount) use ($currency_format, $session_company_currency) {
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('user_name', 'Agent') ?></th>
|
||||
<th><?= $sort_link('now', 'Cost per hour now') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('since', 'Since') ?></th>
|
||||
<th class="ps-3"><?= sortLink('user_name', 'Agent') ?></th>
|
||||
<th><?= sortLink('now', 'Cost per hour now') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('since', 'Since') ?></th>
|
||||
<th class="d-none d-sm-table-cell">Rates</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -56,10 +56,6 @@ $counts = array_combine(array_keys($tabs), array_map('intval', mysqli_fetch_row(
|
||||
|
||||
$health = mailQueueHealth();
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($show) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $show, 'canned_date' => $_GET['canned_date'] ?? '', 'dtf' => $_GET['dtf'] ?? '', 'dtt' => $_GET['dtt'] ?? '']));
|
||||
};
|
||||
@@ -171,10 +167,10 @@ $filtered_dates = isset($_GET['dtf']) && $_GET['dtf'] !== '' && $_GET['dtf'] !==
|
||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" title="Select all on this page">
|
||||
</div>
|
||||
</th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('email_status', 'Status') ?></th>
|
||||
<th><?= $sort_link('email_recipient', 'To') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('email_subject', 'Subject') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('email_queued_at', 'Queued') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('email_status', 'Status') ?></th>
|
||||
<th><?= sortLink('email_recipient', 'To') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('email_subject', 'Subject') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('email_queued_at', 'Queued') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -58,10 +58,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(managed_instance_archived_at IS NULL), 0), COALESCE(SUM(managed_instance_archived_at IS NOT NULL), 0)
|
||||
FROM managed_instances LEFT JOIN clients ON client_id = managed_instance_client_id WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -96,11 +92,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('managed_instance_name', 'Instance') ?> <span class="fw-normal text-body-secondary small ms-2"><?= $sort_link('client_name', 'by client') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('managed_instance_version', 'Version') ?></th>
|
||||
<th class="ps-3"><?= sortLink('managed_instance_name', 'Instance') ?> <span class="fw-normal text-body-secondary small ms-2"><?= sortLink('client_name', 'by client') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('managed_instance_version', 'Version') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Health</th>
|
||||
<th class="d-none d-xl-table-cell">Agents</th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('managed_instance_last_checkin_at', 'Last check-in') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('managed_instance_last_checkin_at', 'Last check-in') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -44,9 +44,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th class="ps-3">
|
||||
<a class="text-dark" href="?<?= $url_query_strings_sort ?>&sort=module_name&order=<?= $disp ?>">
|
||||
Module <?php if ($sort == 'module_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('module_name', 'Module') ?>
|
||||
</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
|
||||
@@ -65,10 +65,6 @@ $rows = array_slice($rows, $record_from, $record_to);
|
||||
|
||||
$missing = $show === '' && $search === '' ? paymentMethodsNotSetUp() : [];
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view]));
|
||||
};
|
||||
@@ -128,10 +124,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('payment_method_name', 'Method') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('payment_method_use', 'For') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('used', 'Used on') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="ps-3"><?= sortLink('payment_method_name', 'Method') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('payment_method_use', 'For') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('used', 'Used on') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -57,10 +57,6 @@ $set_up = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(DISTINCT p
|
||||
. implode("', '", array_map('escapeSql', array_keys(paymentProviderKinds()))) . "')"))[0]);
|
||||
$can_add = $set_up < count(paymentProviderKinds());
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$add_url = 'modals/payment_provider/payment_provider_add.php';
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
@@ -93,12 +89,12 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('payment_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('account_name', 'Payments go into') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('payment_provider_threshold', 'Card limit') ?></th>
|
||||
<th class="ps-3"><?= sortLink('payment_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('account_name', 'Payments go into') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('payment_provider_threshold', 'Card limit') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Fees</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('saved_cards', 'Saved cards') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_paid', 'Card payments') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('saved_cards', 'Saved cards') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_paid', 'Card payments') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -43,10 +43,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(project_template_archived_at IS NULL), 0), COALESCE(SUM(project_template_archived_at IS NOT NULL), 0) FROM project_templates WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
?>
|
||||
|
||||
@@ -80,10 +76,10 @@ $sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $di
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('project_template_name', 'Template') ?></th>
|
||||
<th class="text-center"><?= $sort_link('ticket_count', 'Tickets') ?></th>
|
||||
<th class="text-center"><?= $sort_link('task_count', 'Tasks') ?></th>
|
||||
<th><?= $sort_link('project_template_updated_at', 'Updated') ?></th>
|
||||
<th class="ps-3"><?= sortLink('project_template_name', 'Template') ?></th>
|
||||
<th class="text-center"><?= sortLink('ticket_count', 'Tickets') ?></th>
|
||||
<th class="text-center"><?= sortLink('task_count', 'Tasks') ?></th>
|
||||
<th><?= sortLink('project_template_updated_at', 'Updated') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -86,10 +86,6 @@ if ($suggestions) {
|
||||
}
|
||||
}
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$dashboard = rmmDashboardUrl($provider);
|
||||
$devices_in = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FROM rmm_devices WHERE rmm_device_provider_id = $provider_id AND rmm_device_removed_at IS NULL AND rmm_device_asset_id > 0"))[0]);
|
||||
@@ -176,10 +172,10 @@ $devices_in = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FRO
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('rmm_client_name', escapeHtml("$short client")) ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('rmm_client_devices', 'Devices') ?></th>
|
||||
<th><?= $sort_link('client_name', 'ITFlow client') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('rmm_client_synced_at', 'Brought in') ?></th>
|
||||
<th class="ps-3"><?= sortLink('rmm_client_name', escapeHtml("$short client")) ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('rmm_client_devices', 'Devices') ?></th>
|
||||
<th><?= sortLink('client_name', 'ITFlow client') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('rmm_client_synced_at', 'Brought in') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -66,10 +66,6 @@ $cron_on = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT config_enable_c
|
||||
$job = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT cron_job_enabled FROM cron_jobs WHERE cron_job_name = 'rmm_sync' LIMIT 1"));
|
||||
$job_on = !$job || intval($job['cron_job_enabled']) === 1;
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$add_url = 'modals/rmm/rmm_provider_add.php';
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
@@ -104,12 +100,12 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('rmm_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('rmm_provider_kind', 'Kind') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('clients_linked', 'Clients') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('devices_in', 'Devices') ?></th>
|
||||
<th class="ps-3"><?= sortLink('rmm_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('rmm_provider_kind', 'Kind') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('clients_linked', 'Clients') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('devices_in', 'Devices') ?></th>
|
||||
<?php if ($alerts_ready) { ?><th class="d-none d-lg-table-cell">Alerts</th><?php } ?>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('rmm_provider_sync_at', 'Last sync') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('rmm_provider_sync_at', 'Last sync') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -54,10 +54,6 @@ $agents = roleAgents(array_keys($roles), 5);
|
||||
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(role_archived_at IS NULL), 0), COALESCE(SUM(role_archived_at IS NOT NULL), 0) FROM user_roles WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -91,10 +87,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('role_name', 'Role') ?></th>
|
||||
<th class="ps-3"><?= sortLink('role_name', 'Role') ?></th>
|
||||
<th class="d-none d-md-table-cell">Access</th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('agents', 'Agents') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('role_updated_at', 'Updated') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('agents', 'Agents') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('role_updated_at', 'Updated') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -81,10 +81,6 @@ $clients = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients
|
||||
WHERE client_id IN (SELECT saved_payment_client_id FROM client_saved_payment_methods) OR client_id = $client_filter ORDER BY client_name ASC");
|
||||
$provider_count = mysqli_num_rows($providers);
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($show) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'provider' => $_GET['provider'] ?? '', 'client' => $_GET['client'] ?? '', 'show' => $show]));
|
||||
};
|
||||
@@ -142,11 +138,11 @@ $page_title = 'Saved Cards';
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('client_name', 'Client') ?></th>
|
||||
<th><?= $sort_link('saved_payment_description', 'Card') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('expires', 'Expires') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('autopay', 'Autopay') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('saved_payment_created_at', 'Saved') ?></th>
|
||||
<th class="ps-3"><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th><?= sortLink('saved_payment_description', 'Card') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('expires', 'Expires') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('autopay', 'Autopay') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('saved_payment_created_at', 'Saved') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -144,10 +144,6 @@ if ($view === 'ips') {
|
||||
}
|
||||
}
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
// A view keeps the search and dates, and starts from the top
|
||||
$view_url = function ($key) {
|
||||
$query = array_diff_key($_GET, ['page' => 1, 'sort' => 1, 'order' => 1]);
|
||||
@@ -207,22 +203,22 @@ $audit_url = function (array $query) use ($dates_query) {
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<?php if ($view === 'ips') { ?>
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('log_ip', 'IP address') ?></th>
|
||||
<th><?= $sort_link('accounts', 'Accounts tried') ?></th>
|
||||
<th class="text-end"><?= $sort_link('sign_ins', 'Sign-ins') ?></th>
|
||||
<th class="text-end"><?= $sort_link('failures', 'Failed') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('first_seen', 'First seen') ?></th>
|
||||
<th><?= $sort_link('last_seen', 'Last seen') ?></th>
|
||||
<th class="ps-3"><?= sortLink('log_ip', 'IP address') ?></th>
|
||||
<th><?= sortLink('accounts', 'Accounts tried') ?></th>
|
||||
<th class="text-end"><?= sortLink('sign_ins', 'Sign-ins') ?></th>
|
||||
<th class="text-end"><?= sortLink('failures', 'Failed') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('first_seen', 'First seen') ?></th>
|
||||
<th><?= sortLink('last_seen', 'Last seen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('user_name', 'Who') ?></th>
|
||||
<th class="ps-3"><?= sortLink('user_name', 'Who') ?></th>
|
||||
<th class="d-none d-md-table-cell">Last sign in</th>
|
||||
<th class="text-end"><?= $sort_link('sign_ins', 'Sign-ins') ?></th>
|
||||
<th class="text-end"><?= $sort_link('failures', 'Failed') ?></th>
|
||||
<th class="text-end d-none d-sm-table-cell"><?= $sort_link('ips', 'IP addresses') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('last_seen', 'Last seen') ?></th>
|
||||
<th class="text-end"><?= sortLink('sign_ins', 'Sign-ins') ?></th>
|
||||
<th class="text-end"><?= sortLink('failures', 'Failed') ?></th>
|
||||
<th class="text-end d-none d-sm-table-cell"><?= sortLink('ips', 'IP addresses') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('last_seen', 'Last seen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
@@ -208,9 +208,8 @@ $day_distance = function ($date) use ($today) {
|
||||
// A heading sorts its own way round first - names A to Z, the shortest target and the most used at the top - then the other
|
||||
$sort_first = ['sla_name' => 'ASC', 'sla_response_minutes' => 'ASC', 'sla_resolution_minutes' => 'ASC', 'tickets' => 'DESC',
|
||||
'holiday_name' => 'ASC', 'holiday_date' => $show === 'past' ? 'DESC' : 'ASC'];
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon, $sort_first) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . ($sort === $column ? $disp : $sort_first[$column]) . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
$sort_link = function ($column, $label) use ($sort_first) {
|
||||
return sortLink($column, $label, $sort_first[$column] ?? null);
|
||||
};
|
||||
// A view keeps the search only on its own side - a name typed for an SLA is no use against closure days
|
||||
$pill_url = function ($view) use ($on_days) {
|
||||
|
||||
@@ -95,10 +95,6 @@ foreach ($rows as $template_id => $row) {
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(software_template_archived_at IS NULL), 0), COALESCE(SUM(software_template_archived_at IS NOT NULL), 0),
|
||||
COALESCE(SUM(software_template_archived_at IS NULL AND software_template_required > 0), 0) FROM software_templates $joins WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($show) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $show]));
|
||||
};
|
||||
@@ -157,12 +153,12 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('software_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('software_template_type', 'Type') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= $sort_link('software_template_license_type', 'License type') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('changed_at', 'Changed') ?></th>
|
||||
<th class="ps-3"><?= sortLink('software_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('software_template_type', 'Type') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= sortLink('software_template_license_type', 'License type') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('changed_at', 'Changed') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -69,10 +69,6 @@ while ($row = mysqli_fetch_row($sql)) {
|
||||
$kind_counts[intval($row[0])] = intval($row[1]);
|
||||
}
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($archived) use ($type) {
|
||||
return '?' . http_build_query(array_filter(['type' => $type, 'q' => $_GET['q'] ?? '', 'show' => $archived ? 'archived' : '']));
|
||||
};
|
||||
@@ -169,8 +165,8 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" title="Select all on this page">
|
||||
</div>
|
||||
</th>
|
||||
<th><?= $sort_link('tag_name', 'Tag') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('used', 'On') ?></th>
|
||||
<th><?= sortLink('tag_name', 'Tag') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('used', 'On') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -63,10 +63,6 @@ $used_text = function (array $u) {
|
||||
return $parts;
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
?>
|
||||
|
||||
@@ -101,9 +97,9 @@ $sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $di
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('tax_name', 'Tax') ?></th>
|
||||
<th><?= $sort_link('tax_percent', 'Rate') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('invoice_count', 'Used on') ?></th>
|
||||
<th class="ps-3"><?= sortLink('tax_name', 'Tax') ?></th>
|
||||
<th><?= sortLink('tax_percent', 'Rate') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('invoice_count', 'Used on') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -62,10 +62,6 @@ foreach ($tabs as $key => [, , $where]) {
|
||||
}
|
||||
$counts = array_combine(array_keys($tabs), array_map('intval', mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', $count_sql) . " FROM sms_messages $joins WHERE $search"))));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($show) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $show, 'canned_date' => $_GET['canned_date'] ?? '', 'dtf' => $_GET['dtf'] ?? '', 'dtt' => $_GET['dtt'] ?? '']));
|
||||
};
|
||||
@@ -163,10 +159,10 @@ $ready = smsReady();
|
||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" title="Select all on this page">
|
||||
</div>
|
||||
</th>
|
||||
<th class="d-none d-sm-table-cell"><?= $sort_link('sms_message_status', 'Status') ?></th>
|
||||
<th><?= $sort_link('sms_message_number', 'With') ?></th>
|
||||
<th class="d-none d-sm-table-cell"><?= sortLink('sms_message_status', 'Status') ?></th>
|
||||
<th><?= sortLink('sms_message_number', 'With') ?></th>
|
||||
<th class="d-none d-md-table-cell">Text</th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('sms_message_created_at', 'When') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('sms_message_created_at', 'When') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -49,10 +49,6 @@ $numbers = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(sms_numbe
|
||||
$opted_out = intval($numbers[0]);
|
||||
$blocked = intval($numbers[1]);
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$add_url = 'modals/sms_provider/sms_provider_add.php';
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
@@ -93,10 +89,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('sms_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('sms_provider_number', 'Number') ?></th>
|
||||
<th class="ps-3"><?= sortLink('sms_provider_name', 'Provider') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('sms_provider_number', 'Number') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Texts come back to</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('sms_provider_last_inbound_at', 'Last text in') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('sms_provider_last_inbound_at', 'Last text in') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -56,10 +56,6 @@ $view_counts = array_combine(array_keys($views), $counts);
|
||||
// Dragging into order: the ones in use, in their order, with nothing searched
|
||||
$can_reorder = $show === '' && $sort === 'ticket_status_order' && $order === 'ASC' && $q === '' && $num_rows[0] > 1;
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view]));
|
||||
};
|
||||
@@ -100,9 +96,9 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<?php if ($can_reorder) { ?><th style="width: 1%"><span class="visually-hidden">Order</span></th><?php } ?>
|
||||
<th class="<?= $can_reorder ? 'ps-0' : 'ps-3' ?>"><?= $sort_link('ticket_status_name', 'Status') ?></th>
|
||||
<th class="text-end"><?= $sort_link('tickets', 'Tickets') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('ticket_status_pauses_sla', 'SLA clock') ?></th>
|
||||
<th class="<?= $can_reorder ? 'ps-0' : 'ps-3' ?>"><?= sortLink('ticket_status_name', 'Status') ?></th>
|
||||
<th class="text-end"><?= sortLink('tickets', 'Tickets') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('ticket_status_pauses_sla', 'SLA clock') ?></th>
|
||||
<th class="d-none d-lg-table-cell">When the client replies</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -71,10 +71,6 @@ if ($templates) {
|
||||
|
||||
$counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(ticket_template_archived_at IS NULL), 0), COALESCE(SUM(ticket_template_archived_at IS NOT NULL), 0) FROM ticket_templates WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -130,11 +126,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('ticket_template_name', 'Template') ?></th>
|
||||
<th class="ps-3"><?= sortLink('ticket_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Sets up</th>
|
||||
<th class="d-none d-sm-table-cell text-center"><?= $sort_link('task_count', 'Tasks') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-sm-table-cell text-center"><?= sortLink('task_count', 'Tasks') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -219,10 +219,6 @@ $filter_url = function ($changes) {
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -424,10 +420,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" onclick="checkAll(this)" title="Select all on this page">
|
||||
</div>
|
||||
</th>
|
||||
<th><?= $sort_link('user_name', 'Contact') ?> <span class="fw-normal text-body-secondary small ms-2"><?= $sort_link('user_email', 'by email') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('client_name', 'Client') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('user_status', 'Sign in') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('last_login', 'Last signed in') ?></th>
|
||||
<th><?= sortLink('user_name', 'Contact') ?> <span class="fw-normal text-body-secondary small ms-2"><?= sortLink('user_email', 'by email') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('user_status', 'Sign in') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('last_login', 'Last signed in') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -561,11 +557,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0 itflow-asset-table itflow-ticket-list itflow-user-list" data-user-invites>
|
||||
<thead class="<?php if (!$invites) { echo "d-none"; } ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th><?= $sort_link('user_name', 'Invited') ?> <span class="fw-normal text-body-secondary small ms-2"><?= $sort_link('user_email', 'by email') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('role_name', 'Role') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('user_status', 'Invite') ?></th>
|
||||
<th><?= sortLink('user_name', 'Invited') ?> <span class="fw-normal text-body-secondary small ms-2"><?= sortLink('user_email', 'by email') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('role_name', 'Role') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('user_status', 'Invite') ?></th>
|
||||
<th class="d-none d-xl-table-cell">Clients</th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('user_created_at', 'Invited by') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('user_created_at', 'Invited by') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -683,11 +679,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" onclick="checkAll(this)" title="Select all on this page">
|
||||
</div>
|
||||
</th>
|
||||
<th><?= $sort_link('user_name', 'User') ?> <span class="fw-normal text-body-secondary small ms-2"><?= $sort_link('user_email', 'by email') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('role_name', 'Role') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('user_status', 'Sign in') ?></th>
|
||||
<th><?= sortLink('user_name', 'User') ?> <span class="fw-normal text-body-secondary small ms-2"><?= sortLink('user_email', 'by email') ?></span></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('role_name', 'Role') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('user_status', 'Sign in') ?></th>
|
||||
<th class="d-none d-xl-table-cell">Clients</th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('last_login', 'Last signed in') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('last_login', 'Last signed in') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -104,10 +104,6 @@ $counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(SUM(vendor_tem
|
||||
COALESCE(SUM(vendor_template_archived_at IS NULL AND vendor_template_required > 0), 0), COALESCE(SUM(vendor_template_archived_at IS NULL AND vendor_template_id IN ($out_ids)), 0)
|
||||
FROM vendor_templates WHERE $search"));
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($show) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $show]));
|
||||
};
|
||||
@@ -174,11 +170,11 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('vendor_template_name', 'Template') ?></th>
|
||||
<th class="ps-3"><?= sortLink('vendor_template_name', 'Template') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Support</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('changed_at', 'Changed') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('used_count', 'Used') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('changed_at', 'Changed') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -139,24 +139,16 @@ while ($row = mysqli_fetch_assoc($sql_clients)) {
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=archived_name&order=<?= $disp ?>">
|
||||
Name <?php if ($sort == 'archived_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('archived_name', 'Name') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=archived_kind&order=<?= $disp ?>">
|
||||
Kind <?php if ($sort == 'archived_kind') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('archived_kind', 'Kind') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=archived_at&order=<?= $disp ?>">
|
||||
Archived <?php if ($sort == 'archived_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('archived_at', 'Archived') ?>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -485,39 +485,27 @@ $search_noun = $type_filter ? $asset_type_tabs[$type_filter]['label'] : 'assets'
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_name&order=<?= $disp ?>">
|
||||
Name <?php if ($sort == 'asset_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_name', 'Name') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_type&order=<?= $disp ?>">
|
||||
Type / OS <?php if ($sort == 'asset_type') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_type', 'Type / OS') ?>
|
||||
</th>
|
||||
<?php if ($show_model) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_make&order=<?= $disp ?>">
|
||||
Model / Serial <?php if ($sort == 'asset_make') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_make', 'Model / Serial') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=interface_ip&order=<?= $disp ?>">
|
||||
IP <?php if ($sort == 'interface_ip') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('interface_ip', 'IP') ?>
|
||||
</th>
|
||||
<?php if ($show_mac) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=interface_mac&order=<?= $disp ?>">
|
||||
MAC <?php if ($sort == 'interface_mac') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('interface_mac', 'MAC') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<?php if ($show_purchase) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_purchase_date&order=<?= $disp ?>">
|
||||
Purchased <?php if ($sort == 'asset_purchase_date') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_purchase_date', 'Purchased') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<?php if ($show_details) { ?>
|
||||
@@ -525,40 +513,28 @@ $search_noun = $type_filter ? $asset_type_tabs[$type_filter]['label'] : 'assets'
|
||||
<?php } ?>
|
||||
<?php if ($show_install) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_install_date&order=<?= $disp ?>">
|
||||
Installed <?php if ($sort == 'asset_install_date') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_install_date', 'Installed') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<?php if ($show_warranty) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_warranty_expire&order=<?= $disp ?>">
|
||||
Warranty <?php if ($sort == 'asset_warranty_expire') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_warranty_expire', 'Warranty') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<?php if ($show_contact) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=contact_name&order=<?= $disp ?>">
|
||||
Assigned To <?php if ($sort == 'contact_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('contact_name', 'Assigned To') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=location_name&order=<?= $disp ?>">
|
||||
Location <?php if ($sort == 'location_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('location_name', 'Location') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=asset_status&order=<?= $disp ?>">
|
||||
Status <?php if ($sort == 'asset_status') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('asset_status', 'Status') ?>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -81,10 +81,6 @@ $entity_filter = is_scalar($_GET['entity'] ?? null) ? intval($_GET['entity']) :
|
||||
$more_filters = $action_filter !== '' || $entity_filter;
|
||||
$any_filter = $q !== '' || $user_filter !== '' || $type_filter !== '' || $action_filter !== '' || $entity_filter || $dtf !== '1970-01-01' || $dtt !== '2099-12-31';
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$view_url = function ($key) {
|
||||
$query = $_GET;
|
||||
unset($query['page']);
|
||||
@@ -200,11 +196,11 @@ $view_empty = [
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('log_created_at', 'When') ?></th>
|
||||
<th><?= $sort_link('user_name', 'Who') ?></th>
|
||||
<th><?= $sort_link('log_type', 'What') ?></th>
|
||||
<th class="ps-3"><?= sortLink('log_created_at', 'When') ?></th>
|
||||
<th><?= sortLink('user_name', 'Who') ?></th>
|
||||
<th><?= sortLink('log_type', 'What') ?></th>
|
||||
<th>Description</th>
|
||||
<th class="d-none d-xl-table-cell"><?= $sort_link('log_ip', 'From') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= sortLink('log_ip', 'From') ?></th>
|
||||
<?php if ($session_is_admin) { ?><th></th><?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -282,35 +282,23 @@ $export_extra = [
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=certificate_name&order=<?= $disp ?>">
|
||||
Certificate <?php if ($sort == 'certificate_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('certificate_name', 'Certificate') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=certificate_domain&order=<?= $disp ?>">
|
||||
Host <?php if ($sort == 'certificate_domain') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('certificate_domain', 'Host') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=certificate_issued_by&order=<?= $disp ?>">
|
||||
Issuer <?php if ($sort == 'certificate_issued_by') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('certificate_issued_by', 'Issuer') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=certificate_expire&order=<?= $disp ?>">
|
||||
Expires <?php if ($sort == 'certificate_expire') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('certificate_expire', 'Expires') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=certificate_checked_at&order=<?= $disp ?>">
|
||||
Last check <?php if ($sort == 'certificate_checked_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('certificate_checked_at', 'Last check') ?>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -474,22 +474,16 @@ $search_title = $invites_view ? 'Email, name or client' : 'Name, title, email, p
|
||||
<thead class="<?php if (!$num_rows[0]) { echo "d-none"; } ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th class="ps-3">
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invite_email&order=<?= $disp ?>">
|
||||
Invited <?php if ($sort == 'invite_email') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('invite_email', 'Invited') ?>
|
||||
</th>
|
||||
<th class="d-none d-md-table-cell">Sees</th>
|
||||
<th class="d-none d-sm-table-cell">
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invite_created_at&order=<?= $disp ?>">
|
||||
Sent <?php if ($sort == 'invite_created_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('invite_created_at', 'Sent') ?>
|
||||
</th>
|
||||
<th>Link</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="position-relative"><span class="visually-hidden">Actions</span></th>
|
||||
@@ -562,26 +556,18 @@ $search_title = $invites_view ? 'Email, name or client' : 'Name, title, email, p
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=contact_name&order=<?= $disp ?>">
|
||||
Name <?php if ($sort == 'contact_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('contact_name', 'Name') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=contact_email&order=<?= $disp ?>">
|
||||
Reach <?php if ($sort == 'contact_email') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('contact_email', 'Reach') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=location_name&order=<?= $disp ?>">
|
||||
Location <?php if ($sort == 'location_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('location_name', 'Location') ?>
|
||||
</th>
|
||||
<th class="d-none d-lg-table-cell">Linked</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="position-relative"><span class="visually-hidden">Actions</span></th>
|
||||
|
||||
@@ -117,10 +117,6 @@ $filter_url = function ($changes) {
|
||||
unset($params['page']);
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$add_url = 'modals/contract/contract_add.php' . ($client_url ? "?client_id=$client_id" : '');
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -221,13 +217,13 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="<?= $num_rows[0] ? '' : 'd-none' ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('contract_name', 'Contract') ?></th>
|
||||
<th class="ps-3"><?= sortLink('contract_name', 'Contract') ?></th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th><?= $sort_link('client_name', 'Client') ?></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<?php } ?>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('contract_start_date', 'Term') ?></th>
|
||||
<th><?= $sort_link('contract_end_date', 'Renewal') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= $sort_link('owner_name', 'Owner') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('contract_start_date', 'Term') ?></th>
|
||||
<th><?= sortLink('contract_end_date', 'Renewal') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= sortLink('owner_name', 'Owner') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -325,22 +325,16 @@ $filter_url = function ($changes) use ($client_url) {
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=credential_name&order=<?= $disp ?>">
|
||||
Credential <?php if ($sort == 'credential_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('credential_name', 'Credential') ?>
|
||||
</th>
|
||||
<th>Login</th>
|
||||
<th>For</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=credential_password_changed_at&order=<?= $disp ?>">
|
||||
Changed <?php if ($sort == 'credential_password_changed_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('credential_password_changed_at', 'Changed') ?>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -314,26 +314,18 @@ $bulk_vendor_options = $can_edit ? domainVendorChoices($client_url ? $client_id
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=domain_name&order=<?= $disp ?>">
|
||||
Domain <?php if ($sort == 'domain_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('domain_name', 'Domain') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=domain_expire&order=<?= $disp ?>">
|
||||
Expires <?php if ($sort == 'domain_expire') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('domain_expire', 'Expires') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=registrar_name&order=<?= $disp ?>">
|
||||
Registrar and hosts <?php if ($sort == 'registrar_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('registrar_name', 'Registrar and hosts') ?>
|
||||
</th>
|
||||
<th>Email</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -337,12 +337,12 @@ $month_change = $stats['last_to_date'] > 0 ? round(($stats['month'] - $stats['la
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=expense_date&order=<?= $disp ?>">Date <?php if ($sort == 'expense_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_name&order=<?= $disp ?>">Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=category_name&order=<?= $disp ?>">Category <?php if ($sort == 'category_name') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=account_name&order=<?= $disp ?>">Paid from <?php if ($sort == 'account_name') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=expense_amount&order=<?= $disp ?>">Amount <?php if ($sort == 'expense_amount') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('expense_date', 'Date') ?></th>
|
||||
<th><?= sortLink('vendor_name', 'Vendor') ?></th>
|
||||
<th><?= sortLink('category_name', 'Category') ?></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th><?= sortLink('account_name', 'Paid from') ?></th>
|
||||
<th class="text-end"><?= sortLink('expense_amount', 'Amount') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -288,14 +288,14 @@ $invoices_url = 'invoices.php?' . ($client_page ? "client_id=$client_id&" : '')
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=income_date&order=<?= $disp ?>">Date <?php if ($sort == 'income_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=income_type&order=<?= $disp ?>">From <?php if ($sort == 'income_type') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=category_name&order=<?= $disp ?>">Category <?php if ($sort == 'category_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('income_date', 'Date') ?></th>
|
||||
<th><?= sortLink('income_type', 'From') ?></th>
|
||||
<th><?= sortLink('category_name', 'Category') ?></th>
|
||||
<?php if (!$client_page) { ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<?php } ?>
|
||||
<?php if (moduleOn('bookkeeping')) { ?><th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=account_name&order=<?= $disp ?>">Paid into <?php if ($sort == 'account_name') { echo $order_icon; } ?></a></th><?php } ?>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=income_amount&order=<?= $disp ?>">Amount <?php if ($sort == 'income_amount') { echo $order_icon; } ?></a></th>
|
||||
<?php if (moduleOn('bookkeeping')) { ?><th><?= sortLink('account_name', 'Paid into') ?></th><?php } ?>
|
||||
<th class="text-end"><?= sortLink('income_amount', 'Amount') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -346,15 +346,15 @@ $stat_money = function ($amount) use ($session_company_currency) {
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invoice_number&order=<?= $disp ?>">Invoice <?php if ($sort == 'invoice_number') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('invoice_number', 'Invoice') ?></th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invoice_date&order=<?= $disp ?>">Date <?php if ($sort == 'invoice_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invoice_due&order=<?= $disp ?>">Due <?php if ($sort == 'invoice_due') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invoice_amount&order=<?= $disp ?>">Total <?php if ($sort == 'invoice_amount') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=balance&order=<?= $disp ?>">Balance <?php if ($sort == 'balance') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=invoice_status&order=<?= $disp ?>">Status <?php if ($sort == 'invoice_status') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('invoice_date', 'Date') ?></th>
|
||||
<th><?= sortLink('invoice_due', 'Due') ?></th>
|
||||
<th class="text-end"><?= sortLink('invoice_amount', 'Total') ?></th>
|
||||
<th class="text-end"><?= sortLink('balance', 'Balance') ?></th>
|
||||
<th><?= sortLink('invoice_status', 'Status') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
12
agent/kb.php
12
agent/kb.php
@@ -114,10 +114,6 @@ $filter_url = function ($changes) {
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null && $v !== []; }));
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$add_url = 'modals/kb/kb_article_add.php' . (intval($category_filter) > 0 ? '?category=' . intval($category_filter) : '');
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
@@ -252,12 +248,12 @@ $csrf = $_SESSION['csrf_token'];
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="<?= $can_edit ? '' : 'ps-3' ?>"><?= $sort_link('kb_article_title', 'Article') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('category_name', 'Category') ?></th>
|
||||
<th class="<?= $can_edit ? '' : 'ps-3' ?>"><?= sortLink('kb_article_title', 'Article') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('category_name', 'Category') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Who can read it</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('kb_article_updated', 'Updated') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('kb_article_updated', 'Updated') ?></th>
|
||||
<th class="d-none d-xl-table-cell">Review</th>
|
||||
<?php if ($feedback_ready) { ?><th class="d-none d-xl-table-cell"><?= $sort_link('kb_article_views', 'Readers') ?></th><?php } ?>
|
||||
<?php if ($feedback_ready) { ?><th class="d-none d-xl-table-cell"><?= sortLink('kb_article_views', 'Readers') ?></th><?php } ?>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -240,31 +240,21 @@ $locations_counts = locationCounts(array_keys($locations));
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=location_name&order=<?= $disp ?>">
|
||||
Location <?php if ($sort == 'location_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('location_name', 'Location') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=location_city&order=<?= $disp ?>">
|
||||
Address <?php if ($sort == 'location_city') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('location_city', 'Address') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=location_phone&order=<?= $disp ?>">
|
||||
Phone & hours <?php if ($sort == 'location_phone') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('location_phone', 'Phone & hours') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=contact_name&order=<?= $disp ?>">
|
||||
Ask for <?php if ($sort == 'contact_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('contact_name', 'Ask for') ?>
|
||||
</th>
|
||||
<th>On site</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -144,10 +144,6 @@ $filter_url = function ($changes) {
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
@@ -309,9 +305,9 @@ $csrf = $_SESSION['csrf_token'];
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><?= $sort_link('network_name', 'Network') ?> <span class="fw-normal text-body-secondary small ms-2"><?= $sort_link('network_type', 'by type') ?></span></th>
|
||||
<?php if (!$client_url) { ?><th><?= $sort_link('client_name', 'Client') ?></th><?php } ?>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('network', 'Subnet') ?></th>
|
||||
<th><?= sortLink('network_name', 'Network') ?> <span class="fw-normal text-body-secondary small ms-2"><?= sortLink('network_type', 'by type') ?></span></th>
|
||||
<?php if (!$client_url) { ?><th><?= sortLink('client_name', 'Client') ?></th><?php } ?>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('network', 'Subnet') ?></th>
|
||||
<th class="d-none <?= $client_url ? 'd-lg-table-cell' : 'd-xxl-table-cell' ?>">Gateway, DNS & DHCP</th>
|
||||
<th>In use</th>
|
||||
<th></th>
|
||||
|
||||
@@ -322,12 +322,12 @@ $add_type = in_array($view, ['product', 'hardware', 'stocked', 'reorder'], true)
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=product_name&order=<?= $disp ?>">Item <?php if ($sort == 'product_name') { echo $order_icon; } ?></a></th>
|
||||
<th class="d-none d-md-table-cell"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=product_frequency&order=<?= $disp ?>">Billed <?php if ($sort == 'product_frequency') { echo $order_icon; } ?></a></th>
|
||||
<th class="d-none d-lg-table-cell text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=product_stock&order=<?= $disp ?>">Stock <?php if ($sort == 'product_stock') { echo $order_icon; } ?></a></th>
|
||||
<th class="d-none d-xl-table-cell"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_name&order=<?= $disp ?>">Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=product_price&order=<?= $disp ?>">Price <?php if ($sort == 'product_price') { echo $order_icon; } ?></a></th>
|
||||
<th class="d-none d-sm-table-cell text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=margin&order=<?= $disp ?>" title="Price less cost, as a share of the price">Margin <?php if ($sort == 'margin') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('product_name', 'Item') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('product_frequency', 'Billed') ?></th>
|
||||
<th class="d-none d-lg-table-cell text-end"><?= sortLink('product_stock', 'Stock') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= sortLink('vendor_name', 'Vendor') ?></th>
|
||||
<th class="text-end"><?= sortLink('product_price', 'Price') ?></th>
|
||||
<th class="d-none d-sm-table-cell text-end"><?= sortLink('margin', 'Margin', null, 'Price less cost, as a share of the price') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -136,10 +136,6 @@ $filter_url = function ($changes) {
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$hidden_filter_count = $date_filter_active ? 1 : 0;
|
||||
|
||||
@@ -300,13 +296,13 @@ $hidden_filter_count = $date_filter_active ? 1 : 0;
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><?= $sort_link('project_name', 'Project') ?></th>
|
||||
<th><?= $client_url ? 'Contact' : $sort_link('client_name', 'Client') ?></th>
|
||||
<th><?= sortLink('project_name', 'Project') ?></th>
|
||||
<th><?= $client_url ? 'Contact' : sortLink('client_name', 'Client') ?></th>
|
||||
<th>Progress</th>
|
||||
<th><?= $budgets_in_use ? 'Time / budget' : 'Time' ?></th>
|
||||
<th><?= in_array($show, ['completed', 'archived'], true) ? $sort_link('project_completed_at', 'Done') : $sort_link('project_due', 'Due') ?></th>
|
||||
<th><?= $sort_link('user_name', 'Manager') ?></th>
|
||||
<th class="d-none d-xxl-table-cell"><?= $sort_link('activity', 'Activity') ?></th>
|
||||
<th><?= in_array($show, ['completed', 'archived'], true) ? sortLink('project_completed_at', 'Done') : sortLink('project_due', 'Due') ?></th>
|
||||
<th><?= sortLink('user_name', 'Manager') ?></th>
|
||||
<th class="d-none d-xxl-table-cell"><?= sortLink('activity', 'Activity') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -96,10 +96,6 @@ $filter_url = function ($changes) {
|
||||
unset($params['page']);
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
|
||||
?>
|
||||
@@ -187,12 +183,12 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="<?= $num_rows[0] ? '' : 'd-none' ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('po_number', 'Purchase order') ?></th>
|
||||
<th><?= $sort_link('vendor_name', 'Vendor') ?></th>
|
||||
<th class="ps-3"><?= sortLink('po_number', 'Purchase order') ?></th>
|
||||
<th><?= sortLink('vendor_name', 'Vendor') ?></th>
|
||||
<th class="d-none d-md-table-cell">For</th>
|
||||
<th><?= $sort_link('po_status', 'Status') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('po_order_date', 'Ordered') ?></th>
|
||||
<th class="text-end"><?= $sort_link('po_total', 'Total') ?></th>
|
||||
<th><?= sortLink('po_status', 'Status') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('po_order_date', 'Ordered') ?></th>
|
||||
<th class="text-end"><?= sortLink('po_total', 'Total') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -231,14 +231,14 @@ $stat_monthly = function ($amount) use ($stat_money) {
|
||||
<table class="table table-hover align-middle mb-0 itflow-billing-table">
|
||||
<thead class="<?= $num_rows[0] ? '' : 'd-none' ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th class="ps-3"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=quote_number&order=<?= $disp ?>">Quote <?php if ($sort == 'quote_number') { echo $order_icon; } ?></a></th>
|
||||
<th class="ps-3"><?= sortLink('quote_number', 'Quote') ?></th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=quote_date&order=<?= $disp ?>">Date <?php if ($sort == 'quote_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=quote_expire&order=<?= $disp ?>">Valid until <?php if ($sort == 'quote_expire') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=quote_amount&order=<?= $disp ?>">Total <?php if ($sort == 'quote_amount') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=quote_status&order=<?= $disp ?>">Status <?php if ($sort == 'quote_status') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('quote_date', 'Date') ?></th>
|
||||
<th><?= sortLink('quote_expire', 'Valid until') ?></th>
|
||||
<th class="text-end"><?= sortLink('quote_amount', 'Total') ?></th>
|
||||
<th><?= sortLink('quote_status', 'Status') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -210,13 +210,13 @@ $any_filter = $q || $vendor_filter || $category_filter || $client_filter;
|
||||
<table class="table table-hover align-middle mb-0 itflow-billing-table">
|
||||
<thead class="<?= $num_rows[0] ? '' : 'd-none' ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th class="ps-3"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_name&order=<?= $disp ?>">Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=category_name&order=<?= $disp ?>">Category <?php if ($sort == 'category_name') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_expense_amount&order=<?= $disp ?>">Amount <?php if ($sort == 'recurring_expense_amount') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=monthly&order=<?= $disp ?>">A month <?php if ($sort == 'monthly') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_expense_next_date&order=<?= $disp ?>">Next <?php if ($sort == 'recurring_expense_next_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_expense_last_sent&order=<?= $disp ?>">Last <?php if ($sort == 'recurring_expense_last_sent') { echo $order_icon; } ?></a></th>
|
||||
<th class="ps-3"><?= sortLink('vendor_name', 'Vendor') ?></th>
|
||||
<th><?= sortLink('category_name', 'Category') ?></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th class="text-end"><?= sortLink('recurring_expense_amount', 'Amount') ?></th>
|
||||
<th class="text-end"><?= sortLink('monthly', 'A month') ?></th>
|
||||
<th><?= sortLink('recurring_expense_next_date', 'Next') ?></th>
|
||||
<th><?= sortLink('recurring_expense_last_sent', 'Last') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -255,14 +255,14 @@ $stat_money = function ($amount) use ($session_company_currency) {
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="ps-3"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_invoice_number&order=<?= $disp ?>">Recurring invoice <?php if ($sort == 'recurring_invoice_number') { echo $order_icon; } ?></a></th>
|
||||
<th class="ps-3"><?= sortLink('recurring_invoice_number', 'Recurring invoice') ?></th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<?php } ?>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_invoice_amount&order=<?= $disp ?>">Amount <?php if ($sort == 'recurring_invoice_amount') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=monthly&order=<?= $disp ?>">A month <?php if ($sort == 'monthly') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_invoice_next_date&order=<?= $disp ?>">Next <?php if ($sort == 'recurring_invoice_next_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=recurring_invoice_last_sent&order=<?= $disp ?>">Last <?php if ($sort == 'recurring_invoice_last_sent') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><?= sortLink('recurring_invoice_amount', 'Amount') ?></th>
|
||||
<th class="text-end"><?= sortLink('monthly', 'A month') ?></th>
|
||||
<th><?= sortLink('recurring_invoice_next_date', 'Next') ?></th>
|
||||
<th><?= sortLink('recurring_invoice_last_sent', 'Last') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -128,10 +128,6 @@ $filter_url = function ($changes) {
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
?>
|
||||
|
||||
@@ -277,12 +273,12 @@ $sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $di
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><?= $sort_link('recurring_ticket_subject', 'Recurring ticket') ?></th>
|
||||
<th><?= $client_url ? 'For' : $sort_link('client_name', 'Client') ?></th>
|
||||
<th><?= $sort_link('recurring_ticket_frequency', 'How often') ?></th>
|
||||
<th><?= $sort_link('recurring_ticket_next_run', 'Next run') ?></th>
|
||||
<th><?= sortLink('recurring_ticket_subject', 'Recurring ticket') ?></th>
|
||||
<th><?= $client_url ? 'For' : sortLink('client_name', 'Client') ?></th>
|
||||
<th><?= sortLink('recurring_ticket_frequency', 'How often') ?></th>
|
||||
<th><?= sortLink('recurring_ticket_next_run', 'Next run') ?></th>
|
||||
<th>Last ticket</th>
|
||||
<th><?= $sort_link('user_name', 'Agent') ?></th>
|
||||
<th><?= sortLink('user_name', 'Agent') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -118,10 +118,6 @@ $filter_url = function ($changes) {
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; }));
|
||||
};
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
$link_icons = ['asset' => ['fa-desktop', 'asset', 'assets'], 'credential' => ['fa-key', 'login', 'logins'], 'domain' => ['fa-globe', 'domain', 'domains'],
|
||||
'certificate' => ['fa-lock', 'certificate', 'certificates'], 'contact' => ['fa-user', 'person', 'people'], 'vendor' => ['fa-building', 'vendor', 'vendors'],
|
||||
@@ -280,12 +276,12 @@ $link_icons = ['asset' => ['fa-desktop', 'asset', 'assets'], 'credential' => ['f
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><?= $sort_link('service_name', 'Service') ?></th>
|
||||
<?php if (!$client_url) { ?><th><?= $sort_link('client_name', 'Client') ?></th><?php } ?>
|
||||
<th><?= $sort_link('service_importance', 'Importance') ?></th>
|
||||
<th><?= sortLink('service_name', 'Service') ?></th>
|
||||
<?php if (!$client_url) { ?><th><?= sortLink('client_name', 'Client') ?></th><?php } ?>
|
||||
<th><?= sortLink('service_importance', 'Importance') ?></th>
|
||||
<th class="d-none d-xxl-table-cell">Depends on</th>
|
||||
<th>Attention</th>
|
||||
<th><?= $sort_link('service_review_due', 'Review') ?></th>
|
||||
<th><?= sortLink('service_review_due', 'Review') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -231,36 +231,24 @@ $filter_url = function ($changes) {
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=item_name&order=<?= $disp ?>">
|
||||
Shared <?php if ($sort == 'item_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('item_name', 'Shared') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=item_recipient&order=<?= $disp ?>">
|
||||
With <?php if ($sort == 'item_recipient') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('item_recipient', 'With') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=item_created_at&order=<?= $disp ?>">
|
||||
Made <?php if ($sort == 'item_created_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('item_created_at', 'Made') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=item_expire_at&order=<?= $disp ?>">
|
||||
Works until <?php if ($sort == 'item_expire_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('item_expire_at', 'Works until') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=item_last_viewed_at&order=<?= $disp ?>">
|
||||
Opened <?php if ($sort == 'item_last_viewed_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('item_last_viewed_at', 'Opened') ?>
|
||||
</th>
|
||||
<th>Status</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -385,52 +385,36 @@ while ($license_type_row = mysqli_fetch_row($sql_license_types)) {
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=software_name&order=<?= $disp ?>">
|
||||
License <?php if ($sort == 'software_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('software_name', 'License') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=software_license_type&order=<?= $disp ?>">
|
||||
Type <?php if ($sort == 'software_license_type') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('software_license_type', 'Type') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=seats_used&order=<?= $disp ?>">
|
||||
Seats <?php if ($sort == 'seats_used') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('seats_used', 'Seats') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=software_expire&order=<?= $disp ?>">
|
||||
Renews <?php if ($sort == 'software_expire') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('software_expire', 'Renews') ?>
|
||||
</th>
|
||||
<?php if ($show_key) { ?>
|
||||
<th>Key</th>
|
||||
<?php } ?>
|
||||
<?php if ($show_purchased) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=software_purchase&order=<?= $disp ?>">
|
||||
Purchased <?php if ($sort == 'software_purchase') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('software_purchase', 'Purchased') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<?php if ($show_order_ref) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=software_purchase_reference&order=<?= $disp ?>">
|
||||
Order ref <?php if ($sort == 'software_purchase_reference') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('software_purchase_reference', 'Order ref') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_name&order=<?= $disp ?>">
|
||||
Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('vendor_name', 'Vendor') ?>
|
||||
</th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -81,10 +81,6 @@ foreach ($tabs as $key => $tab) {
|
||||
$counts = array_combine(array_keys($tabs), array_map('intval', mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', $count_sql) . " FROM sms_messages $joins WHERE $scope"))));
|
||||
$latest_code = $can_codes ? intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COALESCE(MAX(sms_message_id), 0) FROM sms_messages WHERE sms_message_direction = 'in' AND sms_message_status = 'code'"))[0]) : 0;
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
$provider = smsProvider();
|
||||
|
||||
@@ -129,10 +125,10 @@ $provider = smsProvider();
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('sms_message_number', 'From') ?></th>
|
||||
<th class="ps-3"><?= sortLink('sms_message_number', 'From') ?></th>
|
||||
<?php if ($codes) { ?><th>Code</th><?php } ?>
|
||||
<th class="d-none d-md-table-cell">Text</th>
|
||||
<th class="d-none d-lg-table-cell"><?= $sort_link('sms_message_created_at', 'When') ?></th>
|
||||
<th class="d-none d-lg-table-cell"><?= sortLink('sms_message_created_at', 'When') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -73,10 +73,6 @@ $link_counts = ticketLinkCounts(array_keys($tickets));
|
||||
// A Due column only when there is something to put in it
|
||||
$show_due = $sla_in_use || mysqli_num_rows(mysqli_query($mysqli, "SELECT 1 FROM tickets WHERE ticket_due_at IS NOT NULL AND ticket_closed_at IS NULL LIMIT 1"));
|
||||
|
||||
$sort_link = function ($column, $label, $class = '') use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none ' . $class . '" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
|
||||
?>
|
||||
|
||||
@@ -101,22 +97,22 @@ $sort_link = function ($column, $label, $class = '') use ($url_query_strings_sor
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><?= $sort_link('ticket_number', 'Ticket') ?></th>
|
||||
<th><?= sortLink('ticket_number', 'Ticket') ?></th>
|
||||
<th>
|
||||
<?php if (!$client_url) { ?>
|
||||
<?= $sort_link('client_name', 'Client') ?> <span class="text-body-secondary">/</span>
|
||||
<?= sortLink('client_name', 'Client') ?> <span class="text-body-secondary">/</span>
|
||||
<?php } ?>
|
||||
<?= $sort_link('contact_name', 'Contact', $client_url ? '' : 'text-body-secondary') ?>
|
||||
<?= sortLink('contact_name', 'Contact', null, '', $client_url ? '' : 'text-body-secondary') ?>
|
||||
</th>
|
||||
<th><?= $sort_link('ticket_status', 'Status') ?></th>
|
||||
<th><?= $sort_link('ticket_priority', 'Priority') ?></th>
|
||||
<th><?= $sort_link('user_name', 'Assigned') ?></th>
|
||||
<th><?= sortLink('ticket_status', 'Status') ?></th>
|
||||
<th><?= sortLink('ticket_priority', 'Priority') ?></th>
|
||||
<th><?= sortLink('user_name', 'Assigned') ?></th>
|
||||
<?php if ($show_due) { ?>
|
||||
<th><?= $sort_link('ticket_sla', 'Due') ?></th>
|
||||
<th><?= sortLink('ticket_sla', 'Due') ?></th>
|
||||
<?php } ?>
|
||||
<th><?= $sort_link('ticket_updated_at', 'Activity') ?></th>
|
||||
<th><?= sortLink('ticket_updated_at', 'Activity') ?></th>
|
||||
<?php if ($show_billing) { ?>
|
||||
<th class="text-center"><?= $sort_link('ticket_billable', 'Billing') ?></th>
|
||||
<th class="text-center"><?= sortLink('ticket_billable', 'Billing') ?></th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -67,10 +67,6 @@ $filter_url = function ($changes) {
|
||||
unset($params['page']);
|
||||
return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null && $v !== 0; }));
|
||||
};
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$csrf = $_SESSION['csrf_token'];
|
||||
$drafts = poReady() ? intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FROM purchase_orders WHERE po_status = 'draft'" . poScopeSql('po_id')))[0]) : 0;
|
||||
|
||||
@@ -176,13 +172,13 @@ $drafts = poReady() ? intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUN
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th class="<?= $can_edit ? '' : 'ps-3' ?>"><?= $sort_link('order_item_name', 'Item') ?></th>
|
||||
<th><?= $sort_link('client_name', 'For') ?></th>
|
||||
<th><?= $sort_link('vendor_name', 'Vendor') ?></th>
|
||||
<th class="text-end"><?= $sort_link('order_item_quantity', 'Qty') ?></th>
|
||||
<th class="text-end d-none d-md-table-cell"><?= $sort_link('order_item_cost', 'Unit cost') ?></th>
|
||||
<th class="<?= $can_edit ? '' : 'ps-3' ?>"><?= sortLink('order_item_name', 'Item') ?></th>
|
||||
<th><?= sortLink('client_name', 'For') ?></th>
|
||||
<th><?= sortLink('vendor_name', 'Vendor') ?></th>
|
||||
<th class="text-end"><?= sortLink('order_item_quantity', 'Qty') ?></th>
|
||||
<th class="text-end d-none d-md-table-cell"><?= sortLink('order_item_cost', 'Unit cost') ?></th>
|
||||
<th class="text-end d-none d-md-table-cell">Amount</th>
|
||||
<th class="d-none d-xl-table-cell"><?= $sort_link('order_item_created_at', 'Added') ?></th>
|
||||
<th class="d-none d-xl-table-cell"><?= sortLink('order_item_created_at', 'Added') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -378,14 +378,14 @@ $is_card = $account && $account['type'] === 3;
|
||||
<table class="table table-hover align-middle mb-0 itflow-billing-table">
|
||||
<thead class="<?= $num_rows[0] ? '' : 'd-none' ?> text-nowrap table-light">
|
||||
<tr>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=txn_date&order=<?= $disp ?>">Date <?php if ($sort == 'txn_date') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('txn_date', 'Date') ?></th>
|
||||
<?php if ($all) { ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=account_name&order=<?= $disp ?>">Account <?php if ($sort == 'account_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('account_name', 'Account') ?></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=txn_what&order=<?= $disp ?>">Who or what <?php if ($sort == 'txn_what') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=category_name&order=<?= $disp ?>">Category <?php if ($sort == 'category_name') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=txn_amount&order=<?= $disp ?>">In <?php if ($sort == 'txn_amount') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('txn_what', 'Who or what') ?></th>
|
||||
<th><?= sortLink('category_name', 'Category') ?></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th class="text-end"><?= sortLink('txn_amount', 'In') ?></th>
|
||||
<th class="text-end">Out</th>
|
||||
<?php if ($balance_visible) { ?>
|
||||
<th class="text-end" title="What it held after the line">Balance</th>
|
||||
|
||||
@@ -315,15 +315,15 @@ $add_url = 'modals/trip/trip_add.php' . ($client_page ? "?client_id=$client_id"
|
||||
</div>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=trip_date&order=<?= $disp ?>">Date <?php if ($sort == 'trip_date') { echo $order_icon; } ?></a></th>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=trip_destination&order=<?= $disp ?>">Trip <?php if ($sort == 'trip_destination') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('trip_date', 'Date') ?></th>
|
||||
<th><?= sortLink('trip_destination', 'Trip') ?></th>
|
||||
<?php if (!$client_page) { ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">Client <?php if ($sort == 'client_name') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('client_name', 'Client') ?></th>
|
||||
<?php } else { ?>
|
||||
<th>Site</th>
|
||||
<?php } ?>
|
||||
<th><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=user_name&order=<?= $disp ?>">Driver <?php if ($sort == 'user_name') { echo $order_icon; } ?></a></th>
|
||||
<th class="text-end"><a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=trip_miles&order=<?= $disp ?>"><?= ucfirst(tripUnit()) ?> <?php if ($sort == 'trip_miles') { echo $order_icon; } ?></a></th>
|
||||
<th><?= sortLink('user_name', 'Driver') ?></th>
|
||||
<th class="text-end"><?= sortLink('trip_miles', ucfirst(tripUnit())) ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -71,10 +71,6 @@ $counts = array_combine(array_keys($views), array_map('intval', mysqli_fetch_row
|
||||
|
||||
$any_filter = $q !== '' || $dtf !== '1970-01-01' || $dtt !== '2099-12-31';
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$view_url = function ($key) {
|
||||
$query = $_GET;
|
||||
unset($query['page']);
|
||||
@@ -134,11 +130,11 @@ $view_empty = [
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('log_created_at', 'When') ?></th>
|
||||
<th><?= $sort_link('log_type', 'What') ?></th>
|
||||
<th class="ps-3"><?= sortLink('log_created_at', 'When') ?></th>
|
||||
<th><?= sortLink('log_type', 'What') ?></th>
|
||||
<th>Description</th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('client_name', 'Client') ?></th>
|
||||
<th class="d-none d-xl-table-cell pe-3"><?= $sort_link('log_ip', 'From') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('client_name', 'Client') ?></th>
|
||||
<th class="d-none d-xl-table-cell pe-3"><?= sortLink('log_ip', 'From') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -79,10 +79,6 @@ $counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', array
|
||||
}, $views)) . " FROM canned_responses WHERE $filters"));
|
||||
$view_counts = array_combine(array_keys($views), $counts);
|
||||
|
||||
$sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) {
|
||||
return '<a class="text-reset text-decoration-none" href="?' . escapeHtml($url_query_strings_sort) . '&sort=' . $column . '&order=' . $disp . '">'
|
||||
. $label . ($sort === $column ? " $order_icon" : '') . '</a>';
|
||||
};
|
||||
$pill_url = function ($view) use ($category_filter) {
|
||||
return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'category' => $category_filter, 'show' => $view]));
|
||||
};
|
||||
@@ -130,10 +126,10 @@ $csrf = $_SESSION['csrf_token'];
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="table-light text-nowrap <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="ps-3"><?= $sort_link('canned_response_name', 'Response') ?></th>
|
||||
<th class="ps-3"><?= sortLink('canned_response_name', 'Response') ?></th>
|
||||
<th class="d-none d-lg-table-cell">Offered on</th>
|
||||
<th class="d-none d-md-table-cell" title="In your replies"><?= $sort_link('use_count', 'You used it') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= $sort_link('last_used', 'Last used') ?></th>
|
||||
<th class="d-none d-md-table-cell" title="In your replies"><?= sortLink('use_count', 'You used it') ?></th>
|
||||
<th class="d-none d-md-table-cell"><?= sortLink('last_used', 'Last used') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -293,26 +293,18 @@ $missing_templates = $view === 'client' && !$archived ? vendorTemplatesMissingFo
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_name&order=<?= $disp ?>">
|
||||
Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('vendor_name', 'Vendor') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_phone&order=<?= $disp ?>">
|
||||
Support <?php if ($sort == 'vendor_phone') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('vendor_phone', 'Support') ?>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=vendor_account_number&order=<?= $disp ?>">
|
||||
Account <?php if ($sort == 'vendor_account_number') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('vendor_account_number', 'Account') ?>
|
||||
</th>
|
||||
<th><?= $view === 'ours' ? 'Spend' : 'With them' ?></th>
|
||||
<?php if ($view === 'clients') { ?>
|
||||
<th>
|
||||
<a class="text-reset text-decoration-none" href="?<?= $url_query_strings_sort ?>&sort=client_name&order=<?= $disp ?>">
|
||||
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
<?= sortLink('client_name', 'Client') ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
<th></th>
|
||||
|
||||
@@ -659,6 +659,34 @@ function emptyStatePill(array $pills, $key, $default = '', array $good = []) {
|
||||
return $view + ['icon' => $pill['icon'] ?? 'fa-filter'];
|
||||
}
|
||||
|
||||
/*
|
||||
* A sortable column header. includes/filter_header.php sets $sort, $disp, $order_icon and
|
||||
* $url_query_strings_sort. A click on the column being sorted flips it; the first click on
|
||||
* another sorts names A-Z and dates, money and counts newest or largest first, or $first
|
||||
* ('ASC' or 'DESC') where the page knows better.
|
||||
*/
|
||||
function sortLink($column, $label, $first = null, $title = '', $class = '') {
|
||||
global $sort, $disp, $order_icon, $url_query_strings_sort;
|
||||
$active = isset($sort) && (string) $sort === (string) $column;
|
||||
$order = $active ? $disp : (in_array($first, ['ASC', 'DESC'], true) ? $first : sortFirstOrder($column));
|
||||
return '<a class="text-reset text-decoration-none' . ($class !== '' ? ' ' . $class : '') . '" href="?' . escapeHtml($url_query_strings_sort ?? '')
|
||||
. '&sort=' . escapeHtml($column) . '&order=' . $order . '"' . ($title !== '' ? ' title="' . escapeHtml($title) . '"' : '') . '>'
|
||||
. $label . ($active ? " $order_icon" : '') . '</a>';
|
||||
}
|
||||
|
||||
/** The first way a column sorts: DESC for dates, money, counts and record numbers, ASC for the rest. */
|
||||
function sortFirstOrder($column) {
|
||||
$column = strtolower((string) $column);
|
||||
$name = preg_replace('/^.*\./', '', $column);
|
||||
if (preg_match('/(^|_)(at|date|due|expire|expires|expiry|updated|created|run|seen|login|paid|used|checkin|synced|inbound|since|starts|ends|now)$/', $name)
|
||||
|| preg_match('/(^|_)(amount|total|balance|price|cost|margin|profit|value|stock|seats|threshold|percent|rate|count|views|size|ms|minutes|hours|miles|quantity|qty|devices|months|tokens|use|uses|failures|requests|activity|sign_ins|ips|linked|in)$/', $name)
|
||||
|| preg_match('/^(tickets|contracts|accounts|agents|used|clients|documents|invoices|assets)$/', $name)
|
||||
|| preg_match('/^(ticket|invoice|quote|po|project|recurring_invoice|contract)_number$/', $name)) {
|
||||
return 'DESC';
|
||||
}
|
||||
return 'ASC';
|
||||
}
|
||||
|
||||
/**
|
||||
* A list's empty state. $o:
|
||||
* thing - what the list holds, plural ('vendors')
|
||||
|
||||
Reference in New Issue
Block a user