Commit ea2408eab2ff3045e02e20d1fe0208ff9bc12f41
1 parent
e3f1f166
Exists in
master
Redmine #4393 Correcao de homologacao
Showing
3 changed files
with
60 additions
and
15 deletions
Show diff stats
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoViewController.js
1 | 1 | 'use strict'; |
2 | 2 | |
3 | -citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', '$timeout', 'GerenciarProcessoRepository', '$rootScope', 'DocumentoGedRepository', 'ProcessoRepository', 'NivelAcessoTipoDocumentoRepository', | |
4 | - function GerenciarProcessoController($scope, $translate, $timeout, GerenciarProcessoRepository, $rootScope, DocumentoGedRepository, ProcessoRepository, NivelAcessoTipoDocumentoRepository ) { | |
3 | +citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', '$timeout', 'GerenciarProcessoRepository', '$rootScope', 'DocumentoGedRepository', 'ProcessoRepository', 'NivelAcessoTipoDocumentoRepository','UnidadeProcessoRepository', | |
4 | + function GerenciarProcessoController($scope, $translate, $timeout, GerenciarProcessoRepository, $rootScope, DocumentoGedRepository, ProcessoRepository, NivelAcessoTipoDocumentoRepository, UnidadeProcessoRepository ) { | |
5 | 5 | |
6 | 6 | $scope.processo = {}; |
7 | 7 | |
8 | 8 | $scope.isDocumentoEdit = false; |
9 | + | |
10 | + $scope.isHistoricoProcesso = true; | |
9 | 11 | |
10 | 12 | $scope.getProcessoRelacionado = function(processoView){ |
11 | 13 | |
12 | 14 | $scope.isProcessoView = true; |
15 | + | |
16 | + $scope.isHistoricoProcessoView = true; | |
13 | 17 | |
14 | 18 | $scope.processo = processoView; |
15 | 19 | |
16 | 20 | $scope.setLoadingGet(true); |
21 | + | |
22 | + | |
17 | 23 | |
18 | 24 | $timeout(function(){ |
19 | 25 | ProcessoRepository.get($scope.processo.id).then(function(result) { |
20 | 26 | $scope.processo = result.originalElement; |
21 | 27 | }); |
22 | 28 | }, 100); |
29 | + | |
30 | + $scope.atualizarAtribuicaoProcesso($scope.processo.id); | |
23 | 31 | |
32 | + angular.element( "#widget-historico" ).scope().atualizar($scope.processo.id); | |
24 | 33 | $scope.setLoading(false); |
25 | 34 | }; |
26 | 35 | |
27 | - // FECHA WIDGET E INICIA WIDGET PADRÃO | |
36 | + // FECHA WIDGET E INICIA WIDGET PADR�O | |
28 | 37 | $scope.closeWidget = function() { |
29 | 38 | $scope.widgetExemploIsCollapsed = false; |
30 | 39 | //WIDGET PRADAO |
31 | - $scope.isHistoricoProcesso = true; | |
32 | - $scope.isDocumentoEdit = false; | |
33 | - $scope.isCancelarDocumento = false; | |
40 | + $scope.isHistoricoProcessoView = true; | |
41 | + $scope.isDocumentoEditView = false; | |
42 | + $scope.isCancelarDocumentoView = false; | |
34 | 43 | }; |
35 | 44 | |
36 | 45 | $scope.editDocument = function(editarDocumento, edit){ |
37 | 46 | |
38 | - $scope.isDocumentoEdit = true; | |
39 | - $scope.isCancelarDocumento = false; | |
47 | + $scope.isDocumentoEditView = true; | |
48 | + $scope.isCancelarDocumentoView = false; | |
40 | 49 | |
41 | 50 | $timeout(function() { |
42 | 51 | angular.element("#editDocumentoViewGed").scope().getDocumentoGedView(editarDocumento.id, false); |
... | ... | @@ -47,12 +56,10 @@ citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', ' |
47 | 56 | $scope.getCancelamentoDocumento = function(documento){ |
48 | 57 | |
49 | 58 | angular.element("#cancelarDocumentoView").scope().getCancelamentoDocumentoView(documento.cancelamentoDocumentoGed.id); |
50 | - $scope.isCancelarDocumento = true; | |
51 | - $scope.isDocumentoEdit = false; | |
59 | + $scope.isCancelarDocumentoView = true; | |
60 | + $scope.isDocumentoEditView = false; | |
52 | 61 | }; |
53 | - | |
54 | - | |
55 | - | |
62 | + | |
56 | 63 | $scope.getProcessoAnexado = function(processoView){ |
57 | 64 | $scope.processo = processoView; |
58 | 65 | |
... | ... | @@ -66,5 +73,35 @@ citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', ' |
66 | 73 | |
67 | 74 | $scope.setLoading(false); |
68 | 75 | }; |
76 | + | |
77 | + $scope.atualizarAtribuicaoProcesso = function (idProcesso){ | |
78 | + | |
79 | + $scope.idProcesso = idProcesso; | |
80 | + ProcessoRepository.verificarAtribuicaoProcessoPrimeiroAcesso(idProcesso).then( function ( result ) { | |
81 | + | |
82 | + if(result){ | |
83 | + | |
84 | + $scope.showAlert('warning', $translate.instant('ECM.MSG.ATRIBUICAO_PRIMEIRO_ACESSO')); | |
85 | + } | |
86 | + if($scope.usuarioLogado.unidade){ | |
87 | + | |
88 | + UnidadeProcessoRepository.findByIdProcesso($scope.idProcesso).then(function(result){ | |
89 | + | |
90 | + $scope.processoUnidades = result; | |
91 | + | |
92 | + angular.forEach(result, function (item) { | |
93 | + | |
94 | + if($scope.usuarioLogado.unidade && item.unidade.id === $scope.usuarioLogado.unidade.id){ | |
95 | + | |
96 | + $scope.unidadeProcesso = item.originalElement; | |
97 | + } | |
98 | + | |
99 | + }); | |
100 | + | |
101 | + }); | |
102 | + } | |
103 | + | |
104 | + }); | |
105 | + } | |
69 | 106 | |
70 | 107 | }]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/HistoricoAlteracaoProcessoController.js
... | ... | @@ -21,6 +21,12 @@ citApp.controller('HistoricoAlteracaoProcessoController', ['$scope', 'HistoricoA |
21 | 21 | $scope.findByProcessoPaginado($scope.idProcesso, 0, 5); |
22 | 22 | $scope.countByProcesso($scope.idProcesso); |
23 | 23 | }; |
24 | + | |
25 | + $scope.atualizar = function (idProcesso){ | |
26 | + $scope.idProcesso = $scope.idProcesso; | |
27 | + $scope.findByProcessoPaginado($scope.idProcesso, 0, 5); | |
28 | + $scope.countByProcesso($scope.idProcesso); | |
29 | + }; | |
24 | 30 | |
25 | 31 | |
26 | 32 | $scope.verMais = function() { | ... | ... |
cit-ecm-web/src/main/webapp/html/gerenciarProcessoView/gerenciarProcessoView.html
... | ... | @@ -60,9 +60,11 @@ |
60 | 60 | |
61 | 61 | <div id="content-container" class="col-md-8"> |
62 | 62 | |
63 | - <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoGedView.html'" ng-show="isDocumentoEdit" /> | |
63 | + <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoGedView.html'" ng-show="isDocumentoEditView" /> | |
64 | 64 | |
65 | - <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumentoView.html'" ng-show="isCancelarDocumento" /> | |
65 | + <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumentoView.html'" ng-show="isCancelarDocumentoView" /> | |
66 | + | |
67 | + <div ng-include src="'/cit-ecm-web/html/historicoAlteracaoProcesso/historicoAlteracaoProcesso.html'" ng-show="isHistoricoProcessoView" /> | |
66 | 68 | |
67 | 69 | </div> |
68 | 70 | ... | ... |