Skip to content

Commit

Permalink
MI | add Home inventory register #433
Browse files Browse the repository at this point in the history
Signed-off-by: mib.iqbal <[email protected]>
  • Loading branch information
mib-iqbal committed Apr 5, 2017
1 parent 3219679 commit bd06754
Show file tree
Hide file tree
Showing 16 changed files with 1,916 additions and 16 deletions.
5 changes: 5 additions & 0 deletions opensrp-sdidtk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
android:theme="@style/AppThemeNoActionBarAndTitle"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="landscape"/>
<activity android:name=".homeinventory.HomeInventorySmartRegisterActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/AppThemeNoActionBarAndTitle"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="landscape"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public void onEvent(String data) {
private TextView ParanaClientCount;
public static int kicount;

private TextView HomeInventoryClientCount;
public static int hicount;


@Override
protected void onCreation() {
//home dashboard
Expand All @@ -99,9 +103,11 @@ private void setupViews() {
// findViewById(R.id.btn_test2_register).setOnClickListener(onRegisterStartListener);
findViewById(R.id.btn_parana_register).setOnClickListener(onRegisterStartListener);
findViewById(R.id.btn_reporting).setOnClickListener(onButtonsClickListener);
findViewById(R.id.btn_home_inven_register).setOnClickListener(onRegisterStartListener);

ecRegisterClientCountView = (TextView) findViewById(R.id.txt_child_register_client_count);
ParanaClientCount = (TextView) findViewById(R.id.txt_parana_client_count);
HomeInventoryClientCount = (TextView) findViewById(R.id.txt_home_client_count);
}

private void initialize() {
Expand All @@ -116,8 +122,6 @@ private void initialize() {
getSupportActionBar().setDisplayUseLogoEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
LoginActivity.setLanguage();
// getActionBar().setBackgroundDrawable(getReso
// urces().getDrawable(R.color.action_bar_background));
}

@Override
Expand Down Expand Up @@ -151,9 +155,14 @@ private void updateRegisterCounts(HomeContext homeContext) {
kicountcursor.close();


Cursor hicountcursor = context().commonrepository("anak").RawCustomQueryForAdapter(sqb.queryForCountOnRegisters("ec_anak_search", "ec_anak_search.is_closed=0"));
hicountcursor.moveToFirst();
hicount= hicountcursor.getInt(0);
hicountcursor.close();

ParanaClientCount.setText(valueOf(kicount));
ecRegisterClientCountView.setText(valueOf(childcount));
// ecRegisterClientCountView.setText(valueOf(hhcontroller.getClients().size()));
HomeInventoryClientCount.setText(valueOf(hicount));

}

Expand Down Expand Up @@ -252,11 +261,11 @@ public void onClick(View view) {
case R.id.btn_parana_register:
navigationController.startFPSmartRegistry();
break;
/*
case R.id.btn_pnc_register:
// navigationController.startPNCSmartRegistry();

case R.id.btn_home_inven_register:
navigationController.startANCSmartRegistry();
break;
case R.id.btn_child_register:
/* case R.id.btn_child_register:
// navigationController.startChildSmartRegistry();
break;
case R.id.btn_fp_register:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@


import org.ei.opensrp.ddtk.ddtk.FormulirDdtkSmartRegisterActivity;
import org.ei.opensrp.ddtk.homeinventory.HomeInventorySmartRegisterActivity;
import org.ei.opensrp.ddtk.parana.NativeKIParanaSmartRegisterActivity;
import org.ei.opensrp.view.activity.NativeChildSmartRegisterActivity;
import org.ei.opensrp.view.controller.ANMController;


Expand Down Expand Up @@ -44,7 +46,11 @@ public void startFPSmartRegistry() {
}
@Override
public void startANCSmartRegistry() {
activity.startActivity(new Intent(activity, FormulirDdtkSmartRegisterActivity.class));
activity.startActivity(new Intent(activity, HomeInventorySmartRegisterActivity.class));
}
@Override
public void startChildSmartRegistry() {
activity.startActivity(new Intent(activity, HomeInventorySmartRegisterActivity.class));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.ei.opensrp.ddtk.LoginActivity;
import org.ei.opensrp.ddtk.ddtk.FormulirDdtkServiceModeOption;
import org.ei.opensrp.ddtk.ddtk.KICommonObjectFilterOption;
import org.ei.opensrp.ddtk.homeinventory.HomeInventoryClientsProvider;
import org.ei.opensrp.ddtk.homeinventory.HomeInventoryServiceModeOption;
import org.ei.opensrp.ddtk.homeinventory.HomeInventorySmartRegisterActivity;
import org.ei.opensrp.provider.SmartRegisterClientsProvider;
import org.ei.opensrp.ddtk.R;

Expand Down Expand Up @@ -92,7 +95,7 @@ protected SecuredNativeSmartRegisterActivity.DefaultOptionsProvider getDefaultOp

@Override
public ServiceModeOption serviceMode() {
return new FormulirDdtkServiceModeOption(clientsProvider());
return new HomeInventoryServiceModeOption(clientsProvider());
}

@Override
Expand Down Expand Up @@ -175,7 +178,7 @@ protected SmartRegisterClientsProvider clientsProvider() {
}

private DialogOption[] getEditOptions() {
return ((FormulirDdtkSmartRegisterActivity)getActivity()).getEditOptions();
return ((HomeInventorySmartRegisterActivity)getActivity()).getEditOptions();
}

@Override
Expand Down Expand Up @@ -208,7 +211,7 @@ private String sortByAlertmethod() {
"Else alerts.status END ASC";
}
public void initializeQueries(){
FormulirDdtkSmartClientsProvider kiscp = new FormulirDdtkSmartClientsProvider(getActivity(),clientActionHandler,context().alertService());
HomeInventoryClientsProvider kiscp = new HomeInventoryClientsProvider(getActivity(),clientActionHandler,context().alertService());
clientAdapter = new SmartRegisterPaginatedCursorAdapter(getActivity(), null, kiscp, new CommonRepository("ec_anak",new String []{"tanggalLahirAnak","namaBayi"}));
clientsView.setAdapter(clientAdapter);

Expand Down Expand Up @@ -266,9 +269,10 @@ private class ClientActionHandler implements View.OnClickListener {
public void onClick(View view) {
switch (view.getId()) {
case R.id.profile_info_layout:
// CharSequence selections[] = new CharSequence[] {"Detail View", "Charts"};
ChildDetailActivity.childclient = (CommonPersonObjectClient) view.getTag();

ChildDetailActivity.childclient = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),ChildDetailActivity.class);
startActivity(intent);
getActivity().finish();
break;
//untuk follow up button
case R.id.btn_edit:
Expand Down
Loading

0 comments on commit bd06754

Please sign in to comment.