Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
ac58717fb6
@ -421,7 +421,7 @@
|
||||
|
||||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||||
|
||||
<table data-custom-table-css="table" id="attachment_table" class="table table-sm mb-0" style="margin-top: 30px;">
|
||||
<table data-custom-table-css="table" id="attachment_table_common" class="table table-sm mb-0" style="margin-top: 30px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attachments</th>
|
||||
@ -604,6 +604,18 @@
|
||||
|
||||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||||
|
||||
<table data-custom-table-css="table" id="attachment_table_reminder" class="table table-sm mb-0" style="margin-top: 30px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attachments</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="attachment_tbody_reminder">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
@ -1439,8 +1451,8 @@
|
||||
|
||||
function addHTMLInput(data = null) {
|
||||
|
||||
console.log('addHTMLInput function called');
|
||||
console.log(template_name);
|
||||
console.log(`:) addHTMLInput function called for ${template_name}`); // REF : PS
|
||||
|
||||
var container = '';
|
||||
if (template_name == 'member_welcome_mail') {
|
||||
container = document.getElementById('attachment_tbody');
|
||||
@ -1448,6 +1460,9 @@
|
||||
else if (template_name == 'member_common_mail') {
|
||||
container = document.getElementById('attachment_tbody_common');
|
||||
}
|
||||
else if (template_name == 'member_reminder_mail') {
|
||||
container = document.getElementById('attachment_tbody_reminder');
|
||||
}
|
||||
else {
|
||||
container = document.getElementById('attachment_tbody_ecard');
|
||||
}
|
||||
@ -1472,20 +1487,39 @@
|
||||
const newFormRow = document.createElement('tr');
|
||||
newFormRow.className = 'dynamic-form-row';
|
||||
|
||||
newFormRow.innerHTML = `
|
||||
<td>
|
||||
<form class="ajax" onsubmit="submitAttachmentForm(event, this)">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-3">
|
||||
<input type="file" class="file-input__input" name="file" required>
|
||||
// newFormRow.innerHTML = `
|
||||
// <td>
|
||||
// <form class="ajax" onsubmit="submitAttachmentForm(event, this)">
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-3">
|
||||
// <input type="file" class="file-input__input" name="file" required>
|
||||
// </div>
|
||||
// <div class="form-group col-2">
|
||||
// <button type="submit" class="btn btn-sm btn-primary">Submit</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// </form>
|
||||
// </td>
|
||||
// `; // DONT DELETE IT REF : VVJ
|
||||
|
||||
newFormRow.innerHTML = `<td>
|
||||
<form class="ajax" onsubmit="submitAttachmentForm(event, this)">
|
||||
<div style="display:flex; align-items:center; gap:10px; white-space:nowrap;">
|
||||
<div>
|
||||
<input type="file" name="file" required
|
||||
style="width:100%; min-width:160px;
|
||||
padding: 0 !important;
|
||||
background-color: transparent !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
border-color: initial !important; color: white;">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-2">
|
||||
<button type="submit" class="btn btn-sm btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
`;
|
||||
</form>
|
||||
</td><td></td>`; // REF : PS
|
||||
|
||||
container.appendChild(newFormRow);
|
||||
|
||||
@ -1493,21 +1527,38 @@
|
||||
// If no data is passed, create a new empty row
|
||||
const newRow = document.createElement('tr');
|
||||
newRow.className = 'dynamic-form-row';
|
||||
newRow.innerHTML = `<td><form class="ajax" onsubmit="submitAttachmentForm(event, this)">
|
||||
<div style="display:flex; align-items:center; gap:10px; white-space:nowrap;">
|
||||
<div>
|
||||
<input type="file" name="file" required
|
||||
style="width:100%; min-width:160px;
|
||||
padding: 0 !important;
|
||||
background-color: transparent !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
border-color: initial !important; color: white;">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td><td></td>`; // REF : PS
|
||||
|
||||
newRow.innerHTML = `
|
||||
<td>
|
||||
<form class="ajax" onsubmit="submitAttachmentForm(event, this)">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-3">
|
||||
<input type="file" class="file-input__input" name="file" required>
|
||||
</div>
|
||||
<div class="form-group col-2">
|
||||
<button type="submit" class="btn btn-sm btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
`;
|
||||
// newRow.innerHTML = `
|
||||
// <td>
|
||||
// <form class="ajax" onsubmit="submitAttachmentForm(event, this)">
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-3">
|
||||
// <input type="file" class="file-input__input" name="file" required>
|
||||
// </div>
|
||||
// <div class="form-group col-2">
|
||||
// <button type="submit" class="btn btn-sm btn-primary">Submit</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// </form>
|
||||
// </td>
|
||||
// `; // DONT DELETE IT REF : VVJ
|
||||
container.appendChild(newRow);
|
||||
}
|
||||
}
|
||||
@ -1519,6 +1570,9 @@
|
||||
else if (template_name == 'member_common_mail') {
|
||||
container = document.getElementById('attachment_tbody_common');
|
||||
}
|
||||
else if (template_name == 'member_reminder_mail') {
|
||||
container = document.getElementById('attachment_tbody_reminder');
|
||||
}
|
||||
else {
|
||||
const container = document.getElementById('attachment_tbody_ecard');
|
||||
}
|
||||
@ -1537,6 +1591,7 @@
|
||||
// var template_name = template_name;
|
||||
var client_id = $('#general_PrimaryKey').val();
|
||||
// console.log(client_id);
|
||||
console.log(`:) Submitted for ${template_name}`);
|
||||
|
||||
const formData = new FormData(form);
|
||||
formData.append('template_name', template_name);
|
||||
@ -1771,7 +1826,7 @@
|
||||
const validTemplates = [
|
||||
"account_maneger_summary_mail", "member_reminder_mail","member_common_mail", "member_ecard_mail", "member_welcome_mail", "member_review_and_summary_mail", "client_hr_summary_mail"
|
||||
];
|
||||
|
||||
console.log(`:) getMailTemplateData function called for ${template_name}`); // REF : PS
|
||||
if (!validTemplates.includes(template_name)) {
|
||||
console.error("Invalid template name:", template_name);
|
||||
return;
|
||||
@ -1789,7 +1844,7 @@
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
console.log('get Mail Template Data', res);
|
||||
console.log(':) getMailTemplateData Resp are', res);
|
||||
|
||||
if (res) {
|
||||
// Set subject
|
||||
@ -1840,6 +1895,8 @@
|
||||
$('.testmail').toggle(!!res.id);
|
||||
$('#attachment_table').toggle(!!res.id);
|
||||
$('#attachment_table_ecard').toggle(!!res.id);
|
||||
$('#attachment_table_common').toggle(!!res.id);
|
||||
$('#attachment_table_reminder').toggle(!!res.id);
|
||||
$('.setid').attr('data-id', res.id || '');
|
||||
if (template_name == "member_common_mail"){
|
||||
$('#notification_temp_id').val(res.id);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user