|
|
@ -13,14 +13,14 @@ from django.views.generic.base import TemplateView |
|
|
|
from django_filters.views import FilterView |
|
|
|
|
|
|
|
from sapl.crud.base import Crud, CrudBaseMixin, CrudListView, make_pagination |
|
|
|
from sapl.materia.models import Proposicao, TipoMateriaLegislativa |
|
|
|
from sapl.materia.models import TipoMateriaLegislativa |
|
|
|
from sapl.utils import create_barcode, get_client_ip |
|
|
|
|
|
|
|
from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, |
|
|
|
DocumentoAdministrativoFilterSet, |
|
|
|
DocumentoAdministrativoForm, ProposicaoSimpleForm, |
|
|
|
ProtocoloDocumentForm, ProtocoloFilterSet, |
|
|
|
ProtocoloMateriaForm, TramitacaoAdmForm) |
|
|
|
DocumentoAdministrativoForm, ProtocoloDocumentForm, |
|
|
|
ProtocoloFilterSet, ProtocoloMateriaForm, |
|
|
|
TramitacaoAdmForm) |
|
|
|
from .models import (Autor, DocumentoAcessorioAdministrativo, |
|
|
|
DocumentoAdministrativo, Protocolo, |
|
|
|
StatusTramitacaoAdministrativo, |
|
|
@ -306,68 +306,6 @@ class ProtocoloMateriaView(CreateView): |
|
|
|
return redirect(self.get_success_url()) |
|
|
|
|
|
|
|
|
|
|
|
# TODO: move to Proposicao app |
|
|
|
class ProposicaoReceberView(TemplateView): |
|
|
|
template_name = "protocoloadm/proposicao_receber.html" |
|
|
|
|
|
|
|
|
|
|
|
class ProposicoesNaoRecebidasView(ListView): |
|
|
|
template_name = "protocoloadm/proposicao_naorecebidas.html" |
|
|
|
model = Proposicao |
|
|
|
paginate_by = 10 |
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
|
return Proposicao.objects.filter(data_envio__isnull=False, status='E') |
|
|
|
|
|
|
|
|
|
|
|
class ProposicoesNaoIncorporadasView(ListView): |
|
|
|
template_name = "protocoloadm/proposicao_naoincorporadas.html" |
|
|
|
model = Proposicao |
|
|
|
paginate_by = 10 |
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
|
return Proposicao.objects.filter(data_envio__isnull=False, |
|
|
|
data_devolucao__isnull=False, |
|
|
|
status='D') |
|
|
|
|
|
|
|
|
|
|
|
class ProposicoesIncorporadasView(ListView): |
|
|
|
template_name = "protocoloadm/proposicao_incorporadas.html" |
|
|
|
model = Proposicao |
|
|
|
paginate_by = 10 |
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
|
return Proposicao.objects.filter(data_envio__isnull=False, |
|
|
|
data_recebimento__isnull=False, |
|
|
|
status='I') |
|
|
|
|
|
|
|
|
|
|
|
class ProposicaoView(TemplateView): |
|
|
|
template_name = "protocoloadm/proposicoes.html" |
|
|
|
|
|
|
|
|
|
|
|
class ProposicaoDetailView(DetailView): |
|
|
|
template_name = "protocoloadm/proposicao_view.html" |
|
|
|
model = Proposicao |
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs): |
|
|
|
proposicao = Proposicao.objects.get(id=kwargs['pk']) |
|
|
|
data = { # 'ano': proposicao.ano, # TODO: FIX |
|
|
|
'tipo': proposicao.tipo.descricao, # TODO: FIX |
|
|
|
'materia': proposicao.materia, |
|
|
|
'numero_proposicao': proposicao.numero_proposicao, |
|
|
|
'data_envio': proposicao.data_envio, |
|
|
|
'data_recebimento': proposicao.data_recebimento, |
|
|
|
'descricao': proposicao.descricao} |
|
|
|
form = ProposicaoSimpleForm(initial=data) |
|
|
|
return self.render_to_response({'form': form}) |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(ProposicaoView, self).get_context_data(**kwargs) |
|
|
|
context['form'] = ProposicaoSimpleForm |
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
class PesquisarDocumentoAdministrativoView(FilterView): |
|
|
|
model = DocumentoAdministrativo |
|
|
|
filterset_class = DocumentoAdministrativoFilterSet |
|
|
|