diff --git a/scripts/timestamp-fields-1-1 b/scripts/timestamp-fields-1-1 index cf1aa8b571..2ed4c99ab6 100644 --- a/scripts/timestamp-fields-1-1 +++ b/scripts/timestamp-fields-1-1 @@ -1,70 +1,71 @@ -appointment -appointment.start_time -appointment.end_time -campus -category -challenge -challenge_category -challenge_referral -child_care_arrangement -citizenship -confidentiality_disclosure_agreement -confidentiality_level -config -early_alert -early_alert_outcome -early_alert_outreach -early_alert_reason -early_alert_referral -early_alert_response -early_alert_routing -early_alert_suggestion -education_goal -education_level -ethnicity -funding_source -goal -journal_entry -journal_entry_detail -journal_source -journal_step -journal_step_detail -journal_step_journal_step_detail -journal_track -journal_track_journal_step -marital_status -message -message.sent_date -message_template -person.student_intake_request_date -person.student_intake_complete_date -person_challenge -person_confidentiality_disclosure_agreement -person_demographics -person_education_goal -person_education_level -person_education_plan -person_funding_source -person_program_status -person_program_status.effective_date -person_program_status.expiration_date -person_referral_source -person_service_reason -person_special_service_group -person_tool -program_status -program_status_change_reason -referral_source -self_help_guide -self_help_guide_group -self_help_guide_question -self_help_guide_question_response -self_help_guide_response -service_reason -special_service_group -student_status -student_type -task -task.completed_date -task.reminder_sent_date -veteran_status +appointment +appointment.start_time +appointment.end_time +campus +category +challenge +challenge_category +challenge_referral +child_care_arrangement +citizenship +confidentiality_disclosure_agreement +confidentiality_level +config +early_alert +early_alert_outcome +early_alert_outreach +early_alert_reason +early_alert_referral +early_alert_response +early_alert_routing +early_alert_suggestion +early_alert_intervention +education_goal +education_level +ethnicity +funding_source +goal +journal_entry +journal_entry_detail +journal_source +journal_step +journal_step_detail +journal_step_journal_step_detail +journal_track +journal_track_journal_step +marital_status +message +message.sent_date +message_template +person.student_intake_request_date +person.student_intake_complete_date +person_challenge +person_confidentiality_disclosure_agreement +person_demographics +person_education_goal +person_education_level +person_education_plan +person_funding_source +person_program_status +person_program_status.effective_date +person_program_status.expiration_date +person_referral_source +person_service_reason +person_special_service_group +person_tool +program_status +program_status_change_reason +referral_source +self_help_guide +self_help_guide_group +self_help_guide_question +self_help_guide_question_response +self_help_guide_response +service_reason +special_service_group +student_status +student_type +task +task.completed_date +task.reminder_sent_date +veteran_status diff --git a/src/main/java/org/jasig/ssp/dao/reference/EarlyAlertInterventionDao.java b/src/main/java/org/jasig/ssp/dao/reference/EarlyAlertInterventionDao.java new file mode 100644 index 0000000000..f5c13a839a --- /dev/null +++ b/src/main/java/org/jasig/ssp/dao/reference/EarlyAlertInterventionDao.java @@ -0,0 +1,66 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/16/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionDao.java for Paging/Sorting/CRUD + */ +package org.jasig.ssp.dao.reference; + +import org.jasig.ssp.dao.AuditableCrudDao; +import org.jasig.ssp.model.ObjectStatus; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.util.sort.PagingWrapper; +import org.jasig.ssp.util.sort.SortDirection; +import org.jasig.ssp.util.sort.SortingAndPaging; +import org.springframework.stereotype.Repository; + +/** + * Data access class for the EarlyAlertIntervention reference entity. + * + * Based on EarlyAlertSuggestion implementation by @author jon.adams + */ +@Repository +public class EarlyAlertInterventionDao extends + AbstractReferenceAuditableCrudDao + implements AuditableCrudDao { + + /** + * Constructor that initializes the instance with the specific type for use + * by the base class methods. + */ + public EarlyAlertInterventionDao() { + super(EarlyAlertIntervention.class); + } + + @Override + public PagingWrapper getAll( + final SortingAndPaging sAndP) { + SortingAndPaging sp = sAndP; + if (sp == null) { + sp = new SortingAndPaging(ObjectStatus.ACTIVE); + } + + if (!sp.isSorted()) { + sp.appendSortField("name", SortDirection.ASC); + } + + return super.getAll(sp); + } +} \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/factory/impl/EarlyAlertTOFactoryImpl.java b/src/main/java/org/jasig/ssp/factory/impl/EarlyAlertTOFactoryImpl.java index 717a836c80..94cbae1a5e 100644 --- a/src/main/java/org/jasig/ssp/factory/impl/EarlyAlertTOFactoryImpl.java +++ b/src/main/java/org/jasig/ssp/factory/impl/EarlyAlertTOFactoryImpl.java @@ -1,135 +1,158 @@ -/** - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jasig.ssp.factory.impl; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.UUID; - -import org.jasig.ssp.dao.EarlyAlertDao; -import org.jasig.ssp.factory.AbstractAuditableTOFactory; -import org.jasig.ssp.factory.EarlyAlertTOFactory; -import org.jasig.ssp.model.EarlyAlert; -import org.jasig.ssp.model.reference.EarlyAlertReason; -import org.jasig.ssp.model.reference.EarlyAlertSuggestion; -import org.jasig.ssp.service.ObjectNotFoundException; -import org.jasig.ssp.service.PersonService; -import org.jasig.ssp.service.reference.CampusService; -import org.jasig.ssp.service.reference.EarlyAlertReasonService; -import org.jasig.ssp.service.reference.EarlyAlertSuggestionService; -import org.jasig.ssp.transferobject.EarlyAlertTO; -import org.jasig.ssp.transferobject.reference.EarlyAlertReasonTO; -import org.jasig.ssp.transferobject.reference.EarlyAlertSuggestionTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.google.common.collect.Lists; - -/** - * EarlyAlert transfer object factory - * - * @author jon.adams - * - */ -@Service -@Transactional(readOnly = true) -public class EarlyAlertTOFactoryImpl extends - AbstractAuditableTOFactory - implements EarlyAlertTOFactory { - - /** - * Construct an EarlyAlert transfer object factory with the specific class - * types for use by the super class methods. - */ - public EarlyAlertTOFactoryImpl() { - super(EarlyAlertTO.class, EarlyAlert.class); - } - - @Autowired - private transient EarlyAlertDao dao; - - @Autowired - private transient CampusService campusService; - - @Autowired - private transient PersonService personService; - - @Autowired - private transient EarlyAlertReasonService earlyAlertReasonService; - - @Autowired - private transient EarlyAlertSuggestionService earlyAlertSuggestionService; - - @Override - protected EarlyAlertDao getDao() { - return dao; - } - - @Override - public EarlyAlert from(final EarlyAlertTO tObject) - throws ObjectNotFoundException { - final EarlyAlert model = super.from(tObject); - - model.setCourseName(tObject.getCourseName()); - model.setCourseTitle(tObject.getCourseTitle()); - model.setCourseTermCode(tObject.getCourseTermCode()); - model.setEmailCC(tObject.getEmailCC()); - if (tObject.getCampusId() != null) { - model.setCampus(campusService.get(tObject.getCampusId())); - } - - model.setEarlyAlertReasonOtherDescription(tObject - .getEarlyAlertReasonOtherDescription()); - model.setEarlyAlertSuggestionOtherDescription(tObject - .getEarlyAlertSuggestionOtherDescription()); - model.setComment(tObject.getComment()); - model.setClosedDate(tObject.getClosedDate()); - if ( tObject.getClosedById() != null ) { - model.setClosedBy(personService.get(tObject.getClosedById())); - } - - if (tObject.getPersonId() != null) { - model.setPerson(personService.get(tObject.getPersonId())); - } - - model.setEarlyAlertReasons(new HashSet()); - if (tObject.getEarlyAlertReasonIds() != null) { - for (final UUID id : tObject - .getEarlyAlertReasonIds()) { - model.getEarlyAlertReasons().add( - earlyAlertReasonService.load(id)); - } - } - - model.setEarlyAlertSuggestions(new HashSet()); - if (tObject.getEarlyAlertSuggestionIds() != null) { - for (final UUID id : tObject - .getEarlyAlertSuggestionIds()) { - model.getEarlyAlertSuggestions().add( - earlyAlertSuggestionService.load(id)); - } - } - - model.setResponseDates(tObject.getLastResponseDate()); - - return model; - } +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions Transfer Object and references + */ +package org.jasig.ssp.factory.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.UUID; + +import org.jasig.ssp.dao.EarlyAlertDao; +import org.jasig.ssp.factory.AbstractAuditableTOFactory; +import org.jasig.ssp.factory.EarlyAlertTOFactory; +import org.jasig.ssp.model.EarlyAlert; +import org.jasig.ssp.model.reference.EarlyAlertReason; +import org.jasig.ssp.model.reference.EarlyAlertSuggestion; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; //TAPS 20140039 +import org.jasig.ssp.service.ObjectNotFoundException; +import org.jasig.ssp.service.PersonService; +import org.jasig.ssp.service.reference.CampusService; +import org.jasig.ssp.service.reference.EarlyAlertReasonService; +import org.jasig.ssp.service.reference.EarlyAlertSuggestionService; +import org.jasig.ssp.service.reference.EarlyAlertInterventionService; //TAPS 20140039 +import org.jasig.ssp.transferobject.EarlyAlertTO; +import org.jasig.ssp.transferobject.reference.EarlyAlertReasonTO; +import org.jasig.ssp.transferobject.reference.EarlyAlertSuggestionTO; +import org.jasig.ssp.transferobject.reference.EarlyAlertInterventionTO; //TAPS 20140039 +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.google.common.collect.Lists; + +/** + * EarlyAlert transfer object factory + * + * @author jon.adams + * + */ +@Service +@Transactional(readOnly = true) +public class EarlyAlertTOFactoryImpl extends + AbstractAuditableTOFactory + implements EarlyAlertTOFactory { + + /** + * Construct an EarlyAlert transfer object factory with the specific class + * types for use by the super class methods. + */ + public EarlyAlertTOFactoryImpl() { + super(EarlyAlertTO.class, EarlyAlert.class); + } + + @Autowired + private transient EarlyAlertDao dao; + + @Autowired + private transient CampusService campusService; + + @Autowired + private transient PersonService personService; + + @Autowired + private transient EarlyAlertReasonService earlyAlertReasonService; + + @Autowired + private transient EarlyAlertSuggestionService earlyAlertSuggestionService; + + //TAPS 20140039 BEGIN + @Autowired + private transient EarlyAlertInterventionService earlyAlertInterventionService; + //TAPS 20140039 END + + @Override + protected EarlyAlertDao getDao() { + return dao; + } + + @Override + public EarlyAlert from(final EarlyAlertTO tObject) + throws ObjectNotFoundException { + final EarlyAlert model = super.from(tObject); + + model.setCourseName(tObject.getCourseName()); + model.setCourseTitle(tObject.getCourseTitle()); + model.setCourseTermCode(tObject.getCourseTermCode()); + model.setEmailCC(tObject.getEmailCC()); + if (tObject.getCampusId() != null) { + model.setCampus(campusService.get(tObject.getCampusId())); + } + + model.setEarlyAlertReasonOtherDescription(tObject + .getEarlyAlertReasonOtherDescription()); + model.setEarlyAlertSuggestionOtherDescription(tObject + .getEarlyAlertSuggestionOtherDescription()); + model.setComment(tObject.getComment()); + model.setClosedDate(tObject.getClosedDate()); + if ( tObject.getClosedById() != null ) { + model.setClosedBy(personService.get(tObject.getClosedById())); + } + + if (tObject.getPersonId() != null) { + model.setPerson(personService.get(tObject.getPersonId())); + } + + model.setEarlyAlertReasons(new HashSet()); + if (tObject.getEarlyAlertReasonIds() != null) { + for (final UUID id : tObject + .getEarlyAlertReasonIds()) { + model.getEarlyAlertReasons().add( + earlyAlertReasonService.load(id)); + } + } + + model.setEarlyAlertSuggestions(new HashSet()); + if (tObject.getEarlyAlertSuggestionIds() != null) { + for (final UUID id : tObject + .getEarlyAlertSuggestionIds()) { + model.getEarlyAlertSuggestions().add( + earlyAlertSuggestionService.load(id)); + } + } + + //TAPS 20140039 BEGIN + model.setEarlyAlertInterventions(new HashSet()); + if (tObject.getEarlyAlertInterventionIds() != null) { + for (final UUID id : tObject + .getEarlyAlertInterventionIds()) { + model.getEarlyAlertInterventions().add( + earlyAlertInterventionService.load(id)); + } + } + //TAPS 20140039 END + + model.setResponseDates(tObject.getLastResponseDate()); + + return model; + } } \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/factory/reference/EarlyAlertInterventionTOFactory.java b/src/main/java/org/jasig/ssp/factory/reference/EarlyAlertInterventionTOFactory.java new file mode 100644 index 0000000000..121685c029 --- /dev/null +++ b/src/main/java/org/jasig/ssp/factory/reference/EarlyAlertInterventionTOFactory.java @@ -0,0 +1,39 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionTOFactory.java transfer object factory for converting back and forth from EarlyAlertIntervention models + */ +package org.jasig.ssp.factory.reference; + +import org.jasig.ssp.factory.TOFactory; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.transferobject.reference.EarlyAlertInterventionTO; + +/** + * EarlyAlertIntervention transfer object factory for converting back and forth + * from EarlyAlertIntervention models. + * + * Based upon EarlyAlertSuggestion By @author jon.adams + * + */ +public interface EarlyAlertInterventionTOFactory extends + TOFactory { +} diff --git a/src/main/java/org/jasig/ssp/factory/reference/impl/EarlyAlertInterventionTOFactoryImpl.java b/src/main/java/org/jasig/ssp/factory/reference/impl/EarlyAlertInterventionTOFactoryImpl.java new file mode 100644 index 0000000000..765a6b5a00 --- /dev/null +++ b/src/main/java/org/jasig/ssp/factory/reference/impl/EarlyAlertInterventionTOFactoryImpl.java @@ -0,0 +1,77 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionTOFactoryImpl.java + */ +package org.jasig.ssp.factory.reference.impl; + +import javax.validation.constraints.NotNull; + +import org.jasig.ssp.dao.reference.EarlyAlertInterventionDao; +import org.jasig.ssp.factory.reference.AbstractReferenceTOFactory; +import org.jasig.ssp.factory.reference.EarlyAlertInterventionTOFactory; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.service.ObjectNotFoundException; +import org.jasig.ssp.transferobject.reference.EarlyAlertInterventionTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * EarlyAlertIntervention transfer object factory implementation class for + * converting back and forth from EarlyAlertIntervention models. + * + * Based on EarlyAlertSuggestion By @author jon.adams + */ +@Service +@Transactional(readOnly = true) +public class EarlyAlertInterventionTOFactoryImpl + extends + AbstractReferenceTOFactory + implements EarlyAlertInterventionTOFactory { + + /** + * Constructor that initializes specific class instances for use by the + * common base class methods. + */ + public EarlyAlertInterventionTOFactoryImpl() { + super(EarlyAlertInterventionTO.class, EarlyAlertIntervention.class); + } + + @Autowired + private transient EarlyAlertInterventionDao dao; + + @Override + protected EarlyAlertInterventionDao getDao() { + return dao; + } + + @Override + public EarlyAlertIntervention from( + @NotNull final EarlyAlertInterventionTO tObject) + throws ObjectNotFoundException { + final EarlyAlertIntervention model = super.from(tObject); + + model.setSortOrder(tObject.getSortOrder()); + + return model; + } +} diff --git a/src/main/java/org/jasig/ssp/model/EarlyAlert.java b/src/main/java/org/jasig/ssp/model/EarlyAlert.java index b93d6de6b5..9e3258810b 100644 --- a/src/main/java/org/jasig/ssp/model/EarlyAlert.java +++ b/src/main/java/org/jasig/ssp/model/EarlyAlert.java @@ -1,377 +1,413 @@ -/** - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jasig.ssp.model; - -import java.util.Date; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.validation.constraints.Size; - -import org.hibernate.annotations.Formula; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; -import org.jasig.ssp.model.reference.Campus; -import org.jasig.ssp.model.reference.EarlyAlertReason; -import org.jasig.ssp.model.reference.EarlyAlertSuggestion; -import org.jasig.ssp.util.uuid.UUIDCustomType; - -import com.google.common.collect.Sets; - -/** - * EarlyAlert - */ -@Entity -@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) -@TypeDef(name = "uuid-custom", typeClass = UUIDCustomType.class) -public class EarlyAlert // NOPMD by jon.adams on 5/24/12 1:29 PM - extends AbstractAuditable - implements PersonAssocAuditable { // NOPMD - - private static final long serialVersionUID = 8141595549982881039L; - - public static final String CUSTOM_GROUP_NAME = "Custom"; - - @Column(nullable = true, length = 80) - private String courseName; - - @Column(nullable = true, length = 255) - private String courseTitle; - - @Column(nullable = true, length = 25) - private String courseTermCode; - - @Column(name = "email_cc", nullable = true, length = 255) - private String emailCC; - - @ManyToOne - @JoinColumn(name = "campus_id", nullable = false) - private Campus campus; - - @Column(nullable = true, length = 64000) - @Size(max = 64000) - private String earlyAlertReasonOtherDescription; - - @Column(nullable = true, length = 64000) - @Size(max = 64000) - private String earlyAlertSuggestionOtherDescription; - - @Column(nullable = true, length = 64000) - @Size(max = 64000) - private String comment; - - @Column(nullable = true) - @Temporal(TemporalType.TIMESTAMP) - private Date closedDate; - - @ManyToOne - @JoinColumn(name = "closed_by_id", nullable = true) - private Person closedBy; - - private static final String RESPONSE_COUNT_FORMULA = "(select count(*) from early_alert_response ear where ear.early_alert_id = ID)"; - - private static final String RESPONSE_DATES_FORMULA = "(select max(ear.modified_date) from early_alert_response ear " - + "where ear.early_alert_id = id)"; - - - @Formula(RESPONSE_COUNT_FORMULA) - private int responseCount; - - @Formula(RESPONSE_DATES_FORMULA) - private Date lastResponseDate; - /** - * Associated person. Changes to this Person are persisted. - */ - @ManyToOne - @JoinColumn(name = "person_id", nullable = false) - private Person person; - - // TODO: eager loading makes more sense, but causes cartesian results. so - // hold off optimizing performance until the performance pass of the system. - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable(name = "early_alert_early_alert_reason", - joinColumns = @JoinColumn(name = "early_alert_id"), - inverseJoinColumns = @JoinColumn(name = "early_alert_reason_id")) - private Set earlyAlertReasonIds = Sets.newHashSet(); - - // TODO: eager loading makes more sense, but causes cartesian results. so - // hold off optimizing performance until the performance pass of the system. - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable(name = "early_alert_early_alert_suggestion", - joinColumns = @JoinColumn(name = "early_alert_id"), - inverseJoinColumns = @JoinColumn(name = "early_alert_suggestion_id")) - private Set earlyAlertSuggestions = Sets - .newHashSet(); - - /** - * @return the courseName - */ - public String getCourseName() { - return courseName; - } - - /** - * @param courseName - * the courseName to set; optional; max length 80 characters - */ - public void setCourseName(final String courseName) { - this.courseName = courseName; - } - - /** - * @return the courseTitle - */ - public String getCourseTitle() { - return courseTitle; - } - - /** - * @param courseTitle - * the courseTitle to set; optional; max length 255 characters - */ - public void setCourseTitle(final String courseTitle) { - this.courseTitle = courseTitle; - } - - /** - * @return the courseTermCode - */ - public String getCourseTermCode() { - return courseTermCode; - } - - /** - * @param courseTermCode - * the courseTermCode to set; optional; max length 25 characters - */ - public void setCourseTermCode(final String courseTermCode) { - this.courseTermCode = courseTermCode; - } - - /** - * @return the emailCC - */ - public String getEmailCC() { - return emailCC; - } - - /** - * @param emailCC - * the emailCC to set; optional; max length 255 characters - */ - public void setEmailCC(final String emailCC) { - this.emailCC = emailCC; - } - - /** - * @return the campus - */ - public Campus getCampus() { - return campus; - } - - /** - * @param campus - * the campus to set - */ - public void setCampus(final Campus campus) { - this.campus = campus; - } - - /** - * @return the earlyAlertReasonOtherDescription - */ - public String getEarlyAlertReasonOtherDescription() { - return earlyAlertReasonOtherDescription; - } - - /** - * @param earlyAlertReasonOtherDescription - * the earlyAlertReasonOtherDescription to set; optional; max - * length 64000 characters - */ - public void setEarlyAlertReasonOtherDescription( - final String earlyAlertReasonOtherDescription) { - this.earlyAlertReasonOtherDescription = earlyAlertReasonOtherDescription; - } - - /** - * @return the earlyAlertSuggestionOtherDescription - */ - public String getEarlyAlertSuggestionOtherDescription() { - return earlyAlertSuggestionOtherDescription; - } - - /** - * @param earlyAlertSuggestionOtherDescription - * the earlyAlertSuggestionOtherDescription to set; optional; max - * length 64000 characters - */ - public void setEarlyAlertSuggestionOtherDescription( - final String earlyAlertSuggestionOtherDescription) { - this.earlyAlertSuggestionOtherDescription = earlyAlertSuggestionOtherDescription; - } - - /** - * @return the comment - */ - public String getComment() { - return comment; - } - - /** - * @param comment - * the comment; optional; max length 64000 characters - */ - public void setComment(final String comment) { - this.comment = comment; - } - - /** - * @return the closedDate - */ - public Date getClosedDate() { - return closedDate == null ? null : new Date(closedDate.getTime()); - } - - /** - * @param closedDate - * the closedDate to set - */ - public void setClosedDate(final Date closedDate) { - this.closedDate = closedDate == null ? null : new Date( - closedDate.getTime()); - } - - /** - * @return the closedById - */ - public UUID getClosedById() { - return closedBy == null ? null : closedBy.getId(); - } - - public Person getClosedBy() { - return closedBy; - } - - public void setClosedBy(Person closedBy) { - this.closedBy = closedBy; - } - - @Override - public Person getPerson() { - return person; - } - - @Override - public void setPerson(final Person person) { - this.person = person; - } - - /** - * @return the earlyAlertReasonIds - */ - public Set getEarlyAlertReasons() { - return earlyAlertReasonIds; - } - - /** - * @param earlyAlertReasonIds - * the earlyAlertReasonIds to set - */ - public void setEarlyAlertReasons( - final Set earlyAlertReasonIds) { - this.earlyAlertReasonIds = earlyAlertReasonIds; - } - - /** - * @return the earlyAlertSuggestionIds - */ - public Set getEarlyAlertSuggestions() { - return earlyAlertSuggestions; - } - - /** - * @param earlyAlertSuggestionIds - * the earlyAlertSuggestionIds to set - */ - public void setEarlyAlertSuggestions( - final Set earlyAlertSuggestionIds) { - this.earlyAlertSuggestions = earlyAlertSuggestionIds; - } - - @Override - protected int hashPrime() { - return 179; - } - - @Override - final public int hashCode() { // NOPMD by jon.adams on 5/9/12 1:50 PM - int result = hashPrime(); - - // Auditable properties - result *= getId() == null ? "id".hashCode() : getId().hashCode(); - result *= getObjectStatus() == null ? hashPrime() : getObjectStatus() - .hashCode(); - - // EarlyAlert - result *= hashField("courseName", courseName); - result *= hashField("courseTitle", courseTitle); - result *= hashField("courseTermCode", courseTermCode); - result *= hashField("emailCC", emailCC); - result *= hashField("campus", campus); - result *= hashField("earlyAlertSuggestionOtherDescription", - earlyAlertReasonOtherDescription); - result *= hashField("comment", comment); - result *= hashField("person", person); - result *= hashField("closedDate", closedDate); - result *= hashField("closedById", closedBy == null ? null : closedBy.getId()); - - return result; - } - - public int getResponseCount() { - return responseCount; - } - - public void setResponseCount(int responseCount) { - this.responseCount = responseCount; - } - - public Date getLastResponseDate() { - return lastResponseDate; - } - - public void setResponseDates(Date lastResponseDate) { - this.lastResponseDate = lastResponseDate; - } - +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions to EA + */ +package org.jasig.ssp.model; + +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.validation.constraints.Size; + +import org.hibernate.annotations.Formula; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; +import org.jasig.ssp.model.reference.Campus; +import org.jasig.ssp.model.reference.EarlyAlertReason; +import org.jasig.ssp.model.reference.EarlyAlertSuggestion; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; //TAPS 20140039 +import org.jasig.ssp.util.uuid.UUIDCustomType; + +import com.google.common.collect.Sets; + +/** + * EarlyAlert + */ +@Entity +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) +@TypeDef(name = "uuid-custom", typeClass = UUIDCustomType.class) +public class EarlyAlert // NOPMD by jon.adams on 5/24/12 1:29 PM + extends AbstractAuditable + implements PersonAssocAuditable { // NOPMD + + private static final long serialVersionUID = 8141595549982881039L; + + public static final String CUSTOM_GROUP_NAME = "Custom"; + + @Column(nullable = true, length = 80) + private String courseName; + + @Column(nullable = true, length = 255) + private String courseTitle; + + @Column(nullable = true, length = 25) + private String courseTermCode; + + @Column(name = "email_cc", nullable = true, length = 255) + private String emailCC; + + @ManyToOne + @JoinColumn(name = "campus_id", nullable = false) + private Campus campus; + + @Column(nullable = true, length = 64000) + @Size(max = 64000) + private String earlyAlertReasonOtherDescription; + + @Column(nullable = true, length = 64000) + @Size(max = 64000) + private String earlyAlertSuggestionOtherDescription; + + @Column(nullable = true, length = 64000) + @Size(max = 64000) + private String comment; + + @Column(nullable = true) + @Temporal(TemporalType.TIMESTAMP) + private Date closedDate; + + @ManyToOne + @JoinColumn(name = "closed_by_id", nullable = true) + private Person closedBy; + + private static final String RESPONSE_COUNT_FORMULA = "(select count(*) from early_alert_response ear where ear.early_alert_id = ID)"; + + private static final String RESPONSE_DATES_FORMULA = "(select max(ear.modified_date) from early_alert_response ear " + + "where ear.early_alert_id = id)"; + + + @Formula(RESPONSE_COUNT_FORMULA) + private int responseCount; + + @Formula(RESPONSE_DATES_FORMULA) + private Date lastResponseDate; + /** + * Associated person. Changes to this Person are persisted. + */ + @ManyToOne + @JoinColumn(name = "person_id", nullable = false) + private Person person; + + // TODO: eager loading makes more sense, but causes cartesian results. so + // hold off optimizing performance until the performance pass of the system. + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "early_alert_early_alert_reason", + joinColumns = @JoinColumn(name = "early_alert_id"), + inverseJoinColumns = @JoinColumn(name = "early_alert_reason_id")) + private Set earlyAlertReasonIds = Sets.newHashSet(); + + // TODO: eager loading makes more sense, but causes cartesian results. so + // hold off optimizing performance until the performance pass of the system. + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "early_alert_early_alert_suggestion", + joinColumns = @JoinColumn(name = "early_alert_id"), + inverseJoinColumns = @JoinColumn(name = "early_alert_suggestion_id")) + private Set earlyAlertSuggestions = Sets + .newHashSet(); + + //TAPS 20140039 BEGIN + // TODO: eager loading makes more sense, but causes cartesian results. so + // hold off optimizing performance until the performance pass of the system. + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(name = "early_alert_early_alert_intervention", + joinColumns = @JoinColumn(name = "early_alert_id"), + inverseJoinColumns = @JoinColumn(name = "early_alert_intervention_id")) + private Set earlyAlertInterventions = Sets + .newHashSet(); + //TAPS 20140039 END + + /** + * @return the courseName + */ + public String getCourseName() { + return courseName; + } + + /** + * @param courseName + * the courseName to set; optional; max length 80 characters + */ + public void setCourseName(final String courseName) { + this.courseName = courseName; + } + + /** + * @return the courseTitle + */ + public String getCourseTitle() { + return courseTitle; + } + + /** + * @param courseTitle + * the courseTitle to set; optional; max length 255 characters + */ + public void setCourseTitle(final String courseTitle) { + this.courseTitle = courseTitle; + } + + /** + * @return the courseTermCode + */ + public String getCourseTermCode() { + return courseTermCode; + } + + /** + * @param courseTermCode + * the courseTermCode to set; optional; max length 25 characters + */ + public void setCourseTermCode(final String courseTermCode) { + this.courseTermCode = courseTermCode; + } + + /** + * @return the emailCC + */ + public String getEmailCC() { + return emailCC; + } + + /** + * @param emailCC + * the emailCC to set; optional; max length 255 characters + */ + public void setEmailCC(final String emailCC) { + this.emailCC = emailCC; + } + + /** + * @return the campus + */ + public Campus getCampus() { + return campus; + } + + /** + * @param campus + * the campus to set + */ + public void setCampus(final Campus campus) { + this.campus = campus; + } + + /** + * @return the earlyAlertReasonOtherDescription + */ + public String getEarlyAlertReasonOtherDescription() { + return earlyAlertReasonOtherDescription; + } + + /** + * @param earlyAlertReasonOtherDescription + * the earlyAlertReasonOtherDescription to set; optional; max + * length 64000 characters + */ + public void setEarlyAlertReasonOtherDescription( + final String earlyAlertReasonOtherDescription) { + this.earlyAlertReasonOtherDescription = earlyAlertReasonOtherDescription; + } + + /** + * @return the earlyAlertSuggestionOtherDescription + */ + public String getEarlyAlertSuggestionOtherDescription() { + return earlyAlertSuggestionOtherDescription; + } + + /** + * @param earlyAlertSuggestionOtherDescription + * the earlyAlertSuggestionOtherDescription to set; optional; max + * length 64000 characters + */ + public void setEarlyAlertSuggestionOtherDescription( + final String earlyAlertSuggestionOtherDescription) { + this.earlyAlertSuggestionOtherDescription = earlyAlertSuggestionOtherDescription; + } + + /** + * @return the comment + */ + public String getComment() { + return comment; + } + + /** + * @param comment + * the comment; optional; max length 64000 characters + */ + public void setComment(final String comment) { + this.comment = comment; + } + + /** + * @return the closedDate + */ + public Date getClosedDate() { + return closedDate == null ? null : new Date(closedDate.getTime()); + } + + /** + * @param closedDate + * the closedDate to set + */ + public void setClosedDate(final Date closedDate) { + this.closedDate = closedDate == null ? null : new Date( + closedDate.getTime()); + } + + /** + * @return the closedById + */ + public UUID getClosedById() { + return closedBy == null ? null : closedBy.getId(); + } + + public Person getClosedBy() { + return closedBy; + } + + public void setClosedBy(Person closedBy) { + this.closedBy = closedBy; + } + + @Override + public Person getPerson() { + return person; + } + + @Override + public void setPerson(final Person person) { + this.person = person; + } + + /** + * @return the earlyAlertReasonIds + */ + public Set getEarlyAlertReasons() { + return earlyAlertReasonIds; + } + + /** + * @param earlyAlertReasonIds + * the earlyAlertReasonIds to set + */ + public void setEarlyAlertReasons( + final Set earlyAlertReasonIds) { + this.earlyAlertReasonIds = earlyAlertReasonIds; + } + + /** + * @return the earlyAlertSuggestionIds + */ + public Set getEarlyAlertSuggestions() { + return earlyAlertSuggestions; + } + + /** + * @param earlyAlertSuggestionIds + * the earlyAlertSuggestionIds to set + */ + public void setEarlyAlertSuggestions( + final Set earlyAlertSuggestionIds) { + this.earlyAlertSuggestions = earlyAlertSuggestionIds; + } + + //TAPS 20140039 BEGIN + /** + * @return the earlyAlertInterventionIds + */ + public Set getEarlyAlertInterventions() { + return earlyAlertInterventions; + } + + /** + * @param earlyAlertInterventionIds + * the earlyAlertInterventionIds to set + */ + public void setEarlyAlertInterventions( + final Set earlyAlertInterventionIds) { + this.earlyAlertInterventions = earlyAlertInterventionIds; + } + //TAPS 20140039 END + + @Override + protected int hashPrime() { + return 179; + } + + @Override + final public int hashCode() { // NOPMD by jon.adams on 5/9/12 1:50 PM + int result = hashPrime(); + + // Auditable properties + result *= getId() == null ? "id".hashCode() : getId().hashCode(); + result *= getObjectStatus() == null ? hashPrime() : getObjectStatus() + .hashCode(); + + // EarlyAlert + result *= hashField("courseName", courseName); + result *= hashField("courseTitle", courseTitle); + result *= hashField("courseTermCode", courseTermCode); + result *= hashField("emailCC", emailCC); + result *= hashField("campus", campus); + result *= hashField("earlyAlertReasonOtherDescription", + earlyAlertReasonOtherDescription); //TAPS 20140039 + result *= hashField("earlyAlertSuggestionOtherDescription", + earlyAlertSuggestionOtherDescription); //TAPS 20140039 + result *= hashField("comment", comment); + result *= hashField("person", person); + result *= hashField("closedDate", closedDate); + result *= hashField("closedById", closedBy == null ? null : closedBy.getId()); + + return result; + } + + public int getResponseCount() { + return responseCount; + } + + public void setResponseCount(int responseCount) { + this.responseCount = responseCount; + } + + public Date getLastResponseDate() { + return lastResponseDate; + } + + public void setResponseDates(Date lastResponseDate) { + this.lastResponseDate = lastResponseDate; + } + } \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/model/reference/EarlyAlertIntervention.java b/src/main/java/org/jasig/ssp/model/reference/EarlyAlertIntervention.java new file mode 100644 index 0000000000..6937e2c7dc --- /dev/null +++ b/src/main/java/org/jasig/ssp/model/reference/EarlyAlertIntervention.java @@ -0,0 +1,123 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertIntervention.java + */ +package org.jasig.ssp.model.reference; + +import java.util.UUID; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.validation.constraints.NotNull; + +import org.jasig.ssp.model.Auditable; + +/** + * EarlyAlertIntervention reference object. + * + * Based on EarlyAlertSuggestion by @author jon.adams + */ +@Entity +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) +public class EarlyAlertIntervention + extends AbstractReference + implements Auditable { + + private static final long serialVersionUID = 118184491549077723L; + + @Column(nullable = false) + @NotNull + private short sortOrder = 0; // NOPMD by jon.adams on 5/4/12 1:42 PM + + /** + * Constructor + */ + public EarlyAlertIntervention() { + super(); + } + + /** + * Constructor + * + * @param id + * Identifier; required + */ + + public EarlyAlertIntervention(@NotNull final UUID id) { + super(id); + } + + /** + * Constructor + * + * @param id + * Identifier; required + * @param name + * Name; required; max 80 characters + * @param description + * Description; max 64000 characters + * @param sortOrder + * Default sort order when displaying objects to the user + */ + public EarlyAlertIntervention(@NotNull final UUID id, + @NotNull final String name, + final String description, final short sortOrder) { // NOPMD + super(id, name, description); + this.sortOrder = sortOrder; + } + + /** + * Gets the default sort order when displaying an item list to the user + * + * @return the sortOrder + */ + public short getSortOrder() { // NOPMD by jon.adams on 5/4/12 1:42 PM + return sortOrder; + } + + /** + * Sets the default sort order when displaying an item list to the user + * + * @param sortOrder + * the sortOrder to set + */ + public void setSortOrder(final short sortOrder) { // NOPMD by jon on 5/4/12 + // 11:16 + this.sortOrder = sortOrder; + } + + /** + * Unique (amongst all Models in the system) prime for use by + * {@link #hashCode()} + */ + @Override + protected int hashPrime() { + return 151; + } + + @Override + public int hashCode() { // NOPMD by jon.adams on 5/3/12 11:48 AM + return hashPrime() * super.hashCode() + * hashField("sortOrder", sortOrder); + } +} \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/service/impl/EarlyAlertServiceImpl.java b/src/main/java/org/jasig/ssp/service/impl/EarlyAlertServiceImpl.java index 093aeef061..091f818dbe 100644 --- a/src/main/java/org/jasig/ssp/service/impl/EarlyAlertServiceImpl.java +++ b/src/main/java/org/jasig/ssp/service/impl/EarlyAlertServiceImpl.java @@ -1,878 +1,900 @@ -/** - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jasig.ssp.service.impl; // NOPMD by jon.adams - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - -import javax.mail.SendFailedException; -import javax.validation.constraints.NotNull; - -import org.apache.commons.lang.StringUtils; -import org.jasig.ssp.dao.EarlyAlertDao; -import org.jasig.ssp.model.AuditPerson; -import org.jasig.ssp.model.EarlyAlert; -import org.jasig.ssp.model.EarlyAlertRouting; -import org.jasig.ssp.model.Message; -import org.jasig.ssp.model.ObjectStatus; -import org.jasig.ssp.model.Person; -import org.jasig.ssp.model.PersonProgramStatus; -import org.jasig.ssp.model.SubjectAndBody; -import org.jasig.ssp.model.external.FacultyCourse; -import org.jasig.ssp.model.external.Term; -import org.jasig.ssp.model.reference.Campus; -import org.jasig.ssp.model.reference.EarlyAlertReason; -import org.jasig.ssp.model.reference.EarlyAlertSuggestion; -import org.jasig.ssp.model.reference.ProgramStatus; -import org.jasig.ssp.model.reference.StudentType; -import org.jasig.ssp.security.SspUser; -import org.jasig.ssp.service.AbstractPersonAssocAuditableService; -import org.jasig.ssp.service.EarlyAlertRoutingService; -import org.jasig.ssp.service.EarlyAlertService; -import org.jasig.ssp.service.MessageService; -import org.jasig.ssp.service.ObjectNotFoundException; -import org.jasig.ssp.service.PersonProgramStatusService; -import org.jasig.ssp.service.PersonService; -import org.jasig.ssp.service.SecurityService; -import org.jasig.ssp.service.external.FacultyCourseService; -import org.jasig.ssp.service.external.TermService; -import org.jasig.ssp.service.reference.ConfigService; -import org.jasig.ssp.service.reference.EarlyAlertReasonService; -import org.jasig.ssp.service.reference.EarlyAlertSuggestionService; -import org.jasig.ssp.service.reference.MessageTemplateService; -import org.jasig.ssp.service.reference.ProgramStatusService; -import org.jasig.ssp.service.reference.StudentTypeService; -import org.jasig.ssp.transferobject.EarlyAlertTO; -import org.jasig.ssp.transferobject.messagetemplate.CoachPersonLiteMessageTemplateTO; -import org.jasig.ssp.transferobject.messagetemplate.EarlyAlertMessageTemplateTO; -import org.jasig.ssp.transferobject.reports.EarlyAlertStudentReportTO; -import org.jasig.ssp.transferobject.reports.EarlyAlertStudentSearchTO; -import org.jasig.ssp.transferobject.reports.EntityCountByCoachSearchForm; -import org.jasig.ssp.transferobject.reports.EntityStudentCountByCoachTO; -import org.jasig.ssp.util.DateTimeUtils; -import org.jasig.ssp.util.collections.Pair; -import org.jasig.ssp.util.sort.PagingWrapper; -import org.jasig.ssp.util.sort.SortingAndPaging; -import org.jasig.ssp.web.api.validation.ValidationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -/** - * EarlyAlert service implementation - * - * @author jon.adams - * - */ -@Service -@Transactional -public class EarlyAlertServiceImpl extends // NOPMD - AbstractPersonAssocAuditableService - implements EarlyAlertService { - - @Autowired - private transient EarlyAlertDao dao; - - @Autowired - private transient ConfigService configService; - - @Autowired - private transient EarlyAlertRoutingService earlyAlertRoutingService; - - @Autowired - private transient MessageService messageService; - - @Autowired - private transient MessageTemplateService messageTemplateService; - - @Autowired - private transient EarlyAlertReasonService earlyAlertReasonService; - - @Autowired - private transient EarlyAlertSuggestionService earlyAlertSuggestionService; - - @Autowired - private transient PersonService personService; - - @Autowired - private transient FacultyCourseService facultyCourseService; - - @Autowired - private transient TermService termService; - - @Autowired - private transient PersonProgramStatusService personProgramStatusService; - - @Autowired - private transient ProgramStatusService programStatusService; - - @Autowired - private transient StudentTypeService studentTypeService; - - @Autowired - private transient SecurityService securityService; - - private static final Logger LOGGER = LoggerFactory - .getLogger(EarlyAlertServiceImpl.class); - - @Override - protected EarlyAlertDao getDao() { - return dao; - } - - @Override - public EarlyAlert create(@NotNull final EarlyAlert earlyAlert) - throws ObjectNotFoundException, ValidationException { - // Validate objects - if (earlyAlert == null) { - throw new IllegalArgumentException("EarlyAlert must be provided."); - } - - if (earlyAlert.getPerson() == null) { - throw new ValidationException( - "EarlyAlert Student data must be provided."); - } - - final Person student = earlyAlert.getPerson(); - - // Figure student advisor or early alert coordinator - final UUID assignedAdvisor = getEarlyAlertAdvisor(earlyAlert); - if (assignedAdvisor == null) { - throw new ValidationException( - "Could not determine the Early Alert Advisor for student ID " - + student.getId()); - } - - if (student.getCoach() == null - || assignedAdvisor.equals(student.getCoach().getId())) { - student.setCoach(personService.get(assignedAdvisor)); - } - - ensureValidAlertedOnPersonStateNoFail(student); - - // Create alert - final EarlyAlert saved = getDao().save(earlyAlert); - - // Send e-mail to assigned advisor (coach) - try { - sendMessageToAdvisor(saved, earlyAlert.getEmailCC()); - } catch (final SendFailedException e) { - LOGGER.warn( - "Could not send Early Alert message to advisor.", - e); - throw new ValidationException( - "Early Alert notification e-mail could not be sent to advisor. Early Alert was NOT created.", - e); - } - - // Send e-mail CONFIRMATION to faculty - try { - sendConfirmationMessageToFaculty(saved); - } catch (final SendFailedException e) { - LOGGER.warn( - "Could not send Early Alert confirmation to faculty.", - e); - throw new ValidationException( - "Early Alert confirmation e-mail could not be sent. Early Alert was NOT created.", - e); - } - - return saved; - } - - @Override - public void closeEarlyAlert(UUID earlyAlertId) - throws ObjectNotFoundException, ValidationException { - final EarlyAlert earlyAlert = getDao().get(earlyAlertId); - - // DAOs don't implement ObjectNotFoundException consistently and we'd - // rather they not implement it at all, so a small attempt at 'future - // proofing' here - if ( earlyAlert == null ) { - throw new ObjectNotFoundException(earlyAlertId, EarlyAlert.class.getName()); - } - - if ( earlyAlert.getClosedDate() != null ) { - // already closed - return; - } - - final SspUser sspUser = securityService.currentUser(); - if ( sspUser == null ) { - throw new ValidationException("Early Alert cannot be closed by a null User."); - } - - earlyAlert.setClosedDate(new Date()); - earlyAlert.setClosedBy(sspUser.getPerson()); - - // This save will result in a Hib session flush, which works fine with - // our current usage. Future use cases might prefer to delay the - // flush and we can address that when the time comes. Might not even - // need to change anything here if it turns out nothing actually - // *depends* on the flush. - getDao().save(earlyAlert); - } - - @Override - public void openEarlyAlert(UUID earlyAlertId) - throws ObjectNotFoundException, ValidationException { - final EarlyAlert earlyAlert = getDao().get(earlyAlertId); - - // DAOs don't implement ObjectNotFoundException consistently and we'd - // rather they not implement it at all, so a small attempt at 'future - // proofing' here - if ( earlyAlert == null ) { - throw new ObjectNotFoundException(earlyAlertId, EarlyAlert.class.getName()); - } - - if ( earlyAlert.getClosedDate() == null ) { - return; - } - - final SspUser sspUser = securityService.currentUser(); - if ( sspUser == null ) { - throw new ValidationException("Early Alert cannot be closed by a null User."); - } - - earlyAlert.setClosedDate(null); - earlyAlert.setClosedBy(null); - - // This save will result in a Hib session flush, which works fine with - // our current usage. Future use cases might prefer to delay the - // flush and we can address that when the time comes. Might not even - // need to change anything here if it turns out nothing actually - // *depends* on the flush. - getDao().save(earlyAlert); - } - - @Override - public EarlyAlert save(@NotNull final EarlyAlert obj) - throws ObjectNotFoundException { - final EarlyAlert current = getDao().get(obj.getId()); - - current.setCourseName(obj.getCourseName()); - current.setCourseTitle(obj.getCourseTitle()); - current.setEmailCC(obj.getEmailCC()); - current.setCampus(obj.getCampus()); - current.setEarlyAlertReasonOtherDescription(obj - .getEarlyAlertReasonOtherDescription()); - current.setComment(obj.getComment()); - current.setClosedDate(obj.getClosedDate()); - if ( obj.getClosedById() == null ) { - current.setClosedBy(null); - } else { - current.setClosedBy(personService.get(obj.getClosedById())); - } - - if (obj.getPerson() == null) { - current.setPerson(null); - } else { - current.setPerson(personService.get(obj.getPerson().getId())); - } - - final Set earlyAlertReasons = new HashSet(); - if (obj.getEarlyAlertReasons() != null) { - for (final EarlyAlertReason reason : obj.getEarlyAlertReasons()) { - earlyAlertReasons.add(earlyAlertReasonService.load(reason - .getId())); - } - } - - current.setEarlyAlertReasons(earlyAlertReasons); - - final Set earlyAlertSuggestions = new HashSet(); - if (obj.getEarlyAlertSuggestions() != null) { - for (final EarlyAlertSuggestion reason : obj - .getEarlyAlertSuggestions()) { - earlyAlertSuggestions.add(earlyAlertSuggestionService - .load(reason - .getId())); - } - } - - current.setEarlyAlertSuggestions(earlyAlertSuggestions); - - return getDao().save(current); - } - - @Override - public PagingWrapper getAllForPerson(final Person person, - final SortingAndPaging sAndP) { - return getDao().getAllForPersonId(person.getId(), sAndP); - } - - /** - * Business logic to determine the advisor that is assigned to the student - * for this Early Alert. - * - * @param earlyAlert - * EarlyAlert instance - * @throws ValidationException - * If Early Alert, Student, and/or system information could not - * determine the advisor for this student. - * @return The assigned advisor - */ - private UUID getEarlyAlertAdvisor(final EarlyAlert earlyAlert) - throws ValidationException { - // Check for student already assigned to an advisor (a.k.a. coach) - if ((earlyAlert.getPerson().getCoach() != null) && - (earlyAlert.getPerson().getCoach().getId() != null)) { - return earlyAlert.getPerson().getCoach().getId(); - } - - // Get campus Early Alert coordinator - if (earlyAlert.getCampus() == null) { - throw new IllegalArgumentException("Campus ID can not be null."); - } - - if (earlyAlert.getCampus().getEarlyAlertCoordinatorId() != null) { - // Return Early Alert coordinator UUID - return earlyAlert.getCampus().getEarlyAlertCoordinatorId(); - } - - // TODO If no campus EA Coordinator, assign to default EA Coordinator - // (which is not yet implemented) - - // getEarlyAlertAdvisor should never return null - throw new ValidationException( - "Could not determined the Early Alert Coordinator for this student. Ensure that a default coordinator is set globally and for all campuses."); - } - - private void ensureValidAlertedOnPersonStateNoFail(Person person) { - try { - ensureValidAlertedOnPersonStateOrFail(person); - } catch ( Exception e ) { - LOGGER.error("Unable to set a program status or student type on " - + "person '{}'. This is likely to prevent that person " - + "record from appearing in caseloads, student searches, " - + "and some reports.", person.getId(), e); - } - } - - private void ensureValidAlertedOnPersonStateOrFail(Person person) - throws ObjectNotFoundException, ValidationException { - - if ( person.getObjectStatus() != ObjectStatus.ACTIVE ) { - person.setObjectStatus(ObjectStatus.ACTIVE); - } - - final ProgramStatus programStatus = programStatusService.getActiveStatus(); - if ( programStatus == null ) { - throw new ObjectNotFoundException( - "Unable to find a ProgramStatus representing \"activeness\".", - "ProgramStatus"); - } - - Set programStatuses = - person.getProgramStatuses(); - if ( programStatuses == null || programStatuses.isEmpty() ) { - PersonProgramStatus personProgramStatus = new PersonProgramStatus(); - personProgramStatus.setEffectiveDate(new Date()); - personProgramStatus.setProgramStatus(programStatus); - personProgramStatus.setPerson(person); - programStatuses.add(personProgramStatus); - person.setProgramStatuses(programStatuses); - // save should cascade, but make sure custom create logic fires - personProgramStatusService.create(personProgramStatus); - } - - if ( person.getStudentType() == null ) { - StudentType studentType = studentTypeService.get(StudentType.EAL_ID); - if ( studentType == null ) { - throw new ObjectNotFoundException( - "Unable to find a StudentType representing an early " - + "alert-assigned type.", "StudentType"); - } - person.setStudentType(studentType); - } - } - - /** - * Send e-mail ({@link Message}) to the assigned advisor for the student. - * - * @param earlyAlert - * Early Alert - * @param emailCC - * Email address to also CC this message - * @throws ObjectNotFoundException - * @throws SendFailedException - * @throws ValidationException - */ - private void sendMessageToAdvisor(@NotNull final EarlyAlert earlyAlert, // NOPMD - final String emailCC) throws ObjectNotFoundException, - SendFailedException, ValidationException { - if (earlyAlert == null) { - throw new IllegalArgumentException("Early alert was missing."); - } - - if (earlyAlert.getPerson() == null) { - throw new IllegalArgumentException("EarlyAlert Person is missing."); - } - - final Person person = earlyAlert.getPerson().getCoach(); - final SubjectAndBody subjAndBody = messageTemplateService - .createEarlyAlertAdvisorConfirmationMessage(fillTemplateParameters(earlyAlert)); - - if ( person == null ) { - LOGGER.warn("Student {} had no coach when EarlyAlert {} was" - + " created. Unable to send message to coach.", - earlyAlert.getPerson(), earlyAlert); - } else { - // Create and queue the message - final Message message = messageService.createMessage(person, emailCC, - subjAndBody); - LOGGER.info("Message {} created for EarlyAlert {}", message, earlyAlert); - } - - // Send same message to all applicable Campus Early Alert routing - // entries - final PagingWrapper routes = earlyAlertRoutingService - .getAllForCampus(earlyAlert.getCampus(), new SortingAndPaging( - ObjectStatus.ACTIVE)); - if (routes.getResults() > 0) { - for (final EarlyAlertRouting route : routes.getRows()) { - // Check that route applies - if (route.getEarlyAlertReason() == null) { - throw new ObjectNotFoundException( - "EarlyAlertRouting missing EarlyAlertReason.", - "EarlyAlertReason"); - } - - // Only routes that are for any of the Reasons in this - // EarlyAlert should be applied. - if ((earlyAlert.getEarlyAlertReasons() == null) - || !earlyAlert.getEarlyAlertReasons().contains( - route.getEarlyAlertReason())) { - continue; - } - - // Send e-mail to specific person - final Person to = route.getPerson(); - if ((to != null) - && !StringUtils.isEmpty(to.getPrimaryEmailAddress())) { - final Message message = messageService - .createMessage(to, null, subjAndBody); - LOGGER.info( - "Message {} for EarlyAlert {} also routed to {}", - new Object[] { message, earlyAlert, to }); // NOPMD - } - - // Send e-mail to a group - if (!StringUtils.isEmpty(route.getGroupName()) - && !StringUtils.isEmpty(route.getGroupEmail())) { - final Message message = messageService - .createMessage(route.getGroupEmail(), null, - subjAndBody); - LOGGER.info( - "Message {} for EarlyAlert {} also routed to {}", - new Object[] { message, earlyAlert, // NOPMD - route.getGroupEmail() }); - } - } - } - } - - @Override - public void sendMessageToStudent(@NotNull final EarlyAlert earlyAlert) - throws ObjectNotFoundException, SendFailedException, - ValidationException { - if (earlyAlert == null) { - throw new IllegalArgumentException("EarlyAlert was missing."); - } - - if (earlyAlert.getPerson() == null) { - throw new IllegalArgumentException("EarlyAlert.Person is missing."); - } - - final Person person = earlyAlert.getPerson(); - final SubjectAndBody subjAndBody = messageTemplateService - .createEarlyAlertToStudentMessage(fillTemplateParameters(earlyAlert)); - - // Create and queue the message - final Message message = messageService.createMessage(person, null, - subjAndBody); - - LOGGER.info("Message {} created for EarlyAlert {}", message, earlyAlert); - } - - /** - * Send confirmation e-mail ({@link Message}) to the faculty who created - * this alert. - * - * @param earlyAlert - * Early Alert - * @throws ObjectNotFoundException - * @throws SendFailedException - * @throws ValidationException - */ - private void sendConfirmationMessageToFaculty(final EarlyAlert earlyAlert) - throws ObjectNotFoundException, SendFailedException, - ValidationException { - if (earlyAlert == null) { - throw new IllegalArgumentException("EarlyAlert was missing."); - } - - if (earlyAlert.getPerson() == null) { - throw new IllegalArgumentException("EarlyAlert.Person is missing."); - } - - final UUID personId = earlyAlert.getCreatedBy().getId(); - Person person = personService.get(personId); - if ( person == null ) { - LOGGER.warn("EarlyAlert {} has no creator. Unable to send" - + " confirmation message to faculty.", earlyAlert); - } else { - final SubjectAndBody subjAndBody = messageTemplateService - .createEarlyAlertFacultyConfirmationMessage(fillTemplateParameters(earlyAlert)); - - // Create and queue the message - final Message message = messageService.createMessage(person, null, - subjAndBody); - - LOGGER.info("Message {} created for EarlyAlert {}", message, earlyAlert); - } - } - - @Override - public Map fillTemplateParameters( - @NotNull final EarlyAlert earlyAlert) { - if (earlyAlert == null) { - throw new IllegalArgumentException("EarlyAlert was missing."); - } - - if (earlyAlert.getPerson() == null) { - throw new IllegalArgumentException("EarlyAlert.Person is missing."); - } - - if (earlyAlert.getCreatedBy() == null) { - throw new IllegalArgumentException( - "EarlyAlert.CreatedBy is missing."); - } - - if (earlyAlert.getCampus() == null) { - throw new IllegalArgumentException("EarlyAlert.Campus is missing."); - } - - // ensure earlyAlert.createdBy is populated - if ((earlyAlert.getCreatedBy() == null) - || (earlyAlert.getCreatedBy().getFirstName() == null)) { - if (earlyAlert.getCreatedBy() == null) { - throw new IllegalArgumentException( - "EarlyAlert.CreatedBy is missing."); - } -// -// try { -// //earlyAlert.setCreatedBy(new AuditPerson(personService.get(earlyAlert.getCreatedBy().getId())).getId()); -// } catch (final ObjectNotFoundException e) { -// throw new IllegalArgumentException( -// "EarlyAlert.CreatedBy.Id could not be loaded.", e); -// } - } - - final Map templateParameters = Maps.newHashMap(); - - final String courseName = earlyAlert.getCourseName(); - if ( StringUtils.isNotBlank(courseName) ) { - Person creator; - try { - creator = personService.get(earlyAlert.getCreatedBy().getId()); - } catch (ObjectNotFoundException e1) { - throw new IllegalArgumentException( - "EarlyAlert.CreatedBy.Id could not be loaded.", e1); - } - final String facultySchoolId = creator.getSchoolId(); - if ( (StringUtils.isNotBlank(facultySchoolId)) ) { - String termCode = earlyAlert.getCourseTermCode(); - FacultyCourse course = null; - try { - if ( StringUtils.isBlank(termCode) ) { - course = facultyCourseService. - getCourseByFacultySchoolIdAndFormattedCourse( - facultySchoolId, courseName); - } else { - course = facultyCourseService. - getCourseByFacultySchoolIdAndFormattedCourseAndTermCode( - facultySchoolId, courseName, termCode); - } - } catch ( ObjectNotFoundException e ) { - // Trace irrelevant. see below for logging. prefer to - // do it there, after the null check b/c not all service - // methods implement ObjectNotFoundException reliably. - } - if ( course != null ) { - templateParameters.put("course", course); - if ( StringUtils.isBlank(termCode) ) { - termCode = course.getTermCode(); - } - if ( StringUtils.isNotBlank(termCode) ) { - Term term = null; - try { - term = termService.getByCode(termCode); - } catch ( ObjectNotFoundException e ) { - // Trace irrelevant. See below for logging. - } - if ( term != null ) { - templateParameters.put("term", term); - } else { - LOGGER.info("Not adding term to message template" - + " params or early alert {} because" - + " the term code {} did not resolve to" - + " an external term record", - earlyAlert.getId(), termCode); - } - } - } else { - LOGGER.info("Not adding course nor term to message template" - + " params for early alert {} because the associated" - + " course {} and faculty school id {} did not" - + " resolve to an external course record.", - new Object[] { earlyAlert.getId(), courseName, - facultySchoolId}); - } - } - } - Person creator = null; - try{ - creator = personService.get(earlyAlert.getCreatedBy().getId()); - }catch(ObjectNotFoundException exp) { - LOGGER.error("Early Alert Creator Not found sending message for early alert:" + earlyAlert.getId(), exp); - } - - EarlyAlertMessageTemplateTO eaMTO = new EarlyAlertMessageTemplateTO(earlyAlert,creator); - - //Only early alerts response late messages sent to coaches - if(eaMTO.getCoach() == null){ - try{ - // if no earlyAlert.getCampus() error thrown by design, should never not be a campus. - eaMTO.setCoach(new CoachPersonLiteMessageTemplateTO(personService.get(earlyAlert.getCampus().getEarlyAlertCoordinatorId()))); - }catch(ObjectNotFoundException exp){ - LOGGER.error("Early Alert with id: " + earlyAlert.getId() + " does not have valid campus coordinator, no coach assigned: " + earlyAlert.getCampus().getEarlyAlertCoordinatorId(), exp); - } - } - - templateParameters.put("earlyAlert", eaMTO); - templateParameters.put("termToRepresentEarlyAlert", - configService.getByNameEmpty("term_to_represent_early_alert")); - templateParameters.put("TermToRepresentEarlyAlert", - configService.getByNameEmpty("term_to_represent_early_alert")); - templateParameters.put("linkToSSP", - configService.getByNameEmpty("serverExternalPath")); - templateParameters.put("applicationTitle", - configService.getByNameEmpty("app_title")); - templateParameters.put("institutionName", - configService.getByNameEmpty("inst_name")); - - templateParameters.put("FirstName", eaMTO.getPerson().getFirstName()); - templateParameters.put("LastName", eaMTO.getPerson().getLastName()); - templateParameters.put("CourseName", eaMTO.getCourseName()); - - return templateParameters; - } - - @Override - public void applyEarlyAlertCounts(Person person) { - if ( person == null ) { - return; // can occur in some legit person lookup call paths - } -// Map activeCnts = -// getCountOfActiveAlertsForPeopleIds(Sets.newHashSet(person.getId())); -// if ( activeCnts == null || !(activeCnts.containsKey(person.getId())) ) { -// person.setActiveAlertsCount(0); -// } else { -// person.setActiveAlertsCount(activeCnts.get(person.getId())); -// } -// Map closedCnts = -// getCountOfClosedAlertsForPeopleIds(Sets.newHashSet(person.getId())); -// if ( closedCnts == null || !(closedCnts.containsKey(person.getId())) ) { -// person.setClosedAlertsCount(0); -// } else { -// person.setClosedAlertsCount(closedCnts.get(person.getId())); -// } - } - - @Override - public Map getCountOfActiveAlertsForPeopleIds( - final Collection peopleIds) { - return dao.getCountOfActiveAlertsForPeopleIds(peopleIds); - } - - @Override - public Map getCountOfClosedAlertsForPeopleIds( - final Collection peopleIds) { - return dao.getCountOfClosedAlertsForPeopleIds(peopleIds); - } - - @Override - public Long getCountOfEarlyAlertsForSchoolIds( - final Collection shoolIds, Campus campus) { - return dao.getCountOfAlertsForSchoolIds(shoolIds, campus); - } - - @Override - public Long getEarlyAlertCountForCoach(Person coach, Date createDateFrom, Date createDateTo, List studentTypeIds) { - return dao.getEarlyAlertCountForCoach(coach, createDateFrom, createDateTo, studentTypeIds); - } - - @Override - public Long getStudentEarlyAlertCountForCoach(Person coach, Date createDateFrom, Date createDateTo, List studentTypeIds) { - return dao.getStudentEarlyAlertCountForCoach(coach, createDateFrom, createDateTo, studentTypeIds); - } - - @Override - public Long getCountOfEarlyAlertsByCreatedDate(Date createDatedFrom, Date createdDateTo, Campus campus, String rosterStatus) { - return dao.getCountOfEarlyAlertsByCreatedDate(createDatedFrom, createdDateTo, campus, rosterStatus); - } - - @Override - public Long getCountOfEarlyAlertsClosedByDate(Date closedDateFrom, Date closedDateTo, Campus campus, String rosterStatus) { - return dao.getCountOfEarlyAlertsClosedByDate(closedDateFrom, closedDateTo, campus, rosterStatus); - } - - @Override - public Long getCountOfEarlyAlertStudentsByDate(Date createDatedFrom, - Date createdDateTo, Campus campus, String rosterStatus) { - return dao.getCountOfEarlyAlertStudentsByDate(createDatedFrom, createdDateTo, campus, rosterStatus); - } - - @Override - public PagingWrapper getStudentsEarlyAlertCountSetForCritera( - EarlyAlertStudentSearchTO earlyAlertStudentSearchTO, - SortingAndPaging createForSingleSort) { - return dao.getStudentsEarlyAlertCountSetForCritera(earlyAlertStudentSearchTO, createForSingleSort); - } - - @Override - public PagingWrapper getStudentEarlyAlertCountByCoaches(EntityCountByCoachSearchForm form) { - return dao.getStudentEarlyAlertCountByCoaches(form); - } - - @Override - public Long getEarlyAlertCountSetForCritera(EarlyAlertStudentSearchTO searchForm){ - return dao.getEarlyAlertCountSetForCritera(searchForm); - } - - @Override - public void sendAllEarlyAlertReminderNotifications() { - Date lastResponseDate = getMinimumResponseComplianceDate(); - // if no responseDate is given no emails are sent - if(lastResponseDate == null) - return; - List eaOutOfCompliance = dao.getResponseDueEarlyAlerts(lastResponseDate); - Map> easByCoach = new HashMap>(); - for(EarlyAlert earlyAlert: eaOutOfCompliance){ - Person coach = earlyAlert.getPerson().getCoach(); - //Only early alerts response late messages sent to coaches - if(coach == null){ - try{ - // if no earlyAlert.getCampus() error thrown by design, should never not be a campus. - coach = personService.get(earlyAlert.getCampus().getEarlyAlertCoordinatorId()); - }catch(ObjectNotFoundException exp){ - LOGGER.error("Early Alert with id: " + earlyAlert.getId() + " does not have valid campus coordinator, no coach assigned: " + earlyAlert.getCampus().getEarlyAlertCoordinatorId(), exp); - } - } - if(easByCoach.containsKey(coach)){ - List coachEarlyAlerts = easByCoach.get(coach); - Person creator = null; - try{ - creator = personService.get(earlyAlert.getCreatedBy().getId()); - }catch(ObjectNotFoundException exp){ - LOGGER.error("Early Alert with id: " + earlyAlert.getId() + " does not have valid creator: " + earlyAlert.getCreatedBy(), exp); - } - coachEarlyAlerts.add(new EarlyAlertMessageTemplateTO(earlyAlert, creator)); - }else{ - easByCoach.put(coach, Lists.newArrayList(new EarlyAlertMessageTemplateTO(earlyAlert))); - } - } - for(Person coach: easByCoach.keySet()){ - Map messageParams = new HashMap(); - - Collections.sort(easByCoach.get(coach), new Comparator() { - @Override public int compare(EarlyAlertTO p1, EarlyAlertTO p2) { - Date p1Date = p1.getLastResponseDate(); - if(p1Date == null) - p1Date = p1.getCreatedDate(); - Date p2Date = p2.getLastResponseDate(); - if(p2Date == null) - p2Date = p2.getCreatedDate(); - return p1Date.compareTo(p2Date); - } - - }); - - Integer daysSince1900ResponseExpected = DateTimeUtils.daysSince1900(lastResponseDate); - List> earlyAlertTOPairs = new ArrayList>(); - for(EarlyAlertMessageTemplateTO ea:easByCoach.get(coach)){ - Integer daysOutOfCompliance; - if(ea.getLastResponseDate() != null){ - daysOutOfCompliance = daysSince1900ResponseExpected - DateTimeUtils.daysSince1900(ea.getLastResponseDate()); - }else{ - daysOutOfCompliance = daysSince1900ResponseExpected - DateTimeUtils.daysSince1900(ea.getCreatedDate()); - } - - // Just in case attempt to only send emails for EA full day out of compliance - if(daysOutOfCompliance >= 0) - earlyAlertTOPairs.add(new Pair(ea, daysOutOfCompliance)); - } - messageParams.put("earlyAlertTOPairs", earlyAlertTOPairs); - messageParams.put("coach", coach); - messageParams.put("DateTimeUtils", DateTimeUtils.class); - messageParams.put("termToRepresentEarlyAlert", - configService.getByNameEmpty("term_to_represent_early_alert")); - SubjectAndBody subjAndBody = messageTemplateService.createEarlyAlertResponseRequiredToCoachMessage(messageParams); - try{ - messageService.createMessage(coach, null, subjAndBody); - }catch(Exception exp){ - LOGGER.error("Unable to send reminder emails to coach: " + coach.getFullName() + "\n", exp); - } - } - - } - - public Map getResponsesDueCountEarlyAlerts(List personIds){ - Date lastResponseDate = getMinimumResponseComplianceDate(); - if(lastResponseDate == null) - return new HashMap(); - return dao.getResponsesDueCountEarlyAlerts(personIds, lastResponseDate); - } - - private Date getMinimumResponseComplianceDate(){ - final String numVal = configService - .getByNameNull("maximum_days_before_early_alert_response"); - if(StringUtils.isBlank(numVal)) - return null; - Integer allowedDaysPastResponse = Integer.parseInt(numVal); - - return DateTimeUtils.getDateOffsetInDays(new Date(), -allowedDaysPastResponse); - - } +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * 06/16/2014 IRSC Jonathan Hart - TAPS 20140039: Added EarlyAlertInterventions Faculty Interventions to ReachOut + */ +package org.jasig.ssp.service.impl; // NOPMD by jon.adams + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +import javax.mail.SendFailedException; +import javax.validation.constraints.NotNull; + +import org.apache.commons.lang.StringUtils; +import org.jasig.ssp.dao.EarlyAlertDao; +import org.jasig.ssp.model.AuditPerson; +import org.jasig.ssp.model.EarlyAlert; +import org.jasig.ssp.model.EarlyAlertRouting; +import org.jasig.ssp.model.Message; +import org.jasig.ssp.model.ObjectStatus; +import org.jasig.ssp.model.Person; +import org.jasig.ssp.model.PersonProgramStatus; +import org.jasig.ssp.model.SubjectAndBody; +import org.jasig.ssp.model.external.FacultyCourse; +import org.jasig.ssp.model.external.Term; +import org.jasig.ssp.model.reference.Campus; +import org.jasig.ssp.model.reference.EarlyAlertReason; +import org.jasig.ssp.model.reference.EarlyAlertSuggestion; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; //TAPS 20140039 +import org.jasig.ssp.model.reference.ProgramStatus; +import org.jasig.ssp.model.reference.StudentType; +import org.jasig.ssp.security.SspUser; +import org.jasig.ssp.service.AbstractPersonAssocAuditableService; +import org.jasig.ssp.service.EarlyAlertRoutingService; +import org.jasig.ssp.service.EarlyAlertService; +import org.jasig.ssp.service.MessageService; +import org.jasig.ssp.service.ObjectNotFoundException; +import org.jasig.ssp.service.PersonProgramStatusService; +import org.jasig.ssp.service.PersonService; +import org.jasig.ssp.service.SecurityService; +import org.jasig.ssp.service.external.FacultyCourseService; +import org.jasig.ssp.service.external.TermService; +import org.jasig.ssp.service.reference.ConfigService; +import org.jasig.ssp.service.reference.EarlyAlertReasonService; +import org.jasig.ssp.service.reference.EarlyAlertSuggestionService; +import org.jasig.ssp.service.reference.EarlyAlertInterventionService; //TAPS 20140039 +import org.jasig.ssp.service.reference.MessageTemplateService; +import org.jasig.ssp.service.reference.ProgramStatusService; +import org.jasig.ssp.service.reference.StudentTypeService; +import org.jasig.ssp.transferobject.EarlyAlertTO; +import org.jasig.ssp.transferobject.messagetemplate.CoachPersonLiteMessageTemplateTO; +import org.jasig.ssp.transferobject.messagetemplate.EarlyAlertMessageTemplateTO; +import org.jasig.ssp.transferobject.reports.EarlyAlertStudentReportTO; +import org.jasig.ssp.transferobject.reports.EarlyAlertStudentSearchTO; +import org.jasig.ssp.transferobject.reports.EntityCountByCoachSearchForm; +import org.jasig.ssp.transferobject.reports.EntityStudentCountByCoachTO; +import org.jasig.ssp.util.DateTimeUtils; +import org.jasig.ssp.util.collections.Pair; +import org.jasig.ssp.util.sort.PagingWrapper; +import org.jasig.ssp.util.sort.SortingAndPaging; +import org.jasig.ssp.web.api.validation.ValidationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +/** + * EarlyAlert service implementation + * + * @author jon.adams + * + */ +@Service +@Transactional +public class EarlyAlertServiceImpl extends // NOPMD + AbstractPersonAssocAuditableService + implements EarlyAlertService { + + @Autowired + private transient EarlyAlertDao dao; + + @Autowired + private transient ConfigService configService; + + @Autowired + private transient EarlyAlertRoutingService earlyAlertRoutingService; + + @Autowired + private transient MessageService messageService; + + @Autowired + private transient MessageTemplateService messageTemplateService; + + @Autowired + private transient EarlyAlertReasonService earlyAlertReasonService; + + @Autowired + private transient EarlyAlertSuggestionService earlyAlertSuggestionService; + + @Autowired //TAPS 20140039 + private transient EarlyAlertInterventionService earlyAlertInterventionService; //TAPS 20140039 + + @Autowired + private transient PersonService personService; + + @Autowired + private transient FacultyCourseService facultyCourseService; + + @Autowired + private transient TermService termService; + + @Autowired + private transient PersonProgramStatusService personProgramStatusService; + + @Autowired + private transient ProgramStatusService programStatusService; + + @Autowired + private transient StudentTypeService studentTypeService; + + @Autowired + private transient SecurityService securityService; + + private static final Logger LOGGER = LoggerFactory + .getLogger(EarlyAlertServiceImpl.class); + + @Override + protected EarlyAlertDao getDao() { + return dao; + } + + @Override + public EarlyAlert create(@NotNull final EarlyAlert earlyAlert) + throws ObjectNotFoundException, ValidationException { + // Validate objects + if (earlyAlert == null) { + throw new IllegalArgumentException("EarlyAlert must be provided."); + } + + if (earlyAlert.getPerson() == null) { + throw new ValidationException( + "EarlyAlert Student data must be provided."); + } + + final Person student = earlyAlert.getPerson(); + + // Figure student advisor or early alert coordinator + final UUID assignedAdvisor = getEarlyAlertAdvisor(earlyAlert); + if (assignedAdvisor == null) { + throw new ValidationException( + "Could not determine the EarlyAlert Advisor for student ID " + + student.getId()); + } + + if (student.getCoach() == null + || assignedAdvisor.equals(student.getCoach().getId())) { + student.setCoach(personService.get(assignedAdvisor)); + } + + ensureValidAlertedOnPersonStateNoFail(student); + + // Create alert + final EarlyAlert saved = getDao().save(earlyAlert); + + // Send e-mail to assigned advisor (coach) + try { + sendMessageToAdvisor(saved, earlyAlert.getEmailCC()); + } catch (final SendFailedException e) { + LOGGER.warn( + "Could not send EarlyAlert message to advisor.", + e); + throw new ValidationException( + "EarlyAlert notification e-mail could not be sent to advisor. EarlyAlert was NOT created.", + e); + } + + // Send e-mail CONFIRMATION to faculty + try { + sendConfirmationMessageToFaculty(saved); + } catch (final SendFailedException e) { + LOGGER.warn( + "Could not send EarlyAlert confirmation to faculty.", + e); + throw new ValidationException( + "EarlyAlert confirmation e-mail could not be sent. EarlyAlert was NOT created.", + e); + } + + return saved; + } + + @Override + public void closeEarlyAlert(UUID earlyAlertId) + throws ObjectNotFoundException, ValidationException { + final EarlyAlert earlyAlert = getDao().get(earlyAlertId); + + // DAOs don't implement ObjectNotFoundException consistently and we'd + // rather they not implement it at all, so a small attempt at 'future + // proofing' here + if ( earlyAlert == null ) { + throw new ObjectNotFoundException(earlyAlertId, EarlyAlert.class.getName()); + } + + if ( earlyAlert.getClosedDate() != null ) { + // already closed + return; + } + + final SspUser sspUser = securityService.currentUser(); + if ( sspUser == null ) { + throw new ValidationException("EarlyAlert cannot be closed by a null User."); + } + + earlyAlert.setClosedDate(new Date()); + earlyAlert.setClosedBy(sspUser.getPerson()); + + // This save will result in a Hib session flush, which works fine with + // our current usage. Future use cases might prefer to delay the + // flush and we can address that when the time comes. Might not even + // need to change anything here if it turns out nothing actually + // *depends* on the flush. + getDao().save(earlyAlert); + } + + @Override + public void openEarlyAlert(UUID earlyAlertId) + throws ObjectNotFoundException, ValidationException { + final EarlyAlert earlyAlert = getDao().get(earlyAlertId); + + // DAOs don't implement ObjectNotFoundException consistently and we'd + // rather they not implement it at all, so a small attempt at 'future + // proofing' here + if ( earlyAlert == null ) { + throw new ObjectNotFoundException(earlyAlertId, EarlyAlert.class.getName()); + } + + if ( earlyAlert.getClosedDate() == null ) { + return; + } + + final SspUser sspUser = securityService.currentUser(); + if ( sspUser == null ) { + throw new ValidationException("EarlyAlert cannot be closed by a null User."); + } + + earlyAlert.setClosedDate(null); + earlyAlert.setClosedBy(null); + + // This save will result in a Hib session flush, which works fine with + // our current usage. Future use cases might prefer to delay the + // flush and we can address that when the time comes. Might not even + // need to change anything here if it turns out nothing actually + // *depends* on the flush. + getDao().save(earlyAlert); + } + + @Override + public EarlyAlert save(@NotNull final EarlyAlert obj) + throws ObjectNotFoundException { + final EarlyAlert current = getDao().get(obj.getId()); + + current.setCourseName(obj.getCourseName()); + current.setCourseTitle(obj.getCourseTitle()); + current.setEmailCC(obj.getEmailCC()); + current.setCampus(obj.getCampus()); + current.setEarlyAlertReasonOtherDescription(obj + .getEarlyAlertReasonOtherDescription()); + current.setComment(obj.getComment()); + current.setClosedDate(obj.getClosedDate()); + if ( obj.getClosedById() == null ) { + current.setClosedBy(null); + } else { + current.setClosedBy(personService.get(obj.getClosedById())); + } + + if (obj.getPerson() == null) { + current.setPerson(null); + } else { + current.setPerson(personService.get(obj.getPerson().getId())); + } + + final Set earlyAlertReasons = new HashSet(); + if (obj.getEarlyAlertReasons() != null) { + for (final EarlyAlertReason reason : obj.getEarlyAlertReasons()) { + earlyAlertReasons.add(earlyAlertReasonService.load(reason + .getId())); + } + } + + current.setEarlyAlertReasons(earlyAlertReasons); + + final Set earlyAlertSuggestions = new HashSet(); + if (obj.getEarlyAlertSuggestions() != null) { + for (final EarlyAlertSuggestion reason : obj + .getEarlyAlertSuggestions()) { + earlyAlertSuggestions.add(earlyAlertSuggestionService + .load(reason + .getId())); + } + } + + current.setEarlyAlertSuggestions(earlyAlertSuggestions); + + //TAPS 20140039 BEGIN + final Set earlyAlertInterventions = new HashSet(); + if (obj.getEarlyAlertInterventions() != null) { + for (final EarlyAlertIntervention reason : obj + .getEarlyAlertInterventions()) { + earlyAlertInterventions.add(earlyAlertInterventionService + .load(reason + .getId())); + } + } + + current.setEarlyAlertInterventions(earlyAlertInterventions); + //TAPS 20140039 END + + return getDao().save(current); + } + + @Override + public PagingWrapper getAllForPerson(final Person person, + final SortingAndPaging sAndP) { + return getDao().getAllForPersonId(person.getId(), sAndP); + } + + /** + * Business logic to determine the advisor that is assigned to the student + * for this Early Alert. + * + * @param earlyAlert + * EarlyAlert instance + * @throws ValidationException + * If Early Alert, Student, and/or system information could not + * determine the advisor for this student. + * @return The assigned advisor + */ + private UUID getEarlyAlertAdvisor(final EarlyAlert earlyAlert) + throws ValidationException { + // Check for student already assigned to an advisor (a.k.a. coach) + if ((earlyAlert.getPerson().getCoach() != null) && + (earlyAlert.getPerson().getCoach().getId() != null)) { + return earlyAlert.getPerson().getCoach().getId(); + } + + // Get campus Early Alert coordinator + if (earlyAlert.getCampus() == null) { + throw new IllegalArgumentException("Campus ID can not be null."); + } + + if (earlyAlert.getCampus().getEarlyAlertCoordinatorId() != null) { + // Return Early Alert coordinator UUID + return earlyAlert.getCampus().getEarlyAlertCoordinatorId(); + } + + // TODO If no campus EA Coordinator, assign to default EA Coordinator + // (which is not yet implemented) + + // getEarlyAlertAdvisor should never return null + throw new ValidationException( + "Could not determined the EarlyAlert Coordinator for this student. Ensure that a default coordinator is set globally and for all campuses."); + } + + private void ensureValidAlertedOnPersonStateNoFail(Person person) { + try { + ensureValidAlertedOnPersonStateOrFail(person); + } catch ( Exception e ) { + LOGGER.error("Unable to set a program status or student type on " + + "person '{}'. This is likely to prevent that person " + + "record from appearing in caseloads, student searches, " + + "and some reports.", person.getId(), e); + } + } + + private void ensureValidAlertedOnPersonStateOrFail(Person person) + throws ObjectNotFoundException, ValidationException { + + if ( person.getObjectStatus() != ObjectStatus.ACTIVE ) { + person.setObjectStatus(ObjectStatus.ACTIVE); + } + + final ProgramStatus programStatus = programStatusService.getActiveStatus(); + if ( programStatus == null ) { + throw new ObjectNotFoundException( + "Unable to find a ProgramStatus representing \"activeness\".", + "ProgramStatus"); + } + + Set programStatuses = + person.getProgramStatuses(); + if ( programStatuses == null || programStatuses.isEmpty() ) { + PersonProgramStatus personProgramStatus = new PersonProgramStatus(); + personProgramStatus.setEffectiveDate(new Date()); + personProgramStatus.setProgramStatus(programStatus); + personProgramStatus.setPerson(person); + programStatuses.add(personProgramStatus); + person.setProgramStatuses(programStatuses); + // save should cascade, but make sure custom create logic fires + personProgramStatusService.create(personProgramStatus); + } + + if ( person.getStudentType() == null ) { + StudentType studentType = studentTypeService.get(StudentType.EAL_ID); + if ( studentType == null ) { + throw new ObjectNotFoundException( + "Unable to find a StudentType representing an early " + + "alert-assigned type.", "StudentType"); + } + person.setStudentType(studentType); + } + } + + /** + * Send e-mail ({@link Message}) to the assigned advisor for the student. + * + * @param earlyAlert + * Early Alert + * @param emailCC + * Email address to also CC this message + * @throws ObjectNotFoundException + * @throws SendFailedException + * @throws ValidationException + */ + private void sendMessageToAdvisor(@NotNull final EarlyAlert earlyAlert, // NOPMD + final String emailCC) throws ObjectNotFoundException, + SendFailedException, ValidationException { + if (earlyAlert == null) { + throw new IllegalArgumentException("Early alert was missing."); + } + + if (earlyAlert.getPerson() == null) { + throw new IllegalArgumentException("EarlyAlert Person is missing."); + } + + final Person person = earlyAlert.getPerson().getCoach(); + final SubjectAndBody subjAndBody = messageTemplateService + .createEarlyAlertAdvisorConfirmationMessage(fillTemplateParameters(earlyAlert)); + + if ( person == null ) { + LOGGER.warn("Student {} had no coach when EarlyAlert {} was" + + " created. Unable to send message to coach.", + earlyAlert.getPerson(), earlyAlert); + } else { + // Create and queue the message + final Message message = messageService.createMessage(person, emailCC, + subjAndBody); + LOGGER.info("Message {} created for EarlyAlert {}", message, earlyAlert); + } + + // Send same message to all applicable Campus Early Alert routing + // entries + final PagingWrapper routes = earlyAlertRoutingService + .getAllForCampus(earlyAlert.getCampus(), new SortingAndPaging( + ObjectStatus.ACTIVE)); + if (routes.getResults() > 0) { + for (final EarlyAlertRouting route : routes.getRows()) { + // Check that route applies + if (route.getEarlyAlertReason() == null) { + throw new ObjectNotFoundException( + "EarlyAlertRouting missing EarlyAlertReason.", + "EarlyAlertReason"); + } + + // Only routes that are for any of the Reasons in this + // EarlyAlert should be applied. + if ((earlyAlert.getEarlyAlertReasons() == null) + || !earlyAlert.getEarlyAlertReasons().contains( + route.getEarlyAlertReason())) { + continue; + } + + // Send e-mail to specific person + final Person to = route.getPerson(); + if ((to != null) + && !StringUtils.isEmpty(to.getPrimaryEmailAddress())) { + final Message message = messageService + .createMessage(to, null, subjAndBody); + LOGGER.info( + "Message {} for EarlyAlert {} also routed to {}", + new Object[] { message, earlyAlert, to }); // NOPMD + } + + // Send e-mail to a group + if (!StringUtils.isEmpty(route.getGroupName()) + && !StringUtils.isEmpty(route.getGroupEmail())) { + final Message message = messageService + .createMessage(route.getGroupEmail(), null, + subjAndBody); + LOGGER.info( + "Message {} for EarlyAlert {} also routed to {}", + new Object[] { message, earlyAlert, // NOPMD + route.getGroupEmail() }); + } + } + } + } + + @Override + public void sendMessageToStudent(@NotNull final EarlyAlert earlyAlert) + throws ObjectNotFoundException, SendFailedException, + ValidationException { + if (earlyAlert == null) { + throw new IllegalArgumentException("EarlyAlert was missing."); + } + + if (earlyAlert.getPerson() == null) { + throw new IllegalArgumentException("EarlyAlert.Person is missing."); + } + + final Person person = earlyAlert.getPerson(); + final SubjectAndBody subjAndBody = messageTemplateService + .createEarlyAlertToStudentMessage(fillTemplateParameters(earlyAlert)); + + // Create and queue the message + final Message message = messageService.createMessage(person, null, + subjAndBody); + + LOGGER.info("Message {} created for EarlyAlert {}", message, earlyAlert); + } + + /** + * Send confirmation e-mail ({@link Message}) to the faculty who created + * this alert. + * + * @param earlyAlert + * Early Alert + * @throws ObjectNotFoundException + * @throws SendFailedException + * @throws ValidationException + */ + private void sendConfirmationMessageToFaculty(final EarlyAlert earlyAlert) + throws ObjectNotFoundException, SendFailedException, + ValidationException { + if (earlyAlert == null) { + throw new IllegalArgumentException("EarlyAlert was missing."); + } + + if (earlyAlert.getPerson() == null) { + throw new IllegalArgumentException("EarlyAlert.Person is missing."); + } + + final UUID personId = earlyAlert.getCreatedBy().getId(); + Person person = personService.get(personId); + if ( person == null ) { + LOGGER.warn("EarlyAlert {} has no creator. Unable to send" + + " confirmation message to faculty.", earlyAlert); + } else { + final SubjectAndBody subjAndBody = messageTemplateService + .createEarlyAlertFacultyConfirmationMessage(fillTemplateParameters(earlyAlert)); + + // Create and queue the message + final Message message = messageService.createMessage(person, null, + subjAndBody); + + LOGGER.info("Message {} created for EarlyAlert {}", message, earlyAlert); + } + } + + @Override + public Map fillTemplateParameters( + @NotNull final EarlyAlert earlyAlert) { + if (earlyAlert == null) { + throw new IllegalArgumentException("EarlyAlert was missing."); + } + + if (earlyAlert.getPerson() == null) { + throw new IllegalArgumentException("EarlyAlert.Person is missing."); + } + + if (earlyAlert.getCreatedBy() == null) { + throw new IllegalArgumentException( + "EarlyAlert.CreatedBy is missing."); + } + + if (earlyAlert.getCampus() == null) { + throw new IllegalArgumentException("EarlyAlert.Campus is missing."); + } + + // ensure earlyAlert.createdBy is populated + if ((earlyAlert.getCreatedBy() == null) + || (earlyAlert.getCreatedBy().getFirstName() == null)) { + if (earlyAlert.getCreatedBy() == null) { + throw new IllegalArgumentException( + "EarlyAlert.CreatedBy is missing."); + } +// +// try { +// //earlyAlert.setCreatedBy(new AuditPerson(personService.get(earlyAlert.getCreatedBy().getId())).getId()); +// } catch (final ObjectNotFoundException e) { +// throw new IllegalArgumentException( +// "EarlyAlert.CreatedBy.Id could not be loaded.", e); +// } + } + + final Map templateParameters = Maps.newHashMap(); + + final String courseName = earlyAlert.getCourseName(); + if ( StringUtils.isNotBlank(courseName) ) { + Person creator; + try { + creator = personService.get(earlyAlert.getCreatedBy().getId()); + } catch (ObjectNotFoundException e1) { + throw new IllegalArgumentException( + "EarlyAlert.CreatedBy.Id could not be loaded.", e1); + } + final String facultySchoolId = creator.getSchoolId(); + if ( (StringUtils.isNotBlank(facultySchoolId)) ) { + String termCode = earlyAlert.getCourseTermCode(); + FacultyCourse course = null; + try { + if ( StringUtils.isBlank(termCode) ) { + course = facultyCourseService. + getCourseByFacultySchoolIdAndFormattedCourse( + facultySchoolId, courseName); + } else { + course = facultyCourseService. + getCourseByFacultySchoolIdAndFormattedCourseAndTermCode( + facultySchoolId, courseName, termCode); + } + } catch ( ObjectNotFoundException e ) { + // Trace irrelevant. see below for logging. prefer to + // do it there, after the null check b/c not all service + // methods implement ObjectNotFoundException reliably. + } + if ( course != null ) { + templateParameters.put("course", course); + if ( StringUtils.isBlank(termCode) ) { + termCode = course.getTermCode(); + } + if ( StringUtils.isNotBlank(termCode) ) { + Term term = null; + try { + term = termService.getByCode(termCode); + } catch ( ObjectNotFoundException e ) { + // Trace irrelevant. See below for logging. + } + if ( term != null ) { + templateParameters.put("term", term); + } else { + LOGGER.info("Not adding term to message template" + + " params or early alert {} because" + + " the term code {} did not resolve to" + + " an external term record", + earlyAlert.getId(), termCode); + } + } + } else { + LOGGER.info("Not adding course nor term to message template" + + " params for early alert {} because the associated" + + " course {} and faculty school id {} did not" + + " resolve to an external course record.", + new Object[] { earlyAlert.getId(), courseName, + facultySchoolId}); + } + } + } + Person creator = null; + try{ + creator = personService.get(earlyAlert.getCreatedBy().getId()); + }catch(ObjectNotFoundException exp) { + LOGGER.error("EarlyAlert Creator Not found sending message for EarlyAlert:" + earlyAlert.getId(), exp); + } + + EarlyAlertMessageTemplateTO eaMTO = new EarlyAlertMessageTemplateTO(earlyAlert,creator); + + //Only early alerts response late messages sent to coaches + if(eaMTO.getCoach() == null){ + try{ + // if no earlyAlert.getCampus() error thrown by design, should never not be a campus. + eaMTO.setCoach(new CoachPersonLiteMessageTemplateTO(personService.get(earlyAlert.getCampus().getEarlyAlertCoordinatorId()))); + }catch(ObjectNotFoundException exp){ + LOGGER.error("EarlyAlert with id: " + earlyAlert.getId() + " does not have valid campus coordinator, no coach assigned: " + earlyAlert.getCampus().getEarlyAlertCoordinatorId(), exp); + } + } + + templateParameters.put("earlyAlert", eaMTO); + templateParameters.put("termToRepresentEarlyAlert", + configService.getByNameEmpty("term_to_represent_early_alert")); + templateParameters.put("TermToRepresentEarlyAlert", + configService.getByNameEmpty("term_to_represent_early_alert")); + templateParameters.put("linkToSSP", + configService.getByNameEmpty("serverExternalPath")); + templateParameters.put("applicationTitle", + configService.getByNameEmpty("app_title")); + templateParameters.put("institutionName", + configService.getByNameEmpty("inst_name")); + + templateParameters.put("FirstName", eaMTO.getPerson().getFirstName()); + templateParameters.put("LastName", eaMTO.getPerson().getLastName()); + templateParameters.put("CourseName", eaMTO.getCourseName()); + + return templateParameters; + } + + @Override + public void applyEarlyAlertCounts(Person person) { + if ( person == null ) { + return; // can occur in some legit person lookup call paths + } +// Map activeCnts = +// getCountOfActiveAlertsForPeopleIds(Sets.newHashSet(person.getId())); +// if ( activeCnts == null || !(activeCnts.containsKey(person.getId())) ) { +// person.setActiveAlertsCount(0); +// } else { +// person.setActiveAlertsCount(activeCnts.get(person.getId())); +// } +// Map closedCnts = +// getCountOfClosedAlertsForPeopleIds(Sets.newHashSet(person.getId())); +// if ( closedCnts == null || !(closedCnts.containsKey(person.getId())) ) { +// person.setClosedAlertsCount(0); +// } else { +// person.setClosedAlertsCount(closedCnts.get(person.getId())); +// } + } + + @Override + public Map getCountOfActiveAlertsForPeopleIds( + final Collection peopleIds) { + return dao.getCountOfActiveAlertsForPeopleIds(peopleIds); + } + + @Override + public Map getCountOfClosedAlertsForPeopleIds( + final Collection peopleIds) { + return dao.getCountOfClosedAlertsForPeopleIds(peopleIds); + } + + @Override + public Long getCountOfEarlyAlertsForSchoolIds( + final Collection shoolIds, Campus campus) { + return dao.getCountOfAlertsForSchoolIds(shoolIds, campus); + } + + @Override + public Long getEarlyAlertCountForCoach(Person coach, Date createDateFrom, Date createDateTo, List studentTypeIds) { + return dao.getEarlyAlertCountForCoach(coach, createDateFrom, createDateTo, studentTypeIds); + } + + @Override + public Long getStudentEarlyAlertCountForCoach(Person coach, Date createDateFrom, Date createDateTo, List studentTypeIds) { + return dao.getStudentEarlyAlertCountForCoach(coach, createDateFrom, createDateTo, studentTypeIds); + } + + @Override + public Long getCountOfEarlyAlertsByCreatedDate(Date createDatedFrom, Date createdDateTo, Campus campus, String rosterStatus) { + return dao.getCountOfEarlyAlertsByCreatedDate(createDatedFrom, createdDateTo, campus, rosterStatus); + } + + @Override + public Long getCountOfEarlyAlertsClosedByDate(Date closedDateFrom, Date closedDateTo, Campus campus, String rosterStatus) { + return dao.getCountOfEarlyAlertsClosedByDate(closedDateFrom, closedDateTo, campus, rosterStatus); + } + + @Override + public Long getCountOfEarlyAlertStudentsByDate(Date createDatedFrom, + Date createdDateTo, Campus campus, String rosterStatus) { + return dao.getCountOfEarlyAlertStudentsByDate(createDatedFrom, createdDateTo, campus, rosterStatus); + } + + @Override + public PagingWrapper getStudentsEarlyAlertCountSetForCritera( + EarlyAlertStudentSearchTO earlyAlertStudentSearchTO, + SortingAndPaging createForSingleSort) { + return dao.getStudentsEarlyAlertCountSetForCritera(earlyAlertStudentSearchTO, createForSingleSort); + } + + @Override + public PagingWrapper getStudentEarlyAlertCountByCoaches(EntityCountByCoachSearchForm form) { + return dao.getStudentEarlyAlertCountByCoaches(form); + } + + @Override + public Long getEarlyAlertCountSetForCritera(EarlyAlertStudentSearchTO searchForm){ + return dao.getEarlyAlertCountSetForCritera(searchForm); + } + + @Override + public void sendAllEarlyAlertReminderNotifications() { + Date lastResponseDate = getMinimumResponseComplianceDate(); + // if no responseDate is given no emails are sent + if(lastResponseDate == null) + return; + List eaOutOfCompliance = dao.getResponseDueEarlyAlerts(lastResponseDate); + Map> easByCoach = new HashMap>(); + for(EarlyAlert earlyAlert: eaOutOfCompliance){ + Person coach = earlyAlert.getPerson().getCoach(); + //Only early alerts response late messages sent to coaches + if(coach == null){ + try{ + // if no earlyAlert.getCampus() error thrown by design, should never not be a campus. + coach = personService.get(earlyAlert.getCampus().getEarlyAlertCoordinatorId()); + }catch(ObjectNotFoundException exp){ + LOGGER.error("EarlyAlert with id: " + earlyAlert.getId() + " does not have valid campus coordinator, no coach assigned: " + earlyAlert.getCampus().getEarlyAlertCoordinatorId(), exp); + } + } + if(easByCoach.containsKey(coach)){ + List coachEarlyAlerts = easByCoach.get(coach); + Person creator = null; + try{ + creator = personService.get(earlyAlert.getCreatedBy().getId()); + }catch(ObjectNotFoundException exp){ + LOGGER.error("EarlyAlert with id: " + earlyAlert.getId() + " does not have valid creator: " + earlyAlert.getCreatedBy(), exp); + } + coachEarlyAlerts.add(new EarlyAlertMessageTemplateTO(earlyAlert, creator)); + }else{ + easByCoach.put(coach, Lists.newArrayList(new EarlyAlertMessageTemplateTO(earlyAlert))); + } + } + for(Person coach: easByCoach.keySet()){ + Map messageParams = new HashMap(); + + Collections.sort(easByCoach.get(coach), new Comparator() { + @Override public int compare(EarlyAlertTO p1, EarlyAlertTO p2) { + Date p1Date = p1.getLastResponseDate(); + if(p1Date == null) + p1Date = p1.getCreatedDate(); + Date p2Date = p2.getLastResponseDate(); + if(p2Date == null) + p2Date = p2.getCreatedDate(); + return p1Date.compareTo(p2Date); + } + + }); + + Integer daysSince1900ResponseExpected = DateTimeUtils.daysSince1900(lastResponseDate); + List> earlyAlertTOPairs = new ArrayList>(); + for(EarlyAlertMessageTemplateTO ea:easByCoach.get(coach)){ + Integer daysOutOfCompliance; + if(ea.getLastResponseDate() != null){ + daysOutOfCompliance = daysSince1900ResponseExpected - DateTimeUtils.daysSince1900(ea.getLastResponseDate()); + }else{ + daysOutOfCompliance = daysSince1900ResponseExpected - DateTimeUtils.daysSince1900(ea.getCreatedDate()); + } + + // Just in case attempt to only send emails for EA full day out of compliance + if(daysOutOfCompliance >= 0) + earlyAlertTOPairs.add(new Pair(ea, daysOutOfCompliance)); + } + messageParams.put("earlyAlertTOPairs", earlyAlertTOPairs); + messageParams.put("coach", coach); + messageParams.put("DateTimeUtils", DateTimeUtils.class); + messageParams.put("termToRepresentEarlyAlert", + configService.getByNameEmpty("term_to_represent_early_alert")); + SubjectAndBody subjAndBody = messageTemplateService.createEarlyAlertResponseRequiredToCoachMessage(messageParams); + try{ + messageService.createMessage(coach, null, subjAndBody); + }catch(Exception exp){ + LOGGER.error("Unable to send reminder emails to coach: " + coach.getFullName() + "\n", exp); + } + } + + } + + public Map getResponsesDueCountEarlyAlerts(List personIds){ + Date lastResponseDate = getMinimumResponseComplianceDate(); + if(lastResponseDate == null) + return new HashMap(); + return dao.getResponsesDueCountEarlyAlerts(personIds, lastResponseDate); + } + + private Date getMinimumResponseComplianceDate(){ + final String numVal = configService + .getByNameNull("maximum_days_before_early_alert_response"); + if(StringUtils.isBlank(numVal)) + return null; + Integer allowedDaysPastResponse = Integer.parseInt(numVal); + + return DateTimeUtils.getDateOffsetInDays(new Date(), -allowedDaysPastResponse); + + } } \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/service/reference/EarlyAlertInterventionService.java b/src/main/java/org/jasig/ssp/service/reference/EarlyAlertInterventionService.java new file mode 100644 index 0000000000..a9ebb8801c --- /dev/null +++ b/src/main/java/org/jasig/ssp/service/reference/EarlyAlertInterventionService.java @@ -0,0 +1,48 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/16/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionService.java + */ +package org.jasig.ssp.service.reference; + +import java.util.UUID; + +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.service.ReferenceService; + +/** + * EarlyAlertIntervention service + * + * Based on EarlyAlertSuggestion service by @author jon.adams + */ +public interface EarlyAlertInterventionService extends + ReferenceService { + + /** + * Lazily load an instance for the specified identifier. + * + * @param id + * Identifier + * @return A lazily-loaded instance for the specified identifier. + */ + EarlyAlertIntervention load(UUID id); + +} diff --git a/src/main/java/org/jasig/ssp/service/reference/impl/EarlyAlertInterventionServiceImpl.java b/src/main/java/org/jasig/ssp/service/reference/impl/EarlyAlertInterventionServiceImpl.java new file mode 100644 index 0000000000..8e2fb0c617 --- /dev/null +++ b/src/main/java/org/jasig/ssp/service/reference/impl/EarlyAlertInterventionServiceImpl.java @@ -0,0 +1,68 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/16/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionServiceImpl.java + */ +package org.jasig.ssp.service.reference.impl; + +import java.util.UUID; + +import org.jasig.ssp.dao.reference.EarlyAlertInterventionDao; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.service.reference.EarlyAlertInterventionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * EarlyAlertIntervention service implementation + * + * Based on EarlyAlertSuggestion service by @author jon.adams + */ +@Service +@Transactional +public class EarlyAlertInterventionServiceImpl extends + AbstractReferenceService + implements EarlyAlertInterventionService { + + @Autowired + transient private EarlyAlertInterventionDao dao; + + /** + * Set the DAO instance + * + * @param dao + * The DAO instance + */ + protected void setDao(final EarlyAlertInterventionDao dao) { + this.dao = dao; + } + + @Override + protected EarlyAlertInterventionDao getDao() { + return dao; + } + + @Override + public EarlyAlertIntervention load(final UUID id) { + return dao.load(id); + } +} diff --git a/src/main/java/org/jasig/ssp/transferobject/EarlyAlertTO.java b/src/main/java/org/jasig/ssp/transferobject/EarlyAlertTO.java index 198e237329..38056229ad 100644 --- a/src/main/java/org/jasig/ssp/transferobject/EarlyAlertTO.java +++ b/src/main/java/org/jasig/ssp/transferobject/EarlyAlertTO.java @@ -1,428 +1,469 @@ -/** - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jasig.ssp.transferobject; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import org.codehaus.jackson.annotate.JsonIgnore; -import org.jasig.ssp.model.EarlyAlert; -import org.jasig.ssp.model.Person; -import org.jasig.ssp.model.reference.EarlyAlertReason; -import org.jasig.ssp.model.reference.EarlyAlertSuggestion; -import org.jasig.ssp.transferobject.reference.EarlyAlertReasonTO; -import org.jasig.ssp.transferobject.reference.EarlyAlertSuggestionTO; - -import com.google.common.collect.Sets; - -/** - * Early Alert transfer object - * - * @author jon.adams - */ -public class EarlyAlertTO extends AbstractAuditableTO implements - TransferObject, Serializable { - - private static final long serialVersionUID = -3197180145189755870L; - - private String courseName; - - private String courseTitle; - - private String courseTermCode; - - private String emailCC; - - private UUID campusId; - - private String earlyAlertReasonOtherDescription; - - private String earlyAlertSuggestionOtherDescription; - - private String comment; - - private UUID personId; - - private Date closedDate; - - private UUID closedById; - - private String closedByName; - - private Integer noOfResponses; - - private Set earlyAlertReasonIds; - - private Set earlyAlertSuggestionIds; - - private Boolean sendEmailToStudent = Boolean.FALSE; - - private Date lastResponseDate; - - @JsonIgnore //For Student History Report - private Set earlyAlertReasonTOs; - @JsonIgnore - private Set earlyAlertSuggestionTOs; - - /** - * Empty constructor - */ - public EarlyAlertTO() { - super(); - } - - /** - * Construct a transfer object based on the specified model. - * - * @param earlyAlert - * Model to copy from - */ - public EarlyAlertTO(final EarlyAlert earlyAlert) { - super(); - from(earlyAlert); - } - - @Override - public void from(final EarlyAlert earlyAlert) { - super.from(earlyAlert); - - courseName = earlyAlert.getCourseName(); - courseTitle = earlyAlert.getCourseTitle(); - courseTermCode = earlyAlert.getCourseTermCode(); - emailCC = earlyAlert.getEmailCC(); - campusId = earlyAlert.getCampus() == null ? null : earlyAlert - .getCampus().getId(); - earlyAlertReasonOtherDescription = earlyAlert - .getEarlyAlertReasonOtherDescription(); - earlyAlertSuggestionOtherDescription = earlyAlert - .getEarlyAlertSuggestionOtherDescription(); - comment = earlyAlert.getComment(); - closedDate = earlyAlert.getClosedDate(); - closedById = earlyAlert.getClosedById(); - earlyAlertReasonIds = Sets.newHashSet(); - earlyAlertSuggestionIds = Sets.newHashSet(); - earlyAlertReasonTOs = Sets.newHashSet(); - earlyAlertSuggestionTOs = Sets.newHashSet(); - - if ( closedById != null ) { - Person closedBy = earlyAlert.getClosedBy(); - closedByName = closedBy.getFirstName() - + (closedBy.getMiddleName() == null || closedBy.getMiddleName().length() == 0 ? "" : " " + closedBy.getMiddleName()) - + " " + closedBy.getLastName(); - } - - - - personId = earlyAlert.getPerson() == null ? null : earlyAlert - .getPerson().getId(); - - Set earlyAlertReasonModels = earlyAlert - .getEarlyAlertReasons(); - for (EarlyAlertReason earlyAlertReason : earlyAlertReasonModels) { - earlyAlertReasonIds.add(earlyAlertReason.getId()); - earlyAlertReasonTOs.add(new EarlyAlertReasonTO(earlyAlertReason)); - } - - Set earlyAlertSuggestionModels = earlyAlert - .getEarlyAlertSuggestions(); - for (EarlyAlertSuggestion earlyAlertSuggestion : earlyAlertSuggestionModels) { - earlyAlertSuggestionIds.add(earlyAlertSuggestion.getId()); - earlyAlertSuggestionTOs.add(new EarlyAlertSuggestionTO(earlyAlertSuggestion)); - } - - setNoOfResponses(earlyAlert.getResponseCount()); - - lastResponseDate = earlyAlert.getLastResponseDate(); - } - - /** - * Convert a collection of models to transfer objects. - * - * @param earlyAlerts - * Models to copy - * @return Transfer object equivalent of the models - */ - public static List toTOList( - final Collection earlyAlerts) { - final List earlyAlertTOs = new ArrayList(); - if ((earlyAlerts != null) && !earlyAlerts.isEmpty()) { - for (final EarlyAlert earlyAlert : earlyAlerts) { - earlyAlertTOs.add(new EarlyAlertTO(earlyAlert)); // NOPMD - } - } - - return earlyAlertTOs; - } - - /** - * @return the Course Name - */ - public String getCourseName() { - return courseName; - } - - /** - * @param courseName - * the Course Name to set - */ - public void setCourseName(final String courseName) { - this.courseName = courseName; - } - - /** - * @return the Course Title - */ - public String getCourseTitle() { - return courseTitle; - } - - /** - * @param courseTitle - * the Course Title to set - */ - public void setCourseTitle(final String courseTitle) { - this.courseTitle = courseTitle; - } - - /** - * @return the Course Term Code - */ - public String getCourseTermCode() { - return courseTermCode; - } - - /** - * @param courseTermCode - * the Course Term Code to set - */ - public void setCourseTermCode(final String courseTermCode) { - this.courseTermCode = courseTermCode; - } - - /** - * @return the Email CC field, if any - */ - public String getEmailCC() { - return emailCC; - } - - /** - * @param emailCC - * the Email CC field to set - */ - public void setEmailCC(final String emailCC) { - this.emailCC = emailCC; - } - - /** - * @return the campusId - */ - public UUID getCampusId() { - return campusId; - } - - /** - * @param campusId - * the campusId to set - */ - public void setCampusId(final UUID campusId) { - this.campusId = campusId; - } - - /** - * @return the ReasonOtherDescription - */ - public String getEarlyAlertReasonOtherDescription() { - return earlyAlertReasonOtherDescription; - } - - /** - * @param earlyAlertReasonOtherDescription - * the ReasonOtherDescription to set - */ - public void setEarlyAlertReasonOtherDescription( - final String earlyAlertReasonOtherDescription) { - this.earlyAlertReasonOtherDescription = earlyAlertReasonOtherDescription; - } - - /** - * @return the SuggestionOtherDescription - */ - public String getEarlyAlertSuggestionOtherDescription() { - return earlyAlertSuggestionOtherDescription; - } - - /** - * @param earlyAlertSuggestionOtherDescription - * the SuggestionOtherDescription to set - */ - public void setEarlyAlertSuggestionOtherDescription( - final String earlyAlertSuggestionOtherDescription) { - this.earlyAlertSuggestionOtherDescription = earlyAlertSuggestionOtherDescription; - } - - /** - * @return the comment - */ - public String getComment() { - return comment; - } - - /** - * @param comment - * the comment to set - */ - public void setComment(final String comment) { - this.comment = comment; - } - - /** - * Gets the person identifier - * - * @return The person identifier - */ - public UUID getPersonId() { - return personId; - } - - /** - * Person identifier - * - * @param personId - * Person identifier - */ - public void setPersonId(final UUID personId) { - this.personId = personId; - } - - /** - * @return the closedDate - */ - public Date getClosedDate() { - return closedDate == null ? null : new Date(closedDate.getTime()); - } - - /** - * @param closedDate - * the closedDate to set - */ - public void setClosedDate(final Date closedDate) { - this.closedDate = closedDate == null ? null : new Date( - closedDate.getTime()); - } - - /** - * @return the closedById - */ - public UUID getClosedById() { - return closedById; - } - - /** - * @param closedById - * the closedById to set - */ - public void setClosedById(final UUID closedById) { - this.closedById = closedById; - } - - public String getClosedByName() { - return closedByName; - } - - public void setClosedByName(String closedByName) { - this.closedByName = closedByName; - } - - /** - * For the create API method, if true, will send a message to the student. - * - * @return If true, will send a message to student for the created Early - * Alert. - */ - public Boolean getSendEmailToStudent() { - return sendEmailToStudent; - } - - /** - * @param sendEmailToStudent - * If true, will send a message to student for the created Early - * Alert. Null values will default to false. - */ - public void setSendEmailToStudent(final Boolean sendEmailToStudent) { - this.sendEmailToStudent = sendEmailToStudent; - } - - public Integer getNoOfResponses() { - return noOfResponses; - } - - public void setNoOfResponses(Integer noOfResponses) { - this.noOfResponses = noOfResponses; - } - - public Set getEarlyAlertReasonIds() { - return earlyAlertReasonIds; - } - - public void setEarlyAlertReasonIds(Set earlyAlertReasonIds) { - this.earlyAlertReasonIds = earlyAlertReasonIds; - } - - public Set getEarlyAlertSuggestionIds() { - return earlyAlertSuggestionIds; - } - - public void setEarlyAlertSuggestionIds(Set earlyAlertSuggestionIds) { - this.earlyAlertSuggestionIds = earlyAlertSuggestionIds; - } - - @JsonIgnore - public Set getEarlyAlertReasonTOs() { - return earlyAlertReasonTOs; - } - - @JsonIgnore - public void setEarlyAlertReasonTOs(Set earlyAlertReasonTOs) { - this.earlyAlertReasonTOs = earlyAlertReasonTOs; - } - - @JsonIgnore - public Set getEarlyAlertSuggestionTOs() { - return earlyAlertSuggestionTOs; - } - - @JsonIgnore - public void setEarlyAlertSuggestionTOs(Set earlyAlertSuggestionTOs) { - this.earlyAlertSuggestionTOs = earlyAlertSuggestionTOs; - } - - public Date getLastResponseDate() { - return lastResponseDate; - } - - public void setLastResponseDate(Date lastResponseDate) { - this.lastResponseDate = lastResponseDate; - } +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/16/2014 - Jonathan Hart IRSC TAPS 20140039 - Add EarlyAlertIntervention Faculty Intervention code + */ +package org.jasig.ssp.transferobject; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import org.codehaus.jackson.annotate.JsonIgnore; +import org.jasig.ssp.model.EarlyAlert; +import org.jasig.ssp.model.Person; +import org.jasig.ssp.model.reference.EarlyAlertReason; +import org.jasig.ssp.model.reference.EarlyAlertSuggestion; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; //TAPS 20140039 +import org.jasig.ssp.transferobject.reference.EarlyAlertReasonTO; +import org.jasig.ssp.transferobject.reference.EarlyAlertSuggestionTO; +import org.jasig.ssp.transferobject.reference.EarlyAlertInterventionTO; //TAPS 20140039 + +import com.google.common.collect.Sets; + +/** + * Early Alert transfer object + * + * @author jon.adams + */ +public class EarlyAlertTO extends AbstractAuditableTO implements + TransferObject, Serializable { + + private static final long serialVersionUID = -3197180145189755870L; + + private String courseName; + + private String courseTitle; + + private String courseTermCode; + + private String emailCC; + + private UUID campusId; + + private String earlyAlertReasonOtherDescription; + + private String earlyAlertSuggestionOtherDescription; + + private String comment; + + private UUID personId; + + private Date closedDate; + + private UUID closedById; + + private String closedByName; + + private Integer noOfResponses; + + private Set earlyAlertReasonIds; + + private Set earlyAlertSuggestionIds; + + private Set earlyAlertInterventionIds; //TAPS 20140039 + + private Boolean sendEmailToStudent = Boolean.FALSE; + + private Date lastResponseDate; + + @JsonIgnore //For Student History Report + private Set earlyAlertReasonTOs; + @JsonIgnore + private Set earlyAlertSuggestionTOs; + @JsonIgnore //TAPS 20140039 + private Set earlyAlertInterventionTOs;//TAPS 20140039 + /** + * Empty constructor + */ + public EarlyAlertTO() { + super(); + } + + /** + * Construct a transfer object based on the specified model. + * + * @param earlyAlert + * Model to copy from + */ + public EarlyAlertTO(final EarlyAlert earlyAlert) { + super(); + from(earlyAlert); + } + + @Override + public void from(final EarlyAlert earlyAlert) { + super.from(earlyAlert); + + courseName = earlyAlert.getCourseName(); + courseTitle = earlyAlert.getCourseTitle(); + courseTermCode = earlyAlert.getCourseTermCode(); + emailCC = earlyAlert.getEmailCC(); + campusId = earlyAlert.getCampus() == null ? null : earlyAlert + .getCampus().getId(); + earlyAlertReasonOtherDescription = earlyAlert + .getEarlyAlertReasonOtherDescription(); + earlyAlertSuggestionOtherDescription = earlyAlert + .getEarlyAlertSuggestionOtherDescription(); + comment = earlyAlert.getComment(); + closedDate = earlyAlert.getClosedDate(); + closedById = earlyAlert.getClosedById(); + earlyAlertReasonIds = Sets.newHashSet(); + earlyAlertSuggestionIds = Sets.newHashSet(); + earlyAlertInterventionIds = Sets.newHashSet(); //TAPS 20140039 + earlyAlertReasonTOs = Sets.newHashSet(); + earlyAlertSuggestionTOs = Sets.newHashSet(); + earlyAlertInterventionTOs = Sets.newHashSet(); //TAPS 20140039 + + if ( closedById != null ) { + Person closedBy = earlyAlert.getClosedBy(); + closedByName = closedBy.getFirstName() + + (closedBy.getMiddleName() == null || closedBy.getMiddleName().length() == 0 ? "" : " " + closedBy.getMiddleName()) + + " " + closedBy.getLastName(); + } + + + + personId = earlyAlert.getPerson() == null ? null : earlyAlert + .getPerson().getId(); + + Set earlyAlertReasonModels = earlyAlert + .getEarlyAlertReasons(); + for (EarlyAlertReason earlyAlertReason : earlyAlertReasonModels) { + earlyAlertReasonIds.add(earlyAlertReason.getId()); + earlyAlertReasonTOs.add(new EarlyAlertReasonTO(earlyAlertReason)); + } + + Set earlyAlertSuggestionModels = earlyAlert + .getEarlyAlertSuggestions(); + for (EarlyAlertSuggestion earlyAlertSuggestion : earlyAlertSuggestionModels) { + earlyAlertSuggestionIds.add(earlyAlertSuggestion.getId()); + earlyAlertSuggestionTOs.add(new EarlyAlertSuggestionTO(earlyAlertSuggestion)); + } + //TAPS 20140039 BEGIN + Set earlyAlertInterventionModels = earlyAlert + .getEarlyAlertInterventions(); + for (EarlyAlertIntervention earlyAlertIntervention : earlyAlertInterventionModels) { + earlyAlertInterventionIds.add(earlyAlertIntervention.getId()); + earlyAlertInterventionTOs.add(new EarlyAlertInterventionTO(earlyAlertIntervention)); + } + //TAPS 20140039 END + setNoOfResponses(earlyAlert.getResponseCount()); + + lastResponseDate = earlyAlert.getLastResponseDate(); + } + + /** + * Convert a collection of models to transfer objects. + * + * @param earlyAlerts + * Models to copy + * @return Transfer object equivalent of the models + */ + public static List toTOList( + final Collection earlyAlerts) { + final List earlyAlertTOs = new ArrayList(); + if ((earlyAlerts != null) && !earlyAlerts.isEmpty()) { + for (final EarlyAlert earlyAlert : earlyAlerts) { + earlyAlertTOs.add(new EarlyAlertTO(earlyAlert)); // NOPMD + } + } + + return earlyAlertTOs; + } + + /** + * @return the Course Name + */ + public String getCourseName() { + return courseName; + } + + /** + * @param courseName + * the Course Name to set + */ + public void setCourseName(final String courseName) { + this.courseName = courseName; + } + + /** + * @return the Course Title + */ + public String getCourseTitle() { + return courseTitle; + } + + /** + * @param courseTitle + * the Course Title to set + */ + public void setCourseTitle(final String courseTitle) { + this.courseTitle = courseTitle; + } + + /** + * @return the Course Term Code + */ + public String getCourseTermCode() { + return courseTermCode; + } + + /** + * @param courseTermCode + * the Course Term Code to set + */ + public void setCourseTermCode(final String courseTermCode) { + this.courseTermCode = courseTermCode; + } + + /** + * @return the Email CC field, if any + */ + public String getEmailCC() { + return emailCC; + } + + /** + * @param emailCC + * the Email CC field to set + */ + public void setEmailCC(final String emailCC) { + this.emailCC = emailCC; + } + + /** + * @return the campusId + */ + public UUID getCampusId() { + return campusId; + } + + /** + * @param campusId + * the campusId to set + */ + public void setCampusId(final UUID campusId) { + this.campusId = campusId; + } + + /** + * @return the ReasonOtherDescription + */ + public String getEarlyAlertReasonOtherDescription() { + return earlyAlertReasonOtherDescription; + } + + /** + * @param earlyAlertReasonOtherDescription + * the ReasonOtherDescription to set + */ + public void setEarlyAlertReasonOtherDescription( + final String earlyAlertReasonOtherDescription) { + this.earlyAlertReasonOtherDescription = earlyAlertReasonOtherDescription; + } + + /** + * @return the SuggestionOtherDescription + */ + public String getEarlyAlertSuggestionOtherDescription() { + return earlyAlertSuggestionOtherDescription; + } + + /** + * @param earlyAlertSuggestionOtherDescription + * the SuggestionOtherDescription to set + */ + public void setEarlyAlertSuggestionOtherDescription( + final String earlyAlertSuggestionOtherDescription) { + this.earlyAlertSuggestionOtherDescription = earlyAlertSuggestionOtherDescription; + } + + /** + * @return the comment + */ + public String getComment() { + return comment; + } + + /** + * @param comment + * the comment to set + */ + public void setComment(final String comment) { + this.comment = comment; + } + + /** + * Gets the person identifier + * + * @return The person identifier + */ + public UUID getPersonId() { + return personId; + } + + /** + * Person identifier + * + * @param personId + * Person identifier + */ + public void setPersonId(final UUID personId) { + this.personId = personId; + } + + /** + * @return the closedDate + */ + public Date getClosedDate() { + return closedDate == null ? null : new Date(closedDate.getTime()); + } + + /** + * @param closedDate + * the closedDate to set + */ + public void setClosedDate(final Date closedDate) { + this.closedDate = closedDate == null ? null : new Date( + closedDate.getTime()); + } + + /** + * @return the closedById + */ + public UUID getClosedById() { + return closedById; + } + + /** + * @param closedById + * the closedById to set + */ + public void setClosedById(final UUID closedById) { + this.closedById = closedById; + } + + public String getClosedByName() { + return closedByName; + } + + public void setClosedByName(String closedByName) { + this.closedByName = closedByName; + } + + /** + * For the create API method, if true, will send a message to the student. + * + * @return If true, will send a message to student for the created Early + * Alert. + */ + public Boolean getSendEmailToStudent() { + return sendEmailToStudent; + } + + /** + * @param sendEmailToStudent + * If true, will send a message to student for the created Early + * Alert. Null values will default to false. + */ + public void setSendEmailToStudent(final Boolean sendEmailToStudent) { + this.sendEmailToStudent = sendEmailToStudent; + } + + public Integer getNoOfResponses() { + return noOfResponses; + } + + public void setNoOfResponses(Integer noOfResponses) { + this.noOfResponses = noOfResponses; + } + + public Set getEarlyAlertReasonIds() { + return earlyAlertReasonIds; + } + + public void setEarlyAlertReasonIds(Set earlyAlertReasonIds) { + this.earlyAlertReasonIds = earlyAlertReasonIds; + } + + public Set getEarlyAlertSuggestionIds() { + return earlyAlertSuggestionIds; + } + + public void setEarlyAlertSuggestionIds(Set earlyAlertSuggestionIds) { + this.earlyAlertSuggestionIds = earlyAlertSuggestionIds; + } + + //TAPS 20140039 BEGIN + public Set getEarlyAlertInterventionIds() { + return earlyAlertInterventionIds; + } + + public void setEarlyAlertInterventionIds(Set earlyAlertInterventionIds) { + this.earlyAlertInterventionIds = earlyAlertInterventionIds; + } + //TAPS 20140039 END + + @JsonIgnore + public Set getEarlyAlertReasonTOs() { + return earlyAlertReasonTOs; + } + + @JsonIgnore + public void setEarlyAlertReasonTOs(Set earlyAlertReasonTOs) { + this.earlyAlertReasonTOs = earlyAlertReasonTOs; + } + + @JsonIgnore + public Set getEarlyAlertSuggestionTOs() { + return earlyAlertSuggestionTOs; + } + + @JsonIgnore + public void setEarlyAlertSuggestionTOs(Set earlyAlertSuggestionTOs) { + this.earlyAlertSuggestionTOs = earlyAlertSuggestionTOs; + } + + //TAPS 20140039 BEGIN + @JsonIgnore + public Set getEarlyAlertInterventionTOs() { + return earlyAlertInterventionTOs; + } + + @JsonIgnore + public void setEarlyAlertInterventionTOs(Set earlyAlertInterventionTOs) { + this.earlyAlertInterventionTOs = earlyAlertInterventionTOs; + } + //TAPS 20140039 END + + public Date getLastResponseDate() { + return lastResponseDate; + } + + public void setLastResponseDate(Date lastResponseDate) { + this.lastResponseDate = lastResponseDate; + } } \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/transferobject/reference/EarlyAlertInterventionTO.java b/src/main/java/org/jasig/ssp/transferobject/reference/EarlyAlertInterventionTO.java new file mode 100644 index 0000000000..e2f361da76 --- /dev/null +++ b/src/main/java/org/jasig/ssp/transferobject/reference/EarlyAlertInterventionTO.java @@ -0,0 +1,158 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/16/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionTO.java + */ +package org.jasig.ssp.transferobject.reference; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Set; +import java.util.UUID; + +import javax.validation.constraints.NotNull; + +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.transferobject.NamedTO; +import org.jasig.ssp.transferobject.TransferObject; + +import com.google.common.collect.Sets; + +/** + * EarlyAlertIntervention reference transfer objects + * + * Based on EarlyAlertSuggestion by @author jon.adams + */ +public class EarlyAlertInterventionTO extends + AbstractReferenceTO + implements TransferObject, NamedTO, Serializable { + + private static final long serialVersionUID = 3743316755135265679L; + + private short sortOrder; // NOPMD by jon.adams on 5/4/12 11:16 + + /** + * Empty constructor + */ + public EarlyAlertInterventionTO() { + super(); + } + + /** + * Constructor to initialize the required properties of the class. + * + * @param id + * identifier + * @param name + * name shown to the user + */ + public EarlyAlertInterventionTO(@NotNull final UUID id, + @NotNull final String name) { + super(); + super.setId(id); + super.setName(name); + } + + /** + * Constructor to initialize all properties of the class. + * + * @param id + * identifier + * @param name + * name shown to the user + * @param description + * description shown to the user in detail views + * @param sortOrder + * default sort order for use when displaying a list of these + * reference objects to the user + */ + public EarlyAlertInterventionTO(@NotNull final UUID id, + @NotNull final String name, + final String description, final short sortOrder) { // NOPMD by jon + super(id, name, description); + this.sortOrder = sortOrder; + } + + /** + * Construct a transfer object based on the data in the supplied model. + * + * @param model + * Model data to copy + */ + public EarlyAlertInterventionTO(@NotNull final EarlyAlertIntervention model) { + super(); + + if (model == null) { + throw new IllegalArgumentException("Model can not be null."); + } + + from(model); + } + + @Override + public final void from(final EarlyAlertIntervention model) { + if (model == null) { + throw new IllegalArgumentException("Model can not be null."); + } + + super.from(model); + sortOrder = model.getSortOrder(); + } + + /** + * @return the sortOrder + */ + public short getSortOrder() { // NOPMD by jon on 5/4/12 11:16 + return sortOrder; + } + + /** + * @param sortOrder + * the sortOrder to set + */ + public void setSortOrder(final short sortOrder) { // NOPMD by jon on 5/4/12 + if (sortOrder < 0) { + throw new IllegalArgumentException( + "Sort order must be 0 or a positive integer, not " + + sortOrder); + } + + this.sortOrder = sortOrder; + } + + /** + * Convert a collection of models to a collection of equivalent transfer + * objects. + * + * @param models + * Collection of models to copy + * @return A collection of equivalent transfer objects. + */ + public static Set toTOSet( + @NotNull final Collection models) { + final Set tObjects = Sets.newHashSet(); + for (final EarlyAlertIntervention model : models) { + tObjects.add(new EarlyAlertInterventionTO(model)); // NOPMD by jon + } + + return tObjects; + } +} \ No newline at end of file diff --git a/src/main/java/org/jasig/ssp/web/api/reference/EarlyAlertInterventionController.java b/src/main/java/org/jasig/ssp/web/api/reference/EarlyAlertInterventionController.java new file mode 100644 index 0000000000..816651fa96 --- /dev/null +++ b/src/main/java/org/jasig/ssp/web/api/reference/EarlyAlertInterventionController.java @@ -0,0 +1,88 @@ +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/16/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertInterventionController.java + */ +package org.jasig.ssp.web.api.reference; + +import org.jasig.ssp.factory.TOFactory; +import org.jasig.ssp.factory.reference.EarlyAlertInterventionTOFactory; +import org.jasig.ssp.model.reference.EarlyAlertIntervention; +import org.jasig.ssp.service.AuditableCrudService; +import org.jasig.ssp.service.reference.EarlyAlertInterventionService; +import org.jasig.ssp.transferobject.reference.EarlyAlertInterventionTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Some basic methods for manipulating EarlyAlertIntervention reference data. + *

+ * Mapped to URI path /1/reference/earlyAlertIntervention + * + * Based on EarlyAlertSuggestion by @author jon.adams + */ +@Controller +@RequestMapping("/1/reference/earlyAlertIntervention") +public class EarlyAlertInterventionController + extends + AbstractAuditableReferenceController { + + /** + * Auto-wired service-layer instance. + */ + @Autowired + protected transient EarlyAlertInterventionService service; + + /** + * Auto-wired transfer object factory. + */ + @Autowired + protected transient EarlyAlertInterventionTOFactory factory; + + private static final Logger LOGGER = LoggerFactory + .getLogger(EarlyAlertInterventionController.class); + + /** + * Constructor that initializes specific class instances for use by the + * common base class methods. + */ + protected EarlyAlertInterventionController() { + super(EarlyAlertIntervention.class, EarlyAlertInterventionTO.class); + } + + @Override + protected Logger getLogger() { + return LOGGER; + } + + @Override + protected AuditableCrudService getService() { + return service; + } + + @Override + protected TOFactory getFactory() { + return factory; + } +} diff --git a/src/main/resources/i18n/messages.properties b/src/main/resources/i18n/messages.properties index 62dbafc3e6..bdcc419f54 100644 --- a/src/main/resources/i18n/messages.properties +++ b/src/main/resources/i18n/messages.properties @@ -1,68 +1,68 @@ -# -# Licensed to Jasig under one or more contributor license -# agreements. See the NOTICE file distributed with this work -# for additional information regarding copyright ownership. -# Jasig licenses this file to you under the Apache License, -# Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a -# copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - - -add.edit=Add/Edit -alert.sent.prefix=Your Early Alert regarding student -alert.sent.suffix=has been sent. -assigned.counselor.coach=Assigned Counselor/Coach -campus=Campus -cancel=Cancel -click.a.student.from.the.roster.to.send.an.early.alert=Click a student from the Course Roster to send an Early Alert. -comments=Comments -course=Course -course.roster=Course Roster -department=Department -early.alert.details=Early Alert Details -early.alert.sent=Early Alert Sent -email.cc=Email cc -enrollment.status=Enrollment Status -error.generic.title=Oops, something went wrong... -error.goback=View your Early Alert-enabled rosters -faculty.suggestions=Faculty Suggestions -first.name=First Name -last.name=Last Name -loading=Loading... -middle.name=Middle Name -net.id=Net ID -student.school.id=Student ID -next=next -no.information.is.available.for.the.current.user.in.ssp=No information is available for the current user in SSP. -office=Office -per.page=per page -phone=Phone -please.wait.while.the.system.finishes.loading.roster=Please wait while the system finishes loading the Course Roster -previous=previous -referral.reasons=Referral Reasons -roster=Roster -select.a.campus=Select a campus... -select.a.reason=Select a reason... -send.early.alert=Send Early Alert -send.email.notice.to.student=Would you like to send an email notice of this Alert message to the Student? The email sent to the student will include information about additional resources and assistance. -show=show -status=Status -student=Student -student.email=Student Email -student.type=Student Type -term=Term -type.a.reason=Type a reason for the referral... -type.a.suggestion=Type a suggestion... -reports.title=Reports and Forms -reports.select.label=Select a report -unregognized.person=Unrecognized Person +# +# Licensed to Jasig under one or more contributor license +# agreements. See the NOTICE file distributed with this work +# for additional information regarding copyright ownership. +# Jasig licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a +# copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on +# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# IRSC LOCALIZATIONS +# 06/17/2014 Jonathan Hart TAPS 20140039 Added Faculty Interventions to EA Form + +add.edit=Add/Edit +alert.sent.prefix=Your EarlyAlert regarding student +alert.sent.suffix=has been sent. +assigned.counselor.coach=Assigned Counselor/Coach +campus=Campus +cancel=Cancel +click.a.student.from.the.roster.to.send.an.early.alert=Click a student from the Course Roster to send a EarlyAlert. +comments=Comments +course=Course +course.roster=Course Roster +department=Department +early.alert.details=EarlyAlert Details +early.alert.sent=EarlyAlert Sent +email.cc=Email cc +enrollment.status=Enrollment Status +faculty.suggestions=Faculty Suggestions +faculty.interventions=Faculty Interventions +first.name=First Name +last.name=Last Name +loading=Loading... +middle.name=Middle Name +net.id=Net ID +student.school.id=Student ID +next=next +no.information.is.available.for.the.current.user.in.ssp=No information is available for the current user in SSP. +office=Office +per.page=per page +phone=Phone +please.wait.while.the.system.finishes.loading.roster=Please wait while the system finishes loading the Course Roster +previous=previous +referral.reasons=Referral Reasons +roster=Roster +select.a.campus=Select a campus... +select.a.reason=Select a reason... +send.early.alert=Send EarlyAlert +send.email.notice.to.student=Would you like to send an email notice of this EarlyAlert message to the Student? The email sent to the student will include information about additional resources and assistance to help the student correct the EarlyAlert situation. +show=show +status=Status +student=Student +student.email=Student Email +student.type=Student Type +term=Term +type.a.reason=Type a reason for the referral... +type.a.suggestion=Type a suggestion... +reports.title=Reports and Forms +reports.select.label=Select a report +unregognized.person=Unrecognized Person \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/ea-form.jsp b/src/main/webapp/WEB-INF/jsp/ea-form.jsp index b38ccfa2c7..81c49dbcb1 100644 --- a/src/main/webapp/WEB-INF/jsp/ea-form.jsp +++ b/src/main/webapp/WEB-INF/jsp/ea-form.jsp @@ -1,319 +1,348 @@ -<%-- - - Licensed to Jasig under one or more contributor license - agreements. See the NOTICE file distributed with this work - for additional information regarding copyright ownership. - Jasig licenses this file to you under the Apache License, - Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a - copy of the License at: - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on - an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---%> - - - - - - - - - - - - - - - - - - - - - -" rel="stylesheet" type="text/css"> - - -

- - -
-
- - -
-

-
- - -
- - -
-
-

. . .

-
-
-

-
-
- - - -
- - - - -
- - +<%-- + + Licensed to Jasig under one or more contributor license + agreements. See the NOTICE file distributed with this work + for additional information regarding copyright ownership. + Jasig licenses this file to you under the Apache License, + Version 2.0 (the "License"); you may not use this file + except in compliance with the License. You may obtain a + copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on + an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--%> +<%-- + 01/29/2014 Jonathan Hart TAPS 20140023 Added "*" to Comments field for display + 06/17/2014 Jonathan Hart TAPS 20140039 Added Faculty Interventions to EA Form +--%> + + + + + + + + + + + + + + + + + + + + + +" rel="stylesheet" type="text/css"> + + +
+ + +
+
+ + +
+

- "Information Regarding Student At-Risk of Course Failure"

+
+ + +
+ + +
+
+

. . .

+
+
+

+
+
+ + + +
+ + + + +
+ + \ No newline at end of file diff --git a/src/main/webapp/app.js b/src/main/webapp/app.js index b4b722d795..9ef4d869d2 100644 --- a/src/main/webapp/app.js +++ b/src/main/webapp/app.js @@ -1,2149 +1,2030 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.Loader.setConfig({ - enabled: true, - paths: { - 'Ssp': '/ssp/app', - 'ContextName': 'ssp' - } -}); - -Ext.require([ - 'Ssp.view.field.ObjectStatusCheckbox', - 'Ssp.view.admin.forms.ColorPicker', - 'Ssp.view.admin.AdminMain', - 'Ssp.view.admin.AdminTreeMenu', - 'Ssp.view.admin.AdminForms', - 'Ssp.view.Main', - 'Ssp.view.Search', - 'Ssp.view.SearchForm', - 'Ssp.view.SearchTab', - 'Ssp.view.StudentRecord', - 'Ssp.view.EmailStudentForm', - 'Ssp.view.EmailStudentView', - 'Ssp.view.ProgramStatusChangeReasonWindow', - 'Ssp.view.person.Student', - 'Ssp.view.person.InstantStudent', - 'Ssp.view.person.CaseloadAssignment', - 'Ssp.view.person.InstantCaseloadAssignment', - 'Ssp.view.person.EditPerson', - 'Ssp.view.person.Coach', - 'Ssp.view.person.Appointment', - 'Ssp.view.person.StudentIntakeRequest', - 'Ssp.view.person.SpecialServiceGroups', - 'Ssp.view.person.ReferralSources', - 'Ssp.view.person.ServiceReasons', - 'Ssp.view.person.AnticipatedStartDate', - 'Ssp.view.component.MappedTextField', - 'Ssp.view.component.MappedTextArea', - 'Ssp.view.component.MappedCheckBox', - 'Ssp.view.component.MappedRadioButton', - 'Ssp.view.ToolsMenu', - 'Ssp.view.Tools', - 'Ssp.view.tools.profile.Profile', - 'Ssp.view.tools.profile.Person', - 'Ssp.view.tools.profile.SpecialServiceGroups', - 'Ssp.view.tools.profile.ReferralSources', - 'Ssp.view.tools.profile.ServicesProvided', - 'Ssp.view.tools.profile.ServiceReasons', - 'Ssp.view.tools.profile.Coach', - 'Ssp.view.tools.profile.Contact', - 'Ssp.view.tools.profile.Placement', - 'Ssp.view.tools.profile.Transcript', - 'Ssp.view.tools.profile.RecentSSPActivity', - 'Ssp.view.tools.profile.Schedule', - 'Ssp.view.tools.profile.CurrentSchedule', - 'Ssp.view.tools.profile.DroppedCourses', - 'Ssp.view.tools.profile.Details', - 'Ssp.view.tools.profile.SapStatus', - 'Ssp.view.tools.profile.Dashboard', - 'Ssp.view.tools.profile.AcademicProgram', - 'Ssp.view.tools.profile.RecentTermActivity', - 'Ssp.view.tools.profile.FinancialAidFiles', - 'Ssp.view.tools.profile.FinancialAidFileViewer', - 'Ssp.view.tools.profile.FinancialAidAwards', - 'Ssp.view.tools.profile.FinancialAidAwardViewer', - 'Ssp.view.tools.actionplan.ActionPlan', - 'Ssp.view.tools.actionplan.Tasks', - 'Ssp.view.tools.actionplan.AddTask', - 'Ssp.view.tools.actionplan.AddTaskForm', - 'Ssp.view.tools.actionplan.EditGoalForm', - 'Ssp.view.tools.actionplan.EmailActionPlan', - 'Ssp.view.tools.actionplan.EmailAndPrintActionPlan', - 'Ssp.view.tools.actionplan.DisplayActionPlan', - 'Ssp.view.tools.actionplan.DisplayActionPlanGoals', - 'Ssp.view.tools.actionplan.DisplayStrengths', - 'Ssp.view.tools.actionplan.TaskTree', - 'Ssp.view.tools.actionplan.AddAPTask', - 'Ssp.view.tools.actionplan.ChallengesGrid', - 'Ssp.view.tools.actionplan.CustomActionPlan', - 'Ssp.view.tools.actionplan.EditTaskForm', - 'Ssp.view.tools.actionplan.SearchChallengeView', - 'Ssp.view.tools.actionplan.TasksGrid', - 'Ssp.view.tools.actionplan.AddTaskView', - 'Ssp.view.tools.studentintake.StudentIntake', - 'Ssp.view.tools.studentintake.Checklist', - 'Ssp.view.tools.studentintake.Challenges', - 'Ssp.view.tools.studentintake.Demographics', - 'Ssp.view.tools.studentintake.EducationGoals', - 'Ssp.view.tools.studentintake.EducationLevels', - 'Ssp.view.tools.studentintake.EducationPlans', - 'Ssp.view.tools.studentintake.Funding', - 'Ssp.view.tools.studentintake.Personal', - 'Ssp.view.tools.journal.Journal', - 'Ssp.view.tools.journal.EditJournal', - 'Ssp.view.tools.journal.DisplayDetails', - 'Ssp.view.tools.journal.TrackTree', - 'Ssp.view.tools.journal.JournalList', - 'Ssp.view.tools.earlyalert.EarlyAlert', - 'Ssp.view.tools.earlyalert.EarlyAlertResponse', - 'Ssp.view.tools.earlyalert.EarlyAlertReferrals', - 'Ssp.view.tools.earlyalert.EarlyAlertDetails', - 'Ssp.view.tools.earlyalert.EarlyAlertResponseDetails', - 'Ssp.view.tools.document.StudentDocuments', - 'Ssp.view.tools.document.EditDocument', - 'Ssp.view.tools.sis.StudentInformationSystem', - 'Ssp.view.tools.sis.Registration', - 'Ssp.view.tools.sis.Assessment', - - //'Ssp.view.tools.sis.Transcript', - 'Ssp.view.tools.accommodation.Accommodation', - 'Ssp.view.tools.accommodation.General', - 'Ssp.view.tools.accommodation.AgencyContacts', - 'Ssp.view.tools.accommodation.DisabilityTypes', - 'Ssp.view.tools.accommodation.Disposition', - 'Ssp.view.tools.accommodation.Accommodations', - - 'Ssp.view.tools.displacedworker.DisplacedWorker', - 'Ssp.view.tools.studentsuccess.StudentSuccess', - 'Ssp.view.admin.AdminForms', - 'Ssp.view.admin.forms.AbstractReferenceAdmin', - 'Ssp.view.admin.forms.ConfidentialityDisclosureAgreementAdmin', - - //MAP Views - 'Ssp.view.tools.map.MAP', - 'Ssp.view.tools.map.CoursesView', - 'Ssp.view.tools.map.SemesterPanel', - 'Ssp.view.tools.map.PersistentFieldSet', - 'Ssp.view.tools.map.SemesterPanelContainer', - 'Ssp.view.tools.map.StudentTranscriptViewer', - 'Ssp.view.tools.map.MapStatusReport', - 'Ssp.view.tools.map.FAView', - 'Ssp.view.tools.map.MAPView', - 'Ssp.view.tools.map.MovePlan', - 'Ssp.view.tools.map.MovePlanDialog', - 'Ssp.view.tools.map.PlanTool', - 'Ssp.view.tools.map.LoadPlans', - 'Ssp.view.tools.map.PlanNotes', - 'Ssp.view.tools.map.LoadTemplates', - 'Ssp.view.tools.map.SaveTemplate', - 'Ssp.view.tools.map.StudentTranscriptViewer', - 'Ssp.view.tools.map.SavePlan', - 'Ssp.view.tools.map.CourseNotes', - 'Ssp.view.tools.map.TermNotes', - 'Ssp.view.tools.map.EmailPlan', - 'Ssp.view.tools.map.PrintPlan', - 'Ssp.view.tools.map.CourseDetails', - 'Ssp.view.tools.map.CoursesGridPanel', - - //PERSON NOTES TOOL - 'Ssp.view.tools.notes.Notes', - - 'Ssp.view.tools.documents.Documents', - 'Ssp.view.tools.documents.UploadDocuments', - - // COUNSELING REFERENCE GUIDE ADMIN VIEWS - 'Ssp.view.admin.forms.crg.ChallengeAdmin', - 'Ssp.view.admin.forms.crg.ChallengeReferralAdmin', - 'Ssp.view.admin.forms.crg.AssociateChallengeCategoriesAdmin', - 'Ssp.view.admin.forms.crg.AssociateChallengeReferralsAdmin', - 'Ssp.view.admin.forms.crg.DisplayChallengesAdmin', - 'Ssp.view.admin.forms.crg.DisplayReferralsAdmin', - 'Ssp.view.admin.forms.crg.EditChallenge', - 'Ssp.view.admin.forms.crg.EditReferral', - - - //CASELOAD REASSIGNMENT ADMIN - 'Ssp.view.admin.forms.caseload.CaseloadReassignment', - 'Ssp.view.admin.forms.caseload.CaseloadReassignmentSource', - 'Ssp.view.admin.forms.caseload.CaseloadReassignmentTarget', - - //CASELOAD REASSIGNMENT TOOL - 'Ssp.view.tools.caseload.CaseloadReassignment', - 'Ssp.view.tools.caseload.CaseloadReassignmentSource', - 'Ssp.view.tools.caseload.CaseloadReassignmentTarget', - - //MyGPS ADMIN TOOLS - 'Ssp.view.admin.forms.shg.SelfHelpGuideAdmin', - 'Ssp.view.admin.forms.shg.SelfHelpGuidesDisplayAdmin', - 'Ssp.view.admin.forms.shg.EditSelfHelpGuide', - 'Ssp.view.admin.forms.shg.EditSelfHelpGuideChallenges', - 'Ssp.view.admin.forms.shg.EditSelfHelpGuideDetails', - 'Ssp.view.admin.forms.shg.EditSelfHelpGuideAvailableChallengesAdmin', - 'Ssp.view.admin.forms.shg.EditSelfHelpGuideEditChallenges', - - - // JOURNAL ADMIN VIEWS - 'Ssp.view.admin.forms.journal.JournalStepAdmin', - 'Ssp.view.admin.forms.journal.JournalStepDetailAdmin', - 'Ssp.view.admin.forms.journal.AssociateTrackStepsAdmin', - 'Ssp.view.admin.forms.journal.AssociateStepDetailsAdmin', - 'Ssp.view.admin.forms.journal.DisplayDetailsAdmin', - 'Ssp.view.admin.forms.journal.DisplayStepsAdmin', - 'Ssp.view.admin.forms.journal.EditStep', - 'Ssp.view.admin.forms.journal.EditStepDetail', - - // CAMPUS ADMIN VIEWS - 'Ssp.view.admin.forms.campus.CampusAdmin', - 'Ssp.view.admin.forms.campus.DefineCampus', - 'Ssp.view.admin.forms.campus.EditCampus', - 'Ssp.view.admin.forms.campus.CampusEarlyAlertRoutingsAdmin', - 'Ssp.view.admin.forms.campus.EarlyAlertRoutingsAdmin', - 'Ssp.view.admin.forms.campus.EditCampusEarlyAlertRouting', - - //CONFIG ADMIN VIEWS - 'Ssp.view.admin.forms.config.ConfigurationOptionsAdmin', - 'Ssp.view.admin.forms.config.ConfigurationOptionsDisplayAdmin', - 'Ssp.view.admin.forms.config.MessageTemplatesAdmin', - 'Ssp.view.admin.forms.config.MessageTemplatesDisplayAdmin', - 'Ssp.view.admin.forms.config.MessageTemplateDetails', - - //OAUTH2 ADMIN VIEWS - 'Ssp.view.admin.forms.apikey.oauth2.OAuth2ClientAdmin', - 'Ssp.view.admin.forms.apikey.oauth2.EditOAuth2Client', - - // ERROR DISPLAYS - 'Ssp.view.ErrorWindow', - - // REPORT DISPLAY - 'Ssp.view.Report', - - 'Ssp.model.SimpleItemDisplay', - 'Ssp.model.ObjectPermission', - 'Ssp.model.AuthenticatedPerson', - 'Ssp.model.Preferences', - 'Ssp.model.FieldError', - 'Ssp.model.util.TreeRequest', - 'Ssp.model.Configuration', - 'Ssp.model.Person', - 'Ssp.model.PersonAppointment', - 'Ssp.model.Appointment', - 'Ssp.model.CaseloadPerson', - 'Ssp.model.EmailStudentRequest', - 'Ssp.model.SearchPerson', - 'Ssp.model.SearchCriteria', - 'Ssp.model.CaseloadFilterCriteria', - 'Ssp.model.PersonGoal', - 'Ssp.model.PersonStrength', - 'Ssp.model.SearchChallengeReferral', - 'Ssp.model.PersonLite', - 'Ssp.model.ContactPerson', - 'Ssp.model.Placement', - 'Ssp.model.PersonProgramStatus', - 'Ssp.model.CourseTranscript', - 'Ssp.model.TermTranscript', - 'Ssp.model.StudentActivity', - 'Ssp.model.Transcript', - 'Ssp.model.FilterDiscreteValues', - 'Ssp.model.MessageTemplates', - 'Ssp.model.OAuth2Client', - 'Ssp.model.Permission', - 'Ssp.model.PersonRegistrationStatusByTerm', - 'Ssp.model.tool.studentintake.StudentIntakeForm', - 'Ssp.model.tool.studentintake.PersonDemographics', - 'Ssp.model.tool.studentintake.PersonEducationGoal', - 'Ssp.model.tool.studentintake.PersonEducationPlan', - 'Ssp.model.tool.accommodation.AccommodationForm', - 'Ssp.model.tool.accommodation.PersonDisability', - 'Ssp.model.tool.accommodation.PersonDisabilityAgency', - 'Ssp.model.tool.accommodation.PersonDisabilityType', - 'Ssp.model.tool.accommodation.PersonDisabilityAccommodation', - 'Ssp.model.tool.actionplan.Task', - 'Ssp.model.tool.earlyalert.PersonEarlyAlert', - 'Ssp.model.tool.earlyalert.PersonEarlyAlertTree', - 'Ssp.model.tool.earlyalert.EarlyAlertResponse', - 'Ssp.model.tool.earlyalert.EarlyAlertResponseGrid', - 'Ssp.model.tool.journal.JournalEntry', - 'Ssp.model.tool.journal.JournalEntryDetail', - 'Ssp.model.tool.documents.StudentDocument', - 'Ssp.model.tool.map.SemesterCourse', - 'Ssp.model.tool.map.Plan', - 'Ssp.model.tool.map.MapStatus', - 'Ssp.model.tool.map.MapStatusCourseDetail', - 'Ssp.model.tool.map.MapStatusSubstitutionDetail', - 'Ssp.model.tool.map.MapStatusTermDetail', - 'Ssp.model.tool.map.TermNote', - 'Ssp.model.tool.map.PlanCourse', - 'Ssp.model.tool.map.PlanOutputData', - 'Ssp.model.tool.shg.SelfHelpGuides', - 'Ssp.model.tool.shg.SelfHelpGuideQuestions', - 'Ssp.model.tool.caseload.CaseloadReassignmentRequest', - 'Ssp.model.reference.AbstractReference', - 'Ssp.model.reference.AdminSelectedIndex', - 'Ssp.model.reference.Challenge', - 'Ssp.model.reference.ChallengeCategory', - 'Ssp.model.reference.ChallengeReferral', - 'Ssp.model.reference.EnrollmentStatus', - 'Ssp.model.reference.CompletedItem', - 'Ssp.model.reference.Text', - 'Ssp.model.reference.JournalTrack', - 'Ssp.model.reference.JournalStep', - 'Ssp.model.reference.JournalStepDetail', - 'Ssp.model.reference.ConfidentialityLevel', - 'Ssp.model.reference.ConfidentialityLevelOption', - 'Ssp.model.reference.ConfidentialityDisclosureAgreement', - 'Ssp.model.reference.EarlyAlertReferral', - 'Ssp.model.external.Course', - 'Ssp.model.external.CourseRequisite', - 'Ssp.model.external.PersonNote', - 'Ssp.model.external.FinancialAidFileStatus', - 'Ssp.model.external.FinancialAidAward', - 'Ssp.model.ApiUrl', - 'Ssp.mixin.ApiProperties', - 'Ssp.mixin.controller.ItemSelectorInitializer', - 'Ssp.util.tools.map.MapEventUtils', - 'Ssp.util.ResponseDispatcher', - 'Ssp.util.FormRendererUtils', - 'Ssp.util.ColumnRendererUtils', - 'Ssp.util.TreeRendererUtils', - 'Ssp.util.StoreUtils', - 'Ssp.util.Constants', - 'Ssp.util.Util', - 'Ssp.store.Coaches', - 'Ssp.store.Caseload', - 'Ssp.store.Tasks', - 'Ssp.store.StudentActivities', - 'Ssp.store.Goals', - 'Ssp.store.Strengths', - 'Ssp.store.AddTasks', - 'Ssp.store.JournalEntries', - 'Ssp.store.JournalEntriesUnpaged', - 'Ssp.store.JournalEntryDetails', - 'Ssp.store.EarlyAlerts', - 'Ssp.store.StudentDocuments', - 'Ssp.store.reference.AbstractReferences', - 'Ssp.store.admin.AdminTreeMenus', - 'Ssp.store.reference.AnticipatedStartTerms', - 'Ssp.store.reference.Campuses', - 'Ssp.store.reference.CampusEarlyAlertRoutings', - 'Ssp.store.reference.CampusServices', - 'Ssp.store.reference.Challenges', - 'Ssp.store.reference.ChallengeCategories', - 'Ssp.store.reference.ChallengeReferrals', - 'Ssp.store.reference.ChildCareArrangements', - 'Ssp.store.reference.Citizenships', - 'Ssp.store.reference.Colors', - 'Ssp.store.reference.ConfidentialityLevels', - 'Ssp.store.reference.ConfidentialityLevelOptions', - 'Ssp.store.reference.ConfigurationOptions', - 'Ssp.store.reference.DisabilityAccommodations', - 'Ssp.store.reference.DisabilityAgencies', - 'Ssp.store.reference.DisabilityStatuses', - 'Ssp.store.reference.DisabilityTypes', - 'Ssp.store.reference.EarlyAlertOutcomes', - 'Ssp.store.reference.EarlyAlertOutreaches', - 'Ssp.store.reference.EarlyAlertReasons', - 'Ssp.store.reference.EarlyAlertReferrals', - 'Ssp.store.reference.EarlyAlertSuggestions', - 'Ssp.store.reference.Electives', - 'Ssp.store.reference.EmploymentShifts', - 'Ssp.store.reference.Ethnicities', - 'Ssp.store.reference.Races', - 'Ssp.store.reference.SapStatuses', - 'Ssp.store.reference.FinancialAidFiles', - 'Ssp.store.reference.FundingSources', - 'Ssp.store.reference.Genders', - 'Ssp.store.reference.JournalSources', - 'Ssp.store.reference.JournalStepDetails', - 'Ssp.store.reference.JournalSteps', - 'Ssp.store.reference.JournalTracks', - 'Ssp.store.reference.Lassis', - 'Ssp.store.reference.MaritalStatuses', - 'Ssp.store.reference.MilitaryAffiliations', - 'Ssp.store.reference.CourseworkHours', - 'Ssp.store.reference.EnrollmentStatuses', - 'Ssp.store.reference.CompletedItem', - 'Ssp.store.reference.Texts', - 'Ssp.store.reference.RegistrationLoads', - 'Ssp.store.reference.CourseworkHours', - 'Ssp.store.reference.MessageTemplates', - 'Ssp.store.OAuth2Clients', - 'Ssp.store.Permissions', - 'Ssp.store.People', - 'Ssp.store.Placement', - 'Ssp.store.reference.RegistrationLoadRanges', - 'Ssp.store.reference.WeeklyCourseWorkHourRanges', - 'Ssp.store.reference.PersonalityTypes', - 'Ssp.store.reference.ProgramStatuses', - 'Ssp.store.reference.ProgramStatusChangeReasons', - 'Ssp.store.reference.ReferralSources', - 'Ssp.store.reference.ServiceReasons', - 'Ssp.store.reference.SelfHelpGuides', - 'Ssp.store.reference.SelfHelpGuideQuestions', - 'Ssp.store.reference.SpecialServiceGroups', - 'Ssp.store.reference.States', - 'Ssp.store.external.Terms', - 'Ssp.store.external.TermsFaceted', - 'Ssp.store.external.Programs', - 'Ssp.store.external.ProgramsFaceted', - 'Ssp.store.external.Departments', - 'Ssp.store.external.Divisions', - 'Ssp.store.external.CatalogYears', - 'Ssp.store.external.Courses', - 'Ssp.store.external.CourseRequisites', - 'Ssp.store.RegistrationStatusByTerm', - 'Ssp.store.external.PersonNotes', - 'Ssp.store.Students', - 'Ssp.store.SemesterCourses', - 'Ssp.store.Search', - 'Ssp.store.reference.StudentStatuses', - 'Ssp.store.reference.StudentTypes', - 'Ssp.store.reference.Tags', - 'Ssp.store.reference.FacetedTags', - 'Ssp.store.Tools', - 'Ssp.store.reference.VeteranStatuses', - 'Ssp.store.PlanStatus', - 'Ssp.store.MAPStatus', - 'Ssp.store.PersonTableTypes', - 'Ssp.store.MapStatusReports', - 'Ssp.store.MapStatusReportCourseDetails', - 'Ssp.store.MapStatusReportSubstitutionDetails', - 'Ssp.store.MapStatusReportTermDetails', - 'Ssp.store.CurrentlyRegistered', - 'Ssp.store.FinancialAidSAPStatus', - 'Ssp.service.AbstractService', - 'Ssp.service.AppointmentService', - 'Ssp.service.AssessmentService', - 'Ssp.service.CaseloadService', - 'Ssp.service.CampusService', - 'Ssp.service.CampusEarlyAlertRoutingService', - 'Ssp.service.ConfidentialityDisclosureAgreementService', - 'Ssp.service.AccommodationService', - 'Ssp.service.EarlyAlertService', - 'Ssp.service.EarlyAlertResponseService', - 'Ssp.service.EarlyAlertReferralService', - 'Ssp.service.JournalEntryService', - 'Ssp.service.PersonService', - 'Ssp.service.PlacementService', - 'Ssp.service.PersonNoteService', - 'Ssp.service.ProgramStatusService', - 'Ssp.service.ReferralSourceService', - 'Ssp.service.SearchService', - 'Ssp.service.SearchChallengeReferralService', - 'Ssp.service.SpecialServiceGroupService', - 'Ssp.service.ServiceReasonsService', - 'Ssp.service.StudentIntakeService', - 'Ssp.service.TranscriptService', - 'Ssp.service.MapPlanService', - 'Ssp.service.CourseService', - 'Ssp.controller.ApplicationEventsController', - 'Ext.tab.*', - 'Ext.util.Filter', - 'Ext.data.TreeStore', - 'Ext.dd.*', - 'Ext.data.Store', - 'Ext.form.field.VTypes', - 'Ext.form.field.Text', - 'Ext.form.field.TextArea', - 'Ext.form.FieldSet', - 'Ext.ux.CheckColumn', - 'Ext.ux.form.MultiSelect', - 'Ext.ux.form.ItemSelector', - 'Ext.util.MixedCollection', - 'Ext.util.TaskRunner', - 'Ext.tree.*', - 'Ext.toolbar.Spacer', - 'Ext.form.field.ComboBox', - 'Ext.grid.column.Action', - 'Ext.grid.feature.Grouping' - -]); - -var apiUrls = [ - {name: 'campus', url: 'reference/campus'}, - {name: 'campusEarlyAlertRouting', url: 'reference/campus/{id}/earlyAlertRouting'}, - {name: 'campusService', url: 'reference/campusService'}, - {name: 'category', url: 'reference/category'}, - {name: 'challenge', url: 'reference/challenge'}, - {name: 'challengeReferral', url: 'reference/challengeReferral'}, - {name: 'challengeReferralSearch', url: 'reference/challengeReferral/search'}, - {name: 'childCareArrangement', url: 'reference/childCareArrangement'}, - {name: 'citizenship', url: 'reference/citizenship'}, - {name: 'color', url: 'reference/color'}, - {name: 'confidentialityDisclosureAgreement', url: 'reference/confidentialityDisclosureAgreement'}, - {name: 'printConfidentialityDisclosureAgreement', url: '/forms/ConfidentialityAgreement.jsp'}, - {name: 'confidentialityLevel', url: 'reference/confidentialityLevel'}, - {name: 'config', url: 'reference/config'}, - {name: 'configuration', url: 'reference/configuration'}, - {name: 'disabilityAccommodation', url: 'reference/disabilityAccommodation'}, - {name: 'accommodationTool', url: 'tool/accommodation'}, - {name: 'disabilityAgency', url: 'reference/disabilityAgency'}, - {name: 'disabilityStatus', url: 'reference/disabilityStatus'}, - {name: 'disabilityType', url: 'reference/disabilityType'}, - {name: 'earlyAlertOutcome', url: 'reference/earlyAlertOutcome'}, - {name: 'earlyAlertOutreach', url: 'reference/earlyAlertOutreach'}, - {name: 'earlyAlertReason', url: 'reference/earlyAlertReason'}, - {name: 'earlyAlertReferral', url: 'reference/earlyAlertReferral'}, - {name: 'earlyAlertSuggestion', url: 'reference/earlyAlertSuggestion'}, - {name: 'educationGoal', url: 'reference/educationGoal'}, - {name: 'educationLevel', url: 'reference/educationLevel'}, - {name: 'elective', url: 'reference/elective'}, - {name: 'ethnicity', url: 'reference/ethnicity'}, - {name: 'race', url: 'reference/race'}, - {name: 'sapstatus', url: 'reference/sapstatus'}, - {name: 'financialAidFile', url: 'reference/financialAidFile'}, - {name: 'fundingSource', url: 'reference/fundingSource'}, - {name: 'journalSource', url: 'reference/journalSource'}, - {name: 'journalStep', url: 'reference/journalStep'}, - {name: 'journalTrack', url: 'reference/journalTrack'}, - {name: 'journalStepDetail', url: 'reference/journalStepDetail'}, - {name: 'lassi', url: 'reference/lassi'}, - {name: 'maritalStatus', url: 'reference/maritalStatus'}, - {name: 'militaryAffiliation', url: 'reference/militaryAffiliation'}, - {name: 'enrollmentStatus', url: 'reference/enrollmentStatus'}, - {name: 'completedItem', url: 'reference/completedItem'}, - {name: 'blurb', url: 'blurb'}, - {name: 'registrationLoad', url: 'reference/registrationLoad'}, - {name: 'courseworkHours', url: 'reference/courseworkHours'}, - {name: 'messageTemplate', url: 'reference/messageTemplate'}, - {name: 'studentStatus', url: 'reference/studentStatus'}, - {name: 'veteranStatus', url: 'reference/veteranStatus'}, - {name: 'oauth2Client', url: 'oauth2/client'}, - {name: 'permission', url: 'reference/permission'}, - {name: 'person', url: 'person'}, - {name: 'personAppointment', url: 'person/{id}/appointment'}, - {name: 'personAssessment', url: 'person/{id}/test'}, - {name: 'personCaseload', url: 'person/caseload'}, - {name: 'personCaseloadId', url: 'person/{id}/caseload'}, - {name: 'personMasterCaseload', url: 'person/{id}/caseload'}, - {name: 'personChallenge', url: 'person/{id}/challenge'}, - {name: 'personCoach', url: 'person/coach'}, - {name: 'personCoachCurrent', url: 'person/currentCoachesLite'}, - {name: 'personDocument', url: 'person/{id}/document'}, - {name: 'personRegistrationStatusByTerm', url: 'person/{personId}/registrationStatusByTerm'}, - {name: 'personEarlyAlert', url: 'person/{personId}/earlyAlert'}, - {name: 'personEarlyAlertResponse', url: 'person/{personId}/earlyAlert/{earlyAlertId}/response'}, - {name: 'personGoal', url: 'person/{id}/goal'}, - {name: 'personStrength', url: 'person/{id}/strength'}, - {name: 'personJournalEntry', url: 'person/{id}/journalEntry'}, - {name: 'personTask', url: 'person/{id}/task'}, - {name: 'personTaskGroup', url: 'person/{id}/task/group'}, - {name: 'studentActivities', url: 'person/{id}/studentactivity'}, - {name: 'personalityType', url: 'reference/personalityType'}, - {name: 'personTranscript', url: 'person/{id}/transcript'}, - {name: 'personNote', url: 'person/{id}/note'}, - {name: 'personEmailTask', url: 'person/{id}/task/email'}, - {name: 'personViewHistory', url: 'person/{id}/history/print'}, - {name: 'personPrintTask', url: 'person/{id}/task/print'}, - {name: 'studentSearch', url: 'person/students/search'}, - {name: 'directoryPersonSearch', url: 'person/directoryperson/search'}, - {name: 'personSearch', url: 'person/search'}, - {name: 'personMapPlan', url: 'person/{id}/map/plan'}, - {name: 'templatePlan', url: 'reference/map/template'}, - {name: 'placement', url: 'person/{id}/test'}, - {name: 'studentDocument', url: 'person/{id}/studentdocument'}, - {name: 'mapStatusReport', url: 'person/{id}/map/statusReport'}, - {name: 'registrationLoadRanges', url: 'reference/config/?name=registration_load_ranges'}, - {name: 'selfHelpGuides', url: 'selfHelpGuides/search'}, - {name: 'selfHelpGuideQuestions', url: 'selfHelpGuides/selfHelpGuideQuestions'}, - {name: 'personProgramStatus', url: 'person/{id}/programStatus'}, - {name: 'programStatus', url: 'reference/programStatus'}, - {name: 'programStatusChangeReason', url: 'reference/programStatusChangeReason'}, - {name: 'referralSource', url: 'reference/referralSource'}, - {name: 'serviceReason', url: 'reference/serviceReason'}, - {name: 'session', url: 'session'}, - {name: 'server', url: 'server'}, - {name: 'serverDateTime', url: 'server/datetime'}, - {name: 'specialServiceGroup', url: 'reference/specialServiceGroup'}, - {name: 'studentIntakeTool', url: 'tool/studentIntake'}, - {name: 'studentType', url: 'reference/studentType'}, - {name: 'terms', url: 'reference/term'}, - {name: 'course', url: 'reference/course'}, - {name: 'courseRequisites', url: 'reference/courserequisites/{id}'}, - {name: 'program', url: 'reference/program/all'}, - {name: 'programfaceted', url: 'reference/program/facet'}, - {name: 'department', url: 'reference/department/all'},//TODO Change to facets. - {name: 'division', url: 'reference/division/all'}, - {name: 'catalogYear', url: 'reference/catalogYear/all'}, - {name: 'tag', url: 'reference/tag'}, - {name: 'facetedtag', url: 'reference/tag/facet'}, - {name: 'futureTerms', url: 'reference/term/future'}, - {name: 'termsfaceted', url: 'reference/term/facet'}, - {name: 'weeklyCourseWorkHourRanges', url: 'reference/config/?name=weekly_course_work_hour_ranges'} -]; - -Ext.onReady(function(){ - - // load the authenticated user - Ext.Ajax.request({ - url: Ssp.mixin.ApiProperties.getBaseApiUrl() + 'session/getAuthenticatedPerson', - method: 'GET', - headers: { 'Accept' : 'application/json','Content-Type': 'application/json' }, - success: function(response){ - var r = Ext.decode(response.responseText); - var user={}; - - if (r != null) - { - // authenticated user - user=r; - - // configure the application - Deft.Injector.configure({ - adminSelectedIndex: { - fn: function(){ - return new Ssp.model.reference.AdminSelectedIndex({}); - }, - singleton: true - }, - sspParentDivId: { - value: sspParentDivId - }, - renderSSPFullScreen: { - value: renderSSPFullScreen - }, - apiUrlStore: { - fn: function(){ - var urlStore = Ext.create('Ext.data.Store', { - model: 'Ssp.model.ApiUrl', - storeId: 'apiUrlStore' - }); - - urlStore.loadData( apiUrls ); - - return urlStore; - }, - singleton: true - }, - sspConfig: { - fn: function(){ - return new Ssp.model.Configuration({}); - }, - singleton: true - }, - currentPerson: { - fn: function(){ - return new Ssp.model.Person({id:""}); - }, - singleton: true - }, - personLite: { - fn: function(){ - return new Ssp.model.PersonLite({id:""}); - }, - singleton: true - }, - contactPerson: { - fn: function(){ - return new Ssp.model.ContactPerson({id:""}); - }, - singleton: true - }, - authenticatedPerson: { - fn: function(){ - var p = new Ssp.model.AuthenticatedPerson(); - p.populateFromGenericObject( user ); - p.setObjectPermissions(); - return p; - }, - singleton: true - }, - preferences: { - fn: function(){ - return new Ssp.model.Preferences(); - }, - singleton: true - }, - itemSelectorInitializer: { - fn: function(){ - return new Ssp.mixin.controller.ItemSelectorInitializer({}); - }, - // Not a singleton b/c this is really intended to work - // more like a mixin on a view component, so needs to - // allowed to maintain state and smaller scopes than - // 'application'. - singleton: false - }, - apiProperties: { - fn: function(){ - return new Ssp.mixin.ApiProperties({}); - }, - singleton: true - }, - formRendererUtils:{ - fn: function(){ - return new Ssp.util.FormRendererUtils({}); - }, - singleton: true - }, - columnRendererUtils:{ - fn: function(){ - return new Ssp.util.ColumnRendererUtils({}); - }, - singleton: true - }, - mapEventUtils:{ - fn: function(){ - return new Ssp.util.tools.map.MapEventUtils({}); - }, - singleton: true - }, - treeRendererUtils:{ - fn: function(){ - return new Ssp.util.TreeRendererUtils({}); - }, - singleton: true - }, - util:{ - fn: function(){ - return new Ssp.util.Util({}); - }, - singleton: true - }, - storeUtils:{ - fn: function(){ - return new Ssp.util.StoreUtils({}); - }, - singleton: true - }, - appEventsController:{ - fn: function(){ - return new Ssp.controller.ApplicationEventsController({}); - }, - singleton: true - }, - currentAppointment: { - fn: function(){ - return new Ssp.model.Appointment({id:""}); - }, - singleton: true - }, - currentPersonAppointment: { - fn: function(){ - return new Ssp.model.PersonAppointment({id:""}); - }, - singleton: true - }, - currentChallenge:{ - fn: function(){ - return new Ssp.model.reference.Challenge({id:""}); - }, - singleton: true - }, - currentChallengeReferral:{ - fn: function(){ - return new Ssp.model.reference.ChallengeReferral({id:""}); - }, - singleton: true - }, - currentCourse:{ - fn: function(){ - return new Ssp.model.external.Course({id:""}); - }, - singleton: true - }, - currentJournalStep:{ - fn: function(){ - return new Ssp.model.reference.JournalStep({id:""}); - }, - singleton: true - }, - currentStudentDocument: { - fn: function(){ - return new Ssp.model.tool.documents.StudentDocument({id:""}); - }, - singleton: true }, - currentJournalStepDetail:{ - fn: function(){ - return new Ssp.model.reference.JournalStepDetail({id:""}); - }, - singleton: true - }, - currentMapPlan: { - fn: function(){ - return new Ssp.model.tool.map.Plan({id:""}); - }, - singleton: true - }, - currentSemesterStores: { - fn: function(){ - return {}; - }, - singleton: true - }, - currentTask:{ - fn: function(){ - return new Ssp.model.tool.actionplan.Task({id:""}); - }, - singleton: true - }, - - currentGoal:{ - fn: function(){ - return new Ssp.model.PersonGoal({id:""}); - }, - singleton: true - }, - currentStrength:{ - fn: function(){ - return new Ssp.model.PersonStrength({id:""}); - }, - singleton: true - }, - currentStudentIntake: { - fn: function(){ - return new Ssp.model.tool.studentintake.StudentIntakeForm(); - }, - singleton: true - }, - currentAccommodation: { - fn: function(){ - return new Ssp.model.tool.accommodation.AccommodationForm(); - }, - singleton: true - }, - currentJournalEntry:{ - fn: function(){ - return new Ssp.model.tool.journal.JournalEntry({id:""}); - }, - singleton: true - }, - currentEarlyAlert:{ - fn: function(){ - return new Ssp.model.tool.earlyalert.PersonEarlyAlert({id:""}); - }, - singleton: true - }, - currentEarlyAlertResponse:{ - fn: function(){ - return new Ssp.model.tool.earlyalert.EarlyAlertResponse({id:""}); - }, - singleton: true - }, - currentEarlyAlertResponsesGridStore: { - fn: function() { - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.tool.earlyalert.EarlyAlertResponseGrid', - storeId: 'currentEarlyAlertResponsesGridStore' - }); - }, - singleton: true - }, - currentDocument:{ - fn: function(){ - return new Ssp.model.tool.documents.StudentDocument({id:""}); - }, - singleton: true - }, - currentCampus:{ - fn: function(){ - return new Ssp.model.reference.Campus({id:""}); - }, - singleton: true - }, - currentCampusEarlyAlertRouting:{ - fn: function(){ - return new Ssp.model.reference.CampusEarlyAlertRouting({id:""}); - }, - singleton: true - }, - currentSelfHelpGuide:{ - fn: function(){ - return new Ssp.model.tool.shg.SelfHelpGuides({id:""}); - }, - singleton: true - }, - currentSelfHelpGuideQuestions:{ - fn: function(){ - return new Ssp.model.tool.shg.SelfHelpGuideQuestions({id:""}); - }, - singleton: true - }, - courseTranscriptsStore: { - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.CourseTranscript' - }); - }, - singleton: true - }, - mapStatusReportStore: { - fn: function(){ - return Ext.create('Ssp.store.MapStatusReports'); - }, - singleton: true - }, - mapStatusReportCourseDetailsStore: { - fn: function(){ - return Ext.create('Ssp.store.MapStatusReportCourseDetails'); - }, - singleton: true - }, - mapStatusReportTermDetailsStore: { - fn: function(){ - return Ext.create('Ssp.store.MapStatusReportTermDetails'); - }, - singleton: true - }, - personRegistrationStatusByTermStore: { - fn: function(){ - return Ext.create('Ssp.store.RegistrationStatusByTerm'); - }, - singleton: true - }, - mapStatusReportSubstitutionDetailsStore: { - fn: function(){ - return Ext.create('Ssp.store.MapStatusReportSubstitutionDetails'); - }, - singleton: true - }, - currentScheduleStore: { - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.CourseTranscript' - }); - }, - singleton: true - }, - currentDroppedScheduleStore:{ - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.CourseTranscript' - }); - }, - singleton: true - }, - - termTranscriptsStore: { - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.TermTranscript' - }); - }, - singleton: true - }, - treeStore:{ - fn: function(){ - return Ext.create('Ext.data.TreeStore',{ - root: { - text: 'root', - expanded: true, - children: [] - } - }); - }, - singleton: true - }, - earlyAlertsTreeStore:{ - fn: function(){ - return Ext.create('Ext.data.TreeStore',{ - model: 'Ssp.model.tool.earlyalert.PersonEarlyAlertTree' - }); - }, - - singleton: true - }, - earlyAlertDetailsSuggestionsStore: { - fn: function(){ - return Ext.create('Ext.data.Store', { - model: 'Ssp.model.SimpleItemDisplay', - storeId: 'earlyAlertDetailsSuggestionsStore' - }); - }, - singleton: true - }, - earlyAlertDetailsReasonsStore: { - fn: function(){ - return Ext.create('Ext.data.Store', { - model: 'Ssp.model.SimpleItemDisplay', - storeId: 'earlyAlertDetailsReasonsStore', - sorters: [{property: 'name'}] - }); - }, - singleton: true - }, - earlyAlertResponseDetailsOutreachesStore: { - fn: function(){ - return Ext.create('Ext.data.Store', { - model: 'Ssp.model.SimpleItemDisplay', - storeId: 'earlyAlertResponseDetailsOutreachesStore' - }); - }, - singleton: true - }, - earlyAlertResponseDetailsReferralsStore: { - fn: function(){ - return Ext.create('Ext.data.Store', { - model: 'Ssp.model.SimpleItemDisplay', - storeId: 'earlyAlertResponseDetailsReferralsStore' - }); - }, - singleton: true - }, - profileSpecialServiceGroupsStore:{ - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.reference.SpecialServiceGroup', - filterOnLoad: true, - filters: [{property:"objectStatus", value:'ACTIVE'}], - sorters: [{ - property: 'name', - direction: 'ASC' - }] - }); - }, - singleton: true - }, - profileReferralSourcesStore:{ - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.reference.ReferralSource', - filterOnLoad: true, - filters: [{property:"objectStatus", value:'ACTIVE'}], - sorters: [{ - property: 'name', - direction: 'ASC' - }] - }); - }, - singleton: true - }, - profileServiceReasonsStore:{ - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.reference.ServiceReason', - filterOnLoad: true, - filters: [{property:"objectStatus", value:'ACTIVE'}], - sorters: [{ - property: 'name', - direction: 'ASC' - }] - }); - }, - singleton: true - }, - errorsStore:{ - fn: function(){ - return Ext.create('Ext.data.Store',{ - model: 'Ssp.model.FieldError' - }); - }, - singleton: true - }, - searchCriteria: { - fn: function(){ - return new Ssp.model.SearchCriteria(); - }, - singleton: true - }, - caseloadFilterCriteria: { - fn: function(){ - return new Ssp.model.CaseloadFilterCriteria(); - }, - singleton: true - }, - currentMessageTemplate:{ - fn: function(){ - return new Ssp.model.MessageTemplates({id:""}); - }, - singleton: true - }, - addTasksStore:{ - fn: function(){ - return new Ssp.store.AddTasks(); - }, - singleton: true - }, - // STORES - abstractReferencesStore: 'Ssp.store.reference.AbstractReferences', - adminTreeMenusStore: 'Ssp.store.admin.AdminTreeMenus', - anticipatedStartTermsStore: 'Ssp.store.reference.AnticipatedStartTerms', - campusesStore: 'Ssp.store.reference.Campuses', - campusesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Campuses', { - storeId: 'campusesAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - campusesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Campuses', { - storeId: 'campusesAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - campusEarlyAlertRoutingsStore: 'Ssp.store.reference.CampusEarlyAlertRoutings', - campusServicesStore: 'Ssp.store.reference.CampusServices', - caseloadStore: { - fn: function(){ - return Ext.create('Ssp.store.Caseload', { - storeId: 'caseloadStoreMain', - params : { - page : 0, - start : 0, - limit : 100 - } - }); - }, - singleton: true - }, - reassignCaseloadStagingStore: 'Ssp.store.Caseload', - reassignCaseloadStore: 'Ssp.store.Caseload', - contactPersonStore: 'Ssp.store.ContactPerson', - challengesStore: 'Ssp.store.reference.Challenges', - challengesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Challenges', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - challengesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Challenges', { - extraParams: {limit: "-1"} - }); - }, - singleton: true - }, - challengeCategoriesStore: 'Ssp.store.reference.ChallengeCategories', - challengeCategoriesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ChallengeCategories', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - challengeReferralsStore: 'Ssp.store.reference.ChallengeReferrals', - challengeReferralsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ChallengeReferrals', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - challengeReferralsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ChallengeReferrals', { - extraParams: {status: "ALL", limit:"-1"} - }); - }, - singleton: true - }, - childCareArrangementsStore: 'Ssp.store.reference.ChildCareArrangements', - childCareArrangementsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ChildCareArrangements', { - storeId: 'childCareArrangementsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - citizenshipsStore: 'Ssp.store.reference.Citizenships', - citizenshipsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Citizenships', { - storeId: 'citizenshipsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - coachesStore: 'Ssp.store.Coaches', - allCoachesStore: 'Ssp.store.CoachesAll', - allCoachesCurrentStore: 'Ssp.store.CoachesAllCurrent', - confidentialityDisclosureAgreementsStore: 'Ssp.store.reference.ConfidentialityDisclosureAgreements', - configurationOptionsStore: 'Ssp.store.reference.ConfigurationOptions', - configurationOptionsUnpagedStore: - { - fn: function(){ - return Ext.create('Ssp.store.reference.ConfigurationOptionsUnpaged', { - storeId: 'configurationOptionsUnpagedStore', - extraParams: {limit: "-1"} - }); - }, - singleton: true - }, - configStore: - { - fn: function(){ - return Ext.create('Ssp.store.reference.ConfigurationOptionsUnpaged', { - storeId: 'configurationOptionsUnpagedStore', - extraParams: {limit: "-1"} - }); - }, - singleton: true - }, - colorsStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Colors', { - storeId: 'colorsStore' - }); - }, - singleton: true - }, - colorsUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Colors', { - storeId: 'colorsUnpagedStore', - extraParams: {limit: "-1"} - }); - }, - singleton: true - }, - colorsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Colors', { - storeId: 'colorsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - colorsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Colors', { - storeId: 'colorsAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - confidentialityLevelOptionsStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ConfidentialityLevelOptions', { - storeId: 'confidentialityLevelOptionsStore' - }); - }, - singleton: true - }, - confidentialityLevelsStore: 'Ssp.store.reference.ConfidentialityLevels', - confidentialityLevelsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ConfidentialityLevels', { - storeId: 'confidentialityLevelsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - confidentialityLevelsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ConfidentialityLevels', { - storeId: 'confidentialityLevelsAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - - //disabilityAccommodationsStore: 'Ssp.store.reference.DisabilityAccommodations', - disabilityAccommodationsStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.DisabilityAccommodations', {}); - }, - singleton: true - }, - disabilityAccommodationsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.DisabilityAccommodations', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - disabilityAgenciesStore: 'Ssp.store.reference.DisabilityAgencies', - disabilityAgenciesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.DisabilityAgencies', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - disabilityStatusesStore: 'Ssp.store.reference.DisabilityStatuses', - disabilityStatusesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.DisabilityStatuses', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - disabilityTypesStore: 'Ssp.store.reference.DisabilityTypes', - disabilityTypesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.DisabilityTypes', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - earlyAlertOutcomesStore: 'Ssp.store.reference.EarlyAlertOutcomes', - earlyAlertOutcomesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertOutcomes', { - storeId: 'earlyAlertOutcomesAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - earlyAlertOutcomesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertOutcomes', { - storeId: 'earlyAlertOutcomesAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - earlyAlertOutreachesStore: 'Ssp.store.reference.EarlyAlertOutreaches', - earlyAlertOutreachesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertOutreaches', { - storeId: 'earlyAlertOutreachesAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - earlyAlertOutreachesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertOutreaches', { - storeId: 'earlyAlertOutreachesAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - earlyAlertReasonsStore: 'Ssp.store.reference.EarlyAlertReasons', - earlyAlertReasonsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertReasons', { - storeId: 'earlyAlertReasonsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - earlyAlertReasonsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertReasons', { - storeId: 'earlyAlertReasonsAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - earlyAlertReferralsStore: 'Ssp.store.reference.EarlyAlertReferrals', - earlyAlertReferralsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertReferrals', { - storeId: 'earlyAlertReferralsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - earlyAlertReferralsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertReferrals', { - storeId: 'earlyAlertReferralsAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - earlyAlertReferralsBindStore: 'Ssp.store.reference.EarlyAlertReferralsBind', - earlyAlertsStore: 'Ssp.store.EarlyAlerts', - earlyAlertSuggestionsStore: 'Ssp.store.reference.EarlyAlertSuggestions', - earlyAlertSuggestionsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertSuggestions', { - storeId: 'earlyAlertSuggestionsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - earlyAlertSuggestionsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EarlyAlertSuggestions', { - storeId: 'earlyAlertSuggestionsAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - educationGoalsStore: 'Ssp.store.reference.EducationGoals', - educationGoalsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EducationGoals', { - storeId: 'educationGoalsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - educationLevelsStore: 'Ssp.store.reference.EducationLevels', - educationLevelsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.EducationLevels', { - storeId: 'educationLevelsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - electivesStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Electives', { - storeId: 'electivesStore', - extraParams: {sort: "sortOrder", sortDirection:'ASC' } - }); - }, - singleton: true - }, - electivesUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Electives', { - storeId: 'electivesUnpagedStore', - extraParams: {limit: "-1"} - }); - }, - singleton: true - }, - electivesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Electives', { - storeId: 'electivsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - electivesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Electives', { - storeId: 'electivsAllUnpagedStore', - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - - planTemplatesSummaryStore: { - fn: function(){ - return Ext.create('Ssp.store.PlanTemplatesSummary', { - storeId: 'planTemplatesSummaryStore', - extraParams: {sort: "name", status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - employmentShiftsStore: 'Ssp.store.reference.EmploymentShifts', - ethnicitiesStore: 'Ssp.store.reference.Ethnicities', - ethnicitiesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Ethnicities', { - storeId: 'ethnicitiesAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - racesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Races', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - racesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.Races', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - sapStatusesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SapStatuses', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - sapStatusesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SapStatuses', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - sapStatusesActiveUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SapStatuses', { - extraParams: {status: "ACTIVE", limit: "-1"} - }); - }, - singleton: true - }, - financialAidFilesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.FinancialAidFiles', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - financialAidFilesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.FinancialAidFiles', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - fundingSourcesStore: 'Ssp.store.reference.FundingSources', - fundingSourcesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.FundingSources', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - gendersStore: 'Ssp.store.reference.Genders', - goalsStore: 'Ssp.store.Goals', - strengthsStore: 'Ssp.store.Strengths', - // addTasksStore: 'Ssp.store.AddTasks', - journalEntriesStore: 'Ssp.store.JournalEntries', - journalEntriesUnpagedStore: 'Ssp.store.JournalEntriesUnpaged', - journalEntryDetailsStore: 'Ssp.store.JournalEntryDetails', - journalSourcesStore: 'Ssp.store.reference.JournalSources', - journalSourcesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalSources', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - journalSourcesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalSources', { - extraParams: {status: "ALL", limit:"-1"} - }); - }, - singleton: true - }, - journalSourcesUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalSources', { - extraParams: {limit:"-1"} - }); - }, - singleton: true - }, - journalStepsStore: 'Ssp.store.reference.JournalSteps', - journalStepsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalSteps', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - journalStepsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalSteps', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - journalDetailsStore: 'Ssp.store.reference.JournalStepDetails', - journalDetailsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalStepDetails', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - journalDetailsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalStepDetails', { - extraParams: {status: "ALL", limit:"-1"} - }); - }, - singleton: true - }, - journalTracksStore: 'Ssp.store.reference.JournalTracks', - journalTracksUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalTracks', { - extraParams: {limit:"-1"} - }); - }, - singleton: true - }, - journalTracksAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalTracks', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - journalTracksAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.JournalTracks', { - extraParams: {status: "ALL", limit:"-1"} - }); - }, - singleton: true - }, - lassisStore: 'Ssp.store.reference.Lassis', - maritalStatusesStore: 'Ssp.store.reference.MaritalStatuses', - maritalStatusesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.MaritalStatuses', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - militaryAffiliationsStore: 'Ssp.store.reference.MilitaryAffiliations', - militaryAffiliationsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.MilitaryAffiliations', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - registrationLoadsStore: 'Ssp.store.reference.RegistrationLoads', - registrationLoadsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.RegistrationLoads', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - courseworkHoursStore: 'Ssp.store.reference.CourseworkHours', - courseworkHoursAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.CourseworkHours', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - enrollmentStatusesStore: 'Ssp.store.reference.EnrollmentStatuses', - completedItemStore: - { - fn: function(){ - return Ext.create('Ssp.store.reference.CompletedItem', { - storeId: 'completedItemStore', - extraParams: {status: "ALL", limit: -1, start: null} - }); - }, - singleton: true - }, - textStore: - { - fn: function(){ - return Ext.create('Ssp.store.reference.Texts', { - storeId: 'textStore', - extraParams: {status: "ALL", limit: -1, start: null} - }); - }, - singleton: true - }, - sspTextStore: - { - fn: function(){ - return Ext.create('Ssp.store.reference.Texts', { - storeId: 'sspTextStore', - extraParams: {status: "ALL", limit: -1, start: null} - }); - }, - singleton: true - }, - messageTemplatesStore: 'Ssp.store.reference.MessageTemplates', - personalityTypesStore: 'Ssp.store.reference.PersonalityTypes', - placementStore: 'Ssp.store.Placement', - planStore: 'Ssp.store.Plan', - programStatusesStore: 'Ssp.store.reference.ProgramStatuses', - programStatusChangeReasonsStore: 'Ssp.store.reference.ProgramStatusChangeReasons', - programStatusChangeReasonsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ProgramStatusChangeReasons', { - storeId: 'programStatusChangeReasonsAllStore', - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - referralSourcesStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ReferralSources', { }); - }, - singleton: true - }, - referralSourcesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ReferralSources', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - referralSourcesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ReferralSources', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - searchStore: 'Ssp.store.Search', - studentsSearchStore: { - fn: function(){ - return Ext.create('Ssp.store.StudentsSearch', { - storeId: 'studenSearchStoreMain', - extraParams: {limit: "50"} - }); - }, - singleton: true - }, - directoryPersonSearchStore: { - fn: function(){ - return Ext.create('Ssp.store.DirectoryPersonSearch', { - storeId: 'directoryPersonSearchStore', - extraParams: {limit: "50"} - }); - }, - singleton: true - }, - searchChallengeReferralStore: 'Ssp.store.SearchChallengeReferral', - selfHelpGuidesStore: 'Ssp.store.reference.SelfHelpGuides', - selfHelpGuidesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SelfHelpGuides', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - selfHelpGuidesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SelfHelpGuides', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - selfHelpGuideQuestionsStore: 'Ssp.store.reference.SelfHelpGuideQuestions', - serviceReasonsStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ServiceReasons', { - }); - }, - singleton: true - }, - serviceReasonsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ServiceReasons', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - serviceReasonsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.ServiceReasons', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - specialServiceGroupsStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SpecialServiceGroups', { }); - }, - singleton: true - }, - specialServiceGroupsAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SpecialServiceGroups', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - specialServiceGroupsAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SpecialServiceGroups', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - specialServiceGroupsActiveUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.SpecialServiceGroups', { - extraParams: {status: "ACTIVE", limit: "-1"} - }); - }, - singleton: true - }, - statesStore: 'Ssp.store.reference.States', - studentDocumentsStore: 'Ssp.store.StudentDocuments', - studentsStore: 'Ssp.store.Students', - studentStatusesStore: 'Ssp.store.reference.StudentStatuses', - studentStatusesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.StudentStatuses', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - studentTypesStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.StudentTypes', {}); - }, - singleton: true - }, - studentTypesAllUnpagedStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.StudentTypes', { - extraParams: {status: "ALL", limit: "-1"} - }); - }, - singleton: true - }, - studentTypesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.StudentTypes', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - registrationLoadRangesStore: 'Ssp.store.reference.RegistrationLoadRanges', - weeklyCourseWorkHourRangesStore: 'Ssp.store.reference.WeeklyCourseWorkHourRanges', - termsStore:'Ssp.store.external.Terms', - termsFacetedStore:'Ssp.store.external.TermsFaceted', - programsStore:'Ssp.store.external.Programs', - programsFacetedStore:'Ssp.store.external.ProgramsFaceted', - divisionsStore:'Ssp.store.external.Divisions', - catalogYearsStore:'Ssp.store.external.CatalogYears', - personNotesStore:'Ssp.store.external.PersonNotes', - departmentsStore:'Ssp.store.external.Departments', - coursesStore:'Ssp.store.external.Courses', - tagsStore: 'Ssp.store.reference.Tags', - facetedTagsStore: 'Ssp.store.reference.FacetedTags', - tasksStore: 'Ssp.store.Tasks', - studentActivitiesStore: 'Ssp.store.StudentActivities', - toolsStore: 'Ssp.store.Tools', - veteranStatusesStore: 'Ssp.store.reference.VeteranStatuses', - veteranStatusesAllStore: { - fn: function(){ - return Ext.create('Ssp.store.reference.VeteranStatuses', { - extraParams: {status: "ALL"} - }); - }, - singleton: true - }, - planStatusStore: 'Ssp.store.PlanStatus', - personTableTypesStore: 'Ssp.store.PersonTableTypes', - financialAidSAPStatus: 'Ssp.store.FinancialAidSAPStatus', - mapStatusStore: 'Ssp.store.MAPStatus', - earlyAlertResponseLateStore: 'Ssp.store.EarlyAlertResponseLate', - currentlyRegisteredStore: 'Ssp.store.CurrentlyRegistered', - oauth2ClientsStore: 'Ssp.store.OAuth2Clients', - permissionsStore: 'Ssp.store.Permissions', - - - - // SERVICES - appointmentService: 'Ssp.service.AppointmentService', - assessmentService: 'Ssp.service.AssessmentService', - campusService: 'Ssp.service.CampusService', - campusEarlyAlertRoutingService: 'Ssp.service.CampusEarlyAlertRoutingService', - caseloadService: 'Ssp.service.CaseloadService', - confidentialityDisclosureAgreementService: 'Ssp.service.ConfidentialityDisclosureAgreementService', - accommodationService: 'Ssp.service.AccommodationService', - earlyAlertService: 'Ssp.service.EarlyAlertService', - earlyAlertReferralService: 'Ssp.service.EarlyAlertReferralService', - earlyAlertResponseService: 'Ssp.service.EarlyAlertResponseService', - journalEntryService: 'Ssp.service.JournalEntryService', - personService: 'Ssp.service.PersonService', - placementService: 'Ssp.service.PlacementService', - personNoteService: 'Ssp.service.PersonNoteService', - personProgramStatusService: 'Ssp.service.PersonProgramStatusService', - programStatusService: 'Ssp.service.ProgramStatusService', - referralSourceService: 'Ssp.service.ReferralSourceService', - searchService: 'Ssp.service.SearchService', - searchChallengeReferralService: 'Ssp.service.SearchChallengeReferralService', - specialServiceGroupService: 'Ssp.service.SpecialServiceGroupService', - serviceReasonsService: 'Ssp.service.ServiceReasonsService', - studentIntakeService: 'Ssp.service.StudentIntakeService', - transcriptService: 'Ssp.service.TranscriptService', - mapPlanService: 'Ssp.service.MapPlanService', - studentActivityService: 'Ssp.service.StudentActivityService', - courseService: 'Ssp.service.CourseService' - }); - - - // Do not use 'autoCreateViewport: true' here. It will trigger - // initialization of the Deft IoC container before the - // Application exists, so some managed components may be only - // partially initialized. This is particularly problematic for - // AppEventsController which needs a reference to the - // Application. If it does not have that reference, the first - // components to load (those associated with Viewport) cannot - // register Application-scoped events during their - // initialization. The resulting deferred event listener - // binding has been the direct cause of subtle bugs. - Ext.application({ - name: 'Ssp', - appFolder: Ext.Loader.getPath('Ssp'), - launch: function( app ) { - var me=this; - Deft.Injector.resolve("appEventsController").setApp(me); - - // Date patterns for formatting by a description - // rather than a date format - Ext.Date.patterns = { - ISO8601Long:"Y-m-d H:i:s", - ISO8601Short:"Y-m-d", - ShortDate: "n/j/Y", - LongDate: "l, F d, Y", - FullDateTime: "l, F d, Y g:i:s A", - MonthDay: "F d", - ShortTime: "g:i A", - LongTime: "g:i:s A", - SortableDateTime: "Y-m-d\\TH:i:s", - UniversalSortableDateTime: "Y-m-d H:i:sO", - YearMonth: "F, Y" - }; - - // Global error handling for Ajax calls - Ext.override(Ext.data.proxy.Server, { - simpleSortMode: true, - constructor: function(config) - { - this.callOverridden([config]); - this.addListener("exception", function (proxy, response, operation) { - if (response.status==403) - { - Ext.Msg.confirm({ - title:'Access Denied Error', - msg: "It looks like you are trying to access restricted information or your login session has expired. Would you like to login to continue working in SSP?", - buttons: Ext.Msg.YESNO, - fn: function( btnId ){ - if (btnId=="yes") - { - // force a login - window.location.reload(); - }else{ - // force a login - window.location.reload(); - } - }, - scope: me - }); - } - - // Handle call not found result - if (response.status==404) - { - Ext.Msg.alert('SSP Error', '404 Server Error. See logs for additional details'); - } - }); - } - }); - - /* - * Provide global asterisks next to required fields - */ - Ext.Function.interceptAfter(Ext.form.Field.prototype,'initComponent', function(){ - var fl=this.fieldLabel, ab=this.allowBlank; - if (fl){ - this.labelStyle=Ssp.util.Constants.SSP_LABEL_STYLE; - } - if (ab===false && fl){ - this.fieldLabel += Ssp.util.Constants.REQUIRED_ASTERISK_DISPLAY; - } - }); - - /* - * Provide global asterisks next to required field containers - */ - Ext.Function.interceptAfter(Ext.form.FieldContainer.prototype,'initComponent', function(){ - var fl=this.fieldLabel, ab=this.allowBlank; - if (fl){ - this.labelStyle=Ssp.util.Constants.SSP_LABEL_STYLE; - } - if (ab===false && fl){ - this.fieldLabel += Ssp.util.Constants.REQUIRED_ASTERISK_DISPLAY; - } - }); - - /* - * Per Animal, http://www.extjs.com/forum/showthread.php?p=450116#post450116 - * Override to provide a function to determine the invalid - * fields in a form. - */ - Ext.override(Ext.form.BasicForm, { - findInvalid: function() { - var result = [], it = this.getFields().items, l = it.length, i, f; - for (i = 0; i < l; i++) { - if(!(f = it[i]).disabled && f.isValid()){ - result.push(f); - } - } - return result; - } - }); - - /* - * Per Animal, http://www.extjs.com/forum/showthread.php?p=450116#post450116 - * Override component so that the first invalid field - * will be displayed for the user when a form is invalid. - */ - Ext.override(Ext.Component, { - ensureVisible: function(stopAt) { - var p; - this.ownerCt.bubble(function(c) { - if (p = c.ownerCt) { - if (p instanceof Ext.TabPanel) { - p.setActiveTab(c); - } else if (p.layout.setActiveItem) { - p.layout.setActiveItem(c); - } else if (p.layout.type == 'accordion'){ - c.expand(); - } - } - return (c !== stopAt); - }); - //this.el.scrollIntoView(this.el.up(':scrollable')); - return this; - } - }); - - //http://stackoverflow.com/questions/9704913/confirm-password-validator-extjs-4 - Ext.apply(Ext.form.field.VTypes,{ - passwordConfirm : function(val, field) { - if (field.initialPassField) { - var pwd = Ext.getCmp(field.initialPassField); - return (val === pwd.getValue()); - } - return true; - }, - passwordConfirmText : 'Passwords/secrets do not match' - }); - - Ext.apply(Ext.form.field.VTypes,{ - multiemail: function(val, field) { - Ext.form.field.VTypes.multiemailInvalidPositions = []; - if(val && val.length > 0){ - var emailAddresses = val.split(','); - var valid = true; - var i = 0; - Ext.Array.each( emailAddresses, function(emailAddress, index){ - // if it is a string and it contains something other than whitespace - if(emailAddress && !(/^\s*$/).test(emailAddress)){ - if(!Ext.form.field.VTypes.email(emailAddress.trim())){ - valid = false; - Ext.form.field.VTypes.multiemailInvalidPositions[i] = index; - } - } - i++; - }); - return valid; - } - return true; - }, - multiemailInvalidPositions: [], - multiemailText: function(){return 'Email(s) at position(s) ' + Ext.form.field.VTypes.multiemailInvalidPositions.join(",") + "are invalid"}, - multiemailMask: /[a-z0-9_.-@,\s]/i - - }); - - /* - * Per Animal, http://www.extjs.com/forum/showthread.php?p=450116#post450116 - * Enables scrolling to the nearest visible elements - * in a form for use with the above override for - * visually indicating when a form validation fails - * and setting the user to see the first invalid field. - Ext.DomQuery.pseudos.scrollable = function(c, t) { - var r = [], ri = -1; - for(var i = 0, ci; ci = c[i]; i++){ - var o = ci.style.overflow; - if(o=='auto'||o=='scroll') { - if (ci.scrollHeight < Ext.fly(ci).getHeight(true)) r[++ri] = ci; - } - } - return r; - }; - */ - - // load the main view - Ext.apply(me,{ - items: [{xtype:'sspview'}] - }); - - // Since we're not using 'autoCreateViewport: true', - // we need to create the default view ourselves. - // (Frankly not sure exactly what the relationship is - // between this and the xtype-based lookup of the same - // component type immediately above. But you'll get - // a blank screen without this explicit create. - Ext.create( "Ssp.view.Viewport"); - - } - }); - - }else{ - Ext.Msg.alert('Error','Unable to determine authenticated user. Please see your system administrator for assistance.'); - } - } - }, this); - -}); +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039: + * Added - Ssp.store.reference.EarlyAlertInterventions + * - earlyAlertIntervention url path + * - earlyAlertDetailsInterventionsStore + * - earlyAlertInterventionsStore & earlyAlertInterventionsAllUnpagedStore + * + * + */ +Ext.Loader.setConfig({ + enabled: true, + paths: { + 'Ssp': '/ssp/app', + 'ContextName': 'ssp' + } +}); + +Ext.require([ + 'Ssp.view.admin.forms.ColorPicker', + 'Ssp.view.admin.AdminMain', + 'Ssp.view.admin.AdminTreeMenu', + 'Ssp.view.admin.AdminForms', + 'Ssp.view.Main', + 'Ssp.view.Search', + 'Ssp.view.SearchForm', + 'Ssp.view.StudentRecord', + 'Ssp.view.EmailStudentForm', + 'Ssp.view.EmailStudentView', + 'Ssp.view.ProgramStatusChangeReasonWindow', + 'Ssp.view.person.Student', + 'Ssp.view.person.CaseloadAssignment', + 'Ssp.view.person.EditPerson', + 'Ssp.view.person.Coach', + 'Ssp.view.person.Appointment', + 'Ssp.view.person.StudentIntakeRequest', + 'Ssp.view.person.SpecialServiceGroups', + 'Ssp.view.person.ReferralSources', + 'Ssp.view.person.ServiceReasons', + 'Ssp.view.person.AnticipatedStartDate', + 'Ssp.view.component.MappedTextField', + 'Ssp.view.component.MappedTextArea', + 'Ssp.view.component.MappedCheckBox', + 'Ssp.view.component.MappedRadioButton', + 'Ssp.view.ToolsMenu', + 'Ssp.view.Tools', + 'Ssp.view.tools.profile.Profile', + 'Ssp.view.tools.profile.Person', + 'Ssp.view.tools.profile.SpecialServiceGroups', + 'Ssp.view.tools.profile.ReferralSources', + 'Ssp.view.tools.profile.ServicesProvided', + 'Ssp.view.tools.profile.ServiceReasons', + 'Ssp.view.tools.profile.Coach', + 'Ssp.view.tools.profile.Contact', + 'Ssp.view.tools.profile.Placement', + 'Ssp.view.tools.profile.Transcript', + 'Ssp.view.tools.profile.RecentSSPActivity', + 'Ssp.view.tools.profile.Schedule', + 'Ssp.view.tools.profile.CurrentSchedule', + 'Ssp.view.tools.profile.DroppedCourses', + 'Ssp.view.tools.profile.Details', + 'Ssp.view.tools.profile.SapStatus', + 'Ssp.view.tools.profile.Dashboard', + 'Ssp.view.tools.profile.AcademicProgram', + 'Ssp.view.tools.profile.RecentTermActivity', + 'Ssp.view.tools.profile.FinancialAidFiles', + 'Ssp.view.tools.profile.FinancialAidFileViewer', + 'Ssp.view.tools.profile.FinancialAidAwards', + 'Ssp.view.tools.profile.FinancialAidAwardViewer', + 'Ssp.view.tools.actionplan.ActionPlan', + 'Ssp.view.tools.actionplan.Tasks', + 'Ssp.view.tools.actionplan.AddTask', + 'Ssp.view.tools.actionplan.AddTaskForm', + 'Ssp.view.tools.actionplan.EditGoalForm', + 'Ssp.view.tools.actionplan.EmailActionPlan', + 'Ssp.view.tools.actionplan.EmailAndPrintActionPlan', + 'Ssp.view.tools.actionplan.DisplayActionPlan', + 'Ssp.view.tools.actionplan.DisplayActionPlanGoals', + 'Ssp.view.tools.actionplan.DisplayStrengths', + 'Ssp.view.tools.actionplan.TaskTree', + 'Ssp.view.tools.actionplan.AddAPTask', + 'Ssp.view.tools.actionplan.ChallengesGrid', + 'Ssp.view.tools.actionplan.CustomActionPlan', + 'Ssp.view.tools.actionplan.EditTaskForm', + 'Ssp.view.tools.actionplan.SearchChallengeView', + 'Ssp.view.tools.actionplan.TasksGrid', + 'Ssp.view.tools.actionplan.AddTaskView', + 'Ssp.view.tools.studentintake.StudentIntake', + 'Ssp.view.tools.studentintake.Checklist', + 'Ssp.view.tools.studentintake.Challenges', + 'Ssp.view.tools.studentintake.Demographics', + 'Ssp.view.tools.studentintake.EducationGoals', + 'Ssp.view.tools.studentintake.EducationLevels', + 'Ssp.view.tools.studentintake.EducationPlans', + 'Ssp.view.tools.studentintake.Funding', + 'Ssp.view.tools.studentintake.Personal', + 'Ssp.view.tools.journal.Journal', + 'Ssp.view.tools.journal.EditJournal', + 'Ssp.view.tools.journal.DisplayDetails', + 'Ssp.view.tools.journal.TrackTree', + 'Ssp.view.tools.journal.JournalList', + 'Ssp.view.tools.earlyalert.EarlyAlert', + 'Ssp.view.tools.earlyalert.EarlyAlertResponse', + 'Ssp.view.tools.earlyalert.EarlyAlertReferrals', + 'Ssp.view.tools.earlyalert.EarlyAlertDetails', + 'Ssp.view.tools.earlyalert.EarlyAlertResponseDetails', + 'Ssp.view.tools.document.StudentDocuments', + 'Ssp.view.tools.document.EditDocument', + 'Ssp.view.tools.sis.StudentInformationSystem', + 'Ssp.view.tools.sis.Registration', + 'Ssp.view.tools.sis.Assessment', + + //'Ssp.view.tools.sis.Transcript', + 'Ssp.view.tools.accommodation.Accommodation', + 'Ssp.view.tools.accommodation.General', + 'Ssp.view.tools.accommodation.AgencyContacts', + 'Ssp.view.tools.accommodation.DisabilityTypes', + 'Ssp.view.tools.accommodation.Disposition', + 'Ssp.view.tools.accommodation.Accommodations', + + 'Ssp.view.tools.displacedworker.DisplacedWorker', + 'Ssp.view.tools.studentsuccess.StudentSuccess', + 'Ssp.view.admin.AdminForms', + 'Ssp.view.admin.forms.AbstractReferenceAdmin', + 'Ssp.view.admin.forms.ConfidentialityDisclosureAgreementAdmin', + + //MAP Views + 'Ssp.view.tools.map.MAP', + 'Ssp.view.tools.map.MAPTool', + 'Ssp.view.tools.map.CoursesView', + 'Ssp.view.tools.map.SemesterGridTranscript', + 'Ssp.view.tools.map.SemesterPanel', + 'Ssp.view.tools.map.SemesterPanelContainer', + 'Ssp.view.tools.map.StudentTranscriptViewer', + 'Ssp.view.tools.map.MapStatusReport', + 'Ssp.view.tools.map.FAView', + 'Ssp.view.tools.map.MAPView', + 'Ssp.view.tools.map.MovePlan', + 'Ssp.view.tools.map.MovePlanDialog', + 'Ssp.view.tools.map.PlanTool', + 'Ssp.view.tools.map.LoadPlans', + 'Ssp.view.tools.map.PlanNotes', + 'Ssp.view.tools.map.LoadTemplates', + 'Ssp.view.tools.map.SaveTemplate', + 'Ssp.view.tools.map.StudentTranscriptViewer', + 'Ssp.view.tools.map.SavePlan', + 'Ssp.view.tools.map.CourseNotes', + 'Ssp.view.tools.map.TermNotes', + 'Ssp.view.tools.map.EmailPlan', + 'Ssp.view.tools.map.PrintPlan', + 'Ssp.view.tools.map.CourseDetails', + 'Ssp.view.tools.map.CoursesGrid', + 'Ssp.view.tools.map.CoursesGridPanel', + + //PERSON NOTES TOOL + 'Ssp.view.tools.notes.Notes', + + 'Ssp.view.tools.documents.Documents', + 'Ssp.view.tools.documents.UploadDocuments', + + // COUNSELING REFERENCE GUIDE ADMIN VIEWS + 'Ssp.view.admin.forms.crg.ChallengeAdmin', + 'Ssp.view.admin.forms.crg.ChallengeReferralAdmin', + 'Ssp.view.admin.forms.crg.AssociateChallengeCategoriesAdmin', + 'Ssp.view.admin.forms.crg.AssociateChallengeReferralsAdmin', + 'Ssp.view.admin.forms.crg.DisplayChallengesAdmin', + 'Ssp.view.admin.forms.crg.DisplayReferralsAdmin', + 'Ssp.view.admin.forms.crg.EditChallenge', + 'Ssp.view.admin.forms.crg.EditReferral', + + + //CASELOAD REASSIGNMENT ADMIN + 'Ssp.view.admin.forms.caseload.CaseloadReassignment', + 'Ssp.view.admin.forms.caseload.CaseloadReassignmentSource', + 'Ssp.view.admin.forms.caseload.CaseloadReassignmentTarget', + + //CASELOAD REASSIGNMENT TOOL + 'Ssp.view.tools.caseload.CaseloadReassignment', + 'Ssp.view.tools.caseload.CaseloadReassignmentSource', + 'Ssp.view.tools.caseload.CaseloadReassignmentTarget', + + //MyGPS ADMIN TOOLS + 'Ssp.view.admin.forms.shg.SelfHelpGuideAdmin', + 'Ssp.view.admin.forms.shg.SelfHelpGuidesDisplayAdmin', + 'Ssp.view.admin.forms.shg.EditSelfHelpGuide', + 'Ssp.view.admin.forms.shg.EditSelfHelpGuideChallenges', + 'Ssp.view.admin.forms.shg.EditSelfHelpGuideDetails', + 'Ssp.view.admin.forms.shg.EditSelfHelpGuideAvailableChallengesAdmin', + 'Ssp.view.admin.forms.shg.EditSelfHelpGuideEditChallenges', + + + // JOURNAL ADMIN VIEWS + 'Ssp.view.admin.forms.journal.JournalStepAdmin', + 'Ssp.view.admin.forms.journal.JournalStepDetailAdmin', + 'Ssp.view.admin.forms.journal.AssociateTrackStepsAdmin', + 'Ssp.view.admin.forms.journal.AssociateStepDetailsAdmin', + 'Ssp.view.admin.forms.journal.DisplayDetailsAdmin', + 'Ssp.view.admin.forms.journal.DisplayStepsAdmin', + 'Ssp.view.admin.forms.journal.EditStep', + 'Ssp.view.admin.forms.journal.EditStepDetail', + + // CAMPUS ADMIN VIEWS + 'Ssp.view.admin.forms.campus.CampusAdmin', + 'Ssp.view.admin.forms.campus.DefineCampus', + 'Ssp.view.admin.forms.campus.EditCampus', + 'Ssp.view.admin.forms.campus.CampusEarlyAlertRoutingsAdmin', + 'Ssp.view.admin.forms.campus.EarlyAlertRoutingsAdmin', + 'Ssp.view.admin.forms.campus.EditCampusEarlyAlertRouting', + + //CONFIG ADMIN VIEWS + 'Ssp.view.admin.forms.config.ConfigurationOptionsAdmin', + 'Ssp.view.admin.forms.config.ConfigurationOptionsDisplayAdmin', + 'Ssp.view.admin.forms.config.MessageTemplatesAdmin', + 'Ssp.view.admin.forms.config.MessageTemplatesDisplayAdmin', + 'Ssp.view.admin.forms.config.MessageTemplateDetails', + + //OAUTH2 ADMIN VIEWS + 'Ssp.view.admin.forms.apikey.oauth2.OAuth2ClientAdmin', + 'Ssp.view.admin.forms.apikey.oauth2.EditOAuth2Client', + + // ERROR DISPLAYS + 'Ssp.view.ErrorWindow', + + // REPORT DISPLAY + 'Ssp.view.Report', + + 'Ssp.model.SimpleItemDisplay', + 'Ssp.model.ObjectPermission', + 'Ssp.model.AuthenticatedPerson', + 'Ssp.model.Preferences', + 'Ssp.model.FieldError', + 'Ssp.model.util.TreeRequest', + 'Ssp.model.Configuration', + 'Ssp.model.Person', + 'Ssp.model.PersonAppointment', + 'Ssp.model.Appointment', + 'Ssp.model.CaseloadPerson', + 'Ssp.model.EmailStudentRequest', + 'Ssp.model.SearchPerson', + 'Ssp.model.SearchCriteria', + 'Ssp.model.CaseloadFilterCriteria', + 'Ssp.model.PersonGoal', + 'Ssp.model.PersonStrength', + 'Ssp.model.SearchChallengeReferral', + 'Ssp.model.PersonLite', + 'Ssp.model.ContactPerson', + 'Ssp.model.Placement', + 'Ssp.model.PersonProgramStatus', + 'Ssp.model.CourseTranscript', + 'Ssp.model.TermTranscript', + 'Ssp.model.StudentActivity', + 'Ssp.model.Transcript', + 'Ssp.model.FilterDiscreteValues', + 'Ssp.model.MessageTemplates', + 'Ssp.model.OAuth2Client', + 'Ssp.model.Permission', + 'Ssp.model.PersonRegistrationStatusByTerm', + 'Ssp.model.tool.studentintake.StudentIntakeForm', + 'Ssp.model.tool.studentintake.PersonDemographics', + 'Ssp.model.tool.studentintake.PersonEducationGoal', + 'Ssp.model.tool.studentintake.PersonEducationPlan', + 'Ssp.model.tool.accommodation.AccommodationForm', + 'Ssp.model.tool.accommodation.PersonDisability', + 'Ssp.model.tool.accommodation.PersonDisabilityAgency', + 'Ssp.model.tool.accommodation.PersonDisabilityType', + 'Ssp.model.tool.accommodation.PersonDisabilityAccommodation', + 'Ssp.model.tool.actionplan.Task', + 'Ssp.model.tool.earlyalert.PersonEarlyAlert', + 'Ssp.model.tool.earlyalert.PersonEarlyAlertTree', + 'Ssp.model.tool.earlyalert.EarlyAlertResponse', + 'Ssp.model.tool.earlyalert.EarlyAlertResponseGrid', + 'Ssp.model.tool.journal.JournalEntry', + 'Ssp.model.tool.journal.JournalEntryDetail', + 'Ssp.model.tool.documents.StudentDocument', + 'Ssp.model.tool.map.SemesterCourse', + 'Ssp.model.tool.map.Plan', + 'Ssp.model.tool.map.MapStatus', + 'Ssp.model.tool.map.MapStatusCourseDetail', + 'Ssp.model.tool.map.MapStatusSubstitutionDetail', + 'Ssp.model.tool.map.MapStatusTermDetail', + 'Ssp.model.tool.map.TermNote', + 'Ssp.model.tool.map.PlanCourse', + 'Ssp.model.tool.map.PlanOutputData', + 'Ssp.model.tool.shg.SelfHelpGuides', + 'Ssp.model.tool.shg.SelfHelpGuideQuestions', + 'Ssp.model.tool.caseload.CaseloadReassignmentRequest', + 'Ssp.model.reference.AbstractReference', + 'Ssp.model.reference.AdminSelectedIndex', + 'Ssp.model.reference.Challenge', + 'Ssp.model.reference.ChallengeCategory', + 'Ssp.model.reference.ChallengeReferral', + 'Ssp.model.reference.EnrollmentStatus', + 'Ssp.model.reference.CompletedItem', + 'Ssp.model.reference.Text', + 'Ssp.model.reference.JournalTrack', + 'Ssp.model.reference.JournalStep', + 'Ssp.model.reference.JournalStepDetail', + 'Ssp.model.reference.ConfidentialityLevel', + 'Ssp.model.reference.ConfidentialityLevelOption', + 'Ssp.model.reference.ConfidentialityDisclosureAgreement', + 'Ssp.model.reference.EarlyAlertReferral', + 'Ssp.model.external.Course', + 'Ssp.model.external.CourseRequisite', + 'Ssp.model.external.PersonNote', + 'Ssp.model.external.FinancialAidFileStatus', + 'Ssp.model.external.FinancialAidAward', + 'Ssp.model.ApiUrl', + 'Ssp.mixin.ApiProperties', + 'Ssp.mixin.controller.ItemSelectorInitializer', + 'Ssp.util.ResponseDispatcher', + 'Ssp.util.FormRendererUtils', + 'Ssp.util.ColumnRendererUtils', + 'Ssp.util.TreeRendererUtils', + 'Ssp.util.Constants', + 'Ssp.util.Util', + 'Ssp.store.Coaches', + 'Ssp.store.Caseload', + 'Ssp.store.Tasks', + 'Ssp.store.StudentActivities', + 'Ssp.store.Goals', + 'Ssp.store.Strengths', + 'Ssp.store.AddTasks', + 'Ssp.store.SelfHelpGuides', + 'Ssp.store.SelfHelpGuideQuestions', + 'Ssp.store.JournalEntries', + 'Ssp.store.JournalEntriesUnpaged', + 'Ssp.store.JournalEntryDetails', + 'Ssp.store.EarlyAlerts', + 'Ssp.store.StudentDocuments', + 'Ssp.store.reference.AbstractReferences', + 'Ssp.store.admin.AdminTreeMenus', + 'Ssp.store.reference.AnticipatedStartTerms', + 'Ssp.store.reference.Campuses', + 'Ssp.store.reference.CampusEarlyAlertRoutings', + 'Ssp.store.reference.CampusServices', + 'Ssp.store.reference.Challenges', + 'Ssp.store.reference.ChallengeCategories', + 'Ssp.store.reference.ChallengeReferrals', + 'Ssp.store.reference.ChildCareArrangements', + 'Ssp.store.reference.Citizenships', + 'Ssp.store.reference.Colors', + 'Ssp.store.reference.ConfidentialityLevels', + 'Ssp.store.reference.ConfidentialityLevelOptions', + 'Ssp.store.reference.ConfigurationOptions', + 'Ssp.store.reference.DisabilityAccommodations', + 'Ssp.store.reference.DisabilityAgencies', + 'Ssp.store.reference.DisabilityStatuses', + 'Ssp.store.reference.DisabilityTypes', + 'Ssp.store.reference.EarlyAlertOutcomes', + 'Ssp.store.reference.EarlyAlertOutreaches', + 'Ssp.store.reference.EarlyAlertReasons', + 'Ssp.store.reference.EarlyAlertReferrals', + 'Ssp.store.reference.EarlyAlertSuggestions', + 'Ssp.store.reference.EarlyAlertInterventions', //TAPS 20140039 + 'Ssp.store.reference.Electives', + 'Ssp.store.reference.EmploymentShifts', + 'Ssp.store.reference.Ethnicities', + 'Ssp.store.reference.Races', + 'Ssp.store.reference.SapStatuses', + 'Ssp.store.reference.FinancialAidFiles', + 'Ssp.store.reference.FundingSources', + 'Ssp.store.reference.Genders', + 'Ssp.store.reference.JournalSources', + 'Ssp.store.reference.JournalSourcesUnpaged', + 'Ssp.store.reference.JournalSourcesAll', + 'Ssp.store.reference.JournalStepDetails', + 'Ssp.store.reference.JournalSteps', + 'Ssp.store.reference.JournalTracks', + 'Ssp.store.reference.JournalTracksUnpaged', + 'Ssp.store.reference.JournalTracksAll', + 'Ssp.store.reference.Lassis', + 'Ssp.store.reference.MaritalStatuses', + 'Ssp.store.reference.MilitaryAffiliations', + 'Ssp.store.reference.CourseworkHours', + 'Ssp.store.reference.EnrollmentStatuses', + 'Ssp.store.reference.CompletedItem', + 'Ssp.store.reference.Texts', + 'Ssp.store.reference.RegistrationLoads', + 'Ssp.store.reference.CourseworkHours', + 'Ssp.store.reference.MessageTemplates', + 'Ssp.store.OAuth2Clients', + 'Ssp.store.Permissions', + 'Ssp.store.People', + 'Ssp.store.Placement', + 'Ssp.store.reference.RegistrationLoadRanges', + 'Ssp.store.reference.WeeklyCourseWorkHourRanges', + 'Ssp.store.reference.PersonalityTypes', + 'Ssp.store.reference.ProgramStatuses', + 'Ssp.store.reference.ProgramStatusChangeReasons', + 'Ssp.store.reference.ReferralSources', + 'Ssp.store.reference.ServiceReasons', + 'Ssp.store.reference.SpecialServiceGroups', + 'Ssp.store.reference.States', + 'Ssp.store.external.Terms', + 'Ssp.store.external.TermsFaceted', + 'Ssp.store.external.Programs', + 'Ssp.store.external.ProgramsFaceted', + 'Ssp.store.external.Departments', + 'Ssp.store.external.Divisions', + 'Ssp.store.external.CatalogYears', + 'Ssp.store.external.Courses', + 'Ssp.store.external.CourseRequisites', + 'Ssp.store.RegistrationStatusByTerm', + 'Ssp.store.external.PersonNotes', + 'Ssp.store.Students', + 'Ssp.store.SemesterCourses', + 'Ssp.store.Search', + 'Ssp.store.reference.StudentStatuses', + 'Ssp.store.reference.StudentTypes', + 'Ssp.store.reference.Tags', + 'Ssp.store.reference.FacetedTags', + 'Ssp.store.Tools', + 'Ssp.store.reference.VeteranStatuses', + 'Ssp.store.PlanStatus', + 'Ssp.store.MAPStatus', + 'Ssp.store.MapStatusReports', + 'Ssp.store.MapStatusReportCourseDetails', + 'Ssp.store.MapStatusReportSubstitutionDetails', + 'Ssp.store.MapStatusReportTermDetails', + 'Ssp.store.CurrentlyRegistered', + 'Ssp.store.FinancialAidSAPStatus', + 'Ssp.service.AbstractService', + 'Ssp.service.AppointmentService', + 'Ssp.service.AssessmentService', + 'Ssp.service.CaseloadService', + 'Ssp.service.CampusService', + 'Ssp.service.CampusEarlyAlertRoutingService', + 'Ssp.service.ConfidentialityDisclosureAgreementService', + 'Ssp.service.AccommodationService', + 'Ssp.service.EarlyAlertService', + 'Ssp.service.EarlyAlertResponseService', + 'Ssp.service.EarlyAlertReferralService', + 'Ssp.service.JournalEntryService', + 'Ssp.service.PersonService', + 'Ssp.service.PlacementService', + 'Ssp.service.PersonNoteService', + 'Ssp.service.ProgramStatusService', + 'Ssp.service.ReferralSourceService', + 'Ssp.service.SearchService', + 'Ssp.service.SearchChallengeReferralService', + 'Ssp.service.SpecialServiceGroupService', + 'Ssp.service.ServiceReasonsService', + 'Ssp.service.StudentIntakeService', + 'Ssp.service.TranscriptService', + 'Ssp.service.MapPlanService', + 'Ssp.service.CourseService', + 'Ssp.controller.ApplicationEventsController', + 'Ext.tab.*', + 'Ext.util.Filter', + 'Ext.data.TreeStore', + 'Ext.dd.*', + 'Ext.data.Store', + 'Ext.form.field.VTypes', + 'Ext.form.field.Text', + 'Ext.form.field.TextArea', + 'Ext.form.FieldSet', + 'Ext.ux.CheckColumn', + 'Ext.ux.form.MultiSelect', + 'Ext.ux.form.ItemSelector', + 'Ext.util.MixedCollection', + 'Ext.util.TaskRunner', + 'Ext.tree.*', + 'Ext.toolbar.Spacer', + 'Ext.form.field.ComboBox', + 'Ext.grid.column.Action', + 'Ext.grid.feature.Grouping' + +]); + +var apiUrls = [ + {name: 'campus', url: 'reference/campus'}, + {name: 'campusEarlyAlertRouting', url: 'reference/campus/{id}/earlyAlertRouting'}, + {name: 'campusService', url: 'reference/campusService'}, + {name: 'category', url: 'reference/category'}, + {name: 'challenge', url: 'reference/challenge'}, + {name: 'challengeReferral', url: 'reference/challengeReferral'}, + {name: 'challengeReferralSearch', url: 'reference/challengeReferral/search'}, + {name: 'childCareArrangement', url: 'reference/childCareArrangement'}, + {name: 'citizenship', url: 'reference/citizenship'}, + {name: 'color', url: 'reference/color'}, + {name: 'confidentialityDisclosureAgreement', url: 'reference/confidentialityDisclosureAgreement'}, + {name: 'printConfidentialityDisclosureAgreement', url: '/forms/ConfidentialityAgreement.jsp'}, + {name: 'confidentialityLevel', url: 'reference/confidentialityLevel'}, + {name: 'config', url: 'reference/config'}, + {name: 'configuration', url: 'reference/configuration'}, + {name: 'disabilityAccommodation', url: 'reference/disabilityAccommodation'}, + {name: 'accommodationTool', url: 'tool/accommodation'}, + {name: 'disabilityAgency', url: 'reference/disabilityAgency'}, + {name: 'disabilityStatus', url: 'reference/disabilityStatus'}, + {name: 'disabilityType', url: 'reference/disabilityType'}, + {name: 'earlyAlertOutcome', url: 'reference/earlyAlertOutcome'}, + {name: 'earlyAlertOutreach', url: 'reference/earlyAlertOutreach'}, + {name: 'earlyAlertReason', url: 'reference/earlyAlertReason'}, + {name: 'earlyAlertReferral', url: 'reference/earlyAlertReferral'}, + {name: 'earlyAlertSuggestion', url: 'reference/earlyAlertSuggestion'}, + {name: 'earlyAlertIntervention', url: 'reference/earlyAlertIntervention'}, //TAPS 20140039 + {name: 'educationGoal', url: 'reference/educationGoal'}, + {name: 'educationLevel', url: 'reference/educationLevel'}, + {name: 'elective', url: 'reference/elective'}, + {name: 'ethnicity', url: 'reference/ethnicity'}, + {name: 'race', url: 'reference/race'}, + {name: 'sapstatus', url: 'reference/sapstatus'}, + {name: 'financialAidFile', url: 'reference/financialAidFile'}, + {name: 'fundingSource', url: 'reference/fundingSource'}, + {name: 'journalSource', url: 'reference/journalSource'}, + {name: 'journalStep', url: 'reference/journalStep'}, + {name: 'journalTrack', url: 'reference/journalTrack'}, + {name: 'journalStepDetail', url: 'reference/journalStepDetail'}, + {name: 'lassi', url: 'reference/lassi'}, + {name: 'maritalStatus', url: 'reference/maritalStatus'}, + {name: 'militaryAffiliation', url: 'reference/militaryAffiliation'}, + {name: 'enrollmentStatus', url: 'reference/enrollmentStatus'}, + {name: 'completedItem', url: 'reference/completedItem'}, + {name: 'blurb', url: 'blurb'}, + {name: 'registrationLoad', url: 'reference/registrationLoad'}, + {name: 'courseworkHours', url: 'reference/courseworkHours'}, + {name: 'messageTemplate', url: 'reference/messageTemplate'}, + {name: 'studentStatus', url: 'reference/studentStatus'}, + {name: 'veteranStatus', url: 'reference/veteranStatus'}, + {name: 'oauth2Client', url: 'oauth2/client'}, + {name: 'permission', url: 'reference/permission'}, + {name: 'person', url: 'person'}, + {name: 'personAppointment', url: 'person/{id}/appointment'}, + {name: 'personAssessment', url: 'person/{id}/test'}, + {name: 'personCaseload', url: 'person/caseload'}, + {name: 'personCaseloadId', url: 'person/{id}/caseload'}, + {name: 'personMasterCaseload', url: 'person/{id}/caseload'}, + {name: 'personChallenge', url: 'person/{id}/challenge'}, + {name: 'personCoach', url: 'person/coach'}, + {name: 'personCoachCurrent', url: 'person/currentCoachesLite'}, + {name: 'personDocument', url: 'person/{id}/document'}, + {name: 'personRegistrationStatusByTerm', url: 'person/{personId}/registrationStatusByTerm'}, + {name: 'personEarlyAlert', url: 'person/{personId}/earlyAlert'}, + {name: 'personEarlyAlertResponse', url: 'person/{personId}/earlyAlert/{earlyAlertId}/response'}, + {name: 'personGoal', url: 'person/{id}/goal'}, + {name: 'personStrength', url: 'person/{id}/strength'}, + {name: 'personJournalEntry', url: 'person/{id}/journalEntry'}, + {name: 'personTask', url: 'person/{id}/task'}, + {name: 'personTaskGroup', url: 'person/{id}/task/group'}, + {name: 'studentActivities', url: 'person/{id}/studentactivity'}, + {name: 'personalityType', url: 'reference/personalityType'}, + {name: 'personTranscript', url: 'person/{id}/transcript'}, + {name: 'personNote', url: 'person/{id}/note'}, + {name: 'personEmailTask', url: 'person/{id}/task/email'}, + {name: 'personViewHistory', url: 'person/{id}/history/print'}, + {name: 'personPrintTask', url: 'person/{id}/task/print'}, + {name: 'studentSearch', url: 'person/students/search'}, + {name: 'personSearch', url: 'person/search'}, + {name: 'personMapPlan', url: 'person/{id}/map/plan'}, + {name: 'templatePlan', url: 'reference/map/template'}, + {name: 'placement', url: 'person/{id}/test'}, + {name: 'studentDocument', url: 'person/{id}/studentdocument'}, + {name: 'mapStatusReport', url: 'person/{id}/map/statusReport'}, + {name: 'registrationLoadRanges', url: 'reference/config/?name=registration_load_ranges'}, + {name: 'selfHelpGuides', url: 'selfHelpGuides/search'}, + {name: 'selfHelpGuideQuestions', url: 'selfHelpGuides/selfHelpGuideQuestions'}, + {name: 'personProgramStatus', url: 'person/{id}/programStatus'}, + {name: 'programStatus', url: 'reference/programStatus'}, + {name: 'programStatusChangeReason', url: 'reference/programStatusChangeReason'}, + {name: 'referralSource', url: 'reference/referralSource'}, + {name: 'serviceReason', url: 'reference/serviceReason'}, + {name: 'session', url: 'session'}, + {name: 'server', url: 'server'}, + {name: 'serverDateTime', url: 'server/datetime'}, + {name: 'specialServiceGroup', url: 'reference/specialServiceGroup'}, + {name: 'studentIntakeTool', url: 'tool/studentIntake'}, + {name: 'studentType', url: 'reference/studentType'}, + {name: 'terms', url: 'reference/term'}, + {name: 'course', url: 'reference/course'}, + {name: 'courseRequisites', url: 'reference/courserequisites/{id}'}, + {name: 'program', url: 'reference/program/all'}, + {name: 'programfaceted', url: 'reference/program/facet'}, + {name: 'department', url: 'reference/department/all'},//TODO Change to facets. + {name: 'division', url: 'reference/division/all'}, + {name: 'catalogYear', url: 'reference/catalogYear/all'}, + {name: 'tag', url: 'reference/tag'}, + {name: 'facetedtag', url: 'reference/tag/facet'}, + {name: 'futureTerms', url: 'reference/term/future'}, + {name: 'termsfaceted', url: 'reference/term/facet'}, + {name: 'weeklyCourseWorkHourRanges', url: 'reference/config/?name=weekly_course_work_hour_ranges'} +]; + +Ext.onReady(function(){ + + // load the authenticated user + Ext.Ajax.request({ + url: Ssp.mixin.ApiProperties.getBaseApiUrl() + 'session/getAuthenticatedPerson', + method: 'GET', + headers: { 'Accept' : 'application/json','Content-Type': 'application/json' }, + success: function(response){ + var r = Ext.decode(response.responseText); + var user={}; + + if (r != null) + { + // authenticated user + user=r; + + // configure the application + Deft.Injector.configure({ + adminSelectedIndex: { + fn: function(){ + return new Ssp.model.reference.AdminSelectedIndex({}); + }, + singleton: true + }, + sspParentDivId: { + value: sspParentDivId + }, + renderSSPFullScreen: { + value: renderSSPFullScreen + }, + apiUrlStore: { + fn: function(){ + var urlStore = Ext.create('Ext.data.Store', { + model: 'Ssp.model.ApiUrl', + storeId: 'apiUrlStore' + }); + + urlStore.loadData( apiUrls ); + + return urlStore; + }, + singleton: true + }, + sspConfig: { + fn: function(){ + return new Ssp.model.Configuration({}); + }, + singleton: true + }, + currentPerson: { + fn: function(){ + return new Ssp.model.Person({id:""}); + }, + singleton: true + }, + personLite: { + fn: function(){ + return new Ssp.model.PersonLite({id:""}); + }, + singleton: true + }, + contactPerson: { + fn: function(){ + return new Ssp.model.ContactPerson({id:""}); + }, + singleton: true + }, + authenticatedPerson: { + fn: function(){ + var p = new Ssp.model.AuthenticatedPerson(); + p.populateFromGenericObject( user ); + p.setObjectPermissions(); + return p; + }, + singleton: true + }, + preferences: { + fn: function(){ + return new Ssp.model.Preferences(); + }, + singleton: true + }, + itemSelectorInitializer: { + fn: function(){ + return new Ssp.mixin.controller.ItemSelectorInitializer({}); + }, + // Not a singleton b/c this is really intended to work + // more like a mixin on a view component, so needs to + // allowed to maintain state and smaller scopes than + // 'application'. + singleton: false + }, + apiProperties: { + fn: function(){ + return new Ssp.mixin.ApiProperties({}); + }, + singleton: true + }, + formRendererUtils:{ + fn: function(){ + return new Ssp.util.FormRendererUtils({}); + }, + singleton: true + }, + columnRendererUtils:{ + fn: function(){ + return new Ssp.util.ColumnRendererUtils({}); + }, + singleton: true + }, + treeRendererUtils:{ + fn: function(){ + return new Ssp.util.TreeRendererUtils({}); + }, + singleton: true + }, + util:{ + fn: function(){ + return new Ssp.util.Util({}); + }, + singleton: true + }, + appEventsController:{ + fn: function(){ + return new Ssp.controller.ApplicationEventsController({}); + }, + singleton: true + }, + currentAppointment: { + fn: function(){ + return new Ssp.model.Appointment({id:""}); + }, + singleton: true + }, + currentPersonAppointment: { + fn: function(){ + return new Ssp.model.PersonAppointment({id:""}); + }, + singleton: true + }, + currentChallenge:{ + fn: function(){ + return new Ssp.model.reference.Challenge({id:""}); + }, + singleton: true + }, + currentChallengeReferral:{ + fn: function(){ + return new Ssp.model.reference.ChallengeReferral({id:""}); + }, + singleton: true + }, + currentCourse:{ + fn: function(){ + return new Ssp.model.external.Course({id:""}); + }, + singleton: true + }, + currentJournalStep:{ + fn: function(){ + return new Ssp.model.reference.JournalStep({id:""}); + }, + singleton: true + }, + currentStudentDocument: { + fn: function(){ + return new Ssp.model.tool.documents.StudentDocument({id:""}); + }, + singleton: true }, + currentJournalStepDetail:{ + fn: function(){ + return new Ssp.model.reference.JournalStepDetail({id:""}); + }, + singleton: true + }, + currentMapPlan: { + fn: function(){ + return new Ssp.model.tool.map.Plan({id:""}); + }, + singleton: true + }, + currentSemesterStores: { + fn: function(){ + return {}; + }, + singleton: true + }, + currentTask:{ + fn: function(){ + return new Ssp.model.tool.actionplan.Task({id:""}); + }, + singleton: true + }, + + currentGoal:{ + fn: function(){ + return new Ssp.model.PersonGoal({id:""}); + }, + singleton: true + }, + currentStrength:{ + fn: function(){ + return new Ssp.model.PersonStrength({id:""}); + }, + singleton: true + }, + currentStudentIntake: { + fn: function(){ + return new Ssp.model.tool.studentintake.StudentIntakeForm(); + }, + singleton: true + }, + currentAccommodation: { + fn: function(){ + return new Ssp.model.tool.accommodation.AccommodationForm(); + }, + singleton: true + }, + currentJournalEntry:{ + fn: function(){ + return new Ssp.model.tool.journal.JournalEntry({id:""}); + }, + singleton: true + }, + currentEarlyAlert:{ + fn: function(){ + return new Ssp.model.tool.earlyalert.PersonEarlyAlert({id:""}); + }, + singleton: true + }, + currentEarlyAlertResponse:{ + fn: function(){ + return new Ssp.model.tool.earlyalert.EarlyAlertResponse({id:""}); + }, + singleton: true + }, + currentEarlyAlertResponsesGridStore: { + fn: function() { + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.tool.earlyalert.EarlyAlertResponseGrid', + storeId: 'currentEarlyAlertResponsesGridStore' + }); + }, + singleton: true + }, + currentDocument:{ + fn: function(){ + return new Ssp.model.tool.documents.StudentDocument({id:""}); + }, + singleton: true + }, + currentCampus:{ + fn: function(){ + return new Ssp.model.reference.Campus({id:""}); + }, + singleton: true + }, + currentCampusEarlyAlertRouting:{ + fn: function(){ + return new Ssp.model.reference.CampusEarlyAlertRouting({id:""}); + }, + singleton: true + }, + currentSelfHelpGuide:{ + fn: function(){ + return new Ssp.model.tool.shg.SelfHelpGuides({id:""}); + }, + singleton: true + }, + currentSelfHelpGuideQuestions:{ + fn: function(){ + return new Ssp.model.tool.shg.SelfHelpGuideQuestions({id:""}); + }, + singleton: true + }, + courseTranscriptsStore: { + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.CourseTranscript' + }); + }, + singleton: true + }, + mapStatusReportStore: { + fn: function(){ + return Ext.create('Ssp.store.MapStatusReports'); + }, + singleton: true + }, + mapStatusReportCourseDetailsStore: { + fn: function(){ + return Ext.create('Ssp.store.MapStatusReportCourseDetails'); + }, + singleton: true + }, + mapStatusReportTermDetailsStore: { + fn: function(){ + return Ext.create('Ssp.store.MapStatusReportTermDetails'); + }, + singleton: true + }, + personRegistrationStatusByTermStore: { + fn: function(){ + return Ext.create('Ssp.store.RegistrationStatusByTerm'); + }, + singleton: true + }, + mapStatusReportSubstitutionDetailsStore: { + fn: function(){ + return Ext.create('Ssp.store.MapStatusReportSubstitutionDetails'); + }, + singleton: true + }, + currentScheduleStore: { + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.CourseTranscript' + }); + }, + singleton: true + }, + currentDroppedScheduleStore:{ + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.CourseTranscript' + }); + }, + singleton: true + }, + + termTranscriptsStore: { + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.TermTranscript' + }); + }, + singleton: true + }, + treeStore:{ + fn: function(){ + return Ext.create('Ext.data.TreeStore',{ + root: { + text: 'root', + expanded: true, + children: [] + } + }); + }, + singleton: true + }, + earlyAlertsTreeStore:{ + fn: function(){ + return Ext.create('Ext.data.TreeStore',{ + model: 'Ssp.model.tool.earlyalert.PersonEarlyAlertTree' + }); + }, + + singleton: true + }, + earlyAlertDetailsSuggestionsStore: { + fn: function(){ + return Ext.create('Ext.data.Store', { + model: 'Ssp.model.SimpleItemDisplay', + storeId: 'earlyAlertDetailsSuggestionsStore' + }); + }, + singleton: true + }, //TAPS 20140039 earlyAlertDetailsInterventionsStore BEGIN + earlyAlertDetailsInterventionsStore: { + fn: function(){ + return Ext.create('Ext.data.Store', { + model: 'Ssp.model.SimpleItemDisplay', + storeId: 'earlyAlertDetailsInterventionsStore' + }); + }, + singleton: true + }, //TAPS 20140039 earlyAlertDetailsInterventionsStore END + earlyAlertDetailsReasonsStore: { + fn: function(){ + return Ext.create('Ext.data.Store', { + model: 'Ssp.model.SimpleItemDisplay', + storeId: 'earlyAlertDetailsReasonsStore', + sorters: [{property: 'name'}] + }); + }, + singleton: true + }, + earlyAlertResponseDetailsOutreachesStore: { + fn: function(){ + return Ext.create('Ext.data.Store', { + model: 'Ssp.model.SimpleItemDisplay', + storeId: 'earlyAlertResponseDetailsOutreachesStore' + }); + }, + singleton: true + }, + earlyAlertResponseDetailsReferralsStore: { + fn: function(){ + return Ext.create('Ext.data.Store', { + model: 'Ssp.model.SimpleItemDisplay', + storeId: 'earlyAlertResponseDetailsReferralsStore' + }); + }, + singleton: true + }, + profileSpecialServiceGroupsStore:{ + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.reference.SpecialServiceGroup', + filterOnLoad: true, + filters: [{property:"objectStatus", value:'ACTIVE'}], + sorters: [{ + property: 'name', + direction: 'ASC' + }] + }); + }, + singleton: true + }, + profileReferralSourcesStore:{ + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.reference.ReferralSource', + filterOnLoad: true, + filters: [{property:"objectStatus", value:'ACTIVE'}], + sorters: [{ + property: 'name', + direction: 'ASC' + }] + }); + }, + singleton: true + }, + profileServiceReasonsStore:{ + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.reference.ServiceReason', + filterOnLoad: true, + filters: [{property:"objectStatus", value:'ACTIVE'}], + sorters: [{ + property: 'name', + direction: 'ASC' + }] + }); + }, + singleton: true + }, + errorsStore:{ + fn: function(){ + return Ext.create('Ext.data.Store',{ + model: 'Ssp.model.FieldError' + }); + }, + singleton: true + }, + searchCriteria: { + fn: function(){ + return new Ssp.model.SearchCriteria(); + }, + singleton: true + }, + caseloadFilterCriteria: { + fn: function(){ + return new Ssp.model.CaseloadFilterCriteria(); + }, + singleton: true + }, + currentMessageTemplate:{ + fn: function(){ + return new Ssp.model.MessageTemplates({id:""}); + }, + singleton: true + }, + addTasksStore:{ + fn: function(){ + return new Ssp.store.AddTasks(); + }, + singleton: true + }, + // STORES + abstractReferencesStore: 'Ssp.store.reference.AbstractReferences', + adminTreeMenusStore: 'Ssp.store.admin.AdminTreeMenus', + anticipatedStartTermsStore: 'Ssp.store.reference.AnticipatedStartTerms', + campusesStore: 'Ssp.store.reference.Campuses', + campusesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Campuses', { + storeId: 'campusesAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + campusesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Campuses', { + storeId: 'campusesAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + campusEarlyAlertRoutingsStore: 'Ssp.store.reference.CampusEarlyAlertRoutings', + campusServicesStore: 'Ssp.store.reference.CampusServices', + caseloadStore: 'Ssp.store.Caseload', + reassignCaseloadStagingStore: 'Ssp.store.Caseload', + reassignCaseloadStore: 'Ssp.store.Caseload', + contactPersonStore: 'Ssp.store.ContactPerson', + challengesStore: 'Ssp.store.reference.Challenges', + challengesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Challenges', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + challengesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Challenges', { + extraParams: {limit: "-1"} + }); + }, + singleton: true + }, + challengeCategoriesStore: 'Ssp.store.reference.ChallengeCategories', + challengeReferralsStore: 'Ssp.store.reference.ChallengeReferrals', + challengeReferralsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ChallengeReferrals', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + childCareArrangementsStore: 'Ssp.store.reference.ChildCareArrangements', + childCareArrangementsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ChildCareArrangements', { + storeId: 'childCareArrangementsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + citizenshipsStore: 'Ssp.store.reference.Citizenships', + citizenshipsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Citizenships', { + storeId: 'citizenshipsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + coachesStore: 'Ssp.store.Coaches', + allCoachesStore: 'Ssp.store.CoachesAll', + allCoachesCurrentStore: 'Ssp.store.CoachesAllCurrent', + confidentialityDisclosureAgreementsStore: 'Ssp.store.reference.ConfidentialityDisclosureAgreements', + configurationOptionsStore: 'Ssp.store.reference.ConfigurationOptions', + configurationOptionsUnpagedStore: + { + fn: function(){ + return Ext.create('Ssp.store.reference.ConfigurationOptionsUnpaged', { + storeId: 'configurationOptionsUnpagedStore', + extraParams: {limit: "-1"} + }); + }, + singleton: true + }, + colorsStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Colors', { + storeId: 'colorsStore' + }); + }, + singleton: true + }, + colorsUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Colors', { + storeId: 'colorsUnpagedStore', + extraParams: {limit: "-1"} + }); + }, + singleton: true + }, + colorsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Colors', { + storeId: 'colorsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + colorsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Colors', { + storeId: 'colorsAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + confidentialityLevelOptionsStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ConfidentialityLevelOptions', { + storeId: 'confidentialityLevelOptionsStore' + }); + }, + singleton: true + }, + confidentialityLevelsStore: 'Ssp.store.reference.ConfidentialityLevels', + confidentialityLevelsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ConfidentialityLevels', { + storeId: 'confidentialityLevelsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + confidentialityLevelsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ConfidentialityLevels', { + storeId: 'confidentialityLevelsAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + + //disabilityAccommodationsStore: 'Ssp.store.reference.DisabilityAccommodations', + disabilityAccommodationsStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.DisabilityAccommodations', {}); + }, + singleton: true + }, + disabilityAccommodationsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.DisabilityAccommodations', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + disabilityAgenciesStore: 'Ssp.store.reference.DisabilityAgencies', + disabilityAgenciesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.DisabilityAgencies', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + disabilityStatusesStore: 'Ssp.store.reference.DisabilityStatuses', + disabilityStatusesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.DisabilityStatuses', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + disabilityTypesStore: 'Ssp.store.reference.DisabilityTypes', + disabilityTypesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.DisabilityTypes', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertOutcomesStore: 'Ssp.store.reference.EarlyAlertOutcomes', + earlyAlertOutcomesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertOutcomes', { + storeId: 'earlyAlertOutcomesAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertOutcomesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertOutcomes', { + storeId: 'earlyAlertOutcomesAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + earlyAlertOutreachesStore: 'Ssp.store.reference.EarlyAlertOutreaches', + earlyAlertOutreachesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertOutreaches', { + storeId: 'earlyAlertOutreachesAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertOutreachesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertOutreaches', { + storeId: 'earlyAlertOutreachesAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + earlyAlertReasonsStore: 'Ssp.store.reference.EarlyAlertReasons', + earlyAlertReasonsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertReasons', { + storeId: 'earlyAlertReasonsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertReasonsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertReasons', { + storeId: 'earlyAlertReasonsAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + earlyAlertReferralsStore: 'Ssp.store.reference.EarlyAlertReferrals', + earlyAlertReferralsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertReferrals', { + storeId: 'earlyAlertReferralsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertReferralsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertReferrals', { + storeId: 'earlyAlertReferralsAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + earlyAlertReferralsBindStore: 'Ssp.store.reference.EarlyAlertReferralsBind', + earlyAlertsStore: 'Ssp.store.EarlyAlerts', + earlyAlertSuggestionsStore: 'Ssp.store.reference.EarlyAlertSuggestions', + earlyAlertSuggestionsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertSuggestions', { + storeId: 'earlyAlertSuggestionsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertSuggestionsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertSuggestions', { + storeId: 'earlyAlertSuggestionsAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, //TAPS 20140039 earlyAlertInterventionsStore/earlyAlertInterventionsAllUnpagedStore BEGIN + earlyAlertInterventionsStore: 'Ssp.store.reference.EarlyAlertInterventions', + earlyAlertInterventionsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertInterventions', { + storeId: 'earlyAlertInterventionsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + earlyAlertInterventionsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EarlyAlertInterventions', { + storeId: 'earlyAlertInterventionsAllUnpagedStore', + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, //TAPS 20140039 earlyAlertInterventionsStore/earlyAlertInterventionsAllUnpagedStore END + educationGoalsStore: 'Ssp.store.reference.EducationGoals', + educationGoalsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EducationGoals', { + storeId: 'educationGoalsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + educationLevelsStore: 'Ssp.store.reference.EducationLevels', + educationLevelsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.EducationLevels', { + storeId: 'educationLevelsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + electivesStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Electives', { + storeId: 'electivesStore', + extraParams: {sort: "sortOrder", sortDirection: "ASC" } + }); + }, + singleton: true + }, + electivesUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Electives', { + storeId: 'electivesUnpagedStore', + extraParams: {sort: "sortOrder", sortDirection: "ASC", limit: "-1"} + }); + }, + singleton: true + }, + electivesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Electives', { + storeId: 'electivsAllStore', + extraParams: {sort: "sortOrder", sortDirection: "ASC", status: "ALL"} + }); + }, + singleton: true + }, + electivesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Electives', { + storeId: 'electivsAllUnpagedStore', + extraParams: {sort: "sortOrder", sortDirection: "ASC", status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + + planTemplatesSummaryStore: { + fn: function(){ + return Ext.create('Ssp.store.PlanTemplatesSummary', { + storeId: 'planTemplatesSummaryStore', + extraParams: {sort: "name", sortDirection: "ASC", status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + employmentShiftsStore: 'Ssp.store.reference.EmploymentShifts', + ethnicitiesStore: 'Ssp.store.reference.Ethnicities', + ethnicitiesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Ethnicities', { + storeId: 'ethnicitiesAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + racesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Races', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + racesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.Races', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + sapStatusesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.SapStatuses', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + sapStatusesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.SapStatuses', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + sapStatusesActiveUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.SapStatuses', { + extraParams: {status: "ACTIVE", limit: "-1"} + }); + }, + singleton: true + }, + financialAidFilesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.FinancialAidFiles', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + financialAidFilesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.FinancialAidFiles', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + fundingSourcesStore: 'Ssp.store.reference.FundingSources', + fundingSourcesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.FundingSources', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + gendersStore: 'Ssp.store.reference.Genders', + goalsStore: 'Ssp.store.Goals', + strengthsStore: 'Ssp.store.Strengths', + // addTasksStore: 'Ssp.store.AddTasks', + journalEntriesStore: 'Ssp.store.JournalEntries', + journalEntriesUnpagedStore: 'Ssp.store.JournalEntriesUnpaged', + journalEntryDetailsStore: 'Ssp.store.JournalEntryDetails', + journalSourcesStore: 'Ssp.store.reference.JournalSources', + journalSourcesUnpagedStore: 'Ssp.store.reference.JournalSourcesUnpaged', + journalSourcesAllStore: 'Ssp.store.reference.JournalSourcesAll', + journalSourcesAllUnpagedStore: 'Ssp.store.reference.JournalSourcesAllUnpaged', + journalStepsStore: 'Ssp.store.reference.JournalSteps', + journalStepsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.JournalSteps', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + journalDetailsStore: 'Ssp.store.reference.JournalStepDetails', + journalDetailsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.JournalStepDetails', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + journalTracksStore: 'Ssp.store.reference.JournalTracks', + journalTracksUnpagedStore: 'Ssp.store.reference.JournalTracksUnpaged', + journalTracksAllStore: 'Ssp.store.reference.JournalTracksAll', + journalTracksAllUnpagedStore: 'Ssp.store.reference.JournalTracksAllUnpaged', + lassisStore: 'Ssp.store.reference.Lassis', + maritalStatusesStore: 'Ssp.store.reference.MaritalStatuses', + maritalStatusesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.MaritalStatuses', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + militaryAffiliationsStore: 'Ssp.store.reference.MilitaryAffiliations', + militaryAffiliationsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.MilitaryAffiliations', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + registrationLoadsStore: 'Ssp.store.reference.RegistrationLoads', + registrationLoadsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.RegistrationLoads', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + courseworkHoursStore: 'Ssp.store.reference.CourseworkHours', + courseworkHoursAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.CourseworkHours', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + enrollmentStatusesStore: 'Ssp.store.reference.EnrollmentStatuses', + completedItemStore: + { + fn: function(){ + return Ext.create('Ssp.store.reference.CompletedItem', { + storeId: 'completedItemStore', + extraParams: {status: "ALL", limit: -1, start: null} + }); + }, + singleton: true + }, + textStore: + { + fn: function(){ + return Ext.create('Ssp.store.reference.Texts', { + storeId: 'textStore', + extraParams: {status: "ALL", limit: -1, start: null} + }); + }, + singleton: true + }, + sspTextStore: + { + fn: function(){ + return Ext.create('Ssp.store.reference.Texts', { + storeId: 'sspTextStore', + extraParams: {status: "ALL", limit: -1, start: null} + }); + }, + singleton: true + }, + messageTemplatesStore: 'Ssp.store.reference.MessageTemplates', + personalityTypesStore: 'Ssp.store.reference.PersonalityTypes', + placementStore: 'Ssp.store.Placement', + planStore: 'Ssp.store.Plan', + programStatusesStore: 'Ssp.store.reference.ProgramStatuses', + programStatusChangeReasonsStore: 'Ssp.store.reference.ProgramStatusChangeReasons', + programStatusChangeReasonsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ProgramStatusChangeReasons', { + storeId: 'programStatusChangeReasonsAllStore', + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + referralSourcesStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ReferralSources', { }); + }, + singleton: true + }, + referralSourcesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ReferralSources', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + referralSourcesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ReferralSources', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + searchStore: 'Ssp.store.Search', + studentsSearchStore: 'Ssp.store.StudentsSearch', + searchChallengeReferralStore: 'Ssp.store.SearchChallengeReferral', + selfHelpGuidesStore: 'Ssp.store.SelfHelpGuides', + selfHelpGuideQuestionsStore: 'Ssp.store.SelfHelpGuideQuestions', + serviceReasonsStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ServiceReasons', { + }); + }, + singleton: true + }, + serviceReasonsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ServiceReasons', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + serviceReasonsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.ServiceReasons', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + specialServiceGroupsStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.SpecialServiceGroups', { }); + }, + singleton: true + }, + specialServiceGroupsAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.SpecialServiceGroups', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + specialServiceGroupsAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.SpecialServiceGroups', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + statesStore: 'Ssp.store.reference.States', + studentDocumentsStore: 'Ssp.store.StudentDocuments', + studentsStore: 'Ssp.store.Students', + studentStatusesStore: 'Ssp.store.reference.StudentStatuses', + studentStatusesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.StudentStatuses', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + studentTypesStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.StudentTypes', {}); + }, + singleton: true + }, + studentTypesAllUnpagedStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.StudentTypes', { + extraParams: {status: "ALL", limit: "-1"} + }); + }, + singleton: true + }, + registrationLoadRangesStore: 'Ssp.store.reference.RegistrationLoadRanges', + weeklyCourseWorkHourRangesStore: 'Ssp.store.reference.WeeklyCourseWorkHourRanges', + termsStore:'Ssp.store.external.Terms', + termsFacetedStore:'Ssp.store.external.TermsFaceted', + programsStore:'Ssp.store.external.Programs', + programsFacetedStore:'Ssp.store.external.ProgramsFaceted', + divisionsStore:'Ssp.store.external.Divisions', + catalogYearsStore:'Ssp.store.external.CatalogYears', + personNotesStore:'Ssp.store.external.PersonNotes', + departmentsStore:'Ssp.store.external.Departments', + coursesStore:'Ssp.store.external.Courses', + tagsStore: 'Ssp.store.reference.Tags', + facetedTagsStore: 'Ssp.store.reference.FacetedTags', + tasksStore: 'Ssp.store.Tasks', + studentActivitiesStore: 'Ssp.store.StudentActivities', + toolsStore: 'Ssp.store.Tools', + veteranStatusesStore: 'Ssp.store.reference.VeteranStatuses', + veteranStatusesAllStore: { + fn: function(){ + return Ext.create('Ssp.store.reference.VeteranStatuses', { + extraParams: {status: "ALL"} + }); + }, + singleton: true + }, + planStatusStore: 'Ssp.store.PlanStatus', + financialAidSAPStatus: 'Ssp.store.FinancialAidSAPStatus', + mapStatusStore: 'Ssp.store.MAPStatus', + earlyAlertResponseLateStore: 'Ssp.store.EarlyAlertResponseLate', + currentlyRegisteredStore: 'Ssp.store.CurrentlyRegistered', + oauth2ClientsStore: 'Ssp.store.OAuth2Clients', + permissionsStore: 'Ssp.store.Permissions', + + + + // SERVICES + appointmentService: 'Ssp.service.AppointmentService', + assessmentService: 'Ssp.service.AssessmentService', + campusService: 'Ssp.service.CampusService', + campusEarlyAlertRoutingService: 'Ssp.service.CampusEarlyAlertRoutingService', + caseloadService: 'Ssp.service.CaseloadService', + confidentialityDisclosureAgreementService: 'Ssp.service.ConfidentialityDisclosureAgreementService', + accommodationService: 'Ssp.service.AccommodationService', + earlyAlertService: 'Ssp.service.EarlyAlertService', + earlyAlertReferralService: 'Ssp.service.EarlyAlertReferralService', + earlyAlertResponseService: 'Ssp.service.EarlyAlertResponseService', + journalEntryService: 'Ssp.service.JournalEntryService', + personService: 'Ssp.service.PersonService', + placementService: 'Ssp.service.PlacementService', + personNoteService: 'Ssp.service.PersonNoteService', + personProgramStatusService: 'Ssp.service.PersonProgramStatusService', + programStatusService: 'Ssp.service.ProgramStatusService', + referralSourceService: 'Ssp.service.ReferralSourceService', + searchService: 'Ssp.service.SearchService', + searchChallengeReferralService: 'Ssp.service.SearchChallengeReferralService', + specialServiceGroupService: 'Ssp.service.SpecialServiceGroupService', + serviceReasonsService: 'Ssp.service.ServiceReasonsService', + studentIntakeService: 'Ssp.service.StudentIntakeService', + transcriptService: 'Ssp.service.TranscriptService', + mapPlanService: 'Ssp.service.MapPlanService', + studentActivityService: 'Ssp.service.StudentActivityService', + courseService: 'Ssp.service.CourseService' + }); + + + // Do not use 'autoCreateViewport: true' here. It will trigger + // initialization of the Deft IoC container before the + // Application exists, so some managed components may be only + // partially initialized. This is particularly problematic for + // AppEventsController which needs a reference to the + // Application. If it does not have that reference, the first + // components to load (those associated with Viewport) cannot + // register Application-scoped events during their + // initialization. The resulting deferred event listener + // binding has been the direct cause of subtle bugs. + Ext.application({ + name: 'Ssp', + appFolder: Ext.Loader.getPath('Ssp'), + launch: function( app ) { + var me=this; + Deft.Injector.resolve("appEventsController").setApp(me); + + // Date patterns for formatting by a description + // rather than a date format + Ext.Date.patterns = { + ISO8601Long:"Y-m-d H:i:s", + ISO8601Short:"Y-m-d", + ShortDate: "n/j/Y", + LongDate: "l, F d, Y", + FullDateTime: "l, F d, Y g:i:s A", + MonthDay: "F d", + ShortTime: "g:i A", + LongTime: "g:i:s A", + SortableDateTime: "Y-m-d\\TH:i:s", + UniversalSortableDateTime: "Y-m-d H:i:sO", + YearMonth: "F, Y" + }; + + // Global error handling for Ajax calls + Ext.override(Ext.data.proxy.Server, { + simpleSortMode: true, + constructor: function(config) + { + this.callOverridden([config]); + this.addListener("exception", function (proxy, response, operation) { + if (response.status==403) + { + Ext.Msg.confirm({ + title:'Access Denied Error', + msg: "It looks like you are trying to access restricted information or your login session has expired. Would you like to login to continue working in RiverSupport?", + buttons: Ext.Msg.YESNO, + fn: function( btnId ){ + if (btnId=="yes") + { + // force a login + window.location.reload(); + }else{ + // force a login + window.location.reload(); + } + }, + scope: me + }); + } + + // Handle call not found result + if (response.status==404) + { + Ext.Msg.alert('RiverSupport Error', '404 Server Error. See logs for additional details'); + } + }); + } + }); + + /* + * Provide global asterisks next to required fields + */ + Ext.Function.interceptAfter(Ext.form.Field.prototype,'initComponent', function(){ + var fl=this.fieldLabel, ab=this.allowBlank; + if (fl){ + this.labelStyle=Ssp.util.Constants.SSP_LABEL_STYLE; + } + if (ab===false && fl){ + this.fieldLabel += Ssp.util.Constants.REQUIRED_ASTERISK_DISPLAY; + } + }); + + /* + * Provide global asterisks next to required field containers + */ + Ext.Function.interceptAfter(Ext.form.FieldContainer.prototype,'initComponent', function(){ + var fl=this.fieldLabel, ab=this.allowBlank; + if (fl){ + this.labelStyle=Ssp.util.Constants.SSP_LABEL_STYLE; + } + if (ab===false && fl){ + this.fieldLabel += Ssp.util.Constants.REQUIRED_ASTERISK_DISPLAY; + } + }); + + /* + * Per Animal, http://www.extjs.com/forum/showthread.php?p=450116#post450116 + * Override to provide a function to determine the invalid + * fields in a form. + */ + Ext.override(Ext.form.BasicForm, { + findInvalid: function() { + var result = [], it = this.getFields().items, l = it.length, i, f; + for (i = 0; i < l; i++) { + if(!(f = it[i]).disabled && f.isValid()){ + result.push(f); + } + } + return result; + } + }); + + /* + * Per Animal, http://www.extjs.com/forum/showthread.php?p=450116#post450116 + * Override component so that the first invalid field + * will be displayed for the user when a form is invalid. + */ + Ext.override(Ext.Component, { + ensureVisible: function(stopAt) { + var p; + this.ownerCt.bubble(function(c) { + if (p = c.ownerCt) { + if (p instanceof Ext.TabPanel) { + p.setActiveTab(c); + } else if (p.layout.setActiveItem) { + p.layout.setActiveItem(c); + } else if (p.layout.type == 'accordion'){ + c.expand(); + } + } + return (c !== stopAt); + }); + //this.el.scrollIntoView(this.el.up(':scrollable')); + return this; + } + }); + + //http://stackoverflow.com/questions/9704913/confirm-password-validator-extjs-4 + Ext.apply(Ext.form.field.VTypes,{ + passwordConfirm : function(val, field) { + if (field.initialPassField) { + var pwd = Ext.getCmp(field.initialPassField); + return (val === pwd.getValue()); + } + return true; + }, + passwordConfirmText : 'Passwords/secrets do not match' + }); + + Ext.apply(Ext.form.field.VTypes,{ + multiemail: function(val, field) { + Ext.form.field.VTypes.multiemailInvalidPositions = []; + if(val && val.length > 0){ + var emailAddresses = val.split(','); + var valid = true; + var i = 0; + Ext.Array.each( emailAddresses, function(emailAddress, index){ + // if it is a string and it contains something other than whitespace + if(emailAddress && !(/^\s*$/).test(emailAddress)){ + if(!Ext.form.field.VTypes.email(emailAddress.trim())){ + valid = false; + Ext.form.field.VTypes.multiemailInvalidPositions[i] = index; + } + } + i++; + }); + return valid; + } + return true; + }, + multiemailInvalidPositions: [], + multiemailText: function(){return 'Email(s) at position(s) ' + Ext.form.field.VTypes.multiemailInvalidPositions.join(",") + "are invalid"}, + multiemailMask: /[a-z0-9_.-@,\s]/i + + }); + + /* + * Per Animal, http://www.extjs.com/forum/showthread.php?p=450116#post450116 + * Enables scrolling to the nearest visible elements + * in a form for use with the above override for + * visually indicating when a form validation fails + * and setting the user to see the first invalid field. + Ext.DomQuery.pseudos.scrollable = function(c, t) { + var r = [], ri = -1; + for(var i = 0, ci; ci = c[i]; i++){ + var o = ci.style.overflow; + if(o=='auto'||o=='scroll') { + if (ci.scrollHeight < Ext.fly(ci).getHeight(true)) r[++ri] = ci; + } + } + return r; + }; + */ + + // load the main view + Ext.apply(me,{ + items: [{xtype:'sspview'}] + }); + + // Since we're not using 'autoCreateViewport: true', + // we need to create the default view ourselves. + // (Frankly not sure exactly what the relationship is + // between this and the xtype-based lookup of the same + // component type immediately above. But you'll get + // a blank screen without this explicit create. + Ext.create( "Ssp.view.Viewport"); + + } + }); + + }else{ + Ext.Msg.alert('Error','Unable to determine authenticated user. Please see your system administrator for assistance.'); + } + } + }, this); + +}); \ No newline at end of file diff --git a/src/main/webapp/app/controller/AdminViewController.js b/src/main/webapp/app/controller/AdminViewController.js index 3f8abe3420..cd02eb8d96 100644 --- a/src/main/webapp/app/controller/AdminViewController.js +++ b/src/main/webapp/app/controller/AdminViewController.js @@ -1,197 +1,198 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.controller.AdminViewController', { - extend: 'Deft.mvc.ViewController', - mixins: [ 'Deft.mixin.Injectable' ], - inject: { - campusesStore: 'campusesStore', - campusServicesStore: 'campusServicesStore', - challengeCategoriesAllStore: 'challengeCategoriesAllStore', - challengesStore: 'challengesStore', - challengeReferralsStore: 'challengeReferralsStore', - childCareArrangementsAllStore: 'childCareArrangementsAllStore', - citizenshipsAllStore: 'citizenshipsAllStore', - colorsStore: 'colorsStore', - colorsUnpagedStore: 'colorsUnpagedStore', - colorsAllStore: 'colorsAllStore', - colorsAllUnpagedStore: 'colorsAllUnpagedStore', - confidentialityLevelsAllStore: 'confidentialityLevelsAllStore', - confidentialityLevelOptionsStore: 'confidentialityLevelOptionsStore', - disabilityAccommodationsAllStore: 'disabilityAccommodationsAllStore', - disabilityAgenciesAllStore: 'disabilityAgenciesAllStore', - disabilityStatusesAllStore: 'disabilityStatusesAllStore', - disabilityTypesAllStore: 'disabilityTypesAllStore', - earlyAlertOutcomesAllStore: 'earlyAlertOutcomesAllStore', - earlyAlertOutreachesAllStore: 'earlyAlertOutreachesAllStore', - earlyAlertReasonsAllStore: 'earlyAlertReasonsAllStore', - earlyAlertReferralsAllStore: 'earlyAlertReferralsAllStore', - earlyAlertSuggestionsAllStore: 'earlyAlertSuggestionsAllStore', - educationGoalsAllStore: 'educationGoalsAllStore', - educationLevelsAllStore: 'educationLevelsAllStore', - electiveStore: 'electivesStore', - electivesAllStore: 'electivesAllStore', - employmentShiftsStore: 'employmentShiftsStore', - ethnicitiesAllStore: 'ethnicitiesAllStore', - racesAllStore: 'racesAllStore', - sapStatusesAllStore: 'sapStatusesAllStore', - financialAidFilesAllStore: 'financialAidFilesAllStore', - formUtils: 'formRendererUtils', - fundingSourcesAllStore: 'fundingSourcesAllStore', - gendersStore: 'gendersStore', - journalSourcesAllStore: 'journalSourcesAllStore', - journalStepsStore: 'journalStepsStore', - journalTracksAllStore: 'journalTracksAllStore', - lassisStore: 'lassisStore', - maritalStatusesAllStore: 'maritalStatusesAllStore', - militaryAffiliationsAllStore: 'militaryAffiliationsAllStore', - courseworkHoursAllStore: 'courseworkHoursAllStore', - enrollmentStatusesStore: 'enrollmentStatusesStore', - completedItemStore: 'completedItemStore', - registrationLoadsAllStore: 'registrationLoadsAllStore', - personalityTypesStore: 'personalityTypesStore', - programStatusChangeReasonsAllStore: 'programStatusChangeReasonsAllStore', - referralSourcesAllStore: 'referralSourcesAllStore', - serviceReasonsAllStore: 'serviceReasonsAllStore', - specialServiceGroupsAllStore: 'specialServiceGroupsAllStore', - statesStore: 'statesStore', - studentStatusesAllStore: 'studentStatusesAllStore', - studentTypesStore: 'studentTypesAllStore', - tagsStore: 'tagsStore', - textStore: 'textStore', - veteranStatusesAllStore: 'veteranStatusesAllStore' - }, - - control: { - view: { - itemclick: 'onItemClick' - } - - }, - - init: function() { - var me = this; - me.confidentialityLevelOptionsStore.load(); - return this.callParent(arguments); - }, - - /* - * Handle selecting an item in the tree grid - */ - onItemClick: function(view,record,item,index,eventObj) { - var storeName = ""; - var columns = null; - - if (record.raw != undefined ) - { - if ( record.raw.form != "") - { - if (record.raw.store != "") - { - storeName = record.raw.store; - } - if (record.raw.columns != null) - { - columns = record.raw.columns; - } - var options = { - interfaceOptions: record.raw.interfaceOptions, - viewConfig: record.raw.viewConfig, - sort: record.raw.sort - } - this.loadAdmin( record.raw.title, record.raw.form, storeName, columns, options); - } - } - }, - - // Just to avoid creating needless closures - noOp: function() {}, - - loadAdmin: function( title ,form, storeName, columns, options ) { - var me=this; - var comp = this.formUtils.loadDisplay('adminforms',form, true, options); - var store = null; - - if (Ext.isFunction(comp.setTitle)) - comp.setTitle(title + ' Admin'); - - // set a store if defined - if (storeName != "") - { - store = me[storeName+'Store']; - // If the store was set, then modify - // the component to use the store - if (store != null) - { - // pass the columns for editing - if(store.sorters){ - store.sorters.clear(); - } - //TODO currentPage for store is reset to 1 since sorting is client side. - store.currentPage=1; - if (columns != null) - { - // comp.reconfigure(store, columns); // ,columns - me.formUtils.reconfigureGridPanel(comp, store, columns); - }else{ - // comp.reconfigure(store); - me.formUtils.reconfigureGridPanel(comp, store); - } - } - - if ( options.interfaceOptions && options.interfaceOptions.storeDependencies ) { - - var responseDispatcherConfig = { - remainingOpNames: [], - afterLastOp: { - callback: Ext.pass(me.afterStoreDependenciesLoaded, [title ,form, storeName, columns, options, comp, store], me), - callbackScope: me - } - } - Ext.each(options.interfaceOptions.storeDependencies, function(storeDependency) { - responseDispatcherConfig.remainingOpNames.push(storeDependency.name); - }); - var responseDispatcher = Ext.create('Ssp.util.ResponseDispatcher', responseDispatcherConfig); - - Ext.each(options.interfaceOptions.storeDependencies, function(storeDependency) { - if ( storeDependency.clearFilter ) { - storeDependency.store.clearFilter(); - } - storeDependency.store.load(responseDispatcher.setSuccessCallback(storeDependency.name, me.noOp, me)); - }); - - } else { - me.afterStoreDependenciesLoaded(title ,form, storeName, columns, options, comp, store); - } - } - }, - - afterStoreDependenciesLoaded: function(title ,form, storeName, columns, options, comp, store) { - var me = this; - if ( store ) { // store (not comp.getStore()) existence check to preserve legacy behavior, maybe to let reconfigureGridPanel() change the store? - // unlike with options.interfaceOptions.storeDependencies handling, - // no clearFilter() here to preserve legacy behavior - comp.getStore().load(function() { // load() is on comp.getStore() not store, again to preserve legacy - if(options.sort != null && options.sort != undefined) { - var sort = options.sort - comp.getStore().sort(sort.field, (sort.direction != null && sort.direction != undefined) ? sort.direction : "ASC"); - } - }); - } - } +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039 - Add earlyAlertInterventionsAllStore data store to AdminViewController + */ +Ext.define('Ssp.controller.AdminViewController', { + extend: 'Deft.mvc.ViewController', + mixins: [ 'Deft.mixin.Injectable' ], + inject: { + campusesStore: 'campusesStore', + campusServicesStore: 'campusServicesStore', + challengeCategoriesStore: 'challengeCategoriesStore', + challengesStore: 'challengesStore', + challengeReferralsStore: 'challengeReferralsStore', + childCareArrangementsAllStore: 'childCareArrangementsAllStore', + citizenshipsAllStore: 'citizenshipsAllStore', + colorsStore: 'colorsStore', + colorsUnpagedStore: 'colorsUnpagedStore', + colorsAllStore: 'colorsAllStore', + colorsAllUnpagedStore: 'colorsAllUnpagedStore', + confidentialityLevelsAllStore: 'confidentialityLevelsAllStore', + confidentialityLevelOptionsStore: 'confidentialityLevelOptionsStore', + disabilityAccommodationsAllStore: 'disabilityAccommodationsAllStore', + disabilityAgenciesAllStore: 'disabilityAgenciesAllStore', + disabilityStatusesAllStore: 'disabilityStatusesAllStore', + disabilityTypesAllStore: 'disabilityTypesAllStore', + earlyAlertOutcomesAllStore: 'earlyAlertOutcomesAllStore', + earlyAlertOutreachesAllStore: 'earlyAlertOutreachesAllStore', + earlyAlertReasonsAllStore: 'earlyAlertReasonsAllStore', + earlyAlertReferralsAllStore: 'earlyAlertReferralsAllStore', + earlyAlertSuggestionsAllStore: 'earlyAlertSuggestionsAllStore', + earlyAlertInterventionsAllStore: 'earlyAlertInterventionsAllStore', //TAPS 20140039 + educationGoalsAllStore: 'educationGoalsAllStore', + educationLevelsAllStore: 'educationLevelsAllStore', + electiveStore: 'electivesStore', + electivesAllStore: 'electivesAllStore', + employmentShiftsStore: 'employmentShiftsStore', + ethnicitiesAllStore: 'ethnicitiesAllStore', + racesAllStore: 'racesAllStore', + sapStatusesAllStore: 'sapStatusesAllStore', + financialAidFilesAllStore: 'financialAidFilesAllStore', + formUtils: 'formRendererUtils', + fundingSourcesAllStore: 'fundingSourcesAllStore', + gendersStore: 'gendersStore', + journalSourcesAllStore: 'journalSourcesAllStore', + journalStepsStore: 'journalStepsStore', + journalTracksAllStore: 'journalTracksAllStore', + lassisStore: 'lassisStore', + maritalStatusesAllStore: 'maritalStatusesAllStore', + militaryAffiliationsAllStore: 'militaryAffiliationsAllStore', + courseworkHoursAllStore: 'courseworkHoursAllStore', + enrollmentStatusesStore: 'enrollmentStatusesStore', + completedItemStore: 'completedItemStore', + registrationLoadsAllStore: 'registrationLoadsAllStore', + personalityTypesStore: 'personalityTypesStore', + programStatusChangeReasonsAllStore: 'programStatusChangeReasonsAllStore', + referralSourcesAllStore: 'referralSourcesAllStore', + serviceReasonsAllStore: 'serviceReasonsAllStore', + specialServiceGroupsAllStore: 'specialServiceGroupsAllStore', + statesStore: 'statesStore', + studentStatusesAllStore: 'studentStatusesAllStore', + studentTypesStore: 'studentTypesAllUnpagedStore', + tagsStore: 'tagsStore', + textStore: 'textStore', + veteranStatusesAllStore: 'veteranStatusesAllStore' + }, + + control: { + view: { + itemclick: 'onItemClick' + } + + }, + + init: function() { + var me = this; + me.confidentialityLevelOptionsStore.load(); + return this.callParent(arguments); + }, + + /* + * Handle selecting an item in the tree grid + */ + onItemClick: function(view,record,item,index,eventObj) { + var storeName = ""; + var columns = null; + + if (record.raw != undefined ) + { + if ( record.raw.form != "") + { + if (record.raw.store != "") + { + storeName = record.raw.store; + } + if (record.raw.columns != null) + { + columns = record.raw.columns; + } + var options = { + interfaceOptions: record.raw.interfaceOptions, + viewConfig: record.raw.viewConfig, + sort: record.raw.sort + } + this.loadAdmin( record.raw.title, record.raw.form, storeName, columns, options); + } + } + }, + + // Just to avoid creating needless closures + noOp: function() {}, + + loadAdmin: function( title ,form, storeName, columns, options ) { + var me=this; + var comp = this.formUtils.loadDisplay('adminforms',form, true, options); + var store = null; + + if (Ext.isFunction(comp.setTitle)) + comp.setTitle(title + ' Admin'); + + // set a store if defined + if (storeName != "") + { + store = me[storeName+'Store']; + // If the store was set, then modify + // the component to use the store + if (store != null) + { + // pass the columns for editing + if (columns != null) + { + // comp.reconfigure(store, columns); // ,columns + me.formUtils.reconfigureGridPanel(comp, store, columns); + }else{ + // comp.reconfigure(store); + me.formUtils.reconfigureGridPanel(comp, store); + } + } + + if ( options.interfaceOptions.storeDependencies ) { + + var responseDispatcherConfig = { + remainingOpNames: [], + afterLastOp: { + callback: Ext.pass(me.afterStoreDependenciesLoaded, [title ,form, storeName, columns, options, comp, store], me), + callbackScope: me + } + } + Ext.each(options.interfaceOptions.storeDependencies, function(storeDependency) { + responseDispatcherConfig.remainingOpNames.push(storeDependency.name); + }); + var responseDispatcher = Ext.create('Ssp.util.ResponseDispatcher', responseDispatcherConfig); + + Ext.each(options.interfaceOptions.storeDependencies, function(storeDependency) { + if ( storeDependency.clearFilter ) { + storeDependency.store.clearFilter(); + } + storeDependency.store.load(responseDispatcher.setSuccessCallback(storeDependency.name, me.noOp, me)); + }); + + } else { + me.afterStoreDependenciesLoaded(title ,form, storeName, columns, options, comp, store); + } + } + }, + + afterStoreDependenciesLoaded: function(title ,form, storeName, columns, options, comp, store) { + var me = this; + if ( store ) { // store (not comp.getStore()) existence check to preserve legacy behavior, maybe to let reconfigureGridPanel() change the store? + // unlike with options.interfaceOptions.storeDependencies handling, + // no clearFilter() here to preserve legacy behavior + comp.getStore().load(function() { // load() is on comp.getStore() not store, again to preserve legacy + if(options.sort != null && options.sort != undefined) { + var sort = options.sort + comp.getStore().sort(sort.field, (sort.direction != null && sort.direction != undefined) ? sort.direction : "ASC"); + } + }); + } + } }); \ No newline at end of file diff --git a/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertDetailsViewController.js b/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertDetailsViewController.js index 033d20610c..244faed26b 100644 --- a/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertDetailsViewController.js +++ b/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertDetailsViewController.js @@ -1,202 +1,217 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.controller.tool.earlyalert.EarlyAlertDetailsViewController', { - extend: 'Deft.mvc.ViewController', - mixins: [ 'Deft.mixin.Injectable' ], - inject: { - apiProperties: 'apiProperties', - campusesStore: 'campusesAllUnpagedStore', - formUtils: 'formRendererUtils', - model: 'currentEarlyAlert', - personService: 'personService', - reasonsStore: 'earlyAlertReasonsAllUnpagedStore', - selectedReasonsStore: 'earlyAlertDetailsReasonsStore', - suggestionsStore: 'earlyAlertSuggestionsAllUnpagedStore', - selectedSuggestionsStore: 'earlyAlertDetailsSuggestionsStore', - appEventsController: 'appEventsController', - earlyAlertResponse: 'currentEarlyAlertResponse', - personLite: 'personLite', - earlyAlertService: 'earlyAlertService' - }, - config: { - containerToLoadInto: 'tools', - earlyAlertResponseFormDisplay: 'earlyalertresponse', - earlyAlertListDisplay: 'earlyalert', - earlyAlertResponseDetailsDisplay: 'earlyalertresponsedetails' - }, - control: { - 'finishButton': { - click: 'onFinishButtonClick' - }, - 'detailRespondButton': { - click: 'onDetailRespondClick' - }, - 'detailResponseGridPanel': { - cellClick : 'onGridClick' - }, - - earlyAlertSuggestionsList: '#earlyAlertSuggestionsList', - campusField: '#campusField', - statusField: '#statusField', - createdByField: '#createdByField', - closedByField: '#closedByField' - }, - - init: function() { - - var me=this; - - me.getView().setLoading( true ); - - var personId = me.personLite.get('id'); - var earlyAlertId = me.model.get('id'); - - var responseDispatcher = Ext.create('Ssp.util.ResponseDispatcher', { - remainingOpNames: ['earlyalert','earlyalertresponses'] - }); - responseDispatcher.setAfterLastCallback(me.afterLastServiceResponse, me); - - if ( me.getView().reloadEarlyAlert ) { - me.earlyAlertService.get(earlyAlertId, personId, { - success: responseDispatcher.setSuccessCallback('earlyalert', me.getEarlyAlertSuccess, me), - failure: responseDispatcher.setFailureCallback('earlyalert', me.getEarlyAlertFailure, me), - scope: responseDispatcher - }); - } else { - // still need to go through the request dispatcher so we can fire the - // 'all clear' once all sync and async data loads have completed - responseDispatcher.setSuccessCallback('earlyalert', me.bindEarlyAlertToView, me).apply(responseDispatcher, []); - } - - me.earlyAlertService.getAllEarlyAlertResponses(personId, - earlyAlertId, { - success: responseDispatcher.setSuccessCallback('earlyalertresponses', me.getEarlyAlertResponsesSuccess, me), - failure: responseDispatcher.setFailureCallback('earlyalertresponses', me.getEarlyAlertResponsesFailure, me), - scope: responseDispatcher - }); - - return this.callParent(arguments); - }, - - getEarlyAlertSuccess: function(response) { - var me = this; - // TODO I have no idea how correct this model state management is. The - // property copying loop that EarlyAlertToolViewController.js and - // onGridClick() uses doesn't work here for reasons that currently - // elude me (e.g. date types are all wrong). IMHO, it seems all wrong - // anyway... shouldn't this all be hidden behind a Ext Store? Playing - // low-level reinitialization games with singleton Models can't possibly - // be right... can it? - var earlyAlert= new Ssp.model.tool.earlyalert.PersonEarlyAlert(); - me.model.data = earlyAlert.data; - if ( response ) { - me.model.populateFromGenericObject(response); - } // TODO else what? a horror show is likely to ensue... - me.bindEarlyAlertToView(); - }, - - bindEarlyAlertToView: function() { - var me = this; - var campus = me.campusesStore.getById( me.model.get('campusId') ); - - // Reset and populate general fields comments, etc. - me.getView().getForm().reset(); - me.getView().loadRecord( me.model ); - - me.getCreatedByField().setValue( me.model.getCreatedByPersonName() ); - - // Early Alert Status: 'Open', 'Closed' - me.getStatusField().setValue( ((me.model.get('closedDate'))? 'Closed' : 'Open') ); - - // Campus - me.getCampusField().setValue( ((campus)? campus.get('name') : "No Campus Defined") ); - - // Reasons - var reasonIds = []; - if ( me.model.get('earlyAlertReasonIds') && me.model.get('earlyAlertReasonIds').length ) { - reasonIds = me.model.get('earlyAlertReasonIds'); - } else if ( me.model.get('earlyAlertReasonId') ) { - reasonIds = [ me.model.get('earlyAlertReasonId') ]; - } - me.selectedReasonsStore.removeAll(); - var selectedReasons = me.formUtils.getSimpleItemsForDisplay( me.reasonsStore, reasonIds, 'Reasons' ); - me.selectedReasonsStore.loadData( selectedReasons ); - - // Suggestions - var selectedSuggestions = me.formUtils.getSimpleItemsForDisplay( me.suggestionsStore, me.model.get('earlyAlertSuggestionIds'), 'Suggestions' ); - me.selectedSuggestionsStore.removeAll(); - me.selectedSuggestionsStore.loadData( selectedSuggestions ); - - if ( me.model.get('closedById') ) { - if ( me.model.get('closedByName') ) { - me.getClosedByField().setValue( me.model.get('closedByName') ); - } else { - me.getClosedByField().setValue('UNKNOWN'); - } - } - - }, - - getEarlyAlertFailure: function() { - // no-op for now... error probably already presented to end user as - // part of the service call. - }, - - getEarlyAlertResponsesSuccess: function( r, scope){ - var me=scope; - // clear the current Early Alert Response - var earlyAlertResponse = new Ssp.model.tool.earlyalert.EarlyAlertResponse(); - me.earlyAlertResponse.data = earlyAlertResponse.data; - }, - - getEarlyAlertResponsesFailure: function( r, scope){ - // no-op for now... error probably already presented to end user as - // part of the service call. - }, - - afterLastServiceResponse: function() { - var me = this; - me.getView().setLoading( false ); - }, - - onFinishButtonClick: function( button ){ - var comp = this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertListDisplay(), true, {}); - }, - - onDetailRespondClick: function( button ){ - var me=this; - me.loadEarlyAlertResponseForm(button); - }, - - loadEarlyAlertResponseForm: function(button){ - this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertResponseFormDisplay(), true, {}); - }, - - onGridClick: function(){ - var me=this; - var record = Ext.getCmp('detailResponseGridPanel').getSelectionModel().getSelection()[0]; - - for (prop in me.earlyAlertResponse.data) - { - me.earlyAlertResponse.data[prop] = record.data[prop]; - } - this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertResponseDetailsDisplay(), true, {}); - - } +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions functionality to EA Controller + */ +Ext.define('Ssp.controller.tool.earlyalert.EarlyAlertDetailsViewController', { + extend: 'Deft.mvc.ViewController', + mixins: [ 'Deft.mixin.Injectable' ], + inject: { + apiProperties: 'apiProperties', + campusesStore: 'campusesAllUnpagedStore', + formUtils: 'formRendererUtils', + model: 'currentEarlyAlert', + personService: 'personService', + reasonsStore: 'earlyAlertReasonsAllUnpagedStore', + selectedReasonsStore: 'earlyAlertDetailsReasonsStore', + suggestionsStore: 'earlyAlertSuggestionsAllUnpagedStore', + selectedSuggestionsStore: 'earlyAlertDetailsSuggestionsStore', + interventionsStore: 'earlyAlertInterventionsAllUnpagedStore', //TAPS 20140039 + selectedInterventionsStore: 'earlyAlertDetailsInterventionsStore', //TAPS 20140039 + appEventsController: 'appEventsController', + earlyAlertResponse: 'currentEarlyAlertResponse', + personLite: 'personLite', + earlyAlertService: 'earlyAlertService' + }, + config: { + containerToLoadInto: 'tools', + earlyAlertResponseFormDisplay: 'earlyalertresponse', + earlyAlertListDisplay: 'earlyalert', + earlyAlertResponseDetailsDisplay: 'earlyalertresponsedetails' + }, + control: { + 'finishButton': { + click: 'onFinishButtonClick' + }, + 'detailRespondButton': { + click: 'onDetailRespondClick' + }, + 'detailResponseGridPanel': { + cellClick : 'onGridClick' + }, + + earlyAlertSuggestionsList: '#earlyAlertSuggestionsList', + earlyAlertInterventionsList: '#earlyAlertInterventionsList', //TAPS 20140039 + campusField: '#campusField', + statusField: '#statusField', + createdByField: '#createdByField', + closedByField: '#closedByField' + }, + + init: function() { + + var me=this; + + me.getView().setLoading( true ); + + var personId = me.personLite.get('id'); + var earlyAlertId = me.model.get('id'); + + var responseDispatcher = Ext.create('Ssp.util.ResponseDispatcher', { + remainingOpNames: ['earlyalert','earlyalertresponses'] + }); + responseDispatcher.setAfterLastCallback(me.afterLastServiceResponse, me); + + if ( me.getView().reloadEarlyAlert ) { + me.earlyAlertService.get(earlyAlertId, personId, { + success: responseDispatcher.setSuccessCallback('earlyalert', me.getEarlyAlertSuccess, me), + failure: responseDispatcher.setFailureCallback('earlyalert', me.getEarlyAlertFailure, me), + scope: responseDispatcher + }); + } else { + // still need to go through the request dispatcher so we can fire the + // 'all clear' once all sync and async data loads have completed + responseDispatcher.setSuccessCallback('earlyalert', me.bindEarlyAlertToView, me).apply(responseDispatcher, []); + } + + me.earlyAlertService.getAllEarlyAlertResponses(personId, + earlyAlertId, { + success: responseDispatcher.setSuccessCallback('earlyalertresponses', me.getEarlyAlertResponsesSuccess, me), + failure: responseDispatcher.setFailureCallback('earlyalertresponses', me.getEarlyAlertResponsesFailure, me), + scope: responseDispatcher + }); + + return this.callParent(arguments); + }, + + getEarlyAlertSuccess: function(response) { + var me = this; + // TODO I have no idea how correct this model state management is. The + // property copying loop that EarlyAlertToolViewController.js and + // onGridClick() uses doesn't work here for reasons that currently + // elude me (e.g. date types are all wrong). IMHO, it seems all wrong + // anyway... shouldn't this all be hidden behind a Ext Store? Playing + // low-level reinitialization games with singleton Models can't possibly + // be right... can it? + var earlyAlert= new Ssp.model.tool.earlyalert.PersonEarlyAlert(); + me.model.data = earlyAlert.data; + if ( response ) { + me.model.populateFromGenericObject(response); + } // TODO else what? a horror show is likely to ensue... + me.bindEarlyAlertToView(); + }, + + bindEarlyAlertToView: function() { + var me = this; + var campus = me.campusesStore.getById( me.model.get('campusId') ); + + // Reset and populate general fields comments, etc. + me.getView().getForm().reset(); + me.getView().loadRecord( me.model ); + + me.getCreatedByField().setValue( me.model.getCreatedByPersonName() ); + + // Early Alert Status: 'Open', 'Closed' + me.getStatusField().setValue( ((me.model.get('closedDate'))? 'Closed' : 'Open') ); + + // Campus + me.getCampusField().setValue( ((campus)? campus.get('name') : "No Campus Defined") ); + + // Reasons + var reasonIds = []; + if ( me.model.get('earlyAlertReasonIds') && me.model.get('earlyAlertReasonIds').length ) { + reasonIds = me.model.get('earlyAlertReasonIds'); + } else if ( me.model.get('earlyAlertReasonId') ) { + reasonIds = [ me.model.get('earlyAlertReasonId') ]; + } + me.selectedReasonsStore.removeAll(); + var selectedReasons = me.formUtils.getSimpleItemsForDisplay( me.reasonsStore, reasonIds, 'Reasons' ); + me.selectedReasonsStore.loadData( selectedReasons ); + + // Suggestions + var selectedSuggestions = me.formUtils.getSimpleItemsForDisplay( me.suggestionsStore, me.model.get('earlyAlertSuggestionIds'), 'Suggestions' ); + me.selectedSuggestionsStore.removeAll(); + me.selectedSuggestionsStore.loadData( selectedSuggestions ); + + //TAPS 20140039 BEGIN + // Interventions + var selectedInterventions = me.formUtils.getSimpleItemsForDisplay( me.interventionsStore, me.model.get('earlyAlertInterventionIds'), 'Interventions' ); + me.selectedInterventionsStore.removeAll(); + me.selectedInterventionsStore.loadData( selectedInterventions ); + //TAPS 20140039 END + + if ( me.model.get('closedById') ) { + if ( me.model.get('closedByName') ) { + me.getClosedByField().setValue( me.model.get('closedByName') ); + } else { + me.getClosedByField().setValue('UNKNOWN'); + } + } + + }, + + getEarlyAlertFailure: function() { + // no-op for now... error probably already presented to end user as + // part of the service call. + }, + + getEarlyAlertResponsesSuccess: function( r, scope){ + var me=scope; + // clear the current Early Alert Response + var earlyAlertResponse = new Ssp.model.tool.earlyalert.EarlyAlertResponse(); + me.earlyAlertResponse.data = earlyAlertResponse.data; + }, + + getEarlyAlertResponsesFailure: function( r, scope){ + // no-op for now... error probably already presented to end user as + // part of the service call. + }, + + afterLastServiceResponse: function() { + var me = this; + me.getView().setLoading( false ); + }, + + onFinishButtonClick: function( button ){ + var comp = this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertListDisplay(), true, {}); + }, + + onDetailRespondClick: function( button ){ + var me=this; + me.loadEarlyAlertResponseForm(button); + }, + + loadEarlyAlertResponseForm: function(button){ + this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertResponseFormDisplay(), true, {}); + }, + + onGridClick: function(){ + var me=this; + var record = Ext.getCmp('detailResponseGridPanel').getSelectionModel().getSelection()[0]; + + for (prop in me.earlyAlertResponse.data) + { + me.earlyAlertResponse.data[prop] = record.data[prop]; + } + this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertResponseDetailsDisplay(), true, {}); + + } }); \ No newline at end of file diff --git a/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertToolViewController.js b/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertToolViewController.js index f2776a8287..3d7224ed59 100644 --- a/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertToolViewController.js +++ b/src/main/webapp/app/controller/tool/earlyalert/EarlyAlertToolViewController.js @@ -1,249 +1,261 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.controller.tool.earlyalert.EarlyAlertToolViewController', { - extend: 'Deft.mvc.ViewController', - mixins: [ 'Deft.mixin.Injectable'], - inject: { - appEventsController: 'appEventsController', - confidentialityLevelsStore: 'confidentialityLevelsStore', - campusesStore: 'campusesAllUnpagedStore', - earlyAlertsStore: 'earlyAlertsStore', - earlyAlertService: 'earlyAlertService', - earlyAlertResponseService: 'earlyAlertResponseService', - earlyAlert: 'currentEarlyAlert', - earlyAlertResponse: 'currentEarlyAlertResponse', - formUtils: 'formRendererUtils', - outcomesStore: 'earlyAlertOutcomesAllUnpagedStore', - outreachesStore: 'earlyAlertOutreachesAllUnpagedStore', - reasonsStore: 'earlyAlertReasonsAllUnpagedStore', - personLite: 'personLite', - referralsStore: 'earlyAlertReferralsAllUnpagedStore', - suggestionsStore: 'earlyAlertSuggestionsAllUnpagedStore', - treeStore: 'earlyAlertsTreeStore', - util: 'util' - }, - config: { - containerToLoadInto: 'tools', - earlyAlertDetailsDisplay: 'earlyalertdetails', - earlyAlertResponseDetailsDisplay: 'earlyalertresponsedetails' - }, - control: { - view: { - viewready: 'onViewReady', - itemexpand: 'onItemExpand', - itemClick: 'onAlertClick' - } - }, - - init: function(){ - return this.callParent(arguments); - }, - - onViewReady: function(comp, obj){ - var me=this; - me.campusesStore.load({ - params:{status: "ALL", limit: "-1"} - }); - - me.confidentialityLevelsStore.load({ - params:{status: "ALL", limit: "-1"} - }); - - me.outcomesStore.load({ - params:{status: "ALL", limit: "-1"} - }); - - me.outreachesStore.load({ - params:{status: "ALL", limit: "-1"} - }); - - me.reasonsStore.load({ - params:{status: "ALL", limit: "-1"} - }); - - me.suggestionsStore.load({ - params:{status: "ALL", limit: "-1"} - }); - - me.referralsStore.load({ - params:{status: "ALL", limit: "-1"}, - callback: function(r,options,success) { - if(success == true) { - me.getEarlyAlerts(); - } - else { - Ext.Msg.alert("Ssp Error","Failed to load referrals. See your system administrator for assitance."); - } - } - }); - me.appEventsController.assignEvent({eventName: 'updateEarlyAlertsResponseStatus', callBackFunc: me.onUpdateEarlyAlertsResponseStatus, scope: me}); - me.setGridRowClass(me.getView()); - }, - - destroy: function() { - return this.callParent( arguments ); - }, - - setGridRowClass: function(grid){ - grid.getView().getRowClass = function(row, index) - { - var cls = ""; - - // early alert color will over-ride the appointment date - if ( row.get('closedDate') == null) - { - cls = 'caseload-early-alert-indicator' - } - if ( row.get('responseRequired') != null) - { - if (row.get('responseRequired') == true) - { - cls = 'caseload-early-alert-response-required-indicator' - } - } - - return cls; - }; - }, - - getEarlyAlerts: function(){ - var me=this; - var pId = me.personLite.get('id'); - me.getView().setLoading(true); - me.earlyAlertService.getAll( pId, - {success:me.getEarlyAlertsSuccess, - failure:me.getEarlyAlertsFailure, - scope: me}); - }, - - getEarlyAlertsSuccess: function( r, scope){ - var me=scope; - var personEarlyAlert; - me.getView().setLoading(false); - if ( me.earlyAlertsStore.getCount() > 0) - { - me.getView().getSelectionModel().select(0); - }else{ - // if no record is available then set the selected early alert to null - personEarlyAlert = new Ssp.model.tool.earlyalert.PersonEarlyAlert(); - me.earlyAlert.data = personEarlyAlert.data; - } - - me.onUpdateEarlyAlertsResponseStatus(); - }, - - onUpdateEarlyAlertsResponseStatus: function(earlyAlertResponse){ - var me = this; - me.util.onUpdateEarlyAlertsResponseStatus(me.treeStore.getRootNode().childNodes); - }, - - getEarlyAlertsFailure: function( r, scope){ - var me=scope; - me.getView().setLoading(false); - }, - - onItemExpand: function(nodeInt, obj){ - var me=this; - var node = nodeInt; - var nodeType = node.get('nodeType'); - var id = node.get('id' ); - var personId = me.personLite.get('id'); - if (node != null) - { - // use root here to prevent the expand from firing - // when items are added to the root element in the tree - if (nodeType == 'early alert' && id != "root" && id != "") - { - me.getView().setLoading(true); - me.earlyAlertService.getAllEarlyAlertResponses(personId, id, - {success:me.getEarlyAlertResponsesSuccess, - failure:me.getEarlyAlertResponsesFailure, - scope: me} - ); - } - } - }, - - getEarlyAlertResponsesSuccess: function( r, scope){ - var me=scope; - // clear the current Early Alert Response - var earlyAlertResponse = new Ssp.model.tool.earlyalert.EarlyAlertResponse(); - me.earlyAlertResponse.data = earlyAlertResponse.data; - me.getView().setLoading(false); - }, - - getEarlyAlertResponsesFailure: function( r, scope){ - var me=scope; - me.getView().setLoading(false); - }, - - onAlertClick: function(nodeInt, obj){ - var me=this; - var record = me.getView().getSelectionModel().getSelection()[0]; - var node = nodeInt; - - var id = record.get('id'); - - var personId = me.personLite.get('id'); - - if (record != null) - { - if (record.get('nodeType')=='early alert') - { - for (prop in me.earlyAlert.data) - { - me.earlyAlert.data[prop] = record.data[prop]; - } - - - /*me.earlyAlertService.getAllEarlyAlertResponses(personId, id, - {success:me.getEarlyAlertResponsesSuccess, - failure:me.getEarlyAlertResponsesFailure, - scope: me} );*/ - - me.displayEarlyAlertDetails(); - } - /*else{ - - for (prop in me.earlyAlertResponse.data) - { - me.earlyAlertResponse.data[prop] = record.data[prop]; - } - - me.displayEarlyAlertResponseDetails(); - } */ - }else{ - Ext.Msg.alert('Notification','Please select an item to view.'); - } - }, - - displayEarlyAlertDetails: function(button){ - var comp = this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertDetailsDisplay(), true, {reloadEarlyAlert: false}); - }, - - displayEarlyAlertResponseDetails: function(button){ - var comp = this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertResponseDetailsDisplay(), true, {}); - }, - - destroy:function(){ - var me = this; - me.appEventsController.removeEvent({eventName: 'updateEarlyAlertsResponseStatus', callBackFunc: me.onUpdateEarlyAlertsResponseStatus, scope: me}); - return me.callParent( arguments ); - } +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions functionality to EA Tool Controller + */ +Ext.define('Ssp.controller.tool.earlyalert.EarlyAlertToolViewController', { + extend: 'Deft.mvc.ViewController', + mixins: [ 'Deft.mixin.Injectable'], + inject: { + appEventsController: 'appEventsController', + confidentialityLevelsStore: 'confidentialityLevelsStore', + campusesStore: 'campusesAllUnpagedStore', + earlyAlertsStore: 'earlyAlertsStore', + earlyAlertService: 'earlyAlertService', + earlyAlertResponseService: 'earlyAlertResponseService', + earlyAlert: 'currentEarlyAlert', + earlyAlertResponse: 'currentEarlyAlertResponse', + formUtils: 'formRendererUtils', + outcomesStore: 'earlyAlertOutcomesAllUnpagedStore', + outreachesStore: 'earlyAlertOutreachesAllUnpagedStore', + reasonsStore: 'earlyAlertReasonsAllUnpagedStore', + personLite: 'personLite', + referralsStore: 'earlyAlertReferralsAllUnpagedStore', + suggestionsStore: 'earlyAlertSuggestionsAllUnpagedStore', + interventionsStore: 'earlyAlertInterventionsAllUnpagedStore', //TAPS 20140039 + treeStore: 'earlyAlertsTreeStore', + util: 'util' + }, + config: { + containerToLoadInto: 'tools', + earlyAlertDetailsDisplay: 'earlyalertdetails', + earlyAlertResponseDetailsDisplay: 'earlyalertresponsedetails' + }, + control: { + view: { + viewready: 'onViewReady', + itemexpand: 'onItemExpand', + itemClick: 'onAlertClick' + } + }, + + init: function(){ + return this.callParent(arguments); + }, + + onViewReady: function(comp, obj){ + + var me=this; + me.campusesStore.load({ + params:{status: "ALL", limit: "-1"} + }); + + me.confidentialityLevelsStore.load({ + params:{status: "ALL", limit: "-1"} + }); + + me.outcomesStore.load({ + params:{status: "ALL", limit: "-1"} + }); + + me.outreachesStore.load({ + params:{status: "ALL", limit: "-1"} + }); + + me.reasonsStore.load({ + params:{status: "ALL", limit: "-1"} + }); + + me.suggestionsStore.load({ + params:{status: "ALL", limit: "-1"} + }); + + //TAPS 20140039 BEGIN + me.interventionsStore.load({ + params:{status: "ALL", limit: "-1"} + }); + //TAPS 20140039 END + + me.referralsStore.load({ + params:{status: "ALL", limit: "-1"}, + callback: function(r,options,success) { + if(success == true) { + me.getEarlyAlerts(); + } + else { + Ext.Msg.alert("RiverSupport Error","Failed to load referrals. See your system administrator for assitance."); + } + } + }); + me.appEventsController.assignEvent({eventName: 'updateEarlyAlertsResponseStatus', callBackFunc: me.onUpdateEarlyAlertsResponseStatus, scope: me}); + me.setGridRowClass(me.getView()); + }, + + destroy: function() { + return this.callParent( arguments ); + }, + + setGridRowClass: function(grid){ + grid.getView().getRowClass = function(row, index) + { + var cls = ""; + + // early alert color will over-ride the appointment date + if ( row.get('closedDate') == null) + { + cls = 'caseload-early-alert-indicator' + } + if ( row.get('responseRequired') != null) + { + if (row.get('responseRequired') == true) + { + cls = 'caseload-early-alert-response-required-indicator' + } + } + + return cls; + }; + }, + + getEarlyAlerts: function(){ + var me=this; + var pId = me.personLite.get('id'); + me.getView().setLoading(true); + me.earlyAlertService.getAll( pId, + {success:me.getEarlyAlertsSuccess, + failure:me.getEarlyAlertsFailure, + scope: me}); + }, + + getEarlyAlertsSuccess: function( r, scope){ + var me=scope; + var personEarlyAlert; + me.getView().setLoading(false); + if ( me.earlyAlertsStore.getCount() > 0) + { + me.getView().getSelectionModel().select(0); + }else{ + // if no record is available then set the selected early alert to null + personEarlyAlert = new Ssp.model.tool.earlyalert.PersonEarlyAlert(); + me.earlyAlert.data = personEarlyAlert.data; + } + + me.onUpdateEarlyAlertsResponseStatus(); + }, + + onUpdateEarlyAlertsResponseStatus: function(earlyAlertResponse){ + var me = this; + me.util.onUpdateEarlyAlertsResponseStatus(me.treeStore.getRootNode().childNodes); + }, + + getEarlyAlertsFailure: function( r, scope){ + var me=scope; + me.getView().setLoading(false); + }, + + onItemExpand: function(nodeInt, obj){ + var me=this; + var node = nodeInt; + var nodeType = node.get('nodeType'); + var id = node.get('id' ); + var personId = me.personLite.get('id'); + if (node != null) + { + // use root here to prevent the expand from firing + // when items are added to the root element in the tree + if (nodeType == 'early alert' && id != "root" && id != "") + { + me.getView().setLoading(true); + me.earlyAlertService.getAllEarlyAlertResponses(personId, id, + {success:me.getEarlyAlertResponsesSuccess, + failure:me.getEarlyAlertResponsesFailure, + scope: me} + ); + } + } + }, + + getEarlyAlertResponsesSuccess: function( r, scope){ + var me=scope; + // clear the current Early Alert Response + var earlyAlertResponse = new Ssp.model.tool.earlyalert.EarlyAlertResponse(); + me.earlyAlertResponse.data = earlyAlertResponse.data; + me.getView().setLoading(false); + }, + + getEarlyAlertResponsesFailure: function( r, scope){ + var me=scope; + me.getView().setLoading(false); + }, + + onAlertClick: function(nodeInt, obj){ + var me=this; + var record = me.getView().getSelectionModel().getSelection()[0]; + var node = nodeInt; + + var id = record.get('id'); + + var personId = me.personLite.get('id'); + + if (record != null) + { + if (record.get('nodeType')=='early alert') + { + for (prop in me.earlyAlert.data) + { + me.earlyAlert.data[prop] = record.data[prop]; + } + + + /*me.earlyAlertService.getAllEarlyAlertResponses(personId, id, + {success:me.getEarlyAlertResponsesSuccess, + failure:me.getEarlyAlertResponsesFailure, + scope: me} );*/ + + me.displayEarlyAlertDetails(); + } + /*else{ + + for (prop in me.earlyAlertResponse.data) + { + me.earlyAlertResponse.data[prop] = record.data[prop]; + } + + me.displayEarlyAlertResponseDetails(); + } */ + }else{ + Ext.Msg.alert('Notification','Please select an item to view.'); + } + }, + + displayEarlyAlertDetails: function(button){ + var comp = this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertDetailsDisplay(), true, {reloadEarlyAlert: false}); + }, + + displayEarlyAlertResponseDetails: function(button){ + var comp = this.formUtils.loadDisplay(this.getContainerToLoadInto(), this.getEarlyAlertResponseDetailsDisplay(), true, {}); + }, + + destroy:function(){ + var me = this; + me.appEventsController.removeEvent({eventName: 'updateEarlyAlertsResponseStatus', callBackFunc: me.onUpdateEarlyAlertsResponseStatus, scope: me}); + return me.callParent( arguments ); + } }); \ No newline at end of file diff --git a/src/main/webapp/app/model/reference/EarlyAlertIntervention.js b/src/main/webapp/app/model/reference/EarlyAlertIntervention.js new file mode 100644 index 0000000000..d545adae9e --- /dev/null +++ b/src/main/webapp/app/model/reference/EarlyAlertIntervention.js @@ -0,0 +1,26 @@ +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Created EarlyAlertIntervention.js for Faculty Interventions + */ +Ext.define('Ssp.model.reference.EarlyAlertIntervention', { + extend: 'Ssp.model.reference.AbstractReference', + fields: [] +}); \ No newline at end of file diff --git a/src/main/webapp/app/model/tool/earlyalert/EarlyAlertResponseGrid.js b/src/main/webapp/app/model/tool/earlyalert/EarlyAlertResponseGrid.js index 51f8da8f4d..40df282099 100644 --- a/src/main/webapp/app/model/tool/earlyalert/EarlyAlertResponseGrid.js +++ b/src/main/webapp/app/model/tool/earlyalert/EarlyAlertResponseGrid.js @@ -1,45 +1,50 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.model.tool.earlyalert.EarlyAlertResponseGrid', { - extend: 'Ssp.model.AbstractBase', - fields: [{name:'personId', type: 'string'}, - {name:'courseName', type:'string'}, - {name:'courseTitle', type:'string'}, - {name:'emailCC', type:'string'}, - {name:'campusId', type:'string'}, - {name:'earlyAlertReasonId', type:'string'}, - {name:'earlyAlertReasonIds', type:'auto'}, - {name:'earlyAlertReasonOtherDescription', type:'string'}, - {name:'earlyAlertSuggestionIds', type:'auto'}, - {name:'earlyAlertSuggestionOtherDescription', type:'string'}, - {name:'comment', type:'string'}, - {name:'closedDate', type: 'date', dateFormat: 'time'}, - {name:'closedById', type:'string'}, - {name:'sendEmailToStudent', type:'boolean'}, - - {name:'nodeType',type:'string',defaultValue:'early alert'}, - {name:'gridDisplayDetails', type:'string'}, - - {name:'earlyAlertId',type:'string'}, - {name:'earlyAlertOutcomeId',type:'string'}, - {name:'earlyAlertOutcomeOtherDescription',type:'string'}, - {name:'earlyAlertReferralIds',type:'auto'}, - {name:'earlyAlertOutreachIds',type:'auto'}, - {name:'comment',type:'string'}] +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions fields to Response Grid + */ +Ext.define('Ssp.model.tool.earlyalert.EarlyAlertResponseGrid', { + extend: 'Ssp.model.AbstractBase', + fields: [{name:'personId', type: 'string'}, + {name:'courseName', type:'string'}, + {name:'courseTitle', type:'string'}, + {name:'emailCC', type:'string'}, + {name:'campusId', type:'string'}, + {name:'earlyAlertReasonId', type:'string'}, + {name:'earlyAlertReasonIds', type:'auto'}, + {name:'earlyAlertReasonOtherDescription', type:'string'}, + {name:'earlyAlertSuggestionIds', type:'auto'}, + {name:'earlyAlertSuggestionOtherDescription', type:'string'}, + {name:'earlyAlertInterventionIds', type:'auto'}, //TAPS 20140039 + {name:'comment', type:'string'}, + {name:'closedDate', type: 'date', dateFormat: 'time'}, + {name:'closedById', type:'string'}, + {name:'sendEmailToStudent', type:'boolean'}, + + {name:'nodeType',type:'string',defaultValue:'early alert'}, + {name:'gridDisplayDetails', type:'string'}, + + {name:'earlyAlertId',type:'string'}, + {name:'earlyAlertOutcomeId',type:'string'}, + {name:'earlyAlertOutcomeOtherDescription',type:'string'}, + {name:'earlyAlertReferralIds',type:'auto'}, + {name:'earlyAlertOutreachIds',type:'auto'}, + {name:'comment',type:'string'}] }); \ No newline at end of file diff --git a/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlert.js b/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlert.js index c8351ec5d2..e08e31a9a1 100644 --- a/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlert.js +++ b/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlert.js @@ -1,36 +1,42 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.model.tool.earlyalert.PersonEarlyAlert', { - extend: 'Ssp.model.AbstractBase', - fields: [{name:'personId', type: 'string'}, - {name:'courseName', type:'string'}, - {name:'courseTitle', type:'string'}, - {name:'emailCC', type:'string'}, - {name:'campusId', type:'string'}, - {name:'earlyAlertReasonId', type:'string'}, - {name:'earlyAlertReasonIds', type:'auto'}, - {name:'earlyAlertReasonOtherDescription', type:'string'}, - {name:'earlyAlertSuggestionIds', type:'auto'}, - {name:'earlyAlertSuggestionOtherDescription', type:'string'}, - {name:'comment', type:'string'}, - {name:'closedDate', type: 'date', dateFormat: 'time'}, - {name:'closedById', type:'string'}, - {name:'closedByName', type:'string'}, - {name:'sendEmailToStudent', type:'boolean'}] +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions fields to Person EA + */ +Ext.define('Ssp.model.tool.earlyalert.PersonEarlyAlert', { + extend: 'Ssp.model.AbstractBase', + fields: [{name:'personId', type: 'string'}, + {name:'courseName', type:'string'}, + {name:'courseTitle', type:'string'}, + {name:'emailCC', type:'string'}, + {name:'campusId', type:'string'}, + {name:'earlyAlertReasonId', type:'string'}, + {name:'earlyAlertReasonIds', type:'auto'}, + {name:'earlyAlertReasonOtherDescription', type:'string'}, + {name:'earlyAlertSuggestionIds', type:'auto'}, + {name:'earlyAlertSuggestionOtherDescription', type:'string'}, + {name:'earlyAlertInterventionIds', type:'auto'}, //TAPS 20140039 + {name:'comment', type:'string'}, + {name:'closedDate', type: 'date', dateFormat: 'time'}, + {name:'closedById', type:'string'}, + {name:'closedByName', type:'string'}, + {name:'sendEmailToStudent', type:'boolean'}] }); \ No newline at end of file diff --git a/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlertTree.js b/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlertTree.js index 12cc79a757..30e395a0b6 100644 --- a/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlertTree.js +++ b/src/main/webapp/app/model/tool/earlyalert/PersonEarlyAlertTree.js @@ -1,55 +1,61 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.model.tool.earlyalert.PersonEarlyAlertTree', { - extend: 'Ssp.model.AbstractBase', - fields: [{name:'personId', type: 'string'}, - {name:'courseName',type:'string'}, - {name:'courseTitle',type:'string'}, - {name:'emailCC',type:'string'}, - {name:'campusId',type:'string'}, - {name:'earlyAlertReasonId',type:'string'}, - {name:'earlyAlertReasonIds',type:'auto'}, - {name:'earlyAlertReasonOtherDescription',type:'string'}, - {name:'responseRequired',type:'boolean'}, - {name:'earlyAlertSuggestionIds',type:'auto'}, - {name:'earlyAlertSuggestionOtherDescription',type:'string'}, - {name:'comment',type:'string'}, - {name:'closedDate',type: 'date', dateFormat: 'time'}, - {name:'closedById',type:'string'}, - {name:'closedByName',type:'string'}, - {name:'sendEmailToStudent', type:'boolean'}, - - /* props for tree manipulation */ - {name:'iconCls',type:'string'}, - {name:'leaf',type:'boolean',defaultValue: false}, - {name:'expanded',type:'boolean'}, - {name:'text',type: 'string'}, - {name:'nodeType',type:'string',defaultValue:'early alert'}, - {name:'gridDisplayDetails', type:'string'}, - {name: 'noOfResponses', type:'string'}, - {name:'lastResponseDate', type: 'date', dateFormat: 'time'}, - /* end props for tree manipulation */ - - {name:'earlyAlertId',type:'string'}, - {name:'earlyAlertOutcomeId',type:'string'}, - {name:'earlyAlertOutcomeOtherDescription',type:'string'}, - {name:'earlyAlertReferralIds',type:'auto'}, - {name:'earlyAlertOutreachIds',type:'auto'}, - {name:'comment',type:'string'}] +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions fields to Person EA Tree + */ +Ext.define('Ssp.model.tool.earlyalert.PersonEarlyAlertTree', { + extend: 'Ssp.model.AbstractBase', + fields: [{name:'personId', type: 'string'}, + {name:'courseName',type:'string'}, + {name:'courseTitle',type:'string'}, + {name:'emailCC',type:'string'}, + {name:'campusId',type:'string'}, + {name:'earlyAlertReasonId',type:'string'}, + {name:'earlyAlertReasonIds',type:'auto'}, + {name:'earlyAlertReasonOtherDescription',type:'string'}, + {name:'responseRequired',type:'boolean'}, + {name:'earlyAlertSuggestionIds',type:'auto'}, + {name:'earlyAlertSuggestionOtherDescription',type:'string'}, + {name:'earlyAlertInterventionIds',type:'auto'}, //TAPS 20140039 + {name:'comment',type:'string'}, + {name:'closedDate',type: 'date', dateFormat: 'time'}, + {name:'closedById',type:'string'}, + {name:'closedByName',type:'string'}, + {name:'sendEmailToStudent', type:'boolean'}, + + /* props for tree manipulation */ + {name:'iconCls',type:'string'}, + {name:'leaf',type:'boolean',defaultValue: false}, + {name:'expanded',type:'boolean'}, + {name:'text',type: 'string'}, + {name:'nodeType',type:'string',defaultValue:'early alert'}, + {name:'gridDisplayDetails', type:'string'}, + {name: 'noOfResponses', type:'string'}, + {name:'lastResponseDate', type: 'date', dateFormat: 'time'}, + /* end props for tree manipulation */ + + {name:'earlyAlertId',type:'string'}, + {name:'earlyAlertOutcomeId',type:'string'}, + {name:'earlyAlertOutcomeOtherDescription',type:'string'}, + {name:'earlyAlertReferralIds',type:'auto'}, + {name:'earlyAlertOutreachIds',type:'auto'}, + {name:'comment',type:'string'}] }); \ No newline at end of file diff --git a/src/main/webapp/app/store/admin/AdminTreeMenus.js b/src/main/webapp/app/store/admin/AdminTreeMenus.js index f18588656b..299e20f59b 100644 --- a/src/main/webapp/app/store/admin/AdminTreeMenus.js +++ b/src/main/webapp/app/store/admin/AdminTreeMenus.js @@ -1,1204 +1,1132 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.store.admin.AdminTreeMenus', { - extend: 'Ext.data.TreeStore', - mixins: ['Deft.mixin.Injectable'], - inject: { - columnRendererUtils: 'columnRendererUtils', - colorsStore: 'colorsStore', - colorsUnpagedStore: 'colorsUnpagedStore', - colorsAllStore: 'colorsAllStore', - colorsAllUnpagedStore: 'colorsAllUnpagedStore', - confidentialityLevelOptionsStore: 'confidentialityLevelOptionsStore', - }, - autoLoad: false, - constructor: function(){ - var me = this; - var items = { - text: 'Administrative Tools', - title: 'Administrative Tools', - form: '', - expanded: true, - children: [ - { - text: 'Accommodation', - title: 'Accommodation', - form: '', - expanded: false, - children: [{ - text: 'Disability Accommodations', - title: 'Disability Accommodations', - store: 'disabilityAccommodationsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [ - { - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - renderer: me.columnRendererUtils.renderObjectStatus, - flex: .10, - field: { - xtype: 'oscheckbox' - } - },{ - header: 'Name', - dataIndex: 'name', - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: 1 - }, { - header: 'Additional Desc', - required: true, - dataIndex: 'useDescription', - flex: .2, - renderer: me.columnRendererUtils.renderFriendlyBoolean, - field: { - xtype: 'checkbox' - } - }, { - header: 'Desc Label', - required: false, - dataIndex: 'descriptionFieldLabel', - field: { - xtype: 'textfield' - }, - flex: .2 - }, { - header: 'Long/Short Desc', - required: false, - dataIndex: 'descriptionFieldType', - field: { - xtype: 'textfield' - }, - flex: .2 - }] - }, { - text: 'Disability Agencies', - title: 'Disability Agencies', - store: 'disabilityAgenciesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Disability Statuses', - title: 'Disability Statuses', - store: 'disabilityStatusesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Disability Types', - title: 'Disability Types', - store: 'disabilityTypesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }] - }, { - text: 'Caseload Assignment', - title: 'Caseload Assignment', - form: '', - expanded: false, - children: [{ - text: 'Program Status Change Reasons', - title: 'Program Status Change Reasons', - store: 'programStatusChangeReasonsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - },{ - text: 'Referral Sources', - title: 'Referral Sources', - store: 'referralSourcesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Special Service Groups', - title: 'Special Service Groups', - store: 'specialServiceGroupsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Service Reasons', - title: 'Service Reasons', - store: 'serviceReasonsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Student Types', - title: 'Student Types', - store: 'studentTypes', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - flex: .2, - renderer: me.columnRendererUtils.renderObjectStatus, - field: { - xtype: 'oscheckbox', - fieldStyle: "margin-bottom:12px;" - } - },{ - header: 'Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }, { - header: 'Description', - required: false, - dataIndex: 'description', - field: { - xtype: 'textfield' - }, - flex: 1 - }, { - header: 'Require Initial Appointment', - required: true, - dataIndex: 'requireInitialAppointment', - flex: .25, - renderer: me.columnRendererUtils.renderFriendlyBoolean, - field: { - xtype: 'checkbox' - } - }, { - header: 'Student Type Code', - required: true, - dataIndex: 'code', - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }] - }, { - text: 'Re-Assignment', - title: 'Re-Assignment', - store: 'Re-Assignment', - form: 'caseloadreassignment', - leaf: true - } ] - }, { - text: 'Student Intake', - title: 'Student Intake', - form: '', - expanded: false, - children: [{ - text: 'Child Care Arrangements', - title: 'Child Care Arrangements', - store: 'childCareArrangementsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'CompletedItem', - title: 'CompletedItem', - store: 'completedItem', - form: 'AbstractReferenceAdmin', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - leaf: true - },{ - text: 'Citizenships', - title: 'Citizenships', - store: 'citizenshipsAll', - form: 'AbstractReferenceAdmin', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - leaf: true - }, { - text: 'Confidentiality Disclosure Agreement', - title: 'Confidentiality Disclosure Agreement', - store: '', - form: 'ConfidentialityDisclosureAgreementAdmin', - leaf: true - }, { - text: 'Education Goals', - title: 'Education Goals', - store: 'educationGoalsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Education Levels', - title: 'Education Levels', - store: 'educationLevelsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Ethnicities', - title: 'Ethnicities', - store: 'ethnicitiesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Races', - title: 'Races', - store: 'racesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - flex: .2, - renderer: me.columnRendererUtils.renderObjectStatus, - field: { - xtype: 'oscheckbox', - fieldStyle: "margin-bottom:12px;" - } - },{ - header: 'Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }, { - header: 'Description', - required: false, - dataIndex: 'description', - field: { - xtype: 'textfield' - }, - flex: 1 - }, { - header: 'Race Code', - required: true, - dataIndex: 'code', - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }] - }, - { - text: 'Coursework Hours', - title: 'Coursework Hours', - store: 'courseworkHoursAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Funding Sources', - title: 'Funding Sources', - store: 'fundingSourcesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Marital Statuses', - title: 'Marital Statuses', - store: 'maritalStatusesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Military Affiliations', - title: 'Military Affiliations', - store: 'militaryAffiliationsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - },{ - text: 'Registration Loads', - title: 'Registration Loads', - store: 'registrationLoadsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Student Statuses', - title: 'Student Statuses', - store: 'studentStatusesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Veteran Statuses', - title: 'Veteran Statuses', - store: 'veteranStatusesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }] - }, { - text: 'Counseling Reference Guide', - title: 'Counseling Reference Guide', - form: '', - expanded: false, - children: [{ - text: 'Categories', - title: 'Categories', - store: 'challengeCategoriesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Challenges', - title: 'Challenges', - store: '', - form: 'ChallengeAdmin', - leaf: true - }, { - text: 'Referrals', - title: 'Referrals', - store: '', - form: 'ChallengeReferralAdmin', - leaf: true - }] - }, { - text: 'MyGPS', - title: 'MyGPS', - form: '', - expanded: false, - children: [{ - text: 'Self Help Guides', - title: 'Self Help Guides', - store: 'selfHelpGuides', - form: 'selfhelpguideadmin', - leaf: true - }] - }, { - text: 'Security', - title: 'Security', - form: '', - expanded: false, - children: [{ - text: 'Confidentiality Levels', - title: 'Confidentiality Levels', - store: 'confidentialityLevelsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [ - { - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - renderer: me.columnRendererUtils.renderObjectStatus, - flex: .10, - field: { - xtype: 'oscheckbox' - } - }, - { - header: 'Name', - dataIndex: 'name', - required: true, - flex: .20, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - } - }, { - header: 'Description', - dataIndex: 'description', - flex: .30, - field: { - xtype: 'textfield' - } - }, { - header: 'Acronym', - dataIndex: 'acronym', - required: true, - flex: .10, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }}, - { - header: 'Data Permission', - dataIndex: 'permission', - required: true, - field: { - xtype: 'combo', - store: me.confidentialityLevelOptionsStore, - displayField: 'name', - valueField:'name', - typeAhead: true, - forceSelection: false, - associativeField: 'permission' - }, - flex: .3 - }] - }, { - text: 'OAuth2 Clients', - title: 'OAuth2 Clients', - store: 'oauth2Clients', - form: 'oauth2clientadmin', - leaf: true - }] - }, { - text: 'Early Alert', - title: 'Early Alert', - form: '', - expanded: false, - children: [{ - text: 'Campuses', - title: 'Campuses', - store: '', - form: 'CampusAdmin', - leaf: true - }, { - text: 'Outcomes', - title: 'Outcomes', - store: 'earlyAlertOutcomesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Outreaches', - title: 'Outreaches', - store: 'earlyAlertOutreachesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Reasons', - title: 'Reasons', - store: 'earlyAlertReasonsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Referrals', - title: 'Referrals', - store: 'earlyAlertReferralsAll', - form: 'AbstractReferenceAdmin', - leaf: true, - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - columns: [ - { - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - renderer: me.columnRendererUtils.renderObjectStatus, - flex: .10, - field: { - xtype: 'oscheckbox' - } - },{ - header: 'Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: 50 - }, { - header: 'Description', - required: false, - dataIndex: 'description', - flex: 80, - field: { - xtype: 'textfield' - }, - }, { - header: 'Acronym', - required: true, - dataIndex: 'acronym', - flex: 10, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - } - }, { - header: 'Referral Email', - required: false, - dataIndex: 'recipientEmailAddress', - renderer: me.columnRendererUtils.renderValidEmail, - flex: 25, - field: { - xtype: 'textfield', - vtype: 'email' - } - }, { - header: 'Carbon Copy(s)', - required: false, - dataIndex: 'carbonCopy', - renderer: me.columnRendererUtils.renderValidEmail, - flex: 50, - field: { - xtype: 'textfield', - vtype: 'multiemail' - } - }] - }, { - text: 'Suggestions', - title: 'Suggestions', - store: 'earlyAlertSuggestionsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }] - }, { - text: 'Journal', - title: 'Journal', - form: '', - expanded: false, - children: [{ - text: 'Sources', - title: 'Sources', - store: 'journalSourcesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }, { - text: 'Details', - title: 'Details', - store: '', - form: 'JournalStepDetailAdmin', - leaf: true - }, { - text: 'Steps', - title: 'Steps', - store: '', - form: 'JournalStepAdmin', - leaf: true - }, { - text: 'Tracks', - title: 'Tracks', - store: 'journalTracksAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true - }] - }, { - text: 'System Configuration', - title: 'System Configuration', - form: '', - expanded: false, - children: [{ - text: 'Configuration Options', - title: 'Configuration Options', - store: 'configurationOptions', - form: 'configurationoptionsadmin', - leaf: true - },{ - text: 'Enrollment Statuses', - title: 'Enrollment Statuses', - store: 'enrollmentStatuses', - viewConfig: { - markDirty: false - }, - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - renderer: me.columnRendererUtils.renderObjectStatus, - flex: .20, - field: { - xtype: 'oscheckbox' - } - }, { - header: 'Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .20 - }, { - header: 'Code', - dataIndex: 'code', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .20 - }, { - header: 'Description', - dataIndex: 'description', - field: { - xtype: 'textfield' - }, - flex: 1 - }] - }, { - text: 'Message Templates', - title: 'Message Templates', - store: 'messageTemplates', - form: 'messagetemplatesadmin', - leaf: true - } - , - { - text: 'Text', - title: 'Text', - store: 'text', - interfaceOptions: { - addButtonVisible: false, - deleteButtonVisible: false, - hasPagingToolbar: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [ - { - header: 'Name', - dataIndex: 'name', - required: true, - rowEditable: false, - flex: .10, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - } - }, { - header: 'Value', - dataIndex: 'value', - flex: .10, - field: { - xtype: 'textfield' - } - }, { - header: 'Code', - rowEditable: false, - dataIndex: 'code', - filterable: true, - flex: .20, - field: { - xtype: 'textfield' - } - }, { - header: 'Description', - dataIndex: 'description', - flex: .20, - field: { - xtype: 'textfield' - } - }] - } ] - } , {text: 'Main Tool', - title: 'Main Tool', - form: '', - expanded: false, - children: [{ - text: 'SAP Statuses', - title: 'SAP Statuses', - store: 'sapStatusesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - flex: .2, - renderer: me.columnRendererUtils.renderObjectStatus, - field: { - xtype: 'oscheckbox', - fieldStyle: "margin-bottom:12px;" - } - },{ - header: 'Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }, { - header: 'Description', - required: false, - dataIndex: 'description', - field: { - xtype: 'textfield' - }, - flex: 1 - }, { - header: 'SAP Code', - required: true, - dataIndex: 'code', - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }] - }, { - text: 'Financial Aid Files', - title: 'Financial Aid Files', - store: 'financialAidFilesAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - flex: .2, - renderer: me.columnRendererUtils.renderObjectStatus, - field: { - xtype: 'oscheckbox', - fieldStyle: "margin-bottom:12px;" - } - },{ - header: 'Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }, { - header: 'Description', - required: false, - dataIndex: 'description', - field: { - xtype: 'textfield' - }, - flex: 1 - }, { - header: 'File Code', - required: true, - dataIndex: 'code', - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .25 - }] - }] - },{ - text: 'MAP', - title: 'MAP', - form: '', - expanded: false, - children: [{ - text: 'Electives', - title: 'Electives', - store: 'electivesAll', - sort: { - field: 'sortOrder' - }, - viewConfig: { - markDirty: false - }, - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false, - dragAndDropReorder: true, - headerInstructions: "Double-click to edit and drag to re-order items.", - storeDependencies: [{ - name: "colors", - store: me.colorsAllUnpagedStore, - clearFilter: true - }] - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Order', - dataIndex: 'sortOrder', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;", - allowBlank: false - }, - flex: .1 - }, { - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - flex: .2, - renderer: me.columnRendererUtils.renderObjectStatus, - field: { - xtype: 'oscheckbox', - fieldStyle: "margin-bottom:12px;" - } - }, { - header: 'Elective Name', - dataIndex: 'name', - required: true, - defaultValue: "", - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;", - allowBlank: false - }, - flex: .2 - }, { - header: 'Elective Code', - dataIndex: 'code', - defaultValue: "", - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;", - allowBlank: false - }, - flex: .2 - }, { - header: 'Description', - dataIndex: 'description', - defaultValue: "", - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;" - }, - flex: 1 - }, { - header: 'Color', - dataIndex: 'color', - renderer: me.columnRendererUtils.renderElectiveColor, - required: true, - field: { - xtype: 'combo', - store: me.colorsAllUnpagedStore, - displayField: 'name', - valueField: 'id', - forceSelection: true, - associativeField: 'color' - }, - flex: .2 - }] - }, { - text: 'Colors', - title: 'Color Management', - store: 'colorsAll', - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - renderer: me.columnRendererUtils.renderObjectStatus, - flex: .20, - field: { - xtype: 'oscheckbox', - fieldStyle: "margin-bottom:12px;" - } - }, { - header: 'Color Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;", - allowBlank: false - }, - flex: .20 - }, { - header: 'Color Code', - dataIndex: 'code', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;", - allowBlank: false - }, - flex: .20 - }, { - header: 'Hex Code', - dataIndex: 'hexCode', - renderer: me.columnRendererUtils.renderHex, - required: true, - field: { - xtype: 'sspcolorpicker' - }, - flex: .20 - }, { - header: 'Description', - dataIndex: 'description', - field: { - xtype: 'textfield', - fieldStyle: "margin-bottom:12px;" - }, - flex: 1 - }] - }, { - text: 'Tags', - title: 'Tag Management', - store: 'tags', - viewConfig: { - markDirty: false - }, - interfaceOptions: { - addButtonVisible: true, - deleteButtonVisible: false - }, - form: 'AbstractReferenceAdmin', - leaf: true, - columns: [{ - header: 'Active', - required: true, - dataIndex: 'objectStatus', - defaultValue: true, - renderer: me.columnRendererUtils.renderObjectStatus, - flex: .20, - field: { - xtype: 'oscheckbox' - } - }, { - header: 'Tag Name', - dataIndex: 'name', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .20 - }, { - header: 'Tag Code', - dataIndex: 'code', - required: true, - editor:{ - allowBlank: false - }, - field: { - xtype: 'textfield', - allowBlank: false - }, - flex: .20 - }, { - header: 'Description', - dataIndex: 'description', - field: { - xtype: 'textfield' - }, - flex: 1 - }] - }] - }] - }; - - Ext.apply(me, { - root: items, - folderSort: true, - sorters: [{ - property: 'text', - direction: 'ASC' - }] - }); - return me.callParent(arguments); - } +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions Data view to Admin Tool + */ +Ext.define('Ssp.store.admin.AdminTreeMenus', { + extend: 'Ext.data.TreeStore', + mixins: ['Deft.mixin.Injectable'], + inject: { + columnRendererUtils: 'columnRendererUtils', + colorsStore: 'colorsStore', + colorsUnpagedStore: 'colorsUnpagedStore', + colorsAllStore: 'colorsAllStore', + colorsAllUnpagedStore: 'colorsAllUnpagedStore', + confidentialityLevelOptionsStore: 'confidentialityLevelOptionsStore', + }, + autoLoad: false, + constructor: function(){ + + var me = this; + var items = { + text: 'Administrative Tools', + title: 'Administrative Tools', + form: '', + expanded: true, + children: [ + { + text: 'Accommodation', + title: 'Accommodation', + form: '', + expanded: false, + children: [{ + text: 'Disability Accommodations', + title: 'Disability Accommodations', + store: 'disabilityAccommodationsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [ + { + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + renderer: me.columnRendererUtils.renderActive, + flex: .10, + field: { + xtype: 'checkbox' + } + },{ + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: 1 + }, { + header: 'Additional Desc', + required: true, + dataIndex: 'useDescription', + flex: .2, + renderer: me.columnRendererUtils.renderFriendlyBoolean, + field: { + xtype: 'checkbox' + } + }, { + header: 'Desc Label', + required: false, + dataIndex: 'descriptionFieldLabel', + field: { + xtype: 'textfield' + }, + flex: .2 + }, { + header: 'Long/Short Desc', + required: false, + dataIndex: 'descriptionFieldType', + field: { + xtype: 'textfield' + }, + flex: .2 + }] + }, { + text: 'Disability Agencies', + title: 'Disability Agencies', + store: 'disabilityAgenciesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Disability Statuses', + title: 'Disability Statuses', + store: 'disabilityStatusesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Disability Types', + title: 'Disability Types', + store: 'disabilityTypesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }] + }, { + text: 'Caseload Assignment', + title: 'Caseload Assignment', + form: '', + expanded: false, + children: [{ + text: 'Program Status Change Reasons', + title: 'Program Status Change Reasons', + store: 'programStatusChangeReasonsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + },{ + text: 'Referral Sources', + title: 'Referral Sources', + store: 'referralSourcesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Special Service Groups', + title: 'Special Service Groups', + store: 'specialServiceGroupsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Service Reasons', + title: 'Service Reasons', + store: 'serviceReasonsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Student Types', + title: 'Student Types', + store: 'studentTypes', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + flex: .2, + renderer: me.columnRendererUtils.renderActive, + field: { + xtype: 'checkbox', + fieldStyle: "margin-bottom:12px;" + } + },{ + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: .25 + }, { + header: 'Description', + required: false, + dataIndex: 'description', + field: { + xtype: 'textfield' + }, + flex: 1 + }, { + header: 'Require Initial Appointment', + required: true, + dataIndex: 'requireInitialAppointment', + flex: .25, + renderer: me.columnRendererUtils.renderFriendlyBoolean, + field: { + xtype: 'checkbox' + } + }, { + header: 'Student Type Code', + required: true, + dataIndex: 'code', + field: { + xtype: 'textfield' + }, + flex: .25 + }] + }, { + text: 'Re-Assignment', + title: 'Re-Assignment', + store: 'Re-Assignment', + form: 'caseloadreassignment', + leaf: true + } ] + }, { + text: 'Student Intake', + title: 'Student Intake', + form: '', + expanded: false, + children: [{ + text: 'Child Care Arrangements', + title: 'Child Care Arrangements', + store: 'childCareArrangementsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'CompletedItem', + title: 'CompletedItem', + store: 'completedItem', + form: 'AbstractReferenceAdmin', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + leaf: true + },{ + text: 'Citizenships', + title: 'Citizenships', + store: 'citizenshipsAll', + form: 'AbstractReferenceAdmin', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + leaf: true + }, { + text: 'Confidentiality Disclosure Agreement', + title: 'Confidentiality Disclosure Agreement', + store: '', + form: 'ConfidentialityDisclosureAgreementAdmin', + leaf: true + }, { + text: 'Education Goals', + title: 'Education Goals', + store: 'educationGoalsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Education Levels', + title: 'Education Levels', + store: 'educationLevelsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Ethnicities', + title: 'Ethnicities', + store: 'ethnicitiesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Races', + title: 'Races', + store: 'racesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + flex: .2, + renderer: me.columnRendererUtils.renderActive, + field: { + xtype: 'checkbox', + fieldStyle: "margin-bottom:12px;" + } + },{ + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: .25 + }, { + header: 'Description', + required: false, + dataIndex: 'description', + field: { + xtype: 'textfield' + }, + flex: 1 + }, { + header: 'Race Code', + required: true, + dataIndex: 'code', + field: { + xtype: 'textfield' + }, + flex: .25 + }] + }, + { + text: 'Coursework Hours', + title: 'Coursework Hours', + store: 'courseworkHoursAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Funding Sources', + title: 'Funding Sources', + store: 'fundingSourcesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Marital Statuses', + title: 'Marital Statuses', + store: 'maritalStatusesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Military Affiliations', + title: 'Military Affiliations', + store: 'militaryAffiliationsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + },{ + text: 'Registration Loads', + title: 'Registration Loads', + store: 'registrationLoadsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Student Statuses', + title: 'Student Statuses', + store: 'studentStatusesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Veteran Statuses', + title: 'Veteran Statuses', + store: 'veteranStatusesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }] + }, { + text: 'Counseling Reference Guide', + title: 'Counseling Reference Guide', + form: '', + expanded: false, + children: [{ + text: 'Categories', + title: 'Categories', + store: 'challengeCategories', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Challenges', + title: 'Challenges', + store: '', + form: 'ChallengeAdmin', + leaf: true + }, { + text: 'Referrals', + title: 'Referrals', + store: '', + form: 'ChallengeReferralAdmin', + leaf: true + }] + }, { + text: 'MyGPS', + title: 'MyGPS', + form: '', + expanded: false, + children: [{ + text: 'Self Help Guides', + title: 'Self Help Guides', + store: 'selfHelpGuides', + form: 'selfhelpguideadmin', + leaf: true + }] + }, { + text: 'Security', + title: 'Security', + form: '', + expanded: false, + children: [{ + text: 'Confidentiality Levels', + title: 'Confidentiality Levels', + store: 'confidentialityLevelsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [ + { + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + renderer: me.columnRendererUtils.renderActive, + flex: .10, + field: { + xtype: 'checkbox' + } + }, + { + header: 'Name', + dataIndex: 'name', + required: true, + flex: .20, + field: { + xtype: 'textfield' + } + }, { + header: 'Description', + dataIndex: 'description', + flex: .30, + field: { + xtype: 'textfield' + } + }, { + header: 'Acronym', + dataIndex: 'acronym', + required: true, + flex: .10, + field: { + xtype: 'textfield' + }}, + { + header: 'Data Permission', + dataIndex: 'dataPermission', + required: true, + field: { + xtype: 'combo', + store: me.confidentialityLevelOptionsStore, + displayField: 'name', + typeAhead: true, + mode:'local', + queryMode:'local', + forceSelection: false, + associativeField: 'dataPermission' + }, + flex: .3 + }] + }, { + text: 'OAuth2 Clients', + title: 'OAuth2 Clients', + store: 'oauth2Clients', + form: 'oauth2clientadmin', + leaf: true + }] + }, { + text: 'EarlyAlert', + title: 'EarlyAlert', + form: '', + expanded: false, + children: [{ + text: 'Campuses', + title: 'Campuses', + store: '', + form: 'CampusAdmin', + leaf: true + }, { + text: 'Outcomes', + title: 'Outcomes', + store: 'earlyAlertOutcomesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'EarlyAlerts', + title: 'EarlyAlerts', + store: 'earlyAlertOutreachesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Reasons', + title: 'Reasons', + store: 'earlyAlertReasonsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Referrals', + title: 'Referrals', + store: 'earlyAlertReferralsAll', + form: 'AbstractReferenceAdmin', + leaf: true, + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + columns: [ + { + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + renderer: me.columnRendererUtils.renderActive, + flex: .10, + field: { + xtype: 'checkbox' + } + },{ + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: 50 + }, { + header: 'Description', + required: false, + dataIndex: 'description', + flex: 80, + field: { + xtype: 'textfield' + }, + }, { + header: 'Acronym', + required: true, + dataIndex: 'acronym', + flex: 10, + field: { + xtype: 'textfield' + } + }, { + header: 'Referral Email', + required: false, + dataIndex: 'recipientEmailAddress', + renderer: me.columnRendererUtils.renderValidEmail, + flex: 25, + field: { + xtype: 'textfield', + vtype: 'email' + } + }, { + header: 'Carbon Copy(s)', + required: false, + dataIndex: 'carbonCopy', + renderer: me.columnRendererUtils.renderValidEmail, + flex: 50, + field: { + xtype: 'textfield', + vtype: 'multiemail' + } + }] + }, { + text: 'Suggestions', + title: 'Suggestions', + store: 'earlyAlertSuggestionsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }//TAPS 20140039 BEGIN + , { + text: 'Interventions', + title: 'Interventions', + store: 'earlyAlertInterventionsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }] //TAPS 20140039 END + }, { + text: 'Journal', + title: 'Journal', + form: '', + expanded: false, + children: [{ + text: 'Sources', + title: 'Sources', + store: 'journalSourcesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }, { + text: 'Details', + title: 'Details', + store: '', + form: 'JournalStepDetailAdmin', + leaf: true + }, { + text: 'Steps', + title: 'Steps', + store: '', + form: 'JournalStepAdmin', + leaf: true + }, { + text: 'Tracks', + title: 'Tracks', + store: 'journalTracksAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true + }] + }, { + text: 'System Configuration', + title: 'System Configuration', + form: '', + expanded: false, + children: [{ + text: 'Configuration Options', + title: 'Configuration Options', + store: 'configurationOptions', + form: 'configurationoptionsadmin', + leaf: true + },{ + text: 'Enrollment Statuses', + title: 'Enrollment Statuses', + store: 'enrollmentStatuses', + viewConfig: { + markDirty: false + }, + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + renderer: me.columnRendererUtils.renderActive, + flex: .20, + field: { + xtype: 'checkbox' + } + }, { + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: .20 + }, { + header: 'Code', + dataIndex: 'code', + required: true, + field: { + xtype: 'textfield' + }, + flex: .20 + }, { + header: 'Description', + dataIndex: 'description', + field: { + xtype: 'textfield' + }, + flex: 1 + }] + }, { + text: 'Message Templates', + title: 'Message Templates', + store: 'messageTemplates', + form: 'messagetemplatesadmin', + leaf: true + } + , + { + text: 'Text', + title: 'Text', + store: 'text', + interfaceOptions: { + addButtonVisible: false, + deleteButtonVisible: false, + hasPagingToolbar: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [ + { + header: 'Name', + dataIndex: 'name', + required: true, + rowEditable: false, + flex: .10, + field: { + xtype: 'textfield' + } + }, { + header: 'Value', + dataIndex: 'value', + flex: .10, + field: { + xtype: 'textfield' + } + }, { + header: 'Code', + rowEditable: false, + dataIndex: 'code', + filterable: true, + flex: .20, + field: { + xtype: 'textfield' + } + }, { + header: 'Description', + dataIndex: 'description', + flex: .20, + field: { + xtype: 'textfield' + } + }] + } ] + } , {text: 'Main Tool', + title: 'Main Tool', + form: '', + expanded: false, + children: [{ + text: 'SAP Statuses', + title: 'SAP Statuses', + store: 'sapStatusesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + flex: .2, + renderer: me.columnRendererUtils.renderActive, + field: { + xtype: 'checkbox', + fieldStyle: "margin-bottom:12px;" + } + },{ + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: .25 + }, { + header: 'Description', + required: false, + dataIndex: 'description', + field: { + xtype: 'textfield' + }, + flex: 1 + }, { + header: 'SAP Code', + required: true, + dataIndex: 'code', + field: { + xtype: 'textfield' + }, + flex: .25 + }] + }, { + text: 'Financial Aid Files', + title: 'Financial Aid Files', + store: 'financialAidFilesAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + flex: .2, + renderer: me.columnRendererUtils.renderActive, + field: { + xtype: 'checkbox', + fieldStyle: "margin-bottom:12px;" + } + },{ + header: 'Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: .25 + }, { + header: 'Description', + required: false, + dataIndex: 'description', + field: { + xtype: 'textfield' + }, + flex: 1 + }, { + header: 'File Code', + required: true, + dataIndex: 'code', + field: { + xtype: 'textfield' + }, + flex: .25 + }] + }] + },{ + text: 'MAP', + title: 'MAP', + form: '', + expanded: false, + children: [{ + text: 'Electives', + title: 'Electives', + store: 'electivesAll', + sort: { + field: 'sortOrder', + direction: 'ASC' //or 'DESC' + }, + viewConfig: { + markDirty: false + }, + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false, + dragAndDropReorder: true, + headerInstructions: "Double-click to edit and drag to re-order items.", + storeDependencies: [{ + name: "colors", + store: me.colorsAllUnpagedStore, + clearFilter: true + }] + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Order', + dataIndex: 'sortOrder', + required: true, + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: .1 + }, { + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + flex: .2, + renderer: me.columnRendererUtils.renderActive, + field: { + xtype: 'checkbox', + fieldStyle: "margin-bottom:12px;" + } + }, { + header: 'Elective Name', + dataIndex: 'name', + required: true, + defaultValue: "", + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: .2 + }, { + header: 'Elective Code', + dataIndex: 'code', + defaultValue: "", + required: true, + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: .2 + }, { + header: 'Description', + dataIndex: 'description', + defaultValue: "", + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: 1 + }, { + header: 'Color', + dataIndex: 'color', + renderer: me.columnRendererUtils.renderElectiveColor, + required: true, + field: { + xtype: 'combo', + store: me.colorsAllUnpagedStore, + displayField: 'name', + valueField: 'id', + forceSelection: true, + associativeField: 'color' + }, + flex: .2 + }] + }, { + text: 'Colors', + title: 'Color Management', + store: 'colorsAll', + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + renderer: me.columnRendererUtils.renderActive, + flex: .20, + field: { + xtype: 'checkbox', + fieldStyle: "margin-bottom:12px;" + } + }, { + header: 'Color Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: .20 + }, { + header: 'Color Code', + dataIndex: 'code', + required: true, + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: .20 + }, { + header: 'Hex Code', + dataIndex: 'hexCode', + renderer: me.columnRendererUtils.renderHex, + required: true, + field: { + xtype: 'sspcolorpicker' + }, + flex: .20 + }, { + header: 'Description', + dataIndex: 'description', + field: { + xtype: 'textfield', + fieldStyle: "margin-bottom:12px;" + }, + flex: 1 + }] + }, { + text: 'Tags', + title: 'Tag Management', + store: 'tags', + viewConfig: { + markDirty: false + }, + interfaceOptions: { + addButtonVisible: true, + deleteButtonVisible: false + }, + form: 'AbstractReferenceAdmin', + leaf: true, + columns: [{ + header: 'Active', + required: true, + dataIndex: 'active', + defaultValue: true, + renderer: me.columnRendererUtils.renderActive, + flex: .20, + field: { + xtype: 'checkbox' + } + }, { + header: 'Tag Name', + dataIndex: 'name', + required: true, + field: { + xtype: 'textfield' + }, + flex: .20 + }, { + header: 'Tag Code', + dataIndex: 'code', + required: true, + field: { + xtype: 'textfield' + }, + flex: .20 + }, { + header: 'Description', + dataIndex: 'description', + field: { + xtype: 'textfield' + }, + flex: 1 + }] + }] + }] + }; + + Ext.apply(me, { + root: items, + folderSort: true, + sorters: [{ + property: 'text', + direction: 'ASC' + }] + }); + return me.callParent(arguments); + } }); \ No newline at end of file diff --git a/src/main/webapp/app/store/reference/EarlyAlertInterventions.js b/src/main/webapp/app/store/reference/EarlyAlertInterventions.js new file mode 100644 index 0000000000..b9c0c9cffd --- /dev/null +++ b/src/main/webapp/app/store/reference/EarlyAlertInterventions.js @@ -0,0 +1,32 @@ +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + /* + * IRSC CUSTOMIZATIONS + * 06/12/2014 - Jonathan Hart IRSC TAPS 20140039 - Created NEW File EarlyAlertInterventions.js to extend AbstractReferences data store + */ +Ext.define('Ssp.store.reference.EarlyAlertInterventions', { + extend: 'Ssp.store.reference.AbstractReferences', + model: 'Ssp.model.reference.EarlyAlertIntervention', + constructor: function(){ + this.callParent(arguments); + Ext.apply(this.getProxy(),{url: this.getProxy().url + this.apiProperties.getItemUrl('earlyAlertIntervention'), + extraParams: this.extraParams}); + } +}); \ No newline at end of file diff --git a/src/main/webapp/app/util/Constants.js b/src/main/webapp/app/util/Constants.js index af8a8ba6f3..8b58d77f3a 100644 --- a/src/main/webapp/app/util/Constants.js +++ b/src/main/webapp/app/util/Constants.js @@ -1,147 +1,147 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.util.Constants',{ - extend: 'Ext.Component', - - statics: { - /* - * id values referenced in the restrictedIds Array will be restricted - * from administrative functionality through the use of a - * test against a supplied id value. In general, these - * items are critically linked to other operations in the UI, - * such as a field value like 'Other' which displays a description - * field to collect additional associated data. - * - * For example: - * This method can be used inside a function call from a button or other - * interface item to determine if the item is restricted. - * Ssp.util.Constants.isRestrictedAdminItemId( selection.get('id') ) - * - */ - isRestrictedAdminItemId: function( id ){ - var restrictedIds = [ - Ssp.util.Constants.DISABILITY_AGENCY_OTHER_ID, - Ssp.util.Constants.EDUCATION_GOAL_OTHER_ID, - Ssp.util.Constants.EDUCATION_GOAL_MILITARY_ID, - Ssp.util.Constants.EDUCATION_GOAL_BACHELORS_DEGREE_ID, - Ssp.util.Constants.EDUCATION_LEVEL_NO_DIPLOMA_GED_ID, - Ssp.util.Constants.EDUCATION_LEVEL_GED_ID, - Ssp.util.Constants.EDUCATION_LEVEL_HIGH_SCHOOL_GRADUATION_ID, - Ssp.util.Constants.EDUCATION_LEVEL_SOME_COLLEGE_CREDITS_ID, - Ssp.util.Constants.EDUCATION_LEVEL_OTHER_ID, - Ssp.util.Constants.FUNDING_SOURCE_OTHER_ID, - Ssp.util.Constants.CHALLENGE_OTHER_ID, - Ssp.util.Constants.EARLY_ALERT_STUDENT_TYPE, - Ssp.util.Constants.OTHER_EARLY_ALERT_OUTCOME_ID, - Ssp.util.Constants.OTHER_EARLY_ALERT_REASON_ID, - Ssp.util.Constants.OTHER_EARLY_ALERT_SUGGESTION_ID, - Ssp.util.Constants.EARLY_ALERT_JOURNAL_TRACK_ID, - Ssp.util.Constants.ACTIVE_PROGRAM_STATUS_ID, - Ssp.util.Constants.NO_SHOW_PROGRAM_STATUS_ID, - Ssp.util.Constants.NON_PARTICIPATING_PROGRAM_STATUS_ID, - Ssp.util.Constants.INACTIVE_PROGRAM_STATUS_ID, - Ssp.util.Constants.TRANSITIONED_PROGRAM_STATUS_ID - ]; - return ((Ext.Array.indexOf( restrictedIds, id ) != -1)? true : false); - }, - - // DEFAULT CONFIDENTIALITY LEVEL ID - // If a value is assigned here then it will be used for the default - // confidentiality level for lists in the SSP portlet. - // default to EVERYONE: 'b3d077a7-4055-0510-7967-4a09f93a0357' - DEFAULT_SYSTEM_CONFIDENTIALITY_LEVEL_ID: '', - - // DISABILITY AGENCY - ID VALUES RELATED TO ACCOMMODATION DISABILITY AGENCIES - DISABILITY_AGENCY_OTHER_ID: '224b03d9-90da-4f9c-8959-ea2e97661f40', - - // EDUCATION GOALS - ID VALUES RELATED TO STUDENT INTAKE EDUCATION GOALS - EDUCATION_GOAL_OTHER_ID: '78b54da7-fb19-4092-bb44-f60485678d6b', - EDUCATION_GOAL_MILITARY_ID: '6c466885-d3f8-44d1-a301-62d6fe2d3553', - EDUCATION_GOAL_BACHELORS_DEGREE_ID: 'efeb5536-d634-4b79-80bc-1e1041dcd3ff', - - // EDUCATION LEVELS - ID VALUES RELATED TO STUDENT INTAKE EDUCATION LEVELS - EDUCATION_LEVEL_NO_DIPLOMA_GED_ID: '5d967ba0-e086-4426-85d5-29bc86da9295', - EDUCATION_LEVEL_GED_ID: '710add1c-7b53-4cbe-86cb-8d7c5837d68b', - EDUCATION_LEVEL_HIGH_SCHOOL_GRADUATION_ID: 'f4780d23-fd8a-4758-b772-18606dca32f0', - EDUCATION_LEVEL_SOME_COLLEGE_CREDITS_ID: 'c5111182-9e2f-4252-bb61-d2cfa9700af7', - EDUCATION_LEVEL_OTHER_ID: '247165ae-3db4-4679-ac95-ca96488c3b27', - - // FUNDING SOURCES - ID VALUES RELATED TO STUDENT INTAKE FUNDING SOURCES - FUNDING_SOURCE_OTHER_ID: '365e8c95-f356-4f1f-8d79-4771ae8b0291', - - // CHALLENGES - ID VALUES RELATED TO STUDENT INTAKE CHALLENGES - CHALLENGE_OTHER_ID: '365e8c95-f356-4f1f-8d79-4771ae8b0291', - - //EARLY ALERT STUDENT TYPE - ID VALUE THAT IS USED WHEN EA IS PLACED ON STUDENT - //WITHOUT A STUDENT TYPE - EARLY_ALERT_STUDENT_TYPE: 'b2d05939-5056-a51a-8004-d803265d2645', - - // EARLY ALERT OUTCOME - ID VALUES RELATED TO EARLY ALERT OUTCOMES - OTHER_EARLY_ALERT_OUTCOME_ID: '0a080114-3799-1bf5-8137-9a778e200004', - OTHER_EARLY_ALERT_REASON_ID: 'b2d11335-5056-a51a-80ea-074f8fef94ea', - OTHER_EARLY_ALERT_SUGGESTION_ID: 'b2d1120c-5056-a51a-80ea-c779a3109f8f', - - // EARLY ALERT - JOURNAL TRACK - EARLY_ALERT_JOURNAL_TRACK_ID: 'b2d07b38-5056-a51a-809d-81ea2f3b27bf', - - // PROGRAM STATUS - ID VALUES RELATED TO PROGRAM STATUS REFERENCE DATA - ACTIVE_PROGRAM_STATUS_ID: 'b2d12527-5056-a51a-8054-113116baab88', - NON_PARTICIPATING_PROGRAM_STATUS_ID: 'b2d125c3-5056-a51a-8004-f1dbabde80c2', - NO_SHOW_PROGRAM_STATUS_ID: 'b2d12640-5056-a51a-80cc-91264965731a', - INACTIVE_PROGRAM_STATUS_ID: 'b2d125a4-5056-a51a-8042-d50b8eff0df1', - TRANSITIONED_PROGRAM_STATUS_ID: 'b2d125e3-5056-a51a-800f-6891bc7d1ddc', - - // ICON PATHS FOR ACTION STYLE GRID BUTTONS NOT APPLIED THROUGH CSS - GRID_ITEM_DELETE_ICON_PATH: '/ssp/images/delete-icon.png', - GRID_ITEM_EDIT_ICON_PATH: '/ssp/images/edit-icon.png', - - EDIT_COURSE_NOTE_NAME:'edit-existing-notes-large.png', - ADD_PLAN_NOTE_ICON_PATH: '/ssp/images/plan-notes.png', - - EDIT_TERM_NOTE_ICON_PATH: '/ssp/images/edit-existing-notes-small.png', - ADD_TERM_NOTE_ICON_PATH: '/ssp/images/edit-icon.png', - - EDIT_COURSE_NOTE_ICON_PATH: '/ssp/images/edit-existing-notes-large.png', - ADD_COURSE_NOTE_ICON_PATH: '/ssp/images/edit-icon.png', - - - GRID_ITEM_CLOSE_ICON_PATH: '/ssp/images/close-icon.jpg', - GRID_ITEM_MAIL_REPLY_ICON_PATH: '/ssp/images/mail-reply-icon.png', - DEFAULT_NO_STUDENT_PHOTO_URL:'/ssp/images/no-photo.jpg', - - // CAN BE APPLIED TO THE LABEL OF A FIELD TO SHOW A RED REQUIRED ASTERISK - REQUIRED_ASTERISK_DISPLAY: '*', - - // CAN BE APPLIED TO THE LABEL OF A FIELD OR CONTAINER TO ALTER THE LABEL STYLE - SSP_LABEL_STYLE: "color:#04408c;", - - SSP_EDITED_ROW_HIGHLIGHT_COLOR: "00AF33", - SSP_EDITED_ROW_HIGHLIGHT_OPTIONS: {attr:'color', duration: 5000}, - - // CONFIGURES THE MESSAGE DISPLAYED NEXT TO THE SAVE BUTTON FOR TOOLS WHERE A SAVE IS ON A SINGLE SCREEN - // FOR EXAMPLE: THIS FUNCTIONALITY IS APPLIED TO THE STUDENT INTAKE TOOL, ACTION PLAN STRENGTHS AND CONFIDENTIALITY DISCLOSURE AGREEMENT - DATA_SAVE_SUCCESS_MESSAGE_STYLE: "font-weight: 'bold'; color: rgb(0, 0, 0); padding-left: 2px;", - DATA_SAVE_SUCCESS_MESSAGE: '✓ Data was successfully saved', - DATA_SAVE_SUCCESS_MESSAGE_TIMEOUT: 3000 - }, - - initComponent: function() { - return this.callParent( arguments ); - } -}); \ No newline at end of file +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +Ext.define('Ssp.util.Constants',{ + extend: 'Ext.Component', + + statics: { + /* + * id values referenced in the restrictedIds Array will be restricted + * from administrative functionality through the use of a + * test against a supplied id value. In general, these + * items are critically linked to other operations in the UI, + * such as a field value like 'Other' which displays a description + * field to collect additional associated data. + * + * For example: + * This method can be used inside a function call from a button or other + * interface item to determine if the item is restricted. + * Ssp.util.Constants.isRestrictedAdminItemId( selection.get('id') ) + * + */ + isRestrictedAdminItemId: function( id ){ + var restrictedIds = [ + Ssp.util.Constants.DISABILITY_AGENCY_OTHER_ID, + Ssp.util.Constants.EDUCATION_GOAL_OTHER_ID, + Ssp.util.Constants.EDUCATION_GOAL_MILITARY_ID, + Ssp.util.Constants.EDUCATION_GOAL_BACHELORS_DEGREE_ID, + Ssp.util.Constants.EDUCATION_LEVEL_NO_DIPLOMA_GED_ID, + Ssp.util.Constants.EDUCATION_LEVEL_GED_ID, + Ssp.util.Constants.EDUCATION_LEVEL_HIGH_SCHOOL_GRADUATION_ID, + Ssp.util.Constants.EDUCATION_LEVEL_SOME_COLLEGE_CREDITS_ID, + Ssp.util.Constants.EDUCATION_LEVEL_OTHER_ID, + Ssp.util.Constants.FUNDING_SOURCE_OTHER_ID, + Ssp.util.Constants.CHALLENGE_OTHER_ID, + Ssp.util.Constants.EARLY_ALERT_STUDENT_TYPE, + Ssp.util.Constants.OTHER_EARLY_ALERT_OUTCOME_ID, + Ssp.util.Constants.OTHER_EARLY_ALERT_REASON_ID, + Ssp.util.Constants.OTHER_EARLY_ALERT_SUGGESTION_ID, + Ssp.util.Constants.EARLY_ALERT_JOURNAL_TRACK_ID, + Ssp.util.Constants.ACTIVE_PROGRAM_STATUS_ID, + Ssp.util.Constants.NO_SHOW_PROGRAM_STATUS_ID, + Ssp.util.Constants.NON_PARTICIPATING_PROGRAM_STATUS_ID, + Ssp.util.Constants.INACTIVE_PROGRAM_STATUS_ID, + Ssp.util.Constants.TRANSITIONED_PROGRAM_STATUS_ID + ]; + return ((Ext.Array.indexOf( restrictedIds, id ) != -1)? true : false); + }, + + // DEFAULT CONFIDENTIALITY LEVEL ID + // If a value is assigned here then it will be used for the default + // confidentiality level for lists in the SSP portlet. + // default to EVERYONE: 'b3d077a7-4055-0510-7967-4a09f93a0357' + DEFAULT_SYSTEM_CONFIDENTIALITY_LEVEL_ID: '', + + // DISABILITY AGENCY - ID VALUES RELATED TO ACCOMMODATION DISABILITY AGENCIES + DISABILITY_AGENCY_OTHER_ID: '224b03d9-90da-4f9c-8959-ea2e97661f40', + + // EDUCATION GOALS - ID VALUES RELATED TO STUDENT INTAKE EDUCATION GOALS + EDUCATION_GOAL_OTHER_ID: '78b54da7-fb19-4092-bb44-f60485678d6b', + EDUCATION_GOAL_MILITARY_ID: '6c466885-d3f8-44d1-a301-62d6fe2d3553', + EDUCATION_GOAL_BACHELORS_DEGREE_ID: 'efeb5536-d634-4b79-80bc-1e1041dcd3ff', + + // EDUCATION LEVELS - ID VALUES RELATED TO STUDENT INTAKE EDUCATION LEVELS + EDUCATION_LEVEL_NO_DIPLOMA_GED_ID: '5d967ba0-e086-4426-85d5-29bc86da9295', + EDUCATION_LEVEL_GED_ID: '710add1c-7b53-4cbe-86cb-8d7c5837d68b', + EDUCATION_LEVEL_HIGH_SCHOOL_GRADUATION_ID: 'f4780d23-fd8a-4758-b772-18606dca32f0', + EDUCATION_LEVEL_SOME_COLLEGE_CREDITS_ID: 'c5111182-9e2f-4252-bb61-d2cfa9700af7', + EDUCATION_LEVEL_OTHER_ID: '247165ae-3db4-4679-ac95-ca96488c3b27', + + // FUNDING SOURCES - ID VALUES RELATED TO STUDENT INTAKE FUNDING SOURCES + FUNDING_SOURCE_OTHER_ID: '365e8c95-f356-4f1f-8d79-4771ae8b0291', + + // CHALLENGES - ID VALUES RELATED TO STUDENT INTAKE CHALLENGES + CHALLENGE_OTHER_ID: '365e8c95-f356-4f1f-8d79-4771ae8b0291', + + //EARLY ALERT STUDENT TYPE - ID VALUE THAT IS USED WHEN EA IS PLACED ON STUDENT + //WITHOUT A STUDENT TYPE + EARLY_ALERT_STUDENT_TYPE: 'b2d05939-5056-a51a-8004-d803265d2645', + + // EARLY ALERT OUTCOME - ID VALUES RELATED TO EARLY ALERT OUTCOMES + OTHER_EARLY_ALERT_OUTCOME_ID: '0a080114-3799-1bf5-8137-9a778e200004', + OTHER_EARLY_ALERT_REASON_ID: 'b2d11335-5056-a51a-80ea-074f8fef94ea', + OTHER_EARLY_ALERT_SUGGESTION_ID: 'b2d1120c-5056-a51a-80ea-c779a3109f8f', + + // EARLY ALERT - JOURNAL TRACK + EARLY_ALERT_JOURNAL_TRACK_ID: 'b2d07b38-5056-a51a-809d-81ea2f3b27bf', + + // PROGRAM STATUS - ID VALUES RELATED TO PROGRAM STATUS REFERENCE DATA + ACTIVE_PROGRAM_STATUS_ID: 'b2d12527-5056-a51a-8054-113116baab88', + NON_PARTICIPATING_PROGRAM_STATUS_ID: 'b2d125c3-5056-a51a-8004-f1dbabde80c2', + NO_SHOW_PROGRAM_STATUS_ID: 'b2d12640-5056-a51a-80cc-91264965731a', + INACTIVE_PROGRAM_STATUS_ID: 'b2d125a4-5056-a51a-8042-d50b8eff0df1', + TRANSITIONED_PROGRAM_STATUS_ID: 'b2d125e3-5056-a51a-800f-6891bc7d1ddc', + + // ICON PATHS FOR ACTION STYLE GRID BUTTONS NOT APPLIED THROUGH CSS + GRID_ITEM_DELETE_ICON_PATH: '/ssp/images/delete-icon.png', + GRID_ITEM_EDIT_ICON_PATH: '/ssp/images/edit-icon.png', + + EDIT_COURSE_NOTE_NAME:'edit-existing-notes-large.png', + ADD_PLAN_NOTE_ICON_PATH: '/ssp/images/plan-notes.png', + + EDIT_TERM_NOTE_ICON_PATH: '/ssp/images/edit-existing-notes-small.png', + ADD_TERM_NOTE_ICON_PATH: '/ssp/images/edit-icon.png', + + EDIT_COURSE_NOTE_ICON_PATH: '/ssp/images/edit-existing-notes-large.png', + ADD_COURSE_NOTE_ICON_PATH: '/ssp/images/edit-icon.png', + + + GRID_ITEM_CLOSE_ICON_PATH: '/ssp/images/close-icon.jpg', + GRID_ITEM_MAIL_REPLY_ICON_PATH: '/ssp/images/mail-reply-icon.png', + DEFAULT_NO_STUDENT_PHOTO_URL:'/ssp/images/no-photo.jpg', + + // CAN BE APPLIED TO THE LABEL OF A FIELD TO SHOW A RED REQUIRED ASTERISK + REQUIRED_ASTERISK_DISPLAY: '*', + + // CAN BE APPLIED TO THE LABEL OF A FIELD OR CONTAINER TO ALTER THE LABEL STYLE + SSP_LABEL_STYLE: "color:#04408c;", + + SSP_EDITED_ROW_HIGHLIGHT_COLOR: "00AF33", + SSP_EDITED_ROW_HIGHLIGHT_OPTIONS: {attr:'color', duration: 5000}, + + // CONFIGURES THE MESSAGE DISPLAYED NEXT TO THE SAVE BUTTON FOR TOOLS WHERE A SAVE IS ON A SINGLE SCREEN + // FOR EXAMPLE: THIS FUNCTIONALITY IS APPLIED TO THE STUDENT INTAKE TOOL, ACTION PLAN STRENGTHS AND CONFIDENTIALITY DISCLOSURE AGREEMENT + DATA_SAVE_SUCCESS_MESSAGE_STYLE: "font-weight: 'bold'; color: rgb(0, 0, 0); padding-left: 2px;", + DATA_SAVE_SUCCESS_MESSAGE: '✓ Data was successfully saved', + DATA_SAVE_SUCCESS_MESSAGE_TIMEOUT: 3000 + }, + + initComponent: function() { + return this.callParent( arguments ); + } +}); diff --git a/src/main/webapp/app/view/tools/earlyalert/EarlyAlertDetails.js b/src/main/webapp/app/view/tools/earlyalert/EarlyAlertDetails.js index 191b4a0bdc..4391134e29 100644 --- a/src/main/webapp/app/view/tools/earlyalert/EarlyAlertDetails.js +++ b/src/main/webapp/app/view/tools/earlyalert/EarlyAlertDetails.js @@ -1,205 +1,222 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -Ext.define('Ssp.view.tools.earlyalert.EarlyAlertDetails', { - extend: 'Ext.form.Panel', - alias: 'widget.earlyalertdetails', - mixins: ['Deft.mixin.Injectable', 'Deft.mixin.Controllable'], - controller: 'Ssp.controller.tool.earlyalert.EarlyAlertDetailsViewController', - inject: { - model: 'currentEarlyAlert', - selectedReasonsStore: 'earlyAlertDetailsReasonsStore', - selectedSuggestionsStore: 'earlyAlertDetailsSuggestionsStore', - authenticatedPerson: 'authenticatedPerson', - columnRendererUtils: 'columnRendererUtils', - treeStore: 'earlyAlertsTreeStore', - currentEarlyAlertResponsesGridStore: 'currentEarlyAlertResponsesGridStore' - }, - width: '100%', - height: '100%', - title: 'Early Alert Details', - - // By default we assume the component causing this view to load has already - // loaded the EA of interest into a shared resource (the injected - // 'currentEarlyAlert') - reloadEarlyAlert: false, - - initComponent: function(){ - var me = this; - Ext.applyIf(me, { - autoScroll: true, - items: [{ - xtype: 'fieldcontainer', - fieldLabel: '', - layout: 'hbox', - margin: '5 0 0 0', - defaultType: 'displayfield', - fieldDefaults: { - msgTarget: 'side' - //labelAlign: 'right', - //labelWidth: 80 - }, - items: [{ - xtype: 'fieldset', - border: 0, - title: '', - defaultType: 'displayfield', - defaults: { - anchor: '100%' - }, - flex: .40, - items: [{ - - fieldLabel: 'Created By', - - name: 'createdByPersonName', - itemId: 'createdByField' - }, { - - fieldLabel: 'Created Date', - - name: 'createdDate', - itemId: 'createdDateField', - renderer: Ext.util.Format.dateRenderer('Y-m-d g:i A') - }, { - - fieldLabel: 'Course Name', - - name: 'courseName' - }, { - - fieldLabel: 'Campus', - itemId: 'campusField', - - name: 'campus' - }, { - xtype: 'multiselect', - name: 'earlyAlertReasonIds', - itemId: 'earlyAlertReasonsList', - fieldLabel: 'Reasons', - store: me.selectedReasonsStore, - displayField: 'name', - anchor: '95%' - }, { - fieldLabel: 'Other Reason', - name: 'earlyAlertReasonOtherDescription', - hidden: !me.model.get('earlyAlertReasonOtherDescription') - }, { - xtype: 'multiselect', - name: 'earlyAlertSuggestionIds', - itemId: 'earlyAlertSuggestionsList', - fieldLabel: 'Suggestions', - store: me.selectedSuggestionsStore, - displayField: 'name', - anchor: '95%' - }, { - fieldLabel: 'Other Suggestion', - name: 'earlyAlertSuggestionOtherDescription', - hidden: !me.model.get('earlyAlertSuggestionOtherDescription') - }, { - fieldLabel: 'Comment', - name: 'comment' - }, { - xtype: 'tbspacer', - height: '10' - }, { - xtype: 'toolbar', - dock: 'top', - items: [] - }, { - xtype: 'gridpanel', - title: 'Responses', - id: 'detailResponseGridPanel', - store: me.currentEarlyAlertResponsesGridStore, - columns: [{ - text: 'Created By', - flex: 1, - dataIndex: 'createdBy', - renderer: me.columnRendererUtils.renderCreatedBy, - sortable: true - }, { - text: 'Created Date', - flex: 1, - dataIndex: 'createdDate', - renderer: Ext.util.Format.dateRenderer('Y-m-d g:i A'), - sortable: true - }, { - text: 'Status', - flex: .5, - sortable: true, - dataIndex: 'closedDate', - renderer: me.columnRendererUtils.renderEarlyAlertStatus - }, { - text: 'Details', - flex: 2, - sortable: true, - dataIndex: 'gridDisplayDetails' - }] - }] - - }, { - xtype: 'fieldset', - border: 0, - title: '', - defaultType: 'displayfield', - defaults: { - anchor: '100%' - }, - flex: .30, - items: [{ - fieldLabel: 'Status', - name: 'status', - itemId: 'statusField' - }, { - fieldLabel: 'Closed By', - name: 'closedByPersonName', - itemId: 'closedByField' - }, { - fieldLabel: 'Closed Date', - name: 'closedDate', - renderer: Ext.util.Format.dateRenderer('Y-m-d g:i A') - }, { - - fieldLabel: 'Email CC', - - name: 'emailCC' - }] - - }] - }], - - dockedItems: [{ - xtype: 'toolbar', - items: [{ - text: 'Return to Early Alert List', - xtype: 'button', - itemId: 'finishButton' - },{ - xtype: 'tbspacer' - },{ - text: 'Respond to selected Early Alert', - xtype: 'button', - itemId: 'detailRespondButton', - hidden: !me.authenticatedPerson.hasAccess('RESPOND_EARLY_ALERT_BUTTON') - }] - }] - }); - - return me.callParent(arguments); - } -}); +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions data stores to EA Details + */ +Ext.define('Ssp.view.tools.earlyalert.EarlyAlertDetails', { + extend: 'Ext.form.Panel', + alias: 'widget.earlyalertdetails', + mixins: ['Deft.mixin.Injectable', 'Deft.mixin.Controllable'], + controller: 'Ssp.controller.tool.earlyalert.EarlyAlertDetailsViewController', + inject: { + model: 'currentEarlyAlert', + selectedReasonsStore: 'earlyAlertDetailsReasonsStore', + selectedSuggestionsStore: 'earlyAlertDetailsSuggestionsStore', + selectedInterventionsStore: 'earlyAlertDetailsInterventionsStore', //TAPS 20140039 + authenticatedPerson: 'authenticatedPerson', + columnRendererUtils: 'columnRendererUtils', + treeStore: 'earlyAlertsTreeStore', + currentEarlyAlertResponsesGridStore: 'currentEarlyAlertResponsesGridStore' + }, + width: '100%', + height: '100%', + title: 'EarlyAlert Details', + + // By default we assume the component causing this view to load has already + // loaded the EA of interest into a shared resource (the injected + // 'currentEarlyAlert') + reloadEarlyAlert: false, + + initComponent: function(){ + var me = this; + Ext.applyIf(me, { + autoScroll: true, + items: [{ + xtype: 'fieldcontainer', + fieldLabel: '', + layout: 'hbox', + margin: '5 0 0 0', + defaultType: 'displayfield', + fieldDefaults: { + msgTarget: 'side' + //labelAlign: 'right', + //labelWidth: 80 + }, + items: [{ + xtype: 'fieldset', + border: 0, + title: '', + defaultType: 'displayfield', + defaults: { + anchor: '100%' + }, + flex: .40, + items: [{ + + fieldLabel: 'Created By', + + name: 'createdByPersonName', + itemId: 'createdByField' + }, { + + fieldLabel: 'Created Date', + + name: 'createdDate', + itemId: 'createdDateField', + renderer: Ext.util.Format.dateRenderer('Y-m-d g:i A') + }, { + + fieldLabel: 'Course Name', + + name: 'courseName' + }, { + + fieldLabel: 'Campus', + itemId: 'campusField', + + name: 'campus' + }, { + xtype: 'multiselect', + name: 'earlyAlertReasonIds', + itemId: 'earlyAlertReasonsList', + fieldLabel: 'Reasons', + store: me.selectedReasonsStore, + displayField: 'name', + anchor: '95%' + }, { + fieldLabel: 'Other Reason', + name: 'earlyAlertReasonOtherDescription', + hidden: !me.model.get('earlyAlertReasonOtherDescription') + }, { + xtype: 'multiselect', + name: 'earlyAlertSuggestionIds', + itemId: 'earlyAlertSuggestionsList', + fieldLabel: 'Suggestions', + store: me.selectedSuggestionsStore, + displayField: 'name', + anchor: '95%' + }, { + fieldLabel: 'Other Suggestion', + name: 'earlyAlertSuggestionOtherDescription', + hidden: !me.model.get('earlyAlertSuggestionOtherDescription') + } + //TAPS 20140039 BEGIN + , { + xtype: 'multiselect', + name: 'earlyAlertInterventionIds', + itemId: 'earlyAlertInterventionsList', + fieldLabel: 'Faculty Interventions', + store: me.selectedInterventionsStore, + displayField: 'name', + anchor: '95%' + } + //TAPS 20140039 END + , { + fieldLabel: 'Comment', + name: 'comment' + }, { + xtype: 'tbspacer', + height: '10' + }, { + xtype: 'toolbar', + dock: 'top', + items: [] + }, { + xtype: 'gridpanel', + title: 'Responses', + id: 'detailResponseGridPanel', + store: me.currentEarlyAlertResponsesGridStore, + columns: [{ + text: 'Created By', + flex: 1, + dataIndex: 'createdBy', + renderer: me.columnRendererUtils.renderCreatedBy, + sortable: true + }, { + text: 'Created Date', + flex: 1, + dataIndex: 'createdDate', + renderer: Ext.util.Format.dateRenderer('Y-m-d g:i A'), + sortable: true + }, { + text: 'Status', + flex: .5, + sortable: true, + dataIndex: 'closedDate', + renderer: me.columnRendererUtils.renderEarlyAlertStatus + }, { + text: 'Details', + flex: 2, + sortable: true, + dataIndex: 'gridDisplayDetails' + }] + }] + + }, { + xtype: 'fieldset', + border: 0, + title: '', + defaultType: 'displayfield', + defaults: { + anchor: '100%' + }, + flex: .30, + items: [{ + fieldLabel: 'Status', + name: 'status', + itemId: 'statusField' + }, { + fieldLabel: 'Closed By', + name: 'closedByPersonName', + itemId: 'closedByField' + }, { + fieldLabel: 'Closed Date', + name: 'closedDate', + renderer: Ext.util.Format.dateRenderer('Y-m-d g:i A') + }, { + + fieldLabel: 'Email CC', + + name: 'emailCC' + }] + + }] + }], + + dockedItems: [{ + xtype: 'toolbar', + items: [{ + text: 'Return to EarlyAlert List', + xtype: 'button', + itemId: 'finishButton' + },{ + xtype: 'tbspacer' + },{ + text: 'Respond to selected EarlyAlert', + xtype: 'button', + itemId: 'detailRespondButton', + hidden: !me.authenticatedPerson.hasAccess('RESPOND_EARLY_ALERT_BUTTON') + }] + }] + }); + + return me.callParent(arguments); + } +}); diff --git a/src/main/webapp/js/early-alert-form.js b/src/main/webapp/js/early-alert-form.js index cec00b662d..1487f04121 100644 --- a/src/main/webapp/js/early-alert-form.js +++ b/src/main/webapp/js/early-alert-form.js @@ -1,430 +1,521 @@ -/* - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -"use strict"; -var ssp = ssp || {}; - -(function($) { - - /* - * NB: This is a temporary workaround for the 1.0 release (until we have a - * chance to implement a better system). The following Ids (uuids) *MUST* - * match the values in src/main/webapp/app/util/Constants.js and the - * corresponding rows in the database. - */ - var CONSTANT_IDS = { - OTHER_EARLY_ALERT_REASON_ID: 'b2d11335-5056-a51a-80ea-074f8fef94ea', - OTHER_EARLY_ALERT_SUGGESTION_ID: 'b2d1120c-5056-a51a-80ea-c779a3109f8f' - }; - - var buildSelectors = function(container) { - var rslt = {}; - $.each({ - errorsDiv: '.errors', - errorTemplate: '.error-message-template', - loadingMessage: '.loading-message', - alertForm: '.alert-form', - course: '.field-course', - term: '.field-term', - student: '.field-student', - enrollmentStatus: '.field-enrollment-status', - netId: '.field-net-id', - studentSchoolId: '.field-student-school-id', - studentEmail: '.field-student-email', - studentType: '.field-student-type', - assignedCounselor: '.field-assigned-counselor', - office: '.field-office', - phone: '.field-phone', - department: '.field-department', - emailCc: '.field-email-cc', - campus: '.field-campus', - reasons: '.field-reasons', - reasonsId: '.field-reasons-id', - reasonsOtherHidden: '.field-reasons-other-hidden', - reasonsAddEdit: '.reasons-add-edit', - reasonsDialog: '.reasons-dialog', - suggestions: '.field-suggestions', - suggestionsId: '.field-suggestions-id', - suggestionsOtherHidden: '.field-suggestions-other-hidden', - suggestionsAddEdit: '.suggestions-add-edit', - suggestionsDialog: '.suggestions-dialog', - comments: '.field-comments', - noticeDialog: '.notice-dialog', - buttonSend: '.button-send' - }, function(name, value) { - rslt[name] = container + ' ' + value; - }); - return rslt; - }; - - ssp.EarlyAlertForm = function(container, options) { - - var selectors = buildSelectors(container); - - /* - * Person Data Function - */ - var getPersonData = function(personId) { - var rslt = []; - $.ajax({ - url: options.urls.person.replace('STUDENTID', personId), - async: false, - dataType: 'json', - error: function(jqXHR, textStatus, errorThrown) { - // Display the error - var response = $.parseJSON(jqXHR.responseText); - showError(jqXHR.status + ': ' + errorThrown, response.message); - }, - success: function(data, textStatus, jqXHR) { - rslt = data; - }, - type: 'GET' - }); - return rslt; - }; - - /* - * Campus Data Function - */ - var getCampusData = function() { - var rslt = []; - $.ajax({ - url: options.urls.campus, - async: false, - dataType: 'json', - error: function(jqXHR, textStatus, errorThrown) { - // Display the error - var response = $.parseJSON(jqXHR.responseText); - showError(jqXHR.status + ': ' + errorThrown, response.message); - }, - success: function(data, textStatus, jqXHR) { - rslt = data.rows; - }, - type: 'GET' - }); - return rslt; - }; - - /* - * Referral Reason Data Function - */ - var getReasonsData = function() { - var rslt = []; - $.ajax({ - url: options.urls.reasons, - async: false, - dataType: 'json', - error: function(jqXHR, textStatus, errorThrown) { - // Display the error - var response = $.parseJSON(jqXHR.responseText); - showError(jqXHR.status + ': ' + errorThrown, response.message); - }, - success: function(data, textStatus, jqXHR) { - rslt = data.rows; - }, - type: 'GET' - }); - return rslt; - }; - - /* - * Suggestions Data Function - */ - var getSuggestionsData = function() { - var rslt = []; - $.ajax({ - url: options.urls.suggestions, - async: false, - dataType: 'json', - error: function(jqXHR, textStatus, errorThrown) { - // Display the error - var response = $.parseJSON(jqXHR.responseText); - showError(jqXHR.status + ': ' + errorThrown, response.message); - }, - success: function(data, textStatus, jqXHR) { - rslt = data.rows; - }, - type: 'GET' - }); - return rslt; - }; - - /* - * Error Handling Functions - */ - var showError = function(title, body) { - var err = $(selectors.errorTemplate).clone(); - err.removeClass('error-message-template').addClass('error-message'); - err.find('.error-title').html(title); - err.find('.error-body').html(body); - err.appendTo(selectors.errorsDiv); - err.slideDown(1000); - }; - var clearErrors = function() { - $(selectors.errorsDiv).html(''); - }; - - /* - * Validation Function - */ - var validate = function() { - var rslt = true; // default - if (!$(selectors.campus).val()) { - rslt = false; - $(selectors.campus).addClass('invalid'); - } else { - $(selectors.campus).removeClass('invalid'); - } - if(!$(selectors.reasonsId) || $(selectors.reasonsId).length <= 0) { - rslt = false; - $(selectors.reasonsAddEdit).addClass('invalid'); - } else { - $(selectors.reasonsAddEdit).removeClass('invalid'); - } - var emailCc = $(selectors.emailCc).val().trim(); - // True regex email validation is a pipe-dream. Just a sanity - // check here. - if ('' !== emailCc && !(/.+@.+/.test(emailCc))) { - rslt = false; - $(selectors.emailCc).addClass('invalid'); - } else { - $(selectors.emailCc).removeClass('invalid'); - } - return rslt; - } - - /* - * Submit Function - */ - var submitEarlyAlert = function(sendNotice) { - - // Start with a clean slate... - clearErrors(); - - // Marshal the POST data - var postData = { - courseName: options.parameters.courseName, - courseTitle: options.parameters.courseTitle, - courseTermCode: options.parameters.term, - emailCC: $(selectors.emailCc).val(), - campusId: $(selectors.campus).val(), - earlyAlertReasonIds: [], // Set below... - earlyAlertReasonOtherDescription: $(selectors.reasonsOtherHidden).val(), - earlyAlertSuggestionIds: [], // Set below... - earlyAlertSuggestionOtherDescription: $(selectors.suggestionsOtherHidden).val(), - comment: $(selectors.comments).val(), - sendEmailToStudent: sendNotice - }; - $(selectors.reasonsId).each(function() { - postData.earlyAlertReasonIds.push( $(this).val() ); - }); - $(selectors.suggestionsId).each(function() { - postData.earlyAlertSuggestionIds.push( $(this).val() ); - }); - - - - // Submit the alert - $.ajax({ - url: options.urls.submit.replace('STUDENTID', options.parameters.studentId), - async: false, - contentType: 'application/json', - data: JSON.stringify(postData), - // processData: false, - dataType: 'json', - error: function(jqXHR, textStatus, errorThrown) { - // Display the error - var response = $.parseJSON(jqXHR.responseText); - showError(jqXHR.status + ': ' + errorThrown, response.message); - }, - success: function(data, textStatus, jqXHR) { - // Return to the roster screen, with a message - var url = options.urls.done.replace('STUDENTNAME', escape(studentName)); - url = url.replace('CONFIRMED_ID', escape(data.id)); - window.location = url; - }, - type: 'POST' - }); - - }; - - /* - * Core Variables... - */ - - var student = getPersonData(options.parameters.studentId); - var campuses = getCampusData(); - var reasons = getReasonsData(); - var suggestions = getSuggestionsData(); - - // studentName - var studentName = student.firstName + ' ' - + (student.middleInitial ? ' ' + student.middleInitial + ' ' : ' ') - + student.lastName; - - /* - * Populate the fields... - */ - - // course - $(selectors.course).text(options.parameters.courseName + ' - ' + options.parameters.courseTitle); - - // term - $(selectors.term).text(options.parameters.term); - - // student - $(selectors.student).text(studentName); - - // enrollment status - $(selectors.enrollmentStatus).text(ssp.getStatusCodeName(options.parameters.enrollmentStatusCode, options)); - - // netId - $(selectors.netId).text(student.username); - - // schoolId - $(selectors.studentSchoolId).text(student.schoolId); - - // studentEmail - $(selectors.studentEmail).text(student.primaryEmailAddress); - - // studentType - $(selectors.studentType).text(student.studentType && student.studentType.name); - - // assignedCounselor - $(selectors.assignedCounselor).text(student.coach && student.coach.lastName + ', ' + student.coach.firstName); - - // office - // phone - // department - - // campus - $.each(campuses, function(index, value) { - var html = ''; - $(selectors.campus).append(html); - }); - - // reason - $.each(reasons, function(index, value) { - var html = '
  • ' + value.name; - if (value.id === CONSTANT_IDS.OTHER_EARLY_ALERT_REASON_ID) { - html += '
    '; - } - html += '
  • '; - $(selectors.reasonsDialog).find('ul').append(html); - }); - var reasonsDlgOptions = { - autoOpen: false, - buttons: { - 'OK': function() { - $(selectors.reasons).html(''); // Clear - $(this).find('li').each(function() { - var chk = $(this).find('input'); - if (chk.attr('checked')) { - var html = ''; - html += (chk.val() === CONSTANT_IDS.OTHER_EARLY_ALERT_REASON_ID) - ? $(this).find(':text').val() + '' - : $(this).text(); - $(selectors.reasons).append('
  • ' + html + '
  • '); - } - }); - $(this).dialog('close'); - }, - 'Cancel': function() { $(this).dialog('close'); }, - }, - modal: true, - title: 'Edit Faculty Reasons' - }; - var reasonsDlg = $(selectors.reasonsDialog).dialog(reasonsDlgOptions); - $(selectors.reasonsAddEdit).click(function() { - reasonsDlg.dialog('open'); - }); - - - // suggestions - $.each(suggestions, function(index, value) { - var html = '
  • ' + value.name; - if (value.id === CONSTANT_IDS.OTHER_EARLY_ALERT_SUGGESTION_ID) { - html += ''; - } - html += '
  • '; - $(selectors.suggestionsDialog).find('ul').append(html); - }); - var suggestionsDlgOptions = { - autoOpen: false, - buttons: { - 'OK': function() { - $(selectors.suggestions).html(''); // Clear - $(this).find('li').each(function() { - var chk = $(this).find('input'); - if (chk.attr('checked')) { - var html = ''; - html += (chk.val() === CONSTANT_IDS.OTHER_EARLY_ALERT_SUGGESTION_ID) - ? $(this).find(':text').val() + '' - : $(this).text(); - $(selectors.suggestions).append('
  • ' + html + '
  • '); - } - }); - $(this).dialog('close'); - }, - 'Cancel': function() { $(this).dialog('close'); }, - }, - modal: true, - title: 'Edit Faculty Suggestions' - }; - var suggestionsDlg = $(selectors.suggestionsDialog).dialog(suggestionsDlgOptions); - $(selectors.suggestionsAddEdit).click(function() { - suggestionsDlg.dialog('open'); - }); - - // send button - var noticeDlgOptions = { - autoOpen: false, - buttons: { - 'Yes': function() { - noticeDlg.dialog('close'); - submitEarlyAlert(true); - }, - 'No': function() { - noticeDlg.dialog('close'); - submitEarlyAlert(false); - } - }, - modal: true, - title: 'Send Early Alert' - }; - var noticeDlg = $(selectors.noticeDialog).dialog(noticeDlgOptions); - $(selectors.buttonSend).click(function() { - clearErrors(); - if (validate()) { - noticeDlg.dialog('open'); - } else { - showError('Validation Error', - 'Could not submit the Early Alert because not enough information was provided or some form fields contained invalid data. Please correct the highlighted fields.'); - } - }); - - /* - * The interface is ready to display... - */ - - $(selectors.loadingMessage).slideUp(500); - $(selectors.alertForm).slideDown(1000); - - }; - -})(jQuery); +/* + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /** +* 01/29/2014 Jonathan Hart TAPS 20140023 IRSC Added Comments field check to validate function +* 06/17/2014 Jonathan Hart TAPS 20140039 Added Faculty Interventions to EA form +**/ +"use strict"; +var ssp = ssp || {}; + +(function($) { + + /* + * NB: This is a temporary workaround for the 1.0 release (until we have a + * chance to implement a better system). The following Ids (uuids) *MUST* + * match the values in src/main/webapp/app/util/Constants.js and the + * corresponding rows in the database. + */ + var CONSTANT_IDS = { + OTHER_EARLY_ALERT_REASON_ID: 'b2d11335-5056-a51a-80ea-074f8fef94ea', + OTHER_EARLY_ALERT_SUGGESTION_ID: 'b2d1120c-5056-a51a-80ea-c779a3109f8f' + }; + + var buildSelectors = function(container) { + var rslt = {}; + $.each({ + errorsDiv: '.errors', + errorTemplate: '.error-message-template', + loadingMessage: '.loading-message', + alertForm: '.alert-form', + course: '.field-course', + term: '.field-term', + student: '.field-student', + enrollmentStatus: '.field-enrollment-status', + netId: '.field-net-id', + studentSchoolId: '.field-student-school-id', + studentEmail: '.field-student-email', + studentType: '.field-student-type', + assignedCounselor: '.field-assigned-counselor', + office: '.field-office', + phone: '.field-phone', + department: '.field-department', + emailCc: '.field-email-cc', + campus: '.field-campus', + reasons: '.field-reasons', + reasonsId: '.field-reasons-id', + reasonsOtherHidden: '.field-reasons-other-hidden', + reasonsAddEdit: '.reasons-add-edit', + reasonsDialog: '.reasons-dialog', + suggestions: '.field-suggestions', + suggestionsId: '.field-suggestions-id', + suggestionsOtherHidden: '.field-suggestions-other-hidden', + suggestionsAddEdit: '.suggestions-add-edit', + suggestionsDialog: '.suggestions-dialog', + interventions: '.field-interventions', //TAPS 20140039 + interventionsId: '.field-interventions-id', //TAPS 20140039 + interventionsAddEdit: '.interventions-add-edit', //TAPS 20140039 + interventionsDialog: '.interventions-dialog', //TAPS 20140039 + comments: '.field-comments', + noticeDialog: '.notice-dialog', + buttonSend: '.button-send' + }, function(name, value) { + rslt[name] = container + ' ' + value; + }); + return rslt; + }; + + ssp.EarlyAlertForm = function(container, options) { + + var selectors = buildSelectors(container); + + /* + * Person Data Function + */ + var getPersonData = function(personId) { + var rslt = []; + $.ajax({ + url: options.urls.person.replace('STUDENTID', personId), + async: false, + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + // Display the error + var response = $.parseJSON(jqXHR.responseText); + showError(jqXHR.status + ': ' + errorThrown, response.message); + }, + success: function(data, textStatus, jqXHR) { + rslt = data; + }, + type: 'GET' + }); + return rslt; + }; + + /* + * Campus Data Function + */ + var getCampusData = function() { + var rslt = []; + $.ajax({ + url: options.urls.campus, + async: false, + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + // Display the error + var response = $.parseJSON(jqXHR.responseText); + showError(jqXHR.status + ': ' + errorThrown, response.message); + }, + success: function(data, textStatus, jqXHR) { + rslt = data.rows; + }, + type: 'GET' + }); + return rslt; + }; + + /* + * Referral Reason Data Function + */ + var getReasonsData = function() { + var rslt = []; + $.ajax({ + url: options.urls.reasons, + async: false, + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + // Display the error + var response = $.parseJSON(jqXHR.responseText); + showError(jqXHR.status + ': ' + errorThrown, response.message); + }, + success: function(data, textStatus, jqXHR) { + rslt = data.rows; + }, + type: 'GET' + }); + return rslt; + }; + + /* + * Suggestions Data Function + */ + var getSuggestionsData = function() { + var rslt = []; + $.ajax({ + url: options.urls.suggestions, + async: false, + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + // Display the error + var response = $.parseJSON(jqXHR.responseText); + showError(jqXHR.status + ': ' + errorThrown, response.message); + }, + success: function(data, textStatus, jqXHR) { + rslt = data.rows; + }, + type: 'GET' + }); + return rslt; + }; + + //TAPS 20140039 BEGIN + /* + * Interventions Data Function + */ + var getInterventionsData = function() { + var rslt = []; + $.ajax({ + url: options.urls.interventions, + async: false, + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + // Display the error + var response = $.parseJSON(jqXHR.responseText); + showError(jqXHR.status + ': ' + errorThrown, response.message); + }, + success: function(data, textStatus, jqXHR) { + rslt = data.rows; + }, + type: 'GET' + }); + return rslt; + }; + //TAPS 20140039 END + + /* + * Error Handling Functions + */ + var showError = function(title, body) { + var err = $(selectors.errorTemplate).clone(); + err.removeClass('error-message-template').addClass('error-message'); + err.find('.error-title').html(title); + err.find('.error-body').html(body); + err.appendTo(selectors.errorsDiv); + err.slideDown(1000); + }; + var clearErrors = function() { + $(selectors.errorsDiv).html(''); + }; + + /* + * Validation Function + */ + var validate = function() { + var rslt = true; // default + if (!$(selectors.campus).val()) { + rslt = false; + $(selectors.campus).addClass('invalid'); + } else { + $(selectors.campus).removeClass('invalid'); + } + if(!$(selectors.reasonsId) || $(selectors.reasonsId).length <= 0) { + rslt = false; + $(selectors.reasonsAddEdit).addClass('invalid'); + } else { + $(selectors.reasonsAddEdit).removeClass('invalid'); + } + var emailCc = $(selectors.emailCc).val().trim(); + // True regex email validation is a pipe-dream. Just a sanity + // check here. + if ('' !== emailCc && !(/.+@.+/.test(emailCc))) { + rslt = false; + $(selectors.emailCc).addClass('invalid'); + } else { + $(selectors.emailCc).removeClass('invalid'); + } + + // TAPS 20140023 - 01/29/2014 Check to see if user entered comments + var commentsFld = $(selectors.comments).val().trim(); + if ('' == commentsFld || !$(selectors.comments).val()) { + rslt = false; + $(selectors.comments).addClass('invalid'); + } else { + $(selectors.comments).removeClass('invalid'); + } + + //TAPS 20140039 BEGIN Add Validation for Faculty Interventions + if(!$(selectors.interventionsId) || $(selectors.interventionsId).length <= 0) { + rslt = false; + $(selectors.interventionsAddEdit).addClass('invalid'); + } else { + $(selectors.interventionsAddEdit).removeClass('invalid'); + } + //TAPS 20140039 END + + return rslt; + } + + /* + * Submit Function + */ + var submitEarlyAlert = function(sendNotice) { + + // Start with a clean slate... + clearErrors(); + + // Marshal the POST data + var postData = { + courseName: options.parameters.courseName, + courseTitle: options.parameters.courseTitle, + courseTermCode: options.parameters.term, + emailCC: $(selectors.emailCc).val(), + campusId: $(selectors.campus).val(), + earlyAlertReasonIds: [], // Set below... + earlyAlertReasonOtherDescription: $(selectors.reasonsOtherHidden).val(), + earlyAlertSuggestionIds: [], // Set below... + earlyAlertSuggestionOtherDescription: $(selectors.suggestionsOtherHidden).val(), + earlyAlertInterventionIds: [], //TAPS 20140039 + comment: $(selectors.comments).val(), + sendEmailToStudent: sendNotice + }; + $(selectors.reasonsId).each(function() { + postData.earlyAlertReasonIds.push( $(this).val() ); + }); + $(selectors.suggestionsId).each(function() { + postData.earlyAlertSuggestionIds.push( $(this).val() ); + }); + //TAPS 20140039 BEGIN + $(selectors.interventionsId).each(function() { + postData.earlyAlertInterventionIds.push( $(this).val() ); + }); + //TAPS 20140039 END + + + + // Submit the alert + $.ajax({ + url: options.urls.submit.replace('STUDENTID', options.parameters.studentId), + async: false, + contentType: 'application/json', + data: JSON.stringify(postData), + // processData: false, + dataType: 'json', + error: function(jqXHR, textStatus, errorThrown) { + // Display the error + var response = $.parseJSON(jqXHR.responseText); + showError(jqXHR.status + ': ' + errorThrown, response.message); + }, + success: function(data, textStatus, jqXHR) { + // Return to the roster screen, with a message + var url = options.urls.done.replace('STUDENTNAME', escape(studentName)); + url = url.replace('CONFIRMED_ID', escape(data.id)); + window.location = url; + }, + type: 'POST' + }); + + }; + + /* + * Core Variables... + */ + + var student = getPersonData(options.parameters.studentId); + var campuses = getCampusData(); + var reasons = getReasonsData(); + var suggestions = getSuggestionsData(); + var interventions = getInterventionsData(); //TAPS 20140039 + + // studentName + var studentName = student.firstName + ' ' + + (student.middleInitial ? ' ' + student.middleInitial + ' ' : ' ') + + student.lastName; + + /* + * Populate the fields... + */ + + // course + $(selectors.course).text(options.parameters.courseName + ' - ' + options.parameters.courseTitle); + + // term + $(selectors.term).text(options.parameters.term); + + // student + $(selectors.student).text(studentName); + + // enrollment status + $(selectors.enrollmentStatus).text(ssp.getStatusCodeName(options.parameters.enrollmentStatusCode, options)); + + // netId + $(selectors.netId).text(student.username); + + // schoolId + $(selectors.studentSchoolId).text(student.schoolId); + + // studentEmail + $(selectors.studentEmail).text(student.primaryEmailAddress); + + // studentType + $(selectors.studentType).text(student.studentType && student.studentType.name); + + // assignedCounselor + $(selectors.assignedCounselor).text(student.coach && student.coach.lastName + ', ' + student.coach.firstName); + + // office + // phone + // department + + // campus + $.each(campuses, function(index, value) { + var html = ''; + $(selectors.campus).append(html); + }); + + // reason + $.each(reasons, function(index, value) { + var html = '
  • ' + value.name; + if (value.id === CONSTANT_IDS.OTHER_EARLY_ALERT_REASON_ID) { + html += '
    '; + } + html += '
  • '; + $(selectors.reasonsDialog).find('ul').append(html); + }); + var reasonsDlgOptions = { + autoOpen: false, + buttons: { + 'OK': function() { + $(selectors.reasons).html(''); // Clear + $(this).find('li').each(function() { + var chk = $(this).find('input'); + if (chk.attr('checked')) { + var html = ''; + html += (chk.val() === CONSTANT_IDS.OTHER_EARLY_ALERT_REASON_ID) + ? $(this).find(':text').val() + '' + : $(this).text(); + $(selectors.reasons).append('
  • ' + html + '
  • '); + } + }); + $(this).dialog('close'); + }, + 'Cancel': function() { $(this).dialog('close'); }, + }, + modal: true, + title: 'Edit Referral Reasons' //TAPS 20140039 Corrected wording to match field + }; + var reasonsDlg = $(selectors.reasonsDialog).dialog(reasonsDlgOptions); + $(selectors.reasonsAddEdit).click(function() { + reasonsDlg.dialog('open'); + }); + + + // suggestions + $.each(suggestions, function(index, value) { + var html = '
  • ' + value.name; + if (value.id === CONSTANT_IDS.OTHER_EARLY_ALERT_SUGGESTION_ID) { + html += ''; + } + html += '
  • '; + $(selectors.suggestionsDialog).find('ul').append(html); + }); + var suggestionsDlgOptions = { + autoOpen: false, + buttons: { + 'OK': function() { + $(selectors.suggestions).html(''); // Clear + $(this).find('li').each(function() { + var chk = $(this).find('input'); + if (chk.attr('checked')) { + var html = ''; + html += (chk.val() === CONSTANT_IDS.OTHER_EARLY_ALERT_SUGGESTION_ID) + ? $(this).find(':text').val() + '' + : $(this).text(); + $(selectors.suggestions).append('
  • ' + html + '
  • '); + } + }); + $(this).dialog('close'); + }, + 'Cancel': function() { $(this).dialog('close'); }, + }, + modal: true, + title: 'Edit Faculty Suggestions' + }; + var suggestionsDlg = $(selectors.suggestionsDialog).dialog(suggestionsDlgOptions); + $(selectors.suggestionsAddEdit).click(function() { + suggestionsDlg.dialog('open'); + }); + + //TAPS 20140039 BEGIN + // interventions + $.each(interventions, function(index, value) { + var html = '
  • ' + value.name + '
  • '; + $(selectors.interventionsDialog).find('ul').append(html); + }); + var interventionsDlgOptions = { + autoOpen: false, + buttons: { + 'OK': function() { + $(selectors.interventions).html(''); // Clear + $(this).find('li').each(function() { + var chk = $(this).find('input'); + if (chk.attr('checked')) { + var html = ''; + html += $(this).text(); + $(selectors.interventions).append('
  • ' + html + '
  • '); + } + }); + $(this).dialog('close'); + }, + 'Cancel': function() { $(this).dialog('close'); }, + }, + modal: true, + title: 'Edit Faculty Interventions' + }; + var interventionsDlg = $(selectors.interventionsDialog).dialog(interventionsDlgOptions); + $(selectors.interventionsAddEdit).click(function() { + interventionsDlg.dialog('open'); + }); + //TAPS 20140039 END + + // send button + var noticeDlgOptions = { + autoOpen: false, + buttons: { + 'Yes': function() { + noticeDlg.dialog('close'); + submitEarlyAlert(true); + }, + 'No': function() { + noticeDlg.dialog('close'); + submitEarlyAlert(false); + } + }, + modal: true, + title: 'Send EarlyAlert' + }; + + var noticeDlg = $(selectors.noticeDialog).dialog(noticeDlgOptions); + $(selectors.buttonSend).click(function() { + clearErrors(); + if (validate()) { + noticeDlg.dialog('open'); + } else { + showError('Validation Error', + 'Could not submit the EarlyAlert because not enough information was provided or some form fields contained invalid data. Please correct the highlighted fields.'); + } + }); + + /* + * The interface is ready to display... + */ + + $(selectors.loadingMessage).slideUp(500); + $(selectors.alertForm).slideDown(1000); + + }; + +})(jQuery); \ No newline at end of file diff --git a/src/main/webapp/resources/css/early-alert.css b/src/main/webapp/resources/css/early-alert.css index 22f0184b23..6db2cb9a28 100644 --- a/src/main/webapp/resources/css/early-alert.css +++ b/src/main/webapp/resources/css/early-alert.css @@ -1,101 +1,132 @@ -/** - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* Roster Screen */ - -.early-alert .sent-message, .early-alert .error-message { - margin-bottom: 16px; -} - -.early-alert .course-label { - font-size: 14px; - padding: .5em; -} -.early-alert .course-select { - border: 1px solid darkGray; - font-size: 14px; - padding: .5em; -} - -/* Form Screen */ - -.early-alert .alert-form { - width: 600px -} - -.early-alert .ea-label { - float: right; - margin: 3px 0; -} - -.early-alert .ea-required { - float: right; - margin: 3px 0 3px 6px; - color: #F00; -} - -.early-alert .ea-input, .early-alert .ea-buttons { - float: right; - margin: 3px 0 3px 4px; - width: 400px; -} - -.early-alert .ea-input input, .early-alert .ea-input select, .early-alert .ea-input textarea { - width: 300px; -} - -.ea-input p { - margin: 3px 0 6px 0; -} - -.ea-input textarea { - height: 100px; -} - -.early-alert .ea-input ul { - margin: 0; - padding-left: 20px; - -webkit-margin-before: 0; - -webkit-margin-after: 0; - -webkit-padding-start: 20px; -} - -.early-alert .ea-clear { - clear: both; -} - -.suggestions-dialog { - width: 400px; -} - -.suggestions-dialog ul li { - list-style-type: none; -} - -.suggestions-dialog li input[type="text"] { - width: 240px; -} - -/* the .ea-input has to be present in this selector to work around selector - precedence conflicts with uP sheets which otherwise prevent application of - this style to certain form fields (esp emailCc) */ -.early-alert .ea-input .invalid { - border: 1px red solid; -} - - +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/* Roster Screen */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions Specific CSS and fixed reasons dialog + */ +.early-alert .sent-message, .early-alert .error-message { + margin-bottom: 16px; +} + +.early-alert .course-label { + font-size: 14px; + padding: .5em; +} +.early-alert .course-select { + border: 1px solid darkGray; + font-size: 14px; + padding: .5em; +} + +/* Form Screen */ + +.early-alert .alert-form { + width: 600px +} + +.early-alert .ea-label { + float: right; + margin: 3px 0; +} + +.early-alert .ea-required { + float: right; + margin: 3px 0 3px 6px; + color: #F00; +} + +.early-alert .ea-input, .early-alert .ea-buttons { + float: right; + margin: 3px 0 3px 4px; + width: 400px; +} + +.early-alert .ea-input input, .early-alert .ea-input select, .early-alert .ea-input textarea { + width: 300px; +} + +.ea-input p { + margin: 3px 0 6px 0; +} + +.ea-input textarea { + height: 100px; +} + +.early-alert .ea-input ul { + margin: 0; + padding-left: 20px; + -webkit-margin-before: 0; + -webkit-margin-after: 0; + -webkit-padding-start: 20px; +} + +.early-alert .ea-clear { + clear: both; +} + +/* TAPS 20140039 BEGIN */ +.reasons-dialog { + width: 400px; +} + +.reasons-dialog ul li { + list-style-type: none; +} + +.reasons-dialog li input[type="text"] { + width: 240px; +} +/* TAPS 20140039 END */ + +.suggestions-dialog { + width: 400px; +} + +.suggestions-dialog ul li { + list-style-type: none; +} + +.suggestions-dialog li input[type="text"] { + width: 240px; +} + +/* TAPS 20140039 BEGIN */ +.interventions-dialog { + width: 400px; +} + +.interventions-dialog ul li { + list-style-type: none; +} + +.interventions-dialog li input[type="text"] { + width: 240px; +} +/* TAPS 20140039 END */ + +/* the .ea-input has to be present in this selector to work around selector + precedence conflicts with uP sheets which otherwise prevent application of + this style to certain form fields (esp emailCc) */ +.early-alert .ea-input .invalid { + border: 1px red solid; +} + + diff --git a/src/main/webapp/resources/css/report.css b/src/main/webapp/resources/css/report.css index 777d58f498..662a6eab7c 100644 --- a/src/main/webapp/resources/css/report.css +++ b/src/main/webapp/resources/css/report.css @@ -1,95 +1,126 @@ -/** - * Licensed to Jasig under one or more contributor license - * agreements. See the NOTICE file distributed with this work - * for additional information regarding copyright ownership. - * Jasig licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a - * copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* Roster Screen */ - -.report .sent-message { - margin-bottom: 16px; -} - -.report .course-label { - font-size: 14px; - padding: .5em; -} -.report .course-select { - border: 1px solid darkGray; - font-size: 14px; - padding: .5em; -} - -/* Form Screen */ -.report .alert-form { - width: 700px -} - -.report .ea-label { - float: right; - margin: 3px 0; -} - -.report .ea-required { - float: left; - margin: 3px 0 3px 6px; - color: #F00; -} - -.report .ea-input, .report .ea-buttons { - float: right; - margin: 3px 0 3px 4px; - width: 400px; -} - -.report .ea-input input, .report .ea-input select, .report .ea-input textarea { - width: 300px; -} - -.ea-input p { - margin: 3px 0 6px 0; -} - -.ea-input textarea { - height: 100px; -} - -.report .ea-input ul { - margin: 0; - padding-left: 20px; - -webkit-margin-before: 0; - -webkit-margin-after: 0; - -webkit-padding-start: 20px; -} - -.report .ea-clear { - clear: both; -} - -.suggestions-dialog { - width: 400px; -} - -.suggestions-dialog ul li { - list-style-type: none; -} - -.suggestions-dialog li input[type="text"] { - width: 240px; -} - -.hideable-form { - width: 800px; -} +/** + * Licensed to Jasig under one or more contributor license + * agreements. See the NOTICE file distributed with this work + * for additional information regarding copyright ownership. + * Jasig licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a + * copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/* Roster Screen */ + /* + * IRSC CUSTOMIZATIONS + * 06/17/2014 - Jonathan Hart IRSC TAPS 20140039 - Add Faculty Interventions Specific CSS and fix reasons dialog + */ +.report .sent-message { + margin-bottom: 16px; +} + +.report .course-label { + font-size: 14px; + padding: .5em; +} +.report .course-select { + border: 1px solid darkGray; + font-size: 14px; + padding: .5em; +} + +/* Form Screen */ +.report .alert-form { + width: 700px +} + +.report .ea-label { + float: right; + margin: 3px 0; +} + +.report .ea-required { + float: left; + margin: 3px 0 3px 6px; + color: #F00; +} + +.report .ea-input, .report .ea-buttons { + float: right; + margin: 3px 0 3px 4px; + width: 400px; +} + +.report .ea-input input, .report .ea-input select, .report .ea-input textarea { + width: 300px; +} + +.ea-input p { + margin: 3px 0 6px 0; +} + +.ea-input textarea { + height: 100px; +} + +.report .ea-input ul { + margin: 0; + padding-left: 20px; + -webkit-margin-before: 0; + -webkit-margin-after: 0; + -webkit-padding-start: 20px; +} + +.report .ea-clear { + clear: both; +} + +/* TAPS 20140039 BEGIN */ +.reasons-dialog { + width: 400px; +} + +.reasons-dialog ul li { + list-style-type: none; +} + +.reasons-dialog li input[type="text"] { + width: 240px; +} +/* TAPS 20140039 END */ + +.suggestions-dialog { + width: 400px; +} + +.suggestions-dialog ul li { + list-style-type: none; +} + +.suggestions-dialog li input[type="text"] { + width: 240px; +} + +/* TAPS 20140039 BEGIN */ +.interventions-dialog { + width: 400px; +} + +.interventions-dialog ul li { + list-style-type: none; +} + +.interventions-dialog li input[type="text"] { + width: 240px; +} +/* TAPS 20140039 END */ + +.hideable-form { + width: 800px; +}