<commit_before>package edu.duke.cabig.c3pr.web.study.tabs;

import edu.duke.cabig.c3pr.dao.StudyDao;
import edu.duke.cabig.c3pr.web.study.StudyWrapper;

import java.util.Map;

/**
 * Created by IntelliJ IDEA. User: kherm Date: Jun 15, 2007 Time: 3:32:32 PM To change this template
 * use File | Settings | File Templates.
 */
public class StudyRegistrationsTab extends StudyTab {

    private StudyDao studyDao;

    public StudyRegistrationsTab() {
        super("Study Registrations", "Registrations", "study/study_registrations");
    }

    @Override
    public Map<String, Object> referenceData(StudyWrapper wrapper) {
        Map<String, Object> refdata = super.referenceData(wrapper);
        refdata.put("participantAssignments", this.getStudyDao().getStudySubjectsForStudy(wrapper.getStudy().getId()));

        return refdata;
    }

    public StudyDao getStudyDao() {
        return studyDao;
    }

    public void setStudyDao(StudyDao studyDao) {
        this.studyDao = studyDao;
    }
}<commit_msg>cpr-1391<commit_after>package edu.duke.cabig.c3pr.web.study.tabs;

import edu.duke.cabig.c3pr.dao.StudyDao;
import edu.duke.cabig.c3pr.utils.web.WebUtils;
import edu.duke.cabig.c3pr.web.study.StudyWrapper;

import java.util.Map;

/**
 * Created by IntelliJ IDEA. User: kherm Date: Jun 15, 2007 Time: 3:32:32 PM To change this template
 * use File | Settings | File Templates.
 */
public class StudyRegistrationsTab extends StudyTab {

    private StudyDao studyDao;

    public StudyRegistrationsTab() {
        super("Study Registrations", "Registrations", "study/study_registrations");
    }

    @Override
    public Map<String, Object> referenceData(StudyWrapper wrapper) {
        Map<String, Object> refdata = super.referenceData(wrapper);
        Boolean isOnlyStudyCoordinator = false;
        if(WebUtils.isStudyCoordinator()&& !WebUtils.isSiteCoordinator() && !WebUtils.isAdmin() && !WebUtils.isRegistrar()){
        	isOnlyStudyCoordinator = true;
        }
        refdata.put("isOnlyStudyCoordinator", isOnlyStudyCoordinator);
        refdata.put("participantAssignments", this.getStudyDao().getStudySubjectsForStudy(wrapper.getStudy().getId()));

        return refdata;
    }

    public StudyDao getStudyDao() {
        return studyDao;
    }

    public void setStudyDao(StudyDao studyDao) {
        this.studyDao = studyDao;
    }
}
{'fraction_non_alphanumeric': 0.1116751269035533, 'fraction_numerical': 0.013959390862944163, 'mean_word_length': 3.6739130434782608, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '684583', 'n_tokens_mistral': 818, 'n_tokens_neox': 771, 'n_words': 151}