Built files from Bizgaze WebServer
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

default.login.min.js 38KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. var __awaiter,Unibase;(function(Unibase){let Themes;(function(Themes){let Compact;(function(Compact){let Components;(function(Components){class Index_Anonymous extends Unibase.Platform.Core.BaseComponent{init(callback,imagerUrl){Unibase.Platform.Helpers.NavigationHelper.SetInstance(new Compact.NavigationHelper);this.render(imagerUrl)}render(imagerUrl){const html=`<div class="biz-wrapper" id="external-container" style="display:none;"><div class="biz-pg-wrapper biz-auth-wrapper h-100"><div class="container-fluid1" style="height:100vh"><div class="row"><div class="col-xl-5 pa-0888 d-none d-xl-block"><div class="banner-img-container h-100"><img src="${imagerUrl}" alt="img" class="h-100 w-100"></div></div><div class="col-xl-7 pa-0888"><div id="divBizgaze_MessagesPlaceholder"></div><div class="auth-form-wrap py-xl-0 py-50"><div id="external-form" class="auth-form w-xxl-55 w-xl-75 w-sm-90 w-xs-100 w-95 mt-50"></div></div><div class="row"><div class="col-12 text-center"><div class="btn-group btn-group-sm d-none"><a id="btnClearcache" class="btn btn-outline-secondary">Settings</a><a href="#" class="btn btn-outline-secondary">Help</a></div></div></div></div></div></div></div></div>`;jQuery("#bizgaze_body").html(html);const cacheHelper=Unibase.Platform.Helpers.FileCacheHelper.Instance();cacheHelper.loadFile({FileName:"",FileType:Unibase.Platform.Helpers.FileType.Js},null)}}Components.Index_Anonymous=Index_Anonymous})(Components=Compact.Components||(Compact.Components={}))})(Compact=Themes.Compact||(Themes.Compact={}))})(Themes=Unibase.Themes||(Unibase.Themes={}))})(Unibase||(Unibase={})),function(Unibase){let Platform;(function(Platform){let Membership;(function(Membership){let Requests;(function(Requests){class Login{constructor(username,password,unibaseid,rememberMe){this.UserName=username;this.Password=password;this.UnibaseId=unibaseid;this.RememberMe=rememberMe}}Requests.Login=Login})(Requests=Membership.Requests||(Membership.Requests={}))})(Membership=Platform.Membership||(Platform.Membership={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))}(Unibase||(Unibase={}));__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},function(Unibase){let Themes;(function(Themes){let Compact;(function(Compact){let Components;(function(Components){class Notification extends Unibase.Platform.Core.BaseComponent{static Instance(){return new Notification}init(containerid){Unibase.Themes.Compact.Components.Notification.containerid=containerid;Unibase.Themes.Compact.Components.Notification.Instance().GetUnreadRemindersCount();Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallAppId("Unibase_Platform_Communications_Reminders_App_Reminders").then(function(response){response.result!=null&&(Unibase.Themes.Compact.Components.Notification.ReminderAppid=response.result.InstalledAppId)});Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallAppId("Unibase_Platform_Communications_Reminders_App_TaskReminders").then(function(response){response.result!=null&&(Unibase.Themes.Compact.Components.Notification.TaskReminderAppid=response.result.InstalledAppId)});$("#Active_Process").click(function(){$("#Active_Process").addClass("active");$("#Active_Notification").removeClass("active");$("#Active_Tasks").removeClass("active");$(".Reminders").remove();Unibase.Themes.Compact.Components.Notification.Instance().GetRunnningProcess()})}tabView(id){var viewallbtn=`<a class="btn btn-outline-primary mr-auto ml-auto px-3 py-1" href="javascript:;" onclick="Unibase.Themes.Compact.Components.Notification.Instance().ViewAll(6)" id="AddWidget_btnCreateWidget">View All</a>`,viewallbtntask=`<a class="btn btn-outline-primary mr-auto ml-auto px-3 py-1" onclick="Unibase.Themes.Compact.Components.Notification.Instance().ViewAll(1)" href="javascript:;" id="AddWidget_btnCreateWidget">View All</a>`;let instance=this;$(".tab-view").removeClass("biz-notification-mobile-view border");$("#"+id).addClass("biz-notification-mobile-view border-0");id=="notification-tab"&&(Unibase.Themes.Compact.Components.Notification.Instance().loadReminders("tab-view"),$(".biz-settings-panel").css("background","#fff9f9"));id=="task-tab"?($(".clearall-checkbox").addClass("d-none"),$(".clear_alldiv").addClass("d-none"),Unibase.Themes.Compact.Components.Notification.Instance().loadTasks("tab-view"),$(".biz-settings-panel").css("background","#fff9f9"),$(".notification-footer").html(viewallbtntask)):(Unibase.Themes.Compact.Components.Notification.UnReadNotificationsCount==0?($(".clearall-checkbox").addClass("d-none"),$(".clear_alldiv").addClass("d-none")):($(".clearall-checkbox").removeClass("d-none"),$(".clear_alldiv").removeClass("d-none")),$(".biz-settings-panel").css("background","#f7fbff"),$(".notification-footer").html(viewallbtn),$("#notificationTabView .rem-item-wrap").length?$(".notification-footer").removeClass("d-none"):$(".notification-footer").addClass("d-none"))}loadNotificationsTask(html,tabType,binding){let tabViewHeaderHTML=`
  2. <ul class="nav nav-tabs border-0 text-center mr-auto" id="myTab" role="tablist">
  3. <li class="nav-item task-litab">
  4. <a class="nav-link tab-view active biz-notification-mobile-view border-0" id="task-tab" data-toggle="tab" href="#taskTabView" id="task-tab" onclick="Unibase.Themes.Compact.Components.Notification.Instance().tabView('task-tab')" role="tab" aria-controls="profile" aria-selected="false"><span>Tasks</span><span class="badge badge-link badge-sm border font-12 ml-2 rounded-circle" id="tasks_count">0</span></a>
  5. </li>
  6. <li class="nav-item">
  7. <a class="nav-link border-0 tab-view" id="notification-tab" data-toggle="tab" href="#notificationTabView" onclick="Unibase.Themes.Compact.Components.Notification.Instance().tabView('notification-tab')" role="tab" aria-controls="home" aria-selected="true"><span>Notification</span><span class="badge badge-link badge-sm border font-12 ml-2 rounded-circle" id="notification_count">0</span></a>
  8. </li>
  9. <li class="nav-item clear_alldiv mt-10 d-none" style="position:absolute;right:32px"><a class="reminderstatus" onclick="Unibase.Themes.Compact.Components.Notification.Instance().changeReminderStatusAsRead()">Clear All</a></li>
  10. </ul><ul class="clear-all-checkbox"><input type="checkbox" class="mb-1 clearall-checkbox" style="position:absolute;right:12px;top:13px"></ul>`,tabViewBodyHTML=`
  11. <div class="tab-content m-0" id="myTabContent">
  12. <div class="tab-pane show active" id="taskTabView" role="tabpanel" aria-labelledby="profile-tab"></div>
  13. <div class="tab-pane " id="notificationTabView" role="tabpanel" aria-labelledby="home-tab"></div>
  14. </div>`;binding==1&&($("#settings-panel-head-title").remove(),$("#myTab").remove(),$("#settings_panel_close").after(tabViewHeaderHTML),$("#settings-panel-body").html(tabViewBodyHTML).parent().addClass("p-0"),$(".settings-panel-head").removeClass("px-3").addClass("pr-3 pl-1"));tabType=="notification"&&$("#notificationTabView").html(html);tabType=="task"&&($("#taskTabView").html(html),this.GetUnreadRemindersCount(!1))}changeReminderStatusAsRead(){bootbox.confirm({title:"<span class='dstry' style='color:red'>Clear All Notifications?<\/span>",message:"Are you sure! Do you want to clear all notifications? ",buttons:{cancel:{label:'<i class="fa fa-times"><\/i> Cancel'},confirm:{label:'<i class="fa fa-check"><\/i> Confirm'}},callback:function(result){if(result)Unibase.Platform.Communications.Managers.ReminderManager.Instance().ChangeAllReminderStatusAsRead().then(function(response){var count,tabcount;if(response.status==Unibase.Data.Status.Success){var html=Unibase.Themes.Compact.Components.Notification.Instance().noremaindershtml(),finalcount=0,checkboxclass="clearall-checkbox";isMobileApp()?(checkboxclass="clear-all-checkbox",count=Number($("#notificatonIconBadge").text()),tabcount=Number($("#notification_count").text()),finalcount=count-tabcount,$("#notificationTabView").html(html)):$("#settings-panel-body").html(html).addClass("no-data");finalcount<=0&&($("#notificatonIconBadge").addClass("d-none"),finalcount=0);$("#notificatonIconBadge").text(finalcount);$(".clear_alldiv").addClass("d-none");$("."+checkboxclass).addClass("d-none");$("#notification_count").text(0);$("#notificationsViewAllBtn").addClass("d-none")}else alert("failed to clear notifications")});else return}})}loadReminders(tabview,count){return __awaiter(this,void 0,void 0,function*(){$(".clear-all-checkbox").removeClass("d-none");$("#settingsPanelBodyWrap").removeClass("d-none");$("#chatPanelBodyWrap").addClass("d-none");$(".biz__nav__toggle").is(":visible")&&$("#biz_nav_close").click();let instance=this,html="";count=count!=null?'<span class="badge border rounded-circle badge-sm badge-link mr-4 font-14 " id="notification_count">0<\/span>':'<span class="badge border rounded-circle badge-sm badge-link mr-4 font-14 " id="notification_count"><\/span>';$(".biz-settings-panel").css("background","#f7fbff");$(".settings-panel-head").removeClass("d-none py-2");$("#settings-panel-head-title").addClass("d-flex flex-row align-items-center py-1").empty().append(`<span class="notification_header my-2 mr-2 font-16 font-weight-400">Notifications</span>${count}<div class="clear_alldiv d-none" style="position:absolute;right:40px"><a class="reminderstatus" onclick="Unibase.Themes.Compact.Components.Notification.Instance().changeReminderStatusAsRead()">Clear All</a></div><input type="checkbox" class="clearall-checkbox ml-2" style="position:absolute;right:10px">`).parent().addClass("px-3 border-bottom").removeClass("py-10");$("#settings-panel-body").removeClass("px-3").addClass("biz-body-height");$(".notification-footer").removeClass("d-none");let remindertype=Unibase.Platform.Communications.Enums.ReminderType.Notification;return Unibase.Themes.Compact.Components.Notification.Instance().GetUnreadRemindersCount(!0),yield Unibase.Platform.Communications.Managers.ReminderManager.Instance().getReminders(remindertype,20).then(function(response){html="";for(let i=0;i<response.length;i++){let createformid=0,installedappid=0,refid=0;response[i].RedirectOptions==null||response[i].RedirectOptions==undefined?(installedappid=response[i].InstalledAppId,refid=response[i].RefId):(createformid=response[i].RedirectOptions.CreateFormId,installedappid=response[i].RedirectOptions.InstalledAppId,refid=response[i].RedirectOptions.RefId);let ReminderUrl=response[i].ReminderUrl,IconUrl=response[i].IconUrl;(IconUrl==undefined||IconUrl==null)&&(IconUrl="tenants/themes/compact/imgs/defaultnotification.png");IconUrl==""&&(IconUrl="tenants/themes/compact/imgs/notification.png");let ReminderId=response[i].ReminderId;ReminderUrl==""&&(ReminderUrl=null);html+=`<div class="rem-item-wrap">
  15. <div class="d-flex w-100">
  16. <a href="javascript:void(0);" class="w-100 px-2 text-dark" id="Rem-item-${ReminderId}" data-id="${ReminderId}" onclick="Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(${refid},${installedappid},'${response[i].UrlType}','${ReminderUrl}',${remindertype},${createformid},null)"
  17. class="text-dark py-1 w-90">
  18. <div class="d-flex w-100">
  19. <div class="w-60p p-2 mr-2 flex-shrink-0">
  20. <img src="${IconUrl}" data-dynamic="1" onerror="ReloadImage(event)" class="img-fluid" data-loaded="0">
  21. </div>
  22. <div class="flex-grow-1 overflow-hide">
  23. <div class="notifications-text word-break">
  24. <div class="d-flex justify-content-between">
  25. <span class="w-90">
  26. <p class="text-dark text-capitalize font-12 font-weight-600 text-truncate w-95 notification-subject" title="${response[i].Subject}">${response[i].Subject}</p>
  27. </span><span>
  28. <div class="d-flex pb-0 px-2">
  29. <div class="checkbox_div w-10 "><input type="checkbox" class="check_allreminders notify_check" style="position:relative;left:5px;top:5px" id="checkid_${ReminderId}"></div>
  30. </div>
  31. </div> </div>
  32. <div><span class="font-12 font-weight-400 word-break notifi_message_overflow">${response[i].Message}</span></div>
  33. <div class="d-flex align-items-center justify-content-between z-index-10">
  34. <div class="notifications-time font-12 font-weight-600">${Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocal(response[i].ReminderDate)}</div>
  35. <span class="font-12 font-weight-600 text-dark py-1 z-index-2" data-id="${ReminderId}" onclick="Unibase.Themes.Compact.Components.Notification.Instance().UpdateReminderStatus('${ReminderId}','Read');event.stopPropagation();">Mark as read</span>
  36. </div>
  37. </div>
  38. </div>
  39. </a>
  40. </div></div>`;i!=response.length-1&&(html+='<div class="dropdown-divider mx-3 m-0 p-0"><\/div>')}var checkcount=Number(`${response.length}`),noreminders=Unibase.Themes.Compact.Components.Notification.Instance().noremaindershtml(),viewallbtn=`<a class="btn btn-outline-primary mr-auto ml-auto px-3 py-1 " href="javascript:;" onclick="Unibase.Themes.Compact.Components.Notification.Instance().ViewAll(6)" id="notificationsViewAllBtn">View All</a><a class="btn btn-outline-danger mr-auto ml-auto px-3 py-1 d-none" href="javascript:;" onclick=" Unibase.Themes.Compact.Components.Notification.Instance().markAsReadUnReadReminders();" id="notificationClearBtn">Clear <span class="d-inline-flex align-items-center font-14">(<span id="clearNotificationCount">0</span>)</span></a>`;tabview=="tab-view"?($(".clearall-checkbox").removeClass("d-none"),checkcount==0?(instance.loadNotificationsTask(noreminders,"notification",0),$(".clear_alldiv").addClass("d-none"),$(".notification-footer").addClass("d-none"),$(".clearall-checkbox").addClass("d-none")):(instance.loadNotificationsTask(html,"notification",0),$(".clear_alldiv").removeClass("d-none"),$(".notification-footer").removeClass("d-none").html(viewallbtn))):checkcount==0?($(".clearall-checkbox").addClass("d-none"),$(".clear_alldiv").addClass("d-none"),$("#settings-panel-body").html(noreminders).addClass("no-data"),$(".notification-footer").addClass("d-none")):($(".clear_alldiv").removeClass("d-none"),$(".clearall-checkbox").removeClass("d-none"),$("#settings-panel-body").html(html).removeClass("no-data"),$(".notification-footer").removeClass("d-none").html(viewallbtn));$(".biz-settings-panel #notification_count").text(Unibase.Themes.Compact.Components.Notification.UnReadNotificationsCount);$(".biz-settings-panel #tasks_count").text(Unibase.Themes.Compact.Components.Notification.UnReadTasksCount);Unibase.Themes.Compact.Components.Index.Instance().layoutIndex==1&&$(".biz-settings-panel").addClass("layout-1");Unibase.Themes.Compact.Components.Index.Instance().layoutIndex==2&&$(".biz-settings-panel").addClass("layout-2");$(".biz-settings-panel").addClass("notifications-tasks-panel");$(".biz-settings-panel .notification-subject").each(function(i,e){$(e).prop("scrollWidth")<$(e).outerWidth()+2&&$(e).removeAttr("title")});$(".notify_check").on("click",function(e){e.stopPropagation();var ischecked=!0;$(".notify_check").each(function(){if($(this).is(":checked"))ischecked=!0;else return ischecked=!1,!1});ischecked?$(".clearall-checkbox").prop("checked",!0):$(".clearall-checkbox").prop("checked",!1);$(".notify_check").is(":checked")?($(".task-litab").addClass("d-none"),$("#notificationsViewAllBtn").addClass("d-none"),$("#clearNotificationCount").text($(".notify_check:checked").length),$("#notificationClearBtn").removeClass("d-none")):($(".task-litab").removeClass("d-none"),$(".clearall-checkbox").prop("checked",!1),$("#notificationsViewAllBtn").removeClass("d-none"),$("#notificationClearBtn").addClass("d-none"))});$(".clearall-checkbox").click(function(){$(".clearall-checkbox").is(":checked")?($(".task-litab").addClass("d-none"),$(".check_allreminders").prop("checked",!0),$("#notificationsViewAllBtn").addClass("d-none"),$("#clearNotificationCount").text($(".notify_check:checked").length),$("#notificationClearBtn").removeClass("d-none")):($(".task-litab").removeClass("d-none"),$(".check_allreminders").prop("checked",!1),$("#notificationsViewAllBtn").removeClass("d-none"),$("#notificationClearBtn").addClass("d-none"))})})})}markAsReadUnReadReminders(ismobile){var Reminders=[],Reminder;$(".check_allreminders").each(function(){if($(this).is(":checked")){var id=$(this).attr("id"),reminderid=id.split("_")[1];Reminders.push(reminderid)}});Reminder={Reminders};Unibase.Platform.Communications.Managers.ReminderManager.Instance().markAsReadUnreadReminders(Reminder).then(function(response){if(response.status==Unibase.Data.Status.Success){var tab=undefined;ismobile&&(tab="tab-view");Unibase.Themes.Compact.Components.Notification.Instance().loadReminders(tab,null)}})}GetUnreadRemindersCount(){const instance=this;let user=Unibase.Platform.Membership.Infos.Identity.getCurrentUser();Unibase.Platform.Communications.Managers.ReminderManager.Instance().getUnreadRemindersCountByUserId().then(function(response){var obj=response.result;Unibase.Themes.Compact.Components.Notification.UnReadNotificationsCount=obj.NotificationCount;Unibase.Themes.Compact.Components.Notification.UnReadTasksCount=obj.TasksCount;const notificationCount=Number(obj.NotificationCount),taskCount=Number(obj.TasksCount);if(Unibase.Themes.Compact.Components.Index.Instance().tabMode)instance.bindCountHtml(notificationCount,"#notificatonIconBadge"),instance.bindCountHtml(taskCount,"#taskIconBadge");else{let totalCount=notificationCount+taskCount;instance.bindCountHtml(totalCount,"#notificatonIconBadge")}$(".biz-settings-panel #notification_count").text(obj.NotificationCount);$(".biz-settings-panel #tasks_count").text(obj.TasksCount)})}bindCountHtml(count,countEl){if(count>0){let countHtml=count.toString();if(count>99&&(countHtml='99<sup class="fa fa-plus" style="font-size: 8px;"><\/sup>'),count>9||count>99){let countClass="count-double-digit";count>99&&(countClass="count-overflow");$(countEl).closest(".dropdown-notifications").addClass(countClass)}$(countEl).html(countHtml).removeClass("d-none")}else $(countEl).empty().addClass("d-none")}loadTasks(tabView){return __awaiter(this,void 0,void 0,function*(){let instance=this;$("#settingsPanelBodyWrap").removeClass("d-none");$("#chatPanelBodyWrap").addClass("d-none");$("#settings-panel-head-title").addClass("d-flex flex-row align-items-center py-1").empty().append('<span class="my-2 font-16 font-weight-400">Tasks<\/span><span class="ml-2 px-2 border rounded-circle font-14" id="tasks_count">0<\/span>').parent().addClass("px-3 border-bottom").removeClass("py-10");$(".biz-settings-panel").css("background","#fff9f9");$(".settings-panel-head").removeClass("py-2 mobileChat-view d-none");$("#settings-panel-body").removeClass("px-3").addClass("biz-body-height");let remindertype=Unibase.Platform.Communications.Enums.ReminderType.Task;return Unibase.Themes.Compact.Components.Notification.Instance().GetUnreadRemindersCount(!1),yield Unibase.Platform.Communications.Managers.ReminderManager.Instance().getReminders(remindertype,20).then(function(response){let html="";for(let i=0;i<response.length;i++){let createformid=0,installedappid=0,refid=0;response[i].RedirectOptions==null||response[i].RedirectOptions==undefined?(installedappid=response[i].InstalledAppId,refid=response[i].RefId):(createformid=response[i].RedirectOptions.CreateFormId,installedappid=response[i].RedirectOptions.InstalledAppId,refid=response[i].RedirectOptions.RefId);let ReminderUrl=response[i].ReminderUrl,IconUrl=response[i].IconUrl;(IconUrl==""||IconUrl==null)&&(IconUrl="tenants/themes/compact/imgs/task.png");let ReminderId=response[i].ReminderId;ReminderUrl==""&&(ReminderUrl=null);html+='<div id="Taskmedia_'+ReminderId+'" data-refid="'+response[i].RefGuid+'" class="task-list-item TaskLi_'+response[i].TaskId+'"><div class="cursor-pointer d-flex pr-3 py-1 w-100" id="Rem-item-'+ReminderId+'" data-id="'+ReminderId+'" onclick="Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails('+refid+","+installedappid+",'"+response[i].UrlType+"','"+ReminderUrl+"',"+remindertype+","+createformid+',null)">'+`<div class="w-60p p-2 mr-2 flex-shrink-0"><img src="${IconUrl}" data-dynamic="1" onerror="ReloadImage(event)" class="img-fluid" data-loaded="0"></div>
  41. <div class="notifications-text flex-grow-1 overflow-hide word-break">
  42. <p class="text-dark text-capitalize font-12 font-weight-600 w-95 text-truncate word-break task-subject" title="${response[i].Subject}">${response[i].Subject}</p>
  43. <p class="font-12 text-dark notifi_message_overflow"> ${response[i].Message}</p>
  44. <div class="d-flex align-items-center justify-content-between my-2">
  45. <div class="notifications-time font-12">${Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocal(response[i].ReminderDate)}</div>`+'<div><a class="pull-right text-primary Collapse_Manage'+ReminderId+' font-12" style="text-decoration: none;" data-toggle="collapse" onclick="Unibase.Themes.Compact.Components.Notification.Instance().LoadApprovals(\''+response[i].RefGuid+"','"+ReminderId+"',"+response[i].TaskId+');event.stopPropagation();"> Manage <i class="text-dark fa fa-angle-down"><\/i>'+`</a></div></div></div></div>
  46. <div class="box collaps" id="collapseManageBtn_${ReminderId}">
  47. </div>
  48. </div>`;i!=response.length-1&&(html+='<div class="dropdown-divider mx-3 m-0 p-0"><\/div>')}$(".biz-settings-panel #tasks_count").text(Unibase.Themes.Compact.Components.Notification.UnReadTasksCount);var checkcount=Number(`${response.length}`),noreminders=Unibase.Themes.Compact.Components.Notification.Instance().notaskshtml(),viewallbtntask=`<a class="btn btn-outline-primary mr-auto ml-auto px-3 py-1" onclick="Unibase.Themes.Compact.Components.Notification.Instance().ViewAll(1)" href="javascript:;" id="AddWidget_btnCreateWidget">View All</a>`;tabView=="tab-view"?checkcount==0?(instance.loadNotificationsTask(noreminders,"task",1),$(".notification-footer").addClass("d-none")):(instance.loadNotificationsTask(html,"task",1),$(".notification-footer").removeClass("d-none").html(viewallbtntask)):($(".biz-settings-panel").toggleClass("show"),checkcount==0?($("#settings-panel-body").html(noreminders).addClass("no-data"),$(".notification-footer").addClass("d-none")):($("#settings-panel-body").html(html).removeClass("no-data"),$(".notification-footer").removeClass("d-none").html(viewallbtntask)));$(".biz-settings-panel .task-subject").each(function(i,e){$(e).prop("scrollWidth")<$(e).outerWidth()+2&&$(e).removeAttr("title")});Unibase.Themes.Compact.Components.Index.Instance().layoutIndex==1&&$(".biz-settings-panel").addClass("layout-1");Unibase.Themes.Compact.Components.Index.Instance().layoutIndex==2&&$(".biz-settings-panel").addClass("layout-2");$(".biz-settings-panel").addClass("notifications-tasks-panel");$(".clear-all-checkbox").addClass("d-none")})})}LoadApprovals(RefId,ReminderId,TaskId){var html="";if($(`#manageBtnWrap_${ReminderId}`).length){$("#collapseManageBtn_"+ReminderId).collapse("toggle");return}Unibase.Platform.Communications.Managers.TaskManager.Instance().getTaskByRefId(RefId,TaskId).then(function(response){if(response.result!=null){var Approvedbtn="Approve",Rejectbtn="Reject",rejectonclick="Unibase.Themes.Compact.Components.Notification.Instance().SaveTaskReason('"+ReminderId+"',"+response.result.TaskId+",'Reject');";response.result.ConfirmKeyText!=null&&response.result.ConfirmKeyText!=undefined&&response.result.ConfirmKeyText!=""&&(Approvedbtn=response.result.ConfirmKeyText);response.result.RejectKeyText!=null&&response.result.RejectKeyText!=undefined&&response.result.RejectKeyText!=""&&(Rejectbtn=response.result.RejectKeyText);Number(response.result.RejectFormId)!=0&&(rejectonclick="Unibase.Themes.Compact.Components.Notification.Instance().ChangeApprovalStatus('"+ReminderId+"',"+response.result.TaskId+",'Reject',"+response.result.RejectFormId+","+response.result.RejectFormPkId+")");html+=`<div class="d-flex justify-content-center align-items-center mb-2 mt-1 ml-3 accordion-header" id="manageBtnWrap_${ReminderId}">`+'<button class="btn btn-outline-success mr-2 ml-auto px-4 py-1 font-12" onclick="Unibase.Themes.Compact.Components.Notification.Instance().ChangeApprovalStatus(\''+ReminderId+"',"+response.result.TaskId+",'Accept',"+response.result.ApprovalFormId+","+response.result.ApprovalFormPkId+')">'+Approvedbtn+'<\/button><button class="btn btn-outline-danger mr-2 ml-auto px-4 py-1 font-12 collapsed" data-toggle="collapse" href="#collapseReject_'+ReminderId+'">'+Rejectbtn+'<\/button><button class="btn btn-outline-primary mr-auto ml-auto px-4 py-1 font-12" onclick = "Unibase.Themes.Compact.Components.Notification.Instance().confirmclosetask('+TaskId+",'"+ReminderId+'\')">Close<\/button><\/div><div class="collapse py-1" id="collapseReject_'+ReminderId+'" data-parent="#collapseManageBtn_'+ReminderId+'"><div class="d-flex justify-content-start mt-1 px-3"><input type="text" id="Reason_'+TaskId+'" class="form-control focus_blue border-0 w-75 p-0 pl-1 mr-2" placeholder="Add Comment"><a href="javascript:void(0);" class="btn-sm btn-success px-3 ml-2 p-0 d-flex flex-row align-items-center" onclick="'+rejectonclick+'"><i class="fa fa-send-o font-11"><\/i><\/a><\/div><\/div>';$("#collapseManageBtn_"+ReminderId).html(html).collapse("show")}})}ChangeApprovalStatus(reminderid,taskid,status,formid,formpkid){var reason=status=="Reject"?$("#Reason_"+taskid).val().toString():"Accepted",obj={TaskId:taskid,Reason:reason,Status:status};formid!=0?(Unibase.Themes.Compact.Components.Notification.TaskId=taskid,Unibase.Themes.Compact.Components.Notification.TaskReminderId=reminderid,Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(formid,formpkid,0,0,function(response){response!=null&&Unibase.Platform.Communications.Managers.TaskManager.Instance().changeApprovalStatus(obj).then(function(){Unibase.Themes.Compact.Components.Notification.TaskId=0;Unibase.Themes.Compact.Components.Notification.TaskReminderId="";Unibase.Themes.Compact.Components.Notification.UnReadTasksCount=Unibase.Themes.Compact.Components.Notification.UnReadTasksCount-1;var refguid=$(".TaskLi_"+taskid).attr("data-refid");Unibase.Themes.Compact.Components.Notification.Instance().reloadPage(refguid);Unibase.Themes.Compact.Components.Notification.Instance().removetask(taskid)})})):Unibase.Platform.Communications.Managers.TaskManager.Instance().changeApprovalStatus(obj).then(function(){Unibase.Themes.Compact.Components.Notification.UnReadTasksCount=Unibase.Themes.Compact.Components.Notification.UnReadTasksCount-1;var refguid=$(".TaskLi_"+taskid).attr("data-refid");Unibase.Themes.Compact.Components.Notification.Instance().reloadPage(refguid);Unibase.Themes.Compact.Components.Notification.Instance().removetask(taskid)})}SaveTaskReason(reminderid,taskid,status){let reason=$("#Reason_"+taskid).val().toString();var obj={TaskId:taskid,Reason:reason,Status:status};Unibase.Platform.Communications.Managers.TaskManager.Instance().changeApprovalStatus(obj).then(function(){Unibase.Themes.Compact.Components.Notification.UnReadTasksCount=Unibase.Themes.Compact.Components.Notification.UnReadTasksCount-1;var refguid=$(".TaskLi_"+taskid).attr("data-refid");Unibase.Themes.Compact.Components.Notification.Instance().reloadPage(refguid);Unibase.Themes.Compact.Components.Notification.Instance().removetask(taskid)})}GetRunnningProcess(){$(".notifications-nicescroll-bar").html("")}loadReminderDetails(id,installedappid,urltype,reminderurl,remindertype,CreateFormId){let reminderid=$(event.currentTarget).attr("id").split("-")[2],instance=this;remindertype!=Number(Unibase.Platform.Communications.Enums.ReminderType.Task)&&Unibase.Platform.Communications.Managers.ReminderManager.Instance().changeReminderStatus(reminderid,"Read").then(function(){$(".Reminders").remove();remindertype==Number(Unibase.Platform.Communications.Enums.ReminderType.Notification)?Unibase.Themes.Compact.Components.Notification.Instance().loadReminders():remindertype==Number(Unibase.Platform.Communications.Enums.ReminderType.Task)?Unibase.Themes.Compact.Components.Notification.Instance().loadTasks():remindertype==Number(Unibase.Platform.Communications.Enums.ReminderType.Process)&&Unibase.Themes.Compact.Components.Notification.Instance().GetRunnningProcess()});urltype=="List"?Unibase.Platform.Helpers.NavigationHelper.Instance().loadList(installedappid,null):urltype=="Details"?Unibase.Platform.Helpers.NavigationHelper.Instance().loadDetail(id,installedappid,null):urltype=="FileDownload"?Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(reminderurl):urltype=="FilePreview"?Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/unicloud.js",function(){Unibase.Apps.Collaboration.Components.UniCloud.Instance().notificationFilePreview(id)}):urltype=="FolderPreview"?Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/unicloud.js",function(){Unibase.Apps.Collaboration.Components.UniCloud.Instance().notificationFolderPreview(id,installedappid)}):urltype=="Create"?this.fileCacheHelper.loadJsFile("platform/forms/managers/formmanager.js",function(){Unibase.Platform.Forms.Managers.FormManager.Instance().getFormRoleByAppConfiguration(Number(CreateFormId)).then(function(response){response.result!=null&&Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(response.result.FormId,0,Number(CreateFormId),0,null)})}):urltype=="Link"&&Unibase.Themes.Compact.Components.Notification.Instance().openLink(reminderurl);instance.closeClickEvent()}closeClickEvent(){$(".settings-panel-head").find(".notification-viewall").html("");$(".biz-wrapper").removeClass("biz-settings-toggle");$(".hk-wrapper").removeClass("biz-settings-toggle");$(".hk-settings-panel").removeClass("show");$(".right-side-menu-content-wrap").find(".nav-item").removeClass("right-sunbnav-active");$(".biz-nav-fullwidth").addClass("hidden")}loadReminder_mobile(params){Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["platform/communications/enums/reminders/remindertype.js","platform/communications/managers/reminders/remindermanager.js"],function(){let id=0,installedappid=0,createformid=0;if(params.RedirectOptions==null||params.RedirectOptions==undefined)installedappid=Number(params.installedappid),id=Number(params.recordid);else{var redirectoption=params.RedirectOptions;typeof params.RedirectOptions=="string"&&redirectoption.includes("CreateFormId")&&(params.RedirectOptions=JSON.parse(params.RedirectOptions));installedappid=Number(params.RedirectOptions.InstalledAppId);createformid=Number(params.RedirectOptions.CreateFormId);id=Number(params.RedirectOptions.RefId)}let urltype=params.urltype,reminderurl=params.reminderurl,remindertype=Number(params.remindertype),reminderid=params.reminderid;urltype=="List"?(Unibase.Platform.Helpers.NavigationHelper.Instance().closeAllModals(),Unibase.Platform.Helpers.NavigationHelper.Instance().loadList(installedappid,null)):urltype=="Details"?(Unibase.Platform.Helpers.NavigationHelper.Instance().closeAllModals(),Unibase.Platform.Helpers.NavigationHelper.Instance().loadDetail(id,installedappid,null)):urltype=="FileDownload"?Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(reminderurl):urltype=="FilePreview"?Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/unicloud.js",function(){Unibase.Apps.Collaboration.Components.UniCloud.Instance().notificationFilePreview(id)}):urltype=="FolderPreview"?Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/unicloud.js",function(){Unibase.Apps.Collaboration.Components.UniCloud.Instance().notificationFolderPreview(id,installedappid)}):urltype=="Create"?this.fileCacheHelper.loadJsFile("platform/forms/managers/formmanager.js",function(){Unibase.Platform.Forms.Managers.FormManager.Instance().getFormRoleByAppConfiguration(createformid).then(function(response){response.result!=null&&Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(response.result.FormId,0,Number(createformid),0,null)})}):urltype=="Link"&&Unibase.Themes.Compact.Components.Notification.Instance().openLink(reminderurl)})}confirmclosetask(taskid,reminderid){bootbox.confirm({title:"<span class='dstry' style='color:red'>Close Task?<\/span>",message:"Are you sure? If you are deleting this task.Then work flow will override",buttons:{cancel:{label:'<i class="fa fa-times"><\/i> Cancel'},confirm:{label:'<i class="fa fa-check"><\/i> Confirm'}},callback:function(result){if(result)Unibase.Themes.Compact.Components.Notification.Instance().CloseTask(taskid,reminderid,"Completed");else return}})}CloseTask(taskid,reminderid,status){var username=Unibase.Platform.Membership.Infos.Identity.currentUser.name,obj;let reason="Task is Closed by "+username;obj={TaskId:taskid,Reason:reason,Status:status};Unibase.Platform.Communications.Managers.TaskManager.Instance().changeApprovalStatus(obj).then(function(){Unibase.Themes.Compact.Components.Notification.UnReadTasksCount=Unibase.Themes.Compact.Components.Notification.UnReadTasksCount-1;Unibase.Themes.Compact.Components.Notification.Instance().removetask(taskid)})}UpdateReminderStatus(reminderid,status){Unibase.Platform.Communications.Managers.ReminderManager.Instance().changeReminderStatus(reminderid,status).then(function(){var tab=undefined;isMobileApp()&&(tab="tab-view");Unibase.Themes.Compact.Components.Notification.Instance().loadReminders(tab,null)})}Downloadfile(url){Unibase.Platform.Helpers.AssetHelper.Instance().download(url)}ViewAll(Type){let installedappid=0,instance=this;installedappid=Type===Number(Unibase.Platform.Communications.Enums.ReminderType.Notification)?Unibase.Themes.Compact.Components.Notification.ReminderAppid:Unibase.Themes.Compact.Components.Notification.TaskReminderAppid;installedappid!=0&&Unibase.Platform.Helpers.NavigationHelper.Instance().loadList(installedappid,null);instance.closeClickEvent()}GetInstalledAppId(uniqueid){return __awaiter(this,void 0,void 0,function*(){let result;return Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallAppId(uniqueid).then(function(response){result=response}),yield result})}notaskshtml(){return`<div class="card text-center border-0 shadow-none w-100 notification-empty-card mb-0 bg-transparent" style="z-index:99"><div class="card-body mt-50 text-center" ><img src="tenants/themes/compact/imgs/task.png" onerror="ReloadImage(event)" class="h-200p w-200p"><p class="text-dark my-1 font-weight-600">You don't have any Tasks Right Now.</p><p class="font-14">Will notify you when Something arrives'</p> </div> <div class="card-footer text-center border-0 mb-10"><a class="btn btn-outline-primary mr-auto ml-auto" onclick="Unibase.Themes.Compact.Components.Notification.Instance().ViewAll(1)" href = "javascript:;" id = "AddWidget_btnCreateWidget">View Earlier Tasks</a></div></div>`}noremaindershtml(){return`<div class="card text-center border-0 shadow-none w-100 notification-empty-card mb-0 bg-transparent" style = "z-index:99" > <div class="card-body mt-50 text-center"><img src="tenants/themes/compact/imgs/notification.png" onerror = "ReloadImage(event)" class="h-200p w-200p"><p class="text-dark my-1 font-weight-600">You don't have any Notifications yet.</p><p class="font-14">Will notify you when Something arrives'</p></div><div class="card-footer text-center border-0 mb-10"><a class="btn btn-outline-primary mr-auto ml-auto" href = "javascript:;" onclick = "Unibase.Themes.Compact.Components.Notification.Instance().ViewAll(6)" id = "AddWidget_btnCreateWidget">View Earlier Notifications</a></div></div>`}reloadPage(refguid){var versionguid,obj;Unibase.Themes.Providers.DetailHelper.installedAppId!=0&&(versionguid=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x=>x.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_versionguid").Value,refguid==versionguid&&(obj=Unibase.Themes.Compact.Components.Details.Instance(),obj._recordId=Unibase.Themes.Providers.DetailHelper.recordId,obj._installedAppId=Unibase.Themes.Providers.DetailHelper.installedAppId,Unibase.Themes.Compact.Components.Details.Instance().loadPortlets(obj)))}removetask(taskid){var count=0,html=Unibase.Themes.Compact.Components.Notification.Instance().notaskshtml();isMobileApp()?(count=Number($("#notificatonIconBadge").text())-1,$("#notificatonIconBadge").text(count),count==0&&($("#notificatonIconBadge").addClass("d-none"),$("#taskTabView").html(html),$(".notification-footer").addClass("d-none"))):(count=Number($("#taskIconBadge").text())-1,$("#taskIconBadge").text(count),count==0&&($("#taskIconBadge").addClass("d-none"),$("#settings-panel-body").html(html).addClass("no-data"),$(".notification-footer").addClass("d-none")));$("#tasks_count").text(count);$("#notification_list_"+taskid).remove();$(".TaskLi_"+taskid).remove()}openLink(link){var linkelement=document.createElement("a");linkelement.href=link;$(linkelement).attr("target","_blank");linkelement.click()}}Notification.Status="Accept";Notification.Reason="Accepted";Notification.TaskId=0;Notification.TaskReminderId="";Notification.UnReadNotificationsCount=0;Notification.UnReadTasksCount=0;Components.Notification=Notification})(Components=Compact.Components||(Compact.Components={}))})(Compact=Themes.Compact||(Themes.Compact={}))})(Themes=Unibase.Themes||(Unibase.Themes={}))}(Unibase||(Unibase={})),function(Unibase){let Platform;(function(Platform){let Core;(function(Core){let Enums;(function(Enums){let RowStatus;(function(RowStatus){RowStatus[RowStatus.Active=1]="Active";RowStatus[RowStatus.InActive=2]="InActive";RowStatus[RowStatus.Deleted=3]="Deleted"})(RowStatus=Enums.RowStatus||(Enums.RowStatus={}))})(Enums=Core.Enums||(Core.Enums={}))})(Core=Platform.Core||(Platform.Core={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))}(Unibase||(Unibase={}));