notification page

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 7 years ago
commit 8b5436ced6

@ -1383,6 +1383,11 @@
"integrity": "sha512-nsqTN6zUcm9xtdJiM9OvOJ5EF0kOI8f1Zuug27O/rgtxCRJHGqncSWfCMZUP852dCKPsDsYXGvBhxfRjDBkF5Q==",
"dev": true
},
"@types/pdfjs-dist": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@types/pdfjs-dist/-/pdfjs-dist-2.0.0.tgz",
"integrity": "sha512-WVPCCHE7a51qBxSdjC3f2q3+h00awOidrsSSnCmHXERMHelO6dpj1tgFiDx2a7qUuQ105u9iKo62aucvmkZ4GA=="
},
"@types/q": {
"version": "0.0.32",
"resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz",
@ -1647,6 +1652,15 @@
"integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==",
"dev": true
},
"adler-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
"integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"adm-zip": {
"version": "0.4.13",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.13.tgz",
@ -1681,7 +1695,6 @@
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.1.tgz",
"integrity": "sha512-XDN92U311aINL77ieWHmqCcNlwjoP5cHXDxIxbf2MaPYuCXOHS7gHH8jktxeK5omgd52XbSTX6a4Piwd1pQmzA==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
@ -1698,8 +1711,7 @@
"ajv-keywords": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz",
"integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw==",
"dev": true
"integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw=="
},
"amdefine": {
"version": "1.0.1",
@ -2277,8 +2289,7 @@
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
},
"binary-extensions": {
"version": "1.13.1",
@ -2709,6 +2720,17 @@
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"dev": true
},
"cfb": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.1.1.tgz",
"integrity": "sha512-eov9L63s9/uMiiDvWCiTYbK3AcM5x5AYo4NL1q75G0AZBrD2X0+Lm9hubk94qy1MJP7pYFuM6/xn0h3grAvBXQ==",
"requires": {
"adler-32": "~1.2.0",
"commander": "^2.16.0",
"crc-32": "~1.2.0",
"printj": "~1.1.2"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
@ -2946,6 +2968,22 @@
}
}
},
"codepage": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
"integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
"requires": {
"commander": "~2.14.1",
"exit-on-epipe": "~1.0.1"
},
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw=="
}
}
},
"collection-visit": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
@ -4116,6 +4154,15 @@
}
}
},
"crc-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
"integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==",
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"create-ecdh": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@ -4948,8 +4995,7 @@
"emojis-list": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
"integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
"dev": true
"integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k="
},
"encodeurl": {
"version": "1.0.2",
@ -5255,6 +5301,11 @@
"integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
"dev": true
},
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw=="
},
"expand-brackets": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
@ -5454,14 +5505,12 @@
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
"dev": true
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
},
"fastparse": {
"version": "1.1.2",
@ -5651,6 +5700,11 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true
},
"frac": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@ -7704,8 +7758,7 @@
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"json-stringify-safe": {
"version": "5.0.1",
@ -7723,7 +7776,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
@ -7968,7 +8020,6 @@
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz",
"integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^2.0.0",
@ -8594,12 +8645,32 @@
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
"dev": true
},
"ng2-file-upload": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/ng2-file-upload/-/ng2-file-upload-1.3.0.tgz",
"integrity": "sha512-Pudxik6LWYsT8hNiEW7RfjgGWAnvfQywxwJYMdt1snTUe+KnlRc/QqPv3QEQW6plXTanuLkYz/TbqilSfSHOsw=="
},
"ng2-pdf-viewer": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/ng2-pdf-viewer/-/ng2-pdf-viewer-5.3.2.tgz",
"integrity": "sha512-lGen4owSxBdgxtq9Ge5+K5QMkqg3qj/IWuAKrnwIbkvQL2n0uLV0x0r23/mIxxQbI+ITi8wslEzyf9kp6TzvUQ==",
"requires": {
"@types/pdfjs-dist": "^2.0.0",
"pdfjs-dist": "^2.1.266",
"tslib": "^1.9.0"
}
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"node-ensure": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/node-ensure/-/node-ensure-0.0.0.tgz",
"integrity": "sha1-7K52QVDemYYexcgQ/V0Jaxg5Mqc="
},
"node-fetch-npm": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz",
@ -9416,6 +9487,15 @@
"sha.js": "^2.4.8"
}
},
"pdfjs-dist": {
"version": "2.1.266",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.1.266.tgz",
"integrity": "sha512-Jy7o1wE3NezPxozexSbq4ltuLT0Z21ew/qrEiAEeUZzHxMHGk4DUV1D7RuCXg5vJDvHmjX1YssN+we9QfRRgXQ==",
"requires": {
"node-ensure": "^0.0.0",
"worker-loader": "^2.0.0"
}
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@ -9595,6 +9675,11 @@
"resolved": "https://registry.npmjs.org/primeng/-/primeng-7.1.3.tgz",
"integrity": "sha512-t+DC5VtTJBCz4fPa3wMspByhtdQYgyLEIMWok2kH1J/a/2bTXSYM31ueHKjgV8XuUaeDwMzARLTQv+V9HczIEQ=="
},
"printj": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ=="
},
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@ -9827,8 +9912,7 @@
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
},
"q": {
"version": "1.4.1",
@ -11160,6 +11244,14 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
"ssf": {
"version": "0.10.2",
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.2.tgz",
"integrity": "sha512-rDhAPm9WyIsY8eZEKyE8Qsotb3j/wBdvMWBUsOhJdfhKGLfQidRjiBUV0y/MkyCLiXQ38FG6LWW/VYUtqlIDZQ==",
"requires": {
"frac": "~1.1.2"
}
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@ -12057,7 +12149,6 @@
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"dev": true,
"requires": {
"punycode": "^2.1.0"
}
@ -12727,6 +12818,26 @@
"errno": "~0.1.7"
}
},
"worker-loader": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-2.0.0.tgz",
"integrity": "sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==",
"requires": {
"loader-utils": "^1.0.0",
"schema-utils": "^0.4.0"
},
"dependencies": {
"schema-utils": {
"version": "0.4.7",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz",
"integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==",
"requires": {
"ajv": "^6.1.0",
"ajv-keywords": "^3.1.0"
}
}
}
},
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
@ -12751,6 +12862,27 @@
"uuid": "^3.3.2"
}
},
"xlsx": {
"version": "0.14.3",
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.14.3.tgz",
"integrity": "sha512-wgt9zGKeFp4WIQdPx+j2sNNbDYRbJ+M+uuFcS16pf2yLo/aKcG3RaD4xmS/LHT5rznc6V27NRwIXNWmxLj6eZw==",
"requires": {
"adler-32": "~1.2.0",
"cfb": "^1.1.0",
"codepage": "~1.14.0",
"commander": "~2.17.1",
"crc-32": "~1.2.0",
"exit-on-epipe": "~1.0.1",
"ssf": "~0.10.2"
},
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg=="
}
}
},
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",

@ -93,6 +93,8 @@
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"mx.ferreyra.callnumber": "0.0.2",
"ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2",
"phonegap-plugin-barcodescanner": "^8.1.0",
"phonegap-plugin-multidex": "^1.0.0",
"phonegap-plugin-push": "2.2.3",
@ -101,6 +103,7 @@
"run": "1.4.0",
"rxjs": "~6.3.3",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2",
"xlsx": "^0.14.3",
"zone.js": "~0.8.29"
},
"devDependencies": {

@ -0,0 +1,51 @@
<ion-header >
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('addAttach','title')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('addAttach','title')}}</div>
<div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader" (change)="onFileSelected($event)" />
<label end for="file"><ion-icon name="add"></ion-icon></label></div>
</ion-card-header>
<ion-card-content>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-row class="rowAH titleH">
<ion-col size="4">
<label class="Header" for=""> {{ts.trPK('addAttach','name')}}</label>
</ion-col>
<ion-col size="4">
<label class="Header" for="">{{ts.trPK('addAttach','size')}} </label>
</ion-col>
<ion-col size="4">
<label class="Header" for=""> {{ts.trPK('addAttach','remove')}} </label>
</ion-col>
</ion-row>
<ion-row class="rowAH" *ngFor="let item of uploader.queue">
<ion-col size="4">
<label for="">{{ item?.file?.name }}</label>
</ion-col>
<ion-col size="4">
<label *ngIf="uploader.options.isHTML5">{{ item?.file?.size/1024/1024 | number:'.2' }} MB</label>
</ion-col>
<ion-col size="4">
<button class="iconButton" ion-button (click)="removeFile(item)"> <img class="imgSize"
src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" (click)="OkBtnModal()">{{ts.trPK('general','ok')}} </ion-button>
</div>
</ion-footer>

@ -0,0 +1,103 @@
.col {
//border: #dedede solid 1px;
padding: 2px !important;
text-align: center;
font-size: 15px;
}
.item-md.item-block .item-inner,
.item-ios.item-block .item-inner {
padding: 0px !important;
}
.iconButton .imgSize{
width:22px !important;
}
.itemAH {
padding: 0px !important;
font-size: 13px;
}
.gridAH {
text-align: center;
padding: 5px 5px !important;
border-radius: 5px;
}
.rowAH {
white-space: normal;
.col {
border: 1px solid var(--cusgray);
label {
font-size: 14px;
}
}
}
.Header {
font-weight: bold;
color: var(--customnavy);
font-size: 14px;
}
.titleH {
font-size: 15px;
border: 1px solid var(--cusgray);
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-bottom: 0px;
.col {
border: 0px;
}
}
ion-label.label.label-md,
ion-label.label.label-ios {
margin: 0px;
}
.fileDiv .inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
width: 40px;
height: 40px;
top: 0;
z-index: 100;
// z-index: -1;
}
.inputfile+label {
display: inline-block;
color: var(--light);
}
.fileDiv {
padding: 10px;
position: absolute;
right:0;
top:0;
:root[dir="ltr"] {
float: right;
}
:root[dir="rtl"] {
float: left;
}
}
ion-icon{
font-size: 28px;
}
button.iconButton.button.button-ios.button-default.button-default-ios,
button.iconButton.button.button-md.button-default.button-default-md {
padding: 0px;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AbsenceAttachmentComponent } from './absence-attachment.component';
describe('AbsenceAttachmentComponent', () => {
let component: AbsenceAttachmentComponent;
let fixture: ComponentFixture<AbsenceAttachmentComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AbsenceAttachmentComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AbsenceAttachmentComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,168 @@
import { Component, EventEmitter, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { FileUploader } from "ng2-file-upload";
import { AddAttachService } from "../service/add-attach-service";
import { AddEitResponse } from "src/app/eit/models/add.eit.response";
import { ModalController } from '@ionic/angular';
/**
* Generated class for the AddAttachPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@Component({
selector: "absence-attachment",
templateUrl: "absence-attachment.component.html",
styleUrls: ["./absence-attachment.component.scss"]
})
export class AbsenceAttachmentComponent implements OnInit {
private eitResponse: any; //AddEitResponse=new AddEitResponse();
isUpload: boolean = false;
inQueue: boolean = false;
addAttachmentListReq: any;
attachmentID: number = 0;
addAttachRequest: any = [];
fileData: any;
fileType: any;
index: any = 1;
dirPage: any;
TransactionID: any;
indexLastObj: any;
filterAllowedType: any = [
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
];
constructor(
public common: CommonService,
public AddAttachService: AddAttachService,
public modalCtrl: ModalController,
public ts: TranslatorService
) {
this.eitResponse = this.common.sharedService.getSharedData(
AddEitResponse.SHARED_DATA,
true
);
// this.TransactionID = this.navParams.get("TransactionID");
// this.indexLastObj = this.navParams.get("indexLastObj");
// console.log("this.TransactionID : "+ this.TransactionID);
this.isUpload = false;
}
public uploader: FileUploader = new FileUploader({
allowedMimeType: [
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async item => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
public hasBaseDropZoneOver: boolean = false;
public hasAnotherDropZoneOver: boolean = false;
ngOnInit() {}
public fileOverBase(e: any): void {
this.hasBaseDropZoneOver = e;
}
public fileOverAnother(e: any): void {
this.hasAnotherDropZoneOver = e;
}
OkBtnModal() {
let fileCount: number = this.uploader.queue.length;
if (fileCount > 0) {
let data: any = this.addAttachRequest;
this.modalCtrl.dismiss(data);
}
else {
let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.common.presentAlert(msg);
return;
}
} // end ok button
closeBtnModal() {
// this.viewCtrl.dismiss("cancel");
}
onFileSelected(input) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.common.presentAlert(msg);
return;
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
// console.log(file);
this.getBase64(file).then(data =>
this.pushObject(data, file.name, file.type)
);
}
}
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
// console.log("before push: "+ this.index);
this.indexLastObj++;
try {
let array = name.split(".");
let attachType: string = array[array.length - 1];
this.addAttachRequest.push({
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0],
P_TRANSACTION_ID: this.TransactionID
});
} catch (e) {}
}
removeFile(objectitem) {
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
this.uploader.queue.splice(objIndex1, 1);
let objIndex = this.addAttachRequest.findIndex(
item => item.AttachmentID == objectitem.AttachmentID
);
this.addAttachRequest.splice(objIndex, 1);
}
}

@ -3,7 +3,7 @@
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('submitAbsenceConfirm','submitAbsenceConfirm')}}</ion-title>
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref=""></ion-back-button>
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
@ -15,41 +15,41 @@
<ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('confirmAddEit','approverList')}}</div>
</ion-card-header>
<ion-card-content>
<ion-card-content class="confirm-details">
<ion-grid class=" gridAH" *ngIf="approversList?.length > 0">
<ion-row class="rowAH titleH">
<ion-col col-1>
<ion-col size="1" >
<label class="Header" for="">{{ts.trPK('confirmAddEit','no')}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label class="Header" for="">{{ts.trPK('confirmAddEit','approver')}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label class="Header" for="">{{ts.trPK('confirmAddEit','approverCategory')}} </label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label class="Header" for="">{{ts.trPK('confirmAddEit','approverType')}}</label>
</ion-col>
<ion-col col-2>
<ion-col size="2">
<label class="Header" for="">{{ts.trPK('confirmAddEit','status')}}</label>
</ion-col>
</ion-row>
<ion-row class="rowAH" *ngFor="let item of approversList">
<ion-col col-1>
<ion-col size="1">
<label for="">{{item.APPROVER_ORDER_NUMBER}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label for="">{{item.APPROVER}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label for="">{{item.APPROVER_CATEGORY}}</label>
</ion-col>
<ion-col col-3>
<ion-col size="3">
<label for="">{{item.APPROVER_TYPE}}</label>
</ion-col>
<ion-col col-2>
<ion-col size="2">
<label for="">{{item.APPROVAL_STATUS}}</label>
</ion-col>
</ion-row>
@ -69,23 +69,23 @@
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{ts.trPK('confirmAddEit','attachList')}}</div>
<button ion-button (click)="addAttachment(true,-1)">
<img class="imgSize" src="../assets/imgs/attachment.png"></button>
<div class="hrTitle">{{ts.trPK('absenceList','attachList')}}</div>
<img class="imgSize" src="../assets/imgs/attachment.png" (click)="addAttachment(true,-1)">
</ion-card-header>
<ion-card-content>
<ion-card-content >
<ion-grid *ngIf="attachListOver?.length > 0">
<div *ngFor="let attachList of attachListOver ; let i = index">
<ion-row>
<ion-col col-8>
<ion-col size="8">
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachList.P_FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<ion-col size="4">
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
@ -101,14 +101,14 @@
<ion-grid *ngIf="attachmentRes?.length > 0">
<div *ngFor="let attachRes of attachmentRes">
<ion-row>
<ion-col col-8>
<ion-col size="8">
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachRes.FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<ion-col size="4">
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">

@ -0,0 +1,31 @@
.imgSize{
position: absolute;
right: 15px;
top: 0;
bottom: 0;
margin: auto;
height:20px;
width:20px;
}
.rowAH ion-col {
border: 1px solid #d9d9d9;
font-size: 13px;
}
.titleH {
font-size: 13px;
border: 1px solid #d9d9d9;
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-bottom: 0px;
}
.gridAH {
text-align: center;
padding: 5px 5px !important;
border-radius: 5px;
}
ion-card-content.confirm-details{
padding: 0;
}
.confirm-details label{
font-size: 13px;
}

@ -1,19 +1,327 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { ApproversList } from '../models/approvers';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { WorkListButtonRequest } from 'src/app/eit/models/NotificationButtonReq';
import { ModalController } from '@ionic/angular';
import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
import { AbsenceResponse } from '../models/absence.response';
import { SubmitAbConfirmService } from '../service/submit-absence-confirm.service';
import { WorklistAttachService } from '../service/work-list-attach.service';
import { ConfirmAddEitService } from '../service/confirm-add-eit-service';
import { AbsenceNotificatonBodyResponse } from '../models/AbsenceNotificationBodyRes';
import { AbsenceAttachmentComponent } from '../absence-attachment/absence-attachment.component';
import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
@Component({
selector: 'app-absence-confirm',
templateUrl: './absence-confirm.component.html',
styleUrls: ['./absence-confirm.component.scss'],
selector: "app-absence-confirm",
templateUrl: "./absence-confirm.component.html",
styleUrls: ["./absence-confirm.component.scss"]
})
export class AbsenceConfirmComponent implements OnInit {
P_TransactionID: number;
approversList: ApproversList;
selEmp: string = "";
respID: number;
absComments: string = "";
selMenu: MenuResponse;
attachItems: any;
attachListDisplay: any;
isTrue: any = 0;
getPassNotificationDetails: any;
menuType: string = "";
attachmentRes: any;
objIndex1: any;
attachListOver: any = [];
index: any = 0;
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
private isResubmitAbs: boolean = false;
private isSubmitBtnClicked: boolean;
constructor(
public common: CommonService,
public ts: TranslatorService,
public modalCtrl: ModalController,
public ConfirmAddEitService: ConfirmAddEitService,
public submitConService: SubmitAbConfirmService,
public WorklistAttachService: WorklistAttachService
) {
this.isSubmitBtnClicked = false;
) { }
// this.isResubmitAbs = this.navParams.get("isResubmit");
if (this.isResubmitAbs) {
this.P_TransactionID = this.common.sharedService.getSharedData(
AbsenceResponse.SHARED_DATA
);
this.getPassNotificationDetails =this.common.sharedService.getSharedData(
AbsenceNotificatonBodyResponse.NOT_WORKLIST,
true
);
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.menuType = "E";
this.respID = -999;
// this.getApproversList();
// console.log("this.getPassNotificationDetails.P_NOTIFICATION_ID :"+this.getPassNotificationDetails.NOTIFICATION_ID);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
} else {
this.selMenu = this.common.sharedService.getSharedData(
MenuResponse.SHARED_DATA,
true
);
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
true
);
this.respID = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_RESP_ID,
true
);
this.P_TransactionID = this.common.sharedService.getSharedData(
AbsenceResponse.SHARED_DATA
);
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
}
this.getApproversList();
}
ngOnInit() {}
startAbApproval() {
if (this.attachListOver) {
//first call add attach inside success call submit
let request = {
AddAttachmentList: this.attachListOver
};
this.ConfirmAddEitService.addAttachment(request).subscribe(
(result: any) => {
this.handleAddAttachmentResults(result);
}
);
} else {
this.startAbsApprovalProcess();
}
} //end
handleAddAttachmentResults(result) {
if (this.common.validResponse(result)) {
//this.isUpload=true;
this.isTrue = 0;
for (let i = 0; i < result.AddAttSuccessList.length; i++) {
if (!result.AddAttSuccessList[i].AddSuccess) {
this.attachListOver[i].isSuccess = false;
// if false display cancel button with waring icon or design
} // end if
else {
// if true remove cancel and set isSuccess = true
this.attachListOver[i].isSuccess = true;
this.isTrue = this.isTrue + 1; //count flag of attach status
} // end else
} // end for
if (this.isTrue == result.AddAttSuccessList.length) {
this.startAbsApprovalProcess();
} else {
//stope
let filtered = this.attachListOver.filter(function(el) {
return el.isSuccess == true;
});
this.attachListOver = filtered;
let msg: string = "";
// msg = this.translate.translate("addAttach.errorMsg");
//this.common.showAlert(msg);
}
}
}
startAbsApprovalProcess() {
let request: any = {};
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
request.P_MENU_TYPE = this.menuType;
request.P_SELECTED_RESP_ID = this.respID;
request.P_TRANSACTION_ID = this.P_TransactionID;
request.P_COMMENTS = this.absComments;
this.submitConService
.startAbApprovalProcess(request)
.subscribe((result: any) => {
this.handleResults(result);
});
}
cancelAbProcess() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID
};
this.submitConService.cancelHRTransaction(body).subscribe((result: any) => {
this.handleCancelResults(result);
});
}
handleCancelResults(result) {
if (this.common.validResponse(result)) {
this.isSubmitBtnClicked = false;
// this.navCtrl.popToRoot();
}
}
handleResults(result) {
if (this.common.validResponse(result)) {
this.isSubmitBtnClicked = true;
//if(this.isResubmitAbs==false){
let msg: string = this.ts.trPK("general", "messageSuccess");
this.common.presentAlert(msg);
// }
// this.navCtrl.popToRoot();
this.common.openNotificationPage();
}
}
getApproversList() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID,
P_AME_TRANSACTION_TYPE: "SSHRMS",
P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1000
};
this.submitConService.getApproversList(body).subscribe((result: any) => {
this.handleApproversResult(result);
});
}
handleApproversResult(result) {
if (this.common.validResponse(result)) {
this.approversList = result.GetApprovesList;
}
}
async addAttachment(str: boolean, attachItems: any) {
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID;
// var modalPage = this.modalCtrl.create("AddAttachPage", {
// indexLastObj: this.attachListOver.length,
// TransactionID: this.P_TransactionID,
// enableBackdropDismiss: false
// });
const modal = await this.modalCtrl.create({
component: AbsenceAttachmentComponent,
componentProps:{ indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID},
keyboardClose: true,
animated: false
});
modal.onDidDismiss()
.then((data) => {
if (data == "cancel" || data == "undefined") {
return;
} else {
if (!str) {
this.updateFile(data, attachDocID);
} else {
this.attachListDisplay = data.data;
this.attachItems = this.attachListDisplay.map(function (el) {
var o = Object.assign({}, el);
o.isSuccess = false;
return o;
});
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
}
}
});
return await modal.present();
}
removeFile(objectitem) {
if (this.attachListOver) {
let index2 = this.attachListOver.findIndex(item => item == objectitem);
if (index2 > -1) {
this.attachListOver.splice(index2, 1);
}
}
if (this.attachmentRes) {
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
if (index3 > -1) {
this.attachmentRes.splice(index3, 1);
}
}
}
getAttachment(NotificationID) {
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
this.WorklistAttachService.getAttach(this.attachReqObj).subscribe(
(result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
}
);
}
handleWorkListAttachResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetAttachementList != null) {
this.attachmentRes = result.GetAttachementList;
} // if result == null
} // valid it
}
async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent
});
modal.onDidDismiss()
.then((data) => {
});
return await modal.present();
}
updateFile(attachList, attachDocID) {
let req = {
P_ATTACHED_DOCUMENT_ID: attachDocID,
P_FILE_DATA: attachList[0].P_FILE_DATA,
P_FILE_NAME: attachList[0].P_FILE_NAME,
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
};
this.submitConService.updateAttach(req).subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) {
let msg: string = "";
// msg = this.translate.translate("addAttach.attachUpdate");
// this.common.showAlert(msg);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
}
} // val
});
}
delelteFile(attach) {
// let alert = this.common.showConfirmMsg(
// this.translate.translate("general.deletePerm")
// );
// alert.onDidDismiss(data => {
// if (data == true) {
// this.continueDelete(attach);
// }
// });
}
continueDelete(attach) {
let req = {
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
};
this.submitConService.delteAttach(req).subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
// let msg: string = "";
// msg = this.translate.translate("addAttach.deleteAttach");
// this.common.showAlert(msg);
}
}
});
}
ionViewWillLeave() {
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
this.cancelAbProcess();
}
}

@ -1,38 +1,57 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";
import { Routes, RouterModule } from "@angular/router";
import { AbsenceListService } from "./service/service.service";
import { IonicModule } from '@ionic/angular';
import { SubmitAbsenceService } from './service/submit.absence.service';
import { AbsencePage } from './absence.page';
import { DatePicker } from '@ionic-native/date-picker/ngx';
import { HomeComponent } from './home/home.component';
import { SubmitAbsenceComponent } from './submit-absence/submit-absence.component';
import { replacmentListService } from './service/replacement-list.service';
import { HmgCommonModule } from './../hmg-common/hmg-common.module';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { AbsenceConfirmComponent } from './absence-confirm/absence-confirm.component';
import { IonicModule } from "@ionic/angular";
import { SubmitAbsenceService } from "./service/submit.absence.service";
import { AbsencePage } from "./absence.page";
import { DatePicker } from "@ionic-native/date-picker/ngx";
import { HomeComponent } from "./home/home.component";
import { SubmitAbsenceComponent } from "./submit-absence/submit-absence.component";
import { replacmentListService } from "./service/replacement-list.service";
import { HmgCommonModule } from "./../hmg-common/hmg-common.module";
import { ReplacementListComponent } from "../vacation-rule/replacement-list/replacement-list.component";
import { AbsenceConfirmComponent } from "./absence-confirm/absence-confirm.component";
import { ConfirmAddEitService } from "./service/confirm-add-eit-service";
import { SubmitAbConfirmService } from "./service/submit-absence-confirm.service";
import { WorklistAttachService } from "./service/work-list-attach.service";
import { AbsenceAttachmentComponent } from "./absence-attachment/absence-attachment.component";
import { AddAttachService } from "./service/add-attach-service";
import { WorkListAttachViewComponent } from "src/app/notification/work-list-attach-view/work-list-attach-view.component";
import { ViewAttachmentsComponent } from './view-attachments/view-attachments.component';
const routes: Routes = [
{
path: '',
path: "",
component: AbsencePage,
children: [
{
path: 'home',
path: "home",
component: HomeComponent
},
{
path: 'submit-absence',
path: "submit-absence",
component: SubmitAbsenceComponent
},
{
path: 'replacement-list',
path: "replacement-list",
component: ReplacementListComponent
},
{
path:'confirm-absence',
component:AbsenceConfirmComponent
path: "confirm-absence",
component: AbsenceConfirmComponent
},
{
path: "absence-attachment",
component: AbsenceAttachmentComponent
},
{
path: "worklist-attachment",
component: WorkListAttachViewComponent
},
{
path:'view-attachements',
component:ViewAttachmentsComponent
}
]
}
@ -46,7 +65,23 @@ const routes: Routes = [
HmgCommonModule,
RouterModule.forChild(routes)
],
providers:[AbsenceListService, SubmitAbsenceService, replacmentListService, DatePicker],
declarations: [AbsencePage, HomeComponent, SubmitAbsenceComponent,AbsenceConfirmComponent]
providers: [
AbsenceListService,
SubmitAbsenceService,
replacmentListService,
WorklistAttachService,
SubmitAbConfirmService,
DatePicker,
ConfirmAddEitService,
AddAttachService
],
declarations: [
AbsencePage,
HomeComponent,
SubmitAbsenceComponent,
AbsenceConfirmComponent,
AbsenceAttachmentComponent,
ViewAttachmentsComponent
]
})
export class AbsencePageModule {}

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar">
<ion-title color="light">{{ts.trPK('absenceList','absenceList')}}</ion-title>
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref=""></ion-back-button>
<nav-buttons></nav-buttons>
</ion-buttons>
<ion-buttons slot="end">
<button class="headerBtn" (click)="AccrualBalances()">
@ -29,8 +29,8 @@
<ion-card-header class="boxHdr">
<div class="hrTitle">{{ts.trPK('absenceList','absHeader')}}</div>
<button ion-button *ngIf="item.ATTACHMENT_EXIST=='Y'" (click)="AttachmentDocuments(item.ABSENCE_ATTENDANCE_ID)">
<img class="imgSize" src="../assets/imgs/attachment.png"></button>
<img class="imgSize" src="../assets/imgs/attachment.png" *ngIf="item.ATTACHMENT_EXIST=='Y'" (click)="AttachmentDocuments(item.ABSENCE_ATTENDANCE_ID)">
</ion-card-header>
<ion-card-content>
<ion-grid>

@ -0,0 +1,9 @@
.imgSize{
position: absolute;
right: 15px;
top: 0;
bottom: 0;
margin: auto;
height:20px;
width:20px;
}

@ -67,11 +67,12 @@ export class HomeComponent implements OnInit {
result.GetAbsenceAttachmentsList,
AbsenceAttahcmentResponse.SHARED_DATA
);
this.common.openviewAbsenceAttachment();
// this.navCtrl.push("AbsenceAttachmentPage");
} else {
let msg: string = "";
// msg=this.translate.translate("general.notAttch");
// this.common.showAlert(msg);
msg = this.ts.trPK("general", "noFileSelect");
this.common.presentAlert(msg);
}
//this.GetAbsenceTransactionList =result.GetAbsenceTransactionList;
}

@ -0,0 +1,17 @@
export class AbsenceNotificationBodyItems {
public TRANSACTION_NUMBER :number;
public DESC_FLEX_NAME : string;
public ACTION : string;
public DESC_FLEX_CONTEXT_COD : string;
public APPLICATION_COLUMN_NAME : string;
public SEGMENT_SEQ_NUM :number;
public DATATYPE : string;
public SEGMENT_NAME : string;
public VARCHAR2_VALUE : string;
public SEGMENT_PROMPT : string;
public NUMBER_VALUE :number;
public SEGMENT_VALUE_DSP : string;
public DATE_VALUE : string ;
public PREV_SEGMENT_VALUE_DSP : string;
public DISPLAY_FLAG : string ;
}

@ -0,0 +1,8 @@
import { Response } from './response';
import { AbsenceNotificationBodyItems } from './AbsenceNotificationBodtItems';
export class AbsenceNotificatonBodyResponse extends Response {
public static SHARED_DATA = 'Abs_Notif_BODY_List';
public static NOT_WORKLIST = 'Abs_Notif_WORK_LIST';
public AbsenceNotificationBodyItems: AbsenceNotificationBodyItems [];
}

@ -0,0 +1,27 @@
import { Injectable } from "@angular/core";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
import { Observable } from "rxjs";
@Injectable()
export class AddAttachService {
public static addAttachment = "Services/ERP.svc/REST/ADD_ATTACHMENT";
constructor(
public api: ConnectorService,
public authService: AuthenticationService
) {}
public addAttachment(
addAttachrequest: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = addAttachrequest;
this.authService.authenticateRequest(request);
return this.api.post(
AddAttachService.addAttachment,
request,
onError,
errorLabel
);
}
}

@ -0,0 +1,58 @@
import { Injectable } from "@angular/core";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
import { Observable } from "rxjs";
// import {AddEitResponse} from '../models/add.eit.response'
@Injectable()
export class ConfirmAddEitService {
public static addAttachment = "Services/ERP.svc/REST/ADD_ATTACHMENT";
public static submitEit = "Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION";
public static startEitProcess =
"Services/ERP.svc/REST/START_EIT_APPROVAL_PROCESS";
constructor(
public api: ConnectorService,
public authService: AuthenticationService
) {}
public submitEit(eit: any, onError?: any, errorLabel?: string) {
const request = eit;
request.EITTransactionTBLModel = eit.EITTransactionTBL;
//request.EITTransactionTBL=[];
this.authService.authenticateRequest(request);
return this.api.post(
ConfirmAddEitService.submitEit,
request,
onError,
errorLabel
);
}
public startEitApprovalProcess(
eitProcess: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = eitProcess;
this.authService.authenticateRequest(request);
return this.api.post(
ConfirmAddEitService.startEitProcess,
request,
onError,
errorLabel
);
}
public addAttachment(
addAttachrequest: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = addAttachrequest;
this.authService.authenticateRequest(request);
return this.api.post(
ConfirmAddEitService.addAttachment,
request,
onError,
errorLabel
);
}
}

@ -0,0 +1,51 @@
import {Injectable} from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { Observable } from 'rxjs';
import {ApproversList} from '../models/approvers'
@Injectable()
export class SubmitAbConfirmService {
public static cancelHRTransaction='Services/ERP.svc/REST/CANCEL_HR_TRANSACTION';
public static startAbsenceProcess='Services/ERP.svc/REST/START_ABSENCE_APPROVAL_PROCESS';
public static getApproversList='Services/ERP.svc/REST/GET_APPROVERS_LIST';
public static updateAttach='Services/ERP.svc/REST/UPDATE_ATTACHMENT';
public static delteAttach='Services/ERP.svc/REST/DELETE_ATTACHMENT';
constructor(
public api: ConnectorService,
public authService: AuthenticationService) { }
public cancelHRTransaction(transactionID: any, onError?: any, errorLabel?: string): Observable<any> {
const request = transactionID;
this.authService.authenticateRequest(request);
return this.api.post(SubmitAbConfirmService.cancelHRTransaction, request, onError, errorLabel);
}
public startAbApprovalProcess(abProcess: any, onError?: any, errorLabel?: string): Observable<any> {
const request = abProcess;
this.authService.authenticateRequest(request);
return this.api.post(SubmitAbConfirmService.startAbsenceProcess, request, onError, errorLabel);
}
public getApproversList(abProcess: any, onError?: any, errorLabel?: string): Observable<ApproversList> {
const request = abProcess;
request.P_AME_TRANSACTION_TYPE="SSHRMS";
request.P_PAGE_NUM=1;
request.P_PAGE_LIMIT=1000;//check later on
this.authService.authenticateRequest(request);
return this.api.post(SubmitAbConfirmService.getApproversList, request, onError, errorLabel);
}
public updateAttach(updateAttachReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = updateAttachReq;
this.authService.authenticateRequest(request);
return this.api.post(SubmitAbConfirmService.updateAttach, request, onError, errorLabel);
}
public delteAttach(delteAttachReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = delteAttachReq;
this.authService.authenticateRequest(request);
return this.api.post(SubmitAbConfirmService.delteAttach, request, onError, errorLabel);
}
}

@ -0,0 +1,30 @@
import { Injectable } from "@angular/core";
import { Http, Response, Headers } from "@angular/http";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
import { Observable } from "rxjs";
import { WorkListButtonRequest } from "src/app/eit/models/NotificationButtonReq";
@Injectable()
export class WorklistAttachService {
public static getAttach = "Services/ERP.svc/REST/GET_ATTACHMENTS";
constructor(
public api: ConnectorService,
public authService: AuthenticationService
) {}
public getAttach(
getAttachReq: WorkListButtonRequest,
onError?: any,
errorLabel?: string
) {
const request = getAttachReq;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistAttachService.getAttach,
request,
onError,
errorLabel
);
}
}

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('submitAbsence','submitAbsence')}}</ion-title>
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref=""></ion-back-button>
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>

@ -475,7 +475,7 @@ export class SubmitAbsenceComponent implements OnInit {
}
bindHtmlElemEvents(id, obj) {
return false;
const elem = document.getElementById(id);
elem.addEventListener("change", e => {
elem.classList.remove("requiredClassElm");

@ -0,0 +1,46 @@
<ion-header >
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('absenceList','attach')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<div [hidden]="AttachmentList && AttachmentList.length > 0">
<p>{{ts.trPK('general','notAttch')}}</p>
</div>
<div *ngIf="AttachmentList && AttachmentList.length > 0 ">
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{ts.trPK('absenceList','attachList')}}</div>
</ion-card-header>
<ion-card-content>
<ion-grid>
<div *ngFor="let item of AttachmentList">
<ion-row>
<ion-col col-10>
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label >
{{item.SEQ_NUM }}. {{item.FILE_NAME}} </ion-label>
</ion-col>
<ion-col col-2 >
<button float-end class="attachImgBtn" (click)="OpenAttachFiles(item.FILE_DATA,item.FILE_CONTENT_TYPE
)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-col>
</ion-row>
</div>
</ion-grid>
</ion-card-content>
</ion-card>
</div>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewAttachmentsComponent } from './view-attachments.component';
describe('ViewAttachmentsComponent', () => {
let component: ViewAttachmentsComponent;
let fixture: ComponentFixture<ViewAttachmentsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewAttachmentsComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViewAttachmentsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,39 @@
import { Component, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { ModalController } from "@ionic/angular";
import { WorkListAttachViewComponent } from "src/app/notification/work-list-attach-view/work-list-attach-view.component";
import { AbsenceAttahcment } from "../models/abs.attach";
import { AbsenceAttahcmentResponse } from "../models/abs.attach.response";
@Component({
selector: "app-view-attachments",
templateUrl: "./view-attachments.component.html",
styleUrls: ["./view-attachments.component.scss"]
})
export class ViewAttachmentsComponent implements OnInit {
AttachmentList: AbsenceAttahcment[];
constructor(
public common: CommonService,
public modalCtrl: ModalController,
private ts: TranslatorService
) {}
ngOnInit() {
this.AttachmentList = this.common.sharedService.getSharedData(
AbsenceAttahcmentResponse.SHARED_DATA
);
}
async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData(
{ displayData: value, TypeData: Type },
"WorkListAttachViewPage"
);
const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent
});
modal.onDidDismiss().then(data => {});
return await modal.present();
}
}

@ -13,7 +13,8 @@ const routes: Routes = [
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' }, { path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' }
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' }, { path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' }
];

@ -12,7 +12,7 @@
</div>
</div>
<ion-list>
<ion-item>
<ion-item (click)="openNotification()">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/bell.png" item-left>
</ion-thumbnail>

@ -111,5 +111,10 @@ export class AppComponent implements OnInit, AfterViewInit {
this.cs.openProfile();
this.menu.toggle();
}
openNotification(){
this.cs.openNotificationPage();
this.menu.toggle();
}
}

@ -0,0 +1,62 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<nav-buttons></nav-buttons>
<ion-title color="light">{{'general, addAttach' | translate}}</ion-title>
<ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="closeBtnModal()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{"addAttach.title" | translate}}</div>
<div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" />
<label end for="file">
<ion-icon name="add"></ion-icon>
</label></div>
</ion-card-header>
<ion-card-content>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-row class="rowAH titleH">
<ion-col col-4>
<label class="Header" for="">{{'addAttach.name' | translate}}</label>
</ion-col>
<ion-col col-4>
<label class="Header" for="">{{'addAttach.size' | translate}}</label>
</ion-col>
<ion-col col-4>
<label class="Header" for="">{{'addAttach.remove' | translate}}</label>
</ion-col>
</ion-row>
<ion-row class="rowAH" *ngFor="let item of uploader.queue">
<ion-col col-4>
<label for="">{{ item?.file?.name }}</label>
</ion-col>
<ion-col col-4>
<label *ngIf="uploader.options.isHTML5">{{ item?.file?.size/1024/1024 | number:'.2' }} MB</label>
</ion-col>
<ion-col col-4>
<button class="iconButton" ion-button (click)="removeFile(item)"> <img class="imgSize"
src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="OkBtnModal()">
{{'general, ok' | translate}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddAttachComponent } from './add-attach.component';
describe('AddAttachComponent', () => {
let component: AddAttachComponent;
let fixture: ComponentFixture<AddAttachComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddAttachComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddAttachComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,172 @@
import { AddEitResponse } from './../models/add.eit.response';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Component, OnInit } from '@angular/core';
import { FileUploader } from 'ng2-file-upload';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ModalController } from '@ionic/angular';
@Component({
selector: 'app-add-attach',
templateUrl: './add-attach.component.html',
styleUrls: ['./add-attach.component.scss'],
})
export class AddAttachComponent implements OnInit {
private eitResponse: any;//AddEitResponse=new AddEitResponse();
isUpload: boolean = false;
inQueue: boolean = false;
addAttachmentListReq: any;
attachmentID: number = 0;
addAttachRequest: any = [];
fileData: any;
fileType: any;
index: any = 1;
dirPage: any;
TransactionID: any;
indexLastObj: any
filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
constructor(public cs: CommonService, public ts: TranslatorService, public modalCtrl: ModalController) {
this.eitResponse = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA, false);
this.TransactionID = this.cs.sharedService.getSharedData('TransactionID', false);
this.indexLastObj = this.cs.sharedService.getSharedData('indexLastObj', false);
// console.log("this.TransactionID : "+ this.TransactionID);
this.isUpload = false;
}
ngOnInit() { }
public uploader: FileUploader = new FileUploader({
allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async (item) => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
public hasBaseDropZoneOver: boolean = false;
public hasAnotherDropZoneOver: boolean = false;
public fileOverBase(e: any): void {
this.hasBaseDropZoneOver = e;
}
public fileOverAnother(e: any): void {
this.hasAnotherDropZoneOver = e;
}
OkBtnModal() {
let fileCount: number = this.uploader.queue.length;
if (fileCount > 0) {
let data: any = this.addAttachRequest;
// this.viewCtrl.dismiss(data);
this.modalCtrl.dismiss(data);
}
else {
let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.cs.presentAlert(msg);
return;
}
} // end ok button
closeBtnModal() {
// this.viewCtrl.dismiss("cancel");
this.modalCtrl.dismiss("cancel");
}
onFileSelected(input) {
// this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "notSupport");
this.cs.presentAlert(msg);
return
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
// console.log(file);
//var encoded = Base64.encode(file);
this.getBase64(file).then(
data => this.pushObject(data, file.name, file.type)
);
// }
// };
}
}
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
// console.log("before push: "+ this.index);
this.indexLastObj++;
try {
let array = name.split('.');
let attachType: string = array[array.length - 1];
this.addAttachRequest.push(
{
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1],
P_FILE_DATA: fileData.split(',')[1],
P_FILE_NAME: name,//.split('.')[0],
P_TRANSACTION_ID: this.TransactionID
})
} catch (e) {
}
//console.log("after push: "+ this.index);
// return this.addAttachRequest
}
removeFile(objectitem) {
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
this.uploader.queue.splice(objIndex1, 1);
let objIndex = this.addAttachRequest.findIndex(item => item.AttachmentID == objectitem.AttachmentID);
this.addAttachRequest.splice(objIndex, 1);
// this.addAttachRequest =this.addAttachRequest.filter(item => item.AttachmentID !== objectitem.AttachmentID);
}
}

@ -1,3 +1,183 @@
<p>
confirm-add-eit works!
</p>
<ion-header>
<ion-toolbar class="header-toolbar">
<nav-buttons></nav-buttons>
<ion-title color="light">{{headerTitle}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{"confirmAddEit.approverList" | translate}}</div>
</ion-card-header>
<ion-card-content>
<!-- <ion-item class="itemAH" > -->
<ion-grid class=" gridAH" *ngIf="approversList?.length > 0">
<ion-row class="rowAH titleH">
<ion-col col-1>
<label class="Header" for="">{{'confirmAddEit, no' | translate}}</label>
</ion-col>
<ion-col col-3>
<label class="Header" for="">{{'confirmAddEit, approver' | translate}}</label>
</ion-col>
<ion-col col-3>
<label class="Header" for="">{{'confirmAddEit, approverCategory' | translate}}</label>
</ion-col>
<ion-col col-3>
<label class="Header" for="">{{'confirmAddEit, approverType' | translate}}</label>
</ion-col>
<ion-col col-2>
<label class="Header" for="">{{'confirmAddEit, status' | translate}}</label>
</ion-col>
</ion-row>
<!-- </ion-grid>
</ion-item> -->
<!-- <ion-list *ngIf="approversList?.length > 0"> -->
<!-- <ion-item class="itemAH" *ngFor="let item of approversList" >
<ion-grid class=" gridAH"> -->
<ion-row class="rowAH" *ngFor="let item of approversList">
<ion-col col-1>
<label for="">{{item.APPROVER_ORDER_NUMBER}}</label>
</ion-col>
<ion-col col-3>
<label for="">{{item.APPROVER}}</label>
</ion-col>
<ion-col col-3>
<label for="">{{item.APPROVER_CATEGORY}}</label>
</ion-col>
<ion-col col-3>
<label for="">{{item.APPROVER_TYPE}}</label>
</ion-col>
<ion-col col-2>
<label for="">{{item.APPROVAL_STATUS}}</label>
</ion-col>
</ion-row>
</ion-grid>
<!-- </ion-item>
</ion-list> -->
</ion-card-content>
</ion-card>
<ion-item padding>
<ion-label class="boldTxtNav">{{'confirmAddEit, comment' | translate}}</ion-label>
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
</ion-item>
<!-- <div padding *ngIf="attachmentRes?.length > 0 || attachListOver?.length > 0">
<p class="boldTxt"> {{"absenceList.attachList" | translate}}</p>
</div>
<div *ngIf="attachListOver?.length > 0">
<ion-row *ngFor="let attachList of attachListOver ; let i = index">
<ion-col col-8 (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
{{ attachList.P_FILE_NAME }}</ion-col>
<ion-col col-4>
<button [disabled]="attachList.isSuccess" class="iconButton" (click)="removeFile(attachList)"><img
class="imgSize" src="../assets/imgs/cancel.png"></button>
</ion-col>
</ion-row>
</div> -->
<!-- <div *ngIf="attachmentRes?.length > 0">
<ion-row *ngFor="let attachRes of attachmentRes">
<ion-col col-8 (click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
{{ attachRes.FILE_NAME }}</ion-col>
<ion-col col-4>
<button [disabled]="!isResubmitEIT" class="iconButton" (click)="addAttachment(false,attachRes)"><img
class="imgSize" src="../assets/imgs/editIcon.png"></button>
<button (click)="delelteFile(attachRes)" class="iconButton" [disabled]="!isResubmitEIT"><img
class="imgSize" src="../assets/imgs/cancel.png"></button>
</ion-col>
</ion-row>
</div> -->
<div>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{"absenceList, attachList" | translate}}</div>
<button ion-button (click)="addAttachment(true,-1)">
<img class="imgSize" src="../assets/imgs/attachment.png"></button>
</ion-card-header>
<ion-card-content>
<ion-grid *ngIf="attachListOver?.length > 0">
<div *ngFor="let attachList of attachListOver ; let i = index">
<ion-row>
<ion-col col-8>
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachList.P_FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn"
(click)="removeFile(attachList)"><img class="attachImg" src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid *ngIf="attachmentRes?.length > 0">
<div *ngFor="let attachRes of attachmentRes">
<ion-row>
<ion-col col-8>
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachRes.FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img
class="attachImg" src="../assets/imgs/deletegray.png"></button>
</ion-col>
<!-- <button [disabled]="!isResubmitEIT" class="iconButton" (click)="addAttachment(false,attachRes)"><img
class="imgSize" src="../assets/imgs/editIcon.png"></button>
<button (click)="delelteFile(attachRes)" class="iconButton" [disabled]="!isResubmitEIT"><img
class="imgSize" src="../assets/imgs/cancel.png"></button> -->
</ion-row>
</div>
</ion-grid>
</ion-card-content>
</ion-card>
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="startEitApproval()">
{{ (isDelete ? 'general, delete' : 'general, submit') | translate }}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,7 @@
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}

@ -1,4 +1,17 @@
import { WorkListAttachViewComponent } from './../../notification/work-list-attach-view/work-list-attach-view.component';
import { AddAttachComponent } from './../add-attach/add-attach.component';
import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes';
import { EITNotificatonBodyResponse } from './../models/EITNotificationBodyRes';
import { WorkListButtonRequest } from './../models/NotificationButtonReq';
import { ApproversList } from './../../absence/models/approvers';
import { EitRequest } from './../models/eit.request';
import { Component, OnInit } from '@angular/core';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { ModalController } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { EitService } from '../services/eit.service';
import { AddEitResponse } from '../models/add.eit.response';
@Component({
selector: 'app-confirm-add-eit',
@ -7,8 +20,446 @@ import { Component, OnInit } from '@angular/core';
})
export class ConfirmAddEitComponent implements OnInit {
constructor() { }
private P_TransactionID: number;
private eitRequest: EitRequest;
approversList: ApproversList;
addrespList: any;//EitRespModel;
eitComments: string = "";
menuType: string = "";
selEmp: string = "";
respID: number;
selMenu: MenuResponse;
getAttachList: any;
attachListDisplay: any;
headerTitle: string = "";
isTrue: any = 0;
attachItems: any;
private isResubmitEIT: boolean = false;
private itemKey: string = "";
private pActionMode: string = "SUBMIT";
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
attachmentRes: any;
objIndex1: any;
attachListOver: any = [];
index: any = 0;
getPassNotificationDetails: any;
isSubmitBtnClicked: boolean;
isDelete: boolean = false;
ngOnInit() {}
constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) {
this.isSubmitBtnClicked = false;
this.eitRequest = new EitRequest();
}
ngOnInit() {
// console.log('ionViewDidLoad ConfirmAddEitPage');
// let selMenu:MenuResponse=new MenuResponse();
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false);
this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
if (this.isResubmitEIT) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
// console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails);
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
this.itemKey = notification.ITEM_KEY;
this.pActionMode = "RESUBMIT";
this.menuType = "E";
this.respID = -999;
this.selEmp = this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER;
this.getApproversList();
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
let msg: string = "";
msg = this.ts.trPK("eit", "update-title");
this.headerTitle = msg;
} else {
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
this.addrespList = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA);
this.itemKey = this.addrespList.SubmitEITTransactionList.P_ITEM_KEY;
this.P_TransactionID = this.addrespList.SubmitEITTransactionList.P_TRANSACTION_ID;
this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
this.getApproversList();
// this.confirmAddEit.submitEit(this.eitRequest).subscribe((result: AddEitResponse) => {
// this.handleSubmitEitResult(result);
// });
}
}
getApproversList() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID,
P_AME_TRANSACTION_TYPE: "SSHRMS",
P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1000
}
this.eitService.getApproversList(
body).
subscribe((result: any) => {
this.handleApproversResult(result);
});
}
handleApproversResult(result) {
if (this.cs.validResponse(result)) {
this.approversList = result.GetApprovesList;
// console.log("approvers List" + this.approversList);
}
}
startEitApproval() {
//first call add attach inside success call submit
// if(this.isResubmitEIT){
// this.startEITApprovalProcess();
// }else{
// let listToAdd:any=[];
if (this.attachListOver) {
// this.attachListOver.forEach(element => {
// if(element.toAdd==true)
// listToAdd.push(element);
// });
let request = {
AddAttachmentList: this.attachListOver
}
this.eitService.addAttachment(
request).
subscribe((result: any) => {
this.handleAddAttachmentResults(result);
});
} else {
this.startEITApprovalProcess();
}
// }
}
handleAddAttachmentResults(result) {
if (this.cs.validResponse(result)) {
//this.isUpload=true;
this.isTrue = 0;
for (let i = 0; i < result.AddAttSuccessList.length; i++) {
if (!result.AddAttSuccessList[i].AddSuccess) {
this.attachListOver[i].isSuccess = false;
//this.attachItems[i].isSuccess = false;
// if false display cancel button with waring icon or design
}// end if
else {
// if true remove cancel and set isSuccess = true
// this.attachItems[i].isSuccess = true;
this.attachListOver[i].isSuccess = true;
this.isTrue = this.isTrue + 1; //count flag of attach status
} // end else
} // end for
if (this.isTrue == result.AddAttSuccessList.length) {
this.startEITApprovalProcess();
}
else {
//stope
let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; });
this.attachListOver = filtered;
let msg: string = "";
msg = this.ts.trPK("eit", "attach-errorMsg");
this.cs.presentAlert(msg);
// this.cs.presentAlert("fail to upload some attach file");
}
}
}
startEITApprovalProcess() {
let request: any = {};
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
request.P_MENU_TYPE = this.menuType;
request.P_SELECTED_RESP_ID = this.respID;
request.P_TRANSACTION_ID = this.P_TransactionID;
request.P_ITEM_KEY = this.itemKey;
request.P_ACTION_MODE = this.pActionMode;
request.P_COMMENTS = this.eitComments;
this.eitService.startEitApprovalProcess(
request).
subscribe((result: any) => {
this.handleResults(result);
});
}
cancelEitProcess() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID
}
this.eitService.cancelHRTransaction(
body).
subscribe((result: any) => {
this.handleCancelResults(result);
});
}
handleCancelResults(result) {
if (this.cs.validResponse(result)) {
this.isSubmitBtnClicked = false;
// this.navCtrl.popToRoot();
}
}
handleResults(result) {
if (this.cs.validResponse(result)) {
this.isSubmitBtnClicked = true;
//if(this.isResubmitEIT==false){
let msg: string = this.ts.trPK("eit", "approval-message-success");
this.cs.presentAlert(msg);
// }
// this.navCtrl.popToRoot();
this.cs.openHome();
}
}
// addAttachment(){
// this.navCtrl.push('AddAttachPage');
// }
async addAttachment(str: boolean, attachItems: any) {
// console.log("inside attach modal");
//open the modal with return data
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID;
const modal = await this.modalController.create({
component: AddAttachComponent
});
modal.onDidDismiss()
.then((data) => {
if (data == "cancel" || data == "undefined") {
return;
} else {
if (!str) {
// this.attachItems = data.map(function(el) {
// var o = Object.assign({}, el);
// o.isSuccess = false;
// return o;
// })
// this.objIndex1 =this.attachmentRes.findIndex(item => item == attachItems); //to use it in remove attach
//.ATTACHED_DOCUMENT_ID
this.updateFile(data, attachDocID);
} else {
this.attachListDisplay = data;
this.attachItems = this.attachListDisplay.map(function (el) {
var o = Object.assign({}, el);
o.isSuccess = false;
return o;
});
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
}
// this.attachListDisplay=data;
// this.attachItems = this.attachListDisplay.map(function(el) {
// var o = Object.assign({}, el);
// o.isSuccess = false;
// return o;
// })
// console.log(this.attachListDisplay);
// console.log(this.attachItems);
}
});
return await modal.present();
// var modalPage = this.modalController.create('AddAttachPage', { indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID, enableBackdropDismiss: false });//enableBackdropDismiss: false ,enableBackdropDismiss: false
// modalPage.onDidDismiss(data => {
// if (data == "cancel" || data == "undefined") {
// return;
// }
// else {
// if (!str) {
// // this.attachItems = data.map(function(el) {
// // var o = Object.assign({}, el);
// // o.isSuccess = false;
// // return o;
// // })
// // this.objIndex1 =this.attachmentRes.findIndex(item => item == attachItems); //to use it in remove attach
// //.ATTACHED_DOCUMENT_ID
// this.updateFile(data, attachDocID);
// }
// else {
// this.attachListDisplay = data;
// this.attachItems = this.attachListDisplay.map(function (el) {
// var o = Object.assign({}, el);
// o.isSuccess = false;
// return o;
// });
// this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
// }
// // this.attachListDisplay=data;
// // this.attachItems = this.attachListDisplay.map(function(el) {
// // var o = Object.assign({}, el);
// // o.isSuccess = false;
// // return o;
// // })
// // console.log(this.attachListDisplay);
// // console.log(this.attachItems);
// }// end else
// });
// modalPage.present();
}
removeFile(objectitem) {
// if (this.attachItems) {
// let index1 = this.attachItems.findIndex(item => item == objectitem);
// if (index1 > -1) {
// this.attachItems.splice(index1, 1);
// }
// this.attachListDisplay =this.attachListDisplay.filter(item => item.AttachmentID !== objectitem.AttachmentID);
// }
if (this.attachListOver) {
let index2 = this.attachListOver.findIndex(item => item == objectitem);
if (index2 > -1) {
this.attachListOver.splice(index2, 1);
}
//this.attachListOver =this.attachListOver.filter(item => item.AttachmentID !== objectitem.AttachmentID);
}
if (this.attachmentRes) {
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
if (index3 > -1) {
this.attachmentRes.splice(index3, 1);
}
}
}
getAttachment(NotificationID) {
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
this.eitService.getAttach(this.attachReqObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
});
}
handleWorkListAttachResult(result) {
if (this.cs.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetAttachementList != null) {
this.attachmentRes = result.GetAttachementList;
} // if result == null
} // valid it
}
async OpenAttachFiles(value, Type) {
// let modal: Modal = this.modalCtrl.create('WorkListAttachViewPage', { displayData: value, TypeData: Type });
// modal.present();
this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
const modal = await this.modalController.create({
component: WorkListAttachViewComponent
});
modal.onDidDismiss()
.then((data) => {
});
return await modal.present();
}
delelteFile(attach) {
// let alert = this.cs.confirmAlertDialog(this.translate.translate('general.deletePerm'));
this.cs.confirmAlertDialog((data) => {
if (data == true) {
this.continueDelete(attach);
}
}, this.ts.trPK('general', 'ok'), () => {
}, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
// alert.onDidDismiss((data) => {
// if (data == true) {
// this.continueDelete(attach);
// }
// });
}
continueDelete(attach) {
// console.log("trst" + attach.ATTACHED_DOCUMENT_ID);
let req = {
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
}
this.eitService.deleteAttach(req).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
let msg: string = "";
msg = this.ts.trPK("eit", "deleteAttach");
this.cs.presentAlert(msg);
//this.cs.presentAlert("Success" );
}
}
});
}
updateFile(attachList, attachDocID) {
//console.log("updateFile" + attachDocID.ATTACHED_DOCUMENT_ID);
let req = {
P_ATTACHED_DOCUMENT_ID: attachDocID,
P_FILE_DATA: attachList[0].P_FILE_DATA,
P_FILE_NAME: attachList[0].P_FILE_NAME,
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
}
this.eitService.updateAttach(req).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.MessageStatus == 1) {
let msg: string = "";
msg = this.ts.trPK("eit", "attachUpdate");
this.cs.presentAlert(msg);
// this.cs.presentAlert("updated attach successfully" );
//flag to disable update and enable remove
// this.removeFile(attachList);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
}
} // val
});
}
ionViewWillLeave() {
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
this.cancelEitProcess();
}
}

@ -55,11 +55,11 @@
<ion-row>
<img class="empty-data" src="../assets/imgs/noData.png" />
</ion-row>
<h4> {{'general.noData' | translate}}</h4>
<h4> {{'general, noData' | translate}}</h4>
</div>
<!-- <no-data *ngIf="!getResEITTransactionList || getResEITTransactionList[0]?.Collection_Transaction.length <= 0" txt="{{'general.noData' | translate}}"></no-data> -->
<!-- <div *ngIf="getResEITTransactionList && getResEITTransactionList[0]?.Collection_Transaction.length > 0 "> -->
<div>
<div *ngIf="getResEITTransactionList && getResEITTransactionList[0]?.Collection_Transaction.length > 0 ">
<!-- <div> -->
<ion-card *ngFor="let EITTransactionList of getResEITTransactionList; let i=index ">
<ion-card-header class="boxHdr">

@ -1,6 +1,11 @@
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
h4 {
font-size: 2.2rem;
text-align: center;
color: #000000;
}

@ -1,3 +1,4 @@
import { AddAttachComponent } from './add-attach/add-attach.component';
import { ConfirmAddEitComponent } from './confirm-add-eit/confirm-add-eit.component';
import { AddEitComponent } from './add-eit/add-eit.component';
import { HmgCommonModule } from 'src/app/hmg-common/hmg-common.module';
@ -5,14 +6,13 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { EITPage } from './eit.page';
import { HomeComponent } from './home/home.component';
import { EitListComponent } from './eit-list/eit-list.component';
import { DatePicker } from '@ionic-native/date-picker/ngx';
const routes: Routes = [
{
path: '',
@ -33,6 +33,10 @@ const routes: Routes = [
{
path: 'confirm-add-eit',
component: ConfirmAddEitComponent
},
{
path: 'add-attach',
component: AddAttachComponent
}
]
}
@ -51,7 +55,8 @@ const routes: Routes = [
HomeComponent,
EitListComponent,
AddEitComponent,
ConfirmAddEitComponent
ConfirmAddEitComponent,
AddAttachComponent
],
providers: [
DatePicker

@ -0,0 +1,18 @@
export class EITNotificationBodyItems {
public TRANSACTION_NUMBER :number;
public DESC_FLEX_NAME : string;
public ACTION : string;
public EXTRA_INFO_ID :number;
public DESC_FLEX_CONTEXT_COD : string;
public APPLICATION_COLUMN_NAME : string;
public SEGMENT_SEQ_NUM :number;
public DATATYPE : string;
public SEGMENT_NAME : string;
public VARCHAR2_VALUE : string;
public SEGMENT_PROMPT : string;
public NUMBER_VALUE :number;
public SEGMENT_VALUE_DSP : string;
public DATE_VALUE : string ;
public PREV_SEGMENT_VALUE_DSP : string;
public DISPLAY_FLAG : string ;
}

@ -0,0 +1,8 @@
import { EITNotificationBodyItems } from './EITNotificationBodyItems';
import { Response } from '../../hmg-common/services/models/response';
export class EITNotificatonBodyResponse extends Response {
public static SHARED_DATA = 'Notif_BODY_List';
public static NOT_WORKLIST = 'Notif_WORK_LOST';
public EITNotificationBodyItems: EITNotificationBodyItems [];
}

@ -0,0 +1,6 @@
import { Request } from '../../hmg-common/services/models/request';
export class WorkListButtonRequest extends Request{
//public static SHARED_DATA = '';
public P_NOTIFICATION_ID :any;
}

@ -0,0 +1,21 @@
import { Response } from '../../hmg-common/services/models/response';
export class NotificationGetAttachResponse extends Response {
public static SHARED_DATA = '';
public SEQ_NUM = 0;// Int
public FILE_NAME = '';//String
public FILE_DATA = '';//base64
public PK1_VALUE = '';//String
public PK2_VALUE = '';//String
public PK3_VALUE = '';//String
public PK4_VALUE = '';//String
public FILE_CONTENT_TYPE = '';//String
public ATTACHED_DOCUMENT_ID = 0;//Int
public DOCUMENT_ID = 0;//Int
public CATEGORY_ID = 0;//Int
public DATATYPE_ID = 0;//Int
public ENTITY_NAME = '';//String
public FILE_ID = 0;//Int
public PK5_VALUE = '';//String
}

@ -1,9 +1,12 @@
import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes';
import { EITTransactionsRequest } from './../models/EITTransactionsReq';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AddEitResponse } from '../models/add.eit.response';
import { ApproversList } from 'src/app/absence/models/approvers';
import { WorkListButtonRequest } from '../models/NotificationButtonReq';
@Injectable({
providedIn: 'root'
@ -21,7 +24,11 @@ export class EitService {
public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION';
public static startEitProcess = 'Services/ERP.svc/REST/START_EIT_APPROVAL_PROCESS';
public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT';
public static delteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST';
public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT';
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION'
public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS';
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
@ -69,4 +76,49 @@ export class EitService {
return this.con.post(EitService.getDefaultValue, request, onError, errorLabel);
}
public getApproversList(abProcess: any, onError?: any, errorLabel?: string): Observable<ApproversList> {
const request = abProcess;
request.P_AME_TRANSACTION_TYPE = "SSHRMS";
request.P_PAGE_NUM = 1;
request.P_PAGE_LIMIT = 1000;//check later on
this.authService.authenticateRequest(request);
return this.con.post(EitService.getApproversList, request, onError, errorLabel);
}
public addAttachment(addAttachrequest: any, onError?: any, errorLabel?: string): Observable<any> {
const request = addAttachrequest;
this.authService.authenticateRequest(request);
return this.con.post(EitService.addAttachment, request, onError, errorLabel);
}
public startEitApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable<any> {
const request = eitProcess;
this.authService.authenticateRequest(request);
return this.con.post(EitService.startEitProcess, request, onError, errorLabel);
}
public cancelHRTransaction(transactionID: any, onError?: any, errorLabel?: string): Observable<any> {
const request = transactionID;
this.authService.authenticateRequest(request);
return this.con.post(EitService.cancelHRTransaction, request, onError, errorLabel);
}
public getAttach(getAttachReq: WorkListButtonRequest, onError?: any, errorLabel?: string): Observable<NotificationGetAttachResponse> {
const request = getAttachReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getAttach, request, onError, errorLabel);
}
public deleteAttach(delteAttachReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = delteAttachReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.deleteAttach, request, onError, errorLabel);
}
public updateAttach(updateAttachReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = updateAttachReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.updateAttach, request, onError, errorLabel);
}
}

@ -91,6 +91,9 @@ import { PaymentComponent } from './ui/payment/payment.component';
import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { FileSelectDirective } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
@NgModule({
imports: [
@ -100,8 +103,8 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl
IonicModule,
HttpClientModule,
NgxChartsModule,
ListboxModule
ListboxModule,
PdfViewerModule
],
declarations: [
NumberRangeComponent,
@ -152,8 +155,9 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl
DetailButtonComponent,
HeaderButtonComponent,
PaymentComponent,
ReplacementListComponent
ReplacementListComponent,
FileSelectDirective,
WorkListAttachViewComponent
],
exports: [
NumberRangeComponent,
@ -201,7 +205,9 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl
DetailButtonComponent,
HeaderButtonComponent,
PaymentComponent,
ReplacementListComponent
ReplacementListComponent,
FileSelectDirective,
WorkListAttachViewComponent
],
providers: [
ConnectorService,

@ -925,9 +925,6 @@ export class CommonService {
public openConfirmEitPage() {
this.nav.navigateForward(["/eit/confirm-add-eit"]);
}
public openHome() {
this.nav.navigateRoot(["/home"]);
}
@ -961,6 +958,15 @@ export class CommonService {
public openConfirmAbsece(){
this.nav.navigateForward(["/absence/confirm-absence"]);
}
public openWorkListAttachViewPage() {
this.nav.navigateForward(["/notification/work-list-attach-view"]);
}
public openviewAbsenceAttachment(){
this.nav.navigateForward(["/absence/view-attachements"]);
}
public openNotificationPage() {
this.nav.navigateForward(["/notification/homepage"]);
}
public reload(url: string, from: string) {
console.log("force reload called from:" + from);
// window.location.reload();

@ -7,6 +7,7 @@ import { DetailsComponent } from './details/details.component';
import { IonicModule } from '@ionic/angular';
import { MyTeamPage } from './my-team.page';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
const routes: Routes = [
{
@ -26,6 +27,7 @@ const routes: Routes = [
@NgModule({
imports: [
HmgCommonModule,
CommonModule,
FormsModule,
IonicModule,

@ -0,0 +1,85 @@
<ion-header >
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('home','worklist')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content [ngClass]=" direction == 'ltr' ? 'left' : 'right'">
<!-- first select type view -->
<ion-item>
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="notificationType"
(ionChange)=onChangeView($event)>
<ion-select-option value="1" selected="true">{{ts.trPK('worklist','openNot')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','toDo')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','all')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','meNot')}} </ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="searchBy"
(ionChange)="getValueSelected($event)">
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
<ion-select-option value="3">{{ts.trPK('worklist','sent')}}</ion-select-option>
<ion-select-option value="4">{{ts.trPK('worklist','itemType')}}</ion-select-option>
<ion-select-option value="5">{{ts.trPK('worklist','none')}}</ion-select-option>
</ion-select>
</ion-item>
<div *ngIf="HideDateInput==true">
<ion-item>
<ion-label>{{ts.trPK('worklist','sent')}} </ion-label>
<ion-datetime placeholder="{{ts.trPK('worklist','enter')}}" displayFormat="DD-MMM-YYYY" pickerFormat="DD-MMM-YYYY"
[(ngModel)]="InputDate"></ion-datetime>
</ion-item>
</div>
<div *ngIf="HideTextInput==true">
<ion-item>
<ion-input placeholder="{{ts.trPK('worklist','enter')}}" [(ngModel)]="inputSearch">
</ion-input>
</ion-item>
</div>
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let notificationList of WorkListResObj">
<div class="timeline-item" slot="start">
<!-- <div class="item-date"> {{notificationList.BEGIN_DATE }} </div> -->
<div class="item-date"> {{notificationList.BEGIN_DATE | dateString }} </div>
<div class="timeline-thumb bg-color-dot timeline-icon">
</div>
</div>
<ion-label (click)="openNotificationDetail(notificationList)"> {{notificationList.SUBJECT}}
</ion-label>
</ion-item>
</div>
</ion-list>
<!-- *ngIf="rowsNo <= noOfrows" -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" (click)="getAllPushNotificationFun()">{{ts.trPK('worklist','search')}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,159 @@
.bar-stable {
background-color: var(--cusgray) !important;
}
.tabs{
background-color: var(--cusgray) !important;
}
.icon-size-lg {
font-size: 40px;
}
/*Timeline*/
.pos-absolute-right {
position: absolute;
right: 8px;
}
.timeline {
position: relative;
margin: 15px 0 0 0;
}
.timeline:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
width: 4px;
background: #e4e4e4;
z-index: 1;
/* margin-left: -10px; */
/* z-index: 1; */
}
.timeline .timeline-thumb {
border-radius: 500px;
width: 50px;
z-index: 2;
position: absolute;
// :root[dir="ltr"]{
// left: 37px;
// }
// :root[dir="rtl"]{
// right: 37px;
// }
width: 50px;
float: right;
top: 0px;
}
.timeline .timeline-thumb.timeline-icon {
height: 50px;
// text-align: center;
// color: white;
// border: 5px solid #CBD0D3;
transform: scale(0.3);
}
.timeline .timeline-item {
width: 50px;
}
.timeline .timeline-stats {
position: relative;
font-size: 12px;
color: var(--darkgray);
}
.divider-title {
background: #e4e4e4;
padding: 5px 15px;
}
.color-red {
color: var(--danger) !important;
}
.bg-color-dot {
// background-color: #ff3b30 !important;
background: var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
}
.notification-list{
ion-item{
// margin-top: 5px;
// margin-bottom: 5px;
background-color: transparent;
.item-date{
width: 55px;
font-size: 14px;
font-weight: bold;
text-align: center;
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 0;
}
ion-label , [item-end]{
white-space: normal;
font-size: 14px;
// :root[dir="ltr"]{
// margin-left: 10px;
// }
// :root[dir="rtl"]{
// margin-right: 10px;
// }
}
}
}
.input-wrapper {
--flex:none;
}
ion-input ,ion-datetime{
border-bottom: #dedede 1px solid;
}
.left {
.timeline:before{
left: 62px;
}
.notification-list ion-item{
padding-left: 3px;
}
.timeline-thumb{
left: 37px;
}
}
.right {
.timeline:before{
right: 62px;
}
.notification-list ion-item{
padding-right: 3px;
}
.timeline-thumb{
right: 37px;
}
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,187 @@
import { Component, OnInit, ViewChild } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { WorkListRequest } from "../models/workListRequest";
import * as moment from "moment";
import { WorKListResponse } from "../models/workListResponse";
import { WorklistService } from "../service/worklist.service";
@Component({
selector: "app-home",
templateUrl: "./home.component.html",
styleUrls: ["./home.component.scss"]
})
export class HomeComponent implements OnInit {
// @ViewChild(Navbar) navBar: Navbar;
private WorkListObj: WorkListRequest;
WorkListResObj: any; //WorKListResponse;
notificationType: string = "1";
pageNum: number = 1;
rowsNo: number;
noOfrows: number;
selectedValue: string = "";
FromUserName: string = "";
ItemKeyDisplayName: string = "";
SentDate: string = "";
Subject: string = "";
inputSearch: string = "";
HideDateInput: boolean = false;
HideTextInput: boolean = false;
InputDate: string;
IsReachEnd: boolean = false;
public direction = 'ltr';
constructor(
public common: CommonService,
public ts: TranslatorService,
public WorklistService: WorklistService
) {
this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = "1";
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 50; //number
}
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
}
ionViewDidLoad() {
// this.navBar.backButtonClick = () => {
// // you can set a full custom history here if you want
// let pages = [
// {
// page: "HomePage"
// }
// ];
// this.navCtrl.setPages(pages);
// };
}
ionViewWillEnter() {
this.getAllPushNotificationFun();
}
getValueSelected(Value) {
this.selectedValue = Value;
if (this.selectedValue == "1") {
this.HideDateInput = false;
this.HideTextInput = true;
} else if (this.selectedValue == "2") {
this.HideDateInput = false;
this.HideTextInput = true;
} else if (this.selectedValue == "3") {
this.HideDateInput = true;
this.HideTextInput = false;
} else if (this.selectedValue == "4") {
this.HideDateInput = false;
this.HideTextInput = true;
} else if (this.selectedValue == "5") {
this.HideDateInput = false;
this.HideTextInput = false;
}
}
getAllPushNotificationFun() {
this.WorkListObj.P_PAGE_NUM = 1;
this.IsReachEnd = false;
if (this.selectedValue == "1") {
this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch;
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
} else if (this.selectedValue == "2") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch;
} else if (this.selectedValue == "3") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
if (this.InputDate)
this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.InputDate).format(
"DD-MMM-YYYY"
);
else this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
} else if (this.selectedValue == "4") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch;
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
} else if (this.selectedValue == "5") {
this.WorkListObj.P_SEARCH_FROM_USER = "";
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = "";
this.WorkListObj.P_SEARCH_SENT_DATE = "";
this.WorkListObj.P_SEARCH_SUBJECT = "";
}
this.WorklistService.getWorkList(this.WorkListObj).subscribe(
(result: WorKListResponse) => {
this.handleWorkListResult(result);
}
);
} //End getNotifications
private handleWorkListResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (this.common.hasData(result.GetWorkList)) {
this.WorkListObj.P_PAGE_NUM++;
this.WorkListResObj = result.GetWorkList;
let lastItemIndex = this.WorkListResObj.length - 1;
if (result.GetWorkList[lastItemIndex]) {
let lastitem = result.GetWorkList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
// this.navCtrl.push('SmsAuthenticatePage');
}
} else {
this.WorkListResObj = [];
}
}
}
openNotificationDetail(obj) {
//this.navCtrl.push("WorkListMainPage", { passNotificationList: obj });
}
onChangeView(selectedValue: any) {
this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue;
}
doInfinite(infiniteScroll) {
//this.pageNum= this.pageNum + 1;
if (!this.IsReachEnd) {
this.WorklistService.getWorkList(this.WorkListObj).subscribe(
(result: any) => {
if (this.common.validResponse(result)) {
this.WorkListObj.P_PAGE_NUM++;
if (this.common.hasData(result.GetWorkList)) {
result.GetWorkList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.WorkListResObj.push(element);
});
} // if list length >0
else {
this.IsReachEnd = true;
}
} // if response == 1
//this.pageNum++;
infiniteScroll.complete();
}
);
} else {
if (infiniteScroll) infiniteScroll.complete();
}
} //end infiniteScroll
}

@ -0,0 +1,17 @@
export class AbsenceNotificationBodyItems {
public TRANSACTION_NUMBER :number;
public DESC_FLEX_NAME : string;
public ACTION : string;
public DESC_FLEX_CONTEXT_COD : string;
public APPLICATION_COLUMN_NAME : string;
public SEGMENT_SEQ_NUM :number;
public DATATYPE : string;
public SEGMENT_NAME : string;
public VARCHAR2_VALUE : string;
public SEGMENT_PROMPT : string;
public NUMBER_VALUE :number;
public SEGMENT_VALUE_DSP : string;
public DATE_VALUE : string ;
public PREV_SEGMENT_VALUE_DSP : string;
public DISPLAY_FLAG : string ;
}

@ -0,0 +1,8 @@
import { Response } from './response';
import { AbsenceNotificationBodyItems } from './AbsenceNotificationBodtItems';
export class AbsenceNotificatonBodyResponse extends Response {
public static SHARED_DATA = 'Abs_Notif_BODY_List';
public static NOT_WORKLIST = 'Abs_Notif_WORK_LIST';
public AbsenceNotificationBodyItems: AbsenceNotificationBodyItems [];
}

@ -0,0 +1,9 @@
import { Request } from './request';
export class WorkListActionHistoryRequest extends Request{
//public static SHARED_DATA = '';
public P_NOTIFICATION_ID :any;
public P_PAGE_NUM:number ;//number
public P_PAGE_LIMIT:number;//number
}

@ -0,0 +1,15 @@
import { Response } from './response';
export class WorkListActionHistoryResponse extends Response {
//public static SHARED_DATA = '';
public NOTIFICATION_ID = 0; //Int
public ROW_NUM = 0; //Int
public SEQUENCE = 0; //Int
public NO_OF_ROWS = 0; //Int
public NAME = ''; //String
public FROM_ROW_NUM = 0; //Int
public ACTION = ''; //String
public TO_ROW_NUM = 0; //Int
public NOTIFICATION_DATE = ''; //String
public NOTE = ''; //String
}

@ -0,0 +1,18 @@
export class EITNotificationBodyItems {
public TRANSACTION_NUMBER :number;
public DESC_FLEX_NAME : string;
public ACTION : string;
public EXTRA_INFO_ID :number;
public DESC_FLEX_CONTEXT_COD : string;
public APPLICATION_COLUMN_NAME : string;
public SEGMENT_SEQ_NUM :number;
public DATATYPE : string;
public SEGMENT_NAME : string;
public VARCHAR2_VALUE : string;
public SEGMENT_PROMPT : string;
public NUMBER_VALUE :number;
public SEGMENT_VALUE_DSP : string;
public DATE_VALUE : string ;
public PREV_SEGMENT_VALUE_DSP : string;
public DISPLAY_FLAG : string ;
}

@ -0,0 +1,8 @@
import { Response } from './response';
import { EITNotificationBodyItems } from './EITNotificationBodyItems';
export class EITNotificatonBodyResponse extends Response {
public static SHARED_DATA = 'Notif_BODY_List';
public static NOT_WORKLIST = 'Notif_WORK_LOST';
public EITNotificationBodyItems: EITNotificationBodyItems [];
}

@ -0,0 +1,12 @@
import { Request } from './request';
export class WorkListActionRequest extends Request{
// public static SHARED_DATA = '';
public P_NOTIFICATION_ID :any;
public P_FORWARD_TO_USER_NAME:string;//String
public P_ACTION_MODE:string;//String
public P_COMMENTS:string;
public RespondAttributeList:any[];
public P_APPROVER_INDEX :any;
}

@ -0,0 +1,8 @@
import { Request } from './request';
export class WorkListBodyRequest extends Request{
// public static SHARED_DATA = '';
public P_NOTIFICATION_ID :any;
public P_TRANSACTION_ID :number;
}

@ -0,0 +1,6 @@
import { Request } from './request';
export class WorkListButtonRequest extends Request{
//public static SHARED_DATA = '';
public P_NOTIFICATION_ID :any;
}

@ -0,0 +1,10 @@
import { Response } from './response';
export class NotificatonButtonResponse extends Response {
//public static SHARED_DATA = '';
public BUTTON_SEQ = -1;
public BUTTON_LABEL = '';
public BUTTON_ACTION = '';
}

@ -0,0 +1,21 @@
import { Response } from './response';
export class NotificationGetAttachResponse extends Response {
public static SHARED_DATA = '';
public SEQ_NUM = 0;// Int
public FILE_NAME = '';//String
public FILE_DATA = '';//base64
public PK1_VALUE = '';//String
public PK2_VALUE = '';//String
public PK3_VALUE = '';//String
public PK4_VALUE = '';//String
public FILE_CONTENT_TYPE = '';//String
public ATTACHED_DOCUMENT_ID = 0;//Int
public DOCUMENT_ID = 0;//Int
public CATEGORY_ID = 0;//Int
public DATATYPE_ID = 0;//Int
public ENTITY_NAME = '';//String
public FILE_ID = 0;//Int
public PK5_VALUE = '';//String
}

@ -0,0 +1,7 @@
import { Response } from './response';
import {RFCEmployeeList } from './RFCEmployee';
export class WorKListRFCEmployeeResponse extends Response {
public RFCEmployeeList: RFCEmployeeList [];
}

@ -0,0 +1,11 @@
export class RFCEmployeeList {
public SEQ :number;
public ROW_NUM : number;
public USER_NAME : string;
public NO_OF_ROWS :number;
public EMPLOYEE_DISPLAY_NAME : string;
public FROM_ROW_NUM : number;
public ACTION :string;
public TO_ROW_NUM : number;
}

@ -0,0 +1,12 @@
export class ReplacmentEmployeeList {
public ROW_NUM : number;
public USER_NAME : string;
public NO_OF_ROWS :number;
public EMPLOYEE_DISPLAY_NAME : string;
public FROM_ROW_NUM : number;
public EMAIL_ADDRESS :string;
public TO_ROW_NUM : number;
}

@ -0,0 +1,10 @@
import { Request } from './request';
export class WorkListReplacmentEmployeeRequest extends Request{
public P_PAGE_NUM : any;
public P_PAGE_LIMIT : Number;
public P_SEARCH_USER_NAME:String;
public P_SEARCH_EMPLOYEE_DISPLAY_NAME:String;
public P_SEARCH_EMAIL_ADDRESS:String;
}

@ -0,0 +1,8 @@
import { Response } from './response';
import {ReplacmentEmployeeList } from './ReplacmentEmployeeList';
export class WorKListReplacmentEmployeeResponse extends Response {
public static SHARED_DATA = 'work-list';
public ReplacmentEmployeeList: ReplacmentEmployeeList [];
}

@ -0,0 +1,72 @@
export class WorklistsubmitterInfoItems {
public BUSINESS_GROUP_ID:number;
public ACTUAL_TERMINATION_DATE:string;
public BUSINESS_GROUP_NAME :string;
public EMPLOYEE_EMAIL_ADDRESS :string;
public PERSON_ID:number;
public JOB_ID:number;
public PERSON_TYPE_ID:number;
public POSITION_ID:number;
public ASSIGNMENT_ID:number;
public ORGANIZATION_ID:number;
public ASSIGNMENT_START_DATE:string;
public LOCATION_ID:number;
public ASSIGNMENT_END_DATE:string;
public PAYROLL_ID:number;
public PRIMARY_FLAG:string;
public GRADE_ID:number;
public CURRENT_EMPLOYEE_FLAG:string;
public JOB_NAME:string;
public ASSIGNMENT_STATUS_TYPE_ID:number;
public POSITION_NAME:string;
public NORMAL_HOURS:number;
public ORGANIZATION_NAME:string;
public FREQUENCY:string;
public LOCATION_NAME:string;
public FREQUENCY_MEANING:string;
public PAYROLL_NAME:string;
public EMPLOYEE_NUMBER:string;
public PAYROLL_CODE:string;
public EMPLOYEE_NAME:string;
public GRADE_NAME:string;
public EMPLOYEE_DISPLAY_NAME:string;
public EMPLOYEE_MOBILE_NUMBER:string;
public NATIONAL_IDENTIFIER:string;
public EMPLOYEE_WORK_NUMBER:string;
public SYSTEM_PERSON_TYPE:string;
public SUPERVISOR_ID:number;
public PERSON_TYPE:string;
public SUPERVISOR_ASSIGNMENT_ID:string;
public MANUAL_TIMECARD_FLAG:string;
public SUPERVISOR_NUMBER:string;
public MANUAL_TIMECARD_MEANING:string;
public SUPERVISOR_NAME:string;
public SWIPES_EXEMPTED_FLAG:string;
public SUPERVISOR_DISPLAY_NAME:string;
public SWIPES_EXEMPTED_MEANING:string;
public SUPERVISOR_EMAIL_ADDRESS:string;
public ASSIGNMENT_NUMBER:string;
public SUPERVISOR_MOBILE_NUMBER:string;
public UNIT_NUMBER:string;
public SUPERVISOR_WORK_NUMBER:string;
public USER_STATUS:string;
public EMPLOYEE_IMAGE:string;//base64;
public EMPLOYMENT_CATEGORY:string;
public TK_PERSON_ID:number;
public ASSIGNMENT_TYPE:string;
public TK_EMPLOYEE_NUMBER:string;
public EMPLOYMENT_CATEGORY_MEANING:string;
public TK_EMPLOYEE_NAME:string;
public PER_INFORMATION_CATEGORY:string;
public TK_EMPLOYEE_DISPLAY_NAME:string;
public NATIONALITY_CODE:string;
public TK_EMAIL_ADDRESS:string;
public NATIONALITY_MEANING:string;
public NUM_OF_SUBORDINATES :number;
public HIRE_DATE:string;
public FROM_ROW_NUM:number;
public TO_ROW_NUM:number;
public NO_OF_ROWS:number;
public ROW_NUM:number;
}

@ -0,0 +1,13 @@
import { Request } from './request';
export class WorkListSubmitterInfoRequest extends Request{
public P_NOTIFICATION_TYPE: string;//string
public P_SELECTED_EMPLOYEE_NUMBER: string;//String
public P_SELECTED_RESP_ID: Number;//NUMBER
public P_PAGE_NUM : Number;
public P_PAGE_LIMIT : Number;
public P_SEARCH_USER_NAME:String;
public P_SEARCH_EMPLOYEE_DISPLAY_NAME:String;
public P_SEARCH_EMAIL_ADDRESS:String;
}

@ -0,0 +1,10 @@
import { Response } from './response';
import { WorklistsubmitterInfoItems } from './WorklistsubmitterInfoItems';
export class WorklistsubmitterInfoResponse extends Response {
//public static SHARED_DATA = '';
public WorklistsubmitterInfoItems: WorklistsubmitterInfoItems [];
}

@ -0,0 +1,18 @@
export class Request {
public P_USER_NAME: string;
public LanguageID: number;
//public IPAdress: string;
public P_SESSION_ID: number;
public VersionID: number;
public Channel: number;
public P_PASSWORD: string;
public P_MOBILE_NUMBER: string;
public P_EMAIL_ADDRESS: string;
public TokenID:string;
public P_NOTIFICATION_ID:number;
public MobileNumber: string;
public UserName:string;
public LogInTokenID:string;
public MobileType:string;
}

@ -0,0 +1,11 @@
export class Response {
public LanguageID?: number;
public ErrorCode:string;
public ErrorEndUserMessage:string;
public ErrorMessage:string;
public ErrorType: number;
public MessageStatus: number;
public SuccessMsg:string;
public SuccessMsgN:string;
public IsAuthenticated:boolean;
}

@ -0,0 +1,17 @@
import { Request } from './request';
export class WorkListRequest extends Request{
public static SHARED_DATA = 'login-request';
// Channel: Channel, //channel
// LanguageID: LanguageID,//langlist
// P_USER_NAME:userName,//string
// P_SESSION_ID:sessionID,//number
public P_NOTIFICATION_TYPE: string;//string
public P_SEARCH_FROM_USER:string;//string
public P_SEARCH_SUBJECT:string;//string
public P_SEARCH_SENT_DATE:string;//string
public P_SEARCH_ITEM_TYPE_DSP_NAME:string;//string
public P_PAGE_NUM:number;//number
public P_PAGE_LIMIT:number;//number
}

@ -0,0 +1,28 @@
export class WorkListResItems {
public ITEM_KEY: string;
public PRIORITY_F : string;
public NOTIFICATION_ID: number;
public RECIPIENT_ROLE : string;
public FROM_USER : string;
public END_DATE: string;
public TO_USER: string;
public ITEM_TYPE_DISPLAY_NAME: string;
public SUBJECT: string;
public MORE_INFO_ROLE: string;
public LANGUAGE: string;
public FROM_ROLE: string;
public BEGIN_DATE: string;
public ITEM_TYPE: string;
public DUE_DATE: string;
public NOTIFICATION_NAME: string;
public STATUS: string;
public MAIL_STATUS: string;
public PRIORITY: number;
public ORIGINAL_RECIPIENT: string;
public SELECTED_EMPLOYEE_NUMBER: string;
public ROW_NUM: number;
public NO_OF_ROWS: number;
public FROM_ROW_NUM : number;
public TO_ROW_NUM : number;
public REQUEST_TYPE: string;
}

@ -0,0 +1,8 @@
import { Response } from './response';
import { WorkListResItems } from './workListResItems';
export class WorKListResponse extends Response {
public static SHARED_DATA = 'work-list';
public WorkListItems: WorkListResItems [];
}

@ -0,0 +1,46 @@
import { HmgCommonModule } from './../hmg-common/hmg-common.module';
import { WorkListAttachViewComponent } from './work-list-attach-view/work-list-attach-view.component';
import { HomeComponent } from './home/home.component';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { NotificationPage } from './notification.page';
import { PipesModule } from '../pipes/pipes.module';
import { WorklistService } from './service/worklist.service';
const routes: Routes = [
{
path: '',
component: NotificationPage,
children: [
{
path: 'homepage',
component: HomeComponent
},
{
path: 'work-list-attach-view',
component: WorkListAttachViewComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
PipesModule,
RouterModule.forChild(routes)
],
declarations: [
NotificationPage,
HomeComponent
],
providers:[WorklistService]
})
export class NotificationPageModule {}

@ -0,0 +1,3 @@
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NotificationPage } from './notification.page';
describe('NotificationPage', () => {
let component: NotificationPage;
let fixture: ComponentFixture<NotificationPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NotificationPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NotificationPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-notification',
templateUrl: './notification.page.html',
styleUrls: ['./notification.page.scss'],
})
export class NotificationPage implements OnInit {
constructor() { }
ngOnInit() {
}
}

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { NotificationService } from './notification.service';
describe('NotificationService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: NotificationService = TestBed.get(NotificationService);
expect(service).toBeTruthy();
});
});

@ -0,0 +1,25 @@
import {Injectable} from '@angular/core';
import {Http, Response, Headers} from "@angular/http";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
import {Observable} from 'rxjs';
import {WorkListRequest} from '../models/workListRequest';
import {WorKListResponse} from '../models/workListResponse';
@Injectable()
export class WorklistService {
public static getWorkList = 'Services/ERP.svc/REST/GET_WORKLIST';
constructor(
public api: ConnectorService,
public authService: AuthenticationService,
) { }
public getWorkList(WorkListReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = WorkListReq;
this.authService.authenticateRequest(request);
return this.api.post(WorklistService.getWorkList, request, onError, errorLabel);
}
}

@ -0,0 +1,68 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<nav-buttons></nav-buttons>
<ion-title color="light">{{'workListMain, suppDoc' | translate}}</ion-title>
<ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="onClose()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<div *ngIf="displayPdf != '' ">
<pdf-viewer *ngIf="displayPdf" [src]="displayPdf" [show-all]="true" [original-size]="false" [zoom]="pdfZoom"
style="display: block"></pdf-viewer>
<ion-fab bottom right>
<button ion-fab mini (click)="zoomIn()">
<ion-icon name="add"></ion-icon>
</button>
<button ion-fab mini (click)="zoomOut()">
<ion-icon name="remove"></ion-icon>
</button>
<button ion-fab mini (click)="resetZoom()">
<ion-icon name="refresh"></ion-icon>
</button>
</ion-fab>
</div>
<div *ngIf="displayImage != '' ">
<img [src]="displayImage" alt="Select Image" />
</div>
<div *ngIf="decodedString != 0 ">
<p [innerHTML]="decodedString"></p>
<!-- <p>{{decodedString}}</p> -->
</div>
<div *ngIf="sheetNameList?.length > 0 ">
<ion-content class="XlsxScroll" scrollX="true" scrollY="true"
style="display: block; width: 100%; height: 100% ;position: initial">
Choose a worksheet:
<ion-grid class="btnGrid">
<ion-row>
<div *ngFor="let sheetName of sheetNameList">
<ion-col col-6 class="gridBtnCol">
<button ion-button class="gridBtn" (click)="openSheet(sheetName)">
{{sheetName.sheetName}}
</button>
</ion-col>
</div>
</ion-row>
</ion-grid>
<ion-grid style="width: 500%;">
<ion-row *ngFor="let row of data">
<ion-col style="border:#0000002e solid 0.5px" *ngFor="let val of row">
{{val}}
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
</div>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WorkListAttachViewComponent } from './work-list-attach-view.component';
describe('WorkListAttachViewComponent', () => {
let component: WorkListAttachViewComponent;
let fixture: ComponentFixture<WorkListAttachViewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WorkListAttachViewComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WorkListAttachViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,147 @@
import { ModalController } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Component, OnInit } from '@angular/core';
import * as XLSX from 'xlsx';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
type AOA = any[][];
const ZOOM_STEP: number = 0.25;
const DEFAULT_ZOOM: number = 1;
@Component({
selector: 'app-work-list-attach-view',
templateUrl: './work-list-attach-view.component.html',
styleUrls: ['./work-list-attach-view.component.scss'],
})
export class WorkListAttachViewComponent implements OnInit {
displayPdf: string = "";
displayImage: string = "";
TypeData: string = "";
displayData: string = "";
decodedString: any;
displayxlsx: string = "";
public pdfZoom: number = DEFAULT_ZOOM;
sheetNameList: any = [];
sheetDataList: any = [];
data: any[][];//[[1,2,3],[4,5,6]];
constructor(private cs: CommonService, private ts: TranslatorService, private modalCtrl: ModalController) {
this.displayData = this.cs.sharedService.getSharedData('WorkListAttachViewPage', false).displayData;
this.TypeData = this.cs.sharedService.getSharedData('WorkListAttachViewPage', false).TypeData;
if (this.TypeData == "png" || this.TypeData == "jpeg" || this.TypeData == "jpg" || this.TypeData == "PNG" || this.TypeData == "JPEG" || this.TypeData == "JPG") {
this.displayImage = 'data:image/' + this.TypeData + ';base64,' + this.displayData;
}
else if (this.TypeData == "pdf" || this.TypeData == "PDF") {
this.displayPdf = 'data:application/octet-stream;base64,' + this.displayData;
}
else if (this.TypeData == "txt") {
//
this.decodedString = atob(this.displayData);
// console.log("..."+ this.decodedString);
}
else if (this.TypeData == "xlx" || this.TypeData == "xlsx") {
this.displayxlsx = this.displayData;
var base64 = this.displayxlsx;//.split(";base64,")
var binary = "";
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for (let i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);
}
var length = array.byteLength;
for (let i = 0; i < length; i++) {
binary += String.fromCharCode(array[i]);
}
const wb: XLSX.WorkBook = XLSX.read(binary, { type: 'binary', cellDates: true });
/* grab first sheet */
const wsname: string = wb.SheetNames[0];
const ws: XLSX.WorkSheet = wb.Sheets[wsname];
// if(ws["!type"]=="chart")
// {
// alert("chart");
// }
// else alert("able");
this.data = <AOA>(XLSX.utils.sheet_to_json(ws, { header: 1 }));
// const wsname1: string = wb.SheetNames[1];
// const ws1: XLSX.WorkSheet = wb.Sheets[wsname];
// console.log("wsname..."+wsname);
// console.log("ws..."+ws);
/* save data */
// this.data = <AOA>(XLSX.utils.sheet_to_json(ws, {header: 1}));
// this.data = <AOA>(XLSX.utils.sheet_to_json(ws1, {header: 1}));
for (let i = 0; i < wb.SheetNames.length; ++i) {
const sheetName = wb.SheetNames[i];
const ws: XLSX.WorkSheet = wb.Sheets[sheetName];
this.sheetNameList.push({ id: i, sheetName: sheetName });
this.sheetDataList.push({ id: i, sheetData: ws });
}
}//if file == xlx/s
else {
let msg: string = "";
msg = this.ts.trPK("general", "notSupportFile");
this.cs.presentAlert(msg);
}
}
ngOnInit() { }
public zoomIn() {
this.pdfZoom += ZOOM_STEP;
}
public zoomOut() {
if (this.pdfZoom > DEFAULT_ZOOM) {
this.pdfZoom -= ZOOM_STEP;
}
}
public resetZoom() {
this.pdfZoom = DEFAULT_ZOOM;
}
onClose(): void {
this.modalCtrl.dismiss();
}
base64ToByteArray(base64String) {
try {
var sliceSize = 1024;
var byteCharacters = atob(base64String);
var bytesLength = byteCharacters.length;
var slicesCount = Math.ceil(bytesLength / sliceSize);
var byteArrays = new Array(slicesCount);
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
var begin = sliceIndex * sliceSize;
var end = Math.min(begin + sliceSize, bytesLength);
var bytes = new Array(end - begin);
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
bytes[i] = byteCharacters[offset].charCodeAt(0);
}
byteArrays[sliceIndex] = new Uint8Array(bytes);
}
return byteArrays;
} catch (e) {
//console.log("Couldn't convert to byte array: " + e);
return undefined;
}
}
openSheet(obj) {
this.data = <AOA>(XLSX.utils.sheet_to_json(this.sheetDataList[obj.id].sheetData, { header: 1 }));
}
}

@ -0,0 +1,39 @@
import { Pipe, PipeTransform } from '@angular/core';
/**
* Generated class for the DateStringPipe pipe.
*
* See https://angular.io/api/core/Pipe for more info on Angular Pipes.
*/
@Pipe({
name: 'dateString',
})
export class DateStringPipe implements PipeTransform {
/**
* Takes a value and makes it lowercase.
*/
locale = {
en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}
};
transform(value: string) {
let x = new Date(Date.parse(value));
//return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
}
getMonthNameShort(lang,month) {
lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month];
};
}

@ -0,0 +1,28 @@
import { Pipe, PipeTransform } from '@angular/core';
/**
* Generated class for the FilterLangPipe pipe.
*
* See https://angular.io/api/core/Pipe for more info on Angular Pipes.
*/
@Pipe({
name: 'filterLang',
})
export class FilterLangPipe implements PipeTransform {
/**
* return the correct translated values.
*/
transform(value: string, valuen:string) {
let desc =value;
if(valuen){
let lang= localStorage.getItem('language');
lang = lang!=null ? lang:'2';
if(lang=='2'){
desc=value;
}else{
desc=valuen;
}
}
return desc
}
}

@ -0,0 +1,11 @@
import { NgModule } from '@angular/core';
import { DateStringPipe } from './date-string/date-string';
import { FilterLangPipe } from './filter-lang/filter-lang';
@NgModule({
declarations: [DateStringPipe,
FilterLangPipe],
imports: [],
exports: [DateStringPipe,
FilterLangPipe]
})
export class PipesModule {}

@ -8,4 +8,8 @@ ion-item {
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
}
.item-radio-checked ion-label {
color: #3ac1f1 !important;
}
.boldTxt{font-weight:bold;}

@ -680,6 +680,26 @@
"attemptDel": {
"en": "You are attempting to delete a row that has already been deleted.",
"ar": "أنت تحاول حذف صف تم حذفه بالفعل."
},
"noData": {
"en": "The are no requests",
"ar": "لا توجد طلبات"
},
"noFileSelect": {
"en": "No file selected",
"ar": "لم يتم اختيار اي ملف"
},
"notSupport": {
"en": "This file type can't be attached",
"ar": "لا يمكن إرفاق نوع الملف هذا"
},
"notSupportFile": {
"en": "This file type is not supported",
"ar": "نوع الملف هذا غير مدعوم"
},
"addAttach": {
"en": "Add Attachment",
"ar": "إضافة مرفق"
}
},
"home": {
@ -1104,6 +1124,26 @@
"update-title": {
"en": "Update",
"ar": "تحديث"
},
"attach-errorMsg": {
"en": "Failed to upload some of the attached files",
"ar": "فشل تحميل بعض الملفات المرفقة"
},
"approval-message-success": {
"en": "Your request has been submitted for approvals.",
"ar": "تم إرسال طلبك للحصول على الموافقات."
},
"delete-perm": {
"en": "Are you sure from deleting this file permanently?",
"ar": "هل أنت متأكد من حذف هذا الملف نهائيًا؟"
},
"attachUpdate": {
"en": "Attachment updated successfully",
"ar": "تحديث"
},
"deleteAttach": {
"en": "Attachment deleted successfully",
"ar": "تحديث"
}
},
"submitAbsence": {
@ -1196,5 +1236,158 @@
"en":"Add Attachment",
"ar":"أضف مرفق"
}
},
"confirmAddEit": {
"confirmAddEit": {
"en": "Confirm Add Eit",
"ar": "تأكيد"
},
"start": {
"en": "Submit",
"ar": "تنفيذ"
},
"cancel": {
"en": "Cancel",
"ar": "إلغاء"
},
"no": {
"en": "No",
"ar": "رقم"
},
"approver": {
"en": "Approver",
"ar": "الموافق"
},
"status": {
"en": "Status",
"ar": "حاله"
},
"approverCategory": {
"en": "Approver Category",
"ar": "فئة الموافقة"
},
"approverType": {
"en": "Approver Type",
"ar": "نوع الموافقة"
},
"comment": {
"en": "Comment",
"ar": "تعليق"
},
"approverList": {
"en": "Approvers List",
"ar": "قائمة الموافقين"
}
},
"workListMain": {
"suppDoc": {
"en": "Support Documents",
"ar": "مستندات الدعم"
}
},
"addAttach":{
"select":{
"en":"Select File",
"ar":"أختر الملف"
},
"name":{
"en":"Name",
"ar":"الإسم"
},
"size":{
"en":"Size",
"ar":"الحجم"
},
"remove":{
"en":"Remove",
"ar":"حذف"
},
"title":{
"en":"Add Attachment",
"ar":"إضافة مرفق"
},
"errorMsg":{
"en":"Failed to upload some of the attached files",
"ar":"حدث خطأ في إرفاق بعض الملفات"
},
"attachUpdate":{
"en":"Attachment updated successfully",
"ar":"تم تحديث المرفق بنجاح"
},
"deleteAttach":{
"en":"Attachment deleted successfully",
"ar":"تم حذف المرفق بنجاح"
},
"noFileSelect":{
"en":"No file selected",
"ar":"لايوجد ملف مرفق"
},
"notSupport":{
"en":"This file type can't be attached",
"ar":"هذا النوع من الملفات لايمكن ارفاقه"
},
"notSupportFile":{
"en":"This file type is not supported",
"ar":"لايمكن عرض هذا النوع من الملفات"
}
},
"worklist": {
"view":{
"en": "View",
"ar":"عرض"
},
"openNot":{
"en": "Open Notifications",
"ar":"التبليغات المفتوحة"
},
"fyi":{
"en": "FYI Notifications",
"ar":"تبليغات للعلم"
},
"toDo": {
"en":"To Do Notifications",
"ar":"تبليغات الأعمال"
},
"all": {
"en":"All Notifications",
"ar":"كل التبليغات"
},
"meNot": {
"en":"Notifications from Me",
"ar": "تبليغات صادرة مني"
},
"searchby": {
"en":"Search By",
"ar":"البحث ب"
},
"from": {
"en":"From User Name",
"ar":"من"
},
"subject": {
"en":"Subject",
"ar":"الموضوع"
},
"sent": {
"en":"Sent Date",
"ar":"تاريخ الإرسال"
},
"itemType":{
"en": "Item Type Display Name",
"ar":"اسم العرض"
},
"none": {
"en":"None",
"ar":"بدون"
},
"enter": {
"en":"Enter",
"ar":"ادخل"
},
"search": {
"en":"Search",
"ar":"بحث"
}
}
}
Loading…
Cancel
Save