From a49b295d043364a4ceadef1804a86224f41653d7 Mon Sep 17 00:00:00 2001 From: Jefferson Oliveira Date: Thu, 26 Dec 2024 15:01:02 -0300 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20renderiza=C3=A7=C3=A3o=20da=20p?= =?UTF-8?q?=C3=A1gina=20ao=20clicar=20no=20bot=C3=A3o=20'abrir=20dilig?= =?UTF-8?q?=C3=AAncia'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/protected/application/lib/MapasCulturais/Utils.php | 2 +- .../lib/modules/Diligence/assets/js/diligence/diligence.js | 2 +- .../modules/Diligence/assets/js/diligence/entity-diligence.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protected/application/lib/MapasCulturais/Utils.php b/src/protected/application/lib/MapasCulturais/Utils.php index 2b3295def..67a843619 100644 --- a/src/protected/application/lib/MapasCulturais/Utils.php +++ b/src/protected/application/lib/MapasCulturais/Utils.php @@ -209,7 +209,7 @@ static function getTermsByOpportunity($text, $opportunity) 'avaliado' => 'monitorado', 'Avaliada' => 'Monitorada', 'avaliada' => 'monitorada', - 'Enviar inscrição' => 'Enviar prestação de conta' + 'Enviar inscrição' => 'Enviar prestação de contas' ]; diff --git a/src/protected/application/lib/modules/Diligence/assets/js/diligence/diligence.js b/src/protected/application/lib/modules/Diligence/assets/js/diligence/diligence.js index 8d9c4aa64..f102b2e72 100644 --- a/src/protected/application/lib/modules/Diligence/assets/js/diligence/diligence.js +++ b/src/protected/application/lib/modules/Diligence/assets/js/diligence/diligence.js @@ -104,7 +104,7 @@ function openDiligence(status) { $("#descriptionDiligence").show(); showBtnActionsDiligence(); EntityDiligence.hideBtnOpenDiligence(); - $('#btn-actions-diligence').removeClass('d-none'); + EntityDiligence.hideRegistration(); } //Editando a descrição do rascunho. diff --git a/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js b/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js index 196ef4955..feb8d6917 100644 --- a/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js +++ b/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js @@ -50,7 +50,7 @@ var EntityDiligence = (function(){ function hideRegistration() { $("#registration-content-all").hide(); - $("#registration-valuers--admin").hide(); + $('#registration-attachments').hide(); } function showRegistration() { @@ -65,7 +65,7 @@ var EntityDiligence = (function(){ var sentencaDesejada = "#/tab=diligence-diligence"; if (urlAtual.includes(sentencaDesejada)) { $("#registration-content-all").hide(); - $("#registration-valuers--admin").hide(); + $('#registration-attachments').hide(); } else { $("#diligence-diligence").hide(); From 881eadf86c6f984a1893d86118477e2a2cc703d6 Mon Sep 17 00:00:00 2001 From: Jefferson Oliveira Date: Thu, 26 Dec 2024 16:58:21 -0300 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20salvar=20resposta=20da=20dilig=C3=AA?= =?UTF-8?q?ncia=20em=20rascunho=20ao=20anexar=20arquivo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/modules/Diligence/assets/js/diligence/proponent.js | 5 +++++ .../layouts/parts/diligence/btn-actions-proponent.php | 2 +- .../Diligence/layouts/parts/diligence/description.php | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/protected/application/lib/modules/Diligence/assets/js/diligence/proponent.js b/src/protected/application/lib/modules/Diligence/assets/js/diligence/proponent.js index eb83926a4..7e6fe1eb7 100644 --- a/src/protected/application/lib/modules/Diligence/assets/js/diligence/proponent.js +++ b/src/protected/application/lib/modules/Diligence/assets/js/diligence/proponent.js @@ -147,6 +147,11 @@ $(document).ready(function () { MapasCulturais.Messages.error('Erro ao carregar diligência'); }) + $('#attach-dili-res-file').on('click', () => { + const text = $('#descriptionDiligence').val(); + + if (text.length) saveAnswerProponente(0); + }); }); function hideAnswerDraft() diff --git a/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/btn-actions-proponent.php b/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/btn-actions-proponent.php index 660f4f414..9e647b75f 100644 --- a/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/btn-actions-proponent.php +++ b/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/btn-actions-proponent.php @@ -20,7 +20,7 @@ ENVIAR ARQUIVO
- Anexar arquivo + Anexar arquivo
diff --git a/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/description.php b/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/description.php index 3a4f01843..2e475d5f3 100644 --- a/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/description.php +++ b/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/description.php @@ -6,5 +6,5 @@ $function = "saveDiligence(0, 0, $('#id-input-diligence').val())"; } ?> - - \ No newline at end of file + + From 8e1805bea691e91f9cb868496b1a10fa92317b3d Mon Sep 17 00:00:00 2001 From: Jefferson Oliveira Date: Fri, 27 Dec 2024 10:28:42 -0300 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20fluxo=20gera=C3=A7=C3=A3o=20do=20TAD?= =?UTF-8?q?O?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/lib/modules/Diligence/Controllers/Tado.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/protected/application/lib/modules/Diligence/Controllers/Tado.php b/src/protected/application/lib/modules/Diligence/Controllers/Tado.php index cabea1ea8..01f4fe91c 100644 --- a/src/protected/application/lib/modules/Diligence/Controllers/Tado.php +++ b/src/protected/application/lib/modules/Diligence/Controllers/Tado.php @@ -89,13 +89,14 @@ function POST_saveTado() $tado->object = $this->data['object']; $tado->registration = $reg; $tado->conclusion = $this->data['conclusion']; - $tado->status = self::STATUS_DRAFT; + $tado->status = $this->data['status']; $tado->agentSignature = $app->auth->getAuthenticatedUser()->profile; $tado->nameManager = $this->data['nameManager']; $tado->cpfManager = $this->data['cpfManager']; $entity = self::saveEntity($tado); if ($entity["entityId"]) { + if ($this->data['status'] == 1) self::returnRequestJson('O seu documento foi gerado!', 'TADO finalizado e realizado o download para o seu computador.', 200); self::returnRequestJson('Sucesso!', 'Rascunho criado com sucesso.', 200); } } @@ -164,4 +165,4 @@ public function sendNotificationTagoGeneration() $class->data = $notifi; $notification->create($class, EntityDiligence::TYPE_NOTIFICATION_TADO); } -} \ No newline at end of file +} From 3637352315a122413990db29856dcfbe7954af58 Mon Sep 17 00:00:00 2001 From: Jefferson Oliveira Date: Fri, 27 Dec 2024 14:55:27 -0300 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20visualiza=C3=A7=C3=A3o=20de=20presta?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20contas=20por=20fiscal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/modules/Diligence/Repositories/Diligence.php | 7 +++---- .../Diligence/assets/js/diligence/entity-diligence.js | 1 + .../layouts/parts/diligence/body-diligence-multi.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/protected/application/lib/modules/Diligence/Repositories/Diligence.php b/src/protected/application/lib/modules/Diligence/Repositories/Diligence.php index d7c41c5cf..187bf0664 100644 --- a/src/protected/application/lib/modules/Diligence/Repositories/Diligence.php +++ b/src/protected/application/lib/modules/Diligence/Repositories/Diligence.php @@ -186,11 +186,10 @@ public static function getIsAuditor($registration) $reg = $app->repo('Registration')->find($registration); $isAdmin = $reg->opportunity->canUser("@control", $app->user); - if(isset($auditorDiligence->openAgent->userId) && $auditorDiligence->openAgent->userId !== $app->user->id && !$isAdmin) { - $app->setCookie("denied-auditor", 'Esse monitoramento já está sendo acompanhado por outro Fiscal', time()+3600);; - $app->redirect($app->createUrl('oportunidade', $auditorDiligence->registration->opportunity->id)); + if ($auditorDiligence && $auditorDiligence->openAgent->userId !== $app->user->id && !$isAdmin) { + $app->setCookie("denied-auditor", 'Esse monitoramento já está sendo acompanhado por outro Fiscal', time() + 3600); + $app->redirect($app->createUrl('oportunidade', $auditorDiligence->registration->opportunity->id) . '#/tab=evaluations'); } return $auditorDiligence; } - } diff --git a/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js b/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js index feb8d6917..2f3bc6769 100644 --- a/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js +++ b/src/protected/application/lib/modules/Diligence/assets/js/diligence/entity-diligence.js @@ -55,6 +55,7 @@ var EntityDiligence = (function(){ function showRegistration() { $("#registration-content-all").show(); + $('#registration-attachments').show(); } function hideCommon() diff --git a/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/body-diligence-multi.php b/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/body-diligence-multi.php index ca9eca128..855edbe9d 100644 --- a/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/body-diligence-multi.php +++ b/src/protected/application/lib/modules/Diligence/layouts/parts/diligence/body-diligence-multi.php @@ -44,7 +44,7 @@
-
+