|
@ -20,7 +20,6 @@ from django.views.generic.base import RedirectView |
|
|
from django.views.generic.edit import FormView |
|
|
from django.views.generic.edit import FormView |
|
|
from django_filters.views import FilterView |
|
|
from django_filters.views import FilterView |
|
|
|
|
|
|
|
|
import sapl |
|
|
|
|
|
from sapl.base.models import Autor, CasaLegislativa |
|
|
from sapl.base.models import Autor, CasaLegislativa |
|
|
from sapl.compilacao.views import IntegracaoTaView |
|
|
from sapl.compilacao.views import IntegracaoTaView |
|
|
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions |
|
|
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions |
|
@ -35,9 +34,8 @@ from sapl.materia.forms import (AnexadaForm, ConfirmarProposicaoForm, |
|
|
from sapl.norma.models import LegislacaoCitada |
|
|
from sapl.norma.models import LegislacaoCitada |
|
|
from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, |
|
|
from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, |
|
|
autor_modal, gerar_hash_arquivo, get_base_url, |
|
|
autor_modal, gerar_hash_arquivo, get_base_url, |
|
|
montar_row_autor, permission_required_for_app, |
|
|
montar_row_autor, permission_required_for_app) |
|
|
permissoes_autor, permissoes_materia, |
|
|
import sapl |
|
|
permissoes_protocoloadm) |
|
|
|
|
|
|
|
|
|
|
|
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, |
|
|
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, |
|
|
DocumentoAcessorioForm, MateriaLegislativaFilterSet, |
|
|
DocumentoAcessorioForm, MateriaLegislativaFilterSet, |
|
@ -52,6 +50,7 @@ from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial, |
|
|
TipoMateriaLegislativa, TipoProposicao, Tramitacao, |
|
|
TipoMateriaLegislativa, TipoProposicao, Tramitacao, |
|
|
UnidadeTramitacao) |
|
|
UnidadeTramitacao) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OrigemCrud = Crud.build(Origem, '') |
|
|
OrigemCrud = Crud.build(Origem, '') |
|
|
|
|
|
|
|
|
TipoMateriaCrud = CrudAux.build( |
|
|
TipoMateriaCrud = CrudAux.build( |
|
@ -185,7 +184,7 @@ class ProposicaoDevolvida(PermissionRequiredMixin, ListView): |
|
|
model = Proposicao |
|
|
model = Proposicao |
|
|
ordering = ['data_envio'] |
|
|
ordering = ['data_envio'] |
|
|
paginate_by = 10 |
|
|
paginate_by = 10 |
|
|
permission_required = permissoes_protocoloadm() |
|
|
permission_required = ('materia.list_proposicao', ) |
|
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
def get_queryset(self): |
|
|
return Proposicao.objects.filter( |
|
|
return Proposicao.objects.filter( |
|
@ -209,7 +208,7 @@ class ProposicaoPendente(PermissionRequiredMixin, ListView): |
|
|
model = Proposicao |
|
|
model = Proposicao |
|
|
ordering = ['data_envio', 'autor', 'tipo', 'descricao'] |
|
|
ordering = ['data_envio', 'autor', 'tipo', 'descricao'] |
|
|
paginate_by = 10 |
|
|
paginate_by = 10 |
|
|
permission_required = permissoes_protocoloadm() |
|
|
permission_required = ('materia.list_proposicao', ) |
|
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
def get_queryset(self): |
|
|
return Proposicao.objects.filter( |
|
|
return Proposicao.objects.filter( |
|
@ -234,7 +233,7 @@ class ProposicaoRecebida(PermissionRequiredMixin, ListView): |
|
|
model = Proposicao |
|
|
model = Proposicao |
|
|
ordering = ['data_envio'] |
|
|
ordering = ['data_envio'] |
|
|
paginate_by = 10 |
|
|
paginate_by = 10 |
|
|
permission_required = permissoes_protocoloadm() |
|
|
permission_required = ('materia.list_proposicao', ) |
|
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
def get_queryset(self): |
|
|
return Proposicao.objects.filter( |
|
|
return Proposicao.objects.filter( |
|
@ -557,7 +556,7 @@ class ProposicaoCrud(Crud): |
|
|
|
|
|
|
|
|
class ReciboProposicaoView(TemplateView): |
|
|
class ReciboProposicaoView(TemplateView): |
|
|
template_name = "materia/recibo_proposicao.html" |
|
|
template_name = "materia/recibo_proposicao.html" |
|
|
permission_required = permissoes_autor() |
|
|
permission_required = ('materia.detail_proposicao', ) |
|
|
|
|
|
|
|
|
def has_permission(self): |
|
|
def has_permission(self): |
|
|
perms = self.get_permission_required() |
|
|
perms = self.get_permission_required() |
|
@ -909,7 +908,7 @@ class MateriaLegislativaCrud(Crud): |
|
|
class DocumentoAcessorioView(PermissionRequiredMixin, CreateView): |
|
|
class DocumentoAcessorioView(PermissionRequiredMixin, CreateView): |
|
|
template_name = "materia/documento_acessorio.html" |
|
|
template_name = "materia/documento_acessorio.html" |
|
|
form_class = DocumentoAcessorioForm |
|
|
form_class = DocumentoAcessorioForm |
|
|
permission_required = permissoes_materia() |
|
|
permission_required = ('materia.add_documentoacessorio', ) |
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs): |
|
|
def get(self, request, *args, **kwargs): |
|
|
materia = MateriaLegislativa.objects.get(id=kwargs['pk']) |
|
|
materia = MateriaLegislativa.objects.get(id=kwargs['pk']) |
|
@ -943,8 +942,7 @@ class DocumentoAcessorioView(PermissionRequiredMixin, CreateView): |
|
|
return reverse('sapl.materia:documento_acessorio', kwargs={'pk': pk}) |
|
|
return reverse('sapl.materia:documento_acessorio', kwargs={'pk': pk}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AcompanhamentoConfirmarView(PermissionRequiredMixin, TemplateView): |
|
|
class AcompanhamentoConfirmarView(TemplateView): |
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
def get_redirect_url(self): |
|
|
def get_redirect_url(self): |
|
|
return reverse('sapl.sessao:list_pauta_sessao') |
|
|
return reverse('sapl.sessao:list_pauta_sessao') |
|
@ -961,8 +959,7 @@ class AcompanhamentoConfirmarView(PermissionRequiredMixin, TemplateView): |
|
|
return HttpResponseRedirect(self.get_redirect_url()) |
|
|
return HttpResponseRedirect(self.get_redirect_url()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AcompanhamentoExcluirView(PermissionRequiredMixin, TemplateView): |
|
|
class AcompanhamentoExcluirView(TemplateView): |
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
def get_redirect_url(self): |
|
|
def get_redirect_url(self): |
|
|
return reverse('sapl.sessao:list_pauta_sessao') |
|
|
return reverse('sapl.sessao:list_pauta_sessao') |
|
@ -1038,9 +1035,8 @@ class MateriaLegislativaPesquisaView(FilterView): |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AcompanhamentoMateriaView(PermissionRequiredMixin, CreateView): |
|
|
class AcompanhamentoMateriaView(CreateView): |
|
|
template_name = "materia/acompanhamento_materia.html" |
|
|
template_name = "materia/acompanhamento_materia.html" |
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
def get_random_chars(self): |
|
|
def get_random_chars(self): |
|
|
s = ascii_letters + digits |
|
|
s = ascii_letters + digits |
|
@ -1296,7 +1292,7 @@ def do_envia_email_tramitacao(request, materia): |
|
|
class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): |
|
|
class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): |
|
|
filterset_class = AcessorioEmLoteFilterSet |
|
|
filterset_class = AcessorioEmLoteFilterSet |
|
|
template_name = 'materia/em_lote/acessorio.html' |
|
|
template_name = 'materia/em_lote/acessorio.html' |
|
|
permission_required = permissoes_materia() |
|
|
permission_required = ('materia.add_documentoacessorio',) |
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super(DocumentoAcessorioEmLoteView, |
|
|
context = super(DocumentoAcessorioEmLoteView, |
|
@ -1340,7 +1336,7 @@ class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): |
|
|
class PrimeiraTramitacaoEmLoteView(PermissionRequiredMixin, FilterView): |
|
|
class PrimeiraTramitacaoEmLoteView(PermissionRequiredMixin, FilterView): |
|
|
filterset_class = PrimeiraTramitacaoEmLoteFilterSet |
|
|
filterset_class = PrimeiraTramitacaoEmLoteFilterSet |
|
|
template_name = 'materia/em_lote/tramitacao.html' |
|
|
template_name = 'materia/em_lote/tramitacao.html' |
|
|
permission_required = permissoes_materia() |
|
|
permission_required = ('materia.add_tramitacao', ) |
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super(PrimeiraTramitacaoEmLoteView, |
|
|
context = super(PrimeiraTramitacaoEmLoteView, |
|
|