mirror of
https://github.com/itflow-org/itflow
synced 2026-11-26 14:27:27 +00:00
Replace Tom Select with ITFlow's own select picker: native select stays the source of truth, search, checklists for multi selects, add-your-own for tag fields, phone sheet, and client/agent/contact avatars, tag and category colours, priority dots and asset icons in the options
This commit is contained in:
@@ -56,11 +56,11 @@ ob_start();
|
||||
<select class="form-select select2" name="run_as_user" required>
|
||||
<option value="">- Select a user -</option>
|
||||
<?php
|
||||
$sql_run_users = mysqli_query($mysqli, "SELECT user_id, user_name FROM users WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC");
|
||||
$sql_run_users = mysqli_query($mysqli, "SELECT user_id, user_name, user_avatar FROM users WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC");
|
||||
while ($run_user = mysqli_fetch_assoc($sql_run_users)) {
|
||||
$run_user_id = intval($run_user['user_id']);
|
||||
$run_user_name = escapeHtml($run_user['user_name']); ?>
|
||||
<option value="<?= $run_user_id ?>"><?= $run_user_name ?></option>
|
||||
<option value="<?= $run_user_id ?>"<?= selectOptionUser($run_user['user_id'], $run_user['user_name'], $run_user['user_avatar'] ?? '') ?>><?= $run_user_name ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -49,11 +49,11 @@ ob_start();
|
||||
<select class="form-select select2" name="run_as_user" required>
|
||||
<option value="">- Select a user -</option>
|
||||
<?php
|
||||
$sql_run_users = mysqli_query($mysqli, "SELECT user_id, user_name FROM users WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC");
|
||||
$sql_run_users = mysqli_query($mysqli, "SELECT user_id, user_name, user_avatar FROM users WHERE user_type = 1 AND user_status = 1 AND user_archived_at IS NULL ORDER BY user_name ASC");
|
||||
while ($run_user = mysqli_fetch_assoc($sql_run_users)) {
|
||||
$run_user_id = intval($run_user['user_id']);
|
||||
$run_user_name = escapeHtml($run_user['user_name']); ?>
|
||||
<option value="<?= $run_user_id ?>" <?php if ($run_user_id == $api_key_user_id) { echo "selected"; } ?>><?= $run_user_name ?></option>
|
||||
<option value="<?= $run_user_id ?>" <?php if ($run_user_id == $api_key_user_id) { echo "selected"; } ?><?= selectOptionUser($run_user['user_id'], $run_user['user_name'], $run_user['user_avatar'] ?? '') ?>><?= $run_user_name ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -30,11 +30,11 @@ ob_start();
|
||||
<option value="0">- All ticket categories -</option>
|
||||
<?php
|
||||
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name, category_color, category_icon FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_id_select = intval($row['category_id']);
|
||||
$category_name_select = escapeHtml($row['category_name']); ?>
|
||||
<option value="<?= $category_id_select ?>"><?= $category_name_select ?></option>
|
||||
<option value="<?= $category_id_select ?>"<?= selectOptionColor($row['category_color'] ?? '', $row['category_icon'] ?? '') ?>><?= $category_name_select ?></option>
|
||||
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
@@ -44,11 +44,11 @@ ob_start();
|
||||
<option value="0" <?php if ($canned_response_category_id == 0) { echo "selected"; } ?>>- All ticket categories -</option>
|
||||
<?php
|
||||
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name, category_color, category_icon FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($category_row = mysqli_fetch_assoc($sql_categories)) {
|
||||
$category_id_select = intval($category_row['category_id']);
|
||||
$category_name_select = escapeHtml($category_row['category_name']); ?>
|
||||
<option value="<?= $category_id_select ?>" <?php if ($canned_response_category_id == $category_id_select) { echo "selected"; } ?>><?= $category_name_select ?></option>
|
||||
<option value="<?= $category_id_select ?>" <?php if ($canned_response_category_id == $category_id_select) { echo "selected"; } ?><?= selectOptionColor($category_row['category_color'] ?? '', $category_row['category_icon'] ?? '') ?>><?= $category_name_select ?></option>
|
||||
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
@@ -133,12 +133,12 @@ ob_start();
|
||||
<option value="">- Select a Category -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
$sql = mysqli_query($mysqli, "SELECT category_id, category_name, category_color, category_icon FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_assoc($sql)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = escapeHtml($row['category_name']);
|
||||
?>
|
||||
<option <?php if ($category_name === 'Processing Fee') { echo "selected"; } ?> value="<?= $category_id ?>"><?= $category_name ?></option>
|
||||
<option <?php if ($category_name === 'Processing Fee') { echo "selected"; } ?> value="<?= $category_id ?>"<?= selectOptionColor($row['category_color'] ?? '', $row['category_icon'] ?? '') ?>><?= $category_name ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -136,12 +136,12 @@ ob_start();
|
||||
<option value="">- Select a Category -</option>
|
||||
<?php
|
||||
|
||||
$sql_category = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
$sql_category = mysqli_query($mysqli, "SELECT category_id, category_name, category_color, category_icon FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_assoc($sql_category)) {
|
||||
$category_id_select = intval($row['category_id']);
|
||||
$category_name = escapeHtml($row['category_name']);
|
||||
?>
|
||||
<option <?php if ($category_id === $category_id_select) { echo "selected"; } ?> value="<?= $category_id_select ?>"><?= $category_name ?></option>
|
||||
<option <?php if ($category_id === $category_id_select) { echo "selected"; } ?> value="<?= $category_id_select ?>"<?= selectOptionColor($row['category_color'] ?? '', $row['category_icon'] ?? '') ?>><?= $category_name ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ ob_start();
|
||||
<option value="">- Select Type -</option>
|
||||
<<?php
|
||||
$sql_software_types_select = mysqli_query($mysqli, "
|
||||
SELECT category_name FROM categories
|
||||
SELECT category_name, category_color, category_icon FROM categories
|
||||
WHERE category_type = 'software_type'
|
||||
AND category_archived_at IS NULL
|
||||
ORDER BY category_order ASC, category_name ASC
|
||||
@@ -65,7 +65,7 @@ ob_start();
|
||||
while ($row = mysqli_fetch_assoc($sql_software_types_select)) {
|
||||
$software_type_select = escapeHtml($row['category_name']);
|
||||
?>
|
||||
<option><?= $software_type_select ?></option>
|
||||
<option<?= selectOptionColor($row['category_color'] ?? '', $row['category_icon'] ?? '') ?>><?= $software_type_select ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@ ob_start();
|
||||
<option value="">- Select Type -</option>
|
||||
<<?php
|
||||
$sql_software_types_select = mysqli_query($mysqli, "
|
||||
SELECT category_name FROM categories
|
||||
SELECT category_name, category_color, category_icon FROM categories
|
||||
WHERE category_type = 'software_type'
|
||||
AND category_archived_at IS NULL
|
||||
ORDER BY category_order ASC, category_name ASC
|
||||
@@ -78,7 +78,7 @@ ob_start();
|
||||
while ($row = mysqli_fetch_assoc($sql_software_types_select)) {
|
||||
$software_type_select = escapeHtml($row['category_name']);
|
||||
?>
|
||||
<option <?php if($software_type == $software_type_select) { echo "selected"; } ?>>
|
||||
<option <?php if($software_type == $software_type_select) { echo "selected"; } ?><?= selectOptionColor($row['category_color'] ?? '', $row['category_icon'] ?? '') ?>>
|
||||
<?= $software_type_select ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
|
||||
@@ -55,13 +55,13 @@ ob_start();
|
||||
<select class="form-select select2" name="ticket_assign" required>
|
||||
<option value="0">No one</option>
|
||||
<?php
|
||||
$sql_users = mysqli_query($mysqli, "SELECT user_id, user_name FROM users WHERE user_type = 1 AND user_archived_at IS NULL");
|
||||
$sql_users = mysqli_query($mysqli, "SELECT user_id, user_name, user_avatar FROM users WHERE user_type = 1 AND user_archived_at IS NULL");
|
||||
while ($row = mysqli_fetch_assoc($sql_users)) {
|
||||
$user_id_select = intval($row['user_id']);
|
||||
$user_name_select = escapeHtml($row['user_name']);
|
||||
|
||||
?>
|
||||
<option value="<?= $user_id_select ?>"><?= $user_name_select ?></option>
|
||||
<option value="<?= $user_id_select ?>"<?= selectOptionUser($row['user_id'], $row['user_name'], $row['user_avatar'] ?? '') ?>><?= $user_name_select ?></option>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user