Search in sources :

Example 1 with RequiredDateField

use of fr.univlorraine.ecandidat.vaadin.form.RequiredDateField in project esup-ecandidat by EsupPortail.

the class CtrCandFormationWindow method getErrorMessageDate.

/**
 * @return true si les dates sont valides
 */
private String getErrorMessageDate() {
    RequiredDateField fieldDatConfirm = ((RequiredDateField) fieldGroup.getField(Formation_.datConfirmForm.getName()));
    RequiredDateField fieldDatConfirmListComp = ((RequiredDateField) fieldGroup.getField(Formation_.datConfirmListCompForm.getName()));
    RequiredDateField fieldDatDebDepot = ((RequiredDateField) fieldGroup.getField(Formation_.datDebDepotForm.getName()));
    RequiredDateField fieldDatAnalyse = ((RequiredDateField) fieldGroup.getField(Formation_.datAnalyseForm.getName()));
    RequiredDateField fieldDatFinDepo = ((RequiredDateField) fieldGroup.getField(Formation_.datFinDepotForm.getName()));
    RequiredDateField fieldDatJury = ((RequiredDateField) fieldGroup.getField(Formation_.datJuryForm.getName()));
    RequiredDateField fieldDatPubli = ((RequiredDateField) fieldGroup.getField(Formation_.datPubliForm.getName()));
    RequiredDateField fieldDatRetour = ((RequiredDateField) fieldGroup.getField(Formation_.datRetourForm.getName()));
    return formationController.getTxtErrorEditDate(fieldDatConfirm.getValue(), fieldDatConfirmListComp.getValue(), fieldDatDebDepot.getValue(), fieldDatAnalyse.getValue(), fieldDatFinDepo.getValue(), fieldDatJury.getValue(), fieldDatPubli.getValue(), fieldDatRetour.getValue());
}
Also used : RequiredDateField(fr.univlorraine.ecandidat.vaadin.form.RequiredDateField)

Example 2 with RequiredDateField

use of fr.univlorraine.ecandidat.vaadin.form.RequiredDateField in project esup-ecandidat by EsupPortail.

the class CtrCandActionCandidatureWindow method majAvisComponent.

/**
 * Mise à jour des composants pour les avis
 */
private void majAvisComponent() {
    final ComboBoxTypeDecision cbTypeDecision = (ComboBoxTypeDecision) fieldGroupDecision.getField(TypeDecisionCandidature_.typeDecision.getName());
    final ComboBoxMotivationAvis cbMotivation = (ComboBoxMotivationAvis) fieldGroupDecision.getField(TypeDecisionCandidature_.motivationAvis.getName());
    final RequiredIntegerField fieldRang = (RequiredIntegerField) fieldGroupDecision.getField(TypeDecisionCandidature_.listCompRangTypDecCand.getName());
    final RequiredTextField fieldLieuPreselect = (RequiredTextField) fieldGroupDecision.getField(TypeDecisionCandidature_.preselectLieuTypeDecCand.getName());
    final RequiredDateField fieldDatePreselect = (RequiredDateField) fieldGroupDecision.getField(TypeDecisionCandidature_.preselectDateTypeDecCand.getName());
    final RequiredCheckBox fieldAppel = (RequiredCheckBox) fieldGroupDecision.getField(TypeDecisionCandidature_.temAppelTypeDecCand.getName());
    final LocalTimeField fieldHeurePreselect = (LocalTimeField) fieldGroupDecision.getField(TypeDecisionCandidature_.preselectHeureTypeDecCand.getName());
    final RequiredTextArea fieldComment = (RequiredTextArea) fieldGroupDecision.getField(TypeDecisionCandidature_.commentTypeDecCand.getName());
    if (cbTypeDecision.getValue() != null) {
        if (candidature != null && candidature.getLastTypeDecision() != null && candidature.getLastTypeDecision().getTemValidTypeDecCand() && candidature.getLastTypeDecision().getTypeDecision().getTemDefinitifTypDec() && parametreController.getIsAppel()) {
            fieldAppel.setVisible(true);
        } else {
            fieldAppel.setVisible(false);
            fieldAppel.setValue(false);
        }
        fieldComment.setVisible(true);
        final TypeDecision typeDecision = (TypeDecision) cbTypeDecision.getValue();
        if (typeDecision.getTypeAvis().getCodTypAvis().equals(NomenclatureUtils.TYP_AVIS_DEF)) {
            cbMotivation.setBoxNeeded(true, null);
        } else {
            cbMotivation.setBoxNeeded(false, null);
        }
        if (typeDecision.getTypeAvis().getCodTypAvis().equals(NomenclatureUtils.TYP_AVIS_LISTE_COMP)) {
            fieldRang.setVisible(true);
            fieldRang.setRequired(true);
            fieldRang.setRequiredError(applicationContext.getMessage("validation.obigatoire", null, UI.getCurrent().getLocale()));
        } else {
            fieldRang.setVisible(false);
            fieldRang.setRequired(false);
            fieldRang.setRequiredError(null);
            fieldRang.setValue(null);
        }
        if (typeDecision.getTypeAvis().getCodTypAvis().equals(NomenclatureUtils.TYP_AVIS_PRESELECTION)) {
            fieldLieuPreselect.setVisible(true);
            fieldDatePreselect.setVisible(true);
            fieldHeurePreselect.setVisible(true);
            if (candidature != null) {
                fieldLieuPreselect.setValue(candidature.getFormation().getPreselectLieuForm());
                fieldDatePreselect.setValue((candidature.getFormation().getPreselectDateForm() != null) ? Date.valueOf(candidature.getFormation().getPreselectDateForm()) : null);
                fieldHeurePreselect.setValue(candidature.getFormation().getPreselectHeureForm());
            } else {
                fieldLieuPreselect.setValue(null);
                fieldDatePreselect.setValue(null);
                fieldHeurePreselect.setValue(null);
            }
        } else {
            fieldLieuPreselect.setVisible(false);
            fieldDatePreselect.setVisible(false);
            fieldHeurePreselect.setVisible(false);
        }
    } else {
        cbMotivation.setBoxNeeded(false, null);
        fieldRang.setVisible(false);
        fieldRang.setRequired(false);
        fieldRang.setRequiredError(null);
        fieldRang.setValue(null);
        fieldLieuPreselect.setVisible(false);
        fieldDatePreselect.setVisible(false);
        fieldHeurePreselect.setVisible(false);
        fieldLieuPreselect.setValue(null);
        fieldDatePreselect.setValue(null);
        fieldHeurePreselect.setValue(null);
        fieldAppel.setVisible(false);
        fieldAppel.setValue(false);
        fieldComment.setValue(null);
        fieldComment.setVisible(false);
    }
    center();
}
Also used : ComboBoxTypeDecision(fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxTypeDecision) TypeDecision(fr.univlorraine.ecandidat.entities.ecandidat.TypeDecision) RequiredCheckBox(fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox) ComboBoxMotivationAvis(fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxMotivationAvis) RequiredTextArea(fr.univlorraine.ecandidat.vaadin.form.RequiredTextArea) RequiredDateField(fr.univlorraine.ecandidat.vaadin.form.RequiredDateField) LocalTimeField(fr.univlorraine.ecandidat.vaadin.form.LocalTimeField) RequiredTextField(fr.univlorraine.ecandidat.vaadin.form.RequiredTextField) RequiredIntegerField(fr.univlorraine.ecandidat.vaadin.form.RequiredIntegerField) ComboBoxTypeDecision(fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxTypeDecision)

Example 3 with RequiredDateField

use of fr.univlorraine.ecandidat.vaadin.form.RequiredDateField in project esup-ecandidat by EsupPortail.

the class CtrCandActionCandidatureWindow method majStatutDossierComponent.

/**
 * Mise à jour des composants pour les StatutDossier
 */
@SuppressWarnings("unchecked")
private void majStatutDossierComponent() {
    final RequiredComboBox<TypeStatut> cbTypeStatut = (RequiredComboBox<TypeStatut>) fieldGroupTypeStatut.getField(Candidature_.typeStatut.getName());
    final RequiredDateField fieldDateRecept = (RequiredDateField) fieldGroupTypeStatut.getField(Candidature_.datReceptDossierCand.getName());
    if (cbTypeStatut.getValue() != null) {
        final TypeStatut typeStatut = (TypeStatut) cbTypeStatut.getValue();
        if (typeStatut.getCodTypStatut().equals(NomenclatureUtils.TYPE_STATUT_ATT)) {
            fieldDateRecept.setVisible(false);
            fieldDateRecept.setRequired(false);
            fieldDateRecept.setRequiredError(null);
            fieldDateRecept.setValue(null);
        } else {
            fieldDateRecept.setVisible(true);
            fieldDateRecept.setRequired(true);
            fieldDateRecept.setRequiredError(applicationContext.getMessage("validation.obigatoire", null, UI.getCurrent().getLocale()));
            if (typeStatut.getCodTypStatut().equals(NomenclatureUtils.TYPE_STATUT_REC)) {
                fieldDateRecept.setCaption(applicationContext.getMessage("candidature.action." + Candidature_.datReceptDossierCand.getName(), null, UI.getCurrent().getLocale()));
            } else if (typeStatut.getCodTypStatut().equals(NomenclatureUtils.TYPE_STATUT_COM)) {
                fieldDateRecept.setCaption(applicationContext.getMessage("candidature.action." + Candidature_.datCompletDossierCand.getName(), null, UI.getCurrent().getLocale()));
            } else if (typeStatut.getCodTypStatut().equals(NomenclatureUtils.TYPE_STATUT_INC)) {
                fieldDateRecept.setCaption(applicationContext.getMessage("candidature.action." + Candidature_.datIncompletDossierCand.getName(), null, UI.getCurrent().getLocale()));
            }
        }
    }
    fieldDateRecept.setLocalValue(LocalDate.now());
}
Also used : TypeStatut(fr.univlorraine.ecandidat.entities.ecandidat.TypeStatut) RequiredDateField(fr.univlorraine.ecandidat.vaadin.form.RequiredDateField) RequiredComboBox(fr.univlorraine.ecandidat.vaadin.form.RequiredComboBox)

Example 4 with RequiredDateField

use of fr.univlorraine.ecandidat.vaadin.form.RequiredDateField in project esup-ecandidat by EsupPortail.

the class CtrCandFormationDatesWindow method getErrorMessageDate.

/**
 * @return true si les dates sont valides
 */
private String getErrorMessageDate() {
    RequiredDateField fieldDatConfirm = ((RequiredDateField) fieldGroup.getField(Formation_.datConfirmForm.getName()));
    RequiredDateField fieldDatConfirmListComp = ((RequiredDateField) fieldGroup.getField(Formation_.datConfirmListCompForm.getName()));
    RequiredDateField fieldDatDebDepot = ((RequiredDateField) fieldGroup.getField(Formation_.datDebDepotForm.getName()));
    RequiredDateField fieldDatAnalyse = ((RequiredDateField) fieldGroup.getField(Formation_.datAnalyseForm.getName()));
    RequiredDateField fieldDatFinDepo = ((RequiredDateField) fieldGroup.getField(Formation_.datFinDepotForm.getName()));
    RequiredDateField fieldDatJury = ((RequiredDateField) fieldGroup.getField(Formation_.datJuryForm.getName()));
    RequiredDateField fieldDatPubli = ((RequiredDateField) fieldGroup.getField(Formation_.datPubliForm.getName()));
    RequiredDateField fieldDatRetour = ((RequiredDateField) fieldGroup.getField(Formation_.datRetourForm.getName()));
    return formationController.getTxtErrorEditDate(fieldDatConfirm.getValue(), fieldDatConfirmListComp.getValue(), fieldDatDebDepot.getValue(), fieldDatAnalyse.getValue(), fieldDatFinDepo.getValue(), fieldDatJury.getValue(), fieldDatPubli.getValue(), fieldDatRetour.getValue());
}
Also used : RequiredDateField(fr.univlorraine.ecandidat.vaadin.form.RequiredDateField)

Aggregations

RequiredDateField (fr.univlorraine.ecandidat.vaadin.form.RequiredDateField)4 TypeDecision (fr.univlorraine.ecandidat.entities.ecandidat.TypeDecision)1 TypeStatut (fr.univlorraine.ecandidat.entities.ecandidat.TypeStatut)1 LocalTimeField (fr.univlorraine.ecandidat.vaadin.form.LocalTimeField)1 RequiredCheckBox (fr.univlorraine.ecandidat.vaadin.form.RequiredCheckBox)1 RequiredComboBox (fr.univlorraine.ecandidat.vaadin.form.RequiredComboBox)1 RequiredIntegerField (fr.univlorraine.ecandidat.vaadin.form.RequiredIntegerField)1 RequiredTextArea (fr.univlorraine.ecandidat.vaadin.form.RequiredTextArea)1 RequiredTextField (fr.univlorraine.ecandidat.vaadin.form.RequiredTextField)1 ComboBoxMotivationAvis (fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxMotivationAvis)1 ComboBoxTypeDecision (fr.univlorraine.ecandidat.vaadin.form.combo.ComboBoxTypeDecision)1