zet-lib 1.5.20 → 1.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/zRoute.js +20 -19
- package/package.json +1 -1
package/lib/zRoute.js
CHANGED
|
@@ -1447,7 +1447,7 @@ zRoute.resetPassword = async (req, res) => {
|
|
|
1447
1447
|
zRoute.loginAuth = async (username, fields) => {
|
|
1448
1448
|
let results = await connection.results({
|
|
1449
1449
|
table: "zuser",
|
|
1450
|
-
where: {
|
|
1450
|
+
where: { email: username },
|
|
1451
1451
|
});
|
|
1452
1452
|
if (results.length) {
|
|
1453
1453
|
await connection.update({
|
|
@@ -5548,43 +5548,43 @@ zRoute.approversFooter = async (results, noActivity) => {
|
|
|
5548
5548
|
const MYMODELS = myCache.get("MYMODELS");
|
|
5549
5549
|
let MYMODEL = MYMODELS.zapprovals_details;
|
|
5550
5550
|
let users = Util.arrayToObject(
|
|
5551
|
-
|
|
5552
|
-
|
|
5551
|
+
await connection.results({ table: "zuser" }),
|
|
5552
|
+
"id"
|
|
5553
5553
|
);
|
|
5554
5554
|
let html = "";
|
|
5555
5555
|
let id = 0;
|
|
5556
|
-
let knowings = []
|
|
5557
|
-
|
|
5556
|
+
let knowings = [];
|
|
5557
|
+
let approvals = [];
|
|
5558
5558
|
results.forEach(function (result) {
|
|
5559
5559
|
if (result.type == 2) {
|
|
5560
5560
|
let html = "";
|
|
5561
5561
|
html += `<span class="status-approver">${
|
|
5562
|
-
|
|
5562
|
+
MYMODEL.widgets.status.fields[result.status]
|
|
5563
5563
|
}</span>`;
|
|
5564
5564
|
html += `<p > <span style="text-decoration: underline;">${
|
|
5565
|
-
|
|
5565
|
+
users[result.user_id].fullname
|
|
5566
5566
|
}</span><span class="small-time"> ${
|
|
5567
|
-
|
|
5567
|
+
users[result.user_id].position ? users[result.user_id].position : ''
|
|
5568
5568
|
}</span></p>`;
|
|
5569
5569
|
knowings.push(html);
|
|
5570
5570
|
}
|
|
5571
5571
|
if (result.type == 1) {
|
|
5572
5572
|
let html = "";
|
|
5573
5573
|
let sign =
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5574
|
+
users[result.user_id].verify_signed && result.status == 3
|
|
5575
|
+
? `<img src="${process.env.APP_URL}/uploads/zuser/${
|
|
5576
|
+
users[result.user_id].verify_signed
|
|
5577
|
+
}" width="200">`
|
|
5578
|
+
: MYMODEL.widgets.status.fields[result.status];
|
|
5579
5579
|
//var sign = "";
|
|
5580
5580
|
html += `<span class="status-approver">${sign}</span>`;
|
|
5581
5581
|
html += `<p class="footer-title"> <span style="text-decoration: underline;">${
|
|
5582
|
-
|
|
5582
|
+
users[result.user_id].fullname
|
|
5583
5583
|
}</span><span class="small-time"> ${
|
|
5584
|
-
|
|
5584
|
+
users[result.user_id].position ? users[result.user_id].position : ''
|
|
5585
5585
|
} <br> ${Util.dateFormat(
|
|
5586
|
-
|
|
5587
|
-
|
|
5586
|
+
result.updated_at,
|
|
5587
|
+
"DD MMM YYYY HH:mm"
|
|
5588
5588
|
)}</span></p>
|
|
5589
5589
|
`;
|
|
5590
5590
|
approvals.push(html);
|
|
@@ -5611,7 +5611,7 @@ zRoute.approversFooter = async (results, noActivity) => {
|
|
|
5611
5611
|
return div;
|
|
5612
5612
|
};
|
|
5613
5613
|
|
|
5614
|
-
html += `<div class="row"><div class="col-12 text-center "><h5 class="knowing">
|
|
5614
|
+
html += `<div class="row"><div class="col-12 text-center "><h5 class="knowing">Approve</h5></div></div>`;
|
|
5615
5615
|
html += `<div class="row d-flex justify-content-start align-items-end">`;
|
|
5616
5616
|
let divClass = divColumn(approvals.length);
|
|
5617
5617
|
approvals.forEach(function (item) {
|
|
@@ -5623,7 +5623,7 @@ zRoute.approversFooter = async (results, noActivity) => {
|
|
|
5623
5623
|
|
|
5624
5624
|
const knowingDiv = divColumn(knowings.length);
|
|
5625
5625
|
if (knowings.length) {
|
|
5626
|
-
html += `<div class="row align-items-end"><div class="col-12 text-center mt-5"><h5 class="knowing">
|
|
5626
|
+
html += `<div class="row align-items-end"><div class="col-12 text-center mt-5"><h5 class="knowing">Acknowledge</h5></div></div>`;
|
|
5627
5627
|
html += `<div class="row">`;
|
|
5628
5628
|
knowings.forEach(function (item) {
|
|
5629
5629
|
html += `<div class="${knowingDiv}">`;
|
|
@@ -5635,6 +5635,7 @@ zRoute.approversFooter = async (results, noActivity) => {
|
|
|
5635
5635
|
return html;
|
|
5636
5636
|
};
|
|
5637
5637
|
|
|
5638
|
+
|
|
5638
5639
|
/*
|
|
5639
5640
|
cache models in so it's no need call database repeatly
|
|
5640
5641
|
*/
|