diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..e3c7b55e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: develop-comores + +on: + push: + branches: [ "develop-comores" ] + pull_request: + branches: [ "develop-comores" ] + +jobs: + build: + name: Build APK + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + + - name: Decode keystore + run: | + echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > policies_comores.jks + + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + with: + cache-disabled: true + + - name: Build release APK + run: ./gradlew assembleComoresDevDebug + env: + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + - name: Rename APK + run: mv app/build/outputs/apk/comoresDev/debug/app-comoresDev-debug.apk policies-comores-test.apk + + - name: List APK files + run: ls -l policies-comores-test.apk + + - name: Upload APK + uses: actions/upload-artifact@v4 + with: + name: policies-comores-test.apk + path: policies-comores-test.apk diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c73fdaf8..2fde40a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - '*' + - 'develop-comores' # tags: # - '!v*' @@ -27,26 +27,26 @@ jobs: - name: build run: | - ./gradlew assembleDebug --stacktrace + ./gradlew assemblecomoresDevDebug --stacktrace - name: Environment info run: | gradle --version - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: openimis-policies-apk-${{github.run_number}}-${{github.sha}} + name: policies-comores-apk-${{github.run_number}}.apk path: ./app/build/outputs/**/*.apk - name: build run: | - ./gradlew bundleDebug --stacktrace + ./gradlew bundlecomoresDevDebug --stacktrace - name: Environment info run: | gradle --version - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: openimis-policies-aab-${{github.run_number}}-${{github.sha}} + name: policies-comores-aab-${{github.run_number}}.aab path: ./app/build/outputs/**/*.aab diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index afb900a3..1bb4af90 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -6,27 +6,7 @@ on: api_base_url: description: URL of the REST API required: true - default: https://release.openimis.org/rest/ - app_name: - description: Display name of the application - required: false - default: Policies Manual - app_dir: - description: Name of the folder in Documents, default IMIS-CLI - required: false - application_id: - description: Fully qualified name of the app - required: true - default: org.openimis.imispolicies.cli - cli_java_dir: - description: java source folder for custom functions. Only works with application_id_suffix .cli - required: false - cli_res_dir: - description: Resources folder for icons. Only works with application_id_suffix .cli - required: false - cli_assets_dir: - description: Asserts folder for images, json files.... Only works with .cli - required: false + default: https://test.amg.km/rest/ # Branch is chosen by default in github manual actions jobs: @@ -34,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup JDK 17 uses: actions/setup-java@v2 @@ -43,14 +23,14 @@ jobs: java-version: '17' cache: 'gradle' - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: | ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-${{ github.event.inputs.application_id }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: | ~/.android @@ -62,31 +42,19 @@ jobs: echo url ${{ github.event.inputs.api_base_url }} echo app name ${{ github.event.inputs.app_name }} - echo app dir ${{ github.event.inputs.app_dir }} - echo CLI_JAVA_DIR "${{ github.event.inputs.cli_java_dir }}" - echo CLI_RES_DIR "${{ github.event.inputs.cli_res_dir }}" - echo CLI_ASSETS_DIR "${{ github.event.inputs.cli_assets_dir }}" - echo APPLICATION_ID "${{ github.event.inputs.application_id }}" - - name: build run: | - ./gradlew assembleCliDebug --stacktrace + ./gradlew assembleComoresDevDebug --stacktrace env: API_BASE_URL: "${{ github.event.inputs.api_base_url }}" - CLI_APP_NAME: "${{ github.event.inputs.app_name }}" - CLI_APP_DIR: "${{ github.event.inputs.app_dir }}" - CLI_JAVA_DIR: "${{ github.event.inputs.cli_java_dir }}" - CLI_RES_DIR: "${{ github.event.inputs.cli_res_dir }}" - CLI_ASSETS_DIR: "${{ github.event.inputs.cli_assets_dir }}" - APPLICATION_ID: "${{ github.event.inputs.application_id }}" - name: Environment info run: | gradle --version - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: openimis-policies-apk-${{github.run_number}}-${{github.sha}} + name: policies-comores-apk-${{github.run_number}}.apk path: ./app/build/outputs/**/*.apk # - name: build diff --git a/.gitignore b/.gitignore index f9061fb5..8cb4b228 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,7 @@ fastlane/test_output fastlane/readme.md app/release/output.json -**/.DS_Store +.DS_Store # Custom product flavours diff --git a/LICENSE.md b/LICENSE.md index 85f8c871..9cfaf249 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -11,3 +11,4 @@ Limitation of Liability In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who modifies and/or conveys the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages. In case of dispute arising out or in relation to the use of the program, it is subject to the public law of Switzerland. The place of jurisdiction is Berne. + diff --git a/README.md b/README.md index 884f6271..cc418862 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,6 @@ In order to use and develop the openIMIS IMIS Android Application on your local machine, you first need to install: * [Android Studio with Android SDK](https://developer.android.com/studio) -* [openIMIS Web Services](https://github.com/openimis/web_service_vb) - ### Installation diff --git a/app/build.gradle b/app/build.gradle index b19ba210..be89e679 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,7 +38,7 @@ android { minSdkVersion 21 targetSdkVersion 33 versionCode gitVersionCode - versionName gitVersionName + versionName "1.3.5" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' vectorDrawables { useSupportLibrary = true @@ -92,6 +92,13 @@ android { resValue "string", "app_name_policies", "Policies Release" dimension = 'std' } + comoresDev { + applicationId "org.openimis.imispolicies.comoresDev" + buildConfigField "String", "API_BASE_URL", '"https://dev.amg.km/"' + resValue "string", "app_name_policies", "Policies Comores Dev" + dimension = 'std' + resValue "string", "release_tag", "comores-dev" + } chfDev { applicationId "org.openimis.imispolicies.chfdev" buildConfigField "String", "API_BASE_URL", '"http://chf-dev.swisstph-mis.ch/"' @@ -152,6 +159,9 @@ android { } } sourceSets { + comoresDev.java.srcDir 'src/master/java' + comoresDev.res.srcDirs = ['src/master/res', 'src/localeMv/res'] + chfDev.java.srcDir 'src/chf/java' chfDev.res.srcDirs = ['src/chf/res', 'src/localeChf/res'] @@ -244,5 +254,4 @@ dependencies { androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - testImplementation 'junit:junit:4.13.2' } diff --git a/app/csuDev/release/policies-vih.aab b/app/csuDev/release/policies-vih.aab new file mode 100644 index 00000000..44a9d994 Binary files /dev/null and b/app/csuDev/release/policies-vih.aab differ diff --git a/app/src/localeMv/res/values-en/strings.xml b/app/src/localeMv/res/values-en/strings.xml index 9d113651..de5759e5 100644 --- a/app/src/localeMv/res/values-en/strings.xml +++ b/app/src/localeMv/res/values-en/strings.xml @@ -207,6 +207,7 @@ Release Date Total Families Total Insurees + Total Attachments Total Policies Total Contributions Upload Enrolments @@ -477,4 +478,16 @@ Current resource language: %1$s Current system language is not supported. The app will use the default language. Supported languages:\n%1$s + Payment day + Periodicity + Check for updates + + + Select disability + Select disease + Select coverage + Select housing + + Members of the monogamous household + Heads of polygamous sub-households diff --git a/app/src/localeMv/res/values-fr/strings.xml b/app/src/localeMv/res/values-fr/strings.xml index e0675292..4d010979 100644 --- a/app/src/localeMv/res/values-fr/strings.xml +++ b/app/src/localeMv/res/values-fr/strings.xml @@ -14,21 +14,21 @@ Synchroniser A propos Quitter - Région - District - Section - Village/GO - Situation de pauvreté + Îles + District sanitaire + Commune + Localité + Démuni Type de confirmation No. de confirmation - Type de groupe + Statut du chef de ménage Ethnicité - Adresse permanente + Détails de l\'adresse Suivant Choisir une Région Choisir un district Choisir une section - Choisir un village/GO + Choisir une localité Oui Non Sélectionner le statut de pauvreté @@ -44,8 +44,8 @@ État matrimonial Carte de bénéficiaire District actuel - Municipalité actuelle - Village actuel + Commune actuelle + Localité actuel Adresse actuelle Profession Éducation @@ -63,8 +63,9 @@ Sélectionner l\'état civil Marié Célibataire - Divorcé - Veuf + Divorcé(e) + Veuf/Veuve + Famille polygame Non spécifié Sélectionner la carte de bénéficiaire Choisir un métier @@ -76,7 +77,7 @@ Hôpital Choisir une FOSA Sauvegarder - Relation + Relation du chef de ménage Sélectionner une relation Famille enregistrée avec succès Une erreur s\'est produite lors du traitement des données. @@ -95,19 +96,19 @@ Date d\'expiration Agent Statut du contrat : - Valeur du contrat : + Valeur du contrat d\'assurance : Solde : - Contribution : + Cotisation : Recherche Payeur Date de paiement - Catégorie de contribution + Catégorie de cotisation Numéro du reçu - Contribution payée + Cotisation payée Type de paiement Sélectionnez Payeur Sélectionner le niveau - Contribution et autres + Cotisation et autres Frais de photo Sélectionnez le type de paiement Argent liquide @@ -119,14 +120,16 @@ En attente Suspendu Le numéro de reçu doit être unique. - Le contrat a une contribution. Veuillez d\'abord supprimer les contributions + Le contrat a une cotisation. Veuillez d\'abord supprimer les cotisations Contrat avec succès - Contribution supprimée avec succès + Cotisation supprimée avec succès Assuré supprimé avec succès Vous ne pouvez pas supprimer le chef de famille. La famille a un contrat, veuillez d\'abord supprimer le contrat. Assuré non supprimé Famille supprimée + Sous-famille supprimée + Sous-famille détachée Scanner Nom de l\'assuré La carte SD est en mode lecture seule. Veuillez régler le mode de lecture/écriture et redémarrer l\'application. @@ -207,8 +210,9 @@ Date de sortie Total de familles : Total des assurés : + Total des pièces jointes : Total des contrats : - Total des contributions : + Total des cotisations : Téléverser les adhésions Créer un XML d\'adhésions Téléverser les renouvellements @@ -222,8 +226,8 @@ Famille et contrats Ajouter/Modifier assuré Ajouter/Modifier le contrat - Contributions - Ajouter/Modifier la contribution + Cotisations + Ajouter/Modifier la cotisation Voulez-vous quitter openIMIS ? Téléverser le rapport OK @@ -262,13 +266,13 @@ Familles éditées Assurés édités Contrats révisés - Contributions éditées + Cotisations éditées Numéro d\'assurance introuvable Numéro d\'assurance requis Suppression... Une connexion Internet est nécessaire pour supprimer des données en ligne. Veuillez d\'abord vous connecter pour supprimer les données en ligne. - La suppression d\'un contrat supprimera également les contributions qui s\'y trouvent. + La suppression d\'un contrat supprimera également les cotisations qui s\'y trouvent. La suppression de la famille supprimera également tous les assurés, les polices et les cotisations de cette famille. Confirmer Déconnexion @@ -283,14 +287,14 @@ Échec de la création de XML Aucune donnée n\'a été créée S\'il vous plaît entrer le numéro d\'assuré - sans contrat/contribution + sans contrat/cotisation sans photo Échec du téléversement Supprimé avec succès Email invalide ! Échec sur le serveur, la mise à jour des données a échouée ! - Le prix du contrat est couvert. Voulez-vous toujours ajouter une contribution ? - La contribution dépasse le prix du contrat. + Le prix du contrat est couvert. Voulez-vous toujours ajouter une cotisation ? + La cotisation dépasse le prix du contrat. Le prix du contrat n\'est pas encore couvert, veuillez sélectionner l\'action à effectuer. Rapports @@ -304,7 +308,7 @@ Nombre de contrats renouvelés Nombre de contrats expirés Nombre de familles avec contrats suspendus - Montant de la contribution collectée + Montant de la cotisation collectée Statistiques actuelles Créer le XML des retours Créer des renouvellements XML @@ -340,7 +344,7 @@ Effacer Demandé Nombre de polices trouvé - Montant de la contribution + Montant de la cotisation Processus Complet Veuillez sélectionner un police Succès @@ -380,7 +384,7 @@ Demande pour polices non enregistrées Numéro de téléphone non fourni Les produits d\'assurance des polices sélectionnées ne sont pas uniques - Montant de la contribution + Montant de la cotisation Choisir la date Obtenir Date du @@ -456,25 +460,82 @@ Wait Suspend Enforce - without a policy - without a premium + sans contrat + sans cotisation HTTP response: %1$d — %2$s No policies registered. This cheque number already used This cheque number was aborted Could not download cheque numbers data - Policy Status: Covered - Policy Status: Not Covered - Policy Status + Statut du contrat: Couvert + Statut du contrat: Non couvert + Statut du contrat This cheque number not exist - Please add a picture + Veuillez ajouter une photo Entry does not exist. Authorization failed. Unknown Error. You are not allowed to take this action. fr - Language settings + Langue Current resource language: %1$s Current system language is not supported. The app will use the default language. Supported languages:\n%1$s + Paiement mobile + Prélèvement bancaire + Versement compte AMG + Choisir une méthode de paiement + Méthode de paiement + Situation Professionnelle + Autre Ménage + Choisir le niveau de revenu + Niveau de revenu + Choisir l\'environnement de residence + Environnement de residence + Famille et sous-familles + Ajouter une sous-famille + Détacher + Erreur lors du détachement de la sous-famille + Le détachement de la sous-famille transformera celle-ci en famille simple + Le numéro d\'identification doit contenir 7 ou 9 caractères + Sél. un régime de cotisation + Régime de cotisation + Numéro du compte + Périodicité + Date de signature + Pièces jointes + Aucun fichier + Titre + Fichier + Aucun fichier ajouté + Suppression de la pièce jointe + Pièce jointe supprimée avec succès + Aucune pièce jointe trouvée. Veuillez ajouter une pièce jointe + Famille polygame + Jour de paiement + Vérification des mises à jour + Mise à jour + Mise à jour disponible + Télécharger + Aucune mise à jour disponible + Téléchargement démarré + Virement Bancaire + Aucun + Échec de connexion. Veuillez réessayer + Pièces jointes famille + Pour ce régime de cotisation la périodicité doit être supérieure ou égale à + Impossible d\'attribuer une pièce jointe à une famille polygame + Inclure le chef de ménage + Êtes-vous sûre de vouloir rattacher le chef de ménage à la sous-famille? + Le chef de ménage a été attaché avec succès + Le chef de ménage est déjà attaché à cette sous-famille + + + Sélectionner incapacité + Sélectionner maladie + Sélectionner couverture + Sélectionner logement + + Membres de la famille du ménage monogame + Les chefs de ménages des sous-foyers polygamiques diff --git a/app/src/localeMv/res/values/strings.xml b/app/src/localeMv/res/values/strings.xml index 9d113651..22ea3a00 100644 --- a/app/src/localeMv/res/values/strings.xml +++ b/app/src/localeMv/res/values/strings.xml @@ -207,6 +207,7 @@ Release Date Total Families Total Insurees + Total Attachments Total Policies Total Contributions Upload Enrolments @@ -477,4 +478,27 @@ Current resource language: %1$s Current system language is not supported. The app will use the default language. Supported languages:\n%1$s + Mobile Money + Bank debit + Unknow pay + Select payment method + Payment method + Professional Situation + Other Household + Select Income Level + Income Level + Select Residence Environment + Residence Environment + Periodicity + Signing Date + Attachment + No File + Title + File + No file added + Deleting of Attachment + Attachment deleted successfully + No attachment added. Please add attachment to continue + Polygamous family + Check for updates diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5a88ad6d..31e5ab66 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -30,6 +30,7 @@ tools:node="remove" /> + + + + Add/Edit Attachments + + + + + + + + + + + +
+ +
+
+ +
    +
  • + Title + +
  • +
  • + File + +
  • +
    + New +
    +
+
    +
  • +
    + +
    +
    +

    +
    +
    +

    +
    +
  • +
+
+ + + \ No newline at end of file diff --git a/app/src/main/assets/pages/Attachment.js b/app/src/main/assets/pages/Attachment.js new file mode 100644 index 00000000..49bcb5dc --- /dev/null +++ b/app/src/main/assets/pages/Attachment.js @@ -0,0 +1,129 @@ +$(document).ready(function () { + + document.title = Android.getString('FamilyAndAttachment'); + + var FamilyId = queryString("f"); + var subFamilyId = queryString("s"); + var isSubfamily = queryString("isSubfamily") + var AttachmentTitle = ""; + var AttachmentName = ""; + var AttachmentId = 0; + + LoadAttachments(); + + + $('.ulList li').click(function () { + AttachmentTitle = $(this).find('#AttachmentTitle').text(); + AttachmentName = $(this).find('#AttachmentFile').text(); + AttachmentId = parseInt($(this).find('#AttachmentId').val()); + }); + + + $('#btnAddNew').click(function () { + var passed = isFormValidated(); + + if (passed == true) { + var title = $('#txtTitleAttachment').val(); + var file = $('#txtFileAttachment').val(); + + if(isSubfamily == 1){ + Android.addAttachment(parseInt(subFamilyId),title, file); + window.location.reload(); + } else { + Android.addAttachment(parseInt(FamilyId),title, file); + window.location.reload(); + } + } else + Android.ShowDialog(Android.getString('FieldRequired')); + + $('#txtTitleAttachment').val(""); + $('#txtFileAttachment').val(""); + }); + + $('#btnSave').click(function () { + $("#divProgress").show(); + + if(isSubfamily == 1){ + if ( Android.getFamilyAttachments(parseInt(queryString('s'))) === "[]"){ + $("#divProgress").hide(); + Android.ShowDialog(Android.getString('AttachmentNotFound')); + } else { + Android.SaveFamilyAttachments(subFamilyId); + window.open("FamilySubFamilies.html?f=" + FamilyId, "_self"); + } + } else { + if ( Android.getFamilyAttachments(parseInt(queryString('f'))) === "[]"){ + $("#divProgress").hide(); + Android.ShowDialog(Android.getString('AttachmentNotFound')); + } else { + Android.SaveFamilyAttachments(FamilyId); + window.open("Enrollment.html", "_self"); + } + } + }); + + $('#txtFileAttachment').click(function () { + Android.showAttachmentDialog(); + }); + + AssignDotClass(); + contextMenu.createContextMenu([Android.getString('Delete')], function () { + var clicked = $(this).text(); + + if (clicked == Android.getString('Delete')) { + var AttachmentDeleted = -1; + $('#msgAlert').text(Android.getString('DeleteAttachment')); + var deletedSuccess = -1; + $("#dialog-confirm").dialog({ + resizable: false, + height: "auto", + width: 350, + modal: true, + buttons: [ + { + text: Android.getString("Ok"), + click: function () { + AttachmentDeleted = parseInt(Android.DeleteAttachment(parseInt(subFamilyId),AttachmentId,AttachmentTitle, AttachmentName)); + + if (AttachmentDeleted == 1) { + Android.ShowDialog(Android.getString('AttachmentDeleted')); + location.reload() + } + $(this).dialog("close"); + } + }, + { + text: Android.getString("Cancel"), + click: function () { + $(this).dialog("close"); + } + } + ] + }); + } + }); + + +}); + +// called from java after attachment was selected by the user +function selectAttachmentCallback(attachName) { + $('#txtFileAttachment').val(attachName); +} + +function LoadAttachments() { + var Attachments; + if(queryString('isSubfamily') == 1){ + Attachments = Android.getFamilyAttachments(parseInt(queryString('s'))); + } else { + Attachments = Android.getFamilyAttachments(parseInt(queryString('f'))); + } + var ctls = ["AttachmentTitle", "AttachmentFile", "AttachmentId"]; + var Columns = ["Title", "Filename", "Id"]; + LoadList(Attachments, '.ulList', ctls, Columns); +} + +function AssignDotClass() { + var $lis = $(".ulList li"); + $lis.addClass("dot-side-menu"); +} \ No newline at end of file diff --git a/app/src/main/assets/pages/Enrollment.html b/app/src/main/assets/pages/Enrollment.html index fd96b4c2..45ae44af 100644 --- a/app/src/main/assets/pages/Enrollment.html +++ b/app/src/main/assets/pages/Enrollment.html @@ -50,7 +50,8 @@
-

+ +
diff --git a/app/src/main/assets/pages/Enrollment.js b/app/src/main/assets/pages/Enrollment.js index 302a2e5d..e9df76d6 100644 --- a/app/src/main/assets/pages/Enrollment.js +++ b/app/src/main/assets/pages/Enrollment.js @@ -13,17 +13,22 @@ $(document).ready(function () { $('.ulList li').click(function () { FamilyId = parseInt($(this).find('#hfFamilyId').val()); + FamilyType = $(this).find('#hfFamilyType').val(); // }); AssignDotClass(); - contextMenu.createContextMenu([Android.getString('Edit'), Android.getString('Delete')], function () { + contextMenu.createContextMenu([Android.getString('Edit'), Android.getString('Delete'), Android.getString('Attachment')], function () { var clicked = $(this).text(); if (clicked == Android.getString('Edit')) { var url = 'Enrollment.html?f=' + FamilyId; Android.SetUrl(url); - window.open('FamilyAndInsurees.html?f=' + FamilyId, '_self'); + if(FamilyType == "P"){ + window.open('FamilyPolygamy.html?f=' + FamilyId, '_self'); + }else{ + window.open('FamilyAndInsurees.html?f=' + FamilyId, '_self'); + } } else if (clicked == Android.getString('Delete')) { var isOffline = Android.getFamilyStat(FamilyId); @@ -57,7 +62,6 @@ $(document).ready(function () { LoadFamilies(); } if (deletedSuccess == 1) { - Android.ShowDialog(Android.getString('FamilyDeleted')); window.open('Enrollment.html', '_self'); } else if (deletedSuccess == -1) { @@ -81,13 +85,24 @@ $(document).ready(function () { ] }); } + else if(clicked == Android.getString('Attachment')){ + if(FamilyType == "P"){ + //print message + Android.ShowToast(Android.getString('CannotAddAttachment')) + }else { + var url = 'Enrollment.html?f=' + FamilyId; + Android.SetUrl(url); + window.open("Attachment.html?f=" + FamilyId, "_self"); + } + + } }); }); function LoadFamilies() { var Families = Android.getAllFamilies(); - var ctls = ["hfFamilyId", "InsuranceNumber", "InsureeName", "Region", "District", "Ward", "Village", "FamilyId", "spFamilyId", "hfIsOffline"]; - var Columns = ["FamilyId", "CHFID", "InsureeName", "RegionName", "DistrictName", "WardName", "VillageName", "FamilyId", "FamilyId", "isOffline"]; + var ctls = ["hfFamilyId", "InsuranceNumber", "InsureeName", "Region", "District", "Ward", "Village", "FamilyId", "spFamilyId", "hfIsOffline", "hfFamilyType"]; + var Columns = ["FamilyId", "CHFID", "InsureeName", "RegionName", "DistrictName", "WardName", "VillageName", "FamilyId", "FamilyId", "isOffline", "FamilyType"]; LoadList(Families, '.ulList', ctls, Columns); } diff --git a/app/src/main/assets/pages/Family.html b/app/src/main/assets/pages/Family.html index 3e23c8c9..543c893c 100644 --- a/app/src/main/assets/pages/Family.html +++ b/app/src/main/assets/pages/Family.html @@ -58,17 +58,17 @@ Poverty Status -
  • +
  • Confirmation Type
  • -
  • +
  • Confirmation No.
  • Group Type - +
  • Ethnicity @@ -78,11 +78,11 @@ Permanent Address Details
  • -
  • +
  • Allow SMS Messages
  • -
  • +
  • Language of SMS
  • diff --git a/app/src/main/assets/pages/Family.js b/app/src/main/assets/pages/Family.js index aab55fbd..67ec2037 100644 --- a/app/src/main/assets/pages/Family.js +++ b/app/src/main/assets/pages/Family.js @@ -88,6 +88,7 @@ function fillDropdowns() { function saveFamilyLocally() { var jsonFamily = getControlsValuesJSON('li'); + sessionStorage.setItem("FamilyType",$('#ddlGroupType').val()) sessionStorage.setItem("FamilyData", jsonFamily); } @@ -127,12 +128,12 @@ function getVillages(WardId) { var $Villages = Android.getVillages(parseInt(WardId.toString())); var rows = JSON.parse($Villages).length; if (rows == 1) SelectText = null; - bindDropdown('ddlVillage', $Villages, 'LocationId', 'LocationName', 0, SelectText); + bindDropdown('ddlVillage', $Villages, 'LocationId', 'LocationName', null, SelectText); } function getPovertyStatus() { var $YesNo = Android.getYesNo(); - bindDropdown('ddlPovertyStatus', $YesNo, 'value', 'key', null, Android.getString('SelectPovertyStatus')); + bindDropdown('ddlPovertyStatus', $YesNo, 'value', 'key', null, ""); } function getConfirmationTypes() { @@ -150,7 +151,7 @@ function getFamilyTypes() { $textLanguage = "AltLanguage"; } var $FamilyTypes = Android.getGroupTypes(); - bindDropdown('ddlGroupType', $FamilyTypes, 'FamilyTypeCode', $textLanguage, 0, Android.getString('SelectFamilyType')); + bindDropdown('ddlGroupType', $FamilyTypes, 'FamilyTypeCode', $textLanguage, null, ""); } function getApprovalOfSMS() { diff --git a/app/src/main/assets/pages/FamilyAndInsurees.html b/app/src/main/assets/pages/FamilyAndInsurees.html index ca680129..14538d92 100644 --- a/app/src/main/assets/pages/FamilyAndInsurees.html +++ b/app/src/main/assets/pages/FamilyAndInsurees.html @@ -74,7 +74,7 @@
    -

    +
    diff --git a/app/src/main/assets/pages/FamilyAndInsurees.js b/app/src/main/assets/pages/FamilyAndInsurees.js index df490301..eeeb5efd 100644 --- a/app/src/main/assets/pages/FamilyAndInsurees.js +++ b/app/src/main/assets/pages/FamilyAndInsurees.js @@ -3,14 +3,22 @@ $(document).ready(function () { document.title = Android.getString('FamilyAndInsurees'); var FamilyId = queryString("f"); + var parentId = queryString("p"); + var isPolygamy = queryString("isPolygamy"); + var isSubfamily = queryString("isSubfamily"); var LocationId = null; var RegionId = null; var DistrictId = null; var InsureeId = null; var Action = null; - var url = 'Enrollment.html?f=' + FamilyId; - Android.SetUrl(url); + if(isSubfamily != 1){ + var url = 'Enrollment.html?f=' + FamilyId; + Android.SetUrl(url); + }else { + var url = 'FamilySubFamilies.html?f=' + parentId; + Android.SetUrl(url); + } if (FamilyId != 0) { LoadFamilyHeader(parseInt(FamilyId)) @@ -49,7 +57,7 @@ $(document).ready(function () { if (clicked == Android.getString('Edit')) { var url = 'FamilyAndInsurees.html?f=' + FamilyId; Android.SetUrl(url); - window.open("Insuree.html?i=" + InsureeId + "&f=" + FamilyId, "_self"); + window.open("Insuree.html?i=" + InsureeId + "&f=" + FamilyId + "&isPolygamy=" + isPolygamy, "_self"); } else if (clicked == Android.getString('Delete')) { //$("#divProgress").show(); diff --git a/app/src/main/assets/pages/FamilyPolicies.html b/app/src/main/assets/pages/FamilyPolicies.html index 2b760342..45d8035f 100644 --- a/app/src/main/assets/pages/FamilyPolicies.html +++ b/app/src/main/assets/pages/FamilyPolicies.html @@ -51,7 +51,7 @@
    -

    +