zet-lib 1.2.61 → 1.2.62
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/zAppRouter.js +1 -1
- package/lib/zRoleRouter.js +3 -2
- package/lib/zdataTable.js +8 -4
- package/package.json +1 -1
package/lib/zAppRouter.js
CHANGED
|
@@ -1360,7 +1360,7 @@ router.post('/zapproval-update/:table', async (req, res) => {
|
|
|
1360
1360
|
let approval_history = result.approval_history || []
|
|
1361
1361
|
if (approval_status == null) {
|
|
1362
1362
|
canUpdate = true
|
|
1363
|
-
} else if (approval_status ==
|
|
1363
|
+
} else if (approval_status == 22) {
|
|
1364
1364
|
canUpdate = true
|
|
1365
1365
|
} else {
|
|
1366
1366
|
if (+value > +approval_status) {
|
package/lib/zRoleRouter.js
CHANGED
|
@@ -209,11 +209,12 @@ router.post('/approval-access', async (req, res) => {
|
|
|
209
209
|
html += `<form id="approvalform">`
|
|
210
210
|
html += `<table class="table table-hover"><thead><tr><th>Name </th><th>Level <input type="checkbox" onclick="tabApprovals(this)" id="checkapprovals" /></th></tr></thead><tbody></tbody>`
|
|
211
211
|
results.map((item) => {
|
|
212
|
-
|
|
212
|
+
if (item.id != 1) {
|
|
213
|
+
html += `<tr>
|
|
213
214
|
<td>${item.name}</td>
|
|
214
215
|
<td><input type="checkbox" class="checkapproval" name="approval_${item.id}" ${checkedFn(myapprovalsRole, item.id)} /></td>
|
|
215
|
-
|
|
216
216
|
</tr>`
|
|
217
|
+
}
|
|
217
218
|
})
|
|
218
219
|
html += `</tbody></table>`
|
|
219
220
|
html += `</form>`
|
package/lib/zdataTable.js
CHANGED
|
@@ -194,17 +194,21 @@ class dataTable {
|
|
|
194
194
|
if (this.hasLevels) {
|
|
195
195
|
//modal-body-approval
|
|
196
196
|
let APPROVAL_LEVELS = myCache.get('APPROVAL_LEVELS')
|
|
197
|
+
console.log(APPROVAL_LEVELS)
|
|
197
198
|
let approvalButtonHtml = ``
|
|
198
199
|
for (let item in this.level_approval) {
|
|
200
|
+
console.log(item)
|
|
199
201
|
let imageapproval = 'brand-bunpo'
|
|
200
|
-
if (item ==
|
|
202
|
+
if (item == 22) {
|
|
201
203
|
imageapproval = 'rubber-stamp-off'
|
|
202
|
-
} else if (item ==
|
|
204
|
+
} else if (item == 2) {
|
|
203
205
|
imageapproval = 'list-check'
|
|
204
|
-
} else if (item ==
|
|
206
|
+
} else if (item == 21) {
|
|
205
207
|
imageapproval = 'rubber-stamp'
|
|
206
208
|
}
|
|
207
|
-
|
|
209
|
+
let name = APPROVAL_LEVELS.hasOwnProperty(item) ? APPROVAL_LEVELS[item].name : ''
|
|
210
|
+
let color = APPROVAL_LEVELS.hasOwnProperty(item) ? APPROVAL_LEVELS[item].color : ''
|
|
211
|
+
approvalButtonHtml += ` <button title="${name}" data-value="${item}" style="background-color: ${color}; color:white" class="btn btn-approval-levels boxy-small dimens2x image-button mb-3" type="button"><img src="/assets/icons/${imageapproval}.svg" class="icons-bg-white"> ${name}</button> `
|
|
208
212
|
}
|
|
209
213
|
approvalButtonHtml += `<div class="row"><div class="col-md-10"><textarea class="form-control boxy purple-border" id="zapproval_message" placeholder="tulis alasan..." rows="2"></textarea></div><div class="col-md-1"></div></div>`
|
|
210
214
|
|