mirror of
https://github.com/itflow-org/itflow
synced 2026-12-03 01:29:01 +00:00
Categories stage 1: Admin > Categories rebuilt with the ten kinds in a side nav with counts and what each is for, each category shown as it looks on records (icon or dot in its color, asset statuses as their badge) with its description and what uses it linked to the filtered lists, search, sort by name, most used or order, Current and Archived tabs, Edit, Merge into, Archive, Restore and Delete only while unused, bulk merge, archive, restore and delete, drag or Move up and Move down ordering for the ordered kinds, names in use that are not categories listed with Add, one shared category window with live preview, color swatches or none and searchable icons or none, names unique per kind and held to their column length, renaming a kind kept by name carries the new name onto its records, merge moves every reference including budget months folded per month, payment provider fees and the mileage setting, all without touching record updated_at, database 3.1.5 normalizing category colors to #rrggbb and icons to fa-name, seed data in hex, new functions/categories.php, agent + window handler routed through the same validation, note-type icons fixed in pickers, Settings > Defaults payment methods read from Payment Methods, changelog updated
This commit is contained in:
@@ -1,69 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* New category - from Admin > Categories (?category= the kind), or the +
|
||||
* beside a category picker in a form (which posts to the agent's post.php).
|
||||
* The fields are category_form.php.
|
||||
*/
|
||||
|
||||
require_once '../../includes/modal_header.php';
|
||||
|
||||
$category = escapeHtml($_GET['category'] ?? '');
|
||||
$category = null;
|
||||
$kind = categoryKind($_GET['category'] ?? '') ? (string) $_GET['category'] : '';
|
||||
$kind_config = $kind !== '' ? categoryKind($kind) : null;
|
||||
|
||||
$category_types_array = ['Expense', 'Income', 'Referral', 'Ticket'];
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-list-ul me-2"></i>New <strong><?= escapeHtml(ucwords(str_replace('_', ' ', $category))); ?></strong> Category</h5>
|
||||
<h5 class="modal-title"><i class="fas fa-fw <?= $kind_config['icon'] ?? 'fa-list-ul' ?> me-2"></i>New <?= escapeHtml($kind_config ? ucwords($kind_config['one']) : 'Category') ?></h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<?php if ($category) { ?>
|
||||
<input type="hidden" name="type" value="<?= $category ?>">
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Type <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||
<select class="form-select select2" name="type" required>
|
||||
<option value="">- Select Type -</option>
|
||||
<?php foreach ($category_types_array as $type_select) { ?>
|
||||
<option><?= $type_select ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list-ul"></i></span>
|
||||
<input type="text" class="form-control" name="name" placeholder="Category name" maxlength="200" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Color <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paint-brush"></i></span>
|
||||
<input type="color" class="form-control form-control-color" name="color" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Description</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-align-left"></i></span>
|
||||
<input type="text" class="form-control" name="description" placeholder="Enter a description" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require __DIR__ . '/category_form.php'; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="add_category" class="btn btn-primary text-bold"><i class="fa fa-check me-2"></i>Create Category</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary text-bold"><i class="fas fa-check me-2"></i>Create</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fas fa-times me-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,60 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Edit a category - its name (carried onto the records of a kind held by
|
||||
* name), description, colour and icon. The fields are category_form.php.
|
||||
*/
|
||||
|
||||
require_once '../../includes/modal_header.php';
|
||||
|
||||
$category_id = intval($_GET['id']);
|
||||
$category = categoryRow(intval($_GET['id'] ?? 0));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT category_color, category_description, category_name, category_type FROM categories WHERE category_id = $category_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_assoc($sql);
|
||||
$category_name = escapeHtml($row['category_name']);
|
||||
$category_description = escapeHtml($row['category_description']);
|
||||
$category_color = escapeHtml($row['category_color']);
|
||||
$category_type = escapeHtml($row['category_type']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
if (!$category) { ?>
|
||||
<div class="modal-body text-center text-secondary py-5">That category is gone - it may have been merged into another, or deleted.</div>
|
||||
<?php } else {
|
||||
$category_id = intval($category['category_id']);
|
||||
$kind = (string) $category['category_type'];
|
||||
$kind_config = categoryKind($kind);
|
||||
$category_used = categoryUsageFor($category_id); ?>
|
||||
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-list-ul me-2"></i>Editing category: <strong><?= $category_name ?></strong></h5>
|
||||
<h5 class="modal-title"><i class="fas fa-fw <?= $kind_config['icon'] ?? 'fa-list-ul' ?> me-2"></i><?= escapeHtml(ucwords($kind_config['one'] ?? 'Category')) ?>: <strong><?= escapeHtml($category['category_name']) ?></strong></h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<input type="hidden" name="category_id" value="<?= $category_id ?>">
|
||||
<input type="hidden" name="type" value="<?= $category_type ?>">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list-ul"></i></span>
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?= $category_name ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Color <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paint-brush"></i></span>
|
||||
<input type="color" class="form-control form-control-color" name="color" value="<?= $category_color ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label>Description</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-align-left"></i></span>
|
||||
<input type="text" class="form-control" name="description" placeholder="Enter a description" maxlength="200" value="<?= $category_description ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($category['category_archived_at']) { ?>
|
||||
<div class="alert alert-secondary small py-2"><i class="fas fa-fw fa-archive me-1"></i>Archived <?= date('M j, Y', strtotime($category['category_archived_at'])) ?> - it stays on its records, but isn't offered for new ones.</div>
|
||||
<?php } ?>
|
||||
<?php if (!$kind_config) { ?>
|
||||
<div class="alert alert-warning small py-2">This is a "<?= escapeHtml($kind) ?>" category - nothing in ITFlow uses that kind any more.</div>
|
||||
<?php } ?>
|
||||
<?php require __DIR__ . '/category_form.php'; ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="edit_category" class="btn btn-primary text-bold"><i class="fa fa-check me-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
|
||||
<button type="submit" name="edit_category" class="btn btn-primary text-bold"><i class="fas fa-check me-2"></i>Save changes</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fas fa-times me-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
<?php }
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
||||
120
admin/modals/category/category_form.php
Normal file
120
admin/modals/category/category_form.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* A category's fields - for category_add.php and category_edit.php, which set
|
||||
* $category (a categoryRow(), or null when new), $kind (its category_type,
|
||||
* or '' to pick one) and for one being edited $category_used (what uses it,
|
||||
* categoryUsageFor()). The preview, colour swatches and icon search are
|
||||
* js/category_form.js. Posts to post.php - admin/post/category.php, or
|
||||
* agent/post/category.php when opened from a form on an agent page.
|
||||
*/
|
||||
|
||||
isset($mysqli) || die("Direct file access is not allowed");
|
||||
|
||||
$c = $category ?? null;
|
||||
$c_config = $kind !== '' ? categoryKind($kind) : null;
|
||||
$c_color = $c ? categoryColor($c['category_color']) : ($c_config ? categoryNextColor($kind) : CATEGORY_COLORS[0]);
|
||||
$c_icon = $c ? categoryIcon($c['category_icon']) : '';
|
||||
$c_icons = CATEGORY_ICONS;
|
||||
if ($c_icon !== '' && !in_array($c_icon, $c_icons, true)) {
|
||||
// An icon picked by name before - offered first, so it stays chosen
|
||||
array_unshift($c_icons, $c_icon);
|
||||
}
|
||||
$c_used = $category_used ?? ['all' => 0, 'archived' => 0, 'uses' => []];
|
||||
$c_preview = categoryChip([
|
||||
'category_name' => $c['category_name'] ?? 'New category',
|
||||
'category_type' => $kind,
|
||||
'category_color' => $c_color,
|
||||
'category_icon' => $c_icon,
|
||||
]);
|
||||
$c_max = $c_config['max'] ?? 200;
|
||||
|
||||
?>
|
||||
|
||||
<div data-category-form data-category-name-was="<?= escapeHtml($c['category_name'] ?? '') ?>">
|
||||
<div class="d-flex flex-wrap align-items-center gap-2 mb-3 p-2 rounded border bg-body-tertiary">
|
||||
<span class="small text-secondary">Looks like</span>
|
||||
<span data-category-preview data-category-badge="<?= $kind === 'asset_status' ? escapeHtml(assetStatusBadge((string) ($c['category_name'] ?? ''), '')['class'] ?: 'secondary') : '' ?>"><?= $c_preview ?></span>
|
||||
<?php if ($c) { ?>
|
||||
<span class="small text-secondary ms-auto text-end">
|
||||
<?= $c_used['all'] ? 'On ' . escapeHtml(categoryUsageText($c, $c_used)) : 'Nothing uses it yet' ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if (!$c && !$c_config) { ?>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">For <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||
<select class="form-select" name="type" required>
|
||||
<option value="">- What it sorts -</option>
|
||||
<?php foreach (categoryKinds() as $kind_key => $kind_config) { ?>
|
||||
<option value="<?= escapeHtml($kind_key) ?>"><?= escapeHtml(ucfirst($kind_config['many'])) ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } elseif (!$c) { ?>
|
||||
<input type="hidden" name="type" value="<?= escapeHtml($kind) ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list-ul"></i></span>
|
||||
<input type="text" class="form-control" name="name" maxlength="<?= $c_max ?>" placeholder="<?= escapeHtml(ucfirst($c_config['one'] ?? 'category')) ?> name" value="<?= escapeHtml($c['category_name'] ?? '') ?>" required<?= $c ? '' : ' autofocus' ?> data-category-name>
|
||||
</div>
|
||||
<?php if ($c && $c_config && $c_config['by'] === 'name' && $c_used['all']) { ?>
|
||||
<small class="text-secondary" data-category-rename-note hidden><i class="fas fa-fw fa-info-circle me-1"></i>Renaming it renames it on the <?= escapeHtml(categoryUsageText($c, $c_used)) ?> that <?= $c_used['all'] === 1 ? 'has' : 'have' ?> it too.</small>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-align-left"></i></span>
|
||||
<input type="text" class="form-control" name="description" maxlength="255" placeholder="What it's for, and when to use it" value="<?= escapeHtml($c['category_description'] ?? '') ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Color</label>
|
||||
<input type="hidden" name="color" value="<?= $c_color ?>" data-category-color>
|
||||
<div class="d-flex flex-wrap align-items-center gap-2">
|
||||
<div class="d-flex flex-wrap gap-1" role="group" aria-label="Colors">
|
||||
<button type="button" class="itflow-tag-swatch itflow-category-swatch-none<?= $c_color === '' ? ' active' : '' ?>" data-category-swatch="" title="No color" aria-label="No color" aria-pressed="<?= $c_color === '' ? 'true' : 'false' ?>"><i class="fas fa-ban" aria-hidden="true"></i></button>
|
||||
<?php foreach (CATEGORY_COLORS as $swatch) { ?>
|
||||
<button type="button" class="itflow-tag-swatch<?= $swatch === $c_color ? ' active' : '' ?>" style="--itflow-tag-color: <?= $swatch ?>; --itflow-tag-text: <?= tagTextColor($swatch) ?>" data-category-swatch="<?= $swatch ?>" title="<?= $swatch ?>" aria-label="Color <?= $swatch ?>" aria-pressed="<?= $swatch === $c_color ? 'true' : 'false' ?>"><i class="fas fa-check" aria-hidden="true"></i></button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="input-group input-group-sm w-auto" title="Any other color">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paint-brush"></i></span>
|
||||
<input type="color" class="form-control form-control-color" value="<?= $c_color ?: '#6c757d' ?>" aria-label="Custom color" data-category-color-pick>
|
||||
<input type="text" class="form-control font-monospace" style="width: 6rem" maxlength="7" value="<?= $c_color ?>" placeholder="None" pattern="#?[0-9a-fA-F]{6}" aria-label="Color as hex" data-category-color-hex>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-1">
|
||||
<label class="form-label">Icon</label>
|
||||
<input type="hidden" name="icon" value="<?= $c_icon ?>" data-category-icon>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-search"></i></span>
|
||||
<input type="search" class="form-control" placeholder="Search icons - or type any Font Awesome icon's name" aria-label="Search icons" data-category-icon-search>
|
||||
</div>
|
||||
<div class="itflow-tag-icons border rounded p-1" role="group" aria-label="Icons" data-category-icons>
|
||||
<button type="button" class="btn btn-sm itflow-tag-icon<?= $c_icon === '' ? ' active' : '' ?>" data-category-icon-choice="" title="No icon - a dot in its color" aria-label="No icon" aria-pressed="<?= $c_icon === '' ? 'true' : 'false' ?>"><i class="fas fa-fw fa-ban" aria-hidden="true"></i></button>
|
||||
<?php foreach ($c_icons as $icon) { ?>
|
||||
<button type="button" class="btn btn-sm itflow-tag-icon<?= $icon === $c_icon ? ' active' : '' ?>" data-category-icon-choice="<?= $icon ?>" title="<?= $icon ?>" aria-label="<?= $icon ?>" aria-pressed="<?= $icon === $c_icon ? 'true' : 'false' ?>"><i class="fas fa-fw fa-<?= $icon ?>" aria-hidden="true"></i></button>
|
||||
<?php } ?>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary itflow-tag-icon-custom" data-category-icon-custom hidden><i class="fas fa-fw" aria-hidden="true"></i><span></span></button>
|
||||
<div class="small text-secondary p-2" data-category-icon-none hidden>No icon by that name here - type its whole name to use it</div>
|
||||
</div>
|
||||
<?php if ($kind === 'asset_status') { ?>
|
||||
<small class="text-secondary">Asset statuses show as a badge in their color - the icon shows in the status picker.</small>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/js/category_form.js"></script>
|
||||
110
admin/modals/category/category_merge.php
Normal file
110
admin/modals/category/category_merge.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Merge categories into one - from a category's Merge into..., or Bulk
|
||||
* Action on the ticked ones. Every record with one of them gets the one kept
|
||||
* instead, and the rest are deleted (categoryMerge()). Categories of one
|
||||
* kind only. Posts merge_categories.
|
||||
*/
|
||||
|
||||
require_once '../../includes/modal_header.php';
|
||||
|
||||
$merge_ids = array_values(array_unique(array_filter(array_map('intval', (array) ($_GET['category_ids'] ?? [])))));
|
||||
$merging = [];
|
||||
foreach ($merge_ids as $merge_id) {
|
||||
if ($row = categoryRow($merge_id)) {
|
||||
$merging[intval($row['category_id'])] = $row;
|
||||
}
|
||||
}
|
||||
$kinds = array_unique(array_map(function ($row) {
|
||||
return (string) $row['category_type'];
|
||||
}, $merging));
|
||||
$config = count($kinds) === 1 ? categoryKind(reset($kinds)) : null;
|
||||
$usage = $config ? categoryUsage($config['kind']) : [];
|
||||
$used = function ($category_id) use ($usage) {
|
||||
return $usage[intval($category_id)]['all'] ?? 0;
|
||||
};
|
||||
|
||||
// What they can go into: one of them (when there are several, the most used first), or another of the kind not archived
|
||||
$into = [];
|
||||
if ($config) {
|
||||
if (count($merging) > 1) {
|
||||
$into = $merging;
|
||||
uasort($into, function ($a, $b) use ($used) {
|
||||
return $used($b['category_id']) <=> $used($a['category_id']) ?: strnatcasecmp($a['category_name'], $b['category_name']);
|
||||
});
|
||||
}
|
||||
foreach (categoryRows($config['kind']) as $category_id => $row) {
|
||||
if (!isset($merging[$category_id]) && !$row['category_archived_at']) {
|
||||
$into[$category_id] = $row;
|
||||
}
|
||||
}
|
||||
}
|
||||
$keep_id = count($merging) > 1 ? intval(array_key_first($into)) : 0;
|
||||
|
||||
// What merging does, in words
|
||||
$one = count($merging) === 1;
|
||||
$records = 0;
|
||||
foreach ($merging as $merge_id => $row) {
|
||||
$records += $used($merge_id);
|
||||
}
|
||||
$merge_text = '';
|
||||
if ($config) {
|
||||
$merge_text = ($records ? 'The ' . number_format($records) . ' ' . ($records === 1 ? 'record' : 'records') . ' with ' . ($one ? 'it get' : 'these get') . ' the ' . $config['one'] . ' you keep instead'
|
||||
. ($config['by'] === 'name' ? ' - renamed to it' : '') . ($config['kind'] === 'Expense' ? ', and a month budgeted under more than one ends with one line of their total' : '') . '.'
|
||||
: 'Nothing uses ' . ($one ? 'it' : 'these') . ' yet.')
|
||||
. ($one ? ' It is then deleted.' : ' The others are then deleted.') . " This can't be undone.";
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title"><i class="fas fa-fw fa-compress-alt me-2"></i>Merge <?= $one ? 'Category' : count($merging) . ' Categories' ?></h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<?php if (!$merging || !$config) { ?>
|
||||
<div class="modal-body text-center text-secondary py-5"><?= $merging ? 'Categories of one kind can be merged - pick expense categories, or asset statuses, and so on.' : 'Those categories are gone - they may have been merged or deleted already.' ?></div>
|
||||
<?php } elseif (!$into) { ?>
|
||||
<div class="modal-body text-center text-secondary py-5">There's no other <?= escapeHtml($config['one']) ?> to merge it into yet.</div>
|
||||
<?php } else { ?>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<?php foreach ($merging as $merge_id => $row) { ?>
|
||||
<input type="hidden" name="category_ids[]" value="<?= $merge_id ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="modal-body">
|
||||
<label class="form-label">Merging</label>
|
||||
<div class="d-flex flex-wrap gap-3 mb-3">
|
||||
<?php foreach ($merging as $merge_id => $row) { ?>
|
||||
<span class="d-inline-flex align-items-center gap-2"><?= categoryChip($row) ?><span class="small text-secondary"><?= number_format($used($merge_id)) ?> <?= $used($merge_id) === 1 ? 'record' : 'records' ?></span></span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Into <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list-ul"></i></span>
|
||||
<select class="form-select select2" name="into_category_id" data-placeholder="- Keep which <?= escapeHtml($config['one']) ?> -" required>
|
||||
<option value=""></option>
|
||||
<?php foreach ($into as $into_id => $row) { ?>
|
||||
<option value="<?= intval($into_id) ?>"<?= intval($into_id) === $keep_id ? ' selected' : '' ?><?= selectOptionColor(categoryColor($row['category_color']), categoryIcon($row['category_icon'])) ?>><?= escapeHtml($row['category_name']) ?><?= isset($merging[$into_id]) ? ' (one of these)' : '' ?><?= $row['category_archived_at'] ? ' (archived)' : '' ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="small text-secondary mb-0"><?= escapeHtml($merge_text) ?></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="merge_categories" class="btn btn-primary text-bold"><i class="fas fa-compress-alt me-2"></i>Merge</button>
|
||||
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fas fa-times me-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
Reference in New Issue
Block a user