Moved Edit Recurring Ticket over to the new AJAX modal function
This commit is contained in:
51
ajax.php
51
ajax.php
@@ -284,57 +284,6 @@ if (isset($_GET['share_generate_link'])) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Looks up info for a given recurring (was scheduled) ticket ID from the database, used to dynamically populate modal edit fields
|
|
||||||
*/
|
|
||||||
if (isset($_GET['recurring_ticket_get_json_details'])) {
|
|
||||||
enforceUserPermission('module_support');
|
|
||||||
|
|
||||||
$client_id = intval($_GET['client_id']);
|
|
||||||
$ticket_id = intval($_GET['ticket_id']);
|
|
||||||
|
|
||||||
// Get all contacts, to allow tickets to be raised under a specific contact
|
|
||||||
$contact_sql = mysqli_query($mysqli, "SELECT contact_id, contact_name FROM contacts
|
|
||||||
WHERE contact_client_id = $client_id
|
|
||||||
AND contact_archived_at IS NULL
|
|
||||||
ORDER BY contact_primary DESC, contact_technical DESC, contact_name ASC"
|
|
||||||
);
|
|
||||||
while ($row = mysqli_fetch_array($contact_sql)) {
|
|
||||||
$response['contacts'][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get ticket details
|
|
||||||
$ticket_sql = mysqli_query($mysqli, "SELECT * FROM scheduled_tickets
|
|
||||||
WHERE scheduled_ticket_id = $ticket_id
|
|
||||||
AND scheduled_ticket_client_id = $client_id LIMIT 1");
|
|
||||||
while ($row = mysqli_fetch_array($ticket_sql)) {
|
|
||||||
$response['ticket'][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get assets
|
|
||||||
$asset_sql = mysqli_query($mysqli, "SELECT asset_id, asset_name FROM assets WHERE asset_client_id = $client_id AND asset_archived_at IS NULL");
|
|
||||||
while ($row = mysqli_fetch_array($asset_sql)) {
|
|
||||||
$response['assets'][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get technicians to auto assign the ticket to
|
|
||||||
$sql_agents = mysqli_query(
|
|
||||||
$mysqli,
|
|
||||||
"SELECT users.user_id, user_name FROM users
|
|
||||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
|
||||||
WHERE user_role > 1
|
|
||||||
AND user_status = 1
|
|
||||||
AND user_archived_at IS NULL
|
|
||||||
ORDER BY user_name ASC"
|
|
||||||
);
|
|
||||||
while ($row = mysqli_fetch_array($sql_agents)) {
|
|
||||||
$response['agents'][] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo json_encode($response);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns sorted list of active clients
|
* Returns sorted list of active clients
|
||||||
*/
|
*/
|
||||||
|
|||||||
233
ajax/ajax_recurring_ticket_edit.php
Normal file
233
ajax/ajax_recurring_ticket_edit.php
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../includes/ajax_header.php';
|
||||||
|
|
||||||
|
$scheduled_ticket_id = intval($_GET['id']);
|
||||||
|
|
||||||
|
$sql = mysqli_query($mysqli, "SELECT * FROM scheduled_tickets WHERE scheduled_ticket_id = $scheduled_ticket_id LIMIT 1");
|
||||||
|
|
||||||
|
$row = mysqli_fetch_array($sql);
|
||||||
|
$client_id = intval($row['scheduled_ticket_client_id']);
|
||||||
|
$scheduled_ticket_subject = nullable_htmlentities($row['scheduled_ticket_subject']);
|
||||||
|
$scheduled_ticket_details = nullable_htmlentities($row['scheduled_ticket_details']);
|
||||||
|
$scheduled_ticket_priority = nullable_htmlentities($row['scheduled_ticket_priority']);
|
||||||
|
$scheduled_ticket_frequency = nullable_htmlentities($row['scheduled_ticket_frequency']);
|
||||||
|
$scheduled_ticket_next_run = nullable_htmlentities($row['scheduled_ticket_next_run']);
|
||||||
|
$scheduled_ticket_assigned_to = intval($row['scheduled_ticket_assigned_to']);
|
||||||
|
$scheduled_ticket_contact_id = intval($row['scheduled_ticket_contact_id']);
|
||||||
|
$scheduled_ticket_asset_id = intval($row['scheduled_ticket_asset_id']);
|
||||||
|
$scheduled_ticket_billable = intval($row['scheduled_ticket_billable']);
|
||||||
|
|
||||||
|
// Generate the HTML form content using output buffering.
|
||||||
|
ob_start();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title"><i class="fas fa-fw fa-calendar-check mr-2"></i>Editing Recurring Ticket: <strong><?php echo $scheduled_ticket_subject; ?></strong></h5>
|
||||||
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
|
<span>×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
<input type="hidden" name="scheduled_ticket_id" value="<?php echo $scheduled_ticket_id; ?>">
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||||
|
|
||||||
|
<div class="modal-body bg-white">
|
||||||
|
|
||||||
|
<ul class="nav nav-pills nav-justified mb-3">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="pill" href="#pills-edit-details<?php echo $scheduled_ticket_id; ?>"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-edit-contacts<?php echo $scheduled_ticket_id; ?>"><i class="fa fa-fw fa-users mr-2"></i>Contacts</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-edit-schedule<?php echo $scheduled_ticket_id; ?>"><i class="fa fa-fw fa-building mr-2"></i>Schedule</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="pill" href="#pills-edit-assets<?php echo $scheduled_ticket_id; ?>"><i class="fa fa-fw fa-desktop mr-2"></i>Assets</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
|
||||||
|
|
||||||
|
<div class="tab-pane fade show active" id="pills-edit-details<?php echo $scheduled_ticket_id; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Subject <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="subject" placeholder="Subject" maxlength="500" value="<?php echo $scheduled_ticket_subject; ?>" required >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<textarea class="form-control tinymce" name="details"><?php echo $scheduled_ticket_details; ?></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Priority <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="priority" required>
|
||||||
|
<option <?php if ($scheduled_ticket_priority == "Low") { echo "selected"; } ?> >Low</option>
|
||||||
|
<option <?php if ($scheduled_ticket_priority == "Medium") { echo "selected"; } ?> >Medium</option>
|
||||||
|
<option <?php if ($scheduled_ticket_priority == "High") { echo "selected"; } ?> >High</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Assign To</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="assigned_to">
|
||||||
|
<option value="0">- Select Agent -</option>
|
||||||
|
<?php
|
||||||
|
$sql_users_select = mysqli_query($mysqli, "SELECT user_id, user_name FROM users
|
||||||
|
WHERE user_type = 1
|
||||||
|
AND user_archived_at IS NULL
|
||||||
|
ORDER BY user_name DESC"
|
||||||
|
);
|
||||||
|
while ($row = mysqli_fetch_array($sql_users_select)) {
|
||||||
|
$user_id_select = intval($row['user_id']);
|
||||||
|
$user_name_select = nullable_htmlentities($row['user_name']);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $user_id_select; ?>" <?php if ($scheduled_ticket_assigned_to == $user_id_select) { echo "selected"; } ?>><?php echo $user_name_select; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group <?php if (!$config_module_enable_accounting) { echo 'd-none'; } ?>">
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="editTicketBillable" name="billable"
|
||||||
|
<?php if ($scheduled_ticket_billable == 1) { echo "checked"; } ?> value="1"
|
||||||
|
>
|
||||||
|
<label class="custom-control-label" for="editTicketBillable">Mark Billable</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-edit-contacts<?php echo $scheduled_ticket_id; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<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">
|
||||||
|
<option value="0">- Select Contact -</option>
|
||||||
|
<?php
|
||||||
|
$sql_client_contacts_select = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_title, contact_primary, contact_technical FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_primary DESC, contact_technical DESC, contact_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_client_contacts_select)) {
|
||||||
|
$contact_id_select = intval($row['contact_id']);
|
||||||
|
$contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
$contact_primary_select = intval($row['contact_primary']);
|
||||||
|
if($contact_primary_select == 1) {
|
||||||
|
$contact_primary_display_select = " (Primary)";
|
||||||
|
} else {
|
||||||
|
$contact_primary_display_select = "";
|
||||||
|
}
|
||||||
|
$contact_technical_select = intval($row['contact_technical']);
|
||||||
|
if($contact_technical_select == 1) {
|
||||||
|
$contact_technical_display_select = " (Technical)";
|
||||||
|
} else {
|
||||||
|
$contact_technical_display_select = "";
|
||||||
|
}
|
||||||
|
$contact_title_select = nullable_htmlentities($row['contact_title']);
|
||||||
|
if(!empty($contact_title_select)) {
|
||||||
|
$contact_title_display_select = " - $contact_title_select";
|
||||||
|
} else {
|
||||||
|
$contact_title_display_select = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $contact_id_select; ?>" <?php if ($contact_id_select == $scheduled_ticket_contact_id) { echo "selected"; } ?>><?php echo "$contact_name_select$contact_title_display_select$contact_primary_display_select$contact_technical_display_select"; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-edit-schedule<?php echo $scheduled_ticket_id; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Frequency <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="frequency">
|
||||||
|
<option <?php if ($scheduled_ticket_frequency == "Weekly") { echo "selected"; } ?>>Weekly</option>
|
||||||
|
<option <?php if ($scheduled_ticket_frequency == "Monthly") { echo "selected"; } ?>>Monthly</option>
|
||||||
|
<option <?php if ($scheduled_ticket_frequency == "Quarterly") { echo "selected"; } ?>>Quarterly</option>
|
||||||
|
<option <?php if ($scheduled_ticket_frequency == "Biannually") { echo "selected"; } ?>>Biannually</option>
|
||||||
|
<option <?php if ($scheduled_ticket_frequency == "Annually") { echo "selected"; } ?>>Annually</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Next run date <strong class="text-danger">*</strong></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-calendar-day"></i></span>
|
||||||
|
</div>
|
||||||
|
<input class="form-control" type="date" name="next_date" max="2999-12-31" value="<?php echo $scheduled_ticket_next_run; ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="pills-edit-assets<?php echo $scheduled_ticket_id; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Asset</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="asset">
|
||||||
|
<option value="0">- Select Asset -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql_assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC");
|
||||||
|
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||||
|
$asset_id_select = intval($row['asset_id']);
|
||||||
|
$asset_name_select = nullable_htmlentities($row['asset_name']);
|
||||||
|
$asset_contact_name_select = nullable_htmlentities($row['contact_name']);
|
||||||
|
?>
|
||||||
|
<option <?php if ($scheduled_ticket_asset_id == $asset_id_select) { echo "selected"; } ?> value="<?php echo $asset_id_select; ?>"><?php echo "$asset_name_select - $asset_contact_name_select"; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer bg-white">
|
||||||
|
<button type="submit" name="edit_recurring_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Save</button>
|
||||||
|
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once "../includes/ajax_footer.php";
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
function populateRecurringTicketEditModal(client_id, ticket_id) {
|
|
||||||
|
|
||||||
// Send a GET request to ajax.php as ajax.php?recurring_ticket_get_json_details=true&client_id=NUM&ticket_id=NUM
|
|
||||||
jQuery.get(
|
|
||||||
"ajax.php",
|
|
||||||
{recurring_ticket_get_json_details: 'true', client_id: client_id, ticket_id: ticket_id},
|
|
||||||
function(data){
|
|
||||||
|
|
||||||
// If we get a response from post.php, parse it as JSON
|
|
||||||
const response = JSON.parse(data);
|
|
||||||
|
|
||||||
// Access the ticket info, agents and all potential assets
|
|
||||||
const contacts = response.contacts;
|
|
||||||
const ticket = response.ticket[0];
|
|
||||||
const agents = response.agents;
|
|
||||||
const assets = response.assets;
|
|
||||||
|
|
||||||
// Populate the scheduled ticket modal fields
|
|
||||||
document.getElementById("editHeader").innerText = " Edit Recurring ticket: " + ticket.scheduled_ticket_subject;
|
|
||||||
document.getElementById("editTicketId").value = ticket_id;
|
|
||||||
document.getElementById("editClientId").value = client_id;
|
|
||||||
document.getElementById("editTicketBillable").checked = !!parseInt(ticket.scheduled_ticket_billable);
|
|
||||||
document.getElementById("editTicketSubject").value = ticket.scheduled_ticket_subject;
|
|
||||||
document.getElementById("editTicketNextRun").value = ticket.scheduled_ticket_next_run;
|
|
||||||
tinyMCE.get('editTicketDetails').setContent(ticket.scheduled_ticket_details);
|
|
||||||
|
|
||||||
// Agent assignment dropdown
|
|
||||||
var agentDropdown = document.getElementById("editTicketAgent");
|
|
||||||
|
|
||||||
// Clear agent dropdown
|
|
||||||
var i, L = agentDropdown.options.length -1;
|
|
||||||
for(i = L; i >= 0; i--) {
|
|
||||||
agentDropdown.remove(i);
|
|
||||||
}
|
|
||||||
agentDropdown[agentDropdown.length] = new Option('- Agent -', '0');
|
|
||||||
|
|
||||||
|
|
||||||
// Populate dropdown
|
|
||||||
agents.forEach(agent => {
|
|
||||||
if(parseInt(agent.user_id) == parseInt(ticket.scheduled_ticket_assigned_to)){
|
|
||||||
// Selected agent
|
|
||||||
agentDropdown[agentDropdown.length] = new Option(agent.user_name, agent.user_id, true, true);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
agentDropdown[agentDropdown.length] = new Option(agent.user_name, agent.user_id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Contact dropdown
|
|
||||||
var contactDropdown = document.getElementById("editTicketContact");
|
|
||||||
|
|
||||||
// Clear contact dropdown
|
|
||||||
var i, L = contactDropdown.options.length -1;
|
|
||||||
for(i = L; i >= 0; i--) {
|
|
||||||
contactDropdown.remove(i);
|
|
||||||
}
|
|
||||||
contactDropdown[contactDropdown.length] = new Option('- Contact -', '0');
|
|
||||||
|
|
||||||
|
|
||||||
// Populate dropdown
|
|
||||||
contacts.forEach(contact => {
|
|
||||||
if(parseInt(contact.contact_id) == parseInt(ticket.scheduled_ticket_contact_id)){
|
|
||||||
// Selected contact
|
|
||||||
contactDropdown[contactDropdown.length] = new Option(contact.contact_name, contact.contact_id, true, true);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
contactDropdown[contactDropdown.length] = new Option(contact.contact_name, contact.contact_id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Frequency dropdown
|
|
||||||
var frequencyDropdown = document.querySelector("#editTicketFrequency");
|
|
||||||
Array.from(frequencyDropdown.options).forEach(function (option, index){
|
|
||||||
if(option.id === ticket.scheduled_ticket_frequency){
|
|
||||||
frequencyDropdown.selectedIndex = index;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Priority dropdown
|
|
||||||
var priorityDropdown = document.querySelector("#editTicketPriority");
|
|
||||||
Array.from(priorityDropdown.options).forEach(function (option, index){
|
|
||||||
if(option.id === ticket.scheduled_ticket_priority){
|
|
||||||
priorityDropdown.selectedIndex = index;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Asset dropdown
|
|
||||||
if (assets && assets.length > 0) {
|
|
||||||
var assetDropdown = document.getElementById("editTicketAssetId");
|
|
||||||
|
|
||||||
// Clear asset dropdown
|
|
||||||
var i, L = assetDropdown.options.length -1;
|
|
||||||
for(i = L; i >= 0; i--) {
|
|
||||||
assetDropdown.remove(i);
|
|
||||||
}
|
|
||||||
assetDropdown[assetDropdown.length] = new Option('- Asset -', '0');
|
|
||||||
|
|
||||||
// Populate dropdown
|
|
||||||
assets.forEach(asset => {
|
|
||||||
if(parseInt(asset.asset_id) == parseInt(ticket.scheduled_ticket_asset_id)){
|
|
||||||
// Selected asset
|
|
||||||
assetDropdown[assetDropdown.length] = new Option(asset.asset_name, asset.asset_id, true, true);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
assetDropdown[assetDropdown.length] = new Option(asset.asset_name, asset.asset_id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
<div class="modal" id="editRecurringTicketModal" tabindex="-1">
|
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content bg-dark">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title"><i class="fas fa-fw fa-calendar-check mr-2"></i><span id="editHeader"></span></h5>
|
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
|
||||||
<span>×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
|
||||||
<input type="hidden" name="scheduled_ticket_id" id="editTicketId">
|
|
||||||
<input type="hidden" name="client" id="editClientId">
|
|
||||||
|
|
||||||
<div class="modal-body bg-white">
|
|
||||||
|
|
||||||
<ul class="nav nav-pills nav-justified mb-3">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" data-toggle="pill" href="#pills-edit-details"><i class="fa fa-fw fa-life-ring mr-2"></i>Details</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-edit-contacts"><i class="fa fa-fw fa-users mr-2"></i>Contacts</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-edit-schedule"><i class="fa fa-fw fa-building mr-2"></i>Schedule</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="pill" href="#pills-edit-assets"><i class="fa fa-fw fa-desktop mr-2"></i>Assets</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="tab-content" <?php if (lookupUserPermission('module_support') <= 1) { echo 'inert'; } ?>>
|
|
||||||
|
|
||||||
<div class="tab-pane fade show active" id="pills-edit-details">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Subject <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="subject" placeholder="Subject" maxlength="500" required id="editTicketSubject">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<textarea class="form-control tinymce" name="details" id="editTicketDetails"></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Priority <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
|
||||||
</div>
|
|
||||||
<!-- Not using select2 as couldn't get this working with Javascript modal population -->
|
|
||||||
<select class="form-control" name="priority" required id="editTicketPriority">
|
|
||||||
<option id="Low">Low</option>
|
|
||||||
<option id="Medium">Medium</option>
|
|
||||||
<option id="High">High</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Assign To</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="assigned_to" id="editTicketAgent">
|
|
||||||
<option value="0">- Not Assigned -</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group" <?php if (!$config_module_enable_accounting) { echo 'style="display:none"'; } ?>>
|
|
||||||
<div class="custom-control custom-switch">
|
|
||||||
<input type="checkbox" class="custom-control-input" name="billable" id="editTicketBillable" value="1">
|
|
||||||
<label class="custom-control-label" for="editTicketBillable">Mark Billable</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-edit-contacts">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<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">
|
|
||||||
<option value="">- Contact -</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-edit-schedule">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Frequency <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
|
||||||
</div>
|
|
||||||
<!-- Not using select2 as couldn't get this working with Javascript modal population -->
|
|
||||||
<select class="form-control" name="frequency" required id="editTicketFrequency">
|
|
||||||
<option id="Weekly">Weekly</option>
|
|
||||||
<option id="Monthly">Monthly</option>
|
|
||||||
<option id="Quarterly">Quarterly</option>
|
|
||||||
<option id="Biannually">Biannually</option>
|
|
||||||
<option id="Annually">Annually</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Next run date <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar-day"></i></span>
|
|
||||||
</div>
|
|
||||||
<input class="form-control" type="date" name="next_date" id="editTicketNextRun" max="2999-12-31">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pills-edit-assets">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Asset</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control select2" name="asset" id="editTicketAssetId">
|
|
||||||
<option value="0">- None -</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer bg-white">
|
|
||||||
<button type="submit" name="edit_recurring_ticket" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Save</button>
|
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -177,7 +177,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a href="#" data-toggle="modal" data-target="#editRecurringTicketModal" onclick="populateRecurringTicketEditModal(<?php echo $scheduled_ticket_client_id, ",", $scheduled_ticket_id ?>)"> <?php echo $scheduled_ticket_subject ?>
|
<a href="#"
|
||||||
|
data-toggle="ajax-modal"
|
||||||
|
data-modal-size="lg"
|
||||||
|
data-ajax-url="ajax/ajax_recurring_ticket_edit.php"
|
||||||
|
data-ajax-id="<?php echo $scheduled_ticket_id; ?>"
|
||||||
|
>
|
||||||
|
<?php echo $scheduled_ticket_subject ?>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@@ -194,7 +200,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
<i class="fas fa-ellipsis-h"></i>
|
<i class="fas fa-ellipsis-h"></i>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editRecurringTicketModal" onclick="populateRecurringTicketEditModal(<?php echo $scheduled_ticket_client_id, ",", $scheduled_ticket_id ?>)">
|
<a class="dropdown-item" href="#"
|
||||||
|
data-toggle="ajax-modal"
|
||||||
|
data-modal-size="lg"
|
||||||
|
data-ajax-url="ajax/ajax_recurring_ticket_edit.php"
|
||||||
|
data-ajax-id="<?php echo $scheduled_ticket_id; ?>"
|
||||||
|
>
|
||||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@@ -230,10 +241,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/recurring_tickets_edit_modal.js"></script>
|
|
||||||
<script src="js/bulk_actions.js"></script>
|
<script src="js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require_once "modals/recurring_ticket_add_modal.php";
|
require_once "modals/recurring_ticket_add_modal.php";
|
||||||
require_once "modals/recurring_ticket_edit_modal.php";
|
|
||||||
require_once "includes/footer.php";
|
require_once "includes/footer.php";
|
||||||
|
|||||||
Reference in New Issue
Block a user