mirror of
https://github.com/itflow-org/itflow
synced 2026-08-05 07:07:14 +00:00
Allow selecting client SLA assignments on client create/edit
This commit is contained in:
@@ -24,6 +24,13 @@ $client_notes = escapeHtml($row['client_notes']);
|
||||
$client_created_at = escapeHtml($row['client_created_at']);
|
||||
$client_archived_at = escapeHtml($row['client_archived_at']);
|
||||
|
||||
// Client SLA assignments
|
||||
$client_sla_assignments = [];
|
||||
$sql_client_slas = mysqli_query($mysqli, "SELECT sla_assignment_priority, sla_assignment_sla_id FROM sla_assignments WHERE sla_assignment_client_id = $client_id");
|
||||
while ($client_sla_row = mysqli_fetch_assoc($sql_client_slas)) {
|
||||
$client_sla_assignments[$client_sla_row['sla_assignment_priority']] = intval($client_sla_row['sla_assignment_sla_id']);
|
||||
}
|
||||
|
||||
// Client Tags
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT tag_id FROM client_tags WHERE client_id = $client_id");
|
||||
@@ -186,6 +193,34 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Ticket SLA assignments - only offered when active SLAs exist
|
||||
$sla_options = [];
|
||||
$sla_options_sql = mysqli_query($mysqli, "SELECT sla_id, sla_name FROM slas WHERE sla_archived_at IS NULL ORDER BY sla_name ASC");
|
||||
while ($sla_option_row = mysqli_fetch_assoc($sla_options_sql)) {
|
||||
$sla_options[intval($sla_option_row['sla_id'])] = $sla_option_row['sla_name'];
|
||||
}
|
||||
if ($config_module_enable_ticketing && !empty($sla_options)) { ?>
|
||||
<div class="form-group">
|
||||
<label>Ticket SLAs</label>
|
||||
<div class="form-row">
|
||||
<?php foreach (['Low', 'Medium', 'High'] as $sla_priority) { $sla_current = $client_sla_assignments[$sla_priority] ?? 'default'; ?>
|
||||
<div class="col-4">
|
||||
<small class="text-secondary"><?= $sla_priority ?></small>
|
||||
<select class="form-control" name="client_sla_<?= strtolower($sla_priority) ?>">
|
||||
<option value="default" <?php if ($sla_current === 'default') { echo "selected"; } ?>>Default</option>
|
||||
<option value="0" <?php if ($sla_current === 0) { echo "selected"; } ?>>None</option>
|
||||
<?php foreach ($sla_options as $sla_option_id => $sla_option_name) { ?>
|
||||
<option value="<?= $sla_option_id ?>" <?php if ($sla_current === $sla_option_id) { echo "selected"; } ?>><?= escapeHtml($sla_option_name) ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<small class="text-muted">Default follows the global SLA assignment for each priority.</small>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
|
||||
Reference in New Issue
Block a user