Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

instantremainder_widget.min.js 6.9KB

12345678910111213141516171819202122232425262728
  1. var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(i){class r extends t.Core.BaseComponent{constructor(){super(...arguments);this.instantReminderId=0;this.isduplicate=!0}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(){return`<form id="frmUnibase_ActionsData" data-validate="parsley" data-isdynamic="false">
  2. <div class="card bg-light">
  3. <div class="b-b bg-white card-header header">
  4. <span class="record_count"><b>Count:</b><span class="badge-light badge rounded ml-1 mb-1" id="response_count">0</span></span>
  5. <span class="isDuplicate mr-10"><input type="radio" name="instantreminder_option" class="isduplicate mr-1">Isduplicate</span>
  6. <span class="data mr-10"><input type="radio" name="instantreminder_option" class="isunique" >IsUnique</span>
  7. </div>
  8. <div class="card-body scrollable" style="overflow-y: scroll;">
  9. <div class="row">
  10. <table class="table">
  11. <thead>
  12. <tr id="Reminders_Row" class="bg-primary">
  13. </tr>
  14. </thead>
  15. <tbody class="ActionsDatalist_body"></tbody>
  16. </table>
  17. </div>
  18. </div>
  19. <div class="bg-white card-footer footer" id="instantreminder_footer">
  20. <a href="javascript:;" id="btnCloseInstantreminder" class="btn btn-light btn-sm mr-auto "> Close</a><div class="pagination pagination-rounded custom-pagination mb-2" id="divpagination"></div>
  21. </div>
  22. </div>
  23. </form>`}load(t,i){$("#btnCloseInstantreminder").click(function(){$("#"+i).modal("hide");$("#"+i).remove()});$('input[name="instantreminder_option"]').change(function(){var t=$(".isduplicate").is(":checked");n.Platform.Communications.Managers.ReminderManager.Instance().updateIsDuplicate(r.Instance().instantReminderId,t).then(function(t){t.result!=null&&(r.Instance().isduplicate=t.result,MessageHelper.Instance().showSuccess(t.message,"message_div"),$(".ActionsDatalist_body").html(""),n.Platform.Communications.Managers.ReminderManager.Instance().getRecipients(r.Instance().instantReminderId,t.result).then(function(t){t.result!=null&&n.Platform.Communications.Components.InstantReminders_Widget.Instance().loadrecipients(t.result)}))})});r.Instance().isduplicate?$(".isduplicate").prop("checked",!0):$(".isunique").prop("checked",!0)}init(t){if(n.Themes.Providers.Detail_Settings.Instance().InputParameters.length>0)for(let t of n.Themes.Providers.Detail_Settings.Instance().InputParameters)t.Key==="hf_"+n.Themes.Providers.DetailHelper.installedAppId+"_recordid"&&(r.Instance().instantReminderId=Number(t.Value));n.Platform.Communications.Components.InstantReminders_Widget.Instance().loadJsFiles();n.Platform.Communications.Components.InstantReminders_Widget.Instance().render(t)}render(t){var i=`<div class="instantremainders"><div id="message_div"></div>
  24. <div class="bg-white card-header"><div class"remainder_datails mb-7 text-dark">
  25. <b>Reminder Details</b></div><table class="table">
  26. <thead style="background-color:#a1a1a1"><tr><th><b>Subject</b></th><th><b>Body</b>
  27. </th><th><b>Recipients</b></th><th></th></tr></thead><tbody class="card-body">
  28. </tbody></div></div>`;$("."+t).append(i);n.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddetails(r.Instance().instantReminderId)}loaddetails(t){n.Platform.Communications.Managers.ReminderManager.Instance().getInstantReminder(t).then(function(t){if(t.result!=null){r.Instance().isduplicate=t.result.IsDuplicate;var i="<tr><td>"+t.result.Subject+"<\/td><td>"+t.result.Body+'<\/td><td><a href="#"onclick="Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().loadpopup();">Recipients<\/a><\/td><td><span class="badge send_btn hidden pull-right" onclick="Unibase.Platform.Communications.Components.InstantReminders_Widget.Instance().sendReminder('+r.Instance().instantReminderId+')" style="background-color:#00B0FF;color:#e9e8e8;cursor:pointer">Send<\/span><\/td><\/tr>';$(".card-body").html(i);t.result.ReminderStatus==Number(n.Platform.Communications.Enums.InstantReminderStatus.Draft)&&$(".send_btn").removeClass("hidden")}})}loadpopup(t){this.navigationHelper.popup(r.Instance().instantReminderId,t,n.Platform.Communications.Components.InstantReminders_Widget.Instance(),null,null);n.Platform.Communications.Managers.ReminderManager.Instance().getRecipients(r.instance.instantReminderId,r.Instance().isduplicate).then(function(t){t.result!=null&&n.Platform.Communications.Components.InstantReminders_Widget.Instance().loadrecipients(t.result)})}loadrecipients(t){var i=Object.getOwnPropertyNames(t[0]),r="",u;for(let n=0;n<i.length;n++)r+="<th>"+i[n]+"<\/th>";r="<th>S.no<\/th>"+r;$("#Reminders_Row").html(r);$("#response_count").text(t.length);n.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddata(0,t,i);u=$("#divpagination");u.pagination(t.length,10,{current_page:0,callback:function(r){n.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddata(r,t,i)}})}loaddata(n,t,i){var r;$(".ActionsDatalist_body").html("");var u=(n+1)*10,e=u-10,f="";for(let n=e;n<u;n++)if(t.length>n){r="";for(let u=0;u<i.length;u++)r+="<td>"+t[n][i[u]]+"<\/td>";f+="<tr><td>"+(n+1)+"<\/td>"+r+"<\/tr>"}else break;$(".ActionsDatalist_body").html(f)}loadJsFiles(){var t=n.Platform.Communications.Components.InstantReminders_Widget.Instance().jsFiles();n.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(t,function(){})}sendReminder(t){var i=new n.Platform.Communications.Requests.InstantReminder;i.InstantReminderId=t;i.ReminderStatus=Number(n.Platform.Communications.Enums.InstantReminderStatus.Active);n.Platform.Communications.Managers.ReminderManager.Instance().sendInstantReminder(i).then(function(){$(".send_btn").addClass("d-none")})}static Instance(){return this.instance==undefined&&(this.instance=new r),this.instance}}i.InstantReminders_Widget=r})(r=i.Components||(i.Components={}))})(i=t.Communications||(t.Communications={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));