From cc800e56d5f0509de8efb411605d212b1c85c7c9 Mon Sep 17 00:00:00 2001 From: Cristian Lucchesi Date: Mon, 12 Sep 2022 16:52:57 +0200 Subject: [PATCH 01/13] Aggiunta configurazione per la comunicazione delle assenze livelli I-III --- app/controllers/Configurations.java | 19 +++++++++++++-- app/helpers/TemplateUtility.java | 8 +++++++ app/manager/configurations/EpasParam.java | 24 +++++++++++++++++++ app/models/GeneralSetting.java | 7 ++++++ app/views/Administration/_generalSetting.html | 12 ++++++++++ conf/messages.it | 4 ++++ db/evolutions/192.sql | 9 +++++++ 7 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 db/evolutions/192.sql diff --git a/app/controllers/Configurations.java b/app/controllers/Configurations.java index 9e4d8b762..76c010c0f 100755 --- a/app/controllers/Configurations.java +++ b/app/controllers/Configurations.java @@ -21,6 +21,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Verify; import common.security.SecurityRules; +import dao.GeneralSettingDao; import dao.OfficeDao; import dao.PersonDao; import java.io.File; @@ -75,7 +76,8 @@ public class Configurations extends Controller { static PeriodManager periodManager; @Inject static SecurityRules rules; - + @Inject + static GeneralSettingDao generalSettingDao; private static IPropertyInPeriod compute(IPropertyInPeriod configuration, EpasParam epasParam, ConfigurationDto configurationDto) { @@ -256,10 +258,23 @@ public static void show(Long officeId, EpasParamCategory paramCategory) { .filter(conf -> conf.epasParam.category == EpasParam.EpasParamCategory.AUTOCERTIFICATION) .collect(Collectors.toList()); - final List flows = configurations.stream() + List flows = configurations.stream() .filter(conf -> conf.epasParam.category == EpasParam.EpasParamCategory.FLOWS) .collect(Collectors.toList()); + if (!generalSettingDao.generalSetting().enableAbsenceTopLevelAuthorization) { + flows = flows.stream().filter(conf -> + !conf.epasParam.equals(EpasParam.COMPENSATORY_REST_REQUEST_I_III_MANAGER_APPROVAL_REQUIRED) && + !conf.epasParam.equals(EpasParam.COMPENSATORY_REST_REQUEST_I_III_OFFICE_HEAD_APPROVAL_REQUIRED) && + !conf.epasParam.equals(EpasParam.VACATION_REQUEST_I_III_MANAGER_APPROVAL_REQUIRED) && + !conf.epasParam.equals(EpasParam.VACATION_REQUEST_I_III_OFFICE_HEAD_APPROVAL_REQUIRED)) + .collect(Collectors.toList()); + } else { + flows = flows.stream().filter(conf -> + !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_MANAGER_NOTIFICATION) && + !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_OFFICE_HEAD_NOTIFICATION)) + .collect(Collectors.toList()); + } final List competenceFlows = configurations.stream() .filter(conf -> conf.epasParam.category == EpasParam.EpasParamCategory.COMPETENCE_FLOWS) .collect(Collectors.toList()); diff --git a/app/helpers/TemplateUtility.java b/app/helpers/TemplateUtility.java index 37d7d42ce..99fbf6c32 100644 --- a/app/helpers/TemplateUtility.java +++ b/app/helpers/TemplateUtility.java @@ -909,4 +909,12 @@ public String getCompanyUrl() { return CompanyConfig.url(); } + + /** + * Indica se è permessa la configurabilità delle richieste di assenza + * per i livelli I-III. + */ + public boolean absenceRequestAuthorizationTopLevelEnabled () { + return generalSettingDao.generalSetting().enableAbsenceTopLevelAuthorization; + } } diff --git a/app/manager/configurations/EpasParam.java b/app/manager/configurations/EpasParam.java index ac9fd1e99..280ee6b19 100644 --- a/app/manager/configurations/EpasParam.java +++ b/app/manager/configurations/EpasParam.java @@ -681,6 +681,30 @@ public enum EpasParam { Lists.newArrayList(), Office.class), + /** + * Il responsabile di sede deve ricevere le notifiche delle comunicazioni di ferie deli livelli I-III. + */ + ABSENCE_TOP_LEVEL_OFFICE_HEAD_NOTIFICATION( + "absence_top_level_office_head_notification", + EpasParamCategory.FLOWS, + EpasParamTimeType.PERIODIC, + EpasParamValueType.BOOLEAN, + EpasParamValueType.formatValue(true), + Lists.newArrayList(), + Office.class), + + /** + * Il responsabile di gruppo deve ricevere le notifiche delle comunicazioni di ferie deli livelli I-III. + */ + ABSENCE_TOP_LEVEL_MANAGER_NOTIFICATION( + "absence_top_level_manager_notification", + EpasParamCategory.FLOWS, + EpasParamTimeType.PERIODIC, + EpasParamValueType.BOOLEAN, + EpasParamValueType.formatValue(false), + Lists.newArrayList(), + Office.class), + //##################################################################### //FLOWS PARAMS COMPETENCES diff --git a/app/models/GeneralSetting.java b/app/models/GeneralSetting.java index a269a12ca..cc9ac82a8 100644 --- a/app/models/GeneralSetting.java +++ b/app/models/GeneralSetting.java @@ -98,5 +98,12 @@ public class GeneralSetting extends BaseModel { * inserire timbrature via REST. */ public int maxDaysInPastForRestStampings = 90; + + /* + * Indica se è possibile o meno configurare per i livelli I-III + * la richiesta di approvazione ferie da parte di un responsabile di + * gruppo o del responsabile di sede. + */ + public boolean enableAbsenceTopLevelAuthorization = true; } \ No newline at end of file diff --git a/app/views/Administration/_generalSetting.html b/app/views/Administration/_generalSetting.html index f90ed3d70..053fb8854 100644 --- a/app/views/Administration/_generalSetting.html +++ b/app/views/Administration/_generalSetting.html @@ -64,6 +64,18 @@

&{actionSelected+'.table'}

#{/b.buttons} #{/form} #{/accordionItem} + #{accordionItem 'enableAbsenceTopLevelRequestAuthorization', parent:'generalSetting', + title:'Abilitazione dei flussi di approvazione per i livelli I-III', open:false} + #{form action:@saveGeneralSetting(), method:'POST', class:'form form-horizontal'} + #{f.hidden 'generalSetting.id' /} + #{alert color:'info'}Permette di configurazione l'approvazione delle richieste di assenza per i livelli I-III. Se impostato a "no" per i livelli I-III sarà possibile solo configurare le notifiche per le comunicazioni di assenza. #{/alert} + #{f.booleanRadio 'generalSetting.enableAbsenceTopLevelAuthorization' /} + #{b.buttons} + #{b.save /} + #{/b.buttons} + #{/form} + #{/accordionItem} + #{accordionItem 'handleGroupsByInstitute', parent:'generalSetting', title:'Gestione gruppi per istituto', open:false} #{form action:@saveGeneralSetting(), method:'POST', class:'form form-horizontal'} #{f.hidden 'generalSetting.id' /} diff --git a/conf/messages.it b/conf/messages.it index cde42bc90..e623012d1 100755 --- a/conf/messages.it +++ b/conf/messages.it @@ -449,6 +449,7 @@ generalSetting.enableAutoconfigCovid19=Abilita visione auto inserimento covid19 generalSetting.enableAutoconfigSmartworking=Abilita visione auto inserimento smartworking in configurazione generalSetting.enableDailyPresenceForManager=Abilita visualizzazione presenza giornaliera dipendenti appartenenti a gruppo generalSetting.holidayShiftInNightToo=Considera come festivi i turni notturni effettuati nei festivi +generalSetting.enableAbsenceTopLevelAuthorization=Possibilità di configurare le autorizzazioni per le assenze dei livelli I-III group.label =Nome gruppo group.limitType =Periodo di utililzzo limite @@ -1267,6 +1268,9 @@ PERSONAL_PERMISSION_REQUEST_I_III_MANAGER_APPROVAL_REQUIRED =Richiesta approvazi PERSONAL_PERMISSION_REQUEST_IV_VIII_MANAGER_APPROVAL_REQUIRED =Richiesta approvazione permessi personali per i livelli IV-VIII da parte del Responsabile gruppo di lavoro PERSONAL_PERMISSION_REQUEST_MANAGER_OFFICE_HEAD_APPROVAL_REQUIRED =Richiesta approvazione permessi personali per i Responsabili di gruppo da parte del Responsabile di Sede +ABSENCE_TOP_LEVEL_OFFICE_HEAD_NOTIFICATION=Invio notifica a responsabile di sede per comunicazione assenza livelli I-III +ABSENCE_TOP_LEVEL_MANAGER_NOTIFICATION=Invio notifica a responsabile di gruppo per comunicazione assenza livelli I-III + ENABLE_COMPETENCE_FLOWS =Abilitazione flusso di richiesta competenze CHANGE_REPERIBILITY_REQUEST_REPERIBILITY_MANAGER_APPROVAL_REQUIRED =Richiesta approvazione del responsabile del servizio per cambio giorno di reperibilità CHANGE_REPERIBILITY_REQUEST_EMPLOYEE_APPROVAL_REQUIRED =Richiesta approvazione del reperibile per cambio giorno di reperibilità diff --git a/db/evolutions/192.sql b/db/evolutions/192.sql new file mode 100644 index 000000000..c936e7ddb --- /dev/null +++ b/db/evolutions/192.sql @@ -0,0 +1,9 @@ +# ---!Ups + +ALTER TABLE general_setting ADD COLUMN enable_absence_top_level_authorization BOOLEAN DEFAULT TRUE; +ALTER TABLE general_setting_history ADD COLUMN enable_absence_top_level_authorization BOOLEAN; + +# ---!Downs + +ALTER TABLE general_setting DROP COLUMN enable_absence_top_level_authorization; +ALTER TABLE general_setting_history DROP enable_absence_top_level_authorization; \ No newline at end of file From 56dc75c3887089733236a5c16c70138ee9cd26ab Mon Sep 17 00:00:00 2001 From: darietto1983 Date: Tue, 13 Sep 2022 17:04:40 +0200 Subject: [PATCH 02/13] Iniziata rifattorizzazione dei congedi parentali. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aggiunti i nuovi codici 25A e 25S (anche per secondo e terzo figlio) e modificati i vecchi 25 (anche per figli successivi) aggiungendo la "O" in fondo al codice. Inserita fine validità per tutti i codici 24 --- .../definitions/DefaultAbsenceType.java | 216 ++++++++++++++++-- .../definitions/DefaultComplation.java | 12 + .../absences/definitions/DefaultGroup.java | 23 ++ .../absences/definitions/DefaultTakable.java | 45 +++- 4 files changed, 265 insertions(+), 31 deletions(-) diff --git a/app/models/absences/definitions/DefaultAbsenceType.java b/app/models/absences/definitions/DefaultAbsenceType.java index ebaec0de9..220d6e171 100644 --- a/app/models/absences/definitions/DefaultAbsenceType.java +++ b/app/models/absences/definitions/DefaultAbsenceType.java @@ -670,20 +670,69 @@ null, new LocalDate(2020, 1, 1), true, true, true), false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_25O("25", "Astensione facoltativa post partum 30% primo figlio intera giornata", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), A_25("25", "Astensione facoltativa post partum 30% primo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + /*Da definire 25A e 25S*/ + A_25A("25A", "Da definire...", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), + A_25AM("25AM", "Da definire... in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), + A_25AH7("25AH7", "Astensione facoltativa post partum 30% primo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_25S("25S", "Da definire...", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), + A_25SM("25SM", "Da definire... in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), + A_25SH7("25SH7", "Astensione facoltativa post partum 30% primo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + /*Fine spazio 25A e 25S*/ + A_25OM("25M", "Astensione facoltativa post partum 30% primo figlio in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), A_25M("25M", "Astensione facoltativa post partum 30% primo figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, false, true, true), + + A_25OH7("25H7", "Astensione facoltativa post partum 30% primo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), A_25H7("25H7", "Astensione facoltativa post partum 30% primo figlio completamento giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_25OU("25U", "Astensione facoltativa post partum 30% primo figlio intera giornata altro genitore", + true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(), null, null, false, true, true), A_25U("25U", "Astensione facoltativa post partum 30% primo figlio intera giornata altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, MealTicketBehaviour.notAllowMealTicket, 0, null, @@ -692,20 +741,20 @@ null, new LocalDate(2020, 1, 1), true, true, true), A_24("24", "Astensione facoltativa post partum non retrib. primo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, - null, false, true, true), + new LocalDate(2022,8,12), false, true, true), A_24M("24M", "Astensione facoltativa post partum non retrib. primo figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, - Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, - false, true, true), + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, + new LocalDate(2022,8,12), false, true, true), A_24H7("24H7", "Astensione facoltativa post partum non retrib. primo figlio completamento " + "giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, - MealTicketBehaviour.notAllowMealTicket, 0, - JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), + null, new LocalDate(2022,8,12), false, true, true), A_24U("24U", "Astensione facoltativa post partum non retrib. primo figlio intera giornata altro " + "genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, false, MealTicketBehaviour.notAllowMealTicket, - 0, null, Sets.newHashSet(), null, null, false, true, true), + 0, null, Sets.newHashSet(), null, new LocalDate(2022,8,12), false, true, true), A_232("232", "Astensione facoltativa post partum 100% secondo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, @@ -725,19 +774,68 @@ null, new LocalDate(2020, 1, 1), true, true, true), true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + A_252OM("252M", "Astensione facoltativa post partum 30% secondo figlio in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), A_252M("252M", "Astensione facoltativa post partum 30% secondo figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, false, true, true), - A_252("252", "Astensione facoltativa post partum 30% secondo figlio intera giornata", + + A_252O("252", "Astensione facoltativa post partum 30% secondo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + A_252("252", "Astensione facoltativa post partum 30% secondo figlio intera giornata", + false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(), null, null, false, true, true), + + A_252A("252A", "Da definire...", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), + A_252AM("252AM", "Da definire... in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), + A_252AH7("25H7", "Astensione facoltativa post partum 30% primo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_252S("252S", "Da definire...", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), + A_252SM("252SM", "Da definire... in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), + A_252SH7("25H7", "Astensione facoltativa post partum 30% primo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + + A_252OH7("252H7", "Astensione facoltativa post partum 30% secondo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), A_252H7("252H7", "Astensione facoltativa post partum 30% secondo figlio completamento giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_252OU("252U", "Astensione facoltativa post partum 30% secondo figlio intera giornata " + + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, + MealTicketBehaviour.notAllowMealTicket, + 0, null, Sets.newHashSet(), null, null, false, true, true), A_252U("252U", "Astensione facoltativa post partum 30% secondo figlio intera giornata " + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, MealTicketBehaviour.notAllowMealTicket, @@ -746,21 +844,21 @@ null, new LocalDate(2020, 1, 1), true, true, true), A_242("242", "Astensione facoltativa post partum non retrib. secondo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), - null, null, false, true, true), + null, new LocalDate(2022,8,12), false, true, true), A_242M("242M", "Astensione facoltativa post partum non retrib. secondo figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, - Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, - false, true, true), + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, + new LocalDate(2022,8,12), false, true, true), A_242H7("242H7", "Astensione facoltativa post partum non retrib. secondo figlio completamento " + "giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, - MealTicketBehaviour.notAllowMealTicket, 0, - JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), + null, new LocalDate(2022,8,12), false, true, true), A_242U("242U", "Astensione facoltativa post partum non retrib. secondo figlio intera giornata " + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, false, MealTicketBehaviour.notAllowMealTicket, - 0, null, Sets.newHashSet(), null, null, false, true, true), + 0, null, Sets.newHashSet(), null, new LocalDate(2022,8,12), false, true, true), A_233("233", "Astensione facoltativa post partum 100% terzo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, @@ -780,19 +878,67 @@ null, new LocalDate(2020, 1, 1), true, true, true), true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + A_253O("253", "Astensione facoltativa post partum 30% terzo figlio intera giornata", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), A_253("253", "Astensione facoltativa post partum 30% terzo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + + A_253A("253A", "Da definire...", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), + A_253AM("253AM", "Da definire... in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), + A_253AH7("253AH7", "Astensione facoltativa post partum 30% terzo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_253S("253S", "Da definire...", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, + MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, + null, false, true, true), + A_253SM("253SM", "Da definire... in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), + A_253SH7("253SH7", "Astensione facoltativa post partum 30% terzo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_253OM("253M", "Astensione facoltativa post partum 30% terzo figlio in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), A_253M("253M", "Astensione facoltativa post partum 30% terzo figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, false, true, true), + + A_253OH7("253H7", "Astensione facoltativa post partum 30% terzo figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), A_253H7("253H7", "Astensione facoltativa post partum 30% terzo figlio completamento giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_253OU("253U", "Astensione facoltativa post partum 30% terzo figlio intera giornata " + + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, + MealTicketBehaviour.notAllowMealTicket, + 0, null, Sets.newHashSet(), null, null, false, true, true), A_253U("253U", "Astensione facoltativa post partum 30% terzo figlio intera giornata " + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, MealTicketBehaviour.notAllowMealTicket, @@ -801,21 +947,21 @@ null, new LocalDate(2020, 1, 1), true, true, true), A_243("243", "Astensione facoltativa post partum non retrib. terzo figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, - null, false, true, true), + new LocalDate(2022,8,12), false, true, true), A_243M("243M", "Astensione facoltativa post partum non retrib. terzo figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, - Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, - false, true, true), + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, + new LocalDate(2022,8,12), false, true, true), A_243H7("243H7", "Astensione facoltativa post partum non retrib. terzo figlio completamento " + "giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, - MealTicketBehaviour.notAllowMealTicket, 0, - JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), + null, new LocalDate(2022,8,12), false, true, true), A_243U("243U", "Astensione facoltativa post partum non retrib. terzo figlio intera giornata " + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, false, MealTicketBehaviour.notAllowMealTicket, - 0, null, Sets.newHashSet(), null, null, false, true, true), + 0, null, Sets.newHashSet(), null, new LocalDate(2022,8,12), false, true, true), A_234("234", "Astensione facoltativa post partum 100% quarto figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, @@ -835,19 +981,39 @@ null, new LocalDate(2020, 1, 1), true, true, true), MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + A_254O("254", "Astensione facoltativa post partum 30% quarto figlio intera giornata", false, + ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, + 0, null, Sets.newHashSet(), null, null, false, true, true), A_254("254", "Astensione facoltativa post partum 30% quarto figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(), null, null, false, true, true), + + A_254OM("254M", + "Astensione facoltativa post partum 30% quarto figlio in ore e minuti", true, + ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, null, + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, + false, true, true), A_254M("254M", "Astensione facoltativa post partum 30% quarto figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, false, true, true), + + A_254OH7("254H7", "Astensione facoltativa post partum 30% quarto figlio completamento giornata", + false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, + MealTicketBehaviour.notAllowMealTicket, 0, + JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), A_254H7("254H7", "Astensione facoltativa post partum 30% quarto figlio completamento giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + + A_254OU("254U", "Astensione facoltativa post partum 30% quarto figlio intera giornata " + + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, + MealTicketBehaviour.notAllowMealTicket, + 0, null, Sets.newHashSet(), null, null, false, true, true), A_254U("254U", "Astensione facoltativa post partum 30% quarto figlio intera giornata " + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, true, MealTicketBehaviour.notAllowMealTicket, @@ -856,21 +1022,21 @@ null, new LocalDate(2020, 1, 1), true, true, true), A_244("244", "Astensione facoltativa post partum non retrib. quarto figlio intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, - Sets.newHashSet(), null, null, false, true, true), + Sets.newHashSet(), null, new LocalDate(2022,8,12), false, true, true), A_244M("244M", "Astensione facoltativa post partum non retrib. quarto figlio in ore e minuti", true, ImmutableSet.of(JustifiedTypeName.specified_minutes), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, null, - Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, null, - false, true, true), + Sets.newHashSet(new Behaviour(JustifiedBehaviourName.no_overtime)), null, + new LocalDate(2022,8,12), false, true, true), A_244H7("244H7", "Astensione facoltativa post partum non retrib. quarto figlio completamento " + "giornata", false, ImmutableSet.of(JustifiedTypeName.nothing), 0, false, - MealTicketBehaviour.notAllowMealTicket, 0, - JustifiedTypeName.all_day, Sets.newHashSet(), null, null, false, true, true), + MealTicketBehaviour.notAllowMealTicket, 0, JustifiedTypeName.all_day, Sets.newHashSet(), + null, new LocalDate(2022,8,12), false, true, true), A_244U("244U", "Astensione facoltativa post partum non retrib. quarto figlio intera giornata " + "altro genitore", true, ImmutableSet.of(JustifiedTypeName.all_day_limit), 0, false, MealTicketBehaviour.notAllowMealTicket, 0, - null, Sets.newHashSet(), null, null, false, true, true), + null, Sets.newHashSet(), null, new LocalDate(2022,8,12), false, true, true), A_25P("25P", "Prolungamento astensione facoltativa post partum 30% intera giornata", false, ImmutableSet.of(JustifiedTypeName.all_day), 0, true, MealTicketBehaviour.notAllowMealTicket, diff --git a/app/models/absences/definitions/DefaultComplation.java b/app/models/absences/definitions/DefaultComplation.java index 460577151..a6db00b74 100644 --- a/app/models/absences/definitions/DefaultComplation.java +++ b/app/models/absences/definitions/DefaultComplation.java @@ -173,6 +173,9 @@ public enum DefaultComplation { C_23(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_23M), ImmutableSet.of(DefaultAbsenceType.A_23H7)), + C_25O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_25OM), + ImmutableSet.of(DefaultAbsenceType.A_25OH7)), C_25(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_25M), ImmutableSet.of(DefaultAbsenceType.A_25H7)), @@ -188,6 +191,9 @@ public enum DefaultComplation { C_232(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_232M), ImmutableSet.of(DefaultAbsenceType.A_232H7)), + C_252O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_252OM), + ImmutableSet.of(DefaultAbsenceType.A_252OH7)), C_252(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_252M), ImmutableSet.of(DefaultAbsenceType.A_252H7)), @@ -198,6 +204,9 @@ public enum DefaultComplation { C_233(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_233M), ImmutableSet.of(DefaultAbsenceType.A_233H7)), + C_253O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_253OM), + ImmutableSet.of(DefaultAbsenceType.A_253OH7)), C_253(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_253M), ImmutableSet.of(DefaultAbsenceType.A_253H7)), @@ -208,6 +217,9 @@ public enum DefaultComplation { C_234(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_234M), ImmutableSet.of(DefaultAbsenceType.A_234H7)), + C_254O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_254OM), + ImmutableSet.of(DefaultAbsenceType.A_254OH7)), C_254(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_254M), ImmutableSet.of(DefaultAbsenceType.A_254H7)), diff --git a/app/models/absences/definitions/DefaultGroup.java b/app/models/absences/definitions/DefaultGroup.java index 0605df96d..bed844f1c 100644 --- a/app/models/absences/definitions/DefaultGroup.java +++ b/app/models/absences/definitions/DefaultGroup.java @@ -223,6 +223,11 @@ public enum DefaultGroup { DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child1_0_12, DefaultTakable.T_24, DefaultComplation.C_24, null, false, true), + + G_25O("25 - Astensione facoltativa post partum 30% primo figlio 0-6 anni 150 giorni", + "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, + PeriodType.child1_0_6, DefaultTakable.T_25O, DefaultComplation.C_25O, DefaultGroup.G_24, + false, true), G_25("25 - Astensione facoltativa post partum 30% primo figlio 0-6 anni 150 giorni", "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child1_0_6, DefaultTakable.T_25, DefaultComplation.C_25, DefaultGroup.G_24, @@ -242,6 +247,12 @@ public enum DefaultGroup { PeriodType.always, DefaultTakable.T_COV00, DefaultComplation.C_COV00, null, false, true), + G_23O("23 - Astensione facoltativa post partum 100% primo figlio 0-12 anni 30 giorni", + "23/25/24 - Astensione facoltativa post partum primo figlio", + DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, + PeriodType.child1_0_12, DefaultTakable.T_23, DefaultComplation.C_23, + DefaultGroup.G_25, false, true), + G_23("23 - Astensione facoltativa post partum 100% primo figlio 0-12 anni 30 giorni", "23/25/24 - Astensione facoltativa post partum primo figlio", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, @@ -253,6 +264,10 @@ public enum DefaultGroup { "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child2_0_12, DefaultTakable.T_242, DefaultComplation.C_242, null, false, true), + G_252O("252 - Astensione facoltativa post partum 30% secondo figlio 0-6 anni 150 giorni", "", + DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, + PeriodType.child2_0_6, DefaultTakable.T_252O, DefaultComplation.C_252O, DefaultGroup.G_242, + false, true), G_252("252 - Astensione facoltativa post partum 30% secondo figlio 0-6 anni 150 giorni", "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child2_0_6, DefaultTakable.T_252, DefaultComplation.C_252, DefaultGroup.G_242, @@ -266,6 +281,10 @@ public enum DefaultGroup { G_243("243 - Astensione facoltativa post partum non retrib. terzo figlio 0-12 anni 600 giorni", "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child3_0_12, DefaultTakable.T_243, DefaultComplation.C_243, null, false, true), + G_253O("253 - Astensione facoltativa post partum 30% terzo figlio 0-6 anni 150 giorni", + "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, + PeriodType.child3_0_6, DefaultTakable.T_253O, DefaultComplation.C_253O, DefaultGroup.G_243, + false, true), G_253("253 - Astensione facoltativa post partum 30% terzo figlio 0-6 anni 150 giorni", "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child3_0_6, DefaultTakable.T_253, DefaultComplation.C_253, DefaultGroup.G_243, @@ -279,6 +298,10 @@ public enum DefaultGroup { G_244("244 - Astensione facoltativa post partum non retrib. quarto figlio 0-12 anni 600 giorni", "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child4_0_12, DefaultTakable.T_244, DefaultComplation.C_244, null, false, true), + G_254O("254 - Astensione facoltativa post partum 30% quarto figlio 0-6 anni 150 giorni", + "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, + PeriodType.child4_0_6, DefaultTakable.T_254O, DefaultComplation.C_254O, DefaultGroup.G_244, + false, true), G_254("254 - Astensione facoltativa post partum 30% quarto figlio 0-6 anni 150 giorni", "", DefaultCategoryType.ASTENSIONE_POSTPARTUM, 0, GroupAbsenceTypePattern.programmed, PeriodType.child4_0_6, DefaultTakable.T_254, DefaultComplation.C_254, DefaultGroup.G_244, diff --git a/app/models/absences/definitions/DefaultTakable.java b/app/models/absences/definitions/DefaultTakable.java index a20d74294..60c772fb7 100644 --- a/app/models/absences/definitions/DefaultTakable.java +++ b/app/models/absences/definitions/DefaultTakable.java @@ -265,6 +265,15 @@ public enum DefaultTakable { DefaultAbsenceType.A_COV00M), ImmutableSet.of(DefaultAbsenceType.A_COV00, DefaultAbsenceType.A_COV00M), -1, null), + + T_25O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_25O, + DefaultAbsenceType.A_25OM, + DefaultAbsenceType.A_25OU), + ImmutableSet.of(DefaultAbsenceType.A_25O, + DefaultAbsenceType.A_25OM, + DefaultAbsenceType.A_25OU), + 150, null), T_25(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_25, @@ -293,6 +302,14 @@ public enum DefaultTakable { DefaultAbsenceType.A_232U), 30, null), + T_252O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_252O, + DefaultAbsenceType.A_252OM, + DefaultAbsenceType.A_252OU), + ImmutableSet.of(DefaultAbsenceType.A_252O, + DefaultAbsenceType.A_252OM, + DefaultAbsenceType.A_252OU), + 150, null), T_252(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_252, DefaultAbsenceType.A_252M, @@ -320,6 +337,14 @@ public enum DefaultTakable { DefaultAbsenceType.A_233U), 30, null), + T_253O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_253O, + DefaultAbsenceType.A_253OM, + DefaultAbsenceType.A_253OU), + ImmutableSet.of(DefaultAbsenceType.A_253O, + DefaultAbsenceType.A_253OM, + DefaultAbsenceType.A_253OU), + 150, null), T_253(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_253, DefaultAbsenceType.A_253M, @@ -346,6 +371,14 @@ public enum DefaultTakable { DefaultAbsenceType.A_234M, DefaultAbsenceType.A_234U), 30, null), + T_254O(AmountType.units, + ImmutableSet.of(DefaultAbsenceType.A_254O, + DefaultAbsenceType.A_254OM, + DefaultAbsenceType.A_254OU), + ImmutableSet.of(DefaultAbsenceType.A_254O, + DefaultAbsenceType.A_254OM, + DefaultAbsenceType.A_254OU), + 150, null), T_254(AmountType.units, ImmutableSet.of(DefaultAbsenceType.A_254, DefaultAbsenceType.A_254M, @@ -649,11 +682,11 @@ public enum DefaultTakable { T_RIDUCE_FERIE_CNR(AmountType.units, ImmutableSet.of( DefaultAbsenceType.A_24, DefaultAbsenceType.A_24H7, - DefaultAbsenceType.A_25, DefaultAbsenceType.A_25H7, + DefaultAbsenceType.A_25O, DefaultAbsenceType.A_25OH7, DefaultAbsenceType.A_242, DefaultAbsenceType.A_242H7, - DefaultAbsenceType.A_252, DefaultAbsenceType.A_252H7, + DefaultAbsenceType.A_252O, DefaultAbsenceType.A_252OH7, DefaultAbsenceType.A_243, DefaultAbsenceType.A_243H7, - DefaultAbsenceType.A_253, DefaultAbsenceType.A_253H7, + DefaultAbsenceType.A_253O, DefaultAbsenceType.A_253OH7, DefaultAbsenceType.A_54L230, DefaultAbsenceType.A_50, DefaultAbsenceType.A_54, DefaultAbsenceType.A_54D, DefaultAbsenceType.A_54E, DefaultAbsenceType.A_54F, @@ -670,11 +703,11 @@ public enum DefaultTakable { DefaultAbsenceType.A_C16, DefaultAbsenceType.A_35R), ImmutableSet.of( DefaultAbsenceType.A_24, DefaultAbsenceType.A_24H7, - DefaultAbsenceType.A_25, DefaultAbsenceType.A_25H7, + DefaultAbsenceType.A_25O, DefaultAbsenceType.A_25OH7, DefaultAbsenceType.A_242, DefaultAbsenceType.A_242H7, - DefaultAbsenceType.A_252, DefaultAbsenceType.A_252H7, + DefaultAbsenceType.A_252O, DefaultAbsenceType.A_252OH7, DefaultAbsenceType.A_243, DefaultAbsenceType.A_243H7, - DefaultAbsenceType.A_253, DefaultAbsenceType.A_253H7, + DefaultAbsenceType.A_253O, DefaultAbsenceType.A_253OH7, DefaultAbsenceType.A_54L230, DefaultAbsenceType.A_50, DefaultAbsenceType.A_54, DefaultAbsenceType.A_54D, DefaultAbsenceType.A_54E, DefaultAbsenceType.A_54F, From 70bc6df2e2f16145bf1849ae74af8ebc04ee023c Mon Sep 17 00:00:00 2001 From: Cristian Lucchesi Date: Wed, 14 Sep 2022 18:19:35 +0200 Subject: [PATCH 03/13] Versione non ancora funzionante comunicazione assenze liv. I-III --- app/controllers/Configurations.java | 5 +- app/manager/NotificationManager.java | 120 +++++++++++++++++- app/manager/configurations/EpasParam.java | 16 ++- app/manager/flows/AbsenceRequestManager.java | 23 +++- .../absences/AbsenceEngineUtility.java | 1 - .../absences/model/AbsencePeriod.java | 1 - app/models/PersonalWorkingTime.java | 7 - app/views/AbsenceRequests/edit.html | 10 +- app/views/AbsenceRequests/list.html | 14 +- app/views/_workflowsMenu.html | 29 +++-- app/views/tags/secure/li.html | 5 +- conf/messages.it | 15 ++- 12 files changed, 199 insertions(+), 47 deletions(-) diff --git a/app/controllers/Configurations.java b/app/controllers/Configurations.java index 76c010c0f..ce7163dfe 100755 --- a/app/controllers/Configurations.java +++ b/app/controllers/Configurations.java @@ -271,8 +271,9 @@ public static void show(Long officeId, EpasParamCategory paramCategory) { .collect(Collectors.toList()); } else { flows = flows.stream().filter(conf -> - !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_MANAGER_NOTIFICATION) && - !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_OFFICE_HEAD_NOTIFICATION)) + !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_GROUP_MANAGER_NOTIFICATION) && + !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_OFFICE_HEAD_NOTIFICATION) && + !conf.epasParam.equals(EpasParam.ABSENCE_TOP_LEVEL_OF_GROUP_MANAGER_OFFICE_HEAD_NOTIFICATION)) .collect(Collectors.toList()); } final List competenceFlows = configurations.stream() diff --git a/app/manager/NotificationManager.java b/app/manager/NotificationManager.java index 1e3103ed1..254ea7bb9 100644 --- a/app/manager/NotificationManager.java +++ b/app/manager/NotificationManager.java @@ -20,9 +20,11 @@ import com.google.common.base.Optional; import com.google.common.base.Strings; import com.google.common.base.Verify; +import com.google.common.collect.Sets; import com.google.inject.Inject; import controllers.Security; import dao.AbsenceDao; +import dao.GeneralSettingDao; import dao.GroupDao; import dao.InformationRequestDao; import dao.RoleDao; @@ -89,7 +91,8 @@ public class NotificationManager { private GroupDao groupDao; private ConfigurationManager configurationManager; private InformationRequestDao requestDao; - + private GeneralSettingDao generalSettingDao; + final String dateFormatter = "dd/MM/YYYY"; /** @@ -98,7 +101,8 @@ public class NotificationManager { @Inject public NotificationManager(SecureManager secureManager, RoleDao roleDao, AbsenceDao absenceDao, AbsenceComponentDao componentDao, GroupDao groupDao, - ConfigurationManager configurationManager, InformationRequestDao requestDao) { + ConfigurationManager configurationManager, InformationRequestDao requestDao, + GeneralSettingDao generalSettingDao) { this.secureManager = secureManager; this.roleDao = roleDao; this.absenceDao = absenceDao; @@ -106,7 +110,7 @@ public NotificationManager(SecureManager secureManager, RoleDao roleDao, Absence this.groupDao = groupDao; this.configurationManager = configurationManager; this.requestDao = requestDao; - + this.generalSettingDao = generalSettingDao; } private static final String WORKDAY_REPERIBILITY = "207"; @@ -749,6 +753,15 @@ private void sendEmailAbsenceRequest(AbsenceRequest absenceRequest) { Verify.verifyNotNull(absenceRequest); final Person person = absenceRequest.person; + //Nel caso si tratti di una "comunicazione" di assenza da parte di + //un livelli I-III e non sia necessaria nessuna autorizzazione, allora + //si invia solo una notifica al responsabile sede e/o responsabile gruppo + //(dipendente dalla configurazione) + if (generalSettingDao.generalSetting().enableAbsenceTopLevelAuthorization == false && + absenceRequest.person.isTopQualification()) { + sendEmailAbsenceNotification(absenceRequest); + } + final Role roleDestination = getProperRole(absenceRequest); if (roleDestination == null) { log.warn( @@ -794,6 +807,67 @@ private void sendEmailAbsenceRequest(AbsenceRequest absenceRequest) { }); } + private void sendEmailAbsenceNotification(AbsenceRequest absenceRequest) { + Set recipients = Sets.newHashSet(); + //si invia solo una notifica al responsabile sede e/o responsabile gruppo + //(dipendente dalla configurazione) + + //Email al responsabile di sede per i livelli I-III che NON SONO + //responsabili di gruppo + if (configurationManager.configValue(absenceRequest.person.office, + EpasParam.ABSENCE_TOP_LEVEL_OFFICE_HEAD_NOTIFICATION, LocalDate.now()).equals(Boolean.TRUE) + && !absenceRequest.person.isGroupManager()) { + recipients = + absenceRequest.person.office.usersRolesOffices.stream() + .filter(uro -> uro.role.name.equals(Role.SEAT_SUPERVISOR)).map(uro -> uro.user.person) + .collect(Collectors.toSet()); + } + //Email al responsabile di sede per i livelli I-III che SONO + //responsabili di gruppo + if (configurationManager.configValue(absenceRequest.person.office, + EpasParam.ABSENCE_TOP_LEVEL_OF_GROUP_MANAGER_OFFICE_HEAD_NOTIFICATION, LocalDate.now()).equals(Boolean.TRUE) + && absenceRequest.person.isGroupManager()) { + recipients = + absenceRequest.person.office.usersRolesOffices.stream() + .filter(uro -> uro.role.name.equals(Role.SEAT_SUPERVISOR)).map(uro -> uro.user.person) + .collect(Collectors.toSet()); + } + //Email al responsabile di gruppo per i livelli I-III del suo gruppo (se sono attive + //notifiche al responsabile di gruppo nella configurazione del gruppo). + if (configurationManager.configValue(absenceRequest.person.office, + EpasParam.ABSENCE_TOP_LEVEL_GROUP_MANAGER_NOTIFICATION, LocalDate.now()).equals(Boolean.TRUE)) { + recipients.addAll(groupDao.myGroups(absenceRequest.person).stream() + .filter(group -> group.sendFlowsEmail) + .map(group -> group.manager) + .collect(Collectors.toSet())); + } + + if (!recipients.isEmpty()) { + SimpleEmail simpleEmail = new SimpleEmail(); + recipients.forEach(r -> { + try { + simpleEmail.addTo(r.email); + simpleEmail.setSubject( + String.format("ePas Comunicazione assenza (%s)", absenceRequest.id)); + val mailBody = createAbsenceNotificationEmail(absenceRequest, r.user); + try { + simpleEmail.setMsg(mailBody); + } catch (EmailException e) { + e.printStackTrace(); + } + Mail.send(simpleEmail); + log.info( + "Inviata email per richiesta di flusso richiesta: {}. " + + "Mail: \n\tTo: {}\n\tSubject: {}\n\tbody: {}", + absenceRequest, r.user.person.email, simpleEmail.getSubject(), mailBody); + } catch (EmailException e) { + log.error("Impossibile inviare l'email a {} che è destinatario del email " + + "per la comunicazione dell'assenza di {}", + r.getFullname(), absenceRequest.person.getFullname(), e); + } + }); + } + } /** * Metodo privato che invia la mail al richiedente la ferie/riposo compensativo. * @@ -825,10 +899,10 @@ private void sendEmailAbsenceRequestConfirmation(AbsenceRequest absenceRequest, approver = " da " + Security.getUser().get().person.getFullname(); } if (approval) { - message.append(String.format("\r\nè stata APPROVATA%s la sua richiesta di : %s", + message.append(String.format("\r\nè stata APPROVATA%s la sua %s", approver, requestType)); } else { - message.append(String.format("\r\nè stata RESPINTA%s la sua richiesta di : %s", + message.append(String.format("\r\nè stata RESPINTA%s la sua %s", approver, requestType)); } @@ -842,7 +916,7 @@ private void sendEmailAbsenceRequestConfirmation(AbsenceRequest absenceRequest, } Mail.send(simpleEmail); log.info( - "Inviata email per approvazione di flusso richiesta: {}. " + "Inviata email per approvazione di flusso {}. " + "Mail: \n\tTo: {}\n\tSubject: {}\n\tbody: {}", absenceRequest, person.email, simpleEmail.getSubject(), mailBody); @@ -891,6 +965,40 @@ private String createAbsenceRequestEmail(AbsenceRequest absenceRequest, User use return message.toString(); } + /** + * Metodo che compone il corpo della mail da inviare. + * + * @param absenceRequest la richiesta d'assenza + * @param user l'utente a cui inviare la mail + * @return il corpo della mail da inviare all'utente responsabile dell'approvazione. + */ + private String createAbsenceNotificationEmail(AbsenceRequest absenceRequest, User user) { + + String requestType = ""; + if (absenceRequest.type == AbsenceRequestType.COMPENSATORY_REST) { + requestType = Messages.get("AbsenceRequestType.COMPENSATORY_REST"); + } else if (absenceRequest.type == AbsenceRequestType.VACATION_PAST_YEAR_AFTER_DEADLINE_REQUEST) { + requestType = Messages.get("AbsenceRequestType.VACATION_PAST_YEAR_AFTER_DEADLINE_REQUEST_TOP_LEVEL"); + } else { + requestType = Messages.get("AbsenceRequestType.VACATION_REQUEST"); + } + final StringBuilder message = + new StringBuilder().append(String.format("Gentile %s,\r\n", user.person.fullName())); + message.append(String.format("\r\nLe è stata notificata da %s", + absenceRequest.person.fullName())); + message.append(String.format("\r\n una assenza di tipo: %s", requestType)); + if (absenceRequest.startAt.isEqual(absenceRequest.endTo)) { + message.append(String.format("\r\n per il giorno: %s", + absenceRequest.startAt.toLocalDate().toString(dateFormatter))); + } else { + message.append(String.format("\r\n dal: %s", + absenceRequest.startAt.toLocalDate().toString(dateFormatter))); + message.append( + String.format(" al: %s", absenceRequest.endTo.toLocalDate().toString(dateFormatter))); + } + return message.toString(); + } + ////////////////////////////////////////////////////////////////////////////////////////// // Notifiche per competence request ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/app/manager/configurations/EpasParam.java b/app/manager/configurations/EpasParam.java index 280ee6b19..530283b3e 100644 --- a/app/manager/configurations/EpasParam.java +++ b/app/manager/configurations/EpasParam.java @@ -693,11 +693,23 @@ public enum EpasParam { Lists.newArrayList(), Office.class), + /** + * Il responsabile di sede deve ricevere le notifiche delle comunicazioni di ferie deli livelli I-III. + */ + ABSENCE_TOP_LEVEL_OF_GROUP_MANAGER_OFFICE_HEAD_NOTIFICATION( + "absence_top_level_of_group_manager_office_head_notification", + EpasParamCategory.FLOWS, + EpasParamTimeType.PERIODIC, + EpasParamValueType.BOOLEAN, + EpasParamValueType.formatValue(true), + Lists.newArrayList(), + Office.class), + /** * Il responsabile di gruppo deve ricevere le notifiche delle comunicazioni di ferie deli livelli I-III. */ - ABSENCE_TOP_LEVEL_MANAGER_NOTIFICATION( - "absence_top_level_manager_notification", + ABSENCE_TOP_LEVEL_GROUP_MANAGER_NOTIFICATION( + "absence_top_level_group_manager_notification", EpasParamCategory.FLOWS, EpasParamTimeType.PERIODIC, EpasParamValueType.BOOLEAN, diff --git a/app/manager/flows/AbsenceRequestManager.java b/app/manager/flows/AbsenceRequestManager.java index 9f0115b93..470cc4c7c 100644 --- a/app/manager/flows/AbsenceRequestManager.java +++ b/app/manager/flows/AbsenceRequestManager.java @@ -22,6 +22,7 @@ import com.google.common.collect.Maps; import controllers.Security; import dao.AbsenceRequestDao; +import dao.GeneralSettingDao; import dao.GroupDao; import dao.PersonReperibilityDayDao; import dao.PersonShiftDayDao; @@ -97,7 +98,8 @@ public class AbsenceRequestManager { private GroupDao groupDao; private PersonReperibilityDayDao personReperibilityDayDao; private PersonShiftDayDao personShiftDayDao; - + private GeneralSettingDao generalSettingDao; + /** * DTO per la configurazione delle AbsenceRequest. */ @@ -127,7 +129,8 @@ public AbsenceRequestManager(ConfigurationManager configurationManager, AbsenceService absenceService, AbsenceManager absenceManager, AbsenceComponentDao absenceDao, PersonDayManager personDayManager, ConsistencyManager consistencyManager, AbsenceRequestDao absenceRequestDao, GroupDao groupDao, - PersonReperibilityDayDao personReperibilityDayDao, PersonShiftDayDao personShiftDayDao) { + PersonReperibilityDayDao personReperibilityDayDao, PersonShiftDayDao personShiftDayDao, + GeneralSettingDao generalSettingDao) { this.configurationManager = configurationManager; this.uroDao = uroDao; this.roleDao = roleDao; @@ -141,6 +144,7 @@ public AbsenceRequestManager(ConfigurationManager configurationManager, this.groupDao = groupDao; this.personReperibilityDayDao = personReperibilityDayDao; this.personShiftDayDao = personShiftDayDao; + this.generalSettingDao = generalSettingDao; } private static final String FERIE_CNR = "FERIE_CNR"; @@ -205,8 +209,14 @@ public List checkconfiguration(AbsenceRequestType requestType, Person pe public AbsenceRequestConfiguration getConfiguration(AbsenceRequestType requestType, Person person) { val absenceRequestConfiguration = new AbsenceRequestConfiguration(person, requestType); + + //Per i livelli I-III in configurazione generale può esserci scritto di + //non abilitare la possibilità di chiedere autorizzazioni, in questo caso i flussi + //dei livelli I-III non hanno mai approvazioni richieste. + val skipTopLevelAuthorization = + person.isTopQualification() && !generalSettingDao.generalSetting().enableAbsenceTopLevelAuthorization; - if (requestType.alwaysSkipAdministrativeApproval) { + if (requestType.alwaysSkipAdministrativeApproval || skipTopLevelAuthorization) { absenceRequestConfiguration.administrativeApprovalRequired = false; } else { if (person.isTopQualification() @@ -223,7 +233,8 @@ public AbsenceRequestConfiguration getConfiguration(AbsenceRequestType requestTy } } - if (requestType.alwaysSkipManagerApproval || person.isGroupManager()) { + if (requestType.alwaysSkipManagerApproval || person.isGroupManager() || + skipTopLevelAuthorization) { absenceRequestConfiguration.managerApprovalRequired = false; } else { if (person.isTopQualification() && requestType.managerApprovalRequiredTopLevel.isPresent()) { @@ -238,7 +249,7 @@ public AbsenceRequestConfiguration getConfiguration(AbsenceRequestType requestTy requestType.managerApprovalRequiredTechnicianLevel.get(), LocalDate.now()); } } - if (requestType.alwaysSkipOfficeHeadApproval) { + if (requestType.alwaysSkipOfficeHeadApproval || skipTopLevelAuthorization) { absenceRequestConfiguration.officeHeadApprovalRequired = false; } else { if (person.isTopQualification() @@ -255,7 +266,7 @@ public AbsenceRequestConfiguration getConfiguration(AbsenceRequestType requestTy } } - if (requestType.alwaysSkipOfficeHeadApprovalForManager) { + if (requestType.alwaysSkipOfficeHeadApprovalForManager || skipTopLevelAuthorization) { absenceRequestConfiguration.officeHeadApprovalForManagerRequired = false; } else { if (person.isGroupManager()) { diff --git a/app/manager/services/absences/AbsenceEngineUtility.java b/app/manager/services/absences/AbsenceEngineUtility.java index 2eaee1629..6edad6bb2 100644 --- a/app/manager/services/absences/AbsenceEngineUtility.java +++ b/app/manager/services/absences/AbsenceEngineUtility.java @@ -34,7 +34,6 @@ import models.Contract; import models.ContractWorkingTimeType; import models.Person; -import models.PersonDay; import models.absences.Absence; import models.absences.AbsenceType; import models.absences.AbsenceTypeJustifiedBehaviour; diff --git a/app/manager/services/absences/model/AbsencePeriod.java b/app/manager/services/absences/model/AbsencePeriod.java index d91674a52..89fdefb07 100644 --- a/app/manager/services/absences/model/AbsencePeriod.java +++ b/app/manager/services/absences/model/AbsencePeriod.java @@ -28,7 +28,6 @@ import java.util.Map; import java.util.Set; import java.util.SortedMap; -import javax.inject.Inject; import manager.PersonDayManager; import manager.services.absences.AbsenceEngineUtility; import manager.services.absences.errors.ErrorsBox; diff --git a/app/models/PersonalWorkingTime.java b/app/models/PersonalWorkingTime.java index 67b0d989a..d4f9f8996 100644 --- a/app/models/PersonalWorkingTime.java +++ b/app/models/PersonalWorkingTime.java @@ -17,22 +17,15 @@ package models; -import com.google.common.base.Optional; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; -import javax.persistence.Transient; import lombok.Getter; import lombok.ToString; -import manager.configurations.EpasParam.EpasParamValueType.LocalTimeInterval; import models.base.IPropertiesInPeriodOwner; import models.base.IPropertyInPeriod; import models.base.PropertyInPeriod; -import org.joda.time.LocalTime; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; -import org.testng.util.Strings; import play.data.validation.Required; /** diff --git a/app/views/AbsenceRequests/edit.html b/app/views/AbsenceRequests/edit.html index 796bf9dcb..dabb08204 100644 --- a/app/views/AbsenceRequests/edit.html +++ b/app/views/AbsenceRequests/edit.html @@ -1,13 +1,19 @@ #{extends 'main.html' /} #{set header:'navbar' /} -#{set absenceRequestTypeLabel: messages.get('AbsenceRequestType.' + absenceRequest.type.toString() + 'S') /} +#{if currentUser.person != null && currentUser.person.isTopQualification()} + #{set absenceRequestTypeLabel: messages.get('AbsenceRequestType.' + absenceRequest.type.toString() + 'S_TOP_LEVEL') /} + #{set typeLabel: messages.get('AbsenceRequestType.' + absenceRequest.type.toString() + '_TOP_LEVEL') /} +#{/if}#{else} + #{set absenceRequestTypeLabel: messages.get('AbsenceRequestType.' + absenceRequest.type.toString() + 'S') /} + #{set typeLabel: messages.get('AbsenceRequestType.' + absenceRequest.type.toString()) /} +#{/else} #{set title:('ePAS - ' + absenceRequest.isPersistent() ? 'Modifica ' : 'Inserimento ' + absenceRequest.type.label()) /} #{set breadcrumbs:[(absenceRequestTypeLabel):@AbsenceRequests.list(absenceRequest.type), ('Modifica'):null] /}
#{breadcrumbs breadcrumbs /} - #{title title:(absenceRequest.isPersistent() ? 'Modifica ' : 'Inserimento ' + absenceRequest.type.label()) /} + #{title title:(absenceRequest.isPersistent() ? 'Modifica ' : 'Inserimento ' + messages.get(typeLabel)) /}
diff --git a/app/views/AbsenceRequests/list.html b/app/views/AbsenceRequests/list.html index a1e3e9b3a..48c10206a 100644 --- a/app/views/AbsenceRequests/list.html +++ b/app/views/AbsenceRequests/list.html @@ -1,6 +1,12 @@ #{extends 'main.html' /} #{set header:'navbar' /} -#{set absenceRequestTypeLabel: messages.get('AbsenceRequestType.' + type.toString() + 'S') /} +#{if currentUser.person != null && currentUser.person.isTopQualification()} + #{set absenceRequestTypeLabel: messages.get('AbsenceRequestType.' + type.toString() + 'S_TOP_LEVEL') /} + #{set topLevelNoAuth:true /} +#{/if}#{else} + #{set absenceRequestTypeLabel: messages.get('AbsenceRequestType.' + type.toString() + 'S') /} + #{set topLevelNoAuth:false /} +#{/else} #{set title:('ePAS - ' + absenceRequestTypeLabel) /} #{set breadcrumbs:[(absenceRequestTypeLabel):null] /} @@ -34,12 +40,14 @@ #{tabContentItem id:'attivo', active:true} #{b.buttons center:true} - &{'AbsenceRequestType.' + type + '.blank'} + + #{if topLevelNoAuth}&{'AbsenceRequestType.' + type + '_TOP_LEVEL.blank'}#{/if} + #{else}&{'AbsenceRequestType.' + type + '.blank'}#{/else} #{/b.buttons} #{if myResults.isEmpty()} #{alert color:'info'} -

Al momento non ci sono flussi di richiesta assenza in esecuzione.

+

Al momento non ci sono flussi di richiesta/comunicazione assenza in esecuzione.

#{/alert} #{/if} #{else} diff --git a/app/views/_workflowsMenu.html b/app/views/_workflowsMenu.html index 1ad7f168c..2dbaddcdb 100644 --- a/app/views/_workflowsMenu.html +++ b/app/views/_workflowsMenu.html @@ -29,16 +29,16 @@ + templateUtility.illnessRequests() + templateUtility.changeReperibilityRequests()} - #{/if} + #{/if}
Flussi di lavoro -
+
*{ items }*