Skip to content

Commit

Permalink
Merge pull request #12883 from SORMAS-Foundation/bugfix-12848-fix_app…
Browse files Browse the repository at this point in the history
…_event_participant_edit

#12848 - Fix access to event participant edit in app
  • Loading branch information
sergiupacurariu authored Jan 22, 2024
2 parents 75fa116 + 746390e commit dafd7d6
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

package de.symeda.sormas.app.event.edit;

import java.util.List;

import android.os.Bundle;
import android.view.View;

Expand All @@ -23,10 +25,10 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

import de.symeda.sormas.api.user.UserRight;
import de.symeda.sormas.app.BaseEditFragment;
import de.symeda.sormas.app.R;
import de.symeda.sormas.app.backend.config.ConfigProvider;
import de.symeda.sormas.app.backend.event.Event;
import de.symeda.sormas.app.backend.event.EventParticipant;
import de.symeda.sormas.app.core.adapter.databinding.OnListItemClickListener;
Expand All @@ -35,6 +37,7 @@
import de.symeda.sormas.app.event.eventparticipant.edit.EventParticipantEditActivity;
import de.symeda.sormas.app.event.eventparticipant.list.EventParticipantListAdapter;
import de.symeda.sormas.app.event.eventparticipant.list.EventParticipantListViewModel;
import de.symeda.sormas.app.event.eventparticipant.read.EventParticipantReadActivity;

public class EventEditPersonsInvolvedListFragment extends BaseEditFragment<FragmentFormListLayoutBinding, List<EventParticipant>, Event>
implements OnListItemClickListener {
Expand Down Expand Up @@ -106,8 +109,13 @@ public boolean isShowNewAction() {

@Override
public void onListItemClick(View view, int position, Object item) {

EventParticipant o = (EventParticipant) item;
EventParticipantEditActivity
.startActivity(getContext(), o.getUuid(), getActivityRootData().getUuid(), EventParticipantSection.EVENT_PARTICIPANT_INFO);
if (ConfigProvider.hasUserRight(UserRight.EVENTPARTICIPANT_EDIT)) {
EventParticipantEditActivity
.startActivity(getContext(), o.getUuid(), getActivityRootData().getUuid(), EventParticipantSection.EVENT_PARTICIPANT_INFO);
} else {
EventParticipantReadActivity.startActivity(getContext(), o.getUuid(), getActivityRootData().getUuid());
}
}
}

0 comments on commit dafd7d6

Please sign in to comment.