Commit db0d36bd2a3ebff2c5d0e91c76199e5d0590da53
1 parent
2dc3db0a
Exists in
master
criação tela de tipo suporte documento.
Showing
15 changed files
with
608 additions
and
0 deletions
Show diff stats
cit-ecm-api/src/main/java/br/com/centralit/api/dao/TipoSuporteDocumentoDao.java
0 → 100644
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +package br.com.centralit.api.dao; | ||
2 | + | ||
3 | +import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | ||
4 | + | ||
5 | +/** | ||
6 | + * | ||
7 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
8 | + * | ||
9 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
10 | + * | ||
11 | + * <p><b>Title: </b></p> | ||
12 | + * | ||
13 | + * <p><b>Description: </b></p> | ||
14 | + * | ||
15 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
16 | + * | ||
17 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
18 | + * | ||
19 | + * @since 04/04/2016 - 15:03:38 | ||
20 | + * | ||
21 | + * @version 1.0.0 | ||
22 | + * | ||
23 | + * @author andre.silva | ||
24 | + * | ||
25 | + */ | ||
26 | +public interface TipoSuporteDocumentoDao extends CitGenericDAO { | ||
27 | + | ||
28 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/TipoSuporteDocumentoDaoHibernate.java
0 → 100644
@@ -0,0 +1,41 @@ | @@ -0,0 +1,41 @@ | ||
1 | +package br.com.centralit.api.dao.impl; | ||
2 | + | ||
3 | +import org.springframework.stereotype.Repository; | ||
4 | + | ||
5 | +import br.com.centralit.api.dao.TipoSuporteDocumentoDao; | ||
6 | +import br.com.centralit.api.model.TipoSuporteDocumento; | ||
7 | +import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; | ||
8 | + | ||
9 | +/** | ||
10 | + * | ||
11 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
12 | + * | ||
13 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
14 | + * | ||
15 | + * <p><b>Title: </b></p> | ||
16 | + * | ||
17 | + * <p><b>Description: </b></p> | ||
18 | + * | ||
19 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
20 | + * | ||
21 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
22 | + * | ||
23 | + * @since 04/04/2016 - 15:05:58 | ||
24 | + * | ||
25 | + * @version 1.0.0 | ||
26 | + * | ||
27 | + * @author andre.silva | ||
28 | + * | ||
29 | + */ | ||
30 | +@Repository("tipoSuporteDocumentoDao") | ||
31 | +public class TipoSuporteDocumentoDaoHibernate extends CitGenericDAOImpl implements TipoSuporteDocumentoDao { | ||
32 | + | ||
33 | + /** | ||
34 | + * Responsável pela criação de novas instâncias desta classe. | ||
35 | + */ | ||
36 | + public TipoSuporteDocumentoDaoHibernate() { | ||
37 | + | ||
38 | + super(TipoSuporteDocumento.class); | ||
39 | + } | ||
40 | + | ||
41 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/framework/json/ViewsEcm.java
@@ -102,5 +102,9 @@ public class ViewsEcm extends Views { | @@ -102,5 +102,9 @@ public class ViewsEcm extends Views { | ||
102 | 102 | ||
103 | public static class HistoricoAtribuicaoProcessoView extends Views.GenericView{}; | 103 | public static class HistoricoAtribuicaoProcessoView extends Views.GenericView{}; |
104 | 104 | ||
105 | + public static class TipoSuporteDocumentoListView extends Views.GenericView{}; | ||
106 | + | ||
107 | + public static class TipoSuporteDocumentoEdit extends TipoSuporteDocumentoListView{}; | ||
108 | + | ||
105 | 109 | ||
106 | } | 110 | } |
cit-ecm-api/src/main/java/br/com/centralit/api/model/TipoSuporteDocumento.java
0 → 100644
@@ -0,0 +1,101 @@ | @@ -0,0 +1,101 @@ | ||
1 | +package br.com.centralit.api.model; | ||
2 | + | ||
3 | +import javax.persistence.Column; | ||
4 | +import javax.persistence.Entity; | ||
5 | +import javax.persistence.FetchType; | ||
6 | +import javax.persistence.GeneratedValue; | ||
7 | +import javax.persistence.GenerationType; | ||
8 | +import javax.persistence.Id; | ||
9 | +import javax.persistence.OneToOne; | ||
10 | + | ||
11 | +import br.com.centralit.api.framework.json.ViewsEcm; | ||
12 | +import br.com.centralit.framework.json.Views; | ||
13 | + | ||
14 | +import com.fasterxml.jackson.annotation.JsonView; | ||
15 | + | ||
16 | +/** | ||
17 | + * | ||
18 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
19 | + * | ||
20 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
21 | + * | ||
22 | + * <p><b>Title: </b></p> | ||
23 | + * | ||
24 | + * <p><b>Description: </b></p> | ||
25 | + * | ||
26 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
27 | + * | ||
28 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
29 | + * | ||
30 | + * @since 04/04/2016 - 14:47:10 | ||
31 | + * | ||
32 | + * @version 1.0.0 | ||
33 | + * | ||
34 | + * @author andre.silva | ||
35 | + * | ||
36 | + */ | ||
37 | +@Entity | ||
38 | +public class TipoSuporteDocumento extends PersistentObjectUnidade { | ||
39 | + | ||
40 | + /** Atributo serialVersionUID. */ | ||
41 | + private static final long serialVersionUID = 4824264305224974743L; | ||
42 | + | ||
43 | + @Id | ||
44 | + @GeneratedValue(strategy = GenerationType.AUTO) | ||
45 | + @JsonView({ Views.GenericView.class }) | ||
46 | + protected Long id; | ||
47 | + | ||
48 | + @Column(length = 64) | ||
49 | + @JsonView({ ViewsEcm.TipoSuporteDocumentoEdit.class }) | ||
50 | + private String descricao; | ||
51 | + | ||
52 | + @OneToOne(mappedBy = "documentoGed", fetch = FetchType.EAGER) | ||
53 | + @JsonView({ ViewsEcm.TipoSuporteDocumentoEdit.class }) | ||
54 | + private DocumentoGed documentoGed; | ||
55 | + | ||
56 | + | ||
57 | + /** | ||
58 | + * Retorna o valor do atributo <code>id</code> | ||
59 | + * | ||
60 | + * @return <code>Long</code> | ||
61 | + */ | ||
62 | + public Long getId() { | ||
63 | + | ||
64 | + return id; | ||
65 | + } | ||
66 | + | ||
67 | + | ||
68 | + /** | ||
69 | + * Define o valor do atributo <code>id</code>. | ||
70 | + * | ||
71 | + * @param id | ||
72 | + */ | ||
73 | + public void setId(Long id) { | ||
74 | + | ||
75 | + this.id = id; | ||
76 | + } | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + /** | ||
81 | + * Retorna o valor do atributo <code>descricao</code> | ||
82 | + * | ||
83 | + * @return <code>String</code> | ||
84 | + */ | ||
85 | + public String getDescricao() { | ||
86 | + | ||
87 | + return descricao; | ||
88 | + } | ||
89 | + | ||
90 | + | ||
91 | + /** | ||
92 | + * Define o valor do atributo <code>descricao</code>. | ||
93 | + * | ||
94 | + * @param descricao | ||
95 | + */ | ||
96 | + public void setDescricao(String descricao) { | ||
97 | + | ||
98 | + this.descricao = descricao; | ||
99 | + } | ||
100 | + | ||
101 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/service/TipoSuporteDocumentoService.java
0 → 100644
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +package br.com.centralit.api.service; | ||
2 | + | ||
3 | +import br.com.centralit.api.model.TipoSuporteDocumento; | ||
4 | +import br.com.centralit.framework.service.arquitetura.GenericService; | ||
5 | + | ||
6 | +/** | ||
7 | + * | ||
8 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
9 | + * | ||
10 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
11 | + * | ||
12 | + * <p><b>Title: </b></p> | ||
13 | + * | ||
14 | + * <p><b>Description: </b></p> | ||
15 | + * | ||
16 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
17 | + * | ||
18 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
19 | + * | ||
20 | + * @since 04/04/2016 - 14:52:40 | ||
21 | + * | ||
22 | + * @version 1.0.0 | ||
23 | + * | ||
24 | + * @author andre.silva | ||
25 | + * | ||
26 | + */ | ||
27 | +public interface TipoSuporteDocumentoService extends GenericService<TipoSuporteDocumento, Long> { | ||
28 | + | ||
29 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/InicializarEcmServiceImpl.java
@@ -215,6 +215,12 @@ public class InicializarEcmServiceImpl extends UtilStartup { | @@ -215,6 +215,12 @@ public class InicializarEcmServiceImpl extends UtilStartup { | ||
215 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/AtribuirProcessoController.min.js", this.dominioJS, menuCadastroProcesso)); | 215 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/AtribuirProcessoController.min.js", this.dominioJS, menuCadastroProcesso)); |
216 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/HistoricoAtribuicaoProcessoRepository.js", this.dominioJS, menuCadastroProcesso)); | 216 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/HistoricoAtribuicaoProcessoRepository.js", this.dominioJS, menuCadastroProcesso)); |
217 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/HistoricoAtribuicaoProcessoRepository.min.js", this.dominioJS, menuCadastroProcesso)); | 217 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/HistoricoAtribuicaoProcessoRepository.min.js", this.dominioJS, menuCadastroProcesso)); |
218 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/TipoSuporteDocumentoRepository.js", this.dominioJS, menuCadastroProcesso)); | ||
219 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/TipoSuporteDocumentoRepository.min.js", this.dominioJS, menuCadastroProcesso)); | ||
220 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/TipoServicoDocumentoController.js", this.dominioJS, menuCadastroProcesso)); | ||
221 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/TipoServicoDocumentoController.min.js", this.dominioJS, menuCadastroProcesso)); | ||
222 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/TipoSuporteDocumentoListController.js", this.dominioJS, menuCadastroProcesso)); | ||
223 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/TipoSuporteDocumentoListController.min.js", this.dominioJS, menuCadastroProcesso)); | ||
218 | 224 | ||
219 | 225 | ||
220 | menuCadastroProcesso.setIncludes(filesProcesso); | 226 | menuCadastroProcesso.setIncludes(filesProcesso); |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/TipoSuporteDocumentoServiceImpl.java
0 → 100644
@@ -0,0 +1,51 @@ | @@ -0,0 +1,51 @@ | ||
1 | +package br.com.centralit.api.service.impl; | ||
2 | + | ||
3 | +import org.springframework.beans.factory.annotation.Autowired; | ||
4 | +import org.springframework.stereotype.Service; | ||
5 | + | ||
6 | +import br.com.centralit.api.dao.TipoSuporteDocumentoDao; | ||
7 | +import br.com.centralit.api.model.TipoSuporteDocumento; | ||
8 | +import br.com.centralit.api.service.TipoSuporteDocumentoService; | ||
9 | +import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; | ||
10 | + | ||
11 | +/** | ||
12 | + * | ||
13 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
14 | + * | ||
15 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
16 | + * | ||
17 | + * <p><b>Title: </b></p> | ||
18 | + * | ||
19 | + * <p><b>Description: </b></p> | ||
20 | + * | ||
21 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
22 | + * | ||
23 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
24 | + * | ||
25 | + * @since 04/04/2016 - 15:02:14 | ||
26 | + * | ||
27 | + * @version 1.0.0 | ||
28 | + * | ||
29 | + * @author andre.silva | ||
30 | + * | ||
31 | + */ | ||
32 | +@Service("tipoSuporteDocumentoService") | ||
33 | +public class TipoSuporteDocumentoServiceImpl extends GenericServiceImpl<TipoSuporteDocumento, Long> implements TipoSuporteDocumentoService { | ||
34 | + | ||
35 | + /** Atributo tipoSuporteDocumentoDao. */ | ||
36 | + @SuppressWarnings("unused") | ||
37 | + private TipoSuporteDocumentoDao tipoSuporteDocumentoDao; | ||
38 | + | ||
39 | + /** | ||
40 | + * | ||
41 | + * Responsável pela criação de novas instâncias desta classe. | ||
42 | + * @param tipoSuporteDocumentoDao | ||
43 | + */ | ||
44 | + @Autowired | ||
45 | + public TipoSuporteDocumentoServiceImpl( TipoSuporteDocumentoDao tipoSuporteDocumentoDao ) { | ||
46 | + | ||
47 | + this.dao = tipoSuporteDocumentoDao; | ||
48 | + | ||
49 | + this.tipoSuporteDocumentoDao = tipoSuporteDocumentoDao; | ||
50 | + } | ||
51 | +} |
cit-ecm-web/src/main/java/br/com/centralit/controller/TipoSuporteDocumentoController.java
0 → 100644
@@ -0,0 +1,68 @@ | @@ -0,0 +1,68 @@ | ||
1 | +package br.com.centralit.controller; | ||
2 | + | ||
3 | +import org.springframework.beans.factory.annotation.Autowired; | ||
4 | +import org.springframework.stereotype.Controller; | ||
5 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
6 | + | ||
7 | +import br.com.centralit.api.framework.json.ViewsEcm; | ||
8 | +import br.com.centralit.api.model.TipoSuporteDocumento; | ||
9 | +import br.com.centralit.api.service.TipoSuporteDocumentoService; | ||
10 | +import br.com.centralit.framework.controller.GenericController; | ||
11 | + | ||
12 | +/** | ||
13 | + * | ||
14 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
15 | + * | ||
16 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
17 | + * | ||
18 | + * <p><b>Title: </b></p> | ||
19 | + * | ||
20 | + * <p><b>Description: </b></p> | ||
21 | + * | ||
22 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
23 | + * | ||
24 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
25 | + * | ||
26 | + * @since 04/04/2016 - 15:07:17 | ||
27 | + * | ||
28 | + * @version 1.0.0 | ||
29 | + * | ||
30 | + * @author andre.silva | ||
31 | + * | ||
32 | + */ | ||
33 | +@Controller | ||
34 | +@RequestMapping("/rest/tipoSuporteDocumento") | ||
35 | +public class TipoSuporteDocumentoController extends GenericController<TipoSuporteDocumento> { | ||
36 | + | ||
37 | + | ||
38 | + @SuppressWarnings("unused") | ||
39 | + private TipoSuporteDocumentoService tipoSuporteDocumentoService; | ||
40 | + | ||
41 | + /** | ||
42 | + * Responsável pela criação de novas instâncias desta classe. | ||
43 | + * | ||
44 | + * @param privilegioService | ||
45 | + */ | ||
46 | + @Autowired | ||
47 | + public TipoSuporteDocumentoController( TipoSuporteDocumentoService tipoSuporteDocumentoService ) { | ||
48 | + | ||
49 | + super(tipoSuporteDocumentoService); | ||
50 | + | ||
51 | + this.tipoSuporteDocumentoService = tipoSuporteDocumentoService; | ||
52 | + | ||
53 | + } | ||
54 | + | ||
55 | + | ||
56 | + @Override | ||
57 | + public Class<ViewsEcm.TipoSuporteDocumentoListView> getListView() { | ||
58 | + | ||
59 | + return ViewsEcm.TipoSuporteDocumentoListView.class; | ||
60 | + } | ||
61 | + | ||
62 | + @Override | ||
63 | + public Class<ViewsEcm.TipoSuporteDocumentoEdit> getEditView() { | ||
64 | + | ||
65 | + return ViewsEcm.TipoSuporteDocumentoEdit.class; | ||
66 | + } | ||
67 | + | ||
68 | +} |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/DocumentoGedController.js
@@ -59,6 +59,17 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', | @@ -59,6 +59,17 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', | ||
59 | } | 59 | } |
60 | }); | 60 | }); |
61 | }; | 61 | }; |
62 | + | ||
63 | + $scope.novoTipoSuporteDocumento = function() { | ||
64 | + $scope.openWorkspaceIfNotOpen($translate.instant('LABEL.PESSOA'), '/cit-ecm-web/html/tipoSuporteDocumento/tipoSuporteDocumento.html', 'mod-orange'); | ||
65 | + | ||
66 | + $timeout(function() { | ||
67 | + angular.element('#searchTipoSuporteDocumento').scope().$showPageEditWorkspace(angular.element('#searchTipoSuporteDocumento').scope().workspace); | ||
68 | + angular.element('#tipoSuporteDocumentoEdit').scope().resetForm(); | ||
69 | + | ||
70 | + }, 600); | ||
71 | + | ||
72 | + }; | ||
62 | 73 | ||
63 | //Remove o primeiro documento criado | 74 | //Remove o primeiro documento criado |
64 | $scope.removeDocumento = function(){ | 75 | $scope.removeDocumento = function(){ |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TipoSuporteDocumentoController.js
0 → 100644
@@ -0,0 +1,92 @@ | @@ -0,0 +1,92 @@ | ||
1 | +'use strict'; | ||
2 | + | ||
3 | +citApp.controller('TipoSuporteDocumentoController', ['$scope', 'TipoSuporteDocumentoRepository', '$filter', '$translate', '$timeout', function TipoSuporteDocumentoController($scope, TipoSuporteDocumentoRepository, $filter, $translate, $timeout) { | ||
4 | + $scope.privilegio = {}; | ||
5 | + | ||
6 | + | ||
7 | + // Limpa formulário para novo cadastro | ||
8 | + $scope.resetForm = function() { | ||
9 | + $scope.limparPrivilegio(); | ||
10 | + $scope.edit = true; | ||
11 | + $scope.pgEdit = true; | ||
12 | + $timeout(function(){ | ||
13 | + $scope.privilegioForm.$submitted = false; | ||
14 | + $scope.privilegioForm.$setPristine(); | ||
15 | + }); | ||
16 | + }; | ||
17 | + | ||
18 | + // Atualiza pagina de pesquisa | ||
19 | + $scope.atualizaPaginaPesquisa = function () { | ||
20 | + angular.element('#searchPrivilegio').scope().fetchResult(); | ||
21 | + }; | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + // MODAL QUE CONFIRMA REMOVER DO PAIS | ||
26 | + $scope.remove = function(pais){ | ||
27 | + $scope.pais = pais; | ||
28 | + $scope.$openModalConfirm({ | ||
29 | + message: $translate.instant('MSG.DESEJA_EXCLUIR_ITENS'), | ||
30 | + callback: function () { | ||
31 | + PrivilegioRepository.remove($scope.privilegio).then(function() { | ||
32 | + | ||
33 | + $scope.$modalConfirmInstance.dismiss('cancel'); | ||
34 | + $scope.showAlert("success", $translate.instant('MSG.SUCESSO_PRIVILEGIO_EXCLUIDO')); | ||
35 | + angular.element('#searchPrivilegio').scope().fetchResult(); | ||
36 | + | ||
37 | + $scope.resetForm(); | ||
38 | + }); | ||
39 | + } | ||
40 | + }); | ||
41 | + }; | ||
42 | + | ||
43 | + // SALVA O PAIS | ||
44 | + $scope.saveOrUpdate = function(){ | ||
45 | + $scope.privilegioForm.$submitted = true; | ||
46 | + | ||
47 | + //verifica se o formulario está valido para salvar | ||
48 | + if($scope.privilegioForm.$valid){ | ||
49 | + | ||
50 | + $scope.setLoadingSalva(true); | ||
51 | + | ||
52 | + PrivilegioRepository.save($scope.privilegio).then(function(result) { | ||
53 | + $scope.privilegio = result.originalElement; | ||
54 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | ||
55 | + $scope.privilegioForm.$submitted = false; | ||
56 | + $scope.setLoading(false); | ||
57 | + }); | ||
58 | + }else{ | ||
59 | + //Mensagem de erro de campos obrigatorios não preenchidos | ||
60 | + $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); | ||
61 | + } | ||
62 | + | ||
63 | + }; | ||
64 | + | ||
65 | + // Limpa o formulario preenchido | ||
66 | + $scope.limparPrivilegio = function(){ | ||
67 | + $scope.privilegio = {}; | ||
68 | + }; | ||
69 | + | ||
70 | + | ||
71 | + | ||
72 | + // Consulta entidade e mostra no formulario | ||
73 | + $scope.getPrivilegio = function(privilegio, edit){ | ||
74 | + $scope.setLoadingGet(true); | ||
75 | + | ||
76 | + PrivilegioRepository.get(privilegio.id).then(function(result) { | ||
77 | + $scope.privilegio = result.originalElement; | ||
78 | + $scope.pgEdit = edit; | ||
79 | + $scope.edit = edit; | ||
80 | + $scope.setLoading(false); | ||
81 | + }); | ||
82 | + }; | ||
83 | + | ||
84 | + //faz uppercase na string | ||
85 | + $scope.$watch('privilegio.nome', function (val) { | ||
86 | + | ||
87 | + $scope.privilegio.nome = $filter('uppercase')(val); | ||
88 | + }, true); | ||
89 | + | ||
90 | +}]); | ||
91 | + | ||
92 | + |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TipoSuporteDocumentoListController.js
0 → 100644
@@ -0,0 +1,46 @@ | @@ -0,0 +1,46 @@ | ||
1 | +'use strict'; | ||
2 | + | ||
3 | +citApp.controller('TipoSuporteDocumentoListController', ['$scope', 'TipoSuporteDocumentoRepository', '$translate', '$modal', '$timeout', | ||
4 | + function TipoSuporteDocumentoListController($scope, TipoSuporteDocumentoRepository, $translate, $modal, $timeout) { | ||
5 | + $scope.$showAdvancedFilters = false; | ||
6 | + | ||
7 | + // Chama controlleredit para limpar o formulario de cadastro | ||
8 | + $scope.resetForm = function() { | ||
9 | + angular.element("#editTipoSuporteDocumento").scope().resetForm(); | ||
10 | + }; | ||
11 | + | ||
12 | + $scope.headers = [ | ||
13 | + { | ||
14 | + title : $translate.instant('LABEL.DESCRICAO'), | ||
15 | + value : 'descricao' | ||
16 | + }]; | ||
17 | + | ||
18 | + // default criteria that will be sent to the server | ||
19 | + $scope.filterCriteria = { | ||
20 | + start : 1, | ||
21 | + dir : 'asc', | ||
22 | + sort : 'id', | ||
23 | + limit : 10, | ||
24 | + fields: ['id','descricao'], | ||
25 | + filters : [{type: 'string', field: 'descricao'}] | ||
26 | + }; | ||
27 | + | ||
28 | + // ABRI PAIS SELECIONADO | ||
29 | + $scope.abrirPrivilegio = function(edit){ | ||
30 | + var tipoSuporteDocumento = $scope.tipoSuporteDocumentoChecked; | ||
31 | + | ||
32 | + if(!edit && !privilegio) { | ||
33 | + $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO')); | ||
34 | + return; | ||
35 | + } | ||
36 | + | ||
37 | + if(edit && !privilegio) { | ||
38 | + $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | ||
39 | + return; | ||
40 | + } | ||
41 | + | ||
42 | + angular.element('#editTipoSuporteDocumento').scope().getTipoSuporteDocumento(tipoSuporteDocumento, edit); | ||
43 | + $scope.$showPageEditWorkspace($scope.workspace); | ||
44 | + }; | ||
45 | + | ||
46 | +}]); | ||
0 | \ No newline at end of file | 47 | \ No newline at end of file |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/TipoSuporteDocumentoRepository.js
0 → 100644
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +citApp.factory('TipoSuporteDocumentoRepository', ['Restangular','AbstractRepository', function(restangular, AbstractRepository) { | ||
2 | + | ||
3 | + | ||
4 | + function TipoSuporteDocumentoRepository(){ | ||
5 | + AbstractRepository.call(this, restangular, 'rest/tipoSuporteDocumento'); | ||
6 | + }; | ||
7 | + | ||
8 | + AbstractRepository.extend(TipoSuporteDocumentoRepository); | ||
9 | + | ||
10 | + return new TipoSuporteDocumentoRepository(); | ||
11 | +}]); | ||
0 | \ No newline at end of file | 12 | \ No newline at end of file |
cit-ecm-web/src/main/webapp/html/tipoSuporteDocumento/tipoServicoDocumento.html
0 → 100644
@@ -0,0 +1,2 @@ | @@ -0,0 +1,2 @@ | ||
1 | +<div ng-include src="'/cit-portal-web/html/tipoSuporteDocumento/tipoSuporteDocumentoList.html'" ng-show="workspace.$showSearch" /> | ||
2 | +<div ng-include src="'/cit-portal-web/html/tipoSuporteDocumento/tipoSuporteDocumentoEdit.html'" ng-show="workspace.$showEdit" /> | ||
0 | \ No newline at end of file | 3 | \ No newline at end of file |
cit-ecm-web/src/main/webapp/html/tipoSuporteDocumento/tipoServicoDocumentoEdit.html
0 → 100644
@@ -0,0 +1,77 @@ | @@ -0,0 +1,77 @@ | ||
1 | +<div id="editTipoServicoDocumento" class="page-content clearfix" ng-controller="TipoSuporteDocumentoController"> | ||
2 | + <div class="bar-buttons-action fixed"> | ||
3 | + <div class="row"> | ||
4 | + <div class="col-sm-8 text-left"> | ||
5 | + <button title="{{$translate.instant('LABEL.SALVAR')}}" alt="{{$translate.instant('LABEL.SALVAR')}}" class="btn btn-clear" ng-click="saveOrUpdate()" ng-show="edit" type="button"> | ||
6 | + <i class="fa fa-save green"></i> | ||
7 | + <translate>LABEL.SALVAR</translate> | ||
8 | + </button> | ||
9 | + | ||
10 | + <button title="{{$translate.instant('LABEL.LIMPAR')}}" alt="{{$translate.instant('LABEL.LIMPAR')}}" class="btn btn-clear" ng-click="resetForm();" ng-show="privilegio.id === undefined" | ||
11 | + type="button"> | ||
12 | + <i class="fa fa-eraser yellow-dark"></i> | ||
13 | + <translate>LABEL.LIMPAR</translate> | ||
14 | + </button> | ||
15 | + | ||
16 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-show="!(pgEdit || edit)" ng-click="edit = true; pgEdit = true;" | ||
17 | + type="button"> | ||
18 | + <i class="fa fa-pencil blue"></i> | ||
19 | + <translate>LABEL.EDITAR</translate> | ||
20 | + </button> | ||
21 | + | ||
22 | + <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" ng-click="remove(privilegio);" ng-show="privilegio.id !== undefined" | ||
23 | + type="button"> | ||
24 | + <i class="fa fa-times red"></i> | ||
25 | + <translate>LABEL.REMOVER</translate> | ||
26 | + </button> | ||
27 | + | ||
28 | + <bloquear-desbloquear ng-model="TipoServicoDocumento" ng-repository="TipoServicoDocumentoRepository" ng-edit="edit" form="TipoServicoDocumentoForm"></bloquear-desbloquear> | ||
29 | + | ||
30 | + <button title="{{$translate.instant('LABEL.PESQUISAR')}}" alt="{{$translate.instant('LABEL.PESQUISAR')}}" class="btn btn-clear" | ||
31 | + ng-click="$showPageSearchWorkspace(workspace); atualizaPaginaPesquisa();" type="button"> | ||
32 | + <i class="fa fa-search"></i> | ||
33 | + <translate>LABEL.PESQUISAR</translate> | ||
34 | + </button> | ||
35 | + </div> | ||
36 | + <!-- .col --> | ||
37 | + | ||
38 | + <div class="col-sm-4 text-right"> | ||
39 | + <favorito /> | ||
40 | + | ||
41 | + <help-button workspace="workspace" /> | ||
42 | + </div> | ||
43 | + <!-- .col --> | ||
44 | + </div> | ||
45 | + <!-- .row --> | ||
46 | + </div> | ||
47 | + <!-- .bar-buttons-action --> | ||
48 | + | ||
49 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | ||
50 | + | ||
51 | + <form name="privilegioForm" id="editPermissao" novalidate autocomplete="off"> | ||
52 | + <p> | ||
53 | + <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small> | ||
54 | + </p> | ||
55 | + | ||
56 | + <fieldset> | ||
57 | + <legend> | ||
58 | + <translate>LABEL.DADOS_PRIVILEGIO</translate> | ||
59 | + </legend> | ||
60 | + | ||
61 | + <div class="row"> | ||
62 | + <div class="col-sm-6"> | ||
63 | + | ||
64 | + <label-input-identifier ng-id="privilegio.nome" name="privilegio.nome" ng-typ="text" ng-obrigatorio='true' ng-custom-maxlength='255' form="privilegioForm" ng-label="LABEL.NOME" | ||
65 | + ng-model="privilegio.nome" ng-disabled="!edit"></label-input-identifier> | ||
66 | + </div> | ||
67 | + <div class="col-md-6"> | ||
68 | + <label-input ng-id="privilegio.descricao" name="privilegio.descricao" ng-typ="text" ng-obrigatorio='true' ng-custom-maxlength='255' form="privilegioForm" ng-label="LABEL.DESCRICAO" | ||
69 | + ng-model="privilegio.descricao" ng-disabled="!edit" /> | ||
70 | + </div> | ||
71 | + <!-- .col-sm-2 --> | ||
72 | + </div> | ||
73 | + <!-- .row --> | ||
74 | + </fieldset> | ||
75 | + </form> | ||
76 | +</div> | ||
77 | +<!-- .page-content --> | ||
0 | \ No newline at end of file | 78 | \ No newline at end of file |
cit-ecm-web/src/main/webapp/html/tipoSuporteDocumento/tipoServicoDocumentoList.html
0 → 100644
@@ -0,0 +1,41 @@ | @@ -0,0 +1,41 @@ | ||
1 | +<div id="searchTipoServicoDocumento" class="page-content" ng-controller="TipoServicoDocumentoListController"> | ||
2 | + <div class="bar-buttons-action fixed"> | ||
3 | + <div class="row"> | ||
4 | + <div class="col-sm-8 text-left"> | ||
5 | + <button title="{{$translate.instant('LABEL.CADASTRAR')}}" alt="{{$translate.instant('LABEL.CADASTRAR')}}" class="btn btn-clear" ng-click="$showPageEditWorkspace(workspace); resetForm();" type="button"> | ||
6 | + <i class="fa fa-plus-circle yellow-dark"></i> | ||
7 | + <translate>LABEL.CADASTRAR</translate> | ||
8 | + </button> | ||
9 | + | ||
10 | + <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" ng-click="abrirPrivilegio(false);" type="button"> | ||
11 | + <i class="fa fa-search blue"></i> | ||
12 | + <translate>LABEL.VISUALIZAR</translate> | ||
13 | + </button> | ||
14 | + | ||
15 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-click="abrirPrivilegio(true);" type="button"> | ||
16 | + <i class="fa fa-pencil blue"></i> | ||
17 | + <translate>LABEL.EDITAR</translate> | ||
18 | + </button> | ||
19 | + | ||
20 | + <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" ng-click="remove();" type="button"> | ||
21 | + <i class="fa fa-times red"></i> | ||
22 | + <translate>LABEL.REMOVER</translate> | ||
23 | + </button> | ||
24 | + | ||
25 | + <span class="divider-vertical"></span> | ||
26 | + | ||
27 | + <filtros ng-filter="filterCriteria" ng-workspace="workspace"></filtros> | ||
28 | + </div><!-- .col --> | ||
29 | + | ||
30 | + <div class="col-sm-4 text-right"> | ||
31 | + <favorito/> | ||
32 | + <help-button workspace="workspace" /> | ||
33 | + </div><!-- .col --> | ||
34 | + </div><!-- .row --> | ||
35 | + </div><!-- .bar-buttons-action --> | ||
36 | + | ||
37 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | ||
38 | + | ||
39 | + <list-view ng-lista="tipoServicoDocumento" ng-repository="TipoServicoDocumentoRepository" ng-headers="headers" ng-filter-criteria="filterCriteria" ng-item-selecionado="tipoServicoDocumentoChecked"></list-view> | ||
40 | + | ||
41 | +</div><!-- .page-content --> | ||
0 | \ No newline at end of file | 42 | \ No newline at end of file |