Commit 5f5948121e7f011262e3660fe4da66bc9435a402
Exists in
master
Merge branch 'master' into cnt-1.1.0-alfa3
Showing
9 changed files
with
123 additions
and
13 deletions
Show diff stats
cit-core/src/main/java/br/com/centralit/framework/util/UtilString.java
1 | package br.com.centralit.framework.util; | 1 | package br.com.centralit.framework.util; |
2 | 2 | ||
3 | import java.io.UnsupportedEncodingException; | 3 | import java.io.UnsupportedEncodingException; |
4 | +import java.text.ParseException; | ||
5 | + | ||
6 | +import javax.swing.text.MaskFormatter; | ||
4 | 7 | ||
5 | 8 | ||
6 | /** | 9 | /** |
@@ -209,4 +212,16 @@ public class UtilString { | @@ -209,4 +212,16 @@ public class UtilString { | ||
209 | else | 212 | else |
210 | return str.substring(0, 1).toLowerCase() + str.substring(1); | 213 | return str.substring(0, 1).toLowerCase() + str.substring(1); |
211 | } | 214 | } |
215 | + | ||
216 | + public static String formatarString(String texto, String mascara){ | ||
217 | + String result = texto; | ||
218 | + try { | ||
219 | + MaskFormatter mf = new MaskFormatter(mascara); | ||
220 | + mf.setValueContainsLiteralCharacters(false); | ||
221 | + result = mf.valueToString(texto); | ||
222 | + } catch (ParseException e) { | ||
223 | + e.printStackTrace(); | ||
224 | + } | ||
225 | + return result; | ||
226 | + } | ||
212 | } | 227 | } |
cit-portal-api/src/main/java/br/com/centralit/api/service/impl/RascunhoServiceImpl.java
@@ -40,9 +40,14 @@ public class RascunhoServiceImpl extends GenericServiceImpl<Rascunho, Long> impl | @@ -40,9 +40,14 @@ public class RascunhoServiceImpl extends GenericServiceImpl<Rascunho, Long> impl | ||
40 | 40 | ||
41 | @Override | 41 | @Override |
42 | public Rascunho merge(Rascunho entity) { | 42 | public Rascunho merge(Rascunho entity) { |
43 | + boolean rascunhoNull = false; | ||
43 | if(!UtilObjeto.isReferencia(entity.getAutor()) && !UtilObjeto.isReferencia(entity.getEditor()) && UtilObjeto.isReferencia(entity.getDetentor())){ | 44 | if(!UtilObjeto.isReferencia(entity.getAutor()) && !UtilObjeto.isReferencia(entity.getEditor()) && UtilObjeto.isReferencia(entity.getDetentor())){ |
44 | Rascunho rascunho = this.find(entity.getId()); | 45 | Rascunho rascunho = this.find(entity.getId()); |
45 | - entity.setAutor(rascunho.getAutor()); | 46 | + if(rascunho != null){ |
47 | + entity.setAutor(rascunho.getAutor()); | ||
48 | + }else{ | ||
49 | + rascunhoNull = true; | ||
50 | + } | ||
46 | }else{ | 51 | }else{ |
47 | Usuario usuario = null; | 52 | Usuario usuario = null; |
48 | if (SecurityContextHolder.getContext().getAuthentication() != null) { | 53 | if (SecurityContextHolder.getContext().getAuthentication() != null) { |
@@ -52,12 +57,15 @@ public class RascunhoServiceImpl extends GenericServiceImpl<Rascunho, Long> impl | @@ -52,12 +57,15 @@ public class RascunhoServiceImpl extends GenericServiceImpl<Rascunho, Long> impl | ||
52 | } | 57 | } |
53 | entity.setDetentor(usuario); | 58 | entity.setDetentor(usuario); |
54 | } | 59 | } |
55 | - return salvar(entity); | 60 | + return !rascunhoNull ? salvar(entity) : null; |
56 | } | 61 | } |
57 | 62 | ||
58 | private Rascunho salvar(Rascunho entity) { | 63 | private Rascunho salvar(Rascunho entity) { |
59 | - validarEntidade(entity, this.validator); | ||
60 | - return super.save(entity); | 64 | + if(entity != null){ |
65 | + validarEntidade(entity, this.validator); | ||
66 | + return super.save(entity); | ||
67 | + } | ||
68 | + return null; | ||
61 | } | 69 | } |
62 | 70 | ||
63 | @Override | 71 | @Override |
cit-portal-web/src/main/java/br/com/centralit/listener/StartupListener.java
@@ -949,6 +949,8 @@ public class StartupListener extends UtilStartup implements ApplicationListener< | @@ -949,6 +949,8 @@ public class StartupListener extends UtilStartup implements ApplicationListener< | ||
949 | 949 | ||
950 | internacionalizacaoList.add(new Internacionalizacao("MSG.INFO_NOTIFICACAO_NOVA", "Chegaram novas notificações para você.", dominio, modulo)); | 950 | internacionalizacaoList.add(new Internacionalizacao("MSG.INFO_NOTIFICACAO_NOVA", "Chegaram novas notificações para você.", dominio, modulo)); |
951 | internacionalizacaoList.add(new Internacionalizacao("MSG.INFO_NOTIFICACAO_PENDENTES", "Há notificações não lidas por você.", dominio, modulo)); | 951 | internacionalizacaoList.add(new Internacionalizacao("MSG.INFO_NOTIFICACAO_PENDENTES", "Há notificações não lidas por você.", dominio, modulo)); |
952 | + internacionalizacaoList.add(new Internacionalizacao("MSG.SELECIONE_AO_MENOS_UM_ITEM_PARA_SER_REMOVIDO", "Selecione ao menos um item para ser removido!", dominio, modulo)); | ||
953 | + internacionalizacaoList.add(new Internacionalizacao("MSG.SELECIONE_APENAS_UM_ITEM_PARA_PREENCHER_CARACTERISTICA", "Selecione apenas um item para preencher suas características!", dominio, modulo)); | ||
952 | 954 | ||
953 | } | 955 | } |
954 | 956 | ||
@@ -1301,6 +1303,7 @@ public class StartupListener extends UtilStartup implements ApplicationListener< | @@ -1301,6 +1303,7 @@ public class StartupListener extends UtilStartup implements ApplicationListener< | ||
1301 | internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR", "Não é permitido editar um item na visualização do registro", dominio, modulo)); | 1303 | internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR", "Não é permitido editar um item na visualização do registro", dominio, modulo)); |
1302 | internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR", "Não é permitido excluir um item na visualização do registro", dominio, modulo)); | 1304 | internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR", "Não é permitido excluir um item na visualização do registro", dominio, modulo)); |
1303 | internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.REMOCAO_GRUPO_NAO_PERMITIDA", "Não é permitido remover este grupo.", dominio, modulo)); | 1305 | internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.REMOCAO_GRUPO_NAO_PERMITIDA", "Não é permitido remover este grupo.", dominio, modulo)); |
1306 | + internacionalizacaoList.add(new Internacionalizacao("PORTAL.MSG.CHAVE_MENU_DUPLICADA", "A chave do menu já existe", dominio, modulo)); | ||
1304 | 1307 | ||
1305 | } | 1308 | } |
1306 | 1309 | ||
@@ -1464,6 +1467,8 @@ public class StartupListener extends UtilStartup implements ApplicationListener< | @@ -1464,6 +1467,8 @@ public class StartupListener extends UtilStartup implements ApplicationListener< | ||
1464 | internacionalizacaoList.add(new Internacionalizacao("LABEL.DETALHES_AUDITORIA", "Detalhes Auditoria", dominio, modulo)); | 1467 | internacionalizacaoList.add(new Internacionalizacao("LABEL.DETALHES_AUDITORIA", "Detalhes Auditoria", dominio, modulo)); |
1465 | internacionalizacaoList.add(new Internacionalizacao("LABEL.DOCUMENTOS", "Documentos", dominio, modulo)); | 1468 | internacionalizacaoList.add(new Internacionalizacao("LABEL.DOCUMENTOS", "Documentos", dominio, modulo)); |
1466 | 1469 | ||
1470 | + internacionalizacaoList.add(new Internacionalizacao("LABEL.CPF_CNPJ", "CPF/CNPJ", dominio, modulo)); | ||
1471 | + | ||
1467 | } | 1472 | } |
1468 | 1473 | ||
1469 | /** | 1474 | /** |
cit-portal-web/src/main/webapp/assets/js/angular/custom/controller/AppController.js
@@ -1593,5 +1593,13 @@ citApp.controller('AppController', ['$scope', '$routeParams', '$timeout', '$loca | @@ -1593,5 +1593,13 @@ citApp.controller('AppController', ['$scope', '$routeParams', '$timeout', '$loca | ||
1593 | $scope.limparUsernameRascunho = function(){ | 1593 | $scope.limparUsernameRascunho = function(){ |
1594 | $scope.editorRascunho = null; | 1594 | $scope.editorRascunho = null; |
1595 | }; | 1595 | }; |
1596 | + | ||
1597 | + $scope.aplicarValidacaoDecimal = function(element){ | ||
1598 | + if(element.precisao && element.precisao == 'decimal') | ||
1599 | + if(element.model) | ||
1600 | + element.model = parseFloat(element.model).toFixed(2); | ||
1601 | + else | ||
1602 | + element.model = ''; | ||
1603 | + }; | ||
1596 | 1604 | ||
1597 | }]); | 1605 | }]); |
cit-portal-web/src/main/webapp/assets/js/angular/custom/directive/LabelInputDecimalDirective.js
@@ -24,7 +24,7 @@ citApp.directive("labelInputDecimal", ["$translate", function($translate) { | @@ -24,7 +24,7 @@ citApp.directive("labelInputDecimal", ["$translate", function($translate) { | ||
24 | restrict : 'E', | 24 | restrict : 'E', |
25 | template : "<div class='form-group' ng-class=\"{'has-error': form[id].$error.required && (!form[id].$pristine || form.$submitted)}\">" + | 25 | template : "<div class='form-group' ng-class=\"{'has-error': form[id].$error.required && (!form[id].$pristine || form.$submitted)}\">" + |
26 | " <label for='{{id}}' class='control-label' ng-if='labelRender'><translate>{{label}}</translate> <span class='red' ng-show='obrigatorio'>*</span> <i ng-if='obrigatorio' ng-show='form[id].$error.required && (!form[id].$pristine || form.$submitted)' class='fa fa-warning red' tooltip='{{labelAlertTooltipCopy}}' tooltip-placement='top'></i> <i ng-if='labelInfoTooltipRender' class='fa fa-info-circle blue' tooltip='{{labelInfoTooltip}}' tooltip-placement='top'></i> <i ng-if='labelQuestionTooltipRender' class='fa fa-question-circle green' tooltip='{{labelQuestionTooltip}}' tooltip-placement='top'></i></label>"+ | 26 | " <label for='{{id}}' class='control-label' ng-if='labelRender'><translate>{{label}}</translate> <span class='red' ng-show='obrigatorio'>*</span> <i ng-if='obrigatorio' ng-show='form[id].$error.required && (!form[id].$pristine || form.$submitted)' class='fa fa-warning red' tooltip='{{labelAlertTooltipCopy}}' tooltip-placement='top'></i> <i ng-if='labelInfoTooltipRender' class='fa fa-info-circle blue' tooltip='{{labelInfoTooltip}}' tooltip-placement='top'></i> <i ng-if='labelQuestionTooltipRender' class='fa fa-question-circle green' tooltip='{{labelQuestionTooltip}}' tooltip-placement='top'></i></label>"+ |
27 | - " <input type='text' class='form-control' ng-change='eventoChange()' ng-blur='eventoBlur()' ng-keydown='removeModel($event)' id='{{id}}' name='{{id}}' ng-model='model' ng-disabled='disabled' maxlength='{{maxlength ? maxlength : 23}}' ng-required='obrigatorio' ui-number-mask='{{precisao}}'/>" + | 27 | + " <input type='text' class='form-control' ng-change='eventoChange()' ng-blur='eventoBlur(this)' ng-keydown='removeModel($event)' id='{{id}}' name='{{id}}' ng-model='model' ng-disabled='disabled' maxlength='{{maxlength ? maxlength : 23}}' ng-required='obrigatorio' ui-number-mask='{{precisao}}'/>" + |
28 | "</div>", | 28 | "</div>", |
29 | 29 | ||
30 | controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { | 30 | controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { |
@@ -58,7 +58,6 @@ citApp.directive("labelInputDecimal", ["$translate", function($translate) { | @@ -58,7 +58,6 @@ citApp.directive("labelInputDecimal", ["$translate", function($translate) { | ||
58 | } | 58 | } |
59 | }], | 59 | }], |
60 | link : function($scope, $element, attibutes){ | 60 | link : function($scope, $element, attibutes){ |
61 | - | ||
62 | $scope.removeModel = function(event){ | 61 | $scope.removeModel = function(event){ |
63 | if((event.keyCode === 8 || event.keyCode === 46) && $scope.model === 0.0){ | 62 | if((event.keyCode === 8 || event.keyCode === 46) && $scope.model === 0.0){ |
64 | $scope.model = null; | 63 | $scope.model = null; |
cit-portal-web/src/main/webapp/assets/js/angular/custom/directive/ListViewDirective.js
@@ -15,7 +15,11 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -15,7 +15,11 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
15 | exibirColunaSelecao : '=?ngExibirColunaSelecao', | 15 | exibirColunaSelecao : '=?ngExibirColunaSelecao', |
16 | templateTransclude : '@transclude', | 16 | templateTransclude : '@transclude', |
17 | modelParent : '=?ngModelParent', | 17 | modelParent : '=?ngModelParent', |
18 | - customTransclude : '&ngCustomTransclude' | 18 | + customTransclude : '&ngCustomTransclude', |
19 | + setTotalPages : '=?setTotalPages', | ||
20 | + setTotalItens : '=?setTotalItens', | ||
21 | + useCustomFilterTemp : '=?useCustomFilterTemp', | ||
22 | + customFilter : '&ngCustomFilter' | ||
19 | }, | 23 | }, |
20 | replace : true, | 24 | replace : true, |
21 | restrict : 'E', | 25 | restrict : 'E', |
@@ -23,8 +27,18 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -23,8 +27,18 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
23 | templateUrl : 'assets/js/angular/custom/directive/html/listView.html', | 27 | templateUrl : 'assets/js/angular/custom/directive/html/listView.html', |
24 | controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) { | 28 | controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) { |
25 | 29 | ||
26 | - $scope.totalPages = 10; | ||
27 | - $scope.totalItens = 0; | 30 | + if($scope.setTotalPages){ |
31 | + $scope.totalPages = $scope.setTotalPages; | ||
32 | + }else{ | ||
33 | + $scope.totalPages = 10; | ||
34 | + } | ||
35 | + | ||
36 | + if($scope.setTotalItens){ | ||
37 | + $scope.totalItens = $scope.setTotalPages; | ||
38 | + }else{ | ||
39 | + $scope.totalItens = 0; | ||
40 | + } | ||
41 | + | ||
28 | $scope.limit = 10; | 42 | $scope.limit = 10; |
29 | $scope.repositorio = $injector.get($scope.repository); | 43 | $scope.repositorio = $injector.get($scope.repository); |
30 | $scope.appController = angular.element("#citapp-controller").scope(); | 44 | $scope.appController = angular.element("#citapp-controller").scope(); |
@@ -75,6 +89,11 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -75,6 +89,11 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
75 | } | 89 | } |
76 | }); | 90 | }); |
77 | 91 | ||
92 | + if($scope.useCustomFilterTemp){ | ||
93 | + $scope.customFilter(); | ||
94 | + return; | ||
95 | + } | ||
96 | + | ||
78 | $scope.fetchResult().then(function() { | 97 | $scope.fetchResult().then(function() { |
79 | // The request fires correctly but sometimes the ui doesn't update, | 98 | // The request fires correctly but sometimes the ui doesn't update, |
80 | // that's a fix | 99 | // that's a fix |
@@ -94,6 +113,12 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -94,6 +113,12 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
94 | $scope.filterCriteria.dir = sortDir; | 113 | $scope.filterCriteria.dir = sortDir; |
95 | $scope.filterCriteria.sort = sortedBy; | 114 | $scope.filterCriteria.sort = sortedBy; |
96 | $scope.filterCriteria.start = 1; | 115 | $scope.filterCriteria.start = 1; |
116 | + | ||
117 | + if($scope.useCustomFilterTemp){ | ||
118 | + $scope.customFilter(); | ||
119 | + return; | ||
120 | + } | ||
121 | + | ||
97 | $scope.fetchResult().then(function() { | 122 | $scope.fetchResult().then(function() { |
98 | // The request fires correctly but sometimes the ui doesn't update, | 123 | // The request fires correctly but sometimes the ui doesn't update, |
99 | // that's a fix | 124 | // that's a fix |
@@ -103,6 +128,13 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -103,6 +128,13 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
103 | 128 | ||
104 | // RECUPERA LISTA E SETA RESULTADO NA GRID | 129 | // RECUPERA LISTA E SETA RESULTADO NA GRID |
105 | $scope.fetchResult = function(page) { | 130 | $scope.fetchResult = function(page) { |
131 | + | ||
132 | + if($scope.useCustomFilterTemp){ | ||
133 | + $scope.customFilter(); | ||
134 | + return; | ||
135 | + } | ||
136 | + | ||
137 | + | ||
106 | $scope.appController.setLoadingPesquisa(true); | 138 | $scope.appController.setLoadingPesquisa(true); |
107 | $scope.itemSelecionado = undefined; | 139 | $scope.itemSelecionado = undefined; |
108 | return $scope.repositorio.getListPage($scope.filterCriteria).then(function(result) { | 140 | return $scope.repositorio.getListPage($scope.filterCriteria).then(function(result) { |
@@ -176,6 +208,7 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -176,6 +208,7 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
176 | 208 | ||
177 | // Limpa os filtros avançados | 209 | // Limpa os filtros avançados |
178 | $scope.limparFilters = function() { | 210 | $scope.limparFilters = function() { |
211 | + $scope.useCustomFilterTemp = false; | ||
179 | $scope.filterCriteria.keywordValue = null; | 212 | $scope.filterCriteria.keywordValue = null; |
180 | if($scope.filtersCopy){ | 213 | if($scope.filtersCopy){ |
181 | $scope.filterCriteria.filters= angular.copy($scope.filtersCopy); | 214 | $scope.filterCriteria.filters= angular.copy($scope.filtersCopy); |
@@ -225,6 +258,22 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | @@ -225,6 +258,22 @@ citApp.directive("listView", ["$translate", "$injector", "$timeout", "$filter", | ||
225 | $scope.aplicarMask = function(value, mask){ | 258 | $scope.aplicarMask = function(value, mask){ |
226 | return value.replace(mask[0], mask[1]); | 259 | return value.replace(mask[0], mask[1]); |
227 | }; | 260 | }; |
261 | + | ||
262 | + $scope.$watch('setTotalPages', function() { | ||
263 | + if($scope.setTotalPages){ | ||
264 | + $scope.totalPages = $scope.setTotalPages; | ||
265 | + }else{ | ||
266 | + $scope.totalPages = 10; | ||
267 | + } | ||
268 | + }); | ||
269 | + | ||
270 | + $scope.$watch('setTotalItens', function() { | ||
271 | + if($scope.setTotalItens){ | ||
272 | + $scope.totalItens = $scope.setTotalItens; | ||
273 | + }else{ | ||
274 | + $scope.totalItens = 10; | ||
275 | + } | ||
276 | + }); | ||
228 | 277 | ||
229 | $scope.$on('filtroDirective-listViewDirective', function(event, active) { | 278 | $scope.$on('filtroDirective-listViewDirective', function(event, active) { |
230 | $scope.$showAdvancedFilters = active; | 279 | $scope.$showAdvancedFilters = active; |
cit-portal-web/src/main/webapp/assets/js/angular/custom/directive/MasksDirective.js
@@ -1571,14 +1571,20 @@ angular.module('ui.utils.masks.number', []) | @@ -1571,14 +1571,20 @@ angular.module('ui.utils.masks.number', []) | ||
1571 | 1571 | ||
1572 | var pos = value.indexOf(","); | 1572 | var pos = value.indexOf(","); |
1573 | var result; | 1573 | var result; |
1574 | + //se não ouver maxlength, 9 eh padrão... | ||
1575 | + var maxLength = attrs.maxlength ? attrs.maxlength : 9; | ||
1576 | + // -3 conta virgula e 2 casa decimais | ||
1577 | + var digitos = maxLength - 3; | ||
1578 | + var part1 = ''; | ||
1579 | + var part2 = ''; | ||
1574 | if (pos !== -1) { | 1580 | if (pos !== -1) { |
1575 | - var part1 = value.substr(0, pos > 6 ? 6 : pos); | ||
1576 | - var part2 = value.substr(pos > 6 ? 6 : pos + 1); | 1581 | + part1 = value.substr(0, pos > digitos ? digitos : pos); |
1582 | + part2 = value.substr(pos > digitos ? digitos : pos + 1); | ||
1577 | //2 casas decimais...... | 1583 | //2 casas decimais...... |
1578 | part2 = part2.substr(0,2); | 1584 | part2 = part2.substr(0,2); |
1579 | result = cleanForDecimal(part1) + "," + cleanForDecimal(part2); | 1585 | result = cleanForDecimal(part1) + "," + cleanForDecimal(part2); |
1580 | } else { | 1586 | } else { |
1581 | - result = cleanForDecimal(value).substr(0,6); | 1587 | + result = cleanForDecimal(value).substr(0,digitos); |
1582 | } | 1588 | } |
1583 | 1589 | ||
1584 | result = result ==',' ? '' : result; | 1590 | result = result ==',' ? '' : result; |
cit-portal-web/src/main/webapp/assets/js/angular/custom/directive/html/listView.html
@@ -29,7 +29,8 @@ | @@ -29,7 +29,8 @@ | ||
29 | <th ng-if="(isCheckBox == undefined || !isCheckBox) && exibirColunaSelecao" class="text-center" style="width: 5%"></th> | 29 | <th ng-if="(isCheckBox == undefined || !isCheckBox) && exibirColunaSelecao" class="text-center" style="width: 5%"></th> |
30 | <th ng-if="exibirExpandir" class="text-center" style="width: 5%"></th> | 30 | <th ng-if="exibirExpandir" class="text-center" style="width: 5%"></th> |
31 | <th class="text-center" ng-repeat="header in headers" style="width: {{header.tamanho ? header.tamanho : divisaoColunas}}%"> | 31 | <th class="text-center" ng-repeat="header in headers" style="width: {{header.tamanho ? header.tamanho : divisaoColunas}}%"> |
32 | - <sort-by onsort="onSort" sortdir="filterCriteria.dir" sortedby="filterCriteria.sort" sortvalue="{{ header.value }}">{{ header.title }}</sort-by> | 32 | + <div ng-if="!header.notSort"><sort-by onsort="onSort" sortdir="filterCriteria.dir" sortedby="filterCriteria.sort" sortvalue="{{ header.value }}">{{ header.title }}</sort-by></div> |
33 | + <div ng-if="header.notSort">{{ header.title }}</div> | ||
33 | </th> | 34 | </th> |
34 | </tr> | 35 | </tr> |
35 | </thead> | 36 | </thead> |
cit-portal-web/src/main/webapp/assets/js/angular/custom/utils/functions.js
@@ -21,6 +21,25 @@ function aplicarMascara(valor, mascara){ | @@ -21,6 +21,25 @@ function aplicarMascara(valor, mascara){ | ||
21 | return result; | 21 | return result; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | +function aplicarCpfCnpj(input) { | ||
25 | + if (input.length == 11) { | ||
26 | + var t = input.split(''); | ||
27 | + t.splice(3, 0, '.'); | ||
28 | + t.splice(7, 0, '.'); | ||
29 | + t.splice(11, 0, '-'); | ||
30 | + return t.join(''); | ||
31 | + } | ||
32 | + if (input.length == 14) { | ||
33 | + var t = input.split(''); | ||
34 | + t.splice(2, 0, '.'); | ||
35 | + t.splice(6, 0, '.'); | ||
36 | + t.splice(10, 0, '/'); | ||
37 | + t.splice(15, 0, '-'); | ||
38 | + return t.join(''); | ||
39 | + } | ||
40 | + return input; | ||
41 | +} | ||
42 | + | ||
24 | // serve para converter strings com o formato > yyyy ou mm/yyyy ou dd/mm/yyyy ou dd-mm-yyyy em date | 43 | // serve para converter strings com o formato > yyyy ou mm/yyyy ou dd/mm/yyyy ou dd-mm-yyyy em date |
25 | function converterStringEmDate(str) { | 44 | function converterStringEmDate(str) { |
26 | if (str) { | 45 | if (str) { |