git-svn-id: https://svn.coded.pt/svn/SIPRP@1869 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
João Maurício 12 years ago
parent daa6e5d25f
commit 275a9d022c

@ -4,7 +4,6 @@
$scope.calculatedAge = 0; $scope.calculatedAge = 0;
//TODO: review store name!!!
$scope.storeFichasClinicas = new globals.dataService.store({ $scope.storeFichasClinicas = new globals.dataService.store({
model: null, model: null,
actions: { actions: {
@ -14,14 +13,8 @@
} }
}); });
//$scope.$watch('editing.antecentesOcupacionaisActividadesAnteriores', function(newVal, oldVal){
//});
$scope.add = function(selected){ $scope.add = function(selected){
//$("body, html").animate({scrollTop : 0}, 500);
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.editing = angular.copy(selected); $scope.editing = angular.copy(selected);
@ -30,7 +23,6 @@
$scope.editing.antecentesOcupacionaisAcidentesTrabalho = []; $scope.editing.antecentesOcupacionaisAcidentesTrabalho = [];
$scope.editing.antecentesOcupacionaisDoencasProfissionais = []; $scope.editing.antecentesOcupacionaisDoencasProfissionais = [];
$scope.editing.antecentesOcupacionaisActividadesAnteriores = []; $scope.editing.antecentesOcupacionaisActividadesAnteriores = [];
}; };
$scope.edit = function(selected){ $scope.edit = function(selected){
@ -99,10 +91,13 @@
{ {
$scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){
if(isNewRecord) //TODO: id's de cada ficha - injectar no modelo em edição
{
//$scope.isNewRecord = isNewRecord;
} //if(isNewRecord)
//{
// //$scope.isNewRecord = isNewRecord;
//}
//$scope.editing.ficha.id = editing.ficha.id; //$scope.editing.ficha.id = editing.ficha.id;
@ -129,9 +124,36 @@
$scope.cancel = function(){ $scope.cancel = function(){
globals.message.custom({
title: null,
message: 'Pretende anular as alterações à ficha ou gravar para edição posterior?',
buttons: {
cancelar: {
label: 'Cancelar',
className: 'btn-default',
callback: function() {
//cancelar diálogo
}
},
anular: {
label: 'Anular',
className: 'btn-danger',
callback: function() {
$scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){
}); });
}
},
gravar: {
label: 'Gravar',
className: 'btn-success',
callback: function() {
$scope.save();
}
}
}
});
}; };
$scope.$on('afterrender', function(event, args){ $scope.$on('afterrender', function(event, args){

@ -30,14 +30,14 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">Nome</label> <label class="col-sm-2 control-label">Nome</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input ng-model="editing.ficha.empresa_designacao_social" data-required="true" type="text" class="form-control" /> <input ng-model="editing.ficha.empresa_designacao_social" data-required="true" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">Ramo de Actividade</label> <label class="col-sm-2 control-label">Ramo de Actividade</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input ng-model="editing.ficha.empresa_ramo_actividade" data-required="true" type="text" class="form-control" /> <input ng-model="editing.ficha.empresa_ramo_actividade" data-required="true" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
@ -46,7 +46,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Estabelecimento</label> <label class="col-sm-4 control-label">Estabelecimento</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input ng-model="editing.ficha.estabelecimento_nome" data-required="true" type="text" class="form-control" /> <input ng-model="editing.ficha.estabelecimento_nome" data-required="true" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
</div> </div>
@ -54,7 +54,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Localidade</label> <label class="col-sm-4 control-label">Localidade</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input ng-model="editing.ficha.estabelecimento_localidade" data-required="true" type="text" class="form-control" /> <input ng-model="editing.ficha.estabelecimento_localidade" data-required="true" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
</div> </div>
@ -74,7 +74,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">Nome</label> <label class="col-sm-2 control-label">Nome</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input ng-model="editing.ficha.trabalhador_nome" type="text" class="form-control" /> <input ng-model="editing.ficha.trabalhador_nome" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
@ -84,11 +84,11 @@
<label class="col-sm-4 control-label">Sexo</label> <label class="col-sm-4 control-label">Sexo</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label class="checkbox-inline p-l-none"> <label class="checkbox-inline p-l-none">
<input ng-model="editing.ficha.trabalhador_sexo" name="rb_trabalhador_sexo" value="M" type="radio" /> <input ng-model="editing.ficha.trabalhador_sexo" name="rb_trabalhador_sexo" value="M" type="radio" disabled/>
Masculino Masculino
</label> </label>
<label class="checkbox-inline"> <label class="checkbox-inline">
<input ng-model="editing.ficha.trabalhador_sexo" name="rb_trabalhador_sexo" value="F" type="radio" /> <input ng-model="editing.ficha.trabalhador_sexo" name="rb_trabalhador_sexo" value="F" type="radio" disabled/>
Feminino Feminino
</label> </label>
</div> </div>
@ -101,7 +101,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Data de Nascimento</label> <label class="col-sm-4 control-label">Data de Nascimento</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input ng-model="editing.ficha.trabalhador_data_nascimento" value="{{editing.ficha.trabalhador_data_nascimento}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.ficha.trabalhador_data_nascimento" type="text" class="form-control" datepicker disabled/>
</div> </div>
</div> </div>
</div> </div>
@ -236,7 +236,6 @@
<h4 class="section-title" id="H1">2 - Actividade</h4> <h4 class="section-title" id="H1">2 - Actividade</h4>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">1.2 - Utente</div>
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">
@ -246,7 +245,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Data de Admissão na Empresa</label> <label class="col-sm-4 control-label">Data de Admissão na Empresa</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input ng-model="editing.ficha.trabalhador_data_admissao" value="{{editing.ficha.trabalhador_data_admissao}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.ficha.trabalhador_data_admissao" type="text" class="form-control" datepicker disabled/>
</div> </div>
</div> </div>
</div> </div>
@ -254,7 +253,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Função Actual</label> <label class="col-sm-4 control-label">Função Actual</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input ng-model="editing.ficha.trabalhador_funcao_actual" type="text" class="form-control" /> <input ng-model="editing.ficha.trabalhador_funcao_actual" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
</div> </div>
@ -265,7 +264,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">Local/Posto de Trabalho</label> <label class="col-sm-2 control-label">Local/Posto de Trabalho</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input ng-model="editing.ficha.trabalhador_posto" type="text" class="form-control" /> <input ng-model="editing.ficha.trabalhador_posto" type="text" class="form-control" readonly/>
</div> </div>
</div> </div>
</div> </div>
@ -771,7 +770,7 @@
<input ng-model="item.acidente" type="text" class="form-control" /> <input ng-model="item.acidente" type="text" class="form-control" />
</td> </td>
<td> <td>
<input ng-model="item.data" value="{{item.data}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="item.data" value="{{item.data}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</td> </td>
<td> <td>
<input ng-model="item.lesao_corporal" type="text" class="form-control" /> <input ng-model="item.lesao_corporal" type="text" class="form-control" />
@ -829,13 +828,13 @@
<input ng-model="item.suspeitada" type="text" class="form-control" /> <input ng-model="item.suspeitada" type="text" class="form-control" />
</td> </td>
<td> <td>
<input ng-model="item.data_suspeita" value="{{item.data_suspeita}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="item.data_suspeita" value="{{item.data_suspeita}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</td> </td>
<td> <td>
<input ng-model="item.declarada" type="text" class="form-control" /> <input ng-model="item.declarada" type="text" class="form-control" />
</td> </td>
<td> <td>
<input ng-model="item.data_declaracao" value="{{item.data_declaracao}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="item.data_declaracao" value="{{item.data_declaracao}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</td> </td>
<td> <td>
<button ng-click="gridRemoveItem($index, editing.antecentesOcupacionaisDoencasProfissionais)" type="button" class="btn btn-danger btn-xs"> <button ng-click="gridRemoveItem($index, editing.antecentesOcupacionaisDoencasProfissionais)" type="button" class="btn btn-danger btn-xs">
@ -3442,7 +3441,7 @@
<label class="control-label">Data</label> <label class="control-label">Data</label>
</div> </div>
<div class="col-md-10"> <div class="col-md-10">
<input ng-model="editing.esquemaVacinal.antitetanica_data" value="{{editing.esquemaVacinal.antitetanica_data}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.esquemaVacinal.antitetanica_data" value="{{editing.esquemaVacinal.antitetanica_data}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</div> </div>
</div> </div>
</div> </div>
@ -3461,7 +3460,7 @@
<label class="control-label">Data</label> <label class="control-label">Data</label>
</div> </div>
<div class="col-md-10"> <div class="col-md-10">
<input ng-model="editing.esquemaVacinal.antihepatiteb_data" value="{{editing.esquemaVacinal.antihepatiteb_data}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.esquemaVacinal.antihepatiteb_data" value="{{editing.esquemaVacinal.antihepatiteb_data}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</div> </div>
</div> </div>
</div> </div>
@ -3480,7 +3479,7 @@
<label class="control-label">Data</label> <label class="control-label">Data</label>
</div> </div>
<div class="col-md-10"> <div class="col-md-10">
<input ng-model="editing.esquemaVacinal.bcg_data" value="{{editing.esquemaVacinal.bcg_data}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.esquemaVacinal.bcg_data" value="{{editing.esquemaVacinal.bcg_data}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</div> </div>
</div> </div>
</div> </div>
@ -3500,7 +3499,7 @@
<label class="control-label">Data</label> <label class="control-label">Data</label>
</div> </div>
<div class="col-md-10"> <div class="col-md-10">
<input ng-model="editing.esquemaVacinal.rastreios_tuberculose_data" value="{{editing.esquemaVacinal.rastreios_tuberculose_data}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.esquemaVacinal.rastreios_tuberculose_data" value="{{editing.esquemaVacinal.rastreios_tuberculose_data}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</div> </div>
</div> </div>
</div> </div>
@ -3683,35 +3682,19 @@
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
<input ng-model="editing.conclusoesResumo.data_exame" value="{{editing.conclusoesResumo.data_exame}}" data-regexp="^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$" type="text" class="form-control" datepicker /> <input ng-model="editing.conclusoesResumo.data_exame" value="{{editing.conclusoesResumo.data_exame}}" data-regexp="^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$" type="text" class="form-control" datepicker />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<h4 class="section-title" id="H16">18 - Médico</h4>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Nº de Cédula Profissional</label>
<div class="col-sm-10">
<input type="text" class="form-control" />
</div>
</div>
</div>
</div>
</div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-12">
<button ng-click="save()" type="button" class="btn btn-block btn-primary">Gravar</button> <button ng-click="save()" type="button" class="btn btn-primary col-md-2 m-r-5 m-b-5">Gravar</button>
<button ng-click="save()" type="button" class="btn btn-success col-md-2 m-b-5">Concluir</button>
</div> </div>
</div> </div>

@ -83,7 +83,8 @@
//set user session //set user session
$rootScope.UserSession = { $rootScope.UserSession = {
userName: args.response.data userName: args.response.data,
tiposFichas: globals.staticData.tiposFichas//TODO: this one needs to come from database
}; };
// go to the default module and/or landing page // go to the default module and/or landing page
@ -394,16 +395,15 @@
if(result) if(result)
{ {
$scope.storeUserSession.broadcastEvents = false; $rootScope.$broadcast('loadingStatusActive');
$scope.storeUserSession.destroy(null, function(response){ $scope.storeUserSession.destroy(null, function(response){
$scope.storeUserSession.broadcastEvents = true; $rootScope.$broadcast('loadingStatusInactive');
if(response.success) if(response.success)
{ {
//TODO: cleanup the whole application ??? $scope.clearSession();
$rootScope.UserSession = null;
$scope.loadModule({Controller: 'Login'}, function(className, scope, isNewModule){ $scope.loadModule({Controller: 'Login'}, function(className, scope, isNewModule){
@ -419,6 +419,22 @@
}); });
}; };
// cleanup all session objects
$scope.clearSession = function(){
$rootScope.UserSession = null;
$scope.currentModuleName = null;
$scope.loadedModules = [];
$scope.currentModule = null;
divTemp.empty();
$('#main-panel').empty();
};
$rootScope.$on('loadingStatusActive', function(event, args){ $rootScope.$on('loadingStatusActive', function(event, args){
$('body').modalmanager('loading'); $('body').modalmanager('loading');

@ -55,8 +55,9 @@
$scope.dadosTrabalhador = null; $scope.dadosTrabalhador = null;
$scope.storeFichasTrabalhador.items = []; $scope.storeFichasTrabalhador.items = [];
//$scope.comboEstabelecimentos.clear(); $scope.comboEmpresas.setValue(null);
//$scope.comboTrabalhadores.clear(); $scope.comboEstabelecimentos.clear();
$scope.comboTrabalhadores.clear();
}; };
$scope.onEmpresaChange = function(selectedValue, selectedRecord){ $scope.onEmpresaChange = function(selectedValue, selectedRecord){
@ -75,6 +76,7 @@
$scope.onEstabelecimentoChange = function(selectedValue, selectedRecord){ $scope.onEstabelecimentoChange = function(selectedValue, selectedRecord){
$scope.comboTrabalhadores.setValue(null);
$scope.comboTrabalhadores.clear(); $scope.comboTrabalhadores.clear();
$scope.comboTrabalhadores.store.extraParams = { $scope.comboTrabalhadores.store.extraParams = {

@ -83,7 +83,13 @@
</div> </div>
<table class="table table-striped table-hover" data-store="storeFichasTrabalhador" datatable> <div class="row">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<h4 class="section-title">Fichas</h4>
<table class="table table-hover table-striped" data-store="storeFichasTrabalhador" datatable>
<thead> <thead>
<tr> <tr>
<th class="col-md-3 hidden-xs">Data</th> <th class="col-md-3 hidden-xs">Data</th>
@ -93,7 +99,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="item in storeFichasTrabalhador.items" ng-click="edit(item)"> <tr ng-repeat="item in storeFichasTrabalhador.items">
<td class="hidden-xs"><span ng-bind="item.data"></span></td> <td class="hidden-xs"><span ng-bind="item.data"></span></td>
<td class="hidden-xs"><span ng-bind="item.tipo"></span></td> <td class="hidden-xs"><span ng-bind="item.tipo"></span></td>
<td><span ng-bind="item.responsavel"></span></td> <td><span ng-bind="item.responsavel"></span></td>
@ -106,13 +112,19 @@
</tbody> </tbody>
</table> </table>
</div>
</div>
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group"> <div class="form-group m-t-15">
<div class="col-sm-12"> <label class="col-sm-2 control-label"><span ng-show="dadosTrabalhador != null">Nova Ficha</span></label>
<button ng-show="dadosTrabalhador != null" ng-click="add()" type="button" class="btn btn-sm btn-success"> <div class="col-sm-10">
<span class="glyphicon glyphicon-plus"></span> Novo
<button ng-show="dadosTrabalhador != null" ng-click="add(item)" ng-repeat="item in UserSession.tiposFichas" type="button" class="btn btn-sm btn-default m-r-5 m-b-5">
{{item.descricao}}
</button> </button>
</div> </div>
</div> </div>
@ -123,8 +135,6 @@
</form> </form>
</section> </section>

@ -93,14 +93,41 @@ evoapp.directive('customCombo', function() {
$scope.setValue = function(newValue){ $scope.setValue = function(newValue){
//$scope.$apply(function () { var option = $scope.domEl.find('option[value=' + newValue + ']');
// $scope.selectedValue = newValue; if(option.length > 0)
//}); {
var record = angular.element(option[0]).scope();
if(record)
{
$($scope.domEl).val(newValue);
$($scope.domEl).select2(
'val', newValue
);
//TODO: this might throw an exception - recheck it please
if($scope.bindToModel === 'true')
{
$scope.selectedValue = newValue; $scope.selectedValue = newValue;
$scope.selectedRecord = record.item;
}
$scope.onChange({
selectedValue: newValue,
selectedRecord: record.item
});
$($scope.domEl).select2('data', newValue); $scope.domEl.blur();
}
}
else
{
$($scope.domEl).val(newValue);
$($scope.domEl).select2(
'val', newValue
);
}
}; };
$scope.loadData = function(data){ $scope.loadData = function(data){
@ -115,11 +142,10 @@ evoapp.directive('customCombo', function() {
$scope.clear = function(){ $scope.clear = function(){
$timeout(function () {
$scope.store.items = []; $scope.store.items = [];
$($scope.domEl).select2('data', null); $scope.domEl.select2('data', null);
});
$scope.domEl.find('option').remove();
}; };
}, },
link: function (scope, elem, attrs, controller) { link: function (scope, elem, attrs, controller) {
@ -133,8 +159,9 @@ evoapp.directive('customCombo', function() {
scope.domEl.attr('name', scope.name); scope.domEl.attr('name', scope.name);
$(scope.domEl).select2({ $(scope.domEl).select2({
allowClear: true allowClear: true,
}).on("change", function(e) { selectOnBlur: true
}).on('change', function(e) {
var record = angular.element($(this).find("option:selected")).scope(); var record = angular.element($(this).find("option:selected")).scope();

@ -19,7 +19,7 @@
if(scope.firstLoad) if(scope.firstLoad)
{ {
scope.domEl.hide(); //scope.domEl.hide();
} }
scope.rows = []; scope.rows = [];
@ -42,7 +42,7 @@
if(newVal.length > 0) if(newVal.length > 0)
{ {
//scope.noRecordsEl.hide(); //scope.noRecordsEl.hide();
scope.domEl.show(); //scope.domEl.show();
scope.renderTable(); scope.renderTable();
} }
@ -51,7 +51,7 @@
{ {
//scope.noRecordsEl.insertAfter(scope.domEl); //scope.noRecordsEl.insertAfter(scope.domEl);
scope.domEl.hide(); //scope.domEl.hide();
//scope.noRecordsEl.show(); //scope.noRecordsEl.show();
} }
}); });

@ -14,8 +14,7 @@ evoapp.directive('datepicker', function($timeout, $filter, globals) {
options = {}; options = {};
return { return {
restrict: 'A', require:'?ngModel',
require: '?ngModel',
link : function (scope, element, attrs, controller) { link : function (scope, element, attrs, controller) {
//convert angularjs formats to jquery format //convert angularjs formats to jquery format
@ -28,6 +27,34 @@ evoapp.directive('datepicker', function($timeout, $filter, globals) {
if (controller) { if (controller) {
controller.$formatters.push(function(value) {
if (angular.isString(value) ) {
return jQuery.datepicker.parseDate(dateFormat, value);
}
return null;
});
controller.$parsers.push(function(value){
if (value) {
return jQuery.datepicker.formatDate(dateFormat, value);
}
return null;
});
//http://jsfiddle.net/FVfSL/
//// Default to ISO formatting
//controller.$formatters.push(function(value) {
// if (angular.isString(value) ) {
// return new Date(value);
// }
// return null;
//});
//controller.$parsers.push(function(value){
// if (value) {
// return value.toISOString();
// }
// return null;
//});
controller.$render = function () { controller.$render = function () {
var date = controller.$viewValue; var date = controller.$viewValue;
@ -51,8 +78,8 @@ evoapp.directive('datepicker', function($timeout, $filter, globals) {
firstDay: 1, firstDay: 1,
timeFormat: showTime ? timeFormat : '',//HH:mm timeFormat: showTime ? timeFormat : '',
dateFormat: dateFormat,//dd-mm-yy dateFormat: dateFormat,
stepHour: 1, stepHour: 1,
stepMinute: 5, stepMinute: 5,
@ -140,3 +167,7 @@ evoapp.directive('datepicker', function($timeout, $filter, globals) {
} }
} }
}); });

@ -1,4 +1,4 @@
 evoapp.factory('globals', function($rootScope, plugins, utils, message, settings, dataService, modelService) {  evoapp.factory('globals', function($rootScope, plugins, utils, message, settings, dataService, modelService, staticData) {
var me = this; var me = this;
@ -8,6 +8,7 @@
message: message, message: message,
settings: settings.settings, settings: settings.settings,
dataService: dataService, dataService: dataService,
modelService: modelService modelService: modelService,
staticData: staticData
}; };
}); });

@ -57,8 +57,23 @@ evoapp.factory('message', function($rootScope) {
}); });
}; };
var custom = function(){
var me = this;
var message = arguments[0].message,
title = arguments[0].title,
buttons = arguments[0].buttons;
bootbox.dialog({
message: message,
buttons: buttons
});
};
return { return {
confirm: confirm, confirm: confirm,
alert: alert alert: alert,
custom: custom
}; };
}); });

@ -4,11 +4,11 @@
me.settings = { me.settings = {
//globals.settings.dateFormat //globals.settings.dateFormat: dd-MM-yyyy | yyyy-MM-dd
dateFormat: 'dd-MM-yyyy', dateFormat: 'yyyy-MM-dd',
//globals.settings.dateTimeFormat //globals.settings.dateTimeFormat
dateTimeFormat: 'dd-MM-yyyy HH:mm:ss', dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
//globals.settings.timeFormat //globals.settings.timeFormat
timeFormat: 'H:i', timeFormat: 'H:i',
@ -18,7 +18,7 @@
//YYYY-MM-DD: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/ //YYYY-MM-DD: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/
//DD-MM-YYYY: /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/ //DD-MM-YYYY: /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/
Date: /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/ Date: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/
} }
}; };

@ -10,7 +10,35 @@
WARNING: 'WARNING' WARNING: 'WARNING'
}; };
var tiposFichas = [
{
id: 1,
descricao: 'Admissão'
},
{
id: 2,
descricao: 'Periódica Inicial'
},
{
id: 3,
descricao: 'Periódica'
},
{
id: 7,
descricao: 'Ocasional'
},
{
id: 8,
descricao: 'Enfermagem'
},
{
id: 9,
descricao: 'Medicina Curativa'
}
];
return { return {
exceptions: exceptions exceptions: exceptions,
tiposFichas: tiposFichas
}; };
}); });

@ -183,6 +183,10 @@ code {
{ {
margin-right:5px; margin-right:5px;
} }
.m-r-10
{
margin-right:10px;
}
.m-t-none .m-t-none
{ {
margin-top:0px; margin-top:0px;
@ -192,7 +196,14 @@ code {
{ {
margin-bottom:0px; margin-bottom:0px;
} }
.m-b-5
{
margin-bottom:5px;
}
.m-b-10
{
margin-bottom:10px;
}
.p-10 .p-10
{ {
padding:10px; padding:10px;
@ -263,3 +274,12 @@ body.modal-open {
filter: alpha(opacity=70); filter: alpha(opacity=70);
background: transparent!important; background: transparent!important;
} }
.modal-footer {
text-align: left;
}
.navbar-brand
{
cursor:text;
}

@ -53,11 +53,13 @@
<script src="app/services/Plugins.js"></script> <script src="app/services/Plugins.js"></script>
<script src="app/services/Utils.js"></script> <script src="app/services/Utils.js"></script>
<script src="app/services/Message.js"></script> <script src="app/services/Message.js"></script>
<script src="app/services/StaticData.js"></script>
<script src="app/directives/datepicker.js"></script> <script src="app/directives/datepicker.js"></script>
<script src="app/directives/inlineAlert.js"></script> <script src="app/directives/inlineAlert.js"></script>
<script src="app/directives/customCombo.js"></script> <script src="app/directives/customCombo.js"></script>
<script src="app/directives/datatable.js"></script> <script src="app/directives/datatable.js"></script>
<script src="app/directives/modalWindow.js"></script>
<script src="app/Main/MainController.js"></script> <script src="app/Main/MainController.js"></script>
<script src="app/Login/LoginController.js"></script> <script src="app/Login/LoginController.js"></script>
@ -78,9 +80,12 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a ng-click="UserSession != null ? loadModule({Controller: 'Search'}) : void();" class="navbar-brand" href=""> <a class="navbar-brand" href="">
<img src="img/siprplogo_site.png" alt="" /> <img src="img/siprplogo_site.png" alt="" />
</a> </a>
<!-- <a ng-click="UserSession != null ? loadModule({Controller: 'Search'}) : void();" class="navbar-brand" href="">
<img src="img/siprplogo_site.png" alt="" />
</a>-->
</div> </div>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">

@ -49,11 +49,11 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
user-select: none; user-select: none;
background-color: #fff; background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff)); /*background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%); background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%); background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);*/
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(to top, #eee 0%, #fff 50%); /*background-image: linear-gradient(to top, #eee 0%, #fff 50%);*/
} }
.select2-container.select2-drop-above .select2-choice { .select2-container.select2-drop-above .select2-choice {
@ -188,12 +188,12 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
background-clip: padding-box; background-clip: padding-box;
background: #ccc; /*background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
background-image: linear-gradient(to top, #ccc 0%, #eee 60%); background-image: linear-gradient(to top, #ccc 0%, #eee 60%);*/
} }
.select2-container .select2-choice .select2-arrow b { .select2-container .select2-choice .select2-arrow b {

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save