programaEdit.html 8.83 KB
<div id="editPrograma" class="page-content clearfix" ng-controller="ProgramaController">
	<div class="bar-buttons-action fixed">
		<div class="row">
			<div class="col-sm-8 text-left">
				<button title="{{$translate.instant('LABEL.SALVAR')}}" alt="{{$translate.instant('LABEL.SALVAR')}}" class="btn btn-clear"
					ng-click="saveOrUpdate()" ng-show="edit">
					<i class="fa fa-save green"></i>
					<translate>LABEL.SALVAR</translate>
				</button>

				<button title="{{$translate.instant('LABEL.LIMPAR')}}" alt="{{$translate.instant('LABEL.LIMPAR')}}" class="btn btn-clear"
					ng-click="resetForm();" ng-show="programa.id === undefined">
					<i class="fa fa-eraser yellow-dark"></i>
					<translate>LABEL.LIMPAR</translate>
				</button>

				<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;">
					<i class="fa fa-pencil blue"></i>
					<translate>LABEL.EDITAR</translate>
				</button>

				<button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear"
					ng-click="remove(programa);" ng-show="programa.id !== undefined">
					<i class="fa fa-times red"></i>
					<translate>LABEL.REMOVER</translate>
				</button>

				<button title="{{$translate.instant('LABEL.PESQUISAR')}}" alt="{{$translate.instant('LABEL.PESQUISAR')}}"
					class="btn btn-clear" ng-click="$showPageSearchWorkspace(workspace); atualizaPaginaPesquisa();">
					<i class="fa fa-search"></i>
					<translate>LABEL.PESQUISAR</translate>
				</button>
			</div>
			<!-- .col -->

			<div class="col-sm-4 text-right">
				<favorito />

				<button title="{{$translate.instant('LABEL.AJUDA')}}" alt="{{$translate.instant('LABEL.AJUDA')}}" class="btn btn-clear">
					<i class="fa fa-life-ring"></i>
					<translate>LABEL.AJUDA</translate>
				</button>
			</div>
			<!-- .col -->
		</div>
		<!-- .row -->
	</div>
	<!-- .bar-buttons-action -->

	<breadcrumb ng-workspace="workspace"></breadcrumb>

	<form name="programaForm" novalidate autocomplete="off">
		<p>
			<small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small>
		</p>
		
		<fieldset>
			<legend>
				<translate>LABEL.INFORMACOES_PROGRAMA</translate>
			</legend>
			
			<div class="row">
				<div class="col-sm-3">
					<label-input-number ng-id="programa.anoExercicio" ng-label="CONTRATOS.LABEL.ANO_EXERCICIO" ng-model="programa.anoExercicio" 
						form="programaForm" ng-obrigatorio="false" ng-disabled="!edit" ng-custom-maxlength="4" />
				
					<!-- 
	                <label-input-data ng-id="programa.anoExercicio" ng-label="CONTRATOS.LABEL.ANO_EXERCICIO" ng-model="programa.anoExercicio"
						form="programaForm" ng-obrigatorio="false" ng-disabled="!edit" ng-mode="year" ng-format="yyyy" />
					 -->
				</div>
				<div class="col-sm-3"> 
					<label-select ng-id="programa.dominioTipoPrograma" ng-label="CONTRATOS.LABEL.TIPO_PROGRAMA" ng-model="programa.dominioTipoPrograma" 
						form="programaForm" ng-obrigatorio="true" ng-disabled="!edit" ng-custom-options="tipoPrograma.originalElement as tipoPrograma.descricao for tipoPrograma" track-by="track by tipoPrograma.id" ng-list="listaTiposProgramas" />
	
						<option value="">Selecione</option>
					</select>
				</div>
				<!-- .col -->
			</div>
			<div class="row">
				<div class="col-sm-3">
					<label-input-number ng-id="programa.codigo" ng-label="CONTRATOS.LABEL.CODIGO_PROGRAMA" ng-model="programa.codigo" 
						form="programaForm" ng-obrigatorio="true" ng-disabled="!edit" ng-custom-maxlength="4" />
				</div>
				<div class="col-sm-9">
					<label-input ng-type="text" ng-id="programa.nome" ng-label="CONTRATOS.LABEL.NOME_PROGRAMA" ng-model="programa.nome" 
						form="programaForm" ng-obrigatorio="true" ng-disabled="!edit" ng-custom-maxlength="150" />
				</div>
				<!-- .col -->
			</div>
			<!-- row -->

		</fieldset>
	</form>

	<form name="programaAcaoForm" novalidate autocomplete="off">
		<fieldset>
			<legend>
				<label ng-class="{'has-error' : programaForm.$submitted && programa.acoes && programa.acoes.length < 1}">
					<translate>LABEL.ACOES_PROGRAMA</translate>
					<span class='red'>*</span>
					<i ng-show="programaForm.$submitted && programa.acoes && programa.acoes.length < 1" class='fa fa-warning red' tooltip="{{$translate.instant('LABEL.ACOES_PROGRAMA') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i>
				</label>
			</legend>

			<script type="text/ng-template" id="modal-programa-acao.html">
				<div ng-include src="'/cit-contratos-web/html/programa/dialog_programa_acao.html'" />
			</script>

			<div class="row margin-top">
				<div class="col-sm-12">
					<div class="panel panel-default">
						<div class="panel-heading clearfix col-sm-12 text-left">
							
							<div class="col-sm-1" tooltip="{{ !edit ? $translate.instant('PORTAL.MSG.ADICIONAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}">
								<button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" type="button" 
									ng-disabled="!edit" ng-click="openModalProgramaAcao();">
									<i class="fa fa-plus-circle yellow-dark"></i>
									<translate>LABEL.ADICIONAR</translate> </a>
								</button>
							</div>

							<div class="col-sm-1" tooltip="{{ listaSize == 0 ? $translate.instant('PORTAL.MSG.VISUALIZAR_SELECIONE_ITEM') : listaSize > 1 ? $translate.instant('PORTAL.MSG.VISUALIZAR_DISABLED_SELECIONADOS') : '' }}">
								<button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" 
									ng-disabled="listaSize != 1" ng-click="editAcao(false)">
									<i class="fa fa-search blue"></i>
									<translate>LABEL.VISUALIZAR</translate>
								</button>
							</div>
	
							<div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EDITAR_SELECIONE_ITEM') : listaSize > 1 && edit ? $translate.instant('PORTAL.MSG.EDITAR_DISABLED_SELECIONADOS') : !edit ? $translate.instant('PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}">
								<button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" type="button" 
									ng-disabled="listaSize != 1 || !edit" ng-click="editAcao(true)" >
									<i class="fa fa-pencil blue"></i>
									<translate>LABEL.EDITAR</translate>
								</button>
							</div>
							
							<div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EXCLUIR_SELECIONE_ITEM') : !edit ? $translate.instant('PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}">
								<button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" 
									ng-disabled="listaSize == 0 || !edit" ng-click="excluirAcoesSelecionados()">
									<i class="fa fa-times red"></i>
									<translate>LABEL.REMOVER</translate>
								</button>
							</div>
							
						</div>
	
						<table class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th class="text-center" style="width: 5%;">
										<input type="checkbox" ng-model="selectedAll" ng-checked="selectedAll" ng-click="checkAll(selectedAll);" />
									</th>
									<th class="text-center" style="width: 15%;">
										<translate>CONTRATOS.LABEL.CODIGO_ACAO</translate>
									</th>
									<th class="text-center" style="width: 25%;">
										<translate>CONTRATOS.LABEL.NOME_ACAO</translate>
									</th>
									<th class="text-center" style="width: 30%;">
										<translate>CONTRATOS.LABEL.DESCRICAO_ACAO</translate>
									</th>
									<th class="text-center" style="width: 25%;">
										<translate>CONTRATOS.LABEL.BASE_LEGAL</translate>
									</th>
								</tr>
							</thead>
							<tbody>
								<tr ng-repeat="acao in programa.acoes" ng-show="programa.acoes.length > 0">
									<td class="text-center">
										<input type="checkbox" ng-click="acao.$index = $index; atualizarListaSizeSelect()" ng-checked="acao.$selected" ng-model="acao.$selected"/>
									</td>
									<td class="text-center">
										{{ acao.codigo }}
									</td>
									<td class="text-justify" title="{{acao.nome}}">
										{{ splitText(acao.nome, 75) }}
									</td>
									<td class="text-justify" title="{{acao.descricao}}">
										{{ splitText(acao.descricao, 85) }}
									</td>
									<td class="text-center" title="{{acao.baseLegal}}">
										{{ splitText(acao.baseLegal, 70) }}
									</td>
								</tr>
								
								<tr ng-hide="programa.acoes.length != 0">
									<td colspan="5">
										<translate>LABEL.TABELA_VAZIA</translate>
									</td>
								</tr>
								
							</tbody>
						</table>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
<!-- .page-content -->