Don't require a contact for recurring tickets

This commit is contained in:
wrongecho 2025-01-09 16:23:35 +00:00
parent 90e53981f6
commit 64fd761934
5 changed files with 5 additions and 22 deletions

View File

@ -7,7 +7,8 @@ All notable changes to ITFlow will be documented in this file.
- Bugfix: Ticket edit modal not showing multi-client/no-client projects
- Bugfix: Asset interface losing DHCP setting
- Bugfix: Editing / creating recurring expenses results in error 500 due to incorrect var name
- Stripe online payment setup now prompts you to set the income/expense account
- Bugfix: Recurring tickets no longer require a contact
- Bugfix: Stripe online payment setup now prompts you to set the income/expense account
- Admin pages now once again use the new admin role-check
- Debug now shows the current git branch
- Individual POST handler logic pages can no longer be accessed directly

View File

@ -1980,14 +1980,6 @@ if (isset($_POST['add_recurring_ticket'])) {
$start_date = sanitizeInput($_POST['start_date']);
// If no contact is selected automatically choose the primary contact for the client
if ($client_id > 0 && $contact_id == 0) {
$sql = mysqli_query($mysqli, "SELECT contact_id FROM contacts WHERE contact_client_id = $client_id AND contact_primary = 1");
$row = mysqli_fetch_array($sql);
$contact_id = intval($row['contact_id']);
}
// Add recurring (scheduled) ticket
mysqli_query($mysqli, "INSERT INTO scheduled_tickets SET scheduled_ticket_subject = '$subject', scheduled_ticket_details = '$details', scheduled_ticket_priority = '$priority', scheduled_ticket_frequency = '$frequency', scheduled_ticket_billable = $billable, scheduled_ticket_start_date = '$start_date', scheduled_ticket_next_run = '$start_date', scheduled_ticket_assigned_to = $assigned_to, scheduled_ticket_created_by = $session_user_id, scheduled_ticket_client_id = $client_id, scheduled_ticket_contact_id = $contact_id, scheduled_ticket_asset_id = $asset_id");
$scheduled_ticket_id = mysqli_insert_id($mysqli);
@ -2009,14 +2001,6 @@ if (isset($_POST['edit_recurring_ticket'])) {
$scheduled_ticket_id = intval($_POST['scheduled_ticket_id']);
$next_run_date = sanitizeInput($_POST['next_date']);
// If no contact is selected automatically choose the primary contact for the client
if ($client_id > 0 && $contact_id == 0) {
$sql = mysqli_query($mysqli, "SELECT contact_id FROM contacts WHERE contact_client_id = $client_id AND contact_primary = 1");
$row = mysqli_fetch_array($sql);
$contact_id = intval($row['contact_id']);
}
// Edit scheduled ticket
mysqli_query($mysqli, "UPDATE scheduled_tickets SET scheduled_ticket_subject = '$subject', scheduled_ticket_details = '$details', scheduled_ticket_priority = '$priority', scheduled_ticket_frequency = '$frequency', scheduled_ticket_billable = $billable, scheduled_ticket_next_run = '$next_run_date', scheduled_ticket_assigned_to = $assigned_to, scheduled_ticket_asset_id = $asset_id, scheduled_ticket_contact_id = $contact_id WHERE scheduled_ticket_id = $scheduled_ticket_id");
// Logging

View File

@ -130,7 +130,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<select class="form-control select2" name="contact" id="contactSelect" required>
<select class="form-control select2" name="contact" id="contactSelect">
</select>
</div>
</div>

View File

@ -85,12 +85,12 @@
<div class="tab-pane fade" id="pills-edit-contacts">
<div class="form-group">
<label>Contact <strong class="text-danger">*</strong></label>
<label>Contact</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<select class="form-control select2" name="contact" id="editTicketContact" required>
<select class="form-control select2" name="contact" id="editTicketContact">
<option value="">- Contact -</option>
</select>
</div>

View File

@ -142,9 +142,7 @@ mysqli_query($mysqli, "DELETE FROM logs WHERE log_created_at < CURDATE() - INTER
// Whitelabel - Disable if expired/invalid
if ($config_whitelabel_enabled && !validateWhitelabelKey($config_whitelabel_key)) {
mysqli_query($mysqli, "UPDATE settings SET config_whitelabel_enabled = 0, config_whitelabel_key = '' WHERE company_id = 1");
appNotify("Settings", "White-labelling was disabled due to expired/invalid key", "settings_modules.php");
}