Skip to content

Commit

Permalink
edit app for csu
Browse files Browse the repository at this point in the history
  • Loading branch information
jobil committed Oct 26, 2023
2 parents 6e8854f + 3a0f658 commit 99dc1a5
Show file tree
Hide file tree
Showing 30 changed files with 245 additions and 64 deletions.
11 changes: 11 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static def getDate() {
android {
compileSdk 33
buildToolsVersion = '33.0.0'
useLibrary 'org.apache.http.legacy'

if (keystorePropertiesFile.exists()) {
signingConfigs {
releaseConfig {
Expand Down Expand Up @@ -100,6 +102,12 @@ android {
resValue "string", "app_name_policies", "Policies CHF DEV"
dimension = 'std'
}
csuDev {
applicationId "org.openimis.imispolicies.csuDev"
buildConfigField "String", "API_BASE_URL", '"https://dev-csuapps.minsante.cm/"'
resValue "string", "app_name_policies", "Enrolement CSU"
dimension = 'std'
}
mvDev {
applicationId "org.openimis.imispolicies.mv"
buildConfigField "String", "API_BASE_URL", '"http://imis-mv.swisstph-mis.ch/"'
Expand Down Expand Up @@ -163,6 +171,9 @@ android {
bephaDev.java.srcDir 'src/bepha/java'
bephaDev.res.srcDirs = ['src/bepha/res', 'src/localeBepha/res']

csuDev.java.srcDir 'src/csu/java'
csuDev.res.srcDirs = ['src/csu/res', 'src/localeCsu/res']

niger.java.srcDir 'src/niger/java'
niger.res.srcDir 'src/niger/res'
niger.assets.srcDir 'src/niger/assets'
Expand Down
47 changes: 47 additions & 0 deletions app/src/csu/java/org/openimis/imispolicies/Escape.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//Copyright (c) 2016-%CurrentYear% Swiss Agency for Development and Cooperation (SDC)
//
//The program users must agree to the following terms:
//
//Copyright notices
//This program is free software: you can redistribute it and/or modify it under the terms of the GNU AGPL v3 License as published by the
//Free Software Foundation, version 3 of the License.
//This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL v3 License for more details www.gnu.org.
//
//Disclaimer of Warranty
//There is no warranty for the program, to the extent permitted by applicable law; except when otherwise stated in writing the copyright
//holders and/or other parties provide the program "as is" without warranty of any kind, either expressed or implied, including, but not
//limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and
//performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.
//
//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.

package org.openimis.imispolicies;

public class Escape {
public int CheckInsuranceNumber(String InsuranceNumber){

if (InsuranceNumber.length() == 0){
return R.string.MissingInsuranceNumber;
}

if (!isValidInsuranceNumber(InsuranceNumber)){
return R.string.InvalidInsuranceNumber;

}

return 0;
}

private boolean isValidInsuranceNumber(String InsuranceNumber){
return true;
}

}
14 changes: 7 additions & 7 deletions app/src/main/assets/pages/Family.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,35 @@
<span strName="Village">Village</span>
<select id="ddlVillage" datafield="VillageId" required></select>
</li>
<li id="Poverty">
<li style="display:none;">
<span strName="PovertyStatus">Poverty Status</span>
<select id="ddlPovertyStatus" datafield="Poverty"></select>
</li>
<li id="Confirmation">
<li style="display:none;">
<span strName="ConfirmationType">Confirmation Type</span>
<select id="ddlConfirmationType" datafield="ConfirmationType"></select>
</li>
<li id="ConfirmationNo">
<li style="display:none;">
<span strName="ConfirmationNo">Confirmation No.</span>
<input type="text" id="txtConfirmationNo" datafield="ConfirmationNo"/>
</li>
<li id="FamilyType">
<li style="display:none;">
<span strName="GroupType">Group Type</span>
<select id="ddlGroupType" datafield="FamilyType"></select>
</li>
<li style="display:none;">
<span strName="Ethnicity">Ethnicity</span>
<select id="ddlEthnicity" datafield="Ethnicity"></select>
</li>
<li id="PermanentAddress">
<li style="display:none;">
<span strName="PermanentAddress">Permanent Address Details</span>
<textarea id="txtPermanentAddress" datafield="FamilyAddress"></textarea>
</li>
<li id="ApprovalOfSMS">
<li style="display:none;" >
<span strName="approvalOfSMS">Allow SMS Messages</span>
<select id="ddlApprovalOfSMS" datafield="ApprovalOfSMS"></select>
</li>
<li id="LanguageOfSMS">
<li style="display:none;">
<span strName="languageOfSMS">Language of SMS</span>
<select id="ddlLanguageOfSMS" datafield="LanguageOfSMS"></select>
</li>
Expand Down
56 changes: 28 additions & 28 deletions app/src/main/assets/pages/Insuree.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,104 +48,104 @@
<input type="hidden" datafield="InsureeId" id="hfInsureeId" value="0"/>
<input type="hidden" datafld="isOffline" id="hfIsOffline" value="."/>
<input type="hidden" datafield="isHead" id="hfisHead" value="-1"/>
<span strName="InsuranceNumber">Insurance Number</span>
<span strName="csuNumber">Insurance Number</span>
<div style="display:flex">
<input type="text" maxlength="12" id="txtInsuranceNumber" dataField="CHFID" onkeyup="getImage()" min="0" required />
<img src="" alt="Scan" id="btnScan" style="width:50px !important" />
</div>
</li>
<li>
<li style="display:none;">
<span strName="OtherNames">Other Names</span>
<input type="text" maxlength="50" id="txtOtherNames" dataField="OtherNames" required/>
<input type="text" maxlength="50" id="txtOtherNames" dataField="OtherNames" />
</li>
<li>
<li style="display:none;">
<span strName="LastName">Last Name</span>
<input type="text" maxlength="50" id="txtLastName" dataField="LastName" required/>
<input type="text" maxlength="50" id="txtLastName" dataField="LastName" />
</li>
<li>
<li style="display:none;">
<input type="hidden" id="hfImagePath" datafield="PhotoPath" />
<input type="hidden" id="hfNewPhotoPath" datafield="newPhotoPath" />
<div id="imgDiv">
<img src="" alt="Image" onerror="noImage(this);" id="imgInsuree"/>
</div>
</li>
<li>
<li style="display:none;">
<span strName="BirthDate">Birth date</span>
<input type="date" id="txtBirthDate" dataField="DOB" required/>
<input type="date" id="txtBirthDate" dataField="DOB" />
</li>
<li>
<li style="display:none;">
<span strName="Gender">Gender</span>
<select id="ddlGender" datafield="Gender" required></select>
<select id="ddlGender" datafield="Gender" ></select>
</li>
<li id="MaritalStatus">
<li style="display:none;" >
<span strName="MaritalStatus">Marital Status</span>
<select id="ddlMaritalStatus" datafield="Marital"></select>
</li>
<li id="BeneficiaryCard">
<li style="display:none;">
<span strName="BeneficiaryCard">Beneficiary Card</span>
<select id="ddlBeneficiaryCard" datafield="CardIssued"></select>
</li>
<li id="CurrentRegion">
<li style="display:none;">
<span strName="CurrentRegion">Current Region</span>
<select id="ddlCurrentRegion" datafield="CurRegion"></select>
</li>
<li id="CurrentDistrict">
<li style="display:none;">
<span strName="CurrentDistrict">Current District</span>
<select id="ddlCurrentDistrict" datafield="CurDistrict"></select>
</li>
<li id="CurrentMunicipality">
<li style="display:none;">
<span strName="CurrentMunicipality">Current Municipality</span>
<select id="ddlCurrentMunicipality" datafield="CurWard"></select>
</li>
<li id="CurrentVillage">
<li style="display:none;">
<span strName="CurrentVillage">Current Village</span>
<select id="ddlCurrentVillage" datafield="CurVillage"></select>
</li>
<li id="CurrentAddress">
<li style="display:none;">
<span strName="CurrentAddress">Current Address</span>
<textarea id="txtCurrentAddress" maxlength="200" datafield="CurrentAddress"></textarea>
</li>
<li id="Profession">
<li style="display:none;">
<span strName="Profession">Profession</span>
<select id="ddlProfession" datafield="Profession"></select>
</li>
<li id="Education">
<li style="display:none;">
<span strName="Education">Education</span>
<select id="ddlEducation" datafield="Education"></select>
</li>
<li>
<li style="display:none;">
<span strName="PhoneNumber">Phone number</span>
<input type="number" id="txtPhoneNumber" datafield="Phone" maxlength="50"/>
</li>
<li id="InsureeEmail">
<li style="display:none;">
<span strName="Email">Email</span>
<input type="email" maxlength="200" id="txtEmail" datafield="Email"/>
</li>
<li id="IdentificationType">
<li style="display:none;">
<span strName="IdentificationType">Identification Type</span>
<select id="ddlIdentificationType" datafield="TypeOfId"></select>
</li>
<li id="IdentificationNumber">
<li style="display:none;">
<span strName="IdentificationNumber">Identification Number</span>
<input type="text" id="txtIdentificationNumber" maxlength="50" datafield="IdentificationNumber"/>
</li>
<li id="Vulnerability">
<li style="display:none;">
<span strName="Vulnerability">Vulnerability</span>
<select id="ddlVulnerability" datafield="Vulnerability"></select>
</li>
<li id="FSPRegion">
<li style="display:none;">
<span strName="FSPRegion"></span>
<select id="ddlFSPRegion" datafield="FSPRegion"></select>
</li>
<li id="FSPDistrict">
<li style="display:none;">
<span strName="FSPDistrict">District of FSP</span>
<select id="ddlFSPDistrict" datafield="FSPDistrict"></select>
</li>
<li id="FSPCategory">
<li style="display:none;">
<span strName="FSPCategory">Level of FSP</span>
<select id="ddlFSPCategory" datafield="FSPCategory"></select>
</li>
<li id="FSP">
<li style="display:none;">
<span strName="FSP">First Service Point</span>
<select id="ddlFSP" datafield="HFID"></select>
</li>
Expand Down
Binary file added app/src/main/ic_launcher_policies-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3203,7 +3203,7 @@ private Family.Member familyMemberFromJSONObject(
/* identificationNumber = */ JsonUtils.getStringOrDefault(object, "IdentificationNumber"),
/* lastName = */ object.getString("LastName"),
/* otherNames = */ object.getString("OtherNames"),
/* dateOfBirth = */ Objects.requireNonNull(JsonUtils.getDateOrDefault(object, "DOB")),
/* dateOfBirth = */ Calendar.getInstance().getTime(),
/* gender = */ object.getString("Gender"),
/* marital = */ JsonUtils.getStringOrDefault(object, "Marital"),
/* phone = */ JsonUtils.getStringOrDefault(object, "Phone"),
Expand Down Expand Up @@ -3332,12 +3332,12 @@ public Pair<String, byte[]>[] FamilyPictures(@NonNull JSONArray insurees, int Ca
Pair<String, byte[]> img = new Pair<>("", empty);
images[j] = img;
} else {
myList.add(getInsureeValidationError(
chfId, lastName, otherNames,
/*mylist.add(getInsureeValidationError(
chfid, lastname, othername,
R.string.WithoutPhoto
));
ShowErrorMessages();
break;
));*/
//ShowErrorMessages();
//break;
}
} else {
images[j] = new Pair<>("", new byte[0]);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/openimis/imispolicies/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,10 @@ public boolean onNavigationItemSelected(MenuItem item) {
} else {
wv.loadUrl("file:///android_asset/pages/Login.html?s=4");
}
} else if (id == R.id.nav_feedback) {
}/*else if (id == R.id.nav_feedback) {
Intent intent = new Intent(this, FeedbackList.class);
startActivity(intent);
} else if (id == R.id.nav_sync) {
}*/ else if (id == R.id.nav_sync) {
wv.loadUrl("file:///android_asset/pages/Sync.html");
} else if (id == R.id.nav_about) {
wv.loadUrl("file:///android_asset/pages/About.html");
Expand Down
Loading

0 comments on commit 99dc1a5

Please sign in to comment.