From 6e0c6ada02812c23a4fadc2da0e0b5748f3503c4 Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Mon, 18 Mar 2019 07:58:30 -0300 Subject: [PATCH 01/39] Fix #2617 (#2618) --- sapl/materia/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 66bcb1beb..b08368db8 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -2021,6 +2021,11 @@ class DocumentoAcessorioEmLoteView(PermissionRequiredMixin, FilterView): tz = timezone.get_current_timezone() + if len(request.POST['autor']) > 50: + msg = _('Autor tem que ter menos do que 50 caracteres.') + messages.add_message(request, messages.ERROR, msg) + return self.get(request, self.kwargs) + for materia_id in marcadas: doc = DocumentoAcessorio() doc.materia_id = materia_id From 9c88018dd56f4387f3e20692d0d2f684995abcd9 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 18 Mar 2019 11:34:06 -0300 Subject: [PATCH 02/39] HOT-FIX: verifica destinatarios emails --- sapl/base/email_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sapl/base/email_utils.py b/sapl/base/email_utils.py index b41c68402..b8f3a07a7 100644 --- a/sapl/base/email_utils.py +++ b/sapl/base/email_utils.py @@ -208,8 +208,8 @@ def do_envia_email_tramitacao(base_url, tipo, doc_mat, status, unidade_destino): # Envia email de tramitacao para usuarios cadastrados # + logger = logging.getLogger(__name__) if not mail_service_configured(): - logger = logging.getLogger(__name__) logger.warning(_('Servidor de email não configurado.')) return @@ -220,6 +220,10 @@ def do_envia_email_tramitacao(base_url, tipo, doc_mat, status, unidade_destino): destinatarios = AcompanhamentoDocumento.objects.filter(documento=doc_mat, confirmado=True) + if not destinatarios: + logger.debug(_('Não existem destinatários cadastrados para essa matéria.')) + return + casa = CasaLegislativa.objects.first() sender = EMAIL_SEND_USER From 32891fcd7c7deca9c537760138c6bbd85757d15a Mon Sep 17 00:00:00 2001 From: Cesar Augusto de Carvalho Date: Mon, 18 Mar 2019 12:24:05 -0300 Subject: [PATCH 03/39] =?UTF-8?q?HOT-FIX:=20Fix=20bot=C3=B5es=20de=20Marca?= =?UTF-8?q?r/Desmarcar=20todos=20(#2620)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HOTFIX - Fix botões de check all * HOTFIX - Fix botões de check all --- sapl/templates/materia/em_lote/acessorio.html | 15 ++++---- sapl/templates/materia/em_lote/anexada.html | 15 ++++---- .../templates/materia/em_lote/tramitacao.html | 15 ++++---- .../votacao/votacao_bloco_expediente.html | 37 +++++-------------- .../sessao/votacao/votacao_bloco_ordem.html | 37 +++++-------------- 5 files changed, 42 insertions(+), 77 deletions(-) diff --git a/sapl/templates/materia/em_lote/acessorio.html b/sapl/templates/materia/em_lote/acessorio.html index f767ba167..89fc2fff8 100644 --- a/sapl/templates/materia/em_lote/acessorio.html +++ b/sapl/templates/materia/em_lote/acessorio.html @@ -79,7 +79,7 @@
@@ -109,11 +109,12 @@ {% endblock detail_content %} {% block extra_js %} {% endblock %} diff --git a/sapl/templates/materia/em_lote/anexada.html b/sapl/templates/materia/em_lote/anexada.html index 81a930cc1..76a154ec6 100644 --- a/sapl/templates/materia/em_lote/anexada.html +++ b/sapl/templates/materia/em_lote/anexada.html @@ -45,7 +45,7 @@
@@ -73,11 +73,12 @@ {% endblock detail_content %} {% block extra_js %} {% endblock %} diff --git a/sapl/templates/materia/em_lote/tramitacao.html b/sapl/templates/materia/em_lote/tramitacao.html index acecac050..94cecf52f 100644 --- a/sapl/templates/materia/em_lote/tramitacao.html +++ b/sapl/templates/materia/em_lote/tramitacao.html @@ -96,7 +96,7 @@
@@ -127,12 +127,13 @@ {% endblock detail_content %} {% block extra_js %} +{% endblock %} \ No newline at end of file diff --git a/sapl/templates/sessao/blocos_ata/assinaturas.html b/sapl/templates/sessao/blocos_ata/assinaturas.html index 1282af63b..990b3f8a8 100644 --- a/sapl/templates/sessao/blocos_ata/assinaturas.html +++ b/sapl/templates/sessao/blocos_ata/assinaturas.html @@ -11,8 +11,8 @@ {% endfor %} {% for p in assinatura_presentes %}
___________________________________________
- {{p.nome_completo}} / {{ p|filiacao_data_filter:object.data_inicio }} -


+ {{p.parlamentar.nome_completo}} / {{ p.parlamentar|filiacao_data_filter:object.data_inicio }} +


{% endfor %} From ca0006637df0aabb9f7cb7a740b0714a8c8a9f09 Mon Sep 17 00:00:00 2001 From: Cesar Carvalho Date: Wed, 20 Mar 2019 10:23:32 -0300 Subject: [PATCH 12/39] Release: 3.1.148 --- docker-compose.yml | 2 +- sapl/settings.py | 2 +- sapl/templates/base.html | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e4cd84b21..e1680ee16 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ sapldb: ports: - "5432:5432" sapl: - image: interlegis/sapl:3.1.147 + image: interlegis/sapl:3.1.148 restart: always environment: ADMIN_PASSWORD: interlegis diff --git a/sapl/settings.py b/sapl/settings.py index a91cfd61d..dc2db1d6e 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -41,7 +41,7 @@ ALLOWED_HOSTS = ['*'] LOGIN_REDIRECT_URL = '/' LOGIN_URL = '/login/?next=' -SAPL_VERSION = '3.1.147' +SAPL_VERSION = '3.1.148' if DEBUG: EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' diff --git a/sapl/templates/base.html b/sapl/templates/base.html index 04502939f..454d63ca2 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -179,7 +179,7 @@ Desenvolvido pelo Interlegis em software livre e aberto. - Release: 3.1.147 + Release: 3.1.148

diff --git a/setup.py b/setup.py index 253ae0411..91f75da8e 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ install_requires = [ ] setup( name='interlegis-sapl', - version='3.1.147', + version='3.1.148', packages=find_packages(), include_package_data=True, license='GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007', From 6465aa53f564c501025214f67356f5343126c2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Cantu=C3=A1ria?= Date: Wed, 20 Mar 2019 10:45:20 -0300 Subject: [PATCH 13/39] =?UTF-8?q?Corrige=20valor=20na=20vari=C3=A1vel=20ti?= =?UTF-8?q?mestamp=20(#2637)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: edwardoliveira --- sapl/lexml/OAIServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/lexml/OAIServer.py b/sapl/lexml/OAIServer.py index 643d17f9e..4c1d85c19 100644 --- a/sapl/lexml/OAIServer.py +++ b/sapl/lexml/OAIServer.py @@ -89,7 +89,7 @@ class OAIServer: def create_header(self, record): oai_id = self.get_oai_id(record['record']['id']) - timestamp = record['record']['when_modified'] + timestamp = record['record']['when_modified'] if record['record']['when_modified'] else datetime.now() timestamp = timestamp.replace(tzinfo=None) sets = [] deleted = record['record']['deleted'] From e6bfe3dd7c2573b15ec16c94e62520f2a61750c2 Mon Sep 17 00:00:00 2001 From: Ulysses Lara Date: Wed, 20 Mar 2019 10:50:11 -0300 Subject: [PATCH 14/39] Fix #2628 (#2638) --- .../sessao/blocos_ata/materias_ordem_dia.html | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/sapl/templates/sessao/blocos_ata/materias_ordem_dia.html b/sapl/templates/sessao/blocos_ata/materias_ordem_dia.html index 9aa620a04..40c4e718a 100644 --- a/sapl/templates/sessao/blocos_ata/materias_ordem_dia.html +++ b/sapl/templates/sessao/blocos_ata/materias_ordem_dia.html @@ -3,32 +3,28 @@ Matérias da Ordem do Dia:

{% for m in materias_ordem %} -
- {{m.numero}} - {{m.titulo}}
- Turno:{{m.turno}}
- Autor: {{ m.autor|length|pluralize:"es" }}: {{ m.autor|join:', ' }} +

+ Materia do Expediente: {{m.numero}} - {{m.titulo}} + Descrição: {{m.ementa|safe}} + Autor: {{ m.autor|length|pluralize:"es" }}: {{ m.autor|join:', ' }} {% if m.numero_protocolo %} - Número de Protocolo: {{ m.numero_protocolo }} + Número de Protocolo: {{ m.numero_protocolo }} {% endif %} {% if m.numero_processo %} - Processo: {{ m.numero_processo }} + Processo:{{ m.numero_processo }} {% endif %} -

Descrição: {{m.ementa|safe}}

- Resultado: {{m.resultado}} {{m.resultado_observacao}} -
-

Tipo: {{m.tipo_votacao}}

-
Sim:{{m.voto_sim}}
-
Não:{{m.voto_nao}} -
Abstenções:{{m.voto_abstencoes}}
-
- {% if m.voto_nominal%} - Votos Nominais -
    - {% for voto in m.voto_nominal %} -
  • {{voto.0}} - {{voto.1}}
  • - {% endfor %} -
- {% endif %} -
+ Turno: {{m.turno}} + Tipo: {{m.tipo_votacao}} + Sim:{{m.voto_sim}} + Não:{{m.voto_nao}} + Abstenções:{{m.voto_abstencoes}} + Resultado: {{m.resultado}} {{m.resultado_observacao}} + {% if m.voto_nominal%} + Votos Nominais : + {% for voto in m.voto_nominal %} + / {{voto.0}} - {{voto.1}} + {% endfor %}; + {% endif %} +

{% endfor %} \ No newline at end of file From 5ad3f1184f553292e829fb64111f2d22d4c9a5a6 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 20 Mar 2019 12:50:58 -0300 Subject: [PATCH 15/39] =?UTF-8?q?Modifica=20campo=20Solr=20de=20atualiza?= =?UTF-8?q?=C3=A7=C3=A3o=20autom=C3=A1tica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solr/sapl_configset/conf/saplconfigset.zip | Bin 30312 -> 30333 bytes solr/sapl_configset/conf/schema.xml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/sapl_configset/conf/saplconfigset.zip b/solr/sapl_configset/conf/saplconfigset.zip index fa631436a00e9af8f4af72381b4fbc797878bbbe..bdbe33d75e7fb43297b3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@}>@_b&mQUak{P zm&he$RVbCfNK{xK)$cv6stb3EYmv5Onyc2<67}=v?-a=B^p--qT6Q+&{w)?OV<{5h zsu`p`z1gy{rIo{K>ExP>&}!n3v#v3GLk%=@9Zjp*GbUFD004-SH+3YFRCX1UaCImF bnUk4yQvq0$?R8QCW0OF3HwF-M00000<(t}` diff --git a/solr/sapl_configset/conf/schema.xml b/solr/sapl_configset/conf/schema.xml index e230533e5..7bf3fc428 100644 --- a/solr/sapl_configset/conf/schema.xml +++ b/solr/sapl_configset/conf/schema.xml @@ -151,7 +151,7 @@ - + From bf93a52e154c309d99606c38fbb455c6d81f63d8 Mon Sep 17 00:00:00 2001 From: Ulysses Lara Date: Wed, 20 Mar 2019 13:33:40 -0300 Subject: [PATCH 16/39] Fix #2639 (#2641) --- sapl/templates/relatorios/relatorio_ata.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sapl/templates/relatorios/relatorio_ata.html b/sapl/templates/relatorios/relatorio_ata.html index 581343677..df927ba7f 100644 --- a/sapl/templates/relatorios/relatorio_ata.html +++ b/sapl/templates/relatorios/relatorio_ata.html @@ -50,7 +50,7 @@ {% if assinatura_mesa or assinatura_presentes %} -
+
{{texto_assinatura}} @@ -60,14 +60,14 @@ {% for p in assinatura_mesa %} {% if forloop.counter0|divisibleby:2 %} - + + From ef62ebf35087abb6f470298a2b6dc5741df7ede8 Mon Sep 17 00:00:00 2001 From: Ulysses Lara Date: Wed, 20 Mar 2019 13:34:42 -0300 Subject: [PATCH 17/39] Adiciona contagem de materias legislativas, sessoes, parlamentares e normas juridicas (#2640) --- sapl/base/urls.py | 4 ++-- sapl/base/views.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sapl/base/urls.py b/sapl/base/urls.py index 317862f18..5d12b3586 100644 --- a/sapl/base/urls.py +++ b/sapl/base/urls.py @@ -8,7 +8,7 @@ from django.contrib.auth.views import (password_reset, password_reset_complete, password_reset_done) from django.views.generic.base import RedirectView, TemplateView -from sapl.base.views import AutorCrud, ConfirmarEmailView, TipoAutorCrud, get_data_ultima_atualizacao +from sapl.base.views import AutorCrud, ConfirmarEmailView, TipoAutorCrud, get_estatistica from sapl.settings import EMAIL_SEND_USER, MEDIA_URL from .apps import AppConfig @@ -176,7 +176,7 @@ urlpatterns = [ ListarLegislaturaInfindavelView.as_view(), name='lista_legislatura_infindavel'), - url(r'^sistema/data_ultima_atualizacao', get_data_ultima_atualizacao), + url(r'^sistema/estatisticas', get_estatistica), # todos os sublinks de sistema devem vir acima deste url(r'^sistema/$', permission_required('base.view_tabelas_auxiliares') diff --git a/sapl/base/views.py b/sapl/base/views.py index 1afd1fee0..ee4c77fe0 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -1234,7 +1234,9 @@ def mandato_sem_data_inicio(): return Mandato.objects.filter(data_inicio_mandato__isnull=True).order_by('parlamentar') -def get_data_ultima_atualizacao(request): +def get_estatistica(request): + + json_dict = {} datas = [MateriaLegislativa.objects.all(). order_by('-data_ultima_atualizacao'). @@ -1251,7 +1253,14 @@ def get_data_ultima_atualizacao(request): max_data = max(datas) else: max_data = next(iter([i for i in datas if i is not None]), '') - return JsonResponse({'data_ultima_atualizacao': max_data}) + + json_dict["data_ultima_atualizacao"] = max_data + json_dict["num_materias_legislativas"] = MateriaLegislativa.objects.all().count() + json_dict["num_normas_juridicas "] = NormaJuridica.objects.all().count() + json_dict["num_parlamentares"] = Parlamentar.objects.all().count() + json_dict["num_sessoes_plenarias"] = SessaoPlenaria.objects.all().count() + + return JsonResponse(json_dict) class ListarMandatoSemDataInicioView(PermissionRequiredMixin, ListView): From b617f05c2566058a69428b2801a987eaf4e369dc Mon Sep 17 00:00:00 2001 From: Cesar Carvalho Date: Wed, 20 Mar 2019 13:59:17 -0300 Subject: [PATCH 18/39] HOTFIX - Corrige layout dos cronometros do painel --- sapl/templates/sessao/painel.html | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sapl/templates/sessao/painel.html b/sapl/templates/sessao/painel.html index 1efb65854..9e1ed742b 100644 --- a/sapl/templates/sessao/painel.html +++ b/sapl/templates/sessao/painel.html @@ -26,11 +26,11 @@


-

Cronômetro do Discurso

+

Cronômetro do Discurso

-
+

@@ -41,11 +41,11 @@

-

Cronômetro do Aparte

+

Cronômetro do Aparte

-
+

@@ -56,11 +56,11 @@

-

Cronômetro da Questão de Ordem

+

Cronômetro da Questão de Ordem

-
+

@@ -68,25 +68,28 @@
-
-
-
-

Cronômetro de Considerações Finais

+ +
+
+ +
+

Cronômetro de Considerações Finais

-
+
-
+


-
+ +
-
+
{% endblock detail_content %} From 1dd9f553dbac0a40e058c6b67ae18d7b5c1efbcf Mon Sep 17 00:00:00 2001 From: Leandro Roberto Silva Date: Thu, 21 Mar 2019 13:26:50 -0300 Subject: [PATCH 19/39] Fix #2559 reordenacao materia em sessao (#2646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add sequencial_regimental no model tipo de matéria legislativa * applica pep * converte TipoMateriaCrud para classe * inclui hooks no crud list * altera ordering de TipoMateriaLegislativa * define layout diferente para detail e list * define estratégia para iniciar sequencia em tipos já existentes * add template custom para listagem de tipo de matérias * altera call hook * impl a reordenação no list dos tipos de matéria * add file migrate * autopep in sessao/views.py * ref views functions acionadas pelo botão 'Ajustar Ordenação' --- sapl/api/views.py | 20 ++- sapl/crud/base.py | 12 +- ...materialegislativa_sequencia_regimental.py | 21 +++ .../migrations/0043_auto_20190320_1749.py | 19 +++ sapl/materia/models.py | 41 +++++- sapl/materia/views.py | 93 +++++++++--- sapl/sessao/views.py | 139 ++++++++++-------- sapl/templates/materia/layouts.yaml | 6 +- .../materia/tipomaterialegislativa_list.html | 55 +++++++ 9 files changed, 322 insertions(+), 84 deletions(-) create mode 100644 sapl/materia/migrations/0042_tipomaterialegislativa_sequencia_regimental.py create mode 100644 sapl/materia/migrations/0043_auto_20190320_1749.py create mode 100644 sapl/templates/materia/tipomaterialegislativa_list.html diff --git a/sapl/api/views.py b/sapl/api/views.py index 769196c76..f2f146e24 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -22,7 +22,7 @@ from sapl.api.forms import SaplFilterSetMixin from sapl.api.permissions import SaplModelPermissions from sapl.api.serializers import ChoiceSerializer from sapl.base.models import Autor, AppConfig, DOC_ADM_OSTENSIVO -from sapl.materia.models import Proposicao +from sapl.materia.models import Proposicao, TipoMateriaLegislativa from sapl.parlamentares.models import Parlamentar from sapl.utils import models_with_gr_for_model, choice_anos_com_sessaoplenaria @@ -349,6 +349,23 @@ class _ProposicaoViewSet(SaplSetViews['materia']['proposicao']): return qs +class _TipoMateriaLegislativaViewSet(SaplSetViews['materia']['tipomaterialegislativa']): + + @action(detail=True, methods=['POST']) + def change_position(self, request, *args, **kwargs): + result = { + 'status': 200, + 'message': 'OK' + } + d = request.data + if 'pos_ini' in d and 'pos_fim' in d: + if d['pos_ini'] != d['pos_fim']: + pk = kwargs['pk'] + TipoMateriaLegislativa.objects.reposicione(pk, d['pos_fim']) + + return Response(result) + + class _DocumentoAdministrativoViewSet(SaplSetViews['protocoloadm']['documentoadministrativo']): class DocumentoAdministrativoPermission(SaplModelPermissions): @@ -427,6 +444,7 @@ class _SessaoPlenariaViewSet( SaplSetViews['base']['autor'] = _AutorViewSet.build_class_with_actions() SaplSetViews['materia']['proposicao'] = _ProposicaoViewSet +SaplSetViews['materia']['tipomaterialegislativa'] = _TipoMateriaLegislativaViewSet SaplSetViews['parlamentares']['parlamentar'] = _ParlamentarViewSet diff --git a/sapl/crud/base.py b/sapl/crud/base.py index 5fa4f70e5..0dc11ea5c 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -2,7 +2,6 @@ import logging from braces.views import FormMessagesMixin from crispy_forms.bootstrap import FieldWithButtons, StrictButton -from sapl.crispy_layout_mixin import SaplFormHelper from crispy_forms.layout import Field, Layout from django import forms from django.conf.urls import url @@ -25,6 +24,7 @@ from django.views.generic.base import ContextMixin from django.views.generic.list import MultipleObjectMixin from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display +from sapl.crispy_layout_mixin import SaplFormHelper from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL, RP_LIST) from sapl.settings import BASE_DIR @@ -449,18 +449,28 @@ class CrudListView(PermissionRequiredContainerCrudMixin, ListView): if not n: s += '
' continue + m = obj n = n.split('__') for f in n[:-1]: m = getattr(m, f) if not m: break + + ss = '' if m: ss = get_field_display(m, n[-1])[1] ss = ( ('
' if '
-
____________________
+
____________________

{{p.cargo}}: {{p.parlamentar.nome_completo}} / {{ p.parlamentar|filiacao_data_filter:object.data_inicio }}




{% else %} -
____________________
+
____________________

{{p.cargo}}: {{p.parlamentar.nome_completo}} / {{ p.parlamentar|filiacao_data_filter:object.data_inicio }}




@@ -78,15 +78,15 @@ {% for p in assinatura_presentes %} {% if forloop.counter0|divisibleby:2 %} -
-
_____________________
-

{{p.nome_completo}} / {{ p|filiacao_data_filter:object.data_inicio }}

-


+
_____________________
+

{{p.cargo}}: {{p.parlamentar.nome_completo}} / {{ p.parlamentar|filiacao_data_filter:object.data_inicio }}

+


{% else %} -
_____________________
-

{{p.nome_completo}} / {{ p|filiacao_data_filter:object.data_inicio }}

+
_____________________
+

{{p.parlamentar.nome_completo}} / {{ p.parlamentar|filiacao_data_filter:object.data_inicio }}




@@ -71,4 +70,4 @@
-{% endblock base_content %} +{% endblock %} diff --git a/sapl/templates/crud/list.html b/sapl/templates/crud/list.html index 375c6edbb..51f0f5223 100644 --- a/sapl/templates/crud/list.html +++ b/sapl/templates/crud/list.html @@ -5,17 +5,18 @@
-