diff --git a/Mohem/src/app/hmg-common/ui/payment/payment.component.scss b/Mohem/SELF_SIGNED_CERT_IN_CHAIN similarity index 100% rename from Mohem/src/app/hmg-common/ui/payment/payment.component.scss rename to Mohem/SELF_SIGNED_CERT_IN_CHAIN diff --git a/Mohem/config.xml b/Mohem/config.xml index 6d27c9a3..82930842 100644 --- a/Mohem/config.xml +++ b/Mohem/config.xml @@ -1,8 +1,8 @@ - - MOHEMM + + Al Habib MOHEMM an app created by cloud Solutions - Cloud Solutions + HMG @@ -88,13 +88,10 @@ - - - diff --git a/Mohem/google-services.json b/Mohem/google-services.json index 62fbaeae..4dfaa0d3 100644 --- a/Mohem/google-services.json +++ b/Mohem/google-services.json @@ -1,34 +1,34 @@ { "project_info": { - "project_number": "679409052782", - "firebase_url": "https://mohemm-dce93.firebaseio.com", - "project_id": "mohemm-dce93", - "storage_bucket": "mohemm-dce93.appspot.com" + "project_number": "448880075189", + "firebase_url": "https://al-habib-mohemm.firebaseio.com", + "project_id": "al-habib-mohemm", + "storage_bucket": "al-habib-mohemm.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", + "mobilesdk_app_id": "1:448880075189:android:5bb4821d515a826d88b9fc", "android_client_info": { - "package_name": "hmg.cloudSolutions.mohem" + "package_name": "com.cloudsolutions.alhabibmohemm" } }, "oauth_client": [ { - "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", + "client_id": "448880075189-49hc2l78pr9hsmr9p3k7j411r40diej8.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyDgWjuSBIKGghWxYg_KGBRIZTi-O_UA8mU" + "current_key": "AIzaSyC8nrli7eyuRNow8nF-QHvDMOxqUkj6fEw" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", + "client_id": "448880075189-49hc2l78pr9hsmr9p3k7j411r40diej8.apps.googleusercontent.com", "client_type": 3 } ] diff --git a/Mohem/package-lock.json b/Mohem/package-lock.json index 589871da..73fb0606 100644 --- a/Mohem/package-lock.json +++ b/Mohem/package-lock.json @@ -805,14 +805,6 @@ "@types/cordova": "^0.0.34" } }, - "@ionic-native/call-number": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ionic-native/call-number/-/call-number-5.8.0.tgz", - "integrity": "sha512-mAM83IAyawaEbYMZvE8NZnKBW3hu9q0V8+YnOlYy20flC4mnJZssuLUlonH5L5IWf3zY0FjsG/fx4SPVQ5Ac/A==", - "requires": { - "@types/cordova": "^0.0.34" - } - }, "@ionic-native/camera": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/@ionic-native/camera/-/camera-5.14.0.tgz", @@ -930,14 +922,6 @@ "@types/cordova": "^0.0.34" } }, - "@ionic-native/local-notifications": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ionic-native/local-notifications/-/local-notifications-5.8.0.tgz", - "integrity": "sha512-g8Q9cgSp9zGuR3oZRejIQWmkeQD0jOB9dzGiLUiq4QKzWtIy8KyL0kGiRdCYdRwCpszPnitm64PNVvjKkGOWjg==", - "requires": { - "@types/cordova": "^0.0.34" - } - }, "@ionic-native/native-storage": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ionic-native/native-storage/-/native-storage-5.8.0.tgz", @@ -969,21 +953,6 @@ "@types/cordova": "^0.0.34" } }, - "@ionic-native/sms": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ionic-native/sms/-/sms-5.8.0.tgz", - "integrity": "sha512-4SRiwmOgTNU2BMhWt3kHXO5XBzeniP0ndyF45wViwrYfIU9Stp59YPjlSTwp1k9S9m7sou9Sm6D3B21UxVWDYQ==", - "requires": { - "@types/cordova": "^0.0.34" - }, - "dependencies": { - "@types/cordova": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", - "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" - } - } - }, "@ionic-native/splash-screen": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-5.8.0.tgz", @@ -2547,11 +2516,6 @@ "resolved": "https://registry.npmjs.org/calendar-utils/-/calendar-utils-0.2.3.tgz", "integrity": "sha512-wXxvJX/fdVZqrHeyxEWq5kbwALXrjifbY2L3fXvuS815cCwoWv+Uuiu0jkfqZNTtOSKaTXHdMkIhmLRqcC0E5g==" }, - "call-number": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-number/-/call-number-1.0.1.tgz", - "integrity": "sha1-v52q5If9alVz+JqjZV++ivA2r9I=" - }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -4280,11 +4244,6 @@ "resolved": "https://registry.npmjs.org/cordova-plugin-android-permissions/-/cordova-plugin-android-permissions-1.0.0.tgz", "integrity": "sha1-nnwRa+Zo6336QUkbE9jUfalUgUk=" }, - "cordova-plugin-badge": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/cordova-plugin-badge/-/cordova-plugin-badge-0.8.8.tgz", - "integrity": "sha512-RhIBtd5xhD/iLnxjt35jvOae28oNW/wtMZBOmQR3Rf0y4wirvA1bpAZEhBoFqL+rZGhsd6ddOdQXdex1T0DRyQ==" - }, "cordova-plugin-camera": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-4.1.0.tgz", @@ -4320,21 +4279,11 @@ "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-4.1.0.tgz", "integrity": "sha512-aY1yI042TMgyDoh07rUSxSedlTwQfrvS44UnpakmCqmA/BapjSv88ixa5qUun95vwsYdTERX2VJp6h/YrR1lFQ==" }, - "cordova-plugin-local-notification": { - "version": "0.9.0-beta.2", - "resolved": "https://registry.npmjs.org/cordova-plugin-local-notification/-/cordova-plugin-local-notification-0.9.0-beta.2.tgz", - "integrity": "sha512-63n77K1pt8dnbWnNR8QWETi9Glezi1bvNHvHWmGNIOv0xCb0phZnm+Ku49BQ+omwe8Z5voMvrA4I03SYPpv38w==" - }, "cordova-plugin-nativestorage": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/cordova-plugin-nativestorage/-/cordova-plugin-nativestorage-2.3.2.tgz", "integrity": "sha512-olg/BzYRk0NGbKQ5f7rf21RYQEyJI19CCZn6RpVMO9/kbRRFqae/6ixjDNy81dXSu2TQ42brjBddGe1Qpn5ViA==" }, - "cordova-plugin-sms-receive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cordova-plugin-sms-receive/-/cordova-plugin-sms-receive-1.0.2.tgz", - "integrity": "sha512-y2QMX709RgrbCHVDHAewjvXi50h+u+VcuCQADPJS+tH/BosFie+x1vo5mMwysuIEiaQ25b0qhIzo63RCyT5Fyw==" - }, "cordova-plugin-splashscreen": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.3.tgz", @@ -4350,11 +4299,6 @@ "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz", "integrity": "sha512-EYC5eQFVkoYXq39l7tYKE6lEjHJ04mvTmKXxGL7quHLdFPfJMNzru/UYpn92AOfpl3PQaZmou78C7EgmFOwFQQ==" }, - "cordova-sms-plugin": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cordova-sms-plugin/-/cordova-sms-plugin-1.0.0.tgz", - "integrity": "sha512-DdRf1zdJkwC9BJ3fVg2yx/faoW5eOscg6oFIWODfOIBu5AQ1oV6+gsGTO5pHVLBzlt5V8U9zG9PwhR1IbnW/EQ==" - }, "cordova-support-google-services": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/cordova-support-google-services/-/cordova-support-google-services-1.1.0.tgz", @@ -9112,11 +9056,6 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, - "mx.ferreyra.callnumber": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/mx.ferreyra.callnumber/-/mx.ferreyra.callnumber-0.0.2.tgz", - "integrity": "sha512-J9FJiMrfWG9Q8AQEz/cgYLcXTTD/Z5+vfq29hn8K7yVWjxkSzr7zFi7Dpn8wcv2iKHBHDJY+U0z8yoAzDugXMw==" - }, "nan": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", diff --git a/Mohem/package.json b/Mohem/package.json index 6540b21d..3025b3b2 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -28,7 +28,6 @@ "@ionic-native/badge": "^5.8.0", "@ionic-native/barcode-scanner": "^5.14.0", "@ionic-native/ble": "^5.8.0", - "@ionic-native/call-number": "^5.8.0", "@ionic-native/camera": "^5.14.0", "@ionic-native/core": "^5.8.0", "@ionic-native/date-picker": "^5.10.0", @@ -41,11 +40,9 @@ "@ionic-native/in-app-browser": "^5.8.0", "@ionic-native/keyboard": "^5.8.0", "@ionic-native/launch-navigator": "^5.8.0", - "@ionic-native/local-notifications": "^5.8.0", "@ionic-native/native-storage": "^5.8.0", "@ionic-native/open-native-settings": "^5.14.0", "@ionic-native/push": "^5.8.0", - "@ionic-native/sms": "^5.8.0", "@ionic-native/splash-screen": "^5.0.0", "@ionic-native/sqlite": "^5.8.0", "@ionic-native/status-bar": "^5.0.0", @@ -56,7 +53,6 @@ "@swimlane/ngx-charts": "^10.1.0", "angular-calendar": "^0.26.11", "app": "0.1.0", - "call-number": "^1.0.1", "chart.js": "^2.8.0", "cordova-android": "8.1.0", "cordova-android-support-gradle-release": "^3.0.1", @@ -65,7 +61,6 @@ "cordova-open-native-settings": "^1.5.2", "cordova-plugin-add-swift-support": "^2.0.2", "cordova-plugin-android-permissions": "^1.0.0", - "cordova-plugin-badge": "^0.8.8", "cordova-plugin-camera": "^4.1.0", "cordova-plugin-datepicker": "^0.9.3", "cordova-plugin-device": "^2.0.3", @@ -73,18 +68,14 @@ "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-ionic-keyboard": "^2.1.3", "cordova-plugin-ionic-webview": "4.1.0", - "cordova-plugin-local-notification": "^0.9.0-beta.2", "cordova-plugin-nativestorage": "^2.3.2", - "cordova-plugin-sms-receive": "^1.0.2", "cordova-plugin-splashscreen": "^5.0.3", "cordova-plugin-statusbar": "^2.4.3", "cordova-plugin-whitelist": "^1.3.4", - "cordova-sms-plugin": "^1.0.0", "cordova-support-google-services": "^1.1.0", "cordova.plugins.diagnostic": "^5.0.1", "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", @@ -132,13 +123,9 @@ "cordova-plugin-nativestorage": {}, "cordova-plugin-globalization": {}, "cordova-plugin-android-permissions": {}, - "cordova-plugin-sms-receive": {}, - "cordova-plugin-local-notification": {}, "mx.ferreyra.callnumber": {}, "cordova-plugin-badge": {}, "cordova-plugin-ionic-keyboard": {}, - "call-number": {}, - "cordova-sms-plugin": {}, "cordova-plugin-datepicker": {}, "cordova-plugin-geolocation": {}, "phonegap-plugin-barcodescanner": { diff --git a/Mohem/resources/android/icon/drawable-hdpi-icon.png b/Mohem/resources/android/icon/drawable-hdpi-icon.png index 0d4559b9..b0adb5d6 100644 Binary files a/Mohem/resources/android/icon/drawable-hdpi-icon.png and b/Mohem/resources/android/icon/drawable-hdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-ldpi-icon.png b/Mohem/resources/android/icon/drawable-ldpi-icon.png index e05b379e..3783ccb3 100644 Binary files a/Mohem/resources/android/icon/drawable-ldpi-icon.png and b/Mohem/resources/android/icon/drawable-ldpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-mdpi-icon.png b/Mohem/resources/android/icon/drawable-mdpi-icon.png index 12217ffd..76948ef6 100644 Binary files a/Mohem/resources/android/icon/drawable-mdpi-icon.png and b/Mohem/resources/android/icon/drawable-mdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-xhdpi-icon.png b/Mohem/resources/android/icon/drawable-xhdpi-icon.png index b99acf02..a7ce9721 100644 Binary files a/Mohem/resources/android/icon/drawable-xhdpi-icon.png and b/Mohem/resources/android/icon/drawable-xhdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-xxhdpi-icon.png b/Mohem/resources/android/icon/drawable-xxhdpi-icon.png index e408218b..61df3ab9 100644 Binary files a/Mohem/resources/android/icon/drawable-xxhdpi-icon.png and b/Mohem/resources/android/icon/drawable-xxhdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png b/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png index d3e40c78..7a8f1c13 100644 Binary files a/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png and b/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png differ diff --git a/Mohem/resources/android/splash/drawable-land-hdpi-screen.png b/Mohem/resources/android/splash/drawable-land-hdpi-screen.png index 049727c9..7d78415f 100644 Binary files a/Mohem/resources/android/splash/drawable-land-hdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-hdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-ldpi-screen.png b/Mohem/resources/android/splash/drawable-land-ldpi-screen.png index ddf677d7..a2bc0538 100644 Binary files a/Mohem/resources/android/splash/drawable-land-ldpi-screen.png and b/Mohem/resources/android/splash/drawable-land-ldpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-mdpi-screen.png b/Mohem/resources/android/splash/drawable-land-mdpi-screen.png index e5edf975..9f218abd 100644 Binary files a/Mohem/resources/android/splash/drawable-land-mdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-mdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png b/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png index 6f264e22..d200d129 100644 Binary files a/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png b/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png index 6d3fda04..b81de763 100644 Binary files a/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png b/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png index 3497cec0..bfc93bf6 100644 Binary files a/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-hdpi-screen.png b/Mohem/resources/android/splash/drawable-port-hdpi-screen.png index 5f192c2a..9c844ff4 100644 Binary files a/Mohem/resources/android/splash/drawable-port-hdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-hdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-ldpi-screen.png b/Mohem/resources/android/splash/drawable-port-ldpi-screen.png index 5c239726..7b7e9d47 100644 Binary files a/Mohem/resources/android/splash/drawable-port-ldpi-screen.png and b/Mohem/resources/android/splash/drawable-port-ldpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-mdpi-screen.png b/Mohem/resources/android/splash/drawable-port-mdpi-screen.png index 2a6d9a25..5114be78 100644 Binary files a/Mohem/resources/android/splash/drawable-port-mdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-mdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png b/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png index 658e946b..5c43ccdc 100644 Binary files a/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png b/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png index 42492889..e12a1ca8 100644 Binary files a/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png b/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png index 6722931b..b8770919 100644 Binary files a/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png differ diff --git a/Mohem/resources/icon.png b/Mohem/resources/icon.png index 06dc8293..afe9bb8b 100755 Binary files a/Mohem/resources/icon.png and b/Mohem/resources/icon.png differ diff --git a/Mohem/resources/splash.png b/Mohem/resources/splash.png index b3611afe..121950ff 100755 Binary files a/Mohem/resources/splash.png and b/Mohem/resources/splash.png differ diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 9040df11..1ace6518 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -24,7 +24,7 @@ export class AppComponent implements OnInit, AfterViewInit { user_image: string = "../assets/imgs/profile.png"; menuSide: string = "left"; notBadge: number; - companyUrl: string = "../assets/imgs/CS.png"; + companyUrl: string = "../assets/imgs/HMG.png"; companyDesc: string = "Powered By Cloud Solutions"; public direction = "ltr"; constructor( @@ -63,7 +63,7 @@ export class AppComponent implements OnInit, AfterViewInit { if (user) { this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL - : "../assets/imgs/CS.png"; + : "../assets/imgs/HMG.png"; this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription diff --git a/Mohem/src/app/authentication/agreement/agreement.component.html b/Mohem/src/app/authentication/agreement/agreement.component.html deleted file mode 100644 index 03b2a285..00000000 --- a/Mohem/src/app/authentication/agreement/agreement.component.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - {{ 'general,usage-agreement' | translate}} - - - - - - - - -
-
-
-
- -
-
- - - - {{ 'general,accept' | translate}} - - - -
-
\ No newline at end of file diff --git a/Mohem/src/app/authentication/agreement/agreement.component.scss b/Mohem/src/app/authentication/agreement/agreement.component.scss deleted file mode 100644 index 389579c4..00000000 --- a/Mohem/src/app/authentication/agreement/agreement.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -.agreement_area{ - width: 100%; - height: 80%; -} - -.html-container { - width: 96%; - padding: 2%; -} \ No newline at end of file diff --git a/Mohem/src/app/authentication/agreement/agreement.component.spec.ts b/Mohem/src/app/authentication/agreement/agreement.component.spec.ts deleted file mode 100644 index ba35ec0e..00000000 --- a/Mohem/src/app/authentication/agreement/agreement.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AgreementComponent } from './agreement.component'; - -describe('AgreementComponent', () => { - let component: AgreementComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AgreementComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AgreementComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/authentication/agreement/agreement.component.ts b/Mohem/src/app/authentication/agreement/agreement.component.ts deleted file mode 100644 index 57d0c0d7..00000000 --- a/Mohem/src/app/authentication/agreement/agreement.component.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -import { CommonService } from 'src/app/hmg-common/services/common/common.service'; -import { AgreementService } from './service/agreement.service'; -import { CheckUserAgreementResponse } from './service/models/check-user-agreement.response'; -import { GetUserAgreementResponse } from './service/models/get-user-agreement.response'; -import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; - -@Component({ - selector: 'app-agreement', - templateUrl: './agreement.component.html', - styleUrls: ['./agreement.component.scss'] -}) -export class AgreementComponent implements OnInit { - - public agreementContent: string; - constructor( - public ts: TranslatorService, - public cs: CommonService, - public agreementService: AgreementService, - public auth: AuthenticationService - - ) { } - - ngOnInit() { - this.checkUserAgreement(); - } - - checkUserAgreement() { - this.agreementService.checkUserAgreement( - () => { - this.checkUserAgreement(); - }, this.ts.trPK('general', 'retry')).subscribe((result: CheckUserAgreementResponse) => { - if (this.cs.validResponse(result)) { - if (result.IsPatientAlreadyAgreed) { - // this.auth.setUserAgreed(true); - this.cs.openHome(); - } else { - this.getUserAgreement(); - } - } - }); - } - - private getUserAgreement() { - this.agreementService.getAgreement( - () => { - this.getUserAgreement(); - }, this.ts.trPK('general', 'retry')).subscribe((result: GetUserAgreementResponse) => { - if (this.cs.validResponse(result)) { - this.agreementContent = result.UserAgreementContent; - } - }); - } - - public onAcceptClicked() { - this.agreementService.addUserAgreement( - () => { - this.onAcceptClicked(); - }, this.ts.trPK('general', 'retry')).subscribe((result: GetUserAgreementResponse) => { - if (this.cs.validResponse(result)) { - //this.auth.setUserAgreed(true); - this.cs.openHome(); - } - }); - } - - public onRejectClicked() { - this.auth.clearUser().subscribe(success => { - this.cs.openHome(); - }); - } - - - -} diff --git a/Mohem/src/app/authentication/agreement/service/agreement.service.spec.ts b/Mohem/src/app/authentication/agreement/service/agreement.service.spec.ts deleted file mode 100644 index 40cca2a5..00000000 --- a/Mohem/src/app/authentication/agreement/service/agreement.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { AgreementService } from './agreement.service'; - -describe('AgreementService', () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it('should be created', () => { - const service: AgreementService = TestBed.get(AgreementService); - expect(service).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/authentication/agreement/service/agreement.service.ts b/Mohem/src/app/authentication/agreement/service/agreement.service.ts deleted file mode 100644 index b0a61f25..00000000 --- a/Mohem/src/app/authentication/agreement/service/agreement.service.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Injectable } from '@angular/core'; -import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; -import { CheckUserAgreementRequest } from './models/check-user-agreement.request'; -import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; -import { Observable } from 'rxjs'; -import { CheckUserAgreementResponse } from './models/check-user-agreement.response'; -import { Request } from 'src/app/hmg-common/services/models/request'; -import { GetUserAgreementResponse } from './models/get-user-agreement.response'; -import { AddUserAgreementRequest } from './models/add-user-agreement.request'; - -@Injectable({ - providedIn: 'root' -}) -export class AgreementService { - - public static checkAgreementURL = 'Services/Patients.svc/REST/CheckForUsageAgreement'; - public static getAgreementURL = 'Services/Patients.svc/REST/GetUsageAgreementText'; - public static addAgreementURL = 'Services/Patients.svc/REST/AddUsageAgreement'; - - - constructor( - public con: ConnectorService, - public auth: AuthenticationService - ) { - - } - - - public checkUserAgreement(onError: any, errorLabel: string): Observable { - const request = new CheckUserAgreementRequest(); - request.Region = 1; - this.auth.authenticateRequest(request); - request.TokenID = ''; - return this.con.post(AgreementService.checkAgreementURL, request, onError, errorLabel); - - } - - public getAgreement(onError: any, errorLabel: string): Observable { - const request = new Request(); - this.auth.setPublicFields(request); - request.TokenID = ''; - return this.con.post(AgreementService.getAgreementURL, request, onError, errorLabel); - } - - public addUserAgreement(onError: any, errorLabel: string): Observable { - const request = new AddUserAgreementRequest(); - request.Region = 1; - this.auth.authenticateRequest(request); - request.TokenID = ''; - return this.con.post(AgreementService.addAgreementURL, request, onError, errorLabel); - } -} - diff --git a/Mohem/src/app/authentication/agreement/service/models/add-user-agreement.request.ts b/Mohem/src/app/authentication/agreement/service/models/add-user-agreement.request.ts deleted file mode 100644 index 63132b81..00000000 --- a/Mohem/src/app/authentication/agreement/service/models/add-user-agreement.request.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Request } from 'src/app/hmg-common/services/models/request'; - -export class AddUserAgreementRequest extends Request { - Region: number; // 1 -} diff --git a/Mohem/src/app/authentication/agreement/service/models/check-user-agreement.request.ts b/Mohem/src/app/authentication/agreement/service/models/check-user-agreement.request.ts deleted file mode 100644 index 171dc392..00000000 --- a/Mohem/src/app/authentication/agreement/service/models/check-user-agreement.request.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Request } from 'src/app/hmg-common/services/models/request'; - -export class CheckUserAgreementRequest extends Request { - Region: number; // 1 -} diff --git a/Mohem/src/app/authentication/agreement/service/models/check-user-agreement.response.ts b/Mohem/src/app/authentication/agreement/service/models/check-user-agreement.response.ts deleted file mode 100644 index d133e4f2..00000000 --- a/Mohem/src/app/authentication/agreement/service/models/check-user-agreement.response.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Response } from 'src/app/hmg-common/services/models/response'; - -export class CheckUserAgreementResponse extends Response { - IsPatientAlreadyAgreed: boolean; -} diff --git a/Mohem/src/app/authentication/agreement/service/models/get-user-agreement.response.ts b/Mohem/src/app/authentication/agreement/service/models/get-user-agreement.response.ts deleted file mode 100644 index e4e919c5..00000000 --- a/Mohem/src/app/authentication/agreement/service/models/get-user-agreement.response.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Response } from 'src/app/hmg-common/services/models/response'; - -export class GetUserAgreementResponse extends Response { - UserAgreementContent: string; -} diff --git a/Mohem/src/app/authentication/authentication.module.ts b/Mohem/src/app/authentication/authentication.module.ts index ab367372..143e3a67 100644 --- a/Mohem/src/app/authentication/authentication.module.ts +++ b/Mohem/src/app/authentication/authentication.module.ts @@ -8,7 +8,7 @@ import { LoginComponent } from './login/login.component'; import { ForgotComponent } from './forgot/forgot.component'; import { HmgCommonModule } from '../hmg-common/hmg-common.module'; import { SelectButtonModule } from 'primeng/selectbutton'; -import { AgreementComponent } from './agreement/agreement.component'; +//import { AgreementComponent } from './agreement/agreement.component'; import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx'; import { Device } from '@ionic-native/device/ngx'; import { SplashScreen } from '@ionic-native/splash-screen/ngx'; @@ -36,10 +36,6 @@ const routes: Routes = [ path: 'forgot', component: ForgotComponent }, - { - path: 'agreement', - component: AgreementComponent - }, { path: 'smspage', component: SmsPageComponent @@ -74,7 +70,6 @@ const routes: Routes = [ AuthenticationPage, LoginComponent, ForgotComponent, - AgreementComponent, SmsPageComponent, CheckUserComponent, ChangePasswordComponent diff --git a/Mohem/src/app/authentication/login/login.component.html b/Mohem/src/app/authentication/login/login.component.html index e83cb05d..3fbb2177 100644 --- a/Mohem/src/app/authentication/login/login.component.html +++ b/Mohem/src/app/authentication/login/login.component.html @@ -2,7 +2,7 @@ - + diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.html b/Mohem/src/app/authentication/sms-page/sms-page.page.html index a26b8d07..6e7bb360 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.html +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html @@ -11,7 +11,7 @@ - + diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index b8b21205..e3e64734 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -42,8 +42,8 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx'; import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service'; import { BarChartComponent } from './ui/bar-chart/bar-chart.component'; import { DonutChartComponent } from './ui/donut-chart/donut-chart.component'; -import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service'; -import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; +//import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service'; +//import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; import { EmailComponent } from './ui/email/email.component'; import { Badge } from '@ionic-native/badge/ngx'; // import { Push } from '@ionic-native/push/ngx'; @@ -53,7 +53,7 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service'; import { GuidService } from './services/guid/guid.service'; import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component'; import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component'; -import { GeofencingService } from './services/geofencing/geofencing.service'; +//import { GeofencingService } from './services/geofencing/geofencing.service'; import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; import { ButtonComponent } from './ui/button/button.component'; import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component'; @@ -82,13 +82,13 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx'; import { DetailButtonComponent } from './ui/detail-button/detail-button.component'; import { RouterModule } from '@angular/router'; import { HeaderButtonComponent } from './ui/header-button/header-button.component'; -import { CallNumber } from '@ionic-native/call-number/ngx'; +//import { CallNumber } from '@ionic-native/call-number/ngx'; import { AppRate } from '@ionic-native/app-rate/ngx'; import { RatingService } from './services/rating/rating.service'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { RateService } from './services/rate/rate.service'; -import { PaymentComponent } from './ui/payment/payment.component'; -import { PaymentService } from './ui/payment/service/payment.service'; +//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'; @@ -155,7 +155,7 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; EmptyDataComponent, DetailButtonComponent, HeaderButtonComponent, - PaymentComponent, + //PaymentComponent, ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent @@ -205,7 +205,7 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; EmptyDataComponent, DetailButtonComponent, HeaderButtonComponent, - PaymentComponent, + //PaymentComponent, ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent @@ -224,14 +224,14 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; NativeStorage, ProgressLoadingService, PushService, - UserLocalNotificationService, - LocalNotifications, + //UserLocalNotificationService, + //LocalNotifications, Badge, LifeCycleService, HmgBrowserService, GuidService, BackgroundGeolocation, - GeofencingService, + //GeofencingService, Keyboard, KeyboardService, Diagnostic, @@ -240,12 +240,12 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; HMGPreloadingStrategy, HMGPreloadingStrategyLoading, Diagnostic, - CallNumber, + // CallNumber, AppRate, RatingService, InAppBrowser, RateService, - PaymentService, + //PaymentService, MenuService, OpenNativeSettings ] diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index b4250b21..ccebfc03 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -3,7 +3,7 @@ import { Request } from "../models/request"; import { TranslatorService } from "../translator/translator.service"; import { ConnectorService } from "../connector/connector.service"; import { Observable, throwError } from "rxjs"; -import { CheckPatientRegisterationRequest } from "./models/check-patient-registeration.request"; +//import { CheckPatientRegisterationRequest } from "./models/check-patient-registeration.request"; import { LoginRequest } from "./models/login.request"; import { Response } from "../models/response"; import { AuthenticatedUser } from "./models/authenticated-user"; @@ -18,7 +18,7 @@ import { RegisterInformationRequest } from "./models/register-information.reques import { ForgotFileIDResponse } from "./models/forgot-File-ID.response"; import { EmailRequest } from "../models/email-request"; import { EmailInput } from "../../ui/email/models/email-input"; -import { UserLocalNotificationService } from "../user-local-notification/user-local-notification.service"; +//import { UserLocalNotificationService } from "../user-local-notification/user-local-notification.service"; import { GetLoginInfoRequest } from "./models/get-login-info.request"; import { GetLoginInfoResponse } from "./models/get-login-info.response"; import { analyzeAndValidateNgModules } from "@angular/compiler"; @@ -81,7 +81,7 @@ export class AuthenticationService { public cs: CommonService, public ts: TranslatorService, public nativeStorage: NativeStorage, - public localNotifications: UserLocalNotificationService, + // public localNotifications: UserLocalNotificationService, private events: Events, private menu: MenuController, ) { } @@ -116,7 +116,7 @@ export class AuthenticationService { public setPublicFields(request: Request): Request { request.VersionID = 1.3; - request.Channel = 31; + request.Channel = 33; request.LanguageID = TranslatorService.getCurrentLanguageCode(); //request.IPAdress = '10.10.10.10'; //request.SessionID = "any thing"; // ??? required for not authorized login funny @@ -193,7 +193,7 @@ export class AuthenticationService { public login(request: LoginRequest, onError: any, errorLabel: string): Observable { this.setPublicFields(request); - request.P_APP_VERSION="CS"; + request.P_APP_VERSION="HMG"; return this.con.post(AuthenticationService.login, request, onError, errorLabel); } @@ -448,7 +448,7 @@ export class AuthenticationService { public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) : Observable { this.setPublicFields(request); - request.P_APP_VERSION="CS"; + request.P_APP_VERSION="HMG"; return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel); } @@ -485,13 +485,13 @@ export class AuthenticationService { client side: id no , mobile no , zip code */ - public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string) - : Observable { - this.setPublicFields(request); - request.TokenID = ''; - request.isRegister = false; - return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel); - } + // public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string) + // : Observable { + // this.setPublicFields(request); + // request.TokenID = ''; + // request.isRegister = false; + // return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel); + // } public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string) : Observable { diff --git a/Mohem/src/app/hmg-common/services/authentication/models/check-patient-registeration.request.ts b/Mohem/src/app/hmg-common/services/authentication/models/check-patient-registeration.request.ts deleted file mode 100644 index 8968bdde..00000000 --- a/Mohem/src/app/hmg-common/services/authentication/models/check-patient-registeration.request.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Request } from '../../models/request'; - -export class CheckPatientRegisterationRequest extends Request { - PatientIdentificationID: string; // "iqama" - PatientMobileNumber: string; // "phone without start 0" - TokenID: string; // should be empty "" - ZipCode: string; // "966 or 971" - isRegister: boolean; -} diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index cd4e9f27..9a4e3ad6 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -25,7 +25,7 @@ import { SharedDataService } from "../shared-data-service/shared-data.service"; import { Badge } from "@ionic-native/badge/ngx"; import { LifeCycleService } from "../life-cycle/life-cycle.service"; import { Diagnostic } from "@ionic-native/diagnostic/ngx"; -import { CallNumber } from "@ionic-native/call-number/ngx"; +//import { CallNumber } from "@ionic-native/call-number/ngx"; import { InAppBrowser } from "@ionic-native/in-app-browser/ngx"; @Injectable({ @@ -95,7 +95,7 @@ export class CommonService { public badge: Badge, public lifeCycle: LifeCycleService, public diagnostic: Diagnostic, - public callNumber: CallNumber, + //public callNumber: CallNumber, public iab: InAppBrowser, private menu: MenuController, ) {} @@ -1089,19 +1089,19 @@ export class CommonService { }); } - public callPhoneNumber(phoneNumber: string) { - this.platform.ready().then(() => { - if (this.isCordova()) { - this.callNumber - .callNumber(phoneNumber, true) - .then(res => {}) - .catch(err => {}); - } else { - window.open("tel:" + phoneNumber); - // this.presentAlert(this.ts.trPK('error', 'call')); - } - }); - } + // public callPhoneNumber(phoneNumber: string) { + // this.platform.ready().then(() => { + // if (this.isCordova()) { + // this.callNumber + // .callNumber(phoneNumber, true) + // .then(res => {}) + // .catch(err => {}); + // } else { + // window.open("tel:" + phoneNumber); + // // this.presentAlert(this.ts.trPK('error', 'call')); + // } + // }); + // } list_to_tree(list) { let map = {}, diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index cb9045c0..20e69db6 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -19,8 +19,8 @@ export class ConnectorService { public static timeOut = 30 * 1000; // public static host = 'http://10.50.100.113:6060/'; // development service - public static host = 'https://uat.hmgwebservices.com/'; - // public static host = 'https://hmgwebservices.com/'; + // public static host = 'https://uat.hmgwebservices.com/'; + public static host = 'https://hmgwebservices.com/'; // public static host = 'http://10.50.100.198:6060/'; // public static host = 'http://10.50.100.113:6060/'; // development service /* public static host = 'http://10.50.100.198:6060/'; diff --git a/Mohem/src/app/hmg-common/services/geofencing/geofencing.service.spec.ts b/Mohem/src/app/hmg-common/services/geofencing/geofencing.service.spec.ts deleted file mode 100644 index e4a9d164..00000000 --- a/Mohem/src/app/hmg-common/services/geofencing/geofencing.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { GeofencingService } from './geofencing.service'; - -describe('GeofencingService', () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it('should be created', () => { - const service: GeofencingService = TestBed.get(GeofencingService); - expect(service).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/hmg-common/services/geofencing/geofencing.service.ts b/Mohem/src/app/hmg-common/services/geofencing/geofencing.service.ts deleted file mode 100644 index 954e9ad3..00000000 --- a/Mohem/src/app/hmg-common/services/geofencing/geofencing.service.ts +++ /dev/null @@ -1,446 +0,0 @@ -import { Injectable } from '@angular/core'; -import { BackgroundGeolocation, BackgroundGeolocationEvents } from '@ionic-native/background-geolocation/ngx'; -import { BackgroundGeolocationConfig, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation/ngx'; -import { UserLocalNotificationService } from '../user-local-notification/user-local-notification.service'; -import { Platform } from '@ionic/angular'; -import { LocationModel } from './models/location.model'; -import { ConnectorService } from '../connector/connector.service'; -import { NativeStorage } from '@ionic-native/native-storage/ngx'; -import { AuthenticationService } from '../authentication/authentication.service'; -import { ZoneModel } from './models/zone.model'; -import { CommonService } from '../common/common.service'; -import { InsertLocationRequest } from './models/insert-location.request'; -import { GeoUserModel } from './models/geo-user.model'; -import { TranslatorService } from '../translator/translator.service'; - -export enum zoneState { - out = 0, enter = 1, exit = 2, in = 3 -} - - @Injectable({ - providedIn: 'root' - }) -export class GeofencingService { - public static ZONES_KEY = 'geofencing-zones'; - public static USER_DATA_KEY = 'geofencing-user-data'; - public static GEO_STATUS_KEY = 'geofencing-status'; - public static zonesUrl = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; - public static loggingUrl = 'Services/Patients.svc/rest/GeoF_InsertPatientFileInfo'; - private zonesList: ZoneModel []; - private userData: GeoUserModel; - private isPaused: boolean; - private debug: boolean; - - locations: any []; - constructor( - private backgroundGeolocation: BackgroundGeolocation, - public notif: UserLocalNotificationService, - public platform: Platform, - public con: ConnectorService, - public auth: AuthenticationService, - public storage: NativeStorage, - public cs: CommonService, - public authService: AuthenticationService, - public ts: TranslatorService, - ) { - this.debug = false; - } -/* -* logs location on server. -*/ - private logLocation(id: number, type: number, userData: GeoUserModel, zone: ZoneModel) { - this.toast('logging location..'); - this.setNotification('Logging location ' , 'location id: ' + id + ' type: ' + type); - const req = new InsertLocationRequest(); - req.PointsID = id; - req.GeoType = type; - //req.PatientID = userData.PatientID; - //req.PatientOutSA = userData.PatientOutSA; - this.auth.setPublicFields(req); - this.con.postNoLoad(GeofencingService.loggingUrl, req, () => { - zone.pendingRequest = type; // failed to log, setup pending request - this.storeZones(this.zonesList); - this.log('pending request from onError'); - this.setNotification('Pending request from onError', 'zone: ' + zone.Description + ' request type: ' + type); - }).subscribe((response) => { - if (this.cs.validResponse(response)) { - this.setNotification('Log success' , 'location id: ' + id + ' patientID: ' + userData.PatientID); - this.log('logged successfuly'); - zone.pendingRequest = zoneState.out; // cancel pending requests if any - } else { - zone.pendingRequest = type; // failed to log, setup pending request - this.log('pending request from invalid'); - this.setNotification('Pending request from invalid', 'zone: ' + zone.Description + ' request type: ' + type); - } - this.storeZones(this.zonesList); - }); - } -/* -* Requests geofence zones list -*/ - private requestZones() { - const req = this.auth.getPublicRequest(); - this.con.postNoLoad(GeofencingService.zonesUrl, req, _ => { // TODO: handle error - }).subscribe((response: any) => { - if (this.cs.validResponse(response)) { - if (this.cs.hasData(response.GeoF_PointsList)) { - // update zonelist if it doesnt exist or if the server has an updated one - if (!this.cs.hasData(this.zonesList) || (this.zonesList.length !== response.GeoF_PointsList.length)) { - this.log('setting new zone list'); - this.zonesList = response.GeoF_PointsList; - for (const zone of this.zonesList) { - zone.in = false; - } - this.log('storing zones'); - this.storeZones(this.zonesList); - } - } - } - }); - } -/* -* Store zones list in local storage -*/ - public async storeZones(zones: ZoneModel []) { - return await this.storage.setItem(GeofencingService.ZONES_KEY, zones); - } -/* -* Retrieve and set list of zones from local storage -*/ - public async setZones() { - try { - const data = await this.storage.getItem(GeofencingService.ZONES_KEY); - if (this.cs.hasData(data)) { - this.zonesList = data; - } else { - this.requestZones(); // zones list not stored in local storage - } - } catch { - this.requestZones(); // zones list not stored in local storage - } - } - - public async storeUserData(user: GeoUserModel) { - return await this.storage.setItem(GeofencingService.USER_DATA_KEY, user); - } -/* -* Retrieve and set user data from local storage -*/ - public async setUserFromStorage() { - const data = await this.storage.getItem(GeofencingService.USER_DATA_KEY); - if (data) { - this.userData = data; - } else { - this.userData = null; - } - } -/* -// turns location tracking on. Sets geo user data and zones list -*/ - public async turnTrackingOn(patientID?: number, outSa?: number): Promise { - this.toast('turning tracking on'); - // set zones list from storage - await this.setZones(); - // update zone list from server - this.requestZones(); - - // Set user data - if (patientID) { - this.userData = new GeoUserModel; - this.userData.PatientID = patientID; - this.userData.PatientOutSA = outSa; - } else if (!this.userData) { - try { - await this.setUserFromStorage(); - } catch { - return false; - } - } - this.userData.isTrackingOn = true; - this.storeUserData(this.userData); - this.startTracking(); - return true; - } -/* -// turns location tracking off. Stops background tracking -*/ - public turnTrackingOff() { - this.toast('turning tracking off'); - this.stopTracking(); - if (this.userData) { - this.userData.isTrackingOn = false; - this.storeUserData(this.userData); - } else { - this.setUserFromStorage().then(() => { - this.userData.isTrackingOn = false; - this.storeUserData(this.userData); - }); - } - } - -/* -// Check if geofencing service is enabled -*/ - public async isTrackingEnabled(): Promise { - // if (this.userData) { - // return this.userData.isTrackingOn; - // } else { - try { - await this.setUserFromStorage(); - if (this.userData) { - return this.userData.isTrackingOn; - } else { - return false; - } - } catch { - throw false; - } - // } - } -/* -// setup and start background gelocation plugin -*/ - public startTracking() { - const config: BackgroundGeolocationConfig = { - desiredAccuracy: 10000, // HIGH_ACCURACY = 1 // low = 10000 - stationaryRadius: 20, // 20 - distanceFilter: 10, // 10 - debug: false, // enable this hear sounds for background-geolocation life-cycle. - stopOnTerminate: false, // enable this to clear background location settings when the app terminates - // startOnBoot: true, - // Android options - notificationsEnabled: false, - interval: 60000, // interval vars for improved battery life - fastestInterval: 120000, - activitiesInterval: 10000, - startForeground: false, - notificationTitle: 'Running in the background', - notificationText: '', - // IOS options - saveBatteryOnBackground: false - }; - this.backgroundGeolocation.configure(config) - .then((location: BackgroundGeolocationResponse) => { - }); - - this.backgroundGeolocation.on(BackgroundGeolocationEvents.location) - .subscribe((location: BackgroundGeolocationResponse) => { - this.reportLocation(location); - }); - - this.backgroundGeolocation.on(BackgroundGeolocationEvents.stationary) - .subscribe((location: BackgroundGeolocationResponse) => { - this.reportLocation(location); - }); - - this.storage.getItem(GeofencingService.GEO_STATUS_KEY).then(status => { - if (!status) { - this.backgroundGeolocation.start(); - this.storage.setItem(GeofencingService.GEO_STATUS_KEY, true); - } - }).catch(() => { - this.toast('turning geofencing on'); - this.backgroundGeolocation.start(); - this.storage.setItem(GeofencingService.GEO_STATUS_KEY, true); - }); - - } -/* -// Helper to startTracking() -*/ - private async reportLocation(location: BackgroundGeolocationResponse) { - // Check if zones and user is set - if (!this.userData) { - await this.setUserFromStorage(); - } - if (!this.cs.hasData(this.zonesList)) { - await this.setZones(); - } - if (this.platform.is('ios')) { - this.backgroundGeolocation.startTask().then((taskKey) => { - this.checklocationInZones(location, this.zonesList, this.userData); - this.backgroundGeolocation.endTask(taskKey); - }); - } else { - this.checklocationInZones(location, this.zonesList, this.userData); - } - this.storeZones(this.zonesList); - } - -/* -// stops background geoloacation plugin tracking -*/ - public stopTracking() { - this.toast('Stop Tracking' ); - this.storage.setItem(GeofencingService.GEO_STATUS_KEY, false); - this.backgroundGeolocation.stop().then(value => { - // this.toast('Stop Tracking value returned: ' + value); - - }); - } - -/* -// Checks if given location triggers any zone events (enter, exit) for all zones, and pauses the service if -// the location was far from all zones -*/ - private checklocationInZones(location: BackgroundGeolocationResponse, zones: ZoneModel [], user: GeoUserModel) { - this.printLocation(location, 'check location in zones'); - let currentMinDist = 9999999; - for (const zone of zones) { - const userLocation = new LocationModel(location.latitude, location.longitude); - const event = this.checkLocationInZone(userLocation, zone); - const currentDistance = this.distanceFromZone(userLocation, zone); - currentMinDist = (currentMinDist > currentDistance ? currentDistance : currentMinDist); - if (zone.GEOF_ID === 16) { - this.log(zone.Description); - this.log('zone state: ' + zone.in + ' pending: ' + zone.pendingRequest + 'current event: ' + event); - } - if (event === zoneState.in) { - zone.in = true; - } - // send enter request - if (event === zoneState.enter || - (event === zoneState.in && zone.pendingRequest === zoneState.enter)) { - zone.in = true; - this.setNotification('Enter ZONE ' + zone.Description, 'location lat: ' + location.latitude + ' lng: ' + location.longitude); - this.log('enter Zone' + zone.Description + ' ' + 'location: ' + location.latitude + ',' + location.longitude); - this.logLocation(zone.GEOF_ID, zoneState.enter, user, zone); - } - // send exit request - if (event === zoneState.exit || - (event === zoneState.out && zone.pendingRequest === zoneState.exit)) { - zone.in = false; - this.setNotification('Exit ZONE ' + zone.Description, 'location lat: ' + location.latitude + ' lng: ' + location.longitude); - this.log('exit Zone' + zone.Description + ' ' + 'location: ' + location.latitude + ',' + location.longitude); - this.logLocation(zone.GEOF_ID, zoneState.exit, user, zone); - } - } - const minDist = this.toDecimalDegrees(5000); // minimum distance location needs to be to all zones to pause service - const maxDist = this.toDecimalDegrees(10000); // Max distance used to have a factor between 0-1 - if (currentMinDist >= minDist) { - const currentDis = (currentMinDist > maxDist ? maxDist : currentMinDist); - this.pauseService((currentDis - minDist) / (maxDist - minDist)); - } - } -/* -// Checks the state of given location for the given zone -*/ - private checkLocationInZone(userLocation: LocationModel, zone: ZoneModel): zoneState { - const isIn = this.isPointInZone(userLocation.lng, userLocation.lat, zone.Longitude, - zone.Latitude, this.toDecimalDegrees(zone.Radius)); - if (isIn === false && zone.in === true) { - return zoneState.exit; - } - if (isIn === true && zone.in === false) { - return zoneState.enter; - } - if (isIn) { - return zoneState.in; - } - return zoneState.out; - } -/* -// calculates the distance between given location and given zone -*/ - private distanceFromZone(userLocation: LocationModel, zone: ZoneModel): number { - return this.distance(userLocation.lng, userLocation.lat, zone.Longitude, zone.Latitude); - } -/* -// checks if a point p is in a circular zone with center z and radius r -*/ - public isPointInZone(xp, yp, xz, yz, r): boolean { - return this.distance(xp, yp, xz, yz) < r; - } -/* -// Measures distance between two points -*/ - public distance(xp, yp, xz, yz): number { - return Math.sqrt(Math.pow(Math.abs(xp - xz), 2) + Math.pow(Math.abs(yp - yz) , 2)); - } -/* -// Convert meters to decimal degrees -*/ - public toDecimalDegrees(meters: number) { - return meters / 1000 / 111.32; - } -/* -// Pauses tracking service for a time multiplied by given factor -*/ - public pauseService(factor: number) { - if (!this.isPaused) { - this.stopTracking(); - this.isPaused = true; - // time to pause min=120 sec max=1800 sec - const time = (1680000 * factor); // time in milliseconds - this.setNotification('pausing tracking service', 'Pause for ' + time + ' FYI factor is: ' + factor); - setTimeout(() => { - this.startTracking(); - this.isPaused = false; - this.setNotification('resuming tracking service', 'Paused for ' + time + ' FYI factor is: ' + factor); - }, time); - } - } - - public startGeoFromHome() { - if (this.cs.isCordova()) { - this.isTrackingEnabled().then((result) => { - if (result) { - this.turnTrackingOff(); - this.turnTrackingOn(); - } - }).catch(() => { - // first time login, setup geofencing - // local storage should reset when user logs out - if (this.authService.isAuthenticated()) { - const user = this.authService.getAuthenticatedUser(); - this.turnTrackingOff(); - this.cs.presentConfirmDialog(this.ts.trPK('settings', 'enable-geo'), () => { - // this.turnTrackingOn(user.PatientID, +user.PatientOutSA); - }, () => { - // this.turnTrackingOn(user.PatientID, +user.PatientOutSA); - this.turnTrackingOff(); - }); - } - }); - } - } - - // ---------- TESTING FUNCTIONS -------------- // - public setNotification(title: string, text: string) { - if (this.debug) { - const date = new Date(); - date.setSeconds(date.getSeconds() + 2); - this.notif.createNotification(title, text, date, 'geofencing'); - } - } - - public printLocation(location: BackgroundGeolocationResponse, source: string) { - if (this.debug) { - console.log('-------------------------------------------------------------'); - console.log(source); - console.log(this.zonesList); - console.log(location); - console.log('location: ' + location.latitude + ', ' + location.longitude); - } - } - - public printAllLocations() { - if (this.debug) { - this.backgroundGeolocation.getLocations().then(locations => { - console.log(locations); - }); - } - } - - public log(msg: string) { - if (this.debug) { - console.log(msg); - } - } - - public toast(msg: string) { - if (this.debug) { - this.cs.toast(msg); - } - } -} diff --git a/Mohem/src/app/hmg-common/services/geofencing/models/geo-user.model.ts b/Mohem/src/app/hmg-common/services/geofencing/models/geo-user.model.ts deleted file mode 100644 index fb3a17f3..00000000 --- a/Mohem/src/app/hmg-common/services/geofencing/models/geo-user.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class GeoUserModel { - PatientID: number; - PatientOutSA: number; - isTrackingOn: boolean; -} diff --git a/Mohem/src/app/hmg-common/services/geofencing/models/insert-location.request.ts b/Mohem/src/app/hmg-common/services/geofencing/models/insert-location.request.ts deleted file mode 100644 index d85177a5..00000000 --- a/Mohem/src/app/hmg-common/services/geofencing/models/insert-location.request.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Request } from 'src/app/hmg-common/services/models/request'; - -export class InsertLocationRequest extends Request { - PointsID: number; - GeoType: number; // 1 enter 2 exit -} diff --git a/Mohem/src/app/hmg-common/services/geofencing/models/location.model.ts b/Mohem/src/app/hmg-common/services/geofencing/models/location.model.ts deleted file mode 100644 index 2bcd2035..00000000 --- a/Mohem/src/app/hmg-common/services/geofencing/models/location.model.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class LocationModel { - lat: number; - lng: number; - constructor(lat: number, lng: number, radius?: number, name?: string) { - this.lat = lat; - this.lng = lng; - } -} diff --git a/Mohem/src/app/hmg-common/services/geofencing/models/zone.model.ts b/Mohem/src/app/hmg-common/services/geofencing/models/zone.model.ts deleted file mode 100644 index 52c5e443..00000000 --- a/Mohem/src/app/hmg-common/services/geofencing/models/zone.model.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { zoneState } from '../geofencing.service'; - -export class ZoneModel { - CreatedBy?: number; - CreatedOn?: string; - Description: string; - DescriptionN?: string; - GEOF_ID?: number; - IsCity?: boolean; - Latitude: string; - Longitude: string; - ProjectID?: number; - Radius: number; - Type?: number; - in: boolean; - pendingRequest: zoneState; -} diff --git a/Mohem/src/app/hmg-common/services/user-local-notification/user-local-notification.service.spec.ts b/Mohem/src/app/hmg-common/services/user-local-notification/user-local-notification.service.spec.ts deleted file mode 100644 index f2573dd9..00000000 --- a/Mohem/src/app/hmg-common/services/user-local-notification/user-local-notification.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { UserLocalNotificationService } from './user-local-notification.service'; - -describe('UserLocalNotificationService', () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it('should be created', () => { - const service: UserLocalNotificationService = TestBed.get(UserLocalNotificationService); - expect(service).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/hmg-common/services/user-local-notification/user-local-notification.service.ts b/Mohem/src/app/hmg-common/services/user-local-notification/user-local-notification.service.ts deleted file mode 100644 index 9a7fcbdb..00000000 --- a/Mohem/src/app/hmg-common/services/user-local-notification/user-local-notification.service.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Injectable } from '@angular/core'; -import { LocalNotifications, ILocalNotification } from '@ionic-native/local-notifications/ngx'; - -export interface UserLocalData { - [key: string]: any; -} - -@Injectable({ - providedIn: 'root' -}) - -export class UserLocalNotificationService { - - public static STORAGE_KEY = 'notifications'; - constructor( - public localNotification: LocalNotifications, - ) { } - - public async requestNotificationPermission(): Promise { - const hasPermission = await this.checkNotificationPermission(); - if (!hasPermission) { - return await this.localNotification.requestPermission(); - } else { - return true; - } - } - - public async checkNotificationPermission(): Promise { - return await this.localNotification.hasPermission(); - } - - public async cancelCategoryNotifications(category: string) { - const notifications = await this.localNotification.getAll(); - for (const notification of notifications) { - const parsedData = JSON.parse(notification.data); - const notifCategory = parsedData['category']; - if (notifCategory === category) { - await this.localNotification.cancel(notification.id); - } - } - } - - public async isCategoryExist(category: string) { - const notifications = await this.localNotification.getAll(); - for (const notification of notifications) { - const parsedData = JSON.parse(notification.data); - const notifCategory = parsedData['category']; - // alert( 'notifCategory:' + notifCategory + ' category:' + category); - if (notifCategory === category) { - return true; - } - } - return false; - } - - public createNotification(title: string, text: string, date: Date, - category: string) { - const notifID = this.generateNotificationID(); - this.scheduleNotification(notifID, title, text, date, category); - } - - private scheduleNotification(notifId: number, title: string, text: string, - date: Date, category: string) { - this.localNotification.on('click').subscribe(notification => { - this.localNotification.clear(notification.id); - }); - this.localNotification.schedule({ - id: notifId, - title: title, - text: text, - trigger: {at: date}, - data : {'category': category}, - }); - } - - public deleteAllNotifications() { - this.localNotification.clearAll(); - this.localNotification.cancelAll(); - } - - public cancelNotification(notifID: number) { - this.localNotification.cancel(notifID); - } - - public clearTriggeredNotifications() { - this.localNotification.clearAll(); - } - - private generateNotificationID(): number { - return Date.now() + Math.floor(Math.random() * (1000 - 1) + 1); - } - - public async getNotifications(): Promise { - const notifs = await this.localNotification.getAll(); - return notifs; - } -} diff --git a/Mohem/src/app/hmg-common/ui/payment/payment.component.html b/Mohem/src/app/hmg-common/ui/payment/payment.component.html deleted file mode 100644 index ea7e2ddd..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/payment.component.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - {{ method.title | translate }} - - - - - - - - - - - -
-
- - - - {{'general,cancel' | translate}} - - - - -
\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/payment/payment.component.spec.ts b/Mohem/src/app/hmg-common/ui/payment/payment.component.spec.ts deleted file mode 100644 index 1ff39bb8..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/payment.component.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PaymentPage } from './payment.page'; - -describe('PaymentPage', () => { - let component: PaymentPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PaymentPage ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PaymentPage); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/hmg-common/ui/payment/payment.component.ts b/Mohem/src/app/hmg-common/ui/payment/payment.component.ts deleted file mode 100644 index f120edb1..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/payment.component.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -import { CommonService } from 'src/app/hmg-common/services/common/common.service'; -import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; -import { PaymentService } from './service/payment.service'; -import { PayRequestInfo } from './service/models/pay-request.info'; -import { PaymentInfoModel } from './service/models/payment-info.model'; -import { PaymentValidationResponse } from './service/models/payment-validation.response'; - -@Component({ - selector: 'payment', - templateUrl: './payment.component.html', - styleUrls: ['./payment.component.scss'], -}) -export class PaymentComponent implements OnInit { - - - public methods = [ - { - icon: 'visa', - title: 'payment,visa', - method: PaymentService.VISA - }, - { - icon: 'sadad', - title: 'payment,sadad', - method: PaymentService.SADAD - }, - { - icon: 'mada', - title: 'payment,mada', - method: PaymentService.MADA - }, - { - icon: 'mastercard', - title: 'payment,mastercard', - method: PaymentService.MASTERCARD - }, - { - icon: 'instalment', - title: 'payment,instalment', - method: PaymentService.INSTALMENT - } - ]; - - @Output() success = new EventEmitter(); - @Output() faild = new EventEmitter(); - @Output() cancel = new EventEmitter(); - public orderDescription: string; - public amount: number; - private requestInfo: PayRequestInfo; - constructor( - public ts: TranslatorService, - public cs: CommonService, - public paymentService: PaymentService, - public sharedData: SharedDataService - ) { } - - ngOnInit() { - - } - - @Input() set payRequestInfo(payRequestInfo: PayRequestInfo) { - this.requestInfo = payRequestInfo; - this.amount = payRequestInfo.amount; - this.orderDescription = payRequestInfo.orderDescription; - } - - get payRequestInfo(): PayRequestInfo { - return this.requestInfo; - } - - - public openPayment(method: string) { - /*this.paymentService.openPayment(this.amount, method, this.orderDescription).subscribe((success) => { - if (success) { - this.success.emit(this.requestInfo.data); - } else { - this.faild.emit(); - } - }); - */ - } - - public onComplete(info: PaymentInfoModel) { - - } - - public onCancel() { - this.cancel.emit(); - } - - -} diff --git a/Mohem/src/app/hmg-common/ui/payment/service/models/pay-request.info.ts b/Mohem/src/app/hmg-common/ui/payment/service/models/pay-request.info.ts deleted file mode 100644 index 3109cb0c..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/models/pay-request.info.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class PayRequestInfo { - public static SHARED_DATA = 'pay-request-info-shared'; - amount: number; - orderDescription: string; - data: any; -} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/payment/service/models/payment-info.model.ts b/Mohem/src/app/hmg-common/ui/payment/service/models/payment-info.model.ts deleted file mode 100644 index 16dffe1b..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/models/payment-info.model.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class PaymentInfoModel { - transactionId: string; - amount: number; - - constructor(amount: number, transactionId: string){ - this.transactionId = transactionId; - this.amount = amount; - } -} diff --git a/Mohem/src/app/hmg-common/ui/payment/service/models/payment-validation.request.ts b/Mohem/src/app/hmg-common/ui/payment/service/models/payment-validation.request.ts deleted file mode 100644 index 734f1ec5..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/models/payment-validation.request.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Request } from 'src/app/hmg-common/services/models/request'; - -export class PaymentValidationRequest extends Request { - MerchantModuleSessionID: string; - PayOneProject: number ; // 0 - PayOneService: number; // 4 - LanguageID: number; - -} diff --git a/Mohem/src/app/hmg-common/ui/payment/service/models/payment-validation.response.ts b/Mohem/src/app/hmg-common/ui/payment/service/models/payment-validation.response.ts deleted file mode 100644 index 76e3e5d7..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/models/payment-validation.response.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Response } from 'src/app/hmg-common/services/models/response'; - -export class PaymentValidationResponse extends Response { - public static SHARED_DATA = 'payment_validation_shared'; - Amount: number; - Merchant_Reference: string; - Response_Message: string; -} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/payment/service/payment.service.payfort.txt b/Mohem/src/app/hmg-common/ui/payment/service/payment.service.payfort.txt deleted file mode 100644 index 1e65b50c..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/payment.service.payfort.txt +++ /dev/null @@ -1,100 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { PaymentInfoModel } from './models/payment-info.model'; -import { PaymentValidationRequest } from './models/payment-validation.request'; -import { PaymentValidationResponse } from './models/payment-validation.response'; -import { CommonService } from 'src/app/hmg-common/services/common/common.service'; -import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; -import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; -import { GuidService } from 'src/app/hmg-common/services/guid/guid.service'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; - -@Injectable({ - providedIn: 'root' -}) -export class PaymentService { - - public static MADA = 'MADA'; - public static MASTERCARD = 'MASTERCARD'; - public static SADAD = 'SADAD '; - public static VISA = 'VISA'; - public static INSTALMENT = 'INSTALMENT'; - public static validateURL = 'Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID'; - private static SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; - - constructor( - public cs: CommonService, - public ts: TranslatorService, - public con: ConnectorService, - public authService: AuthenticationService, - public guid: GuidService - ) { } - - - public validatePayment(transactionID: string, onError: any, errorLabel: string): Observable { - const request = new PaymentValidationRequest(); - request.ClientRequestID = transactionID; - // this.authService.authenticateRequest(request); - return this.con.post(PaymentService.validateURL, request, onError, errorLabel); - } - - - public openPayment(amount: number, method: string, orderDesc: string, ): Observable { - return Observable.create(observer => { - const transactionID = this.guid.generate(); - this.cs.openBrowser( this.generateURL( amount, method, orderDesc, transactionID) , - () => this.notifyCallerDone(observer, true) , - () => this.notifyCallerDone(observer, false) ); - // this.hmgBrowser.registerBack(() => this.notifyCaller(observer, amount, transactionID)); - // this.hmgBrowser.registerClose(() => this.notifyCaller(observer, amount, transactionID)); - }); - } - - private notifyCaller(observer: any, amount: number, transactionID: string) { - observer.next(new PaymentInfoModel(amount, transactionID)) ; - observer.complete(); - } - - private notifyCallerDone(observer: any,done: boolean) { - observer.next( done) ; - observer.complete(); - } - - private generateURL( amount: number, method: string, orderDesc: string, transactionID: string): string { - let form = this.getForm(); - const user = this.authService.getAuthenticatedUser(); - if (user) { - form = form.replace('EMAIL_VALUE', user.Email || user.EmailAddress); - } - form = form.replace('AMOUNT_VALUE', (amount || 0 ).toString()); - form = form.replace('METHOD_VALUE', method); - form = form.replace('ORDER_DESCRIPTION_VALUE', orderDesc); - form = form.replace('ORDER_ID_VALUE', transactionID); - form = form.replace('SERVICE_URL_VALUE', PaymentService.SERVICE_URL); - console.log(form); - const base64URL = 'data:text/html;base64,' + btoa(form); - console.log(base64URL); - return base64URL; - } - - public getForm(): string { - return ' ' + - '' + - '' + - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
' + - '' + - '' + - ''; - } -} diff --git a/Mohem/src/app/hmg-common/ui/payment/service/payment.service.spec.ts b/Mohem/src/app/hmg-common/ui/payment/service/payment.service.spec.ts deleted file mode 100644 index 97018b11..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/payment.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { PaymentService } from './payment.service'; - -describe('PaymentService', () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it('should be created', () => { - const service: PaymentService = TestBed.get(PaymentService); - expect(service).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/hmg-common/ui/payment/service/payment.service.ts b/Mohem/src/app/hmg-common/ui/payment/service/payment.service.ts deleted file mode 100644 index 2f6a9abf..00000000 --- a/Mohem/src/app/hmg-common/ui/payment/service/payment.service.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { PaymentInfoModel } from './models/payment-info.model'; -import { PaymentValidationRequest } from './models/payment-validation.request'; -import { PaymentValidationResponse } from './models/payment-validation.response'; -import { CommonService } from 'src/app/hmg-common/services/common/common.service'; -import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; -import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; -import { GuidService } from 'src/app/hmg-common/services/guid/guid.service'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; - -import { Response } from 'src/app/hmg-common/services/models/response'; - -@Injectable({ - providedIn: 'root' -}) -export class PaymentService { - - public static MADA = 'MADA'; - public static MASTERCARD = 'MASTERCARD'; - public static SADAD = 'SADAD '; - public static VISA = 'VISA'; - public static INSTALMENT = 'INSTALMENT'; - private static SERVICE_URL = 'https://hmgwebservices.com/PayOneDev/Pay_Request.aspx'; - public static paymentStatusURL = 'Services/PayOne.svc/REST/PayOneGetRequestsByProjectServiceAndItem'; - - constructor( - public cs: CommonService, - public ts: TranslatorService, - public con: ConnectorService, - public authService: AuthenticationService, - public guid: GuidService - ) { } - - public getPaymentLanguageID(): number { - return TranslatorService.getCurrentLanguageName() == 'en' ? 1 : 0; - } - - public getPaymentStatus(transactionID: string, onError: any, errorLabel: string): - Observable { - const request = new PaymentValidationRequest(); - request.MerchantModuleSessionID = transactionID; - request.PayOneProject = 0; - request.PayOneService = 4; - request.LanguageID = this.getPaymentLanguageID(); - this.authService.authenticateRequest(request); - return this.con.postNoLoad(PaymentService.paymentStatusURL, request, onError); - } - - public openPayment(amount: number, transactionID: string, orderDesc: string): Observable { - return Observable.create(observer => { - // const transactionID = this.guid.generate(); - this.cs.openBrowser(this.generateURL(amount, orderDesc, transactionID), - () => this.notifyCallerDone(observer, true), - () => this.notifyCallerDone(observer, false), - () => this.notifyCallerDone(observer, true), - ['success' ]); - // this.hmgBrowser.registerBack(() => this.notifyCaller(observer, amount, transactionID)); - // this.hmgBrowser.registerClose(() => this.notifyCaller(observer, amount, transactionID)); - }); - } - - private notifyCaller(observer: any, amount: number, transactionID: string) { - observer.next(new PaymentInfoModel(amount, transactionID)); - observer.complete(); - } - - private notifyCallerDone(observer: any, done: boolean) { - observer.next(done); - observer.complete(); - } - - private generateURL(amount: number, orderDesc: string, transactionID: string): string { - let form = this.getForm(); - const user = this.authService.getAuthenticatedUser(); - // if (user) { - // form = form.replace('EMAIL_VALUE', user.Email || user.EmailAddress); - // } - form = form.replace('AMOUNT_VALUE', (amount || 0).toString()); - form = form.replace('ORDER_DESCRIPTION_VALUE', orderDesc); - form = form.replace('SESSION_ID_VALUE', transactionID); - form = form.replace('REQUEST_ID_VALUE', transactionID); - form = form.replace('PROJECT_ID_VALUE', 'ENTED'); - form = form.replace('SERVICE_URL_VALUE', PaymentService.SERVICE_URL); - console.log(form); - const base64URL = 'data:text/html;base64,' + btoa(form); - console.log(base64URL); - return base64URL; - } - - public getForm(): string { - return ' ' + - '' + - '' + - '
' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
' + - '' + - '' + - ''; - } -} diff --git a/Mohem/src/app/hmg-common/ui/sms/service/smsservice.ts b/Mohem/src/app/hmg-common/ui/sms/service/smsservice.ts index 42be9586..28fc9edd 100644 --- a/Mohem/src/app/hmg-common/ui/sms/service/smsservice.ts +++ b/Mohem/src/app/hmg-common/ui/sms/service/smsservice.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { UserDetailsRequest } from './model/user-details.request'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; -import { UserLocalNotificationService } from 'src/app/hmg-common/services/user-local-notification/user-local-notification.service'; +//import { UserLocalNotificationService } from 'src/app/hmg-common/services/user-local-notification/user-local-notification.service'; import { Observable } from 'rxjs'; import { Response } from 'src/app/hmg-common/services/models/response'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; @@ -26,7 +26,7 @@ export class SMSService { constructor( public con: ConnectorService, public auth: AuthenticationService, - public notifications: UserLocalNotificationService, + //public notifications: UserLocalNotificationService, public ts: TranslatorService ) { } diff --git a/Mohem/src/app/hmg-common/ui/sms/sms.page.html b/Mohem/src/app/hmg-common/ui/sms/sms.page.html index c49cc795..7560b6a0 100644 --- a/Mohem/src/app/hmg-common/ui/sms/sms.page.html +++ b/Mohem/src/app/hmg-common/ui/sms/sms.page.html @@ -8,7 +8,7 @@ - + diff --git a/Mohem/src/app/hmg-common/ui/smsdialog/service/smsdialogservice.ts b/Mohem/src/app/hmg-common/ui/smsdialog/service/smsdialogservice.ts index a37ab47d..4a301077 100644 --- a/Mohem/src/app/hmg-common/ui/smsdialog/service/smsdialogservice.ts +++ b/Mohem/src/app/hmg-common/ui/smsdialog/service/smsdialogservice.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { UserDetailsRequest } from './model/user-details.request'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; -import { UserLocalNotificationService } from 'src/app/hmg-common/services/user-local-notification/user-local-notification.service'; +//import { UserLocalNotificationService } from 'src/app/hmg-common/services/user-local-notification/user-local-notification.service'; import { Observable } from 'rxjs'; import { Response } from 'src/app/hmg-common/services/models/response'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; @@ -21,7 +21,7 @@ export class SMSDialogService { constructor( public con: ConnectorService, public auth: AuthenticationService, - public notifications: UserLocalNotificationService, + //public notifications: UserLocalNotificationService, public ts: TranslatorService ) { } diff --git a/app document/CS/Android/google-services.json b/app document/CS/Android/google-services.json new file mode 100644 index 00000000..62fbaeae --- /dev/null +++ b/app document/CS/Android/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "679409052782", + "firebase_url": "https://mohemm-dce93.firebaseio.com", + "project_id": "mohemm-dce93", + "storage_bucket": "mohemm-dce93.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", + "android_client_info": { + "package_name": "hmg.cloudSolutions.mohem" + } + }, + "oauth_client": [ + { + "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDgWjuSBIKGghWxYg_KGBRIZTi-O_UA8mU" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app document/HMG/google-services.json b/app document/HMG/google-services.json new file mode 100644 index 00000000..4dfaa0d3 --- /dev/null +++ b/app document/HMG/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "448880075189", + "firebase_url": "https://al-habib-mohemm.firebaseio.com", + "project_id": "al-habib-mohemm", + "storage_bucket": "al-habib-mohemm.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:448880075189:android:5bb4821d515a826d88b9fc", + "android_client_info": { + "package_name": "com.cloudsolutions.alhabibmohemm" + } + }, + "oauth_client": [ + { + "client_id": "448880075189-49hc2l78pr9hsmr9p3k7j411r40diej8.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyC8nrli7eyuRNow8nF-QHvDMOxqUkj6fEw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "448880075189-49hc2l78pr9hsmr9p3k7j411r40diej8.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app document/icons.zip b/app document/icons.zip new file mode 100644 index 00000000..5e769895 Binary files /dev/null and b/app document/icons.zip differ