From eabbe4505f7ee38c1acf0045b8d26ce001971609 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Wed, 16 Oct 2024 15:39:46 -0300 Subject: [PATCH 01/37] =?UTF-8?q?feat:=20cria=20estrutura=20m=C3=ADnima=20?= =?UTF-8?q?do=20m=C3=B3dulo=20de=20plano=20de=20trabalho?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/OpportunityWorkplan/Module.php | 114 ++++++++++++++ .../opportunity-enable-workplan/script.js | 52 +++++++ .../opportunity-enable-workplan/template.php | 142 ++++++++++++++++++ .../parts/opportunity-workplan-config.php | 5 + .../_opportunity-enable-workplan.scss | 33 ++++ .../BaseV2/assets-src/sass/theme-BaseV2.scss | 1 + 6 files changed, 347 insertions(+) create mode 100644 src/modules/OpportunityWorkplan/Module.php create mode 100644 src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js create mode 100644 src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php create mode 100644 src/modules/OpportunityWorkplan/layouts/parts/opportunity-workplan-config.php create mode 100644 src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss diff --git a/src/modules/OpportunityWorkplan/Module.php b/src/modules/OpportunityWorkplan/Module.php new file mode 100644 index 0000000000..0dbad19319 --- /dev/null +++ b/src/modules/OpportunityWorkplan/Module.php @@ -0,0 +1,114 @@ +hook('app.init:after', function () use($app) { + $app->hook("component(opportunity-phase-config-data-collection):bottom", function(){ + $this->part('opportunity-workplan-config'); + }); + }); + } + + function register(){ + + $this->registerOpportunityMetadata('enableWorkplan', [ + 'label' => i::__('Habilitar plano de trabalho'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('dataProjectlimitMaximumDurationOfProjects', [ + 'label' => i::__('Limitar duração máxima dos projetos'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('dataProjectmaximumDurationInMonths', [ + 'label' => i::__('Duração máxima em meses'), + 'type' => 'integer' + ]); + + $this->registerOpportunityMetadata('metaInformTheStageOfCulturalMaking', [ + 'label' => i::__('Informar a etapa do fazer cultural'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('metaLimitNumberOfGoals', [ + 'label' => i::__('Limitar número de metas'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('metaMaximumNumberOfGoals', [ + 'label' => i::__('Número máximo de metas'), + 'type' => 'integer' + ]); + + $this->registerOpportunityMetadata('deliveryReportTheDeliveriesLinkedToTheGoals', [ + 'label' => i::__('Informar as entregas vinculadas à meta'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('deliveryReportTheNumberOfParticipants', [ + 'label' => i::__('Informar a quantidade de participantes'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('deliveryReportExpectedRenevue', [ + 'label' => i::__('Informar receita prevista'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringInformAccessibilityMeasures', [ + 'label' => i::__('Informar as medidas de acessibilidade'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringProvideTheProfileOfParticipants', [ + 'label' => i::__('Informar o perfil dos participantes'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringInformThePriorityAudience', [ + 'label' => i::__('Informar o público prioritário'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringInformDeliveryType', [ + 'label' => i::__('Informar tipo de entrega'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringReportExecutedRevenue', [ + 'label' => i::__('Informar receita executada'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringLimitNumberOfDeliveries', [ + 'label' => i::__('Limitar número de entregas'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('monitoringMaximumNumberOfDeliveries', [ + 'label' => i::__('Número máximo de entregas'), + 'type' => 'integer' + ]); + } +} \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js new file mode 100644 index 0000000000..dc5d694fbe --- /dev/null +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js @@ -0,0 +1,52 @@ +app.component('opportunity-enable-workplan', { + template: $TEMPLATES['opportunity-enable-workplan'], + + setup() { + const text = Utils.getTexts('opportunity-enable-workplan'); + return { text }; + }, + props: { + entity: { + type: Entity, + required: true + } + }, + data() { + return { + entity: this.entity, + timeOut: null, + } + }, + watch: { + 'entity.enableWorkplan'(_new,_old){ + if (!_new) { + this.disabledWorkPlan(); + } + }, + }, + methods: { + autoSave(){ + this.entity.save(3000); + }, + disabledWorkPlan(){ + this.entity.dataProjectlimitMaximumDurationOfProjects = false; + this.entity.dataProjectmaximumDurationInMonths = 0; + this.entity.metaInformTheStageOfCulturalMaking = false; + this.entity.metaLimitNumberOfGoals = false; + this.entity.metaMaximumNumberOfGoals = 0; + this.entity.deliveryReportTheDeliveriesLinkedToTheGoals = false; + this.entity.deliveryReportTheNumberOfParticipants = false; + this.entity.deliveryReportExpectedRenevue = false; + this.entity.monitoringInformAccessibilityMeasures = false; + this.entity.monitoringProvideTheProfileOfParticipants = false; + this.entity.monitoringInformThePriorityAudience = false; + this.entity.monitoringInformDeliveryType = false; + this.entity.monitoringReportExecutedRevenue = false; + this.entity.monitoringLimitNumberOfDeliveries = false; + this.entity.monitoringMaximumNumberOfDeliveries = 0; + } + }, + computed: { + + } +}) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php new file mode 100644 index 0000000000..da072a8597 --- /dev/null +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php @@ -0,0 +1,142 @@ + +
+

+
text('header-description', i::__('Configurar parâmetros do plano de trabalho')) ?>
+
+
+
+ +
+
+ +
+
+

+
+
+ +
+ +
+ + +
+
+
+
+

+
text('header-description', i::__('As metas são constituídas por uma ou mais entregas')) ?>
+
+
+ +
+ +
+ +
+ +
+ + +
+
+
+
+

+
text('header-description', i::__('As entregas são evidências (arquivos ou links) que comprovam a conclusão da meta.')) ?>
+
+
+ +
+
+
+
+

+
text('header-description', i::__('As informações que forem marcadas abaixo serão exigidas dos agentes no momento de inscrição na oportunidade.')) ?>
+
+
+ +
+
+ +
+
+
+
+

+
text('header-description', i::__('As informações que forem marcadas abaixo serão exigidas dos agentes no momento de monitoramento da oportunidade.')) ?>
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/layouts/parts/opportunity-workplan-config.php b/src/modules/OpportunityWorkplan/layouts/parts/opportunity-workplan-config.php new file mode 100644 index 0000000000..0dd7c2d2d3 --- /dev/null +++ b/src/modules/OpportunityWorkplan/layouts/parts/opportunity-workplan-config.php @@ -0,0 +1,5 @@ +import('opportunity-enable-workplan'); +?> + + diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss new file mode 100644 index 0000000000..eac8ccf971 --- /dev/null +++ b/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss @@ -0,0 +1,33 @@ +@use '../0.settings/mixins' as *; + +.opportunity-enable-workplan { + display: flex; + flex-direction: column; + gap: size(8); + + border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + -moz-border-radius: 4px 4px 4px 4px; + border: 1px solid #bbbbbb; + margin-top: size(16); + padding: size(20); + width: 100%; + + &__block { + border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + -moz-border-radius: 4px 4px 4px 4px; + border: 1px solid #bbbbbb; + margin-top: size(16); + padding: size(20); + width: 100%; + } + + h4 { + margin-bottom: size(5); + } + + h6 { + margin-bottom: size(16); + } +} \ No newline at end of file diff --git a/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss b/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss index eeb60499ae..a1ec37d5f4 100644 --- a/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss +++ b/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss @@ -123,6 +123,7 @@ @import '2.components/opportunity-phase-status'; @import '2.components/opportunity-phases-timeline'; @import '2.components/opportunity-ranges-config'; +@import '2.components/opportunity-enable-workplan'; @import '2.components/opportunity-registrations'; @import '2.components/opportunity-rules'; @import '2.components/opportunity-subscription-list'; From 042928085d0bcb6d1e60018d2ec6c264e36f9f49 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Fri, 25 Oct 2024 12:25:27 -0300 Subject: [PATCH 02/37] feat: refatora e atualiza escopo nome dos metadados --- src/modules/OpportunityWorkplan/Module.php | 30 ++++++++-------- .../opportunity-enable-workplan/script.js | 33 ++++++++--------- .../opportunity-enable-workplan/template.php | 36 +++++++++---------- 3 files changed, 48 insertions(+), 51 deletions(-) diff --git a/src/modules/OpportunityWorkplan/Module.php b/src/modules/OpportunityWorkplan/Module.php index 0dbad19319..68ab4b1bbe 100644 --- a/src/modules/OpportunityWorkplan/Module.php +++ b/src/modules/OpportunityWorkplan/Module.php @@ -24,89 +24,89 @@ function register(){ 'default_value' => false ]); - $this->registerOpportunityMetadata('dataProjectlimitMaximumDurationOfProjects', [ + $this->registerOpportunityMetadata('workplan_dataProjectlimitMaximumDurationOfProjects', [ 'label' => i::__('Limitar duração máxima dos projetos'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('dataProjectmaximumDurationInMonths', [ + $this->registerOpportunityMetadata('workplan_dataProjectmaximumDurationInMonths', [ 'label' => i::__('Duração máxima em meses'), 'type' => 'integer' ]); - $this->registerOpportunityMetadata('metaInformTheStageOfCulturalMaking', [ + $this->registerOpportunityMetadata('workplan_metaInformTheStageOfCulturalMaking', [ 'label' => i::__('Informar a etapa do fazer cultural'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('metaLimitNumberOfGoals', [ + $this->registerOpportunityMetadata('workplan_metaLimitNumberOfGoals', [ 'label' => i::__('Limitar número de metas'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('metaMaximumNumberOfGoals', [ + $this->registerOpportunityMetadata('workplan_metaMaximumNumberOfGoals', [ 'label' => i::__('Número máximo de metas'), 'type' => 'integer' ]); - $this->registerOpportunityMetadata('deliveryReportTheDeliveriesLinkedToTheGoals', [ + $this->registerOpportunityMetadata('workplan_deliveryReportTheDeliveriesLinkedToTheGoals', [ 'label' => i::__('Informar as entregas vinculadas à meta'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('deliveryReportTheNumberOfParticipants', [ + $this->registerOpportunityMetadata('workplan_deliveryReportTheNumberOfParticipants', [ 'label' => i::__('Informar a quantidade de participantes'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('deliveryReportExpectedRenevue', [ + $this->registerOpportunityMetadata('workplan_deliveryReportExpectedRenevue', [ 'label' => i::__('Informar receita prevista'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringInformAccessibilityMeasures', [ + $this->registerOpportunityMetadata('workplan_monitoringInformAccessibilityMeasures', [ 'label' => i::__('Informar as medidas de acessibilidade'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringProvideTheProfileOfParticipants', [ + $this->registerOpportunityMetadata('workplan_monitoringProvideTheProfileOfParticipants', [ 'label' => i::__('Informar o perfil dos participantes'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringInformThePriorityAudience', [ + $this->registerOpportunityMetadata('workplan_monitoringInformThePriorityAudience', [ 'label' => i::__('Informar o público prioritário'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringInformDeliveryType', [ + $this->registerOpportunityMetadata('workplan_monitoringInformDeliveryType', [ 'label' => i::__('Informar tipo de entrega'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringReportExecutedRevenue', [ + $this->registerOpportunityMetadata('workplan_monitoringReportExecutedRevenue', [ 'label' => i::__('Informar receita executada'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringLimitNumberOfDeliveries', [ + $this->registerOpportunityMetadata('workplan_monitoringLimitNumberOfDeliveries', [ 'label' => i::__('Limitar número de entregas'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('monitoringMaximumNumberOfDeliveries', [ + $this->registerOpportunityMetadata('workplan_monitoringMaximumNumberOfDeliveries', [ 'label' => i::__('Número máximo de entregas'), 'type' => 'integer' ]); diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js index dc5d694fbe..a67f1ed8af 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js @@ -29,24 +29,21 @@ app.component('opportunity-enable-workplan', { this.entity.save(3000); }, disabledWorkPlan(){ - this.entity.dataProjectlimitMaximumDurationOfProjects = false; - this.entity.dataProjectmaximumDurationInMonths = 0; - this.entity.metaInformTheStageOfCulturalMaking = false; - this.entity.metaLimitNumberOfGoals = false; - this.entity.metaMaximumNumberOfGoals = 0; - this.entity.deliveryReportTheDeliveriesLinkedToTheGoals = false; - this.entity.deliveryReportTheNumberOfParticipants = false; - this.entity.deliveryReportExpectedRenevue = false; - this.entity.monitoringInformAccessibilityMeasures = false; - this.entity.monitoringProvideTheProfileOfParticipants = false; - this.entity.monitoringInformThePriorityAudience = false; - this.entity.monitoringInformDeliveryType = false; - this.entity.monitoringReportExecutedRevenue = false; - this.entity.monitoringLimitNumberOfDeliveries = false; - this.entity.monitoringMaximumNumberOfDeliveries = 0; + this.entity.workplan_dataProjectlimitMaximumDurationOfProjects = false; + this.entity.workplan_dataProjectmaximumDurationInMonths = 0; + this.entity.workplan_metaInformTheStageOfCulturalMaking = false; + this.entity.workplan_metaLimitNumberOfGoals = false; + this.entity.workplan_metaMaximumNumberOfGoals = 0; + this.entity.workplan_deliveryReportTheDeliveriesLinkedToTheGoals = false; + this.entity.workplan_deliveryReportTheNumberOfParticipants = false; + this.entity.workplan_deliveryReportExpectedRenevue = false; + this.entity.workplan_monitoringInformAccessibilityMeasures = false; + this.entity.workplan_monitoringProvideTheProfileOfParticipants = false; + this.entity.workplan_monitoringInformThePriorityAudience = false; + this.entity.workplan_monitoringInformDeliveryType = false; + this.entity.workplan_monitoringReportExecutedRevenue = false; + this.entity.workplan_monitoringLimitNumberOfDeliveries = false; + this.entity.workplan_monitoringMaximumNumberOfDeliveries = 0; } }, - computed: { - - } }) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php index da072a8597..f49e69af55 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php @@ -25,15 +25,15 @@
-
+
- +
@@ -43,21 +43,21 @@
-
+
- +
@@ -67,7 +67,7 @@
@@ -78,12 +78,12 @@
@@ -94,45 +94,45 @@
-
+
- +
From 3c676924b2eb34a8e17ce72715456d665fa39c17 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Fri, 1 Nov 2024 13:54:54 -0300 Subject: [PATCH 03/37] =?UTF-8?q?feat:=20atualiza=20configura=C3=A7=C3=B5e?= =?UTF-8?q?s=20do=20plano=20de=20trabalho=20no=20gerenciamento=20da=20opor?= =?UTF-8?q?tunidade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/OpportunityWorkplan/Module.php | 207 ++++++++++++++++-- .../opportunity-enable-workplan/script.js | 33 ++- .../opportunity-enable-workplan/template.php | 78 +++++-- .../_opportunity-enable-workplan.scss | 10 + 4 files changed, 281 insertions(+), 47 deletions(-) diff --git a/src/modules/OpportunityWorkplan/Module.php b/src/modules/OpportunityWorkplan/Module.php index 68ab4b1bbe..0a37b1605b 100644 --- a/src/modules/OpportunityWorkplan/Module.php +++ b/src/modules/OpportunityWorkplan/Module.php @@ -13,83 +13,252 @@ function _init(){ $app->hook("component(opportunity-phase-config-data-collection):bottom", function(){ $this->part('opportunity-workplan-config'); }); + + $app->hook("component(registration-related-project):after", function(){ + $this->part('registration-workplan'); + }); + + $app->hook('entity(Registration).<>:after', function() use($app){ + /** @var Registration $this */ + $app->disableAccessControl(); + + // echo $this->id; + // die; + + $app->enableAccessControl(); + }); }); } - function register(){ + function register() + { + // metadados opportunity $this->registerOpportunityMetadata('enableWorkplan', [ 'label' => i::__('Habilitar plano de trabalho'), 'type' => 'boolean', 'default_value' => false ]); + $this->registerOpportunityMetadata('workplan_dataProjectlimitMaximumDurationOfProjects', [ 'label' => i::__('Limitar duração máxima dos projetos'), 'type' => 'boolean', 'default_value' => false ]); + $this->registerOpportunityMetadata('workplan_dataProjectmaximumDurationInMonths', [ 'label' => i::__('Duração máxima em meses'), 'type' => 'integer' ]); + $this->registerOpportunityMetadata('workplan_metaInformTheStageOfCulturalMaking', [ 'label' => i::__('Informar a etapa do fazer cultural'), 'type' => 'boolean', 'default_value' => false ]); + + $this->registerOpportunityMetadata('workplan_metaInformTheValueGoals', [ + 'label' => i::__('Informar o valor da meta'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('workplan_metaLimitNumberOfGoals', [ 'label' => i::__('Limitar número de metas'), 'type' => 'boolean', 'default_value' => false ]); + $this->registerOpportunityMetadata('workplan_metaMaximumNumberOfGoals', [ 'label' => i::__('Número máximo de metas'), 'type' => 'integer' ]); + $this->registerOpportunityMetadata('workplan_deliveryReportTheDeliveriesLinkedToTheGoals', [ 'label' => i::__('Informar as entregas vinculadas à meta'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('workplan_deliveryReportTheNumberOfParticipants', [ - 'label' => i::__('Informar a quantidade de participantes'), + + $this->registerOpportunityMetadata('workplan_deliveryLimitNumberOfDeliveries', [ + 'label' => i::__('Limitar número de entregas'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('workplan_deliveryReportExpectedRenevue', [ + + $this->registerOpportunityMetadata('workplan_deliveryMaximumNumberOfDeliveries', [ + 'label' => i::__('Número máximo de entregas'), + 'type' => 'integer' + ]); + + $this->registerOpportunityMetadata('workplan_monitoringInformDeliveryType', [ + 'label' => i::__('Informar tipo de entrega'), + 'type' => 'multiselect', + 'options' => [ + \MapasCulturais\i::__("Ação de comunicação"), + \MapasCulturais\i::__("Ação de formação"), + \MapasCulturais\i::__("Acervo"), + \MapasCulturais\i::__("Adereço"), + \MapasCulturais\i::__("Agente cultural"), + \MapasCulturais\i::__("Album"), + \MapasCulturais\i::__("Aplicativo"), + \MapasCulturais\i::__("Apresentação"), + \MapasCulturais\i::__("Arte Gráfica"), + \MapasCulturais\i::__("Arte Visual"), + \MapasCulturais\i::__("Artesanato"), + \MapasCulturais\i::__("Artigo"), + \MapasCulturais\i::__("Áudio"), + \MapasCulturais\i::__("Audiodescrição"), + \MapasCulturais\i::__("Audiolivro"), + \MapasCulturais\i::__("Aula"), + \MapasCulturais\i::__("Bem cultural"), + \MapasCulturais\i::__("Biblioteca"), + \MapasCulturais\i::__("Blog"), + \MapasCulturais\i::__("Bolsa"), + \MapasCulturais\i::__("Cartilha"), + \MapasCulturais\i::__("Catálogo"), + \MapasCulturais\i::__("Cenário"), + \MapasCulturais\i::__("Circulação"), + \MapasCulturais\i::__("Coleção"), + \MapasCulturais\i::__("Concurso"), + \MapasCulturais\i::__("Conferência"), + \MapasCulturais\i::__("Congresso"), + \MapasCulturais\i::__("Conteúdo cultural"), + \MapasCulturais\i::__("Coreografia"), + \MapasCulturais\i::__("Curadoria"), + \MapasCulturais\i::__("Curso"), + \MapasCulturais\i::__("Desenho"), + \MapasCulturais\i::__("Desfile"), + \MapasCulturais\i::__("Design"), + \MapasCulturais\i::__("Direito autoral"), + \MapasCulturais\i::__("Disco"), + \MapasCulturais\i::__("Distribuição"), + \MapasCulturais\i::__("E-Book"), + \MapasCulturais\i::__("Encontro"), + \MapasCulturais\i::__("Ensaio"), + \MapasCulturais\i::__("Ensaio aberto"), + \MapasCulturais\i::__("Escultura"), + \MapasCulturais\i::__("Espaço/Equipamento cultural"), + \MapasCulturais\i::__("Espetáculo"), + \MapasCulturais\i::__("Evento"), + \MapasCulturais\i::__("Exibição"), + \MapasCulturais\i::__("Exposição"), + \MapasCulturais\i::__("Expressão artístico-cultural"), + \MapasCulturais\i::__("Fanzine"), + \MapasCulturais\i::__("Feira"), + \MapasCulturais\i::__("Festa Popular"), + \MapasCulturais\i::__("Festival"), + \MapasCulturais\i::__("Figurino"), + \MapasCulturais\i::__("Filme"), + \MapasCulturais\i::__("Fotografia"), + \MapasCulturais\i::__("Game"), + \MapasCulturais\i::__("Grafitti"), + \MapasCulturais\i::__("Gravura"), + \MapasCulturais\i::__("Grupo artístico-cultural"), + \MapasCulturais\i::__("Ilustração"), + \MapasCulturais\i::__("Imóvel cultural"), + \MapasCulturais\i::__("Ingresso"), + \MapasCulturais\i::__("Intercâmbio cultural"), + \MapasCulturais\i::__("Inventário cultural"), + \MapasCulturais\i::__("Jogo"), + \MapasCulturais\i::__("Joia"), + \MapasCulturais\i::__("Jornal"), + \MapasCulturais\i::__("Livro"), + \MapasCulturais\i::__("Medida de acessibilidade"), + \MapasCulturais\i::__("Mentoria"), + \MapasCulturais\i::__("Monografia"), + \MapasCulturais\i::__("Mostra"), + \MapasCulturais\i::__("Mural"), + \MapasCulturais\i::__("Música"), + \MapasCulturais\i::__("Obra artístico-cultural"), + \MapasCulturais\i::__("Oficina"), + \MapasCulturais\i::__("Palestra"), + \MapasCulturais\i::__("Parada"), + \MapasCulturais\i::__("Patrimônio cultural"), + \MapasCulturais\i::__("Performance"), + \MapasCulturais\i::__("Periódico"), + \MapasCulturais\i::__("Pesquisa artístico-cultural"), + \MapasCulturais\i::__("Pintura"), + \MapasCulturais\i::__("Plataforma Digital"), + \MapasCulturais\i::__("Podcast"), + \MapasCulturais\i::__("Premiação"), + \MapasCulturais\i::__("Produto artesanal"), + \MapasCulturais\i::__("Produto artístico-cultural"), + \MapasCulturais\i::__("Programa de TV"), + \MapasCulturais\i::__("Programa de Rádio"), + \MapasCulturais\i::__("Projeto"), + \MapasCulturais\i::__("Quadrinho"), + \MapasCulturais\i::__("Residência artístico-cultural"), + \MapasCulturais\i::__("Revista"), + \MapasCulturais\i::__("Roda De Capoeira"), + \MapasCulturais\i::__("Roteiro"), + \MapasCulturais\i::__("Sarau"), + \MapasCulturais\i::__("Seleção"), + \MapasCulturais\i::__("Seminário"), + \MapasCulturais\i::__("Série"), + \MapasCulturais\i::__("Show"), + \MapasCulturais\i::__("Simpósio"), + \MapasCulturais\i::__("Single"), + \MapasCulturais\i::__("Site"), + \MapasCulturais\i::__("Slam"), + \MapasCulturais\i::__("Tese"), + \MapasCulturais\i::__("Texto"), + \MapasCulturais\i::__("Trilha Sonora"), + \MapasCulturais\i::__("Vestuário"), + \MapasCulturais\i::__("Vídeo"), + \MapasCulturais\i::__("Visita Guiada"), + \MapasCulturais\i::__("Websérie"), + \MapasCulturais\i::__("Workshop") + ], + ]); + + $this->registerOpportunityMetadata('workplan_registrationReportTheNumberOfParticipants', [ + 'label' => i::__('Informar a quantidade estimada de público'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('workplan_registrationReportExpectedRenevue', [ 'label' => i::__('Informar receita prevista'), 'type' => 'boolean', 'default_value' => false ]); + $this->registerOpportunityMetadata('workplan_monitoringInformActionPAAR', [ + 'label' => i::__('Informar a ação orçamentária (PAAR)'), + 'type' => 'boolean', + 'default_value' => false + ]); + $this->registerOpportunityMetadata('workplan_monitoringInformAccessibilityMeasures', [ 'label' => i::__('Informar as medidas de acessibilidade'), 'type' => 'boolean', 'default_value' => false ]); - - $this->registerOpportunityMetadata('workplan_monitoringProvideTheProfileOfParticipants', [ - 'label' => i::__('Informar o perfil dos participantes'), + + $this->registerOpportunityMetadata('workplan_monitoringInformThePriorityTerritories', [ + 'label' => i::__('Informar os territórios prioritários'), 'type' => 'boolean', 'default_value' => false ]); - - $this->registerOpportunityMetadata('workplan_monitoringInformThePriorityAudience', [ - 'label' => i::__('Informar o público prioritário'), + + $this->registerOpportunityMetadata('workplan_monitoringProvideTheProfileOfParticipants', [ + 'label' => i::__('Informar o perfil do público'), 'type' => 'boolean', 'default_value' => false ]); - $this->registerOpportunityMetadata('workplan_monitoringInformDeliveryType', [ - 'label' => i::__('Informar tipo de entrega'), + $this->registerOpportunityMetadata('workplan_monitoringInformThePriorityAudience', [ + 'label' => i::__('Informar o público prioritário'), 'type' => 'boolean', 'default_value' => false ]); @@ -100,15 +269,15 @@ function register(){ 'default_value' => false ]); - $this->registerOpportunityMetadata('workplan_monitoringLimitNumberOfDeliveries', [ - 'label' => i::__('Limitar número de entregas'), - 'type' => 'boolean', - 'default_value' => false + // metadados registrations + $this->registerRegistrationMetadata('workplan_projectDuration', [ + 'label' => i::__('Duração do projeto'), + 'type' => 'integer', ]); - $this->registerOpportunityMetadata('workplan_monitoringMaximumNumberOfDeliveries', [ - 'label' => i::__('Número máximo de entregas'), - 'type' => 'integer' + $this->registerRegistrationMetadata('workplan_goals', [ + 'label' => i::__('Metas'), + 'type' => 'json', ]); } } \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js index a67f1ed8af..0257c993ed 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js @@ -15,14 +15,30 @@ app.component('opportunity-enable-workplan', { return { entity: this.entity, timeOut: null, + workplan_monitoringInformDeliveryTypeList: Object.values($MAPAS.EntitiesDescription.opportunity.workplan_monitoringInformDeliveryType.options) } }, watch: { - 'entity.enableWorkplan'(_new,_old){ + 'entity.enableWorkplan'(_new){ if (!_new) { this.disabledWorkPlan(); } }, + 'entity.workplan_dataProjectlimitMaximumDurationOfProjects'(_new){ + if (!_new) { + this.entity.workplan_dataProjectmaximumDurationInMonths = 0; + } + }, + 'entity.workplan_metaLimitNumberOfGoals'(_new){ + if (!_new) { + this.entity.workplan_metaMaximumNumberOfGoals = 0; + } + }, + 'entity.workplan_deliveryLimitNumberOfDeliveries'(_new){ + if (!_new) { + this.entity.workplan_deliveryMaximumNumberOfDeliveries = 0; + } + }, }, methods: { autoSave(){ @@ -32,18 +48,21 @@ app.component('opportunity-enable-workplan', { this.entity.workplan_dataProjectlimitMaximumDurationOfProjects = false; this.entity.workplan_dataProjectmaximumDurationInMonths = 0; this.entity.workplan_metaInformTheStageOfCulturalMaking = false; + this.entity.workplan_metaInformTheValueGoals = false; this.entity.workplan_metaLimitNumberOfGoals = false; this.entity.workplan_metaMaximumNumberOfGoals = 0; this.entity.workplan_deliveryReportTheDeliveriesLinkedToTheGoals = false; - this.entity.workplan_deliveryReportTheNumberOfParticipants = false; - this.entity.workplan_deliveryReportExpectedRenevue = false; + this.entity.workplan_deliveryLimitNumberOfDeliveries = false; + this.entity.workplan_deliveryMaximumNumberOfDeliveries = 0; + this.entity.workplan_monitoringInformDeliveryType = []; + this.entity.workplan_registrationReportTheNumberOfParticipants = false; + this.entity.workplan_registrationReportExpectedRenevue = false; + this.entity.workplan_monitoringInformActionPAAR = false; this.entity.workplan_monitoringInformAccessibilityMeasures = false; + this.entity.workplan_monitoringInformThePriorityTerritories = false; this.entity.workplan_monitoringProvideTheProfileOfParticipants = false; this.entity.workplan_monitoringInformThePriorityAudience = false; - this.entity.workplan_monitoringInformDeliveryType = false; - this.entity.workplan_monitoringReportExecutedRevenue = false; - this.entity.workplan_monitoringLimitNumberOfDeliveries = false; - this.entity.workplan_monitoringMaximumNumberOfDeliveries = 0; + this.entity.workplan_monitoringReportExecutedRevenue = false; } }, }) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php index f49e69af55..89a40def53 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php @@ -6,6 +6,13 @@ */ use MapasCulturais\i; + + +$this->import(' + mc-tag-list + +'); + ?>

@@ -29,11 +36,11 @@
-
+
- +
@@ -47,17 +54,23 @@ +
+ +
+
-
+
- +
@@ -70,6 +83,36 @@ + +
+ +
+ +
+ + +
+ + + +
+ + + + + +
+
@@ -78,12 +121,12 @@
@@ -94,46 +137,39 @@
-
-
-
- - -
+
diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss index eac8ccf971..6fa6c256e6 100644 --- a/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss +++ b/src/themes/BaseV2/assets-src/sass/2.components/_opportunity-enable-workplan.scss @@ -30,4 +30,14 @@ h6 { margin-bottom: size(16); } + + .field-delivery-type { + border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + -moz-border-radius: 4px 4px 4px 4px; + border: 1px solid #bbbbbb; + margin-top: size(16); + padding: size(20); + width: 100%; + } } \ No newline at end of file From 8ef8364a06452811e9bee06146b673dd42ec534d Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Fri, 1 Nov 2024 13:55:53 -0300 Subject: [PATCH 04/37] =?UTF-8?q?feat:=20inicia=20cria=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20componente=20de=20cadastro=20do=20plano=20de=20trabalho=20na?= =?UTF-8?q?=20inscri=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../registration-workplan/script.js | 58 ++++++++++++ .../registration-workplan/template.php | 94 +++++++++++++++++++ .../layouts/parts/registration-workplan.php | 5 + 3 files changed, 157 insertions(+) create mode 100644 src/modules/OpportunityWorkplan/components/registration-workplan/script.js create mode 100644 src/modules/OpportunityWorkplan/components/registration-workplan/template.php create mode 100644 src/modules/OpportunityWorkplan/layouts/parts/registration-workplan.php diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js new file mode 100644 index 0000000000..91d19c8175 --- /dev/null +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js @@ -0,0 +1,58 @@ +app.component('registration-workplan', { + template: $TEMPLATES['registration-workplan'], + setup() { + const text = Utils.getTexts('registration-workplan'); + return { text }; + }, + props: { + registration: { + type: Entity, + required: true + }, + }, + data() { + if (this.registration.workplan_goals == null) { + this.registration.workplan_goals = []; + } + + return { + registration: this.registration, + duracaoProjeto: '', + workplan_goals: this.registration.workplan_goals, + meses: [ + "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", + "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro", + ], + }; + }, + methods: { + generateUUIDv4() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + const r = (Math.random() * 16) | 0; + const v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + }, + async adicionarMeta() { + this.registration.workplan_goals.push({ + id: this.generateUUIDv4(), + mesInicial: '', + mesFinal: '', + titulo: '', + descricao: '', + etapaFazerCultural: '', + acaoOrcamentaria: '', + valor: '', + }); + }, + async removerMeta(index) { + this.registration.workplan_goals.splice(index, 1); + await this.save_(); + }, + async save_() { + const registration = this.registration; + registration.workplan_goals = this.workplan_goals; + return registration.save(300, true); + } + }, +}) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php new file mode 100644 index 0000000000..cc60759aae --- /dev/null +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -0,0 +1,94 @@ +import(' + entity-field + mc-card +'); +?> + + + + + +
+ Não habilitado +
\ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/layouts/parts/registration-workplan.php b/src/modules/OpportunityWorkplan/layouts/parts/registration-workplan.php new file mode 100644 index 0000000000..1cffd4c5d9 --- /dev/null +++ b/src/modules/OpportunityWorkplan/layouts/parts/registration-workplan.php @@ -0,0 +1,5 @@ +import('registration-workplan'); +?> + + From 4e56931c06a61119734e39f78679182a2f127ea2 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 13:29:40 -0300 Subject: [PATCH 05/37] =?UTF-8?q?feat:=20define=20estrutura=20m=C3=ADnima?= =?UTF-8?q?=20das=20metas=20na=20inscri=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/OpportunityWorkplan/Module.php | 2 +- .../registration-workplan/template.php | 55 ++++++++++--------- .../2.components/_registration-workplan.scss | 30 ++++++++++ .../BaseV2/assets-src/sass/theme-BaseV2.scss | 1 + 4 files changed, 60 insertions(+), 28 deletions(-) create mode 100644 src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss diff --git a/src/modules/OpportunityWorkplan/Module.php b/src/modules/OpportunityWorkplan/Module.php index 0a37b1605b..af84c172b2 100644 --- a/src/modules/OpportunityWorkplan/Module.php +++ b/src/modules/OpportunityWorkplan/Module.php @@ -271,7 +271,7 @@ function register() // metadados registrations $this->registerRegistrationMetadata('workplan_projectDuration', [ - 'label' => i::__('Duração do projeto'), + 'label' => i::__('Duração do projeto (meses)'), 'type' => 'integer', ]); diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index cc60759aae..93ca82b8b4 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -2,32 +2,31 @@ $this->import(' entity-field mc-card + mc-icon '); ?> - + diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss new file mode 100644 index 0000000000..0e34cebe4d --- /dev/null +++ b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss @@ -0,0 +1,30 @@ +@use '../0.settings/mixins' as *; + +.registration-workplan { + &__goals { + border: 1px solid #ddd; + padding: size(12); + margin-top: size(12); + } + + &__goals-months { + display: flex; + gap: size(12); + margin-bottom: size(12); + } + + &__delete-meta { + margin-top: size(12); + display:flex; + align-items:right; + justify-content: flex-end; + } + + &__new-meta { + margin-top: size(12); + } + + .field { + margin-top: size(12); + } +} \ No newline at end of file diff --git a/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss b/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss index a1ec37d5f4..c912fdc62d 100644 --- a/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss +++ b/src/themes/BaseV2/assets-src/sass/theme-BaseV2.scss @@ -150,6 +150,7 @@ @import '2.components/registration-related-entity'; @import '2.components/registration-results'; @import '2.components/registration-status'; +@import '2.components/registration-workplan'; @import '2.components/opportunity-header'; @import '2.components/opportunity-registration-table'; @import '2.components/occurrence-card'; From f86a8f744a20421a7cacedb625a88b93d5c585a5 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 13:59:45 -0300 Subject: [PATCH 06/37] feat: adiciona novo campo de segmento cultural no plano de trabalho e aplica css de acordo com figma --- src/modules/OpportunityWorkplan/Module.php | 10 +++ .../opportunity-enable-workplan/template.php | 9 -- .../registration-workplan/template.php | 83 +++++++++---------- .../2.components/_registration-workplan.scss | 12 ++- 4 files changed, 61 insertions(+), 53 deletions(-) diff --git a/src/modules/OpportunityWorkplan/Module.php b/src/modules/OpportunityWorkplan/Module.php index af84c172b2..6983f5534a 100644 --- a/src/modules/OpportunityWorkplan/Module.php +++ b/src/modules/OpportunityWorkplan/Module.php @@ -275,6 +275,16 @@ function register() 'type' => 'integer', ]); + $this->registerRegistrationMetadata('workplan_culturalArtisticSegment', [ + 'label' => i::__('Segmento artistico cultural'), + 'type' => 'select', + 'options' => [ + \MapasCulturais\i::__("Segmento 1"), + \MapasCulturais\i::__("Segmento 2"), + ], + 'placeholder' => "Selecione", + ]); + $this->registerRegistrationMetadata('workplan_goals', [ 'label' => i::__('Metas'), 'type' => 'json', diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php index 89a40def53..7a599bdcc0 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php @@ -7,12 +7,9 @@ use MapasCulturais\i; - $this->import(' mc-tag-list - '); - ?>

@@ -97,12 +94,6 @@
- -
diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index 93ca82b8b4..ce7f2e151d 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -1,4 +1,12 @@ import(' entity-field mc-card @@ -7,89 +15,78 @@ ?> - - -
- Não habilitado -
\ No newline at end of file + \ No newline at end of file diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss index 0e34cebe4d..25d291da76 100644 --- a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss +++ b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss @@ -7,10 +7,20 @@ margin-top: size(12); } + &__goals-title { + color: #117C83; + } + + &__goals-period { + margin-top: size(12); + p { + font-weight: bold; + } + } + &__goals-months { display: flex; gap: size(12); - margin-bottom: size(12); } &__delete-meta { From 078df46bf5f278afa989c90213c3d4f518915b39 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 15:21:45 -0300 Subject: [PATCH 07/37] feat: adiciona fluxo inicial de entregas nas metas --- .../registration-workplan/script.js | 36 ++++++++++++------ .../registration-workplan/template.php | 38 +++++++++++++------ .../2.components/_registration-workplan.scss | 14 ++++++- 3 files changed, 62 insertions(+), 26 deletions(-) diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js index 91d19c8175..a282660084 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js @@ -15,6 +15,22 @@ app.component('registration-workplan', { this.registration.workplan_goals = []; } + let objectDelivery = { + id: this.generateUUIDv4(), + name: '', + }; + + let objectGoal = { + id: this.generateUUIDv4(), + mesInicial: '', + mesFinal: '', + titulo: '', + descricao: '', + etapaFazerCultural: '', + valor: '', + deliveries: [] + }; + return { registration: this.registration, duracaoProjeto: '', @@ -23,6 +39,8 @@ app.component('registration-workplan', { "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro", ], + objectGoal, + objectDelivery }; }, methods: { @@ -33,22 +51,16 @@ app.component('registration-workplan', { return v.toString(16); }); }, - async adicionarMeta() { - this.registration.workplan_goals.push({ - id: this.generateUUIDv4(), - mesInicial: '', - mesFinal: '', - titulo: '', - descricao: '', - etapaFazerCultural: '', - acaoOrcamentaria: '', - valor: '', - }); + async newGoal() { + this.registration.workplan_goals.push(this.objectGoal); }, - async removerMeta(index) { + async deleteGoal(index) { this.registration.workplan_goals.splice(index, 1); await this.save_(); }, + async newDelivery(index) { + this.registration.workplan_goals[index].deliveries.push(this.objectDelivery); + }, async save_() { const registration = this.registration; registration.workplan_goals = this.workplan_goals; diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index ce7f2e151d..c12b2f6d5e 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -23,8 +23,8 @@ -
-

[{{ meta.titulo }}]

+
+

[{{ goal.titulo }}]

{{ index + 1 }}
@@ -33,14 +33,14 @@
-
- @@ -51,19 +51,19 @@
- +
- +
- @@ -73,18 +73,32 @@
- +
-
- +
+
+
-
-
diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss index 25d291da76..66daea5ee5 100644 --- a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss +++ b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss @@ -23,14 +23,24 @@ gap: size(12); } - &__delete-meta { + &__delete-goal { margin-top: size(12); display:flex; align-items:right; justify-content: flex-end; } - &__new-meta { + &__goals__deliveries { + border: 1px solid #ddd; + padding: size(24); + margin-top: size(12); + } + + &__new-delivery { + margin-top: size(12); + } + + &__new-goal { margin-top: size(12); } From 35045b65e798179200d46f10399eae9bc2bfaebe Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 17:31:52 -0300 Subject: [PATCH 08/37] feat: adiciona gerenciamento de entregas para as metas --- .../registration-workplan/script.js | 85 +++--- .../registration-workplan/template.php | 260 ++++++++++++------ .../2.components/_registration-workplan.scss | 2 +- 3 files changed, 221 insertions(+), 126 deletions(-) diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js index a282660084..9aa8a79386 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js @@ -12,59 +12,68 @@ app.component('registration-workplan', { }, data() { if (this.registration.workplan_goals == null) { - this.registration.workplan_goals = []; + this.registration.workplan_goals = []; } - let objectDelivery = { - id: this.generateUUIDv4(), - name: '', - }; - - let objectGoal = { - id: this.generateUUIDv4(), - mesInicial: '', - mesFinal: '', - titulo: '', - descricao: '', - etapaFazerCultural: '', - valor: '', - deliveries: [] - }; - return { registration: this.registration, duracaoProjeto: '', workplan_goals: this.registration.workplan_goals, meses: [ - "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", - "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro", - ], - objectGoal, - objectDelivery - }; + "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", + "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro", + ] + }; }, methods: { generateUUIDv4() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { - const r = (Math.random() * 16) | 0; - const v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + const r = (Math.random() * 16) | 0; + const v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); }, - async newGoal() { - this.registration.workplan_goals.push(this.objectGoal); + async newGoal() { + const objectGoal = { + id: this.generateUUIDv4(), + monthInitial: '', + monthEnd: '', + title: '', + description: '', + culturalMakingStage: '', + amount: '', + deliveries: [] + }; + this.registration.workplan_goals.push(objectGoal); }, async deleteGoal(index) { - this.registration.workplan_goals.splice(index, 1); - await this.save_(); + this.registration.workplan_goals.splice(index, 1); + await this.save_(); + }, + async newDelivery(indexGoal) { + const objectDelivery = { + id: this.generateUUIDv4(), + name: '', + description: '', + type: '', + artisticCulturalSegmentOfDelivery: '', + budgetAction: '', + expectedNumberOfPeople: '', + deliveryWillGenerateRevenue: '', + renevueQtd: '', + unitValueForecast: '', + TotalValueForecast: '', + }; + this.registration.workplan_goals[indexGoal].deliveries.push(objectDelivery); }, - async newDelivery(index) { - this.registration.workplan_goals[index].deliveries.push(this.objectDelivery); + async deleteDelivery(indexGoal, indexDelivery) { + this.registration.workplan_goals[indexGoal].deliveries.splice(indexDelivery, 1); + await this.save_(); }, async save_() { - const registration = this.registration; - registration.workplan_goals = this.workplan_goals; - return registration.save(300, true); + const registration = this.registration; + registration.workplan_goals = this.workplan_goals; + return registration.save(300, true); } - }, + }, }) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index c12b2f6d5e..328ce42d5c 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -11,96 +11,182 @@ entity-field mc-card mc-icon + mc-confirm-button '); ?> - - \ No newline at end of file diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss index 66daea5ee5..3e5a72f90f 100644 --- a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss +++ b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss @@ -23,7 +23,7 @@ gap: size(12); } - &__delete-goal { + &__delete-goal, &__delete-delivery { margin-top: size(12); display:flex; align-items:right; From 9a7a146df22a0365cbd70ac9c5fabe56383f6f59 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 17:58:45 -0300 Subject: [PATCH 09/37] feat: configura fields quando moeda nas metas e entregas --- .../components/registration-workplan/template.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index 328ce42d5c..06b89e01a6 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -12,6 +12,7 @@ mc-card mc-icon mc-confirm-button + mc-currency-input '); ?> @@ -74,7 +75,7 @@
- +
@@ -139,12 +140,12 @@
- +
- +
From 9148c49f440a36f8016f30091e151ad4eb979116 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 18:15:13 -0300 Subject: [PATCH 10/37] feat: configura css das metas e entregas --- .../sass/2.components/_registration-workplan.scss | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss index 3e5a72f90f..7333e2b29e 100644 --- a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss +++ b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss @@ -2,9 +2,13 @@ .registration-workplan { &__goals { - border: 1px solid #ddd; padding: size(12); margin-top: size(12); + background-color: #f7f7f7; + border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + -moz-border-radius: 4px 4px 4px 4px; + border: 1px solid #ccc; } &__goals-title { @@ -28,12 +32,17 @@ display:flex; align-items:right; justify-content: flex-end; + } &__goals__deliveries { - border: 1px solid #ddd; + border-radius: 4px 4px 4px 4px; + -webkit-border-radius: 4px 4px 4px 4px; + -moz-border-radius: 4px 4px 4px 4px; + border: 1px solid #ccc; padding: size(24); margin-top: size(12); + background-color: #f3f3f3; } &__new-delivery { From ea6e8f4589e196e793a5512ae9fea7fde4307273 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 18:54:05 -0300 Subject: [PATCH 11/37] =?UTF-8?q?feat:=20reimplementa=20formul=C3=A1rio=20?= =?UTF-8?q?de=20configura=C3=A7=C3=A3o=20do=20plano=20de=20trabalho=20na?= =?UTF-8?q?=20oportunidade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/OpportunityWorkplan/Module.php | 26 ++- .../opportunity-enable-workplan/script.js | 6 +- .../opportunity-enable-workplan/template.php | 178 ++++++++++-------- 3 files changed, 130 insertions(+), 80 deletions(-) diff --git a/src/modules/OpportunityWorkplan/Module.php b/src/modules/OpportunityWorkplan/Module.php index 6983f5534a..26fab3f5c4 100644 --- a/src/modules/OpportunityWorkplan/Module.php +++ b/src/modules/OpportunityWorkplan/Module.php @@ -60,6 +60,12 @@ function register() 'default_value' => false ]); + $this->registerOpportunityMetadata('workplan_metaReportTheBudgetAction', [ + 'label' => i::__('Informar a ação orçamentária'), + 'type' => 'boolean', + 'default_value' => false + ]); + $this->registerOpportunityMetadata('workplan_metaInformTheValueGoals', [ 'label' => i::__('Informar o valor da meta'), @@ -226,6 +232,12 @@ function register() 'type' => 'boolean', 'default_value' => false ]); + + $this->registerOpportunityMetadata('workplan_registrationInformCulturalArtisticSegment', [ + 'label' => i::__('Informar segmento artístico cultural'), + 'type' => 'boolean', + 'default_value' => false + ]); $this->registerOpportunityMetadata('workplan_registrationReportExpectedRenevue', [ 'label' => i::__('Informar receita prevista'), @@ -233,12 +245,24 @@ function register() 'default_value' => false ]); - $this->registerOpportunityMetadata('workplan_monitoringInformActionPAAR', [ + $this->registerOpportunityMetadata('workplan_registrationInformActionPAAR', [ 'label' => i::__('Informar a ação orçamentária (PAAR)'), 'type' => 'boolean', 'default_value' => false ]); + $this->registerOpportunityMetadata('workplan_monitoringInformTheFormOfAvailability', [ + 'label' => i::__('Informar forma de disponibilização'), + 'type' => 'boolean', + 'default_value' => false + ]); + + $this->registerOpportunityMetadata('workplan_monitoringEnterDeliverySubtype', [ + 'label' => i::__('Informar subtipo de entrega'), + 'type' => 'boolean', + 'default_value' => false + ]); + $this->registerOpportunityMetadata('workplan_monitoringInformAccessibilityMeasures', [ 'label' => i::__('Informar as medidas de acessibilidade'), 'type' => 'boolean', diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js index 0257c993ed..6bf06a3eed 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js @@ -57,12 +57,16 @@ app.component('opportunity-enable-workplan', { this.entity.workplan_monitoringInformDeliveryType = []; this.entity.workplan_registrationReportTheNumberOfParticipants = false; this.entity.workplan_registrationReportExpectedRenevue = false; - this.entity.workplan_monitoringInformActionPAAR = false; + this.entity.workplan_registrationInformActionPAAR = false; this.entity.workplan_monitoringInformAccessibilityMeasures = false; this.entity.workplan_monitoringInformThePriorityTerritories = false; this.entity.workplan_monitoringProvideTheProfileOfParticipants = false; this.entity.workplan_monitoringInformThePriorityAudience = false; this.entity.workplan_monitoringReportExecutedRevenue = false; + this.entity.workplan_metaReportTheBudgetAction = false; + this.entity.workplan_registrationInformCulturalArtisticSegment = false; + this.entity.workplan_monitoringInformTheFormOfAvailability = false; + this.entity.workplan_monitoringEnterDeliverySubtype = false; } }, }) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php index 7a599bdcc0..899972099b 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/template.php @@ -18,18 +18,18 @@
- +

@@ -47,25 +47,31 @@
+
+ +
+
@@ -77,92 +83,108 @@
-
- -
+
+
+ +
-
- - -
+
+ + +
-
- - - - - +
+ + + + + +
-
-
-
-

-
text('header-description', i::__('As informações que forem marcadas abaixo serão exigidas dos agentes no momento de inscrição na oportunidade.')) ?>
-
-
- -
-
- + +
+

+
text('header-description', i::__('As informações que forem marcadas abaixo serão exigidas dos agentes no momento de inscrição na oportunidade.')) ?>
+
+
+ +
+
+ +
+
+ +
+
+ +
-
-
-

-
text('header-description', i::__('As informações que forem marcadas abaixo serão exigidas dos agentes no momento de monitoramento da oportunidade.')) ?>
-
-
- -
-
- -
-
- -
+
+

+
text('header-description', i::__('As informações que forem marcadas abaixo serão exigidas dos agentes no momento de monitoramento da oportunidade.')) ?>
+
+
+ +
+
+ +
+
+ +
+
+ +
-
- -
+
+ +
-
- -
+
+ +
-
- +
+ +
- -
+
From 47e876502755eee53338673075a49209ed9e6447 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Mon, 4 Nov 2024 19:06:03 -0300 Subject: [PATCH 12/37] =?UTF-8?q?feat:=20limpa=20campos=20quando=20entrega?= =?UTF-8?q?s=20vinculadas=20a=20meta=20s=C3=A3o=20desativadas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opportunity-enable-workplan/script.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js index 6bf06a3eed..bbf994f857 100644 --- a/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/opportunity-enable-workplan/script.js @@ -39,6 +39,11 @@ app.component('opportunity-enable-workplan', { this.entity.workplan_deliveryMaximumNumberOfDeliveries = 0; } }, + 'entity.workplan_deliveryReportTheDeliveriesLinkedToTheGoals'(_new){ + if (!_new) { + this.disabledDeliveries(); + } + }, }, methods: { autoSave(){ @@ -47,26 +52,33 @@ app.component('opportunity-enable-workplan', { disabledWorkPlan(){ this.entity.workplan_dataProjectlimitMaximumDurationOfProjects = false; this.entity.workplan_dataProjectmaximumDurationInMonths = 0; + this.entity.workplan_metaInformTheStageOfCulturalMaking = false; this.entity.workplan_metaInformTheValueGoals = false; this.entity.workplan_metaLimitNumberOfGoals = false; this.entity.workplan_metaMaximumNumberOfGoals = 0; + this.entity.workplan_metaReportTheBudgetAction = false; + this.entity.workplan_deliveryReportTheDeliveriesLinkedToTheGoals = false; + + this.disabledDeliveries(); + }, + disabledDeliveries() { this.entity.workplan_deliveryLimitNumberOfDeliveries = false; this.entity.workplan_deliveryMaximumNumberOfDeliveries = 0; - this.entity.workplan_monitoringInformDeliveryType = []; this.entity.workplan_registrationReportTheNumberOfParticipants = false; this.entity.workplan_registrationReportExpectedRenevue = false; this.entity.workplan_registrationInformActionPAAR = false; + this.entity.workplan_registrationInformCulturalArtisticSegment = false; + + this.entity.workplan_monitoringInformTheFormOfAvailability = false; + this.entity.workplan_monitoringEnterDeliverySubtype = false; + this.entity.workplan_monitoringInformDeliveryType = []; this.entity.workplan_monitoringInformAccessibilityMeasures = false; this.entity.workplan_monitoringInformThePriorityTerritories = false; this.entity.workplan_monitoringProvideTheProfileOfParticipants = false; this.entity.workplan_monitoringInformThePriorityAudience = false; - this.entity.workplan_monitoringReportExecutedRevenue = false; - this.entity.workplan_metaReportTheBudgetAction = false; - this.entity.workplan_registrationInformCulturalArtisticSegment = false; - this.entity.workplan_monitoringInformTheFormOfAvailability = false; - this.entity.workplan_monitoringEnterDeliverySubtype = false; - } + this.entity.workplan_monitoringReportExecutedRevenue = false; + }, }, }) \ No newline at end of file From a822f733cdb8d1b5906b54015c33db83029a999f Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Tue, 5 Nov 2024 11:27:19 -0300 Subject: [PATCH 13/37] feat: adiciona collapse para plano de trabalho --- .../registration-workplan/script.js | 25 +- .../registration-workplan/template.php | 249 +++++++++--------- .../2.components/_registration-workplan.scss | 9 +- 3 files changed, 152 insertions(+), 131 deletions(-) diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js index 9aa8a79386..4846ce968f 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js @@ -15,10 +15,12 @@ app.component('registration-workplan', { this.registration.workplan_goals = []; } + const workplan_goals = this.registration.workplan_goals; + return { registration: this.registration, + workplan_goals, duracaoProjeto: '', - workplan_goals: this.registration.workplan_goals, meses: [ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro", @@ -42,12 +44,14 @@ app.component('registration-workplan', { description: '', culturalMakingStage: '', amount: '', - deliveries: [] + deliveries: [], + isCollapsed: true }; - this.registration.workplan_goals.push(objectGoal); + + this.workplan_goals.push(objectGoal); }, async deleteGoal(index) { - this.registration.workplan_goals.splice(index, 1); + this.workplan_goals.splice(index, 1); await this.save_(); }, async newDelivery(indexGoal) { @@ -64,16 +68,17 @@ app.component('registration-workplan', { unitValueForecast: '', TotalValueForecast: '', }; - this.registration.workplan_goals[indexGoal].deliveries.push(objectDelivery); + this.workplan_goals[indexGoal].deliveries.push(objectDelivery); }, async deleteDelivery(indexGoal, indexDelivery) { - this.registration.workplan_goals[indexGoal].deliveries.splice(indexDelivery, 1); + this.workplan_goals[indexGoal].deliveries.splice(indexDelivery, 1); await this.save_(); }, async save_() { - const registration = this.registration; - registration.workplan_goals = this.workplan_goals; - return registration.save(300, true); - } + return this.registration.save(300, true); + }, + toggleCollapse(index) { + this.workplan_goals[index].isCollapsed = !this.workplan_goals[index].isCollapsed; + }, }, }) \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index 06b89e01a6..eea041fdf8 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -25,168 +25,177 @@ -
-

[{{ goal.title }}]

+
+
+

{{ goal.title }}

+ + + + +
{{ index + 1 }}
- -
-

-
-
- - -
-
- - + +
+ +
+

+
+
+ + +
+
+ + +
-
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- -
-

[{{ delivery.name }}]

+
- - + +
+
- +
+
- - - - + +
+
- - + +
-
- - -
+
+

[{{ delivery.name }}]

-
- - -
+
+ + +
-
- - -
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
-
-
- - +
+ +
-
- - +
+ +
-
- - +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + + +
+
+ +
+
- -
- +
+
- -
- -
-
- - - - -
diff --git a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss index 7333e2b29e..50b91ec1f0 100644 --- a/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss +++ b/src/themes/BaseV2/assets-src/sass/2.components/_registration-workplan.scss @@ -11,8 +11,15 @@ border: 1px solid #ccc; } + &__header-goals { + cursor: pointer; + display: flex; + justify-content: space-between; + color: var(--mc-primary-500); + } + &__goals-title { - color: #117C83; + color: var(--mc-primary-500); } &__goals-period { From cc3a63024828789eae898c22827bd686e9aaac66 Mon Sep 17 00:00:00 2001 From: Victor Magalhaes Date: Tue, 5 Nov 2024 19:53:35 -0300 Subject: [PATCH 14/37] feat: add estrutura minima com doctrine --- .../Controllers/Workplan.php | 25 +++++++ .../OpportunityWorkplan/Entities/Workplan.php | 55 +++++++++++++++ .../Entities/WorkplanGoals.php | 70 +++++++++++++++++++ src/modules/OpportunityWorkplan/Module.php | 49 +++++++++++-- .../registration-workplan/script.js | 9 +++ .../registration-workplan/template.php | 14 +++- .../OpportunityWorkplan/db-updates.php | 34 +++++++++ 7 files changed, 249 insertions(+), 7 deletions(-) create mode 100644 src/modules/OpportunityWorkplan/Controllers/Workplan.php create mode 100644 src/modules/OpportunityWorkplan/Entities/Workplan.php create mode 100644 src/modules/OpportunityWorkplan/Entities/WorkplanGoals.php create mode 100644 src/modules/OpportunityWorkplan/db-updates.php diff --git a/src/modules/OpportunityWorkplan/Controllers/Workplan.php b/src/modules/OpportunityWorkplan/Controllers/Workplan.php new file mode 100644 index 0000000000..6e38254240 --- /dev/null +++ b/src/modules/OpportunityWorkplan/Controllers/Workplan.php @@ -0,0 +1,25 @@ +repo(Registration::class)->find($this->data['id']); + $workplan = $app->repo(EntitiesWorkplan::class)->findOneBy(['registration' => $registration->id]); + + + + $this->json($workplan); + } + + + +} \ No newline at end of file diff --git a/src/modules/OpportunityWorkplan/Entities/Workplan.php b/src/modules/OpportunityWorkplan/Entities/Workplan.php new file mode 100644 index 0000000000..9217521f30 --- /dev/null +++ b/src/modules/OpportunityWorkplan/Entities/Workplan.php @@ -0,0 +1,55 @@ +part('registration-workplan'); }); - $app->hook('entity(Registration).<>:after', function() use($app){ + + $app->hook("PATCH(registration.single):before", function() use($app) { /** @var Registration $this */ $app->disableAccessControl(); - - // echo $this->id; - // die; + $app = App::i(); + + $registration = $app->repo(Registration::class)->find($this->data['id']); + $workplan = $app->repo(entity_name: Workplan::class)->findOneBy(['registration' => $registration->id]); + + if (!$workplan) { + $workplan = new Workplan(); + } + + if (array_key_exists('workplan_projectDuration', $this->data)) { + $workplan->projectDuration = $this->data['workplan_projectDuration']; + } + + if (array_key_exists('workplan_culturalArtisticSegment', $this->data)) { + $workplan->culturalArtisticSegment = $this->data['workplan_culturalArtisticSegment']; + } + + $workplan->registration = $registration; + $workplan->save(true); + + $goals = []; + if (array_key_exists('workplan_goals', $this->data)) { + foreach ($this->data['workplan_goals'] as $g) { + $goals = new WorkplanGoals(); + $goals->monthInitial = $g['monthInitial']; + $goals->monthEnd = $g['monthEnd']; + $goals->title = $g['title']; + $goals->description = $g['description']; + $goals->culturalMakingStage = $g['culturalMakingStage']; + $goals->amount = $g['amount']; + $goals->workplan = $workplan; + $goals->save(true); + } + } + $app->enableAccessControl(); }); }); @@ -32,6 +68,9 @@ function _init(){ function register() { + $app = App::i(); + + $app->registerController('workplan', ControllersWorkplan::class); // metadados opportunity $this->registerOpportunityMetadata('enableWorkplan', [ diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js index 4846ce968f..9553c23cb3 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/script.js +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/script.js @@ -11,13 +11,22 @@ app.component('registration-workplan', { }, }, data() { + const api = new API('workplan'); + + const response = api.GET(`${this.registration.id}`); + response.then((res) => res.json().then((data) => { + this.workplan = data; + })); + if (this.registration.workplan_goals == null) { this.registration.workplan_goals = []; } + const workplan_goals = this.registration.workplan_goals; return { + workplan: [], registration: this.registration, workplan_goals, duracaoProjeto: '', diff --git a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php index eea041fdf8..a1481639ba 100644 --- a/src/modules/OpportunityWorkplan/components/registration-workplan/template.php +++ b/src/modules/OpportunityWorkplan/components/registration-workplan/template.php @@ -21,9 +21,19 @@