|
@@ -40,10 +40,10 @@ function createLoad(data) {
|
40
|
40
|
const {unibaseId, tenantId, userId} = JSON.parse(cookie);
|
41
|
41
|
|
42
|
42
|
fomrhtml = `<div>
|
43
|
|
- <div class="frm-ifre frm-ifre-${number}" id="frm-ifre-${number}" style="right:${width}px">
|
|
43
|
+ <div class="frm-ifre frm-ifre-${number}" data-formId="${formId}" id="frm-ifre-${number}" style="right:${width}px">
|
44
|
44
|
<div>
|
45
|
45
|
<ul class="m-0 p-0">
|
46
|
|
- <li class="frm-hdr d-none">
|
|
46
|
+ <li class="frm-hdr d-none" data-frm_hdr="true">
|
47
|
47
|
<div class="app-title-ifrm">${appName}</div>
|
48
|
48
|
<div class="ctrl">
|
49
|
49
|
<a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
|
|
@@ -53,13 +53,7 @@ function createLoad(data) {
|
53
|
53
|
</div>
|
54
|
54
|
</li>
|
55
|
55
|
<li class="frm-bdy">
|
56
|
|
- <div class="ctrl-vrtl">
|
57
|
|
- <a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
|
58
|
|
- <a href="javascript:;" class="maximum" data-unid="${number}"><span><i class="la la-expand"></i></span></a>
|
59
|
|
- <a href="javascript:;" class="compress d-none" data-unid="${number}"><span><i class="las la-compress"></i></span></a>
|
60
|
|
- <a href="javascript:;" class="close" data-unid="${number}"><span><i class="la la-times"></i></span></a>
|
61
|
|
- </div>
|
62
|
|
- <iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/${pk_id}/${appConfigurationId}/loadform"></iframe>
|
|
56
|
+ <iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/0/${appConfigurationId}/false/0/loadform"></iframe>
|
63
|
57
|
</li>
|
64
|
58
|
<li class="frm-ftr"></li>
|
65
|
59
|
</ul>
|
|
@@ -79,11 +73,11 @@ function hdrCrtnClckEvnt(number) {
|
79
|
73
|
let isPopUpState = $(this).attr("data-ispopup");
|
80
|
74
|
let height = $(`.frm-ifre-${id}`).find(".frm-hdr").height();
|
81
|
75
|
$(".list-page").css({filter: "unset", opacity: 1});
|
82
|
|
- $(`.frm-ifre-${id} .frm-hdr`).toggleClass("d-none");
|
83
|
76
|
$(`.frm-ifre-${id} .frm-bdy`).toggleClass("d-none");
|
84
|
77
|
if (isPopUpState == "true") {
|
85
|
78
|
// popup large
|
86
|
79
|
$(this).attr("data-ispopup", "false");
|
|
80
|
+ $(this).parents('.frm-hdr').removeClass('d-none').attr('data-frm_hdr', 'false');
|
87
|
81
|
$(`.frm-ifre-${id} .maximum`).addClass("d-none");
|
88
|
82
|
$(`.frm-ifre-${id} .minimize`).attr("data-ispopup", "false");
|
89
|
83
|
$(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
|
|
@@ -96,6 +90,7 @@ function hdrCrtnClckEvnt(number) {
|
96
|
90
|
} else {
|
97
|
91
|
// popup small
|
98
|
92
|
$(this).attr("data-ispopup", "true");
|
|
93
|
+ $(this).parents('.frm-hdr').addClass('d-none').attr('data-frm_hdr', 'true');
|
99
|
94
|
$(`.frm-ifre-${id} .maximum`).removeClass("d-none");
|
100
|
95
|
$(`.frm-ifre-${id} .minimize`).attr("data-ispopup", "true");
|
101
|
96
|
$(`.frm-ifre-${id}`).attr("data-ispop_up", "true");
|
|
@@ -104,6 +99,9 @@ function hdrCrtnClckEvnt(number) {
|
104
|
99
|
height: "",
|
105
|
100
|
bottom: "",
|
106
|
101
|
});
|
|
102
|
+ if($(this).parents('.frm-hdr').attr("data-saveform") == 'true'){
|
|
103
|
+ $(this).parents('.frm-hdr').removeClass('d-none')
|
|
104
|
+ }
|
107
|
105
|
}
|
108
|
106
|
resetwidth();
|
109
|
107
|
});
|
|
@@ -136,264 +134,90 @@ function hdrCrtnClckEvnt(number) {
|
136
|
134
|
resetwidth();
|
137
|
135
|
});
|
138
|
136
|
}
|
139
|
|
-function loadData() {
|
140
|
|
- $(".bdy-ul").empty();
|
141
|
|
- $('[class="refrsh"]')
|
142
|
|
- .unbind()
|
143
|
|
- .on("click", function () {
|
144
|
|
- loadData();
|
145
|
|
- });
|
146
|
|
- $('[data-clck="ri-grid-fill"]').on("click", function () {
|
147
|
|
- $(".apps-list").toggleClass("d-flex");
|
148
|
|
- });
|
149
|
|
- getData("apis/v4/unibase/platform/apps/myapps").then(function (response) {
|
150
|
|
- let result = JSON.parse(response.result);
|
151
|
|
- let html = "";
|
152
|
|
- for (var i = 0; i < result.length; i++) {
|
153
|
|
- html += `<li class="appsBind" data-myappid="${result[i].MyAppId}"><img src="../imgs/${result[i].ImageUrl}" ><span class="appTitle">${result[i].AppTitle}</span></li>`;
|
154
|
|
- }
|
155
|
|
- $("#apps-list").html(html);
|
156
|
|
- $("li.appsBind").on("click", function () {
|
157
|
|
- $(".apps-list").removeClass("d-flex");
|
158
|
|
- });
|
159
|
|
- });
|
160
|
|
- getData(
|
161
|
|
- "apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20"
|
162
|
|
- ).then(function (result) {
|
163
|
|
- let response = JSON.parse(result.result);
|
|
137
|
+function loadData(ApiPath, isSentBy) {
|
|
138
|
+ $(".bdy-ul").empty().removeClass("d-none");
|
|
139
|
+ $(".hdr-ul").removeClass("d-none");
|
|
140
|
+ getData(ApiPath).then(function (result) {
|
|
141
|
+ let response = JSON.parse(result.result),
|
|
142
|
+ html = "";
|
|
143
|
+ const cookie = getCookie("_idty");
|
164
|
144
|
if (response.length != 0) {
|
165
|
|
- // Notifcations
|
166
|
|
- let bdyUI = '<div class="accordion" id="notifi-list">';
|
167
|
|
- for (var i = 0; i < response.length; i++) {
|
168
|
|
- bdyUI += `<li class="item-li" id="${
|
169
|
|
- response[i].ReminderId
|
170
|
|
- }" data-ref="${
|
171
|
|
- response[i].RedirectOptions.RefId
|
172
|
|
- }" data-installedAppId="${
|
173
|
|
- response[i].RedirectOptions.InstalledAppId
|
174
|
|
- }" data-formId="${response[i].RedirectOptions.CreateFormId}">
|
175
|
|
- <div class="accordion-header" id="accHeader-${
|
176
|
|
- response[i].ReminderId
|
177
|
|
- }">
|
178
|
|
- <div class="notifiListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${
|
179
|
|
- response[i].ReminderId
|
180
|
|
- }" aria-expanded="false" aria-controls="collapseOne">
|
181
|
|
- <div class="row m-0 w-100 p-0 ">
|
182
|
|
- <div class="col-3 px-0 d-flex flex-row text-truncate">
|
183
|
|
- <input class="form-check-input mr-2" type="checkbox" value="" id="flexCheckDefault">
|
184
|
|
- <div class="mx-3 w-75 text-truncate">
|
185
|
|
- <span class="mx-1">${
|
186
|
|
- response[i].Subject
|
187
|
|
- }</span>
|
188
|
|
- </div>
|
189
|
|
- </div>
|
190
|
|
- <div class="col-9 text-truncate d-flex justify-content-between">
|
191
|
|
- <span class="mx-1 w-mes">${
|
192
|
|
- response[i].Message
|
193
|
|
- }</span>
|
194
|
|
- <span class="mx-1 t-sec-min">${dateTimeFormat(
|
195
|
|
- response[i].ReminderDate
|
196
|
|
- )}</span>
|
197
|
|
- </div>
|
198
|
|
- </div>
|
199
|
|
- </div>
|
200
|
|
- <div id="collapse-${
|
201
|
|
- response[i].ReminderId
|
202
|
|
- }" class="accordion-collapse collapse" aria-labelledby="accHeader-${
|
203
|
|
- response[i].ReminderId
|
204
|
|
- }" data-bs-parent="#notifi-list">
|
205
|
|
- <div class="accordion-body" id="accBody${
|
206
|
|
- response[i].ReminderId
|
207
|
|
- }">
|
208
|
|
-
|
209
|
|
- </div>
|
210
|
|
- </div>
|
211
|
|
- </div>
|
212
|
|
- </li>`;
|
213
|
|
- }
|
214
|
|
- bdyUI += "</div>";
|
215
|
|
- $(".bdy-ul").append(bdyUI);
|
216
|
|
- $('.sub-nav-item[data-buttonType="inbox"] .length').remove();
|
217
|
|
- $('.sub-nav-item[data-buttonType="inbox"]').append(
|
218
|
|
- `<span class="length badge rounded-pill bg-light text-dark ml-auto"></span>`
|
219
|
|
- );
|
220
|
|
- $(".notifiListItms").on("click", function () {
|
221
|
|
- let _this = $(this).parents(".item-li");
|
222
|
|
- let obj = {
|
223
|
|
- FromDate: "2022/11/30",
|
224
|
|
- InstalledAppId: Number($(_this).attr("data-installedAppId")),
|
225
|
|
- RecordId: Number($(_this).attr("data-ref")),
|
226
|
|
- ToDate: "2022/11/30",
|
227
|
|
- };
|
228
|
|
- //let obj = { "FromDate": "2022/11/30", "InstalledAppId": 102530270000109, "RecordId": 102533490346298, "ToDate": "2022/11/30" };
|
229
|
|
- getDataObj(
|
230
|
|
- "apis/v4/unibase/platform/widgets/getdefaultwidget",
|
231
|
|
- obj,
|
232
|
|
- true,
|
233
|
|
- "POST"
|
234
|
|
- ).then(function (response) {
|
235
|
|
- let res = JSON.parse(response.result),
|
236
|
|
- html = "";
|
237
|
|
- if (response.message == "200" && response.errors == null) {
|
238
|
|
- html = `<ul class="p-0 m-0 d-flex flex-row">`;
|
239
|
|
- if (
|
240
|
|
- res.AppConfigurations != null &&
|
241
|
|
- res.AppConfigurations.length > 0
|
242
|
|
- ) {
|
243
|
|
- for (var k = 0; k < res.AppConfigurations.length; k++) {
|
244
|
|
- html += `<li class="mx-2 btn-outline-primary btn btn-sm">${res.AppConfigurations[k].SettingName}</li>`;
|
245
|
|
- }
|
246
|
|
- } else {
|
247
|
|
- html += `<li class="p-1 my-0 alert alert-danger" role="alert">
|
248
|
|
- App Configurations Not configure
|
249
|
|
- </li>`;
|
250
|
|
- }
|
251
|
|
- if (res.Stages != null) {
|
252
|
|
- for (var x = 0; x < res.Stages.length; x++) {
|
253
|
|
- if (res.Stages[x].IsDefault) {
|
254
|
|
- html += `<li class="ml-auto">
|
255
|
|
- <a class="btn btn-sm btn-secondary dropdown-toggle" href="javascript:void(0)" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
256
|
|
- ${res.Stages[x].StageName}
|
257
|
|
- </a>
|
258
|
|
- <ul class="dropdown-menu">`;
|
259
|
|
- }
|
260
|
|
- }
|
261
|
|
- for (var i = 0; i < res.Stages.length; i++) {
|
262
|
|
- if (!res.Stages[i].IsDefault) {
|
263
|
|
- html += `<li><a class="dropdown-item" href="javascript:void(0);">${res.Stages[i].StageName}</a></li>`;
|
264
|
|
- }
|
265
|
|
- }
|
266
|
|
- html += "</ul></li>";
|
267
|
|
- } else {
|
268
|
|
- html += `<li class="p-1 my-0 alert alert-danger ml-auto" role="alert">
|
269
|
|
- No Stages
|
270
|
|
- </li>`;
|
271
|
|
- }
|
272
|
|
- html += `<li class="p-1 mx-2 my-0 btn-outline-info detailBtn btn btn-sm" data-appid="${Number(
|
273
|
|
- $(_this).attr("data-installedAppId")
|
274
|
|
- )}" data-recordid="${Number(
|
275
|
|
- $(_this).attr("data-ref")
|
276
|
|
- )}">Details-Page</li></ul>`;
|
|
145
|
+ response.forEach(function (Item, index) {
|
|
146
|
+ let isSent = false;
|
|
147
|
+ if (Item.FromUserName == JSON.parse(cookie).name) {
|
|
148
|
+ isSent = true;
|
|
149
|
+ }
|
|
150
|
+ if (Item.FromUserName == null) {
|
|
151
|
+ Item.FromUserName = 'Please check it Notification Team';
|
|
152
|
+ }
|
|
153
|
+ //if(window.innerWidth >1024){ // Desktop Width
|
|
154
|
+ html += `<li class="pdng lst-Notifi" data-ReminderTypeId="${Item.ReminderTypeId}" data-reminderurl="${Item.ReminderUrl}" data-reminderId="${Item.ReminderId}" data-isreaded="${Item.ReminderStatusId}" data-issentby=${isSent} data-refId="${Item.RedirectOptions.RefId}" data-instlledAppId="${Item.RedirectOptions.InstalledAppId}" data-formid="${Item.RedirectOptions.CreateFormId}" data-urlType="${Item.UrlType}">`;
|
|
155
|
+ html += `<div class="flex-shrink-0 wi-chck"><div class="wi-item ml-0"><input class="form-check-input mr-2" type="checkbox" value="" id="flexCheckDefault"></div><div class="wi-item">`;
|
|
156
|
+ if (Item.ReminderTypeId == 1) {
|
|
157
|
+ html += `<i class="ri-star-fill" style="opacity:0.6"></i>`;
|
277
|
158
|
} else {
|
278
|
|
- html += `<div class="alert alert-danger" role="alert">
|
279
|
|
- ${response.message} ${response.errors}
|
280
|
|
- </div>`;
|
|
159
|
+ html += `<i class="ri-star-line"></i>`;
|
281
|
160
|
}
|
282
|
|
- $(_this).find(".accordion-body").html(html);
|
283
|
|
- detailClick();
|
284
|
|
- });
|
|
161
|
+ html += `</div></div>`; // check-box
|
|
162
|
+ html += `<div class="wi-sbjt-msge mx-1">`;
|
|
163
|
+ html += `<div class="wi-from wi-item text-truncate"><span data-isreaded="${Item.ReminderStatusId}">${Item.FromUserName}</span></div>`;
|
|
164
|
+ html += `<div class="wi-sbjt wi-item text-truncate flex-shrink-1"><span class="mx-2">${Item.Subject}</span></div><div>-</div>`; // Subject
|
|
165
|
+ html += `<div class="wi-msge wi-item text-truncate"><span class="mx-2">${Item.Message}</span></div>`; // Message
|
|
166
|
+ html += `</div>`;
|
|
167
|
+ html += `<div class="wi-time time flex-shrink-0 ml-auto"><span>${dateTimeFormat(
|
|
168
|
+ Item.ReminderDate
|
|
169
|
+ )}</span></div>`;
|
|
170
|
+ html += `<div class="hover">
|
|
171
|
+ <ul>`;
|
|
172
|
+ if (Item.RedirectOptions.CreateFormId != 0) {
|
|
173
|
+ html += ` <li class="mx-2 hover-item"><a class="formBtn" data-urltype="Form" href="javascript:;"><i class="ri-store-line"></i></a></li>`;
|
|
174
|
+ } else {
|
|
175
|
+ html += ` <li class="mx-2 hover-item"><a class="detailBtn" data-urltype=${Item.UrlType} href="javascript:;"><i class="ri-information-line"></i></a></li>`;
|
|
176
|
+ }
|
|
177
|
+ html += ` </ul>
|
|
178
|
+ </div>`;
|
|
179
|
+ html += "</li>";
|
|
180
|
+ /* }else{ // Mobile Width card view
|
|
181
|
+ html += `<li class="pdng lst-Notifi" data-ReminderTypeId="${Item.ReminderTypeId}" data-reminderurl="${Item.ReminderUrl}" data-reminderId="${Item.ReminderId}" data-isreaded="${Item.ReminderStatusId}" data-issentby=${isSent} data-refId="${Item.RedirectOptions.RefId}" data-instlledAppId="${Item.RedirectOptions.InstalledAppId}" data-formid="${Item.RedirectOptions.CreateFormId}" data-urlType="${Item.UrlType}">`
|
|
182
|
+ html += ` <div><span class="align-items-center d-flex justify-content-center sdr-nme fs-4">S</span></div>
|
|
183
|
+ <div class="d-flex flex-column ms-2 w-100">
|
|
184
|
+ <div class="d-flex justify-content-between align-items-baseline">
|
|
185
|
+ <span class="me-2 text-truncate">${Item.FromUserName}</span>
|
|
186
|
+ <span class="w-60p text-truncate font-11">${dateTimeFormat(
|
|
187
|
+ Item.ReminderDate
|
|
188
|
+ )}</span>
|
|
189
|
+ </div>
|
|
190
|
+ <div><span class="fw-500">${Item.Subject}</span></div>
|
|
191
|
+ <div class="d-flex justify-content-between"><span>${Item.Message}</span><span>`;
|
|
192
|
+ if (Item.ReminderTypeId == 1) {
|
|
193
|
+ html += `<i class="ri-star-fill" style="opacity:0.6"></i>`;
|
|
194
|
+ } else {
|
|
195
|
+ html += `<i class="ri-star-line"></i>`;
|
|
196
|
+ }
|
|
197
|
+ html += `</span></div>
|
|
198
|
+ </div>`
|
|
199
|
+ html +=`</li>`
|
|
200
|
+ }*/
|
|
201
|
+
|
285
|
202
|
});
|
286
|
|
- }
|
287
|
|
- });
|
288
|
|
- getData(
|
289
|
|
- "apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/20"
|
290
|
|
- ).then(function (tskResp) {
|
291
|
|
- let response = JSON.parse(tskResp.result);
|
292
|
|
- if (response.length != 0) {
|
293
|
|
- let _tskhtml = '<div class="accordion" id="task-list">';
|
294
|
|
- for (var i = 0; i < response.length; i++) {
|
295
|
|
- _tskhtml += `<li class="item-li" id="${
|
296
|
|
- response[i].ReminderId
|
297
|
|
- }" data-ref="${
|
298
|
|
- response[i].RedirectOptions.RefId
|
299
|
|
- }" data-installedAppId="${
|
300
|
|
- response[i].RedirectOptions.InstalledAppId
|
301
|
|
- }" data-formId="${response[i].RedirectOptions.CreateFormId}">
|
302
|
|
- <div class="accordion-header" id="accHeader-${
|
303
|
|
- response[i].ReminderId
|
304
|
|
- }">
|
305
|
|
- <div class="tskListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${
|
306
|
|
- response[i].ReminderId
|
307
|
|
- }" aria-expanded="false" aria-controls="collapseOne">
|
308
|
|
- <div class="row m-0 w-100 p-0 ">
|
309
|
|
- <div class="col-3 px-0 d-flex flex-row text-truncate">
|
310
|
|
- <input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
|
311
|
|
- <div class="mx-3 w-75 text-truncat">
|
312
|
|
- <span class="mx-1">${
|
313
|
|
- response[i].Subject
|
314
|
|
- }</span>
|
315
|
|
- </div>
|
316
|
|
- </div>
|
317
|
|
- <div class="col-9 text-truncate d-flex justify-content-between">
|
318
|
|
- <span class="mx-1 w-mes">${
|
319
|
|
- response[i].Message
|
320
|
|
- }</span>
|
321
|
|
- <span class="mx-1 t-sec-min">${dateTimeFormat(
|
322
|
|
- response[i].ReminderDate
|
323
|
|
- )}</span>
|
324
|
|
- </div>
|
325
|
|
- </div>
|
326
|
|
- </div>
|
327
|
|
- <div id="collapse-${
|
328
|
|
- response[i].ReminderId
|
329
|
|
- }" class="accordion-collapse collapse" aria-labelledby="accHeader-${
|
330
|
|
- response[i].ReminderId
|
331
|
|
- }" data-bs-parent="#notifi-list">
|
332
|
|
- <div class="accordion-body" id="accBody${
|
333
|
|
- response[i].ReminderId
|
334
|
|
- }">
|
335
|
|
- <ul class="p-0 m-0 d-flex flex-row justify-content-between">
|
336
|
|
- <li class="mx-2 btn-outline-success btn btn-sm">Confirm</li>
|
337
|
|
- <li class="mx-2 btn-outline-danger btn btn-sm">Reject</li>
|
338
|
|
- <li class="mx-2 btn-outline-primary btn btn-sm">Close</li>
|
339
|
|
- <li class="mx-2 btn-outline-info detailBtn btn btn-sm" data-appId="${
|
340
|
|
- response[i].RedirectOptions
|
341
|
|
- .InstalledAppId
|
342
|
|
- }" data-recordId="${
|
343
|
|
- response[i].RedirectOptions.RefId
|
344
|
|
- }">Details-Page</li>
|
345
|
|
- </ul>
|
346
|
|
- </div>
|
347
|
|
- </div>
|
348
|
|
- </div>
|
349
|
|
- </li>`;
|
|
203
|
+ $(".ctr-lst-pge .bdy-ul").html(html);
|
|
204
|
+ if (isSentBy) {
|
|
205
|
+ $(".pdng.lst-Notifi").addClass("d-none");
|
|
206
|
+ $(".pdng.lst-Notifi[data-issentby='true']").removeClass("d-none");
|
350
|
207
|
}
|
351
|
|
- _tskhtml += "</div>";
|
352
|
|
- $(".bdy-ul").append(_tskhtml);
|
353
|
208
|
detailClick();
|
|
209
|
+ //stagesLoad();
|
354
|
210
|
}
|
355
|
211
|
});
|
356
|
212
|
|
357
|
|
- // create button apps load
|
358
|
|
- let appName = [];
|
359
|
|
- getData("apis/v4/unibase/platform/apps/myapps").then(function (res) {
|
360
|
|
- let response = JSON.parse(res.result);
|
361
|
|
- jQuery.each(response, async function (index, item) {
|
362
|
|
- let installedAppId = Number(item.MyAppId);
|
363
|
|
- await getData(
|
364
|
|
- `apis/v4/unibase/platform/apps/listappconfigurations/installedappid/${installedAppId}`
|
365
|
|
- ).then(function (result) {
|
366
|
|
- if (
|
367
|
|
- result.result != null &&
|
368
|
|
- result.result != "" &&
|
369
|
|
- result.result != "[]"
|
370
|
|
- ) {
|
371
|
|
- let _data = JSON.parse(result.result);
|
372
|
|
- let data = _data.filter((x) => x.SettingUrlType == 1);
|
373
|
|
- if (data.length != 0) {
|
374
|
|
- appName.push({
|
375
|
|
- SettingUrlType: data[0].SettingUrlType,
|
376
|
|
- AppTitle: data[0].AppTitle,
|
377
|
|
- FormId: data[0].FormId,
|
378
|
|
- InstalledAppId: data[0].InstalledAppId,
|
379
|
|
- RoleSettingAppId: data[0].RoleSettingAppId,
|
380
|
|
- InstalledAppGuid: data[0].InstalledAppGuid,
|
381
|
|
- AppConfigurationId: data[0].AppConfigurationId,
|
382
|
|
- AppPermissionId: data[0].AppPermissionId,
|
383
|
|
- AppConfigType: data[0].AppConfigType,
|
384
|
|
- });
|
385
|
|
- }
|
386
|
|
- }
|
387
|
|
- });
|
388
|
|
- await createLoad(appName);
|
389
|
|
- });
|
390
|
|
- });
|
391
|
|
-
|
392
|
213
|
getData("apis/v4/unibase/reminders/platform/getunreadreminderscount").then(
|
393
|
214
|
function (response) {
|
394
|
215
|
let result = JSON.parse(response.result);
|
395
|
216
|
let count = Number(result.NotificationCount) + Number(result.TasksCount);
|
396
|
|
- $('[data-buttontype="inbox"] .length').text(count);
|
|
217
|
+ $('[data-buttontype="inbox"] .length.rounded-pill').remove();
|
|
218
|
+ $('[data-buttontype="inbox"]').append(
|
|
219
|
+ `<span class="length badge rounded-pill bg-light text-dark ml-auto" data-TasksCount="${result.TasksCount}" data-notifiCount="${result.NotificationCount}">${count}</span>`
|
|
220
|
+ );
|
397
|
221
|
$('[data-notification="count"]').text(count);
|
398
|
222
|
if (count > 40) {
|
399
|
223
|
$('[data-paggtn="true"]').text(`1-40`);
|
|
@@ -402,10 +226,15 @@ function loadData() {
|
402
|
226
|
}
|
403
|
227
|
}
|
404
|
228
|
);
|
|
229
|
+ if(window.innerWidth() < 1024){
|
|
230
|
+ $('.ctr-lst-pge').on('click', function(){
|
|
231
|
+ $('.mnNvIcn').click()
|
|
232
|
+ })
|
|
233
|
+ }
|
405
|
234
|
}
|
406
|
235
|
function iFrmeWdth() {
|
407
|
236
|
let width = 0,
|
408
|
|
- erwdth = 32;
|
|
237
|
+ erwdth = 15;
|
409
|
238
|
$(".frm-ifre").each(function (i, e) {
|
410
|
239
|
if ($(this).length == 0) {
|
411
|
240
|
erwdth = 0;
|
|
@@ -418,7 +247,7 @@ function iFrmeWdth() {
|
418
|
247
|
}
|
419
|
248
|
function resetwidth() {
|
420
|
249
|
let width = 0,
|
421
|
|
- erwdth = 32;
|
|
250
|
+ erwdth = 15;
|
422
|
251
|
$(".frm-ifre").each(function (i, e) {
|
423
|
252
|
if (i == 0) {
|
424
|
253
|
$(this).css("right", width + "px");
|
|
@@ -432,22 +261,74 @@ function resetwidth() {
|
432
|
261
|
});
|
433
|
262
|
}
|
434
|
263
|
export function detailClick() {
|
435
|
|
- $(".detailBtn").click(function () {
|
436
|
|
- let serverUrl = _serverUrl();
|
437
|
|
- $(".bdy-ul").addClass("d-none");
|
438
|
|
- let installedAppId = +$(this).attr("data-appId");
|
439
|
|
- let recordId = +$(this).attr("data-recordId");
|
440
|
|
- // Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(105013010001972,105010260000090,'Details','null',6,0,null)
|
441
|
|
- const cookie = getCookie("_idty");
|
442
|
|
- if (cookie) {
|
443
|
|
- const {unibaseId, tenantId, userId} = JSON.parse(cookie);
|
|
264
|
+ // Details Popup Abihram popup page
|
|
265
|
+ $(".wi-sbjt-msge").on("click", function (e) {
|
|
266
|
+ e.stopPropagation();
|
|
267
|
+ detailsPage(this, true, "Details-page");
|
|
268
|
+ });
|
|
269
|
+ // Details Page Loading
|
|
270
|
+ $(".detailBtn[data-urltype='Details']").click(function (e) {
|
|
271
|
+ e.stopPropagation();
|
|
272
|
+ detailsPage(this, false, "Details-page");
|
|
273
|
+ });
|
|
274
|
+ //Form Page Loading
|
|
275
|
+ $(".formBtn[data-urltype='Form']").on("click", function (e) {
|
|
276
|
+ e.stopPropagation();
|
|
277
|
+ detailsPage(this, true, "Form-page");
|
|
278
|
+ });
|
|
279
|
+ //List Page Loading
|
|
280
|
+ $("[data-urltype='List']").on("click", function (e) {
|
|
281
|
+ e.stopPropagation();
|
|
282
|
+ detailsPage(this, true, "List-page");
|
|
283
|
+ });
|
|
284
|
+ // get stages
|
|
285
|
+}
|
|
286
|
+export function detailsPage(e, ifrmPopup, isPage) {
|
|
287
|
+ let serverUrl = _serverUrl();
|
|
288
|
+ $(".bdy-ul").addClass("d-none");
|
|
289
|
+ $(".hdr-ul").addClass("d-none");
|
|
290
|
+ let installedAppId = $(e)
|
|
291
|
+ .parents(".pdng.lst-Notifi")
|
|
292
|
+ .attr("data-instlledappid");
|
|
293
|
+ let recordId = $(e).parents(".pdng.lst-Notifi").attr("data-refid");
|
|
294
|
+ let reminderid = $(e).parents(".pdng.lst-Notifi").attr("data-reminderid");
|
|
295
|
+ let remindertype = $(e)
|
|
296
|
+ .parents(".pdng.lst-Notifi")
|
|
297
|
+ .attr("data-remindertypeid");
|
|
298
|
+ // Unibase.Themes.Compact.Components.Notification.Instance().loadReminderDetails(105013010001972,105010260000090,'Details','null',6,0,null)
|
|
299
|
+ const cookie = getCookie("_idty");
|
|
300
|
+ if (cookie) {
|
|
301
|
+ const {unibaseId, tenantId, userId} = JSON.parse(cookie);
|
|
302
|
+ if (isPage == "Details-page") {
|
|
303
|
+ $("#detailIframe").html(
|
|
304
|
+ `<iframe width="100%" style="min-height:calc(100vh - ${$(
|
|
305
|
+ ".tp-bar"
|
|
306
|
+ ).height()}px)" name="srcframe" id="srcframe" class="srcframe" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${recordId}/${installedAppId}/${remindertype}/${reminderid}/${ifrmPopup}/loadDetail"></iframe>`
|
|
307
|
+ );
|
|
308
|
+ } else if (isPage == "Form-page") {
|
|
309
|
+ getData(
|
|
310
|
+ `apis/v4/unibase/platform/apps/listappconfigurations/installedappid/${installedAppId}`
|
|
311
|
+ ).then(function (result) {
|
|
312
|
+ let _data = JSON.parse(result.result);
|
|
313
|
+ let data = _data.filter((x) => x.SettingUrlType == 1);
|
|
314
|
+ $("#detailIframe").html(
|
|
315
|
+ `<iframe width="100%" style="min-height:calc(100vh - ${$(
|
|
316
|
+ ".tp-bar"
|
|
317
|
+ ).height()}px)" name="srcframe" id="srcframe" class="srcframe" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${
|
|
318
|
+ data[0].FormId
|
|
319
|
+ }/0/${
|
|
320
|
+ data[0].AppConfigurationId
|
|
321
|
+ }/${reminderid}/${ifrmPopup}/loadform"></iframe>`
|
|
322
|
+ );
|
|
323
|
+ });
|
|
324
|
+ } else if (isPage == "List-page") {
|
444
|
325
|
$("#detailIframe").html(
|
445
|
326
|
`<iframe width="100%" style="min-height:calc(100vh - ${$(
|
446
|
327
|
".tp-bar"
|
447
|
|
- ).height()}px)" name="srcframe" id="srcframe" class="srcframe" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${recordId}/${installedAppId}/loadDetail"></iframe>`
|
|
328
|
+ ).height()}px)" name="srcframe" id="srcframe" class="srcframe" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${reminderid}/${ifrmPopup}/loadList"></iframe>`
|
448
|
329
|
);
|
449
|
330
|
}
|
450
|
|
- });
|
|
331
|
+ }
|
451
|
332
|
}
|
452
|
333
|
export function signaRInit() {
|
453
|
334
|
var huburl = _serverUrl() + "notificationhub";
|
|
@@ -459,7 +340,10 @@ export function signaRInit() {
|
459
|
340
|
export async function register() {
|
460
|
341
|
connection.on("sendnotification", (obj) => {
|
461
|
342
|
$(".ctr-lst-pge .bdy-ul").empty();
|
462
|
|
- loadData();
|
|
343
|
+ loadData(
|
|
344
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
345
|
+ false
|
|
346
|
+ );
|
463
|
347
|
});
|
464
|
348
|
const cookie = getCookie("_idty");
|
465
|
349
|
const {unibaseId, tenantId, userId, sessionId, name} = JSON.parse(cookie);
|
|
@@ -486,16 +370,16 @@ export function resetClckEvnt() {
|
486
|
370
|
}
|
487
|
371
|
|
488
|
372
|
export function initListIndex() {
|
489
|
|
- let _userInfo = atob(document.cookie.split("=")[1]);
|
490
|
|
- let userInfo = " JSON.parse(_userInfo).result";
|
491
|
|
- let sessionId = "userInfo.sessionId";
|
|
373
|
+ let userInfo = JSON.parse(getCookie("_idty"));
|
|
374
|
+ let sessionId = userInfo.sessionId;
|
|
375
|
+
|
492
|
376
|
signaRInit();
|
493
|
|
- let usrinfoHTML = `<li><a class="dropdown-item" href="javascript:void(0);">${userInfo.name}</a></li>
|
494
|
|
-<li><a class="dropdown-item" href="javascript:void(0);">Cloud Settings</a></li>
|
495
|
|
-<li><a class="dropdown-item" href="javascript:void(0);">Help</a></li>
|
|
377
|
+ let usrinfoHTML = `<li><a class="dropdown-item text-capitalize" href="javascript:void(0);">${userInfo.name}</a></li>
|
|
378
|
+ <li><a class="dropdown-item" href="javascript:void(0);">Help</a></li>
|
496
|
379
|
<li><a class="dropdown-item" href="javascript:void(0);" data-btn="logoff">Logoff</a></li>`;
|
497
|
380
|
$(".icn-circle").text(userInfo?.name?.charAt(0)?.toUpperCase());
|
498
|
381
|
$(".uindtls").html(usrinfoHTML);
|
|
382
|
+
|
499
|
383
|
$('[data-btn="logoff"]').on("click", function () {
|
500
|
384
|
document.cookie = "_idty=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
501
|
385
|
window.location = "../login";
|
|
@@ -526,8 +410,17 @@ export function initListIndex() {
|
526
|
410
|
}
|
527
|
411
|
);
|
528
|
412
|
$(".mnNvIcn").click(function () {
|
529
|
|
- $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
|
530
|
|
- $(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
|
|
413
|
+ $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
|
|
414
|
+ $(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
|
|
415
|
+ if ($(".apps-loading:visible").length != 0) {
|
|
416
|
+ $(".ctr-lst-pge").css("width", "");
|
|
417
|
+ $(".ctr-lst-pge").toggleClass("apps-loaded");
|
|
418
|
+ $(".ctr-lst-pge").toggleClass("apps-loaded-tr");
|
|
419
|
+ }
|
|
420
|
+ if(window.innerWidth < 1025){
|
|
421
|
+ $(".ctr-lst-pge").toggleClass('d-block');
|
|
422
|
+ $(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap d-flex w-100").css('background-color','rgb(0 0 0 / 50%)');
|
|
423
|
+ }
|
531
|
424
|
});
|
532
|
425
|
$(".mre-drp a.sub-nav-item.more").on("click", function () {
|
533
|
426
|
$(".sub-nav-item").removeClass("active");
|
|
@@ -547,9 +440,240 @@ export function initListIndex() {
|
547
|
440
|
$(this).addClass("active");
|
548
|
441
|
});
|
549
|
442
|
|
|
443
|
+ $('[data-buttontype="inbox"], [data-application="Mail Application"]').on(
|
|
444
|
+ "click",
|
|
445
|
+ function () {
|
|
446
|
+ $("#detailIframe").empty();
|
|
447
|
+ loadData(
|
|
448
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
449
|
+ false
|
|
450
|
+ );
|
|
451
|
+ }
|
|
452
|
+ );
|
|
453
|
+ window.addEventListener("message", function (e) {
|
|
454
|
+ if (e.data != undefined) {
|
|
455
|
+ if(e.data == "Edit-form"){
|
|
456
|
+ $('.frm-hdr').addClass('d-none')
|
|
457
|
+ }
|
|
458
|
+ if (e.data == "closeForm") {
|
|
459
|
+ $("#detailIframe").empty();
|
|
460
|
+ $(".hdr-ul, .bdy-ul").removeClass("d-none");
|
|
461
|
+ $('.frm-bdy [class="close"]')[0].click();
|
|
462
|
+ }
|
|
463
|
+ if (e.data == "clickToBack") {
|
|
464
|
+ $("#detailIframe").empty();
|
|
465
|
+ loadData(
|
|
466
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
467
|
+ false
|
|
468
|
+ );
|
|
469
|
+ }
|
|
470
|
+ if (e.data.includes("save-form")) {
|
|
471
|
+ let spilt = e.data.split("/");
|
|
472
|
+ $(`.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr`).removeClass(
|
|
473
|
+ "d-none"
|
|
474
|
+ ).attr('data-frm_hdr','false');
|
|
475
|
+ }
|
|
476
|
+ if (e.data == "close apps") {
|
|
477
|
+ $("body").removeClass("d-flex flex-row");
|
|
478
|
+ $("#detailIframe").empty();
|
|
479
|
+ $(".hdr-ul, .bdy-ul").removeClass("d-none");
|
|
480
|
+ $(".apps-loading").remove();
|
|
481
|
+ $("#list-page").css("width", "100%");
|
|
482
|
+ $(".lft-nav-bar").removeClass(".lft-nav-bar-Wrap");
|
|
483
|
+ $(".ctr-lst-pge").removeClass("apps-loaded");
|
|
484
|
+ $(".ctr-lst-pge").removeClass("apps-loaded-tr");
|
|
485
|
+ }
|
|
486
|
+ if (e.data.includes("/")) {
|
|
487
|
+ let spilt = e.data.split("/");
|
|
488
|
+ $(
|
|
489
|
+ `.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr .ctrl .${spilt[0]}`
|
|
490
|
+ ).click();
|
|
491
|
+ if(spilt[0].includes('success')){
|
|
492
|
+ $(`.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr`).removeClass("d-none").attr({'data-frm_hdr': 'false', 'data-saveform':'true'});
|
|
493
|
+ }
|
|
494
|
+ if(!spilt[0].includes('maximum') && !spilt[0].includes('compress')){
|
|
495
|
+ $(`.frm-ifre[data-formid="${spilt[1]}"] .frm-hdr`).removeClass("d-none").attr({'data-frm_hdr': 'false'});
|
|
496
|
+ }
|
|
497
|
+ }
|
|
498
|
+ if (e.data == "closeForm_detailIframe") {
|
|
499
|
+ $("#detailIframe").empty();
|
|
500
|
+ $(".hdr-ul, .bdy-ul").removeClass("d-none");
|
|
501
|
+ }
|
|
502
|
+ }
|
|
503
|
+ });
|
|
504
|
+ $('[class="refrsh"]').on("click", function () {
|
|
505
|
+ loadData(
|
|
506
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
507
|
+ false
|
|
508
|
+ );
|
|
509
|
+ });
|
|
510
|
+
|
|
511
|
+ getData("apis/v4/unibase/platform/apps/myapps").then(function (response) {
|
|
512
|
+ if(response.message.includes("User Authentication Failed")){
|
|
513
|
+ window.location = "../login";
|
|
514
|
+ }else{
|
|
515
|
+ let result = JSON.parse(response.result);
|
|
516
|
+ let html = "<li class='m-0 p-0'><ul class='d-flex flex-wrap m-0 p-0'>";
|
|
517
|
+ for (var i = 0; i < result.length; i++) {
|
|
518
|
+ html += `<li class="appsBind" data-myappid="${result[i].MyAppId}">`;
|
|
519
|
+ if (
|
|
520
|
+ result[i].SvgIconUrl != undefined &&
|
|
521
|
+ result[i].SvgIconUrl != null &&
|
|
522
|
+ result[i].SvgIconUrl != ""
|
|
523
|
+ ) {
|
|
524
|
+ html += `<span class="svg-icons">${result[i].SvgIconUrl}</span>`;
|
|
525
|
+ } else {
|
|
526
|
+ html +=
|
|
527
|
+ '<span class="svg-icons"><svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> <path class="biz-svg-highlight-color" d="M16.01,31c-1.38,0-2.77-.09-4.14-.28-3.57-.49-6.58-1.42-9.21-2.86-.25-.14-.53-.42-.57-.71-.02-.19-.05-.37-.07-.56-.17-1.33-.34-2.7-.12-4.09,.31-1.92,1.27-3.07,2.95-3.5,1.88-.49,3.74-1.32,5.7-2.55,.07-.04,.14-.08,.24-.13,.04-.02,.09-.05,.15-.08l.28-.15,2.84,8.94c.03-.07,.05-.14,.08-.21,.05-.14,.1-.28,.15-.42,.19-.51,.38-1.04,.53-1.56,0,0,0-.01,0-.02-.03-.03-.05-.07-.06-.11l-1.46-3.77c-.06-.14-.04-.31,.05-.44,.09-.13,.23-.2,.39-.2h4.52c.16,0,.3,.08,.39,.2,.09,.13,.11,.29,.05,.44l-1.46,3.77s-.04,.09-.07,.13c.01,.05,.02,.09,.04,.14,.23,.6,.45,1.22,.66,1.82,.03,.07,.05,.15,.08,.22l2.83-8.89,.28,.14c.35,.18,.7,.37,1.04,.55,.79,.42,1.53,.81,2.3,1.16,.91,.41,1.82,.74,2.72,.98,1.71,.45,2.69,1.61,2.99,3.54h0c.22,1.38,.04,2.74-.13,4.06-.03,.2-.05,.39-.08,.59-.04,.33-.39,.6-.58,.7-2.61,1.43-5.61,2.36-9.16,2.85-1.38,.19-2.77,.28-4.16,.28Zm-5.11-14.14s-.05,.03-.07,.04c-2,1.26-3.91,2.11-5.85,2.61-1.48,.38-2.29,1.36-2.56,3.07-.21,1.31-.04,2.65,.12,3.94,.02,.19,.05,.37,.07,.56,0,.06,.14,.22,.29,.31,2.57,1.4,5.52,2.32,9.03,2.8,2.71,.37,5.45,.37,8.16,0,3.49-.48,6.43-1.39,8.98-2.79,.16-.09,.3-.24,.3-.3,.02-.2,.05-.39,.08-.59,.17-1.28,.34-2.6,.13-3.91h0c-.27-1.72-1.1-2.71-2.6-3.11-.93-.25-1.87-.59-2.8-1.01-.79-.36-1.54-.76-2.33-1.18-.25-.13-.5-.27-.75-.4l-3.11,9.79-.27-.74c-.12-.32-.23-.65-.34-.97-.21-.6-.42-1.21-.65-1.81-.06-.15-.09-.29-.1-.43v-.18s.14-.06,.14-.06l1.42-3.66h-4.34l1.42,3.66,.11,.07v.15c0,.1-.01,.19-.03,.27-.16,.54-.35,1.08-.54,1.6-.05,.14-.1,.28-.15,.42-.06,.18-.14,.35-.21,.51-.05,.13-.11,.26-.16,.39l-.27,.71-3.1-9.76Z"></path> <path class="biz-svg-highlight-color" d="M16.09,16.2c-.81,0-1.63-.16-2.42-.48-2.36-.98-3.89-3.26-3.89-5.82,0-.62,.51-1.13,1.13-1.13s1.13,.51,1.13,1.13c0,1.64,.98,3.11,2.5,3.74,1.52,.63,3.25,.28,4.41-.88,1.16-1.16,1.51-2.89,.88-4.41-.63-1.52-2.1-2.5-3.74-2.5h-2.45l.66,.66c.44,.44,.44,1.16,0,1.6-.21,.21-.5,.33-.8,.33s-.59-.12-.8-.33l-2.59-2.59c-.21-.21-.33-.5-.33-.8s.12-.59,.33-.8l2.59-2.59c.21-.21,.5-.33,.8-.33s.59,.12,.8,.33c.21,.21,.33,.5,.33,.8s-.12,.59-.33,.8l-.66,.66h2.45c2.56,0,4.84,1.53,5.82,3.89,.98,2.36,.44,5.06-1.37,6.87-1.21,1.21-2.81,1.85-4.45,1.85Zm-5.18-6.9c-.33,0-.6,.27-.6,.6,0,2.34,1.4,4.44,3.56,5.33,2.16,.9,4.63,.41,6.29-1.25s2.15-4.13,1.25-6.29c-.9-2.16-2.99-3.56-5.33-3.56h-3.74l1.58-1.57c.23-.23,.23-.61,0-.85-.23-.23-.62-.23-.85,0l-2.59,2.59c-.11,.11-.18,.27-.18,.42s.06,.31,.18,.42l2.59,2.59c.23,.23,.62,.23,.85,0,.23-.23,.23-.61,0-.85l-1.58-1.57h3.74c1.86,0,3.52,1.11,4.23,2.83,.71,1.72,.32,3.68-.99,4.99-1.31,1.31-3.27,1.7-4.99,.99-1.72-.71-2.83-2.37-2.83-4.23,0-.33-.27-.6-.6-.6Z"></path> </svg></span>';
|
|
528
|
+ }
|
|
529
|
+ html += `<span class="appTitle">${result[i].AppTitle}</span></li>`;
|
|
530
|
+ }
|
|
531
|
+ html += "</ul></li>";
|
|
532
|
+ $("#apps-list").html(html);
|
|
533
|
+ $(".appsBind").on("click", function () {
|
|
534
|
+ let width = "330px";
|
|
535
|
+ if(window.innerWidth> 1024){
|
|
536
|
+ $("#list-page").css("width", `calc(100% - ${width})`);
|
|
537
|
+ }
|
|
538
|
+ if( $('.lft-nav-bar-2:visible').length !=0 ){
|
|
539
|
+ $(".ctr-lst-pge").addClass("apps-loaded-tr");
|
|
540
|
+ }else{
|
|
541
|
+ $(".ctr-lst-pge").addClass("apps-loaded lft-nav-bar-Wrap")
|
|
542
|
+ }
|
|
543
|
+ let installedAppId = $(this).attr("data-myappid");
|
|
544
|
+ const cookie = getCookie("_idty");
|
|
545
|
+ if (cookie) {
|
|
546
|
+ let serverUrl = _serverUrl();
|
|
547
|
+ const {unibaseId, tenantId, userId} = JSON.parse(cookie);
|
|
548
|
+ $("body").addClass("d-flex flex-row");
|
|
549
|
+ $(".apps-loading").remove();
|
|
550
|
+ $("#list-page").after(
|
|
551
|
+ `<section id="" class="apps-loading"><iframe width="100%" style="height:inherit" name="lstSrcFrame" id="lstSrcFrame" class="lstSrcFrame" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/0/false/loadList"></iframe></section>`
|
|
552
|
+ );
|
|
553
|
+ }
|
|
554
|
+ });
|
|
555
|
+ }
|
|
556
|
+ });
|
|
557
|
+ $(".btn.dropdown-toggle.create").on("click", function () {
|
|
558
|
+ let appName = [];
|
|
559
|
+ getData("apis/v4/unibase/platform/apps/myapps").then(async function (res) {
|
|
560
|
+ let response = await JSON.parse(res.result);
|
|
561
|
+ jQuery.each(response, async function (index, item) {
|
|
562
|
+ let installedAppId = Number(item.MyAppId);
|
|
563
|
+ await getData(
|
|
564
|
+ `apis/v4/unibase/platform/apps/listappconfigurations/installedappid/${installedAppId}`
|
|
565
|
+ ).then(function (result) {
|
|
566
|
+ if (
|
|
567
|
+ result.result != null &&
|
|
568
|
+ result.result != "" &&
|
|
569
|
+ result.result != "[]"
|
|
570
|
+ ) {
|
|
571
|
+ let _data = JSON.parse(result.result);
|
|
572
|
+ let data = _data.filter((x) => x.SettingUrlType == 1);
|
|
573
|
+ if (data.length != 0) {
|
|
574
|
+ appName.push({
|
|
575
|
+ SettingUrlType: data[0].SettingUrlType,
|
|
576
|
+ AppTitle: data[0].AppTitle,
|
|
577
|
+ FormId: data[0].FormId,
|
|
578
|
+ InstalledAppId: data[0].InstalledAppId,
|
|
579
|
+ RoleSettingAppId: data[0].RoleSettingAppId,
|
|
580
|
+ InstalledAppGuid: data[0].InstalledAppGuid,
|
|
581
|
+ AppConfigurationId: data[0].AppConfigurationId,
|
|
582
|
+ AppPermissionId: data[0].AppPermissionId,
|
|
583
|
+ AppConfigType: data[0].AppConfigType,
|
|
584
|
+ });
|
|
585
|
+ }
|
|
586
|
+ }
|
|
587
|
+ });
|
|
588
|
+ await appName.sort(function (a, b) {
|
|
589
|
+ var a1 = a.AppTitle.toLowerCase().trim(), b1 = b.AppTitle.toLowerCase().trim();
|
|
590
|
+ if (a1 == b1) return 0;
|
|
591
|
+ return a1 > b1 ? 1 : -1;
|
|
592
|
+ });
|
|
593
|
+ await createLoad(appName);
|
|
594
|
+ });
|
|
595
|
+ });
|
|
596
|
+ });
|
|
597
|
+ $('[data-buttontype="Starred"]').on("click", function () {
|
|
598
|
+ let count = 20;
|
|
599
|
+ if (
|
|
600
|
+ $('[data-buttontype="inbox"] .length').attr("data-taskscount") !=
|
|
601
|
+ undefined
|
|
602
|
+ ) {
|
|
603
|
+ count = $('[data-buttontype="inbox"] .length').attr("data-taskscount");
|
|
604
|
+ }
|
|
605
|
+ loadData(
|
|
606
|
+ `apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/1/PageSize/${count}`,
|
|
607
|
+ false
|
|
608
|
+ );
|
|
609
|
+ });
|
|
610
|
+
|
|
611
|
+ $('[data-buttontype="unstarred"]').on("click", function () {
|
|
612
|
+ let count = 20;
|
|
613
|
+ if (
|
|
614
|
+ $('[data-buttontype="inbox"] .length').attr("data-notificount") !=
|
|
615
|
+ undefined
|
|
616
|
+ ) {
|
|
617
|
+ count = $('[data-buttontype="inbox"] .length').attr("data-notificount");
|
|
618
|
+ }
|
|
619
|
+ loadData(
|
|
620
|
+ `apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/${count}`,
|
|
621
|
+ false
|
|
622
|
+ );
|
|
623
|
+ });
|
|
624
|
+ $('[data-buttontype="all"]').on("click", function () {
|
|
625
|
+ loadData(
|
|
626
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
627
|
+ false
|
|
628
|
+ );
|
|
629
|
+ });
|
|
630
|
+ $('[data-buttontype="read"]').on("click", function () {
|
|
631
|
+ $(".pdng.lst-Notifi").addClass("d-none");
|
|
632
|
+ $(".pdng.lst-Notifi[data-isreaded='2']").removeClass("d-none");
|
|
633
|
+ });
|
|
634
|
+ $('[data-buttontype="unread"]').on("click", function () {
|
|
635
|
+ $(".pdng.lst-Notifi").addClass("d-none");
|
|
636
|
+ $(".pdng.lst-Notifi[data-isreaded='8']").removeClass("d-none");
|
|
637
|
+ });
|
|
638
|
+ $('[data-buttontype="sent"]').on("click", function () {
|
|
639
|
+ loadData(
|
|
640
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
641
|
+ true
|
|
642
|
+ );
|
|
643
|
+ });
|
550
|
644
|
try {
|
551
|
|
- loadData();
|
|
645
|
+ loadData(
|
|
646
|
+ "apis/v4/unibase/reminders/platform/getuserreminders/PageSize/0",
|
|
647
|
+ false
|
|
648
|
+ );
|
552
|
649
|
} catch (error) {
|
553
|
650
|
console.log("LoadData Method is not loading, and getting error");
|
554
|
651
|
}
|
555
|
652
|
}
|
|
653
|
+
|
|
654
|
+export function stagesLoad() {
|
|
655
|
+ $(".stgs-li").each(function () {
|
|
656
|
+ let html = "";
|
|
657
|
+ let InstalledAppId = $(this).attr("data-installedappid");
|
|
658
|
+ getData(
|
|
659
|
+ `apis/v4/unibase/platform/apps/getallchangestageroles/installedappid/${InstalledAppId}`
|
|
660
|
+ ).then(function (stg_rslt) {
|
|
661
|
+ let data = JSON.parse(stg_rslt.result);
|
|
662
|
+ let _stage = data.filter(function (o) {
|
|
663
|
+ return o.IsDefault == true;
|
|
664
|
+ });
|
|
665
|
+ html += `<button type="button" class="btn btn-sm btn-info dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" data-isdefault="${_stage[0].IsDefault}" data-stageid="${_stage[0].StageId}" >
|
|
666
|
+ ${_stage[0].StageName}
|
|
667
|
+ </button>
|
|
668
|
+ <ul class="dropdown-menu">`;
|
|
669
|
+ for (var s = 0; s < data.length; s++) {
|
|
670
|
+ let stage = data[s];
|
|
671
|
+ if (!stage.IsDefault) {
|
|
672
|
+ html += `<li><a class="dropdown-item" href="javascript:;" data-isdefault="${stage.IsDefault}" data-stageid="${stage.StageId}">${stage.StageName}</a></li>`;
|
|
673
|
+ }
|
|
674
|
+ }
|
|
675
|
+ html += "</ul>";
|
|
676
|
+ $(`.stgs-li[data-installedappid='${InstalledAppId}']`).html(html);
|
|
677
|
+ });
|
|
678
|
+ });
|
|
679
|
+}
|