diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index 90d684a36..d791ab501 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -439,35 +439,6 @@ class ProtocoloMateriaForm(ModelForm): *args, **kwargs) -class ProposicaoSimpleForm(forms.Form): - - tipo = forms.CharField(label='Tipo', - widget=forms.TextInput( - attrs={'readonly': 'readonly'})) - materia = forms.CharField(label='Matéria', - widget=forms.TextInput( - attrs={'readonly': 'readonly'})) - data_envio = forms.DateField(label=_('Data Envio'), - widget=forms.DateInput( - format='%d/%m/%Y', - attrs={'readonly': 'readonly'})) - data_recebimento = forms.DateField(label=_('Data Recebimento'), - widget=forms.DateInput( - format='%d/%m/%Y', - attrs={'readonly': 'readonly'})) - - descricao = forms.CharField(label='Descrição', - widget=forms.TextInput( - attrs={'readonly': 'readonly'})) - - numero_proposicao = forms.CharField(label='Número', - widget=forms.TextInput( - attrs={'readonly': 'readonly'})) - # ano = forms.CharField(label='Ano', - # widget = forms.TextInput( - # attrs={'readonly':'readonly'})) - - class DocumentoAcessorioAdministrativoForm(ModelForm): class Meta: diff --git a/sapl/protocoloadm/urls.py b/sapl/protocoloadm/urls.py index 5f6feb538..6108b7847 100644 --- a/sapl/protocoloadm/urls.py +++ b/sapl/protocoloadm/urls.py @@ -9,11 +9,6 @@ from sapl.protocoloadm.views import (AnularProtocoloAdmView, DocumentoAcessorioAdministrativoView, DocumentoAdministrativoCrud, PesquisarDocumentoAdministrativoView, - ProposicaoDetailView, - ProposicaoReceberView, ProposicaoView, - ProposicoesIncorporadasView, - ProposicoesNaoIncorporadasView, - ProposicoesNaoRecebidasView, ProtocoloDocumentoCrud, ProtocoloDocumentoView, ProtocoloListView, ProtocoloMateriaCrud, @@ -27,8 +22,7 @@ from sapl.protocoloadm.views import (AnularProtocoloAdmView, TramitacaoAdmEditView, TramitacaoAdmIncluirView, TramitacaoAdministrativoCrud, - TramitacaoAdmView, get_nome_autor, - pesquisa_autores) + TramitacaoAdmView) from .apps import AppConfig @@ -86,26 +80,4 @@ urlpatterns = [ ComprovanteProtocoloView.as_view(), name='comprovante_protocolo'), url(r'^protocoloadm/(?P\d+)/(?P\d+)/criar_documento$', CriarDocumentoProtocolo.as_view(), name='criar_documento'), - - - # TODO: move to Proposicoes app - url(r'^proposicao$', - ProposicaoView.as_view(), name='proposicao'), - url(r'^proposicao/proposicao-receber', - ProposicaoReceberView.as_view(), name='proposicao_receber'), - url(r'^proposicao/proposicao-naorecebidas', - ProposicoesNaoRecebidasView.as_view(), - name='proposicao_naorecebidas'), - url(r'^proposicao/proposicao-naoincorporadas', - ProposicoesNaoIncorporadasView.as_view(), - name='proposicao_naoincorporadas'), - url(r'^proposicao/proposicao-incorporadas', - ProposicoesIncorporadasView.as_view(), - name='proposicao_incorporadas'), - url(r'^proposicao/(?P\d+)/proposicao', - ProposicaoDetailView.as_view(), name='proposicao_view'), - url(r'^proposicao/pesquisar_autor', - pesquisa_autores, name='pesquisar_autor'), - url(r'^proposicao/get_nome_autor', - get_nome_autor, name='get_nome_autor') ] diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 3eba8b729..9d86f0dde 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -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