Skip to content

Commit

Permalink
Merge pull request #145 from EyeSeeTea/development
Browse files Browse the repository at this point in the history
Release 1.1
  • Loading branch information
adrianq committed Nov 23, 2015
2 parents be2b102 + 55cee8c commit 1e79482
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/org/eyeseetea/malariacare/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.eyeseetea.malariacare.database.model.Program$Table;
import org.eyeseetea.malariacare.database.model.Survey;
import org.eyeseetea.malariacare.database.utils.LocationMemory;
import org.eyeseetea.malariacare.database.utils.PreferencesState;
import org.eyeseetea.malariacare.database.utils.Session;
import org.eyeseetea.malariacare.layout.listeners.SurveyLocationListener;
import org.eyeseetea.malariacare.layout.utils.LayoutUtils;
Expand Down Expand Up @@ -187,10 +188,10 @@ public void onClick(DialogInterface arg0, int arg1) {
}

public void newSurvey(View v){
List<OrgUnit> firstOrgUnit = new Select().from(OrgUnit.class).where(Condition.column(OrgUnit$Table.ID_ORG_UNIT).eq(1)).queryList();
//Get Programs from database
List<Program> firstProgram = new Select().from(Program.class).where(Condition.column(Program$Table.ID_PROGRAM).eq(1)).queryList();
// Put new survey in session
Survey survey = new Survey(firstOrgUnit.get(0), firstProgram.get(0), Session.getUser());
Survey survey = new Survey(null, firstProgram.get(0), Session.getUser());
survey.save();
Session.setSurvey(survey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private void initDataIfRequired() throws IOException {
}

Log.i(TAG, "DB empty, loading data ...");
PopulateDB.populateDummyData();
//PopulateDB.populateDummyData();
try {
PopulateDB.populateDB(getAssets());
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.eyeseetea.malariacare.database.model.Question;
import org.eyeseetea.malariacare.database.model.Survey;
import org.eyeseetea.malariacare.database.model.Tab;
import org.eyeseetea.malariacare.database.utils.PreferencesState;
import org.eyeseetea.malariacare.database.utils.Session;
import org.eyeseetea.malariacare.layout.adapters.general.TabArrayAdapter;
import org.eyeseetea.malariacare.layout.adapters.survey.AutoTabAdapter;
Expand Down Expand Up @@ -258,7 +259,7 @@ private void createActionBar(){

android.support.v7.app.ActionBar actionBar = this.getSupportActionBar();
LayoutUtils.setActionBarLogo(actionBar);
LayoutUtils.setActionBarText(actionBar, survey.getOrgUnit().getName(), program.getName());
LayoutUtils.setActionBarText(actionBar, PreferencesState.getInstance().getOrgUnit(), program.getName());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class PushClient {

private static String DHIS_USERNAME="KHMCS";
//Todo: introduce final password
private static String DHIS_PASSWORD="";
private static String DHIS_PASSWORD="KHMCSadmin1";

private static String DHIS_ORG_NAME ="";
private static String DHIS_ORG_UID ="";
Expand Down Expand Up @@ -183,7 +183,6 @@ public PushResult push() {
}
return result;
} catch (Exception ex) {
Log.e(TAG, ex.getMessage());
return new PushResult(ex);
}
}
Expand Down Expand Up @@ -211,7 +210,7 @@ public PushResult pushBackground() {
}
return result;
} catch (Exception ex) {
Log.e(TAG, ex.getMessage());
//Log.e(TAG, ex.getMessage());
return new PushResult(ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ public void setPhone_serial(String phone_serial) {
public String getPhone_metaData() {
String phonemetadata="";
phonemetadata= "###";
if(phone_number.length()>0){
if(phone_number != null && !phone_number.equals("") && phone_number.length()>0){
phonemetadata=phonemetadata+phone_number;
}

phonemetadata= phonemetadata+"###";
if(imei.length()>0){
if(imei != null && !imei.equals("") && imei.length()>0){
phonemetadata=phonemetadata+imei;
}

phonemetadata= phonemetadata+"###";
if(phone_serial.length()>0){
if(phone_serial != null && !phone_serial.equals("") && phone_serial.length()>0){
phonemetadata=phonemetadata+phone_serial;
}
return phonemetadata;
Expand Down

0 comments on commit 1e79482

Please sign in to comment.