Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
vadivelJ96 2025-08-21 17:17:25 +05:30
commit 3dda9c5991
2 changed files with 19 additions and 23 deletions

View File

@ -88,6 +88,7 @@ class ThzMasterNotesModel extends Model
$ticketTypeFilter = "AND ( thz_master_notes.notes_type = 'External' OR thz_master_notes.notes_type = 'Internal' ) ";
}
$integer_ticket_id = (int)$thz_id;
$notes_sql = "SELECT
thz_master_notes.*,
@ -105,7 +106,7 @@ class ThzMasterNotesModel extends Model
LEFT JOIN thz_master
ON thz_master.thz_id = thz_master_notes.thz_id
AND LOWER(thz_master_notes.notes_by) = 'user'
WHERE thz_master_notes.thz_id = '. (int)$thz_id .'
WHERE thz_master_notes.thz_id = ". $integer_ticket_id ."
$ticketTypeFilter
ORDER BY thz_master_notes.created_at ASC";

View File

@ -199,19 +199,19 @@
<!-- Input Card -->
<div class="card">
<form id="conversationForm">
<input type="hidden" id="notes_type" name="notes_type">
<input type="hidden" id="thz_id" name="thz_id">
<input type="hidden" id="notes_by" name="notes_by" value="Staff">
<input type="hidden" id="created_by" name="created_by" value="<?= get_session_userid(); ?>">
<div class="notes-box">
<form id="conversationForm">
<textarea class="form-control" id="notes" name="notes" placeholder="Write your notes here..."></textarea>
<input type="hidden" id="notes_type" name="notes_type">
<input type="hidden" id="thz_id" name="thz_id">
<input type="hidden" id="notes_by" name="notes_by" value="Staff">
<input type="hidden" id="created_by" name="created_by" value="<?= get_session_userid(); ?>">
<div class="icon-buttons">
<button type="button" class="btn-icon" onclick="submitConverstionTicket('External')"><i class="mdi mdi-content-save"></i></button>
<button type="button" class="btn-icon" onclick="submitConverstionTicket('Internal')"><i class="mdi mdi-email"></i></button>
</div>
</form>
<textarea class="form-control" id="notes" name="notes" placeholder="Write your notes here..."></textarea>
<div class="icon-buttons">
<button type="button" class="btn-icon" onclick="submitConverstionTicket('External')"><i class="mdi mdi-content-save"></i></button>
<button type="button" class="btn-icon" onclick="submitConverstionTicket('Internal')"><i class="mdi mdi-email"></i></button>
</div>
</div>
</form>
</div>
</div>
@ -232,7 +232,7 @@
<div class="modal-body">
<div class="form-row">
<input type="hidden" id="thz_id" name="thz_id">
<input type="hidden" id="edit_thz_id" name="thz_id">
<input type="hidden" id="updated_by" name="updated_by" value="<?= get_session_userid(); ?>">
<div class="form-group col-md-12">
@ -335,13 +335,10 @@
form.reset();
var masterData = <?= json_encode($master[0]); ?>;
// console.log("*****");
// console.log(masterData);
document.getElementById('EditModalLabel').innerText = "Update";
document.getElementById('thz_id').value = masterData.thz_id;
document.getElementById('edit_thz_id').value = masterData.thz_id;
document.getElementById('assign_to').value = masterData.assign_to;
document.getElementById('status').value = masterData.status;
document.getElementById('ticket_type').value = masterData.ticket_type;
@ -355,11 +352,10 @@
function submitTicket() {
var form = document.getElementById("ticketForm"); // your form ID
var form = document.getElementById("ticketForm");
var id = form.querySelector("[name='thz_id']").value;
var formData = new FormData(form);
var id = form.querySelector("[name='thz_id']").value;
$.ajax({
url: "<?= base_url('ticketSave') ?>",
type: "POST",
@ -389,7 +385,7 @@
document.getElementById("notes_type").value = notetype;
const urlParams = new URLSearchParams(window.location.search);
document.getElementById("thz_id").value = urlParams.get('thz_id');
var id = urlParams.get('thz_id');
var form = document.getElementById("conversationForm");
var formData = new FormData(form);
@ -403,7 +399,6 @@
success: function(response) {
if (response.status === "success") {
toastr.success(response.message, 'success');
$('#ticketModal').modal('hide');
form.reset();
window.location.href = "<?= base_url('ticketConversationList?return_type=web&notes_ticket_type=Internal&thz_id=') ?>" + id;
} else {