Skip to content

Commit

Permalink
Merge pull request #357 from secultce/feature/accountability-adjustments
Browse files Browse the repository at this point in the history
Ajustes na Prestação de Contas
  • Loading branch information
Junior-Shyko authored Dec 30, 2024
2 parents 8e0c3f4 + 2e0acd0 commit ec19fa4
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/protected/application/lib/MapasCulturais/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -164,4 +165,4 @@ public function sendNotificationTagoGeneration()
$class->data = $notifi;
$notification->create($class, EntityDiligence::TYPE_NOTIFICATION_TADO);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ var EntityDiligence = (function(){

function hideRegistration() {
$("#registration-content-all").hide();
$("#registration-valuers--admin").hide();
$('#registration-attachments').hide();
}

function showRegistration() {
$("#registration-content-all").show();
$('#registration-attachments').show();
}

function hideCommon()
Expand All @@ -65,7 +66,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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<label class="label-diligence-status" id="label-status-actual"></label>
</h5>
</div>
<div style="margin-top: 25px;">
<div>
<div style="font-size: 14px; padding: 10px; margin-bottom: 10px;">
<label>
<b>
Expand Down Expand Up @@ -261,4 +261,4 @@
<?php
$this->applyTemplateHook("body-diligence-multi-div", "end");
$this->applyTemplateHook("body-diligence-multi", "after");
?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<span class="title-send-file">ENVIAR ARQUIVO</span><br>
<?php if ($showText) { ?>
<div id="div-upload-file-count">
<a class="js-open-editbox hltip" data-target="#answer-diligence" href="#" title="Click para anexar arquivo">Anexar arquivo</a>
<a class="js-open-editbox hltip" id="attach-dili-res-file" data-target="#answer-diligence" href="#" title="Click para anexar arquivo">Anexar arquivo</a>
<div id="answer-diligence" class="js-editbox mc-left" title="Anexar arquivo" data-submit-label="Enviar">
<form class="js-ajax-upload" id="upload-file-diligence" data-action="append" data-target=".import-diligence" data-group="answer-diligence" method="post" action="<?php echo $app->createUrl('diligence', 'upload', ['id' => $diligenceId]) ?>" enctype="multipart/form-data">
<div class="alert danger hidden"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
$function = "saveDiligence(0, 0, $('#id-input-diligence').val())";
}
?>
<textarea name="description" id="descriptionDiligence" cols="30" rows="10" onblur="<?= $function; ?>" placeholder="<?= $placeHolder; ?>" class="diligence-context-open"></textarea>
<input type="hidden" id="id-input-diligence">
<textarea name="description" id="descriptionDiligence" cols="30" rows="10" placeholder="<?= $placeHolder; ?>" class="diligence-context-open"></textarea>
<input type="hidden" id="id-input-diligence">
2 changes: 1 addition & 1 deletion src/protected/application/plugins/PDFReport
Submodule PDFReport updated 1 files
+2 −2 Controllers/Pdf.php

0 comments on commit ec19fa4

Please sign in to comment.