mirror of https://github.com/itflow-org/itflow
Fixed issue with scheduled tickets breaking CRON removed invalid character, More work on Ticket Watchers
This commit is contained in:
parent
173230d250
commit
653fa01ecc
2
cron.php
2
cron.php
|
|
@ -272,7 +272,7 @@ if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
|
|||
$id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Ticket', log_action = 'Create', log_description = 'System created scheduled $frequency ticket - $subject', log_client_id = $client_id, log_user_id = $created_id`");
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Ticket', log_action = 'Create', log_description = 'System created scheduled $frequency ticket - $subject', log_client_id = $client_id, log_user_id = $created_id");
|
||||
|
||||
// E-mail client
|
||||
if (!empty($config_smtp_host) && $config_ticket_client_general_notifications == 1) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,14 @@ if (isset($_POST['add_ticket'])) {
|
|||
|
||||
$ticket_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Add Watchers
|
||||
if (!empty($_POST['watchers'])) {
|
||||
foreach($_POST['watchers'] as $watcher) {
|
||||
$watcher_email = sanitizeInput($watcher);
|
||||
mysqli_query($mysqli,"INSERT INTO ticket_watchers SET watcher_email = '$watcher_email', watcher_ticket_id = $ticket_id");
|
||||
}
|
||||
}
|
||||
|
||||
// E-mail client
|
||||
if (!empty($config_smtp_host) && $config_ticket_client_general_notifications == 1) {
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@
|
|||
<div class="form-group">
|
||||
<label>Watchers <span class="text-danger">Work in Progress</span></label>
|
||||
<div id="text-fields"></div>
|
||||
<button class="btn btn-primary" onclick="addTextField()"><i class="fas fa-fw fa-plus"></i> Add Watcher</button>
|
||||
<button type="button" class="btn btn-primary" onclick="addTextField()"><i class="fas fa-fw fa-plus"></i> Add Watcher</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
@ -209,7 +209,6 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-assets">
|
||||
|
|
|
|||
|
|
@ -134,6 +134,76 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Watchers <span class="text-danger">Work in Progress</span></label>
|
||||
|
||||
<div id="text-fields">
|
||||
<?php
|
||||
$sql_watchers = mysqli_query($mysqli, "SELECT * FROM ticket_watchers WHERE watcher_ticket_id = $ticket_id");
|
||||
while ($row = mysqli_fetch_array($sql_watchers)) {
|
||||
$watcher_id = intval($row['ticket_watcher_id']);
|
||||
$watcher_email = nullable_htmlentities($row['watcher_email']);
|
||||
?>
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="watchers[]" value="<?php echo $watcher_email; ?>">
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-danger"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary" type="button" onclick="addTextField()"><i class="fas fa-fw fa-plus"></i> Add Watcher</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function addTextField<?php echo $ticket_id; ?>() {
|
||||
var container = document.getElementById("text-fields<?php echo $ticket_id; ?>");
|
||||
var textFieldWrapper = document.createElement("div");
|
||||
textFieldWrapper.className = "input-group mb-3";
|
||||
|
||||
var prependWrapper = document.createElement("div");
|
||||
prependWrapper.className = "input-group-prepend";
|
||||
var iconSpan = document.createElement("span");
|
||||
iconSpan.className = "input-group-text";
|
||||
iconSpan.innerHTML = "<i class='fa fa-fw fa-envelope'></i>";
|
||||
prependWrapper.appendChild(iconSpan);
|
||||
|
||||
var textField = document.createElement("input");
|
||||
textField.type = "email";
|
||||
textField.className = "form-control";
|
||||
textField.name = "watchers[]";
|
||||
|
||||
var removeButtonWrapper = document.createElement("div");
|
||||
removeButtonWrapper.className = "input-group-append";
|
||||
|
||||
var removeButton = document.createElement("button");
|
||||
removeButton.className = "btn btn-danger";
|
||||
removeButton.type = "button";
|
||||
removeButton.innerHTML = "<i class='fas fa-fw fa-minus'></i>";
|
||||
removeButton.onclick = function() {
|
||||
removeTextField(this);
|
||||
};
|
||||
|
||||
removeButtonWrapper.appendChild(removeButton);
|
||||
textFieldWrapper.appendChild(prependWrapper);
|
||||
textFieldWrapper.appendChild(textField);
|
||||
textFieldWrapper.appendChild(removeButtonWrapper);
|
||||
container.appendChild(textFieldWrapper);
|
||||
}
|
||||
|
||||
function removeTextField(button) {
|
||||
var container = document.getElementById("text-fields");
|
||||
var textFieldWrapper = button.parentNode.parentNode; // Since we added an extra wrapping div
|
||||
container.removeChild(textFieldWrapper);
|
||||
}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-assets<?php echo $ticket_id; ?>">
|
||||
|
|
|
|||
Loading…
Reference in New Issue