var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Communications; (function (Communications) { let Components; (function (Components) { class InstantReminders_Widget extends Platform.Core.BaseComponent { constructor() { super(...arguments); this.instantReminderId = 0; this.isduplicate = true; } cssFiles() { return []; } jsFiles() { return ["platform/communications/managers/reminders/remindermanager.js", "platform/communications/requests/reminders/instantreminder.js", "platform/communications/infos/reminders/instantreminder.js", "platform/communications/requests/reminders/instantreminder.js", "libs/jquery/pagination/jquery.pagination.js", "platform/communications/enums/reminders/instantreminderstatus.js"]; } html(id, containerid) { var html = `
`; return html; } load(id, containerid, callback) { $('#btnCloseInstantreminder').click(function () { $('#' + containerid).modal('hide'); $('#' + containerid).remove(); }); $('input[name="instantreminder_option"]').change(function () { var isduplicate = $('.isduplicate').is(":checked"); Unibase.Platform.Communications.Managers.ReminderManager.Instance().updateIsDuplicate(InstantReminders_Widget.Instance().instantReminderId, isduplicate).then(function (response) { if (response.result != null) { InstantReminders_Widget.Instance().isduplicate = response.result; MessageHelper.Instance().showSuccess(response.message, "message_div"); $('.ActionsDatalist_body').html(''); Unibase.Platform.Communications.Managers.ReminderManager.Instance().getRecipients(InstantReminders_Widget.Instance().instantReminderId, response.result).then(function (response) { if (response.result != null) { Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().loadrecipients(response.result); } }); } }); }); if (InstantReminders_Widget.Instance().isduplicate) { $('.isduplicate').prop("checked", true); } else { $('.isunique').prop("checked", true); } } init(containerid) { if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.length > 0) { for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) { if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_recordid") { InstantReminders_Widget.Instance().instantReminderId = Number(obj.Value); } } } Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().loadJsFiles(); Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().render(containerid); } render(containerid) { var html = `Subject | Body | Recipients | |
---|---|---|---|
' + response.result.Subject + ' | ' + response.result.Body + ' | Recipients | ' + properties[j] + ' | '; } headerhtml = 'S.no | ' + headerhtml; $('#Reminders_Row').html(headerhtml); $('#response_count').text(response.length); Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddata(0, response, properties); var ele; ele = $('#divpagination'); ele.pagination(response.length, 10, { current_page: 0, callback: function (page, component) { Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddata(page, response, properties); } }); } loaddata(page, response, properties) { $('.ActionsDatalist_body').html(''); var len = (page + 1) * 10; var initialval = len - 10; var html = ''; for (let i = initialval; i < len; i++) { if (response.length > i) { var innerhtml = ''; for (let j = 0; j < properties.length; j++) { innerhtml += '' + response[i][properties[j]] + ' | '; } html += '
' + (i + 1) + ' | ' + innerhtml + '